diff options
author | Diegoisawesome <diego@domoreaweso.me> | 2018-12-25 15:03:13 -0600 |
---|---|---|
committer | Diegoisawesome <diego@domoreaweso.me> | 2018-12-25 15:03:13 -0600 |
commit | d8948a5cda2e385c1d4b5c6190c4fe0fb53359fb (patch) | |
tree | fa882b0733f88cc17dcbaef8c25c30c7198bdca1 /src | |
parent | dea41e1a7e6e73789431153d6c28dac3a3a73ac6 (diff) | |
parent | a54aa03d20dacc88879404b87a5f6a7eb7babc54 (diff) |
Merge remote-tracking branch 'pret/master' into trade
Diffstat (limited to 'src')
133 files changed, 35865 insertions, 7027 deletions
diff --git a/src/battle_anim.c b/src/battle_anim.c index 88c548208..d1550f31e 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -1605,8 +1605,8 @@ static void ScriptCmd_loadspritegfx(void) sBattleAnimScriptPtr++; index = T1_READ_16(sBattleAnimScriptPtr); - LoadCompressedObjectPicUsingHeap(&gBattleAnimPicTable[GET_TRUE_SPRITE_INDEX(index)]); - LoadCompressedObjectPaletteUsingHeap(&gBattleAnimPaletteTable[GET_TRUE_SPRITE_INDEX(index)]); + LoadCompressedSpriteSheetUsingHeap(&gBattleAnimPicTable[GET_TRUE_SPRITE_INDEX(index)]); + LoadCompressedSpritePaletteUsingHeap(&gBattleAnimPaletteTable[GET_TRUE_SPRITE_INDEX(index)]); sBattleAnimScriptPtr += 2; AddSpriteIndex(GET_TRUE_SPRITE_INDEX(index)); gAnimFramesToWait = 1; @@ -1671,7 +1671,11 @@ static void ScriptCmd_createsprite(void) if (subpriority < 3) subpriority = 3; - CreateSpriteAndAnimate(template, GetBattlerSpriteCoord(gBattleAnimTarget, 2), GetBattlerSpriteCoord(gBattleAnimTarget, 3), subpriority); + CreateSpriteAndAnimate( + template, + GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2), + GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET), + subpriority); gAnimVisualTaskCount++; } @@ -1866,7 +1870,7 @@ static void ScriptCmd_monbg(void) else toBG_2 = TRUE; - sub_80A438C(battlerId, toBG_2, FALSE); + MoveBattlerSpriteToBG(battlerId, toBG_2, FALSE); taskId = CreateTask(sub_80A40F4, 10); gAnimVisualTaskCount++; gTasks[taskId].data[t1_MONBG_BATTLER] = battlerId; @@ -1885,7 +1889,7 @@ static void ScriptCmd_monbg(void) else toBG_2 = TRUE; - sub_80A438C(battlerId, toBG_2, FALSE); + MoveBattlerSpriteToBG(battlerId, toBG_2, FALSE); taskId = CreateTask(sub_80A40F4, 10); gAnimVisualTaskCount++; gTasks[taskId].data[0] = battlerId; @@ -1918,7 +1922,7 @@ bool8 IsBattlerSpriteVisible(u8 battlerId) return FALSE; } -void sub_80A438C(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible) +void MoveBattlerSpriteToBG(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible) { struct UnknownAnimStruct2 unknownStruct; u8 battlerSpriteId; @@ -2190,7 +2194,7 @@ static void ScriptCmd_monbg_22(void) else toBG_2 = TRUE; - sub_80A438C(battlerId, toBG_2, FALSE); + MoveBattlerSpriteToBG(battlerId, toBG_2, FALSE); } battlerId ^= BIT_FLANK; @@ -2202,7 +2206,7 @@ static void ScriptCmd_monbg_22(void) else toBG_2 = TRUE; - sub_80A438C(battlerId, toBG_2, FALSE); + MoveBattlerSpriteToBG(battlerId, toBG_2, FALSE); } sBattleAnimScriptPtr++; @@ -3029,12 +3033,12 @@ static void ScriptCmd_doublebattle_2D(void) { if (wantedBattler == ANIM_ATTACKER) { - r4 = sub_80A8364(gBattleAnimAttacker); + r4 = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker); spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); } else { - r4 = sub_80A8364(gBattleAnimTarget); + r4 = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget); spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); } if (spriteId != 0xFF) @@ -3064,12 +3068,12 @@ static void ScriptCmd_doublebattle_2E(void) { if (wantedBattler == ANIM_ATTACKER) { - r4 = sub_80A8364(gBattleAnimAttacker); + r4 = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker); spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); } else { - r4 = sub_80A8364(gBattleAnimTarget); + r4 = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget); spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); } diff --git a/src/battle_anim_80A5C6C.c b/src/battle_anim_80A5C6C.c index 910845c69..f85104bc7 100644 --- a/src/battle_anim_80A5C6C.c +++ b/src/battle_anim_80A5C6C.c @@ -568,7 +568,7 @@ void TranslateSpriteOverDuration(struct Sprite *sprite) } } -void TranslateAnimLinearSimple(struct Sprite *sprite) +void AnimTranslateLinearSimple(struct Sprite *sprite) { if (sprite->data[0] > 0) { @@ -716,7 +716,9 @@ void SetSpriteCoordsToAnimAttackerCoords(struct Sprite *sprite) sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); } -void sub_80A6864(struct Sprite *sprite, s16 xOffset) +// Sets the initial x offset of the anim sprite depending on the horizontal orientation +// of the two involved mons. +void SetAnimSpriteInitialXOffset(struct Sprite *sprite, s16 xOffset) { u16 attackerX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); u16 targetX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); @@ -749,7 +751,7 @@ void InitAnimArcTranslation(struct Sprite *sprite) bool8 TranslateAnimArc(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) return TRUE; sprite->data[7] += sprite->data[6]; sprite->pos2.y += Sin((u8)(sprite->data[7] >> 8), sprite->data[5]); @@ -758,7 +760,7 @@ bool8 TranslateAnimArc(struct Sprite *sprite) bool8 sub_80A6934(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) return TRUE; sprite->data[7] += sprite->data[6]; sprite->pos2.x += Sin((u8)(sprite->data[7] >> 8), sprite->data[5]); @@ -773,18 +775,20 @@ void oamt_add_pos2_onto_pos1(struct Sprite *sprite) sprite->pos2.y = 0; } -void sub_80A6980(struct Sprite *sprite, bool8 a2) +void InitSpritePosToAnimTarget(struct Sprite *sprite, bool8 respectMonPicOffsets) { - if (!a2) + // Battle anim sprites are automatically created at the anim target's center, which + // is why there is no else clause for the "respectMonPicOffsets" check. + if (!respectMonPicOffsets) { sprite->pos1.x = GetBattlerSpriteCoord2(gBattleAnimTarget, BATTLER_COORD_X); sprite->pos1.y = GetBattlerSpriteCoord2(gBattleAnimTarget, BATTLER_COORD_Y); } - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; } -void InitAnimSpritePos(struct Sprite *sprite, u8 respectMonPicOffsets) +void InitSpritePosToAnimAttacker(struct Sprite *sprite, bool8 respectMonPicOffsets) { if (!respectMonPicOffsets) { @@ -796,7 +800,7 @@ void InitAnimSpritePos(struct Sprite *sprite, u8 respectMonPicOffsets) sprite->pos1.x = GetBattlerSpriteCoord2(gBattleAnimAttacker, BATTLER_COORD_X_2); sprite->pos1.y = GetBattlerSpriteCoord2(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); } - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; } @@ -917,7 +921,7 @@ void sub_80A6BFC(struct UnknownAnimStruct2 *unk, u8 unused) unk->tilesOffset = 0; unk->unkC = 0; } - else if (sub_80A8364(gBattleAnimAttacker) == 1) + else if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) { unk->unk8 = 8; unk->bgId = 1; @@ -1058,7 +1062,7 @@ void sub_80A6F14(struct Sprite *sprite) sprite->callback(sprite); } -bool8 TranslateAnimLinear(struct Sprite *sprite) +bool8 AnimTranslateLinear(struct Sprite *sprite) { u16 v1, v2, x, y; @@ -1090,14 +1094,14 @@ bool8 TranslateAnimLinear(struct Sprite *sprite) void sub_80A6F98(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) SetCallbackToStoredInData6(sprite); } void sub_80A6FB4(struct Sprite *sprite) { sub_8039E9C(sprite); - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) SetCallbackToStoredInData6(sprite); } @@ -1117,14 +1121,14 @@ void sub_80A7000(struct Sprite *sprite) sprite->callback(sprite); } -void sub_80A7028(struct Sprite *sprite) +static void InitAnimFastLinearTranslation(struct Sprite *sprite) { - int x = sprite->data[2] - sprite->data[1]; - int y = sprite->data[4] - sprite->data[3]; - bool8 x_sign = x < 0; - bool8 y_sign = y < 0; - u16 x2 = abs(x) << 4; - u16 y2 = abs(y) << 4; + int xDiff = sprite->data[2] - sprite->data[1]; + int yDiff = sprite->data[4] - sprite->data[3]; + bool8 x_sign = xDiff < 0; + bool8 y_sign = yDiff < 0; + u16 x2 = abs(xDiff) << 4; + u16 y2 = abs(yDiff) << 4; x2 /= sprite->data[0]; y2 /= sprite->data[0]; @@ -1145,16 +1149,16 @@ void sub_80A7028(struct Sprite *sprite) sprite->data[3] = 0; } -void sub_80A70C0(struct Sprite *sprite) +void InitAndRunAnimFastLinearTranslation(struct Sprite *sprite) { sprite->data[1] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; - sub_80A7028(sprite); + InitAnimFastLinearTranslation(sprite); sprite->callback = sub_80A7144; sprite->callback(sprite); } -bool8 sub_80A70E8(struct Sprite *sprite) +bool8 AnimFastTranslateLinear(struct Sprite *sprite) { u16 v1, v2, x, y; @@ -1186,22 +1190,22 @@ bool8 sub_80A70E8(struct Sprite *sprite) void sub_80A7144(struct Sprite *sprite) { - if (sub_80A70E8(sprite)) + if (AnimFastTranslateLinear(sprite)) SetCallbackToStoredInData6(sprite); } -void sub_80A7160(struct Sprite *sprite) +void InitAnimFastLinearTranslationWithSpeed(struct Sprite *sprite) { - int v1 = abs(sprite->data[2] - sprite->data[1]) << 4; - sprite->data[0] = v1 / sprite->data[0]; - sub_80A7028(sprite); + int xDiff = abs(sprite->data[2] - sprite->data[1]) << 4; + sprite->data[0] = xDiff / sprite->data[0]; + InitAnimFastLinearTranslation(sprite); } void sub_80A718C(struct Sprite *sprite) { sprite->data[1] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; - sub_80A7160(sprite); + InitAnimFastLinearTranslationWithSpeed(sprite); sprite->callback = sub_80A7144; sprite->callback(sprite); } @@ -1471,9 +1475,9 @@ void sub_80A77C8(struct Sprite *sprite) else var = FALSE; if (!gBattleAnimArgs[2]) - InitAnimSpritePos(sprite, var); + InitSpritePosToAnimAttacker(sprite, var); else - sub_80A6980(sprite, var); + InitSpritePosToAnimTarget(sprite, var); sprite->data[0]++; } @@ -1506,7 +1510,7 @@ void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite) else coordType = BATTLER_COORD_Y; - InitAnimSpritePos(sprite, v1); + InitSpritePosToAnimAttacker(sprite, v1); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; @@ -1519,7 +1523,7 @@ void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite) void sub_80A78AC(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); if (GetBattlerSide(gBattleAnimAttacker)) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[4]; @@ -1553,17 +1557,17 @@ void sub_80A7938(struct Sprite *sprite) } if (!gBattleAnimArgs[5]) { - InitAnimSpritePos(sprite, r4); + InitSpritePosToAnimAttacker(sprite, r4); battlerId = gBattleAnimAttacker; } else { - sub_80A6980(sprite, r4); + InitSpritePosToAnimTarget(sprite, r4); battlerId = gBattleAnimTarget; } if (GetBattlerSide(gBattleAnimAttacker)) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; - sub_80A6980(sprite, r4); + InitSpritePosToAnimTarget(sprite, r4); sprite->data[0] = gBattleAnimArgs[4]; sprite->data[2] = GetBattlerSpriteCoord(battlerId, BATTLER_COORD_X_2) + gBattleAnimArgs[2]; sprite->data[4] = GetBattlerSpriteCoord(battlerId, attributeId) + gBattleAnimArgs[3]; @@ -2006,7 +2010,7 @@ u8 GetBattlerSpriteSubpriority(u8 battlerId) return subpriority; } -u8 sub_80A8328(u8 battlerId) +u8 GetBattlerSpriteBGPriority(u8 battlerId) { u8 position = GetBattlerPosition(battlerId); @@ -2018,7 +2022,7 @@ u8 sub_80A8328(u8 battlerId) return GetAnimBgAttribute(1, BG_ANIM_PRIORITY); } -u8 sub_80A8364(u8 battlerId) +u8 GetBattlerSpriteBGPriorityRank(u8 battlerId) { if (!IsContest()) { @@ -2229,36 +2233,38 @@ s16 sub_80A861C(u8 battlerId, u8 a2) } } -void SetAverageBattlerPositions(u8 battlerId, bool8 a2, s16 *x, s16 *y) +void SetAverageBattlerPositions(u8 battlerId, bool8 respectMonPicOffsets, s16 *x, s16 *y) { - u8 v1, v2; - s16 v3, v4; - s16 v5, v6; + u8 xCoordType, yCoordType; + s16 battlerX, battlerY; + s16 partnerX, partnerY; - if (!a2) + if (!respectMonPicOffsets) { - v1 = 0; - v2 = 1; + xCoordType = BATTLER_COORD_X; + yCoordType = BATTLER_COORD_Y; } else { - v1 = 2; - v2 = 3; + xCoordType = BATTLER_COORD_X_2; + yCoordType = BATTLER_COORD_Y_PIC_OFFSET; } - v3 = GetBattlerSpriteCoord(battlerId, v1); - v4 = GetBattlerSpriteCoord(battlerId, v2); + + battlerX = GetBattlerSpriteCoord(battlerId, xCoordType); + battlerY = GetBattlerSpriteCoord(battlerId, yCoordType); if (IsDoubleBattle() && !IsContest()) { - v5 = GetBattlerSpriteCoord(BATTLE_PARTNER(battlerId), v1); - v6 = GetBattlerSpriteCoord(BATTLE_PARTNER(battlerId), v2); + partnerX = GetBattlerSpriteCoord(BATTLE_PARTNER(battlerId), xCoordType); + partnerY = GetBattlerSpriteCoord(BATTLE_PARTNER(battlerId), yCoordType); } else { - v5 = v3; - v6 = v4; + partnerX = battlerX; + partnerY = battlerY; } - *x = (v3 + v5) / 2; - *y = (v4 + v6) / 2; + + *x = (battlerX + partnerX) / 2; + *y = (battlerY + partnerY) / 2; } u8 sub_80A89C8(int battlerId, u8 spriteId, int species) diff --git a/src/battle_anim_80A9C70.c b/src/battle_anim_80A9C70.c index 2eea276a1..001f99d7f 100644 --- a/src/battle_anim_80A9C70.c +++ b/src/battle_anim_80A9C70.c @@ -71,8 +71,8 @@ u8 sub_80A9C70(u8 battlerId, bool8 b) u8 spriteId2; u8 i; - LoadCompressedObjectPicUsingHeap(&gBattleAnimPicTable[GET_TRUE_SPRITE_INDEX(ANIM_TAG_CIRCLE_IMPACT)]); - LoadCompressedObjectPaletteUsingHeap(&gBattleAnimPaletteTable[GET_TRUE_SPRITE_INDEX(ANIM_TAG_CIRCLE_IMPACT)]); + LoadCompressedSpriteSheetUsingHeap(&gBattleAnimPicTable[GET_TRUE_SPRITE_INDEX(ANIM_TAG_CIRCLE_IMPACT)]); + LoadCompressedSpritePaletteUsingHeap(&gBattleAnimPaletteTable[GET_TRUE_SPRITE_INDEX(ANIM_TAG_CIRCLE_IMPACT)]); gTasks[taskId].data[0] = battlerId; if (b) { diff --git a/src/battle_anim_8170478.c b/src/battle_anim_8170478.c index 34898899c..502c4cdbb 100755 --- a/src/battle_anim_8170478.c +++ b/src/battle_anim_8170478.c @@ -1376,8 +1376,8 @@ static void sub_8171D60(u8 ballId) if (GetSpriteTileStartByTag(gBallOpenParticleSpritesheets[ballId].tag) == 0xFFFF) { - LoadCompressedObjectPicUsingHeap(&gBallOpenParticleSpritesheets[ballId]); - LoadCompressedObjectPaletteUsingHeap(&gBallOpenParticlePalettes[ballId]); + LoadCompressedSpriteSheetUsingHeap(&gBallOpenParticleSpritesheets[ballId]); + LoadCompressedSpritePaletteUsingHeap(&gBallOpenParticlePalettes[ballId]); } } @@ -1971,7 +1971,7 @@ void sub_8172D98(u8 taskId) switch (gTasks[taskId].data[15]) { case 0: - if (sub_80A8364(gBattleAnimAttacker) == B_POSITION_OPPONENT_LEFT) + if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == B_POSITION_OPPONENT_LEFT) SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG1 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL); else SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG2 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL); @@ -2032,8 +2032,8 @@ void sub_8172EF0(u8 battler, struct Pokemon *mon) { if (GetSpriteTileStartByTag(0x27F9) == 0xFFFF) { - LoadCompressedObjectPicUsingHeap(&gBattleAnimPicTable[233]); - LoadCompressedObjectPaletteUsingHeap(&gBattleAnimPaletteTable[233]); + LoadCompressedSpriteSheetUsingHeap(&gBattleAnimPicTable[233]); + LoadCompressedSpritePaletteUsingHeap(&gBattleAnimPaletteTable[233]); } taskId1 = CreateTask(sub_8172FEC, 10); @@ -2173,8 +2173,8 @@ void sub_81732B0(u8 taskId) { u8 paletteIndex; - LoadCompressedObjectPicUsingHeap(&gBattleAnimPicTable[269]); - LoadCompressedObjectPaletteUsingHeap(&gBattleAnimPaletteTable[269]); + LoadCompressedSpriteSheetUsingHeap(&gBattleAnimPicTable[269]); + LoadCompressedSpritePaletteUsingHeap(&gBattleAnimPaletteTable[269]); paletteIndex = IndexOfSpritePaletteTag(0x281D); // unused DestroyAnimVisualTask(taskId); } @@ -2188,7 +2188,7 @@ void sub_81732E4(u8 taskId) static void sub_817330C(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 0); + InitSpritePosToAnimAttacker(sprite, 0); sprite->data[0] = 30; sprite->data[2] = GetBattlerSpriteCoord(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), 0) + gBattleAnimArgs[2]; sprite->data[4] = GetBattlerSpriteCoord(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), 1) + gBattleAnimArgs[3]; diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 3b1b49e34..e37d2b5b8 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -19,28 +19,28 @@ EWRAM_DATA s16 gUnknown_0203A0F8[4] = {0}; void AnimMovePowderParticle(struct Sprite *); -void sub_80FE8E0(struct Sprite *); -void sub_80FE930(struct Sprite *); -void sub_80FE988(struct Sprite *); -void sub_80FEAD8(struct Sprite *); -void sub_80FEB44(struct Sprite *); -void sub_80FED28(struct Sprite *); -void sub_80FEE78(struct Sprite *); -void sub_80FEF44(struct Sprite *); -void sub_80FEFFC(struct Sprite *); +void AnimPowerAbsorptionOrb(struct Sprite *); +void AnimSolarbeamBigOrb(struct Sprite *); +void AnimSolarbeamSmallOrb(struct Sprite *); +void AnimAbsorptionOrb(struct Sprite *); +void AnimHyperBeamOrb(struct Sprite *); +void AnimSporeParticle(struct Sprite *); +void AnimPetalDanceBigFlower(struct Sprite *); +void AnimPetalDanceSmallFlower(struct Sprite *); +void AnimRazorLeafParticle(struct Sprite *); void AnimLeechSeed(struct Sprite *); void AnimTranslateLinearSingleSineWave(struct Sprite *); void AnimMoveTwisterParticle(struct Sprite *); -void sub_80FF374(struct Sprite *); -void sub_80FF698(struct Sprite *); -void sub_80FF768(struct Sprite *); -void sub_80FF7EC(struct Sprite *); -void sub_80FF934(struct Sprite *); -void sub_80FFB18(struct Sprite *); -void sub_80FFBF4(struct Sprite *); -void sub_80FFC70(struct Sprite *); -void sub_80FFCB4(struct Sprite *); -void sub_80FFDBC(struct Sprite *); +void AnimConstrictBinding(struct Sprite *); +void AnimMimicOrb(struct Sprite *); +void AnimIngrainRoot(struct Sprite *); +void AnimFrenzyPlantRoot(struct Sprite *); +void AnimIngrainOrb(struct Sprite *); +void AnimPresent(struct Sprite *); +void AnimKnockOffItem(struct Sprite *); +void AnimPresentHealParticle(struct Sprite *); +void AnimItemSteal(struct Sprite *); +void AnimTrickBag(struct Sprite *); void sub_8100640(struct Sprite *); void sub_8100898(struct Sprite *); void sub_81009F8(struct Sprite *); @@ -79,27 +79,27 @@ void sub_8103208(struct Sprite *); void sub_8103284(struct Sprite *); void sub_8103390(struct Sprite *); static void AnimMovePowderParticleStep(struct Sprite *); -static void sub_80FE9E4(struct Sprite *); -static void sub_80FEB28(struct Sprite *); -static void sub_80FEBFC(struct Sprite *); +static void AnimSolarbeamSmallOrbStep(struct Sprite *); +static void AnimAbsorptionOrbStep(struct Sprite *); +static void AnimHyperBeamOrbStep(struct Sprite *); static void AnimLeechSeedStep(struct Sprite *); static void AnimLeechSeedSprouts(struct Sprite *); -static void sub_80FED74(struct Sprite *); -static void sub_80FEECC(struct Sprite *); -static void sub_80FEF98(struct Sprite *); -static void sub_80FF044(struct Sprite *); -static void sub_80FF090(struct Sprite *); +static void AnimSporeParticleStep(struct Sprite *); +static void AnimPetalDanceBigFlowerStep(struct Sprite *); +static void AnimPetalDanceSmallFlowerStep(struct Sprite *); +static void AnimRazorLeafParticleStep1(struct Sprite *); +static void AnimRazorLeafParticleStep2(struct Sprite *); static void AnimTranslateLinearSingleSineWaveStep(struct Sprite *); static void AnimMoveTwisterParticleStep(struct Sprite *); -static void sub_80FF3B0(struct Sprite *); -static void sub_80FF3EC(struct Sprite *); +static void AnimConstrictBindingStep1(struct Sprite *); +static void AnimConstrictBindingStep2(struct Sprite *); static void sub_80FF53C(u8); static void sub_80FF5CC(u8); -static void sub_80FFD2C(struct Sprite *); -static void sub_80FF8DC(struct Sprite *); -static void sub_80FFE58(struct Sprite *); -static void sub_80FFEC4(struct Sprite *); -static void sub_80FFF7C(struct Sprite *); +static void AnimItemStealStep(struct Sprite *); +static void AnimRootFlickerOut(struct Sprite *); +static void AnimTrickBagStep1(struct Sprite *); +static void AnimTrickBagStep2(struct Sprite *); +static void AnimTrickBagStep3(struct Sprite *); static void sub_8100128(u8); static s16 sub_8100504(struct Sprite *); static void sub_8100524(struct Task *, u8); @@ -285,7 +285,7 @@ const union AffineAnimCmd *const gUnknown_085921DC[] = { gUnknown_085921CC, }; -const struct SpriteTemplate gUnknown_085921E0 = +const struct SpriteTemplate gPowerAbsorptionOrbSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_ORBS, @@ -293,10 +293,10 @@ const struct SpriteTemplate gUnknown_085921E0 = .anims = gUnknown_085921C8, .images = NULL, .affineAnims = gUnknown_085921DC, - .callback = sub_80FE8E0, + .callback = AnimPowerAbsorptionOrb, }; -const struct SpriteTemplate gUnknown_085921F8 = +const struct SpriteTemplate gSolarbeamBigOrbSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_ORBS, @@ -304,10 +304,10 @@ const struct SpriteTemplate gUnknown_085921F8 = .anims = gUnknown_085921A8, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FE930, + .callback = AnimSolarbeamBigOrb, }; -const struct SpriteTemplate gUnknown_08592210 = +const struct SpriteTemplate gSolarbeamSmallOrbSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_ORBS, @@ -315,7 +315,7 @@ const struct SpriteTemplate gUnknown_08592210 = .anims = gUnknown_085921C4, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FE988, + .callback = AnimSolarbeamSmallOrb, }; const union AffineAnimCmd gUnknown_08592228[] = { @@ -328,7 +328,7 @@ const union AffineAnimCmd *const gUnknown_08592240[] = { gUnknown_08592228, }; -const struct SpriteTemplate gUnknown_08592244 = +const struct SpriteTemplate gStockpileAbsorptionOrbSpriteTemplate = { .tileTag = ANIM_TAG_GRAY_ORB, .paletteTag = ANIM_TAG_GRAY_ORB, @@ -336,7 +336,7 @@ const struct SpriteTemplate gUnknown_08592244 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gUnknown_08592240, - .callback = sub_80FE8E0, + .callback = AnimPowerAbsorptionOrb, }; const union AffineAnimCmd gUnknown_0859225C[] = { @@ -348,7 +348,7 @@ const union AffineAnimCmd *const gUnknown_0859226C[] = { gUnknown_0859225C, }; -const struct SpriteTemplate gUnknown_08592270 = +const struct SpriteTemplate gAbsorptionOrbSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_ORBS, @@ -356,10 +356,10 @@ const struct SpriteTemplate gUnknown_08592270 = .anims = gUnknown_085921C8, .images = NULL, .affineAnims = gUnknown_0859226C, - .callback = sub_80FEAD8, + .callback = AnimAbsorptionOrb, }; -const struct SpriteTemplate gUnknown_08592288 = +const struct SpriteTemplate gHyperBeamOrbSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_ORBS, @@ -367,7 +367,7 @@ const struct SpriteTemplate gUnknown_08592288 = .anims = gUnknown_085921A8, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FEB44, + .callback = AnimHyperBeamOrb, }; const union AnimCmd gUnknown_085922A0[] = @@ -418,7 +418,7 @@ const union AnimCmd *const gUnknown_085922E4[] = gUnknown_085922DC, }; -const struct SpriteTemplate gUnknown_085922EC = +const struct SpriteTemplate gSporeParticleSpriteTemplate = { .tileTag = ANIM_TAG_SPORE, .paletteTag = ANIM_TAG_SPORE, @@ -426,7 +426,7 @@ const struct SpriteTemplate gUnknown_085922EC = .anims = gUnknown_085922E4, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FED28, + .callback = AnimSporeParticle, }; const union AnimCmd gUnknown_08592304[] = @@ -451,7 +451,7 @@ const union AnimCmd *const gUnknown_08592318[] = gUnknown_0859230C, }; -const struct SpriteTemplate gUnknown_0859231C = +const struct SpriteTemplate gPetalDanceBigFlowerSpriteTemplate = { .tileTag = ANIM_TAG_FLOWER, .paletteTag = ANIM_TAG_FLOWER, @@ -459,10 +459,10 @@ const struct SpriteTemplate gUnknown_0859231C = .anims = gUnknown_08592314, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FEE78, + .callback = AnimPetalDanceBigFlower, }; -const struct SpriteTemplate gUnknown_08592334 = +const struct SpriteTemplate gPetalDanceSmallFlowerSpriteTemplate = { .tileTag = ANIM_TAG_FLOWER, .paletteTag = ANIM_TAG_FLOWER, @@ -470,7 +470,7 @@ const struct SpriteTemplate gUnknown_08592334 = .anims = gUnknown_08592318, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FEF44, + .callback = AnimPetalDanceSmallFlower, }; const union AnimCmd gUnknown_0859234C[] = @@ -502,7 +502,7 @@ const union AnimCmd *const gUnknown_08592388[] = gUnknown_08592378, }; -const struct SpriteTemplate gUnknown_08592390 = +const struct SpriteTemplate gRazorLeafParticleSpriteTemplate = { .tileTag = ANIM_TAG_LEAF, .paletteTag = ANIM_TAG_LEAF, @@ -510,10 +510,10 @@ const struct SpriteTemplate gUnknown_08592390 = .anims = gUnknown_08592388, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FEFFC, + .callback = AnimRazorLeafParticle, }; -const struct SpriteTemplate gUnknown_085923A8 = +const struct SpriteTemplate gTwisterLeafParticleSpriteTemplate = { .tileTag = ANIM_TAG_LEAF, .paletteTag = ANIM_TAG_LEAF, @@ -538,7 +538,7 @@ const union AnimCmd *const gUnknown_085923D4[] = gUnknown_085923C0, }; -const struct SpriteTemplate gUnknown_085923D8 = +const struct SpriteTemplate gRazorLeafCutterSpriteTemplate = { .tileTag = ANIM_TAG_RAZOR_LEAF, .paletteTag = ANIM_TAG_RAZOR_LEAF, @@ -594,14 +594,14 @@ const union AnimCmd *const gUnknown_08592444[] = }; const union AffineAnimCmd gUnknown_0859244C[] = { - AFFINEANIMCMD_FRAME(256, 256, 0, 0), + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(-11, 0, 0, 6), AFFINEANIMCMD_FRAME(11, 0, 0, 6), AFFINEANIMCMD_END, }; const union AffineAnimCmd gUnknown_0859246C[] = { - AFFINEANIMCMD_FRAME(-256, 256, 0, 0), + AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(11, 0, 0, 6), AFFINEANIMCMD_FRAME(-11, 0, 0, 6), AFFINEANIMCMD_END, @@ -612,7 +612,7 @@ const union AffineAnimCmd *const gUnknown_0859248C[] = { gUnknown_0859246C, }; -const struct SpriteTemplate gUnknown_08592494 = +const struct SpriteTemplate gConstrictBindingSpriteTemplate = { .tileTag = ANIM_TAG_TENDRILS, .paletteTag = ANIM_TAG_TENDRILS, @@ -620,7 +620,7 @@ const struct SpriteTemplate gUnknown_08592494 = .anims = gUnknown_08592444, .images = NULL, .affineAnims = gUnknown_0859248C, - .callback = sub_80FF374, + .callback = AnimConstrictBinding, }; const union AffineAnimCmd gUnknown_085924AC[] = { @@ -639,7 +639,7 @@ const union AffineAnimCmd *const gUnknown_085924D4[] = { gUnknown_085924C4, }; -const struct SpriteTemplate gUnknown_085924DC = +const struct SpriteTemplate gMimicOrbSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_ORBS, @@ -647,7 +647,7 @@ const struct SpriteTemplate gUnknown_085924DC = .anims = gUnknown_085921C8, .images = NULL, .affineAnims = gUnknown_085924D4, - .callback = sub_80FF698, + .callback = AnimMimicOrb, }; const union AnimCmd gUnknown_085924F4[] = @@ -692,7 +692,7 @@ const union AnimCmd *const gUnknown_0859253C[] = gUnknown_0859252C, }; -const struct SpriteTemplate gUnknown_0859254C = +const struct SpriteTemplate gIngrainRootSpriteTemplate = { .tileTag = ANIM_TAG_ROOTS, .paletteTag = ANIM_TAG_ROOTS, @@ -700,10 +700,10 @@ const struct SpriteTemplate gUnknown_0859254C = .anims = gUnknown_0859253C, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FF768, + .callback = AnimIngrainRoot, }; -const struct SpriteTemplate gUnknown_08592564 = +const struct SpriteTemplate gFrenzyPlantRootSpriteTemplate = { .tileTag = ANIM_TAG_ROOTS, .paletteTag = ANIM_TAG_ROOTS, @@ -711,7 +711,7 @@ const struct SpriteTemplate gUnknown_08592564 = .anims = gUnknown_0859253C, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FF7EC, + .callback = AnimFrenzyPlantRoot, }; const union AnimCmd gUnknown_0859257C[] = @@ -726,7 +726,7 @@ const union AnimCmd *const gUnknown_08592588[] = gUnknown_0859257C, }; -const struct SpriteTemplate gUnknown_0859258C = +const struct SpriteTemplate gIngrainOrbSpriteTemplate = { .tileTag = ANIM_TAG_ORBS, .paletteTag = ANIM_TAG_ORBS, @@ -734,7 +734,7 @@ const struct SpriteTemplate gUnknown_0859258C = .anims = gUnknown_08592588, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FF934, + .callback = AnimIngrainOrb, }; const union AnimCmd gUnknown_085925A4[] = @@ -770,7 +770,7 @@ const union AffineAnimCmd *const gUnknown_08592608[] = { gUnknown_085925D0, }; -const struct SpriteTemplate gUnknown_08592610 = +const struct SpriteTemplate gPresentSpriteTemplate = { .tileTag = ANIM_TAG_ITEM_BAG, .paletteTag = ANIM_TAG_ITEM_BAG, @@ -778,10 +778,10 @@ const struct SpriteTemplate gUnknown_08592610 = .anims = gUnknown_085925AC, .images = NULL, .affineAnims = gUnknown_08592608, - .callback = sub_80FFB18, + .callback = AnimPresent, }; -const struct SpriteTemplate gBattleAnimSpriteTemplate_8592628 = +const struct SpriteTemplate gKnockOffItemSpriteTemplate = { .tileTag = ANIM_TAG_ITEM_BAG, .paletteTag = ANIM_TAG_ITEM_BAG, @@ -789,7 +789,7 @@ const struct SpriteTemplate gBattleAnimSpriteTemplate_8592628 = .anims = gUnknown_085925AC, .images = NULL, .affineAnims = gUnknown_08592608, - .callback = sub_80FFBF4, + .callback = AnimKnockOffItem, }; const union AnimCmd gUnknown_08592640[] = @@ -806,7 +806,7 @@ const union AnimCmd *const gUnknown_08592654[] = gUnknown_08592640, }; -const struct SpriteTemplate gUnknown_08592658 = +const struct SpriteTemplate gPresentHealParticleSpriteTemplate = { .tileTag = ANIM_TAG_GREEN_SPARKLE, .paletteTag = ANIM_TAG_GREEN_SPARKLE, @@ -814,10 +814,10 @@ const struct SpriteTemplate gUnknown_08592658 = .anims = gUnknown_08592654, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FFC70, + .callback = AnimPresentHealParticle, }; -const struct SpriteTemplate gUnknown_08592670 = +const struct SpriteTemplate gItemStealSpriteTemplate = { .tileTag = ANIM_TAG_ITEM_BAG, .paletteTag = ANIM_TAG_ITEM_BAG, @@ -825,7 +825,7 @@ const struct SpriteTemplate gUnknown_08592670 = .anims = gUnknown_085925AC, .images = NULL, .affineAnims = gUnknown_08592608, - .callback = sub_80FFCB4, + .callback = AnimItemSteal, }; const union AffineAnimCmd gUnknown_08592688[] = { @@ -851,7 +851,7 @@ const union AffineAnimCmd *const gUnknown_085926D8[] = { gUnknown_085925D0, }; -const struct SpriteTemplate gUnknown_085926E8 = +const struct SpriteTemplate gTrickBagSpriteTemplate = { .tileTag = ANIM_TAG_ITEM_BAG, .paletteTag = ANIM_TAG_ITEM_BAG, @@ -859,7 +859,7 @@ const struct SpriteTemplate gUnknown_085926E8 = .anims = gUnknown_085925AC, .images = NULL, .affineAnims = gUnknown_085926D8, - .callback = sub_80FFDBC, + .callback = AnimTrickBag, }; const s8 gUnknown_08592700[][3] = @@ -2219,44 +2219,59 @@ static void AnimMovePowderParticleStep(struct Sprite* sprite) } } -void sub_80FE8E0(struct Sprite* sprite) +// Moves an energy orb towards the center of the mon. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: duration +void AnimPowerAbsorptionOrb(struct Sprite* sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[2]; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); } -void sub_80FE930(struct Sprite* sprite) +// Moves an orb in a straight line towards the target mon. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: duration +// arg 3: sprite anim number +void AnimSolarbeamBigOrb(struct Sprite* sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, TRUE); StartSpriteAnim(sprite, gBattleAnimArgs[3]); sprite->data[0] = gBattleAnimArgs[2]; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); sprite->callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } -void sub_80FE988(struct Sprite* sprite) +// Moves a small orb in a wavy pattern towards the target mon. +// The small orb "circles" the big orbs in AnimSolarbeamBigOrb. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: duration +// arg 3: initial wave offset +void AnimSolarbeamSmallOrb(struct Sprite* sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = sprite->pos1.x; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->data[3] = sprite->pos1.y; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); InitAnimLinearTranslation(sprite); sprite->data[5] = gBattleAnimArgs[3]; - sprite->callback = sub_80FE9E4; + sprite->callback = AnimSolarbeamSmallOrbStep; sprite->callback(sprite); } -static void sub_80FE9E4(struct Sprite* sprite) +static void AnimSolarbeamSmallOrbStep(struct Sprite* sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) { DestroySprite(sprite); } @@ -2273,10 +2288,12 @@ static void sub_80FE9E4(struct Sprite* sprite) } } -void sub_80FEA58(u8 taskId) +// Creates 15 small secondary orbs used in the solarbeam anim effect. +// There is a 7-frame delay between each of them. +// No args. +void AnimTask_CreateSmallSolarbeamOrbs(u8 taskId) { - gTasks[taskId].data[0]--; - if (gTasks[taskId].data[0] == -1) + if (--gTasks[taskId].data[0] == -1) { gTasks[taskId].data[1]++; gTasks[taskId].data[0] = 6; @@ -2284,63 +2301,66 @@ void sub_80FEA58(u8 taskId) gBattleAnimArgs[1] = 0; gBattleAnimArgs[2] = 80; gBattleAnimArgs[3] = 0; - CreateSpriteAndAnimate(&gUnknown_08592210, 0, 0, GetBattlerSpriteSubpriority(gBattleAnimTarget) + 1); + CreateSpriteAndAnimate(&gSolarbeamSmallOrbSpriteTemplate, 0, 0, GetBattlerSpriteSubpriority(gBattleAnimTarget) + 1); } if (gTasks[taskId].data[1] == 15) DestroyAnimVisualTask(taskId); } -void sub_80FEAD8(struct Sprite* sprite) +// Moves an orb from the target mon to the attacking mon in an arc-like fashion. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: wave amplitude +// arg 3: wave period (lower means faster wave) +void AnimAbsorptionOrb(struct Sprite* sprite) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[3]; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[5] = gBattleAnimArgs[2]; InitAnimArcTranslation(sprite); - sprite->callback = sub_80FEB28; + sprite->callback = AnimAbsorptionOrbStep; } -static void sub_80FEB28(struct Sprite* sprite) +static void AnimAbsorptionOrbStep(struct Sprite* sprite) { if (TranslateAnimArc(sprite)) DestroyAnimSprite(sprite); } -void sub_80FEB44(struct Sprite* sprite) +// Moves an orb in a wave-like fashion towards the target mon. The wave's +// properties and the sprite anim are randomly determined. +void AnimHyperBeamOrb(struct Sprite* sprite) { - u16 a = Random2(); - u16 b; + u16 speed; + u16 animNum = Random2(); - StartSpriteAnim(sprite, a & 7); - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); - if (GetBattlerSide(gBattleAnimAttacker)) - { + StartSpriteAnim(sprite, animNum % 8); + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) sprite->pos1.x -= 20; - } else - { sprite->pos1.x += 20; - } - b = Random2(); - sprite->data[0] = (b & 31) + 64; + speed = Random2(); + sprite->data[0] = (speed & 31) + 64; sprite->data[1] = sprite->pos1.x; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->data[3] = sprite->pos1.y; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); - sub_80A7160(sprite); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); + InitAnimFastLinearTranslationWithSpeed(sprite); sprite->data[5] = Random2() & 0xFF; sprite->data[6] = sprite->subpriority; - sprite->callback = sub_80FEBFC; + sprite->callback = AnimHyperBeamOrbStep; sprite->callback(sprite); } -static void sub_80FEBFC(struct Sprite* sprite) +static void AnimHyperBeamOrbStep(struct Sprite* sprite) { - if (sub_80A70E8(sprite)) + if (AnimFastTranslateLinear(sprite)) { DestroyAnimSprite(sprite); } @@ -2352,7 +2372,8 @@ static void sub_80FEBFC(struct Sprite* sprite) else sprite->subpriority = sprite->data[6] + 1; - sprite->data[5] = (sprite->data[5] + 24) & 0xFF; + sprite->data[5] += 24; + sprite->data[5] &= 0xFF; } } @@ -2366,13 +2387,13 @@ static void sub_80FEBFC(struct Sprite* sprite) // arg 5: wave amplitude void AnimLeechSeed(struct Sprite* sprite) { - InitAnimSpritePos(sprite, 1); - if (GetBattlerSide(gBattleAnimAttacker)) + InitSpritePosToAnimAttacker(sprite, TRUE); + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[4]; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 0) + gBattleAnimArgs[2]; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + gBattleAnimArgs[3]; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X) + gBattleAnimArgs[2]; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + gBattleAnimArgs[3]; sprite->data[5] = gBattleAnimArgs[5]; InitAnimArcTranslation(sprite); sprite->callback = AnimLeechSeedStep; @@ -2398,42 +2419,54 @@ static void AnimLeechSeedSprouts(struct Sprite* sprite) StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } -void sub_80FED28(struct Sprite* sprite) +// Moves a spore particle in a halo around the target mon. +// The sprite's priority is updated to give the effect of going +// behind the mon's sprite. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: initial wave offset +// arg 3: duration +// arg 4: blend (0 = off, 1 = on) +void AnimSporeParticle(struct Sprite* sprite) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); StartSpriteAnim(sprite, gBattleAnimArgs[4]); if (gBattleAnimArgs[4] == 1) sprite->oam.objMode = ST_OAM_OBJ_BLEND; sprite->data[0] = gBattleAnimArgs[3]; sprite->data[1] = gBattleAnimArgs[2]; - sprite->callback = sub_80FED74; + sprite->callback = AnimSporeParticleStep; sprite->callback(sprite); } -static void sub_80FED74(struct Sprite* sprite) +static void AnimSporeParticleStep(struct Sprite* sprite) { sprite->pos2.x = Sin(sprite->data[1], 32); sprite->pos2.y = Cos(sprite->data[1], -3) + ((sprite->data[2] += 24) >> 8); if ((u16)(sprite->data[1] - 0x40) < 0x80) { - sprite->oam.priority = (sub_80A8328(gBattleAnimTarget) & 3); + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget); } else { - u8 priority = sub_80A8328(gBattleAnimTarget) + 1; + u8 priority = GetBattlerSpriteBGPriority(gBattleAnimTarget) + 1; if (priority > 3) priority = 3; sprite->oam.priority = priority; } - sprite->data[1] = (sprite->data[1] + 2) & 0xFF; + sprite->data[1] += 2; + sprite->data[1] &= 0xFF; if (--sprite->data[0] == -1) DestroyAnimSprite(sprite); } -void sub_80FEE1C(u8 taskId) +// In a double battle, Updates the mon sprite background priorities to allow +// the circling effect controlled by AnimSporeParticle. +// No args. +void AnimTask_SporeDoubleBattle(u8 taskId) { if (IsContest() || !IsDoubleBattle()) { @@ -2441,7 +2474,7 @@ void sub_80FEE1C(u8 taskId) } else { - if (sub_80A8364(gBattleAnimTarget) == 1) + if (GetBattlerSpriteBGPriorityRank(gBattleAnimTarget) == 1) SetAnimBgAttribute(2, BG_ANIM_PRIORITY, 3); else SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); @@ -2450,23 +2483,29 @@ void sub_80FEE1C(u8 taskId) } } -void sub_80FEE78(struct Sprite* sprite) +// Rotates a big flower around the attacking mon, and slowly floats +// downward. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: target y pixel offset +// arg 3: duration +void AnimPetalDanceBigFlower(struct Sprite* sprite) { - InitAnimSpritePos(sprite, 0); + InitSpritePosToAnimAttacker(sprite, FALSE); sprite->data[0] = gBattleAnimArgs[3]; sprite->data[1] = sprite->pos1.x; sprite->data[2] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + gBattleAnimArgs[2]; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[2]; InitAnimLinearTranslation(sprite); sprite->data[5] = 0x40; - sprite->callback = sub_80FEECC; + sprite->callback = AnimPetalDanceBigFlowerStep; sprite->callback(sprite); } -static void sub_80FEECC(struct Sprite* sprite) +static void AnimPetalDanceBigFlowerStep(struct Sprite* sprite) { - if (!TranslateAnimLinear(sprite)) + if (!AnimTranslateLinear(sprite)) { sprite->pos2.x += Sin(sprite->data[5], 32); sprite->pos2.y += Cos(sprite->data[5], -5); @@ -2483,9 +2522,14 @@ static void sub_80FEECC(struct Sprite* sprite) } } -void sub_80FEF44(struct Sprite* sprite) +// Slowly floats a small flower downard, while swaying from right to left. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: target y pixel offset +// arg 3: duration +void AnimPetalDanceSmallFlower(struct Sprite* sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[3]; sprite->data[1] = sprite->pos1.x; sprite->data[2] = sprite->pos1.x; @@ -2493,19 +2537,20 @@ void sub_80FEF44(struct Sprite* sprite) sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + gBattleAnimArgs[2]; InitAnimLinearTranslation(sprite); sprite->data[5] = 0x40; - sprite->callback = sub_80FEF98; + sprite->callback = AnimPetalDanceSmallFlowerStep; sprite->callback(sprite); } -static void sub_80FEF98(struct Sprite* sprite) +static void AnimPetalDanceSmallFlowerStep(struct Sprite* sprite) { - if (!TranslateAnimLinear(sprite)) + if (!AnimTranslateLinear(sprite)) { sprite->pos2.x += Sin(sprite->data[5], 8); if ((u16)(sprite->data[5] - 59) < 5 || (u16)(sprite->data[5] - 187) < 5) - sprite->oam.matrixNum ^= 0x8; + sprite->oam.matrixNum ^= 0x8; // horizontal flip - sprite->data[5] = (sprite->data[5] + 5) & 0xFF; + sprite->data[5] += 5; + sprite->data[5] &= 0xFF; } else { @@ -2513,17 +2558,21 @@ static void sub_80FEF98(struct Sprite* sprite) } } -void sub_80FEFFC(struct Sprite* sprite) +// Shoots a leaf upward, then floats it downward while swaying back and forth. +// arg 0: upward x delta per frame +// arg 1: upward y delta per frame +// arg 2: upward duration +void AnimRazorLeafParticle(struct Sprite* sprite) { - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[0] = gBattleAnimArgs[0]; sprite->data[1] = gBattleAnimArgs[1]; sprite->data[2] = gBattleAnimArgs[2]; - sprite->callback = sub_80FF044; + sprite->callback = AnimRazorLeafParticleStep1; } -static void sub_80FF044(struct Sprite* sprite) +static void AnimRazorLeafParticleStep1(struct Sprite* sprite) { if (!sprite->data[2]) { @@ -2535,11 +2584,11 @@ static void sub_80FF044(struct Sprite* sprite) } else { - sprite->data[0] = sprite->data[1] & 1; - sprite->data[1] = sprite->data[1] & 1; - sprite->data[2] = sprite->data[1] & 1; + sprite->data[0] = 0; + sprite->data[1] = 0; + sprite->data[2] = 0; } - sprite->callback = sub_80FF090; + sprite->callback = AnimRazorLeafParticleStep2; } else { @@ -2549,14 +2598,15 @@ static void sub_80FF044(struct Sprite* sprite) } } -static void sub_80FF090(struct Sprite* sprite) +static void AnimRazorLeafParticleStep2(struct Sprite* sprite) { if (GetBattlerSide(gBattleAnimAttacker)) sprite->pos2.x = -Sin(sprite->data[0], 25); else sprite->pos2.x = Sin(sprite->data[0], 25); - sprite->data[0] = (sprite->data[0] + 2) & 0xFF; + sprite->data[0] += 2; + sprite->data[0] &= 0xFF; sprite->data[1]++; if (!(sprite->data[1] & 1)) sprite->pos2.y++; @@ -2577,19 +2627,19 @@ static void sub_80FF090(struct Sprite* sprite) // arg 6: target between double battle opponents (boolean) void AnimTranslateLinearSingleSineWave(struct Sprite* sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, TRUE); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[4]; if (!gBattleAnimArgs[6]) { - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[2]; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + gBattleAnimArgs[2]; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[3]; } else { - SetAverageBattlerPositions(gBattleAnimTarget, 1, &sprite->data[2], &sprite->data[4]); + SetAverageBattlerPositions(gBattleAnimTarget, TRUE, &sprite->data[2], &sprite->data[4]); sprite->data[2] += gBattleAnimArgs[2]; sprite->data[4] += gBattleAnimArgs[3]; } @@ -2676,38 +2726,45 @@ static void AnimMoveTwisterParticleStep(struct Sprite* sprite) sprite->pos2.x = Cos(sprite->data[5], sprite->data[3]); sprite->pos2.y = Sin(sprite->data[5], 5); if (sprite->data[5] < 0x80) - sprite->oam.priority = sub_80A8328(gBattleAnimTarget) - 1; + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget) - 1; else - sprite->oam.priority = sub_80A8328(gBattleAnimTarget) + 1; + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget) + 1; if (--sprite->data[0] == 0) DestroyAnimSprite(sprite); } -void sub_80FF374(struct Sprite* sprite) +// Squeezes a constricting "rope" several times via affine animations. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: affine anim num +// arg 3: num squeezes +void AnimConstrictBinding(struct Sprite* sprite) { - sub_80A6980(sprite, FALSE); + InitSpritePosToAnimTarget(sprite, FALSE); sprite->affineAnimPaused = 1; StartSpriteAffineAnim(sprite, gBattleAnimArgs[2]); sprite->data[6] = gBattleAnimArgs[2]; sprite->data[7] = gBattleAnimArgs[3]; - sprite->callback = sub_80FF3B0; + sprite->callback = AnimConstrictBindingStep1; } -static void sub_80FF3B0(struct Sprite* sprite) +static void AnimConstrictBindingStep1(struct Sprite* sprite) { + u8 spriteId; + if ((u16)gBattleAnimArgs[7] == 0xFFFF) { sprite->affineAnimPaused = 0; - GetAnimBattlerSpriteId(1); + spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); sprite->data[0] = 0x100; - sprite->callback = sub_80FF3EC; + sprite->callback = AnimConstrictBindingStep2; } } -static void sub_80FF3EC(struct Sprite* sprite) +static void AnimConstrictBindingStep2(struct Sprite* sprite) { - GetAnimBattlerSpriteId(1); + u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); if (!sprite->data[2]) sprite->data[0] += 11; else @@ -2739,23 +2796,23 @@ void sub_80FF458(u8 taskId) { PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_BLEND); gTasks[taskId].data[14] = gSprites[spriteId].oam.priority; - gSprites[spriteId].oam.priority = sub_80A8328(gBattleAnimTarget); + gSprites[spriteId].oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget); spriteId = GetAnimBattlerSpriteId(ANIM_DEF_PARTNER); gTasks[taskId].data[15] = gSprites[spriteId].oam.priority; - gSprites[spriteId].oam.priority = sub_80A8328(BATTLE_PARTNER(gBattleAnimTarget)); + gSprites[spriteId].oam.priority = GetBattlerSpriteBGPriority(BATTLE_PARTNER(gBattleAnimTarget)); gTasks[taskId].data[0] = gBattleAnimArgs[0]; gTasks[taskId].data[1] = gBattleAnimArgs[1]; - gTasks[taskId].data[11] = 256; + gTasks[taskId].data[11] = 0x100; gTasks[taskId].func = sub_80FF53C; } } static void sub_80FF53C(u8 taskId) { - u8 spriteId = GetAnimBattlerSpriteId(1); + u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); gTasks[taskId].data[10] += gTasks[taskId].data[0]; gSprites[spriteId].pos2.x = gTasks[taskId].data[10] >> 8; - if (GetBattlerSide(gBattleAnimTarget)) + if (GetBattlerSide(gBattleAnimTarget) != B_SIDE_PLAYER) gSprites[spriteId].pos2.x = -gSprites[spriteId].pos2.x; gTasks[taskId].data[11] += 16; @@ -2796,7 +2853,10 @@ static void sub_80FF5CC(u8 taskId) DestroyAnimVisualTask(taskId); } -void sub_80FF698(struct Sprite* sprite) +// Moves an orb from the target mon to the attacking mon. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +void AnimMimicOrb(struct Sprite* sprite) { switch (sprite->data[0]) { @@ -2804,8 +2864,8 @@ void sub_80FF698(struct Sprite* sprite) if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) gBattleAnimArgs[0] *= -1; - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 0) + gBattleAnimArgs[0]; - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + gBattleAnimArgs[1]; + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X) + gBattleAnimArgs[0]; + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + gBattleAnimArgs[1]; sprite->invisible = 1; sprite->data[0]++; break; @@ -2815,21 +2875,27 @@ void sub_80FF698(struct Sprite* sprite) { ChangeSpriteAffineAnim(sprite, 1); sprite->data[0] = 25; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); - sprite->callback = sub_80A70C0; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); + sprite->callback = InitAndRunAnimFastLinearTranslation; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); break; } } } -void sub_80FF768(struct Sprite* sprite) +// Animates a root that flickers away after some time. +// arg 0: x pixel offset +// arg 1: y pixel offset +// arg 2: sprite subpriority offset +// arg 3: sprite anim num +// arg 4: duration +void AnimIngrainRoot(struct Sprite* sprite) { if (!sprite->data[0]) { - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y); sprite->pos2.x = gBattleAnimArgs[0]; sprite->pos2.y = gBattleAnimArgs[1]; sprite->subpriority = gBattleAnimArgs[2] + 30; @@ -2839,33 +2905,40 @@ void sub_80FF768(struct Sprite* sprite) if (sprite->pos1.y + sprite->pos2.y > 120) sprite->pos1.y += sprite->pos2.y + sprite->pos1.y - 120; } - sprite->callback = sub_80FF8DC; + sprite->callback = AnimRootFlickerOut; } -void sub_80FF7EC(struct Sprite *sprite) +// Places a root on the path to the target mon that flickers away after some time. +// arg 0: percent along the path to the target mon +// arg 1: x pixel offset +// arg 2: y pixel offset +// arg 3: sprite subpriority offset +// arg 4: sprite anum num +// arg 5: duration +void AnimFrenzyPlantRoot(struct Sprite *sprite) { - s16 p1 = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - s16 p2 = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); - s16 e1 = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - s16 e2 = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + s16 attackerX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + s16 attackerY = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); + s16 targetX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + s16 targetY = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); - e1 -= p1; - e2 -= p2; - sprite->pos1.x = p1 + e1 * gBattleAnimArgs[0] / 100; - sprite->pos1.y = p2 + e2 * gBattleAnimArgs[0] / 100; + targetX -= attackerX; + targetY -= attackerY; + sprite->pos1.x = attackerX + targetX * gBattleAnimArgs[0] / 100; + sprite->pos1.y = attackerY + targetY * gBattleAnimArgs[0] / 100; sprite->pos2.x = gBattleAnimArgs[1]; sprite->pos2.y = gBattleAnimArgs[2]; sprite->subpriority = gBattleAnimArgs[3] + 30; StartSpriteAnim(sprite, gBattleAnimArgs[4]); sprite->data[2] = gBattleAnimArgs[5]; - sprite->callback = sub_80FF8DC; + sprite->callback = AnimRootFlickerOut; gUnknown_0203A0F8[0] = sprite->pos1.x; gUnknown_0203A0F8[1] = sprite->pos1.y; - gUnknown_0203A0F8[2] = e1; - gUnknown_0203A0F8[3] = e2; + gUnknown_0203A0F8[2] = targetX; + gUnknown_0203A0F8[3] = targetY; } -static void sub_80FF8DC(struct Sprite* sprite) +static void AnimRootFlickerOut(struct Sprite* sprite) { if (++sprite->data[0] > (sprite->data[2] - 10)) sprite->invisible = sprite->data[0] % 2; @@ -2874,7 +2947,13 @@ static void sub_80FF8DC(struct Sprite* sprite) DestroyAnimSprite(sprite); } -void sub_80FF934(struct Sprite* sprite) +// Moves an orb in a fast wavy path. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: horizontal velocity +// arg 3: wave amplitude +// arg 4: duration +void AnimIngrainOrb(struct Sprite* sprite) { if (!sprite->data[0]) { @@ -2892,11 +2971,11 @@ void sub_80FF934(struct Sprite* sprite) DestroyAnimSprite(sprite); } -void sub_80FF9B8(struct Sprite* sprite, s16 c) +static void sub_80FF9B8(struct Sprite* sprite, s16 c) { - s32 a = (sprite->pos1.x * 256) | sprite->pos1.y; - s32 b = (sprite->data[6] * 256) | sprite->data[7]; - c *= 256; + int a = (sprite->pos1.x << 8) | sprite->pos1.y; + int b = (sprite->data[6] << 8) | sprite->data[7]; + c <<= 8; sprite->data[5] = a; sprite->data[6] = b; sprite->data[7] = c; @@ -2961,24 +3040,24 @@ static void sub_80FFAB4(struct Sprite* sprite) } } -void sub_80FFB18(struct Sprite* sprite) +void AnimPresent(struct Sprite* sprite) { - s16 e1; - s16 e2; - InitAnimSpritePos(sprite, 0); - e1 = GetBattlerSpriteCoord(gBattleAnimTarget, 0); - e2 = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + s16 targetX; + s16 targetY; + InitSpritePosToAnimAttacker(sprite, FALSE); + targetX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + targetY = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y); if (BATTLE_PARTNER(gBattleAnimAttacker) == gBattleAnimTarget) { - sprite->data[6] = e1; - sprite->data[7] = e2 + 10; + sprite->data[6] = targetX; + sprite->data[7] = targetY + 10; sub_80FF9B8(sprite, 60); sprite->data[3] = 1; } else { - sprite->data[6] = e1; - sprite->data[7] = e2 + 10; + sprite->data[6] = targetX; + sprite->data[7] = targetY + 10; sub_80FF9B8(sprite, 60); sprite->data[3] = 3; } @@ -3007,37 +3086,42 @@ static void sub_80FFB90(struct Sprite* sprite) } } -void sub_80FFBF4(struct Sprite* sprite) +void AnimKnockOffItem(struct Sprite* sprite) { - s16 e = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + s16 targetY = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y); if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) { sprite->data[6] = 0; - sprite->data[7] = e + 10; + sprite->data[7] = targetY + 10; sub_80FF9B8(sprite, 40); sprite->data[3] = 3; - sprite->data[4] = 0x3C; + sprite->data[4] = 60; sprite->callback = sub_80FFAB4; } else { sprite->data[6] = 255; - sprite->data[7] = e + 10; + sprite->data[7] = targetY + 10; if (IsContest()) sprite->data[6] = 0; sub_80FF9B8(sprite, 40); sprite->data[3] = 3; - sprite->data[4] = 0x3C; + sprite->data[4] = 60; sprite->callback = sub_80FFB90; } } -void sub_80FFC70(struct Sprite* sprite) +// Animates a heal particle upward. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: vertical velocity +// arg 3: unused +void AnimPresentHealParticle(struct Sprite* sprite) { - if (sprite->data[0] == 0) + if (!sprite->data[0]) { - sub_80A6980(sprite, FALSE); + InitSpritePosToAnimTarget(sprite, FALSE); sprite->data[1] = gBattleAnimArgs[2]; } @@ -3047,33 +3131,33 @@ void sub_80FFC70(struct Sprite* sprite) DestroyAnimSprite(sprite); } -void sub_80FFCB4(struct Sprite* sprite) +void AnimItemSteal(struct Sprite* sprite) { - s16 p1; - s16 p2; - sub_80A6980(sprite, FALSE); - p1 = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); - p2 = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + s16 attackerX; + s16 attackerY; + InitSpritePosToAnimTarget(sprite, FALSE); + attackerX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); + attackerY = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y); if (BATTLE_PARTNER(gBattleAnimTarget) == gBattleAnimAttacker) { - sprite->data[6] = p1; - sprite->data[7] = p2 + 10; + sprite->data[6] = attackerX; + sprite->data[7] = attackerY + 10; sub_80FF9B8(sprite, 60); sprite->data[3] = 1; } else { - sprite->data[6] = p1; - sprite->data[7] = p2 + 10; + sprite->data[6] = attackerX; + sprite->data[7] = attackerY + 10; sub_80FF9B8(sprite, 60); sprite->data[3] = 3; } sprite->data[4] = 60; - sprite->callback = sub_80FFD2C; + sprite->callback = AnimItemStealStep; } -static void sub_80FFD2C(struct Sprite* sprite) +static void AnimItemStealStep(struct Sprite* sprite) { int zero; sprite->data[0] += ((sprite->data[3] * 128) / sprite->data[4]); @@ -3097,7 +3181,10 @@ static void sub_80FFD2C(struct Sprite* sprite) } } -void sub_80FFDBC(struct Sprite* sprite) +// Moves a bag in a circular motion. +// arg 0: y position +// arg 1: initial wave offset +void AnimTrickBag(struct Sprite* sprite) { int a; int b; @@ -3126,7 +3213,7 @@ void sub_80FFDBC(struct Sprite* sprite) sprite->data[4] = 20; sprite->pos2.x = Cos(sprite->data[1], 60); sprite->pos2.y = Sin(sprite->data[1], 20); - sprite->callback = sub_80FFE58; + sprite->callback = AnimTrickBagStep1; if (sprite->data[1] > 0 && sprite->data[1] < 192) sprite->subpriority = 31; else @@ -3134,7 +3221,7 @@ void sub_80FFDBC(struct Sprite* sprite) } } -static void sub_80FFE58(struct Sprite* sprite) +static void AnimTrickBagStep1(struct Sprite* sprite) { switch (sprite->data[3]) { @@ -3158,20 +3245,20 @@ static void sub_80FFE58(struct Sprite* sprite) { sprite->data[0] = 0; sprite->data[2] = 0; - sprite->callback = sub_80FFEC4; + sprite->callback = AnimTrickBagStep2; } break; } } -static void sub_80FFEC4(struct Sprite* sprite) +static void AnimTrickBagStep2(struct Sprite* sprite) { if (sprite->data[2] == gUnknown_08592700[sprite->data[0]][1]) { if (gUnknown_08592700[sprite->data[0]][2] == 127) { sprite->data[0] = 0; - sprite->callback = sub_80FFF7C; + sprite->callback = AnimTrickBagStep3; } sprite->data[2] = 0; @@ -3194,7 +3281,7 @@ static void sub_80FFEC4(struct Sprite* sprite) } } -static void sub_80FFF7C(struct Sprite* sprite) +static void AnimTrickBagStep3(struct Sprite* sprite) { if (sprite->data[0] > 20) DestroyAnimSprite(sprite); @@ -3493,20 +3580,20 @@ void sub_8100640(struct Sprite* sprite) { case 0: sprite->pos1.y = gBattleAnimArgs[0]; - sprite->oam.priority = sub_80A8328(battler); + sprite->oam.priority = GetBattlerSpriteBGPriority(battler); break; case 1: sprite->pos1.y = gBattleAnimArgs[0]; - sprite->oam.priority = sub_80A8328(battler) + 1; + sprite->oam.priority = GetBattlerSpriteBGPriority(battler) + 1; break; case 2: sprite->pos1.y = GetBattlerSpriteCoord(battler, 3) + gBattleAnimArgs[0]; - sprite->oam.priority = sub_80A8328(battler); + sprite->oam.priority = GetBattlerSpriteBGPriority(battler); break; case 3: sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[0]; GetAnimBattlerSpriteId(ANIM_TARGET); - sprite->oam.priority = sub_80A8328(battler) + 1; + sprite->oam.priority = GetBattlerSpriteBGPriority(battler) + 1; break; } @@ -3665,7 +3752,7 @@ void sub_8100A50(struct Sprite* sprite) StartSpriteAnim(sprite, 1); sprite->callback = sub_81009DC; - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; } @@ -3858,9 +3945,9 @@ void sub_8100EF0(struct Sprite* sprite) sprite->pos1.x = GetBattlerSpriteCoord2(gBattleAnimAttacker, 0) + gBattleAnimArgs[0]; sprite->pos1.y = GetBattlerSpriteCoord2(gBattleAnimAttacker, 1) + gBattleAnimArgs[1]; if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER || IsContest()) - sprite->oam.priority = sub_80A8328(gBattleAnimAttacker) + 1; + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimAttacker) + 1; else - sprite->oam.priority = sub_80A8328(gBattleAnimAttacker); + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimAttacker); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[2] = (IndexOfSpritePaletteTag(ANIM_TAG_PROTECT) << 4) + 0x100; @@ -4028,13 +4115,13 @@ void sub_810130C(struct Sprite* sprite) if (!gBattleAnimArgs[2]) SetSpriteCoordsToAnimAttackerCoords(sprite); - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; sprite->data[0] = gBattleAnimArgs[5]; sprite->data[1] = gBattleAnimArgs[3]; sprite->data[2] = gBattleAnimArgs[4]; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); - sprite->callback = TranslateAnimLinearSimple; + sprite->callback = AnimTranslateLinearSimple; } void sub_810135C(struct Sprite* sprite) @@ -4048,7 +4135,7 @@ void sub_810135C(struct Sprite* sprite) if (IsDoubleBattle() && IsBattlerSpriteVisible(BATTLE_PARTNER(battler))) { SetAverageBattlerPositions(battler, gBattleAnimArgs[6], &sprite->pos1.x, &sprite->pos1.y); - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; } else @@ -4064,14 +4151,14 @@ void sub_810135C(struct Sprite* sprite) sprite->pos1.y = GetBattlerSpriteCoord(battler, 3) + gBattleAnimArgs[1]; } - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); } sprite->data[0] = gBattleAnimArgs[5]; sprite->data[1] = gBattleAnimArgs[3]; sprite->data[2] = gBattleAnimArgs[4]; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); - sprite->callback = TranslateAnimLinearSimple; + sprite->callback = AnimTranslateLinearSimple; } void sub_8101440(struct Sprite* sprite) @@ -4782,7 +4869,7 @@ void sub_81022D4(u8 taskId) void sub_810234C(struct Sprite* sprite) { - sub_80A6980(sprite, FALSE); + InitSpritePosToAnimTarget(sprite, FALSE); sprite->animPaused = 1; sprite->data[0] = gBattleAnimArgs[2]; sprite->callback = sub_810237C; @@ -5094,7 +5181,7 @@ void sub_81029B4(u8 taskId) } task->func = sub_8102AE0; - if (sub_80A8364(gBattleAnimAttacker) == 1) + if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG1_ON); else ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG2_ON); @@ -5105,7 +5192,7 @@ static void sub_8102AE0(u8 taskId) struct Task* task = &gTasks[taskId]; if (!task->data[3]) { - if (sub_80A8364(gBattleAnimAttacker) == 1) + if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG1_ON); else SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG2_ON); @@ -5345,7 +5432,7 @@ void sub_8103028(struct Sprite* sprite) static void sub_81030B0(struct Sprite* sprite) { - if (TranslateAnimLinear(sprite) == 0) + if (AnimTranslateLinear(sprite) == 0) { s16 xDiff; xDiff = Sin(sprite->data[5], 8); diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index ba124a6a3..1a7fb8736 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -1257,7 +1257,7 @@ const struct SpriteTemplate gUnknown_08593C64 = void sub_8103448(struct Sprite *sprite) { SetSpriteCoordsToAnimAttackerCoords(sprite); - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; sprite->data[1] = gBattleAnimArgs[2]; sprite->data[2] = gBattleAnimArgs[4]; @@ -1339,7 +1339,7 @@ void sub_810358C(struct Sprite *sprite) void sub_8103620(struct Sprite *sprite) { - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = gBattleAnimArgs[3]; sprite->data[5] = gBattleAnimArgs[4]; @@ -1451,7 +1451,7 @@ void Anim_KinesisZapEnergy(struct Sprite *sprite) // arg 1: y pixel offset void Anim_SwordsDanceBlade(struct Sprite *sprite) { - InitAnimSpritePos(sprite, FALSE); + InitSpritePosToAnimAttacker(sprite, FALSE); sprite->callback = RunStoredCallbackWhenAffineAnimEnds; StoreSpriteCallbackInData6(sprite, Anim_SwordsDanceBladeStep); } @@ -1489,7 +1489,7 @@ void AnimSonicBoomProjectile(struct Sprite *sprite) gBattleAnimArgs[3] = -gBattleAnimArgs[3]; } - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); targetXPos = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[2]; targetYPos = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; rotation = ArcTan2Neg(targetXPos - sprite->pos1.x, targetYPos - sprite->pos1.y); @@ -1732,7 +1732,7 @@ void sub_8103CF0(u8 taskId) void sub_8103FE8(struct Sprite *sprite) { - InitAnimSpritePos(sprite, FALSE); + InitSpritePosToAnimAttacker(sprite, FALSE); sprite->data[0] = 0x100 + (IndexOfSpritePaletteTag(gUnknown_085934A0.paletteTag) << 4); sprite->callback = sub_8104018; } @@ -1828,7 +1828,7 @@ void sub_8104088(struct Sprite *sprite) s16 r7; u16 var; - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); r6 = GetBattlerSpriteCoord(gBattleAnimTarget, 2); r7 = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) @@ -1872,7 +1872,7 @@ static void sub_8104154(struct Sprite *sprite) void sub_81041C4(struct Sprite *sprite) { - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = 20; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); @@ -1931,7 +1931,7 @@ static void sub_81042A0(struct Sprite *sprite) // arg 6: duration void Anim_RazorWindTornado(struct Sprite *sprite) { - InitAnimSpritePos(sprite, FALSE); + InitSpritePosToAnimAttacker(sprite, FALSE); if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) sprite->pos1.y += 16; @@ -2009,7 +2009,7 @@ void Anim_GuillotinePincer(struct Sprite *sprite) static void Anim_GuillotinePincerStep1(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite) && sprite->animEnded) + if (AnimTranslateLinear(sprite) && sprite->animEnded) { SeekSpriteAnim(sprite, 0); sprite->animPaused = 1; @@ -2049,7 +2049,7 @@ static void Anim_GuillotinePincerStep2(struct Sprite *sprite) static void Anim_GuillotinePincerStep3(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) DestroyAnimSprite(sprite); } @@ -2318,7 +2318,7 @@ void Anim_BreathPuff(struct Sprite *sprite) sprite->data[3] = 0; sprite->data[4] = 0; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); - sprite->callback = TranslateAnimLinearSimple; + sprite->callback = AnimTranslateLinearSimple; } // Animates an "angry" mark above a mon's head. @@ -2448,7 +2448,7 @@ void sub_8104E74(u8 taskId) task->data[5] = 0; task->data[15] = sub_80A861C(gBattleAnimTarget, 0); - if (sub_80A8364(gBattleAnimTarget) == 1) + if (GetBattlerSpriteBGPriorityRank(gBattleAnimTarget) == 1) { task->data[6] = gBattle_BG1_X; params.dmaDest = (u16 *)REG_ADDR_BG1HOFS; @@ -2628,7 +2628,7 @@ void sub_81051C4(struct Sprite *sprite) void sub_8105284(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) { FreeSpriteOamMatrix(sprite); DestroyAnimSprite(sprite); @@ -2736,7 +2736,7 @@ void sub_81054E8(struct Sprite *sprite) void sub_8105538(struct Sprite *sprite) { s16 r1; - InitAnimSpritePos(sprite, FALSE); + InitSpritePosToAnimAttacker(sprite, FALSE); r1 = GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER ? -160 : 160; sprite->data[0] = 0x380; sprite->data[1] = r1; @@ -3098,7 +3098,7 @@ static void sub_8105D88(struct Sprite *sprite, u8 a, u8 b) void sub_8105DE8(struct Sprite *sprite) { - InitAnimSpritePos(sprite, FALSE); + InitSpritePosToAnimAttacker(sprite, FALSE); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; @@ -3113,7 +3113,7 @@ void sub_8105DE8(struct Sprite *sprite) void sub_8105E60(struct Sprite *sprite) { if (++sprite->data[0] == 1) - InitAnimSpritePos(sprite, FALSE); + InitSpritePosToAnimAttacker(sprite, FALSE); sprite->pos2.x = Sin(sprite->data[1], 8); sprite->pos2.y = sprite->data[2] >> 8; @@ -3218,7 +3218,7 @@ void sub_81060B0(u8 taskId) void sub_8106140(struct Sprite *sprite) { - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = 95; sprite->data[1] = sprite->pos1.x; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); @@ -3230,7 +3230,7 @@ void sub_8106140(struct Sprite *sprite) static void sub_810618C(struct Sprite *sprite) { - if (!TranslateAnimLinear(sprite)) + if (!AnimTranslateLinear(sprite)) { sprite->pos2.y += Sin(sprite->data[5], 14); sprite->data[5] = (sprite->data[5] + 4) & 0xFF; @@ -3550,7 +3550,7 @@ static void sub_810699C(struct Sprite *sprite) void sub_81069B8(struct Sprite *sprite) { - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->callback = sub_810699C; } diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 4369bd0a5..72d9722b3 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -589,9 +589,9 @@ const union AffineAnimCmd gUnknown_085CE430[] = const s8 gUnknown_085CE460[] = { - 0xE8, - 0x18, - 0xFC, + 0xE8, + 0x18, + 0xFC, 0x00, }; @@ -1225,7 +1225,7 @@ void sub_815A254(struct Sprite *sprite) u8 x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); u8 y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); rotation = ArcTan2Neg(sprite->pos1.x - x, sprite->pos1.y - y); rotation += 0x6000; @@ -1406,7 +1406,7 @@ void sub_815A6C4(struct Sprite *sprite) u16 x; u16 y; - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); SetAverageBattlerPositions(gBattleAnimTarget, FALSE, &x, &y); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) @@ -1444,7 +1444,7 @@ static void sub_815A76C(struct Sprite *sprite) void sub_815A7B0(struct Sprite *sprite) { SetSpriteCoordsToAnimAttackerCoords(sprite); - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; sprite->callback = RunStoredCallbackWhenAnimEnds; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); @@ -1458,7 +1458,7 @@ void sub_815A7EC(struct Sprite *sprite) if (sprite->data[0] == 0) { SetSpriteCoordsToAnimAttackerCoords(sprite); - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); if (!IsContest()) { if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) @@ -1528,7 +1528,7 @@ void sub_815A934(struct Sprite *sprite) SetGpuReg(REG_OFFSET_WIN0H, gBattle_WIN0H); SetGpuReg(REG_OFFSET_WIN0V, gBattle_WIN0V); - sub_80A6980(sprite, FALSE); + InitSpritePosToAnimTarget(sprite, FALSE); sprite->oam.objMode = ST_OAM_OBJ_WINDOW; sprite->invisible = 1; @@ -1745,12 +1745,12 @@ void sub_815ADB0(u8 taskId) if (!gBattleAnimArgs[0]) { var0 = GetBattlerYCoordWithElevation(gBattleAnimAttacker); - toBG2 = sub_80A8364(gBattleAnimAttacker); + toBG2 = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker); } else { var0 = GetBattlerYCoordWithElevation(gBattleAnimTarget); - toBG2 = sub_80A8364(gBattleAnimTarget); + toBG2 = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget); } task->data[0] = var0 + 36; @@ -1846,7 +1846,7 @@ static void sub_815AED8(u8 taskId) if (task->data[7]) task->data[12] = task->data[8]; else - task->data[12] = task->data[9]; + task->data[12] = task->data[9]; } i = task->data[0]; @@ -2000,7 +2000,7 @@ static void sub_815B23C(struct Sprite *sprite) void sub_815B27C(struct Sprite *sprite) { if (sprite->data[0] == 0) - InitAnimSpritePos(sprite, FALSE); + InitSpritePosToAnimAttacker(sprite, FALSE); if (++sprite->data[0] < 40) { @@ -2204,7 +2204,7 @@ void sub_815B70C(struct Sprite *sprite) switch (sprite->data[0]) { case 0: - InitAnimSpritePos(sprite, FALSE); + InitSpritePosToAnimAttacker(sprite, FALSE); sprite->data[1] = 0x900; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); sprite->data[0]++; @@ -2246,7 +2246,7 @@ void sub_815B7D0(u8 taskId) { case 0: SetGpuReg(REG_OFFSET_MOSAIC, 0); - if (sub_80A8364(gBattleAnimAttacker) == 1) + if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) SetAnimBgAttribute(1, BG_ANIM_MOSAIC, 1); else SetAnimBgAttribute(2, BG_ANIM_MOSAIC, 1); @@ -2326,7 +2326,7 @@ void sub_815B7D0(u8 taskId) break; case 4: SetGpuReg(REG_OFFSET_MOSAIC, 0); - if (sub_80A8364(gBattleAnimAttacker) == 1) + if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) SetAnimBgAttribute(1, BG_ANIM_MOSAIC, 0); else SetAnimBgAttribute(2, BG_ANIM_MOSAIC, 0); @@ -2403,7 +2403,7 @@ void sub_815BB84(u8 taskId) gTasks[taskId].data[4] = 0; if (++gTasks[taskId].data[1] > 12) gTasks[taskId].data[1] = 12; - + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[1], 16 - gTasks[taskId].data[1])); if (gTasks[taskId].data[1] == 12) @@ -2459,7 +2459,7 @@ void sub_815BE04(struct Sprite *sprite) xOffset &= 0x3F; if (xOffset > 31) xOffset = 32 - xOffset; - + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0) + xOffset; sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + 32; sprite->data[1] = gBattleAnimArgs[0]; @@ -2490,7 +2490,7 @@ static void sub_815BF44(struct Sprite *sprite) { int var0; s8 var1; - + var0 = (u16)sprite->data[2] + (u16)sprite->data[3]; var1 = var0 >> 8; sprite->pos2.y -= var1; @@ -2531,7 +2531,7 @@ static void sub_815C050(struct Sprite *sprite) register u16 d3 asm("r1"); int var0; s8 var1; - + if (!sprite->invisible) { d2 = sprite->data[2]; @@ -2637,7 +2637,7 @@ void sub_815C0A4(u8 taskId) sub_80A6C68(unknownStruct.bgId); if (!IsContest()) SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0); - + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); gBattle_BG1_X = 0; gBattle_BG1_Y = 0; @@ -2666,7 +2666,7 @@ void sub_815C400(struct Sprite *sprite) { if (sprite->data[0] == 0) { - InitAnimSpritePos(sprite, 0); + InitSpritePosToAnimAttacker(sprite, 0); sprite->data[0]++; } else if (sprite->data[0]++ > 20) @@ -2893,7 +2893,7 @@ static void sub_815C7C4(u8 taskId) SetSpriteRotScale(task->data[15], 0x100, 0x100, task->data[2]); SetBattlerSpriteYOffsetFromRotation(task->data[15]); gSprites[task->data[15]].pos2.x = -(((temp = task->data[2]) >= 0 ? task->data[2] : temp + 63) >> 6); - + if (++task->data[1] > 8) { if (task->data[12]) @@ -3064,7 +3064,7 @@ void sub_815CC94(struct Sprite *sprite) SetGpuReg(REG_OFFSET_WIN0V, gBattle_WIN0V); sprite->data[0] = gBattleAnimArgs[2]; - sub_80A6980(sprite, FALSE); + InitSpritePosToAnimTarget(sprite, FALSE); sprite->oam.objMode = ST_OAM_OBJ_WINDOW; sprite->invisible = 1; sprite->callback = sub_815CD0C; @@ -3166,7 +3166,7 @@ void sub_815CED8(u8 taskId) otId = gContestResources->field_18->unkC; species = gContestResources->field_18->unk2; xOffset = 20; - priority = sub_80A8328(gBattleAnimAttacker); + priority = GetBattlerSpriteBGPriority(gBattleAnimAttacker); } else { @@ -3188,7 +3188,7 @@ void sub_815CED8(u8 taskId) } xOffset = 20; - priority = sub_80A8328(gBattleAnimAttacker); + priority = GetBattlerSpriteBGPriority(gBattleAnimAttacker); } else { @@ -3208,7 +3208,7 @@ void sub_815CED8(u8 taskId) } xOffset = -20; - priority = sub_80A8328(gBattleAnimAttacker); + priority = GetBattlerSpriteBGPriority(gBattleAnimAttacker); } } @@ -3290,7 +3290,7 @@ void sub_815D240(u8 taskId) task->data[14] = task->data[13] + 66; task->data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); - if (sub_80A8364(battler) == 1) + if (GetBattlerSpriteBGPriorityRank(battler) == 1) { scanlineParams.dmaDest = ®_BG1HOFS; SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1); @@ -3333,7 +3333,7 @@ static void sub_815D398(u8 taskId) s16 var3; task = &gTasks[taskId]; - if (sub_80A8364(task->data[5]) == 1) + if (GetBattlerSpriteBGPriorityRank(task->data[5]) == 1) { bgX = gBattle_BG1_X; bgY = gBattle_BG1_Y; @@ -3679,7 +3679,7 @@ void sub_815DCA4(u8 taskId) if (!gBattleAnimArgs[1]) DestroyAnimVisualTask(taskId); - + task->data[0] = 0; task->data[1] = 0; task->data[2] = 0; @@ -3801,7 +3801,7 @@ static void sub_815DF64(u8 taskId) BlendPalette(gTasks[taskId].data[2], 16, 8, gUnknown_085CE784[gTasks[taskId].data[0]]); if (++gTasks[taskId].data[0] > 23) gTasks[taskId].data[0] = 0; - + gTasks[taskId].data[1]--; } else @@ -3831,7 +3831,7 @@ void sub_815E01C(struct Sprite *sprite) { if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) gBattleAnimArgs[0] = -gBattleAnimArgs[0]; - + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0) + gBattleAnimArgs[0]; sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + gBattleAnimArgs[1]; if (gBattleAnimArgs[2] == 0) @@ -4009,7 +4009,7 @@ void sub_815E444(struct Sprite *sprite) sprite->data[4] = gBattleAnimArgs[3]; sprite->data[0] = gBattleAnimArgs[4]; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); - sprite->callback = sub_80A70C0; + sprite->callback = InitAndRunAnimFastLinearTranslation; } void sub_815E47C(u8 taskId) @@ -4030,7 +4030,7 @@ void sub_815E47C(u8 taskId) InitAnimArcTranslation(&gSprites[task->data[15]]); if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) StartSpriteAffineAnim(&gSprites[task->data[15]], 1); - + task->func = sub_815E5CC; } else @@ -4303,7 +4303,7 @@ static void sub_815EA60(struct Sprite *sprite) sprite->pos2.x = sprite->data[7] * (gSineTable[sprite->data[1] * 10] >> 3); if (sprite->data[1] == 15) sprite->oam.tileNum += 16; - + if (sprite->data[1] == 18) { sprite->data[1] = 0; @@ -4452,7 +4452,7 @@ void sub_815EE84(struct Sprite *sprite) { if (gBattleAnimArgs[0] == 0) { - InitAnimSpritePos(sprite, TRUE); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[7] = gBattleAnimAttacker; } else @@ -4463,7 +4463,7 @@ void sub_815EE84(struct Sprite *sprite) if (GetBattlerSide(sprite->data[7]) == B_SIDE_OPPONENT) sprite->oam.matrixNum = 8; - sprite->oam.priority = sub_80A8328(sprite->data[7]); + sprite->oam.priority = GetBattlerSpriteBGPriority(sprite->data[7]); sprite->oam.objMode = ST_OAM_OBJ_BLEND; sprite->callback = sub_815EF08; } @@ -4517,7 +4517,7 @@ static void sub_815EF08(struct Sprite *sprite) sprite->data[5]++; break; case 1: - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) { switch (sprite->data[6]) { @@ -4581,7 +4581,7 @@ static void sub_815F10C(struct Sprite *sprite) sprite->pos1.x + sprite->pos2.x, sprite->pos1.y + sprite->pos2.y, 5); } - + if (sprite->data[5] == sprite->data[4]) DestroyAnimSprite(sprite); @@ -4648,7 +4648,7 @@ void AnimTask_MonToSubstitute(u8 taskId) for (i = 0; i < 16; i++) gTasks[taskId].data[i] = 0; - + gTasks[taskId].func = sub_815F330; } } @@ -4837,7 +4837,7 @@ void sub_815F620(u8 taskId) gSprites[spriteId1].invisible = 1; } - + gSprites[spriteId2].oam.objMode = ST_OAM_OBJ_NORMAL; gSprites[spriteId1].oam.objMode = ST_OAM_OBJ_NORMAL; gSprites[spriteId2].callback = sub_815F7C4; @@ -4887,3 +4887,18 @@ static void sub_815F7C4(struct Sprite *sprite) break; } } + +void AnimTask_GetReturnPowerLevel(u8 taskId) +{ + gBattleAnimArgs[7] = 0; + if (gAnimFriendship < 60) + gBattleAnimArgs[7] = 0; + if (gAnimFriendship > 60 && gAnimFriendship < 92) + gBattleAnimArgs[7] = 1; + if (gAnimFriendship > 91 && gAnimFriendship < 201) + gBattleAnimArgs[7] = 2; + if (gAnimFriendship > 200) + gBattleAnimArgs[7] = 3; + + DestroyAnimVisualTask(taskId); +} diff --git a/src/battle_arena.c b/src/battle_arena.c index a4179eca8..39bb6936d 100644 --- a/src/battle_arena.c +++ b/src/battle_arena.c @@ -497,7 +497,7 @@ u8 BattleArena_ShowJudgmentWindow(u8 *state) case 0: BeginNormalPaletteFade(0x7FFFFF1C, 4, 0, 8, 0); SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR); - LoadCompressedObjectPic(gUnknown_08611F74); + LoadCompressedSpriteSheet(gUnknown_08611F74); LoadCompressedPalette(gUnknown_08D855E8, 0x1F0, 0x20); gBattle_WIN0H = 0xFF; gBattle_WIN0V = 0x70; diff --git a/src/battle_bg.c b/src/battle_bg.c index bb66a41fd..a6919be1d 100644 --- a/src/battle_bg.c +++ b/src/battle_bg.c @@ -11,6 +11,7 @@ #include "link.h" #include "main.h" #include "menu.h" +#include "overworld.h" #include "palette.h" #include "sound.h" #include "sprite.h" @@ -31,8 +32,6 @@ struct BattleBackground const void *palette; }; -extern u8 GetCurrentMapBattleScene(void); - // .rodata static const u16 sUnrefArray[] = {0x0300, 0x0000}; //OamData? @@ -1103,7 +1102,7 @@ void DrawBattleEntryBackground(void) SetGpuReg(REG_OFFSET_WINOUT, 0x36); gBattle_BG1_Y = 0xFF5C; gBattle_BG2_Y = 0xFF5C; - LoadCompressedObjectPicUsingHeap(&gUnknown_0831AA00); + LoadCompressedSpriteSheetUsingHeap(&gUnknown_0831AA00); } else if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000 | BATTLE_TYPE_EREADER_TRAINER)) { diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index e81035fc7..85756309d 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -6,6 +6,7 @@ #include "battle_interface.h" #include "battle_message.h" #include "battle_setup.h" +#include "battle_tower.h" #include "battle_tv.h" #include "bg.h" #include "data2.h" @@ -33,7 +34,6 @@ extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; extern void sub_8172EF0(u8 battlerId, struct Pokemon *mon); extern void sub_81851A8(u8 *); extern u16 sub_8068B48(void); -extern u8 GetFrontierTrainerFrontSpriteId(u16 trainerId); // this file's functions static void LinkOpponentHandleGetMonData(void); diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 533ec39de..ef18c14aa 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -6,6 +6,7 @@ #include "battle_interface.h" #include "battle_message.h" #include "battle_setup.h" +#include "battle_tower.h" #include "battle_tv.h" #include "bg.h" #include "data2.h" @@ -31,7 +32,6 @@ extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[]; extern void sub_8172EF0(u8 battlerId, struct Pokemon *mon); extern void sub_81851A8(u8 *); -extern u8 GetFrontierTrainerFrontSpriteId(u16 trainerId); // this file's functions static void LinkPartnerHandleGetMonData(void); diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 2d8fba63a..e5f795266 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -34,9 +34,6 @@ #include "constants/songs.h" #include "constants/trainers.h" -extern u8 gUnknown_0203CEE8; -extern u8 gUnknown_0203CEE9; -extern u8 gUnknown_0203CF00[]; extern struct MusicPlayerInfo gMPlayInfo_BGM; extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; diff --git a/src/battle_controllers.c b/src/battle_controllers.c index a6d6e9294..1b0ca6a73 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -6,6 +6,7 @@ #include "battle_message.h" #include "cable_club.h" #include "link.h" +#include "party_menu.h" #include "pokemon.h" #include "recorded_battle.h" #include "task.h" @@ -19,8 +20,6 @@ static EWRAM_DATA u8 sUnknown_02022D0A = 0; EWRAM_DATA struct UnusedControllerStruct gUnknown_02022D0C = {}; static EWRAM_DATA u8 sBattleBuffersTransferData[0x100] = {}; -extern void sub_81B8D64(u8 battlerId, u8 arg1); // party_menu - // this file's funcionts static void CreateTasksForSendRecvLinkBuffers(void); static void InitLinkBtlControllers(void); diff --git a/src/battle_dome.c b/src/battle_dome.c index 514b57c97..24e2cbfed 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -19,6 +19,7 @@ #include "window.h" #include "palette.h" #include "decompress.h" +#include "party_menu.h" #include "menu.h" #include "sound.h" #include "pokemon_icon.h" @@ -57,12 +58,6 @@ struct UnkStruct_860DD10 u16 src; }; -extern void sub_81B8558(void); - -extern u8 gSelectedOrderFromParty[]; - -extern const struct SpriteTemplate gUnknown_0860CFA8; - // text extern const u8 gTrainerClassNames[][0xD]; @@ -3536,7 +3531,7 @@ static void sub_8190400(u8 taskId) DecompressAndLoadBgGfxUsingHeap(2, gUnknown_08D83D50, 0x2000, 0, 0); DecompressAndLoadBgGfxUsingHeap(2, gUnknown_08D84970, 0x2000, 0, 1); DecompressAndLoadBgGfxUsingHeap(3, gUnknown_08D84F00, 0x800, 0, 1); - LoadCompressedObjectPic(gUnknown_0860CF50); + LoadCompressedSpriteSheet(gUnknown_0860CF50); LoadCompressedPalette(gUnknown_08D85358, 0, 0x200); LoadCompressedPalette(gUnknown_08D85444, 0x100, 0x200); LoadCompressedPalette(gUnknown_08D85600, 0xF0, 0x20); @@ -5707,7 +5702,7 @@ static void sub_8194220(u8 taskId) gTasks[taskId].data[0]++; break; case 3: - LoadCompressedObjectPic(gUnknown_0860CF50); + LoadCompressedSpriteSheet(gUnknown_0860CF50); if (r10 == 0) { for (i = 0; i < (unsigned) 31; i++) diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index 60b233daf..2571e7a92 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -131,12 +131,6 @@ struct FactorySwapMonsStruct bool8 unk30; }; -extern u8 gUnknown_0203CF20; - -extern const u16 gBattleFrontierHeldItems[]; -extern const struct FacilityMon gBattleFrontierMons[]; -extern const struct FacilityMon gSlateportBattleTentMons[]; -extern const struct BattleFrontierTrainer gBattleFrontierTrainers[]; extern const u32 gUnknown_085B18AC[]; // This file's functions. @@ -1167,7 +1161,7 @@ static void CB2_InitSelectScreen(void) case 4: LoadSpritePalettes(gUnknown_086103F4); LoadSpriteSheets(gUnknown_086103BC); - LoadCompressedObjectPic(gUnknown_086103E4); + LoadCompressedSpriteSheet(gUnknown_086103E4); ShowBg(0); ShowBg(1); SetVBlankCallback(Select_VblankCb); @@ -3171,7 +3165,7 @@ static void CB2_InitSwapScreen(void) case 4: LoadSpritePalettes(gUnknown_086106B0); LoadSpriteSheets(gUnknown_08610650); - LoadCompressedObjectPic(gUnknown_086106A0); + LoadCompressedSpriteSheet(gUnknown_086106A0); SetVBlankCallback(Swap_VblankCb); gMain.state++; break; diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index f53a6281d..3654cf6d4 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -15,6 +15,7 @@ #include "task.h" #include "sprite.h" #include "sound.h" +#include "party_menu.h" #include "m4a.h" #include "constants/species.h" #include "decompress.h" @@ -42,10 +43,6 @@ extern const struct CompressedSpriteSheet gSpriteSheet_EnemyShadow; extern const struct SpriteTemplate gSpriteTemplate_EnemyShadow; extern const u8 gEnemyMonElevation[]; -extern u8 sub_80688F8(u8, u8 battlerId); -extern u8 pokemon_order_func(u8); // party menu -extern void sub_81B8C68(void); - // this file's functions static u8 sub_805D4A8(u16 move); static u16 BattlePalaceGetTargetRetValue(void); @@ -643,7 +640,7 @@ void DecompressTrainerFrontPic(u16 frontPicId, u8 battlerId) DecompressPicFromTable_2(&gTrainerFrontPicTable[frontPicId], gMonSpritesGfxPtr->sprites[position], SPECIES_NONE); - LoadCompressedObjectPalette(&gTrainerFrontPicPaletteTable[frontPicId]); + LoadCompressedSpritePalette(&gTrainerFrontPicPaletteTable[frontPicId]); } void DecompressTrainerBackPic(u16 backPicId, u8 battlerId) @@ -675,20 +672,20 @@ void BattleLoadAllHealthBoxesGfxAtOnce(void) LoadSpritePalette(&sSpritePalettes_HealthBoxHealthBar[1]); if (!IsDoubleBattle()) { - LoadCompressedObjectPic(&sSpriteSheet_SinglesPlayerHealthbox); - LoadCompressedObjectPic(&sSpriteSheet_SinglesOpponentHealthbox); + LoadCompressedSpriteSheet(&sSpriteSheet_SinglesPlayerHealthbox); + LoadCompressedSpriteSheet(&sSpriteSheet_SinglesOpponentHealthbox); numberOfBattlers = 2; } else { - LoadCompressedObjectPic(&sSpriteSheets_DoublesPlayerHealthbox[0]); - LoadCompressedObjectPic(&sSpriteSheets_DoublesPlayerHealthbox[1]); - LoadCompressedObjectPic(&sSpriteSheets_DoublesOpponentHealthbox[0]); - LoadCompressedObjectPic(&sSpriteSheets_DoublesOpponentHealthbox[1]); + LoadCompressedSpriteSheet(&sSpriteSheets_DoublesPlayerHealthbox[0]); + LoadCompressedSpriteSheet(&sSpriteSheets_DoublesPlayerHealthbox[1]); + LoadCompressedSpriteSheet(&sSpriteSheets_DoublesOpponentHealthbox[0]); + LoadCompressedSpriteSheet(&sSpriteSheets_DoublesOpponentHealthbox[1]); numberOfBattlers = 4; } for (i = 0; i < numberOfBattlers; i++) - LoadCompressedObjectPic(&sSpriteSheets_HealthBar[gBattlerPositions[i]]); + LoadCompressedSpriteSheet(&sSpriteSheets_HealthBar[gBattlerPositions[i]]); } bool8 BattleLoadAllHealthBoxesGfx(u8 state) @@ -707,37 +704,37 @@ bool8 BattleLoadAllHealthBoxesGfx(u8 state) if (state == 2) { if (gBattleTypeFlags & BATTLE_TYPE_SAFARI) - LoadCompressedObjectPic(&sSpriteSheet_SafariHealthbox); + LoadCompressedSpriteSheet(&sSpriteSheet_SafariHealthbox); else - LoadCompressedObjectPic(&sSpriteSheet_SinglesPlayerHealthbox); + LoadCompressedSpriteSheet(&sSpriteSheet_SinglesPlayerHealthbox); } else if (state == 3) - LoadCompressedObjectPic(&sSpriteSheet_SinglesOpponentHealthbox); + LoadCompressedSpriteSheet(&sSpriteSheet_SinglesOpponentHealthbox); else if (state == 4) - LoadCompressedObjectPic(&sSpriteSheets_HealthBar[gBattlerPositions[0]]); + LoadCompressedSpriteSheet(&sSpriteSheets_HealthBar[gBattlerPositions[0]]); else if (state == 5) - LoadCompressedObjectPic(&sSpriteSheets_HealthBar[gBattlerPositions[1]]); + LoadCompressedSpriteSheet(&sSpriteSheets_HealthBar[gBattlerPositions[1]]); else retVal = TRUE; } else { if (state == 2) - LoadCompressedObjectPic(&sSpriteSheets_DoublesPlayerHealthbox[0]); + LoadCompressedSpriteSheet(&sSpriteSheets_DoublesPlayerHealthbox[0]); else if (state == 3) - LoadCompressedObjectPic(&sSpriteSheets_DoublesPlayerHealthbox[1]); + LoadCompressedSpriteSheet(&sSpriteSheets_DoublesPlayerHealthbox[1]); else if (state == 4) - LoadCompressedObjectPic(&sSpriteSheets_DoublesOpponentHealthbox[0]); + LoadCompressedSpriteSheet(&sSpriteSheets_DoublesOpponentHealthbox[0]); else if (state == 5) - LoadCompressedObjectPic(&sSpriteSheets_DoublesOpponentHealthbox[1]); + LoadCompressedSpriteSheet(&sSpriteSheets_DoublesOpponentHealthbox[1]); else if (state == 6) - LoadCompressedObjectPic(&sSpriteSheets_HealthBar[gBattlerPositions[0]]); + LoadCompressedSpriteSheet(&sSpriteSheets_HealthBar[gBattlerPositions[0]]); else if (state == 7) - LoadCompressedObjectPic(&sSpriteSheets_HealthBar[gBattlerPositions[1]]); + LoadCompressedSpriteSheet(&sSpriteSheets_HealthBar[gBattlerPositions[1]]); else if (state == 8) - LoadCompressedObjectPic(&sSpriteSheets_HealthBar[gBattlerPositions[2]]); + LoadCompressedSpriteSheet(&sSpriteSheets_HealthBar[gBattlerPositions[2]]); else if (state == 9) - LoadCompressedObjectPic(&sSpriteSheets_HealthBar[gBattlerPositions[3]]); + LoadCompressedSpriteSheet(&sSpriteSheets_HealthBar[gBattlerPositions[3]]); else retVal = TRUE; } @@ -1116,7 +1113,7 @@ void LoadAndCreateEnemyShadowSprites(void) { u8 battlerId; - LoadCompressedObjectPic(&gSpriteSheet_EnemyShadow); + LoadCompressedSpriteSheet(&gSpriteSheet_EnemyShadow); battlerId = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); gBattleSpritesDataPtr->healthBoxesData[battlerId].shadowSpriteId = CreateSprite(&gSpriteTemplate_EnemyShadow, GetBattlerSpriteCoord(battlerId, 0), GetBattlerSpriteCoord(battlerId, 1) + 29, 0xC8); diff --git a/src/battle_interface.c b/src/battle_interface.c index 9fd8e116a..4a8422091 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -1523,7 +1523,7 @@ u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo, bar_data0 = 5; } - LoadCompressedObjectPicUsingHeap(&sStatusSummaryBarSpriteSheet); + LoadCompressedSpriteSheetUsingHeap(&sStatusSummaryBarSpriteSheet); LoadSpriteSheet(&sStatusSummaryBallsSpriteSheet); LoadSpritePalette(&sStatusSummaryBarSpritePal); LoadSpritePalette(&sStatusSummaryBallsSpritePal); diff --git a/src/battle_main.c b/src/battle_main.c index a71d8662d..9cd661d9e 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4,6 +4,7 @@ #include "battle_arena.h" #include "battle_controllers.h" #include "battle_interface.h" +#include "battle_main.h" #include "battle_message.h" #include "battle_pyramid.h" #include "battle_scripts.h" @@ -39,6 +40,7 @@ #include "sound.h" #include "sprite.h" #include "string_util.h" +#include "strings.h" #include "task.h" #include "text.h" #include "trig.h" @@ -56,23 +58,8 @@ #include "constants/species.h" #include "constants/trainers.h" -struct UnknownPokemonStruct4 -{ - /*0x00*/ u16 species; - /*0x02*/ u16 heldItem; - /*0x04*/ u8 nickname[POKEMON_NAME_LENGTH + 1]; - /*0x0F*/ u8 level; - /*0x10*/ u16 hp; - /*0x12*/ u16 maxhp; - /*0x14*/ u32 status; - /*0x18*/ u32 personality; - /*0x1C*/ u8 gender; - /*0x1D*/ u8 language; -}; - extern struct MusicPlayerInfo gMPlayInfo_SE1; extern struct MusicPlayerInfo gMPlayInfo_SE2; -extern u8 gUnknown_0203CF00[]; extern const struct BgTemplate gBattleBgTemplates[]; extern const struct WindowTemplate *const gBattleWindowTemplates[]; @@ -81,25 +68,9 @@ extern const u8 *const gBattlescriptsForBallThrow[]; extern const u8 *const gBattlescriptsForRunningByItem[]; extern const u8 *const gBattlescriptsForUsingItem[]; extern const u8 *const gBattlescriptsForSafariActions[]; -extern const struct ScanlineEffectParams gBattleIntroSlideScanlineEffectParams; - -// strings -extern const u8 gText_LinkStandby3[]; -extern const u8 gText_BattleRecordCouldntBeSaved[]; -extern const u8 gText_ShedinjaJapaneseName[]; -extern const u8 gText_Poison[]; -extern const u8 gText_Sleep[]; -extern const u8 gText_Paralysis[]; -extern const u8 gText_Burn[]; -extern const u8 gText_Ice[]; -extern const u8 gText_Confusion[]; -extern const u8 gText_Love[]; // functions -extern void sub_81B9150(void); extern void sub_80B3AF8(u8 taskId); // cable club -extern void sub_81B8FB0(u8, u8); // party menu -extern u8 pokemon_order_func(u8); // party menu // this file's functions static void CB2_InitBattleInternal(void); @@ -117,9 +88,9 @@ static void sub_8038F34(void); static void sub_80392A8(void); static void sub_803937C(void); static void sub_803939C(void); -static void sub_803980C(struct Sprite *sprite); -static void sub_8039838(struct Sprite *sprite); -static void sub_8039894(struct Sprite *sprite); +static void SpriteCb_MoveWildMonToRight(struct Sprite *sprite); +static void SpriteCb_WildMonShowHealthbox(struct Sprite *sprite); +static void SpriteCb_WildMonAnimate(struct Sprite *sprite); static void sub_80398D0(struct Sprite *sprite); static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite); static void sub_8039AF4(struct Sprite *sprite); @@ -296,6 +267,70 @@ u8 gNumberOfMovesToChoose; u8 gUnknown_03005D7C[MAX_BATTLERS_COUNT]; // rom const data +static const struct ScanlineEffectParams sIntroScanlineParams16Bit = +{ + (void *)REG_ADDR_BG3HOFS, SCANLINE_EFFECT_DMACNT_16BIT, 1 +}; + +// unused +static const struct ScanlineEffectParams sIntroScanlineParams32Bit = +{ + (void *)REG_ADDR_BG3HOFS, SCANLINE_EFFECT_DMACNT_32BIT, 1 +}; + +const struct SpriteTemplate gUnknown_0831AC88 = +{ + .tileTag = 0, + .paletteTag = 0, + .oam = &gDummyOamData, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8038528, +}; + +static const u8 sText_ShedinjaJpnName[] = _("ヌケニン"); // Nukenin + +const struct OamData gOamData_831ACA8 = +{ + .y = 0, + .affineMode = 1, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 2, + .paletteNum = 0, + .affineParam = 0 +}; + +const struct OamData gOamData_831ACB0 = +{ + .y = 0, + .affineMode = 1, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 2, + .paletteNum = 2, + .affineParam = 0 +}; + +// 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 s8 gUnknown_0831ACE0[] ={-32, -16, -16, -32, -32, 0, 0, 0}; // format: attacking type, defending type, damage multiplier @@ -633,7 +668,7 @@ static void CB2_InitBattleInternal(void) gScanlineEffectRegBuffers[1][i] = 0xFF10; } - ScanlineEffect_SetParams(gBattleIntroSlideScanlineEffectParams); + ScanlineEffect_SetParams(sIntroScanlineParams16Bit); } ResetPaletteFade(); @@ -2605,7 +2640,7 @@ static void TryCorrectShedinjaLanguage(struct Pokemon *mon) && GetMonData(mon, MON_DATA_LANGUAGE) != language) { GetMonData(mon, MON_DATA_NICKNAME, nickname); - if (StringCompareWithoutExtCtrlCodes(nickname, gText_ShedinjaJapaneseName) == 0) + if (StringCompareWithoutExtCtrlCodes(nickname, sText_ShedinjaJpnName) == 0) SetMonData(mon, MON_DATA_LANGUAGE, &language); } } @@ -2618,38 +2653,38 @@ u32 sub_80397C4(u32 setId, u32 tableId) #define sBattler data[0] #define sSpeciesId data[2] -void oac_poke_opponent(struct Sprite *sprite) +void SpriteCb_WildMon(struct Sprite *sprite) { - sprite->callback = sub_803980C; + sprite->callback = SpriteCb_MoveWildMonToRight; StartSpriteAnimIfDifferent(sprite, 0); BeginNormalPaletteFade(0x20000, 0, 10, 10, RGB(8, 8, 8)); } -static void sub_803980C(struct Sprite *sprite) +static void SpriteCb_MoveWildMonToRight(struct Sprite *sprite) { if ((gIntroSlideFlags & 1) == 0) { sprite->pos2.x += 2; if (sprite->pos2.x == 0) { - sprite->callback = sub_8039838; + sprite->callback = SpriteCb_WildMonShowHealthbox; } } } -static void sub_8039838(struct Sprite *sprite) +static void SpriteCb_WildMonShowHealthbox(struct Sprite *sprite) { if (sprite->animEnded) { sub_8076918(sprite->sBattler); SetHealthboxSpriteVisible(gHealthboxSpriteIds[sprite->sBattler]); - sprite->callback = sub_8039894; + sprite->callback = SpriteCb_WildMonAnimate; StartSpriteAnimIfDifferent(sprite, 0); BeginNormalPaletteFade(0x20000, 0, 10, 0, RGB(8, 8, 8)); } } -static void sub_8039894(struct Sprite *sprite) +static void SpriteCb_WildMonAnimate(struct Sprite *sprite) { if (!gPaletteFade.active) { diff --git a/src/battle_message.c b/src/battle_message.c index 75f9b1da8..f283d959c 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -14,6 +14,7 @@ #include "palette.h" #include "recorded_battle.h" #include "string_util.h" +#include "strings.h" #include "text.h" #include "window.h" #include "constants/battle_string_ids.h" @@ -40,15 +41,7 @@ extern u8 gUnknown_0203C7B4; extern const u8 gTrainerClassNames[][13]; extern const u16 gUnknown_08D85620[]; -// strings -extern const u8 gText_PkmnBoxSomeonesPCFull[]; -extern const u8 gText_PkmnBoxLanettesPCFull[]; -extern const u8 gText_PkmnTransferredSomeonesPC[]; -extern const u8 gText_PkmnTransferredLanettesPC[]; - -extern u8 GetFrontierBrainTrainerClass(void); // battle_frontier_2 extern u8 GetTrainerHillOpponentClass(u16 trainerId); // pokenav -extern void CopyFrontierBrainTrainerName(u8 *txtPtr); // battle_frontier_2 extern void GetTrainerHillTrainerName(u8 *txtPtr, u16 trainerId); // pokenav extern void CopyTrainerHillTrainerText(u8 arg0, u16 trainerId); // pokenav diff --git a/src/battle_pike.c b/src/battle_pike.c index 893796790..303146f6a 100644 --- a/src/battle_pike.c +++ b/src/battle_pike.c @@ -1611,7 +1611,7 @@ static void sub_81A8830(void) static bool8 CanEncounterWildMon(u8 enemyMonLevel) { - if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_BIT3)) + if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) { u8 monAbility = GetMonAbility(&gPlayerParty[0]); if (monAbility == ABILITY_KEEN_EYE || monAbility == ABILITY_INTIMIDATE) diff --git a/src/battle_pyramid.c b/src/battle_pyramid.c index 45aca91c8..244e61d17 100644 --- a/src/battle_pyramid.c +++ b/src/battle_pyramid.c @@ -8,7 +8,9 @@ #include "save.h" #include "strings.h" #include "fieldmap.h" +#include "party_menu.h" #include "palette.h" +#include "field_screen_effect.h" #include "field_message_box.h" #include "random.h" #include "item.h" @@ -32,9 +34,6 @@ #include "constants/moves.h" #include "constants/species.h" -extern u8 gSelectedOrderFromParty[3]; -extern void door_upload_tiles(void); - extern const struct MapLayout *const gMapLayouts[]; extern const u16 gUnknown_08D856C8[][16]; diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c index 8a6348522..12f631155 100644 --- a/src/battle_pyramid_bag.c +++ b/src/battle_pyramid_bag.c @@ -547,7 +547,7 @@ static bool8 sub_81C5238(void) gPyramidBagResources->state++; break; case 3: - LoadCompressedObjectPic(&gUnknown_0861F3CC); + LoadCompressedSpriteSheet(&gUnknown_0861F3CC); gPyramidBagResources->state++; break; case 4: @@ -964,7 +964,7 @@ static void HandleMenuActionInput(u8 taskId) { if (sub_81221EC() != TRUE) { - s8 id = GetMenuCursorPos(); + s8 id = Menu_GetCursorPos(); if (gMain.newKeys & DPAD_UP) { if (id > 0 && IsValidMenuAction(id - 2)) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index f1e7143dc..c71043958 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -46,22 +46,18 @@ #include "battle_arena.h" #include "battle_pike.h" #include "battle_pyramid.h" +#include "field_specials.h" +#include "pokemon_summary_screen.h" extern struct MusicPlayerInfo gMPlayInfo_BGM; extern const u8* const gBattleScriptsForMoveEffects[]; // functions -extern void ShowSelectMovePokemonSummaryScreen(struct Pokemon* party, u8 monPartyId, u8 monCount, void (*callback)(void), u16 move); // pokemon summary screen -extern u8 sub_81C1B94(void); // pokemon summary screen extern void sub_81D388C(struct Pokemon* mon, void* statStoreLocation); // pokenav.s -extern void sub_81D3640(u8 arg0, void* statStoreLocation1, void* statStoreLocation2, u8 arg3, u8 arg4, u8 arg5); // pokenav.s -extern void sub_81D3784(u8 arg0, void* statStoreLocation1, u8 arg2, u8 arg3, u8 arg4); // pokenav.s -extern u8* GetMonNickname(struct Pokemon* mon, u8* dst); // party_menu -extern void sub_81B8E80(u8 battlerId, u8, u8); // party menu -extern bool8 sub_81B1250(void); // ? +extern void sub_81D3640(u16 arg0, void* statStoreLocation1, void* statStoreLocation2, u8 arg3, u8 arg4, u8 arg5); // pokenav.s +extern void sub_81D3784(u16 arg0, void* statStoreLocation1, u8 arg2, u8 arg3, u8 arg4); // pokenav.s extern u8 sub_813B21C(void); -extern u16 get_unknown_box_id(void); #define DEFENDER_IS_PROTECTED ((gProtectStructs[gBattlerTarget].protected) && (gBattleMoves[gCurrentMove].flags & FLAG_PROTECT_AFFECTED)) @@ -7609,7 +7605,7 @@ static void atk8F_forcerandomswitch(void) } *(gBattleStruct->monToSwitchIntoId + gBattlerTarget) = i; - if (!sub_81B1250()) + if (!IsMultiBattle()) sub_803BDA0(gBattlerTarget); if ((gBattleTypeFlags & BATTLE_TYPE_LINK && gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER) diff --git a/src/battle_setup.c b/src/battle_setup.c index 5377f39b5..56bed77c8 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -24,6 +24,7 @@ #include "window.h" #include "event_object_movement.h" #include "event_scripts.h" +#include "tv.h" #include "trainer_see.h" #include "field_message_box.h" #include "sound.h" @@ -36,6 +37,9 @@ #include "gym_leader_rematch.h" #include "battle_pike.h" #include "battle_pyramid.h" +#include "fldeff.h" +#include "fldeff_misc.h" +#include "field_control_avatar.h" #include "constants/map_types.h" #include "constants/battle_frontier.h" @@ -57,12 +61,8 @@ struct TrainerBattleParameter }; extern bool32 InTrainerHill(void); -extern bool32 FieldPoisonEffectIsRunning(void); -extern void RestartWildEncounterImmunitySteps(void); extern void ClearPoisonStepCounter(void); -extern void sub_81BE72C(void); extern void sub_808BCF4(void); -extern void sub_80EECC8(void); extern void sub_80AF6F0(void); extern u16 sub_81D6180(u8 localId); extern bool8 GetTrainerHillTrainerFlag(u8 eventObjId); @@ -338,7 +338,7 @@ static void Task_BattleStart(u8 taskId) switch (tState) { case 0: - if (!FieldPoisonEffectIsRunning()) // is poison not active? + if (!FldEffPoison_IsActive()) // is poison not active? { BattleTransition_StartOnField(tTransition); sub_81BE72C(); diff --git a/src/battle_tower.c b/src/battle_tower.c index 4a9e0dbc4..5ff396a9e 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -31,8 +31,6 @@ #include "constants/species.h" #include "constants/easy_chat.h" -extern const u16 gUnknown_085DFA46[]; - extern const u8 MossdeepCity_SpaceCenter_2F_EventScript_224157[]; extern const u8 MossdeepCity_SpaceCenter_2F_EventScript_224166[]; @@ -942,55 +940,55 @@ struct const u8 *const *strings; } const gUnknown_085DD500[] = { - {FACILITY_CLASS_LASS, gUnknown_085DD118}, - {FACILITY_CLASS_YOUNGSTER, gUnknown_085DD12C}, - {FACILITY_CLASS_HIKER, gUnknown_085DD140}, - {FACILITY_CLASS_BEAUTY, gUnknown_085DD154}, - {FACILITY_CLASS_FISHERMAN, gUnknown_085DD168}, - {FACILITY_CLASS_LADY, gUnknown_085DD17C}, - {FACILITY_CLASS_CYCLING_TRIATHLETE_F, gUnknown_085DD190}, - {FACILITY_CLASS_BUG_CATCHER, gUnknown_085DD1A4}, - {FACILITY_CLASS_SCHOOL_KID_M, gUnknown_085DD1B8}, - {FACILITY_CLASS_RICH_BOY, gUnknown_085DD1CC}, - {FACILITY_CLASS_BLACK_BELT, gUnknown_085DD1E0}, - {FACILITY_CLASS_TUBER_F, gUnknown_085DD1F4}, - {FACILITY_CLASS_HEX_MANIAC, gUnknown_085DD208}, - {FACILITY_CLASS_PKMN_BREEDER_M, gUnknown_085DD21C}, - {FACILITY_CLASS_RUNNING_TRIATHLETE_F, gUnknown_085DD230}, - {FACILITY_CLASS_RUNNING_TRIATHLETE_M, gUnknown_085DD244}, - {FACILITY_CLASS_BATTLE_GIRL, gUnknown_085DD258}, - {FACILITY_CLASS_CYCLING_TRIATHLETE_M, gUnknown_085DD26C}, - {FACILITY_CLASS_TUBER_M, gUnknown_085DD280}, - {FACILITY_CLASS_GUITARIST, gUnknown_085DD294}, - {FACILITY_CLASS_GENTLEMAN, gUnknown_085DD2A8}, - {FACILITY_CLASS_POKEFAN_M, gUnknown_085DD2BC}, - {FACILITY_CLASS_EXPERT_M, gUnknown_085DD2D0}, - {FACILITY_CLASS_EXPERT_F, gUnknown_085DD2E4}, - {FACILITY_CLASS_DRAGON_TAMER, gUnknown_085DD2F8}, - {FACILITY_CLASS_BIRD_KEEPER, gUnknown_085DD30C}, - {FACILITY_CLASS_NINJA_BOY, gUnknown_085DD320}, - {FACILITY_CLASS_PARASOL_LADY, gUnknown_085DD334}, - {FACILITY_CLASS_BUG_MANIAC, gUnknown_085DD348}, - {FACILITY_CLASS_SAILOR, gUnknown_085DD35C}, - {FACILITY_CLASS_COLLECTOR, gUnknown_085DD370}, - {FACILITY_CLASS_PKMN_RANGER_M, gUnknown_085DD384}, - {FACILITY_CLASS_PKMN_RANGER_F, gUnknown_085DD398}, - {FACILITY_CLASS_AROMA_LADY, gUnknown_085DD3AC}, - {FACILITY_CLASS_RUIN_MANIAC, gUnknown_085DD3C0}, - {FACILITY_CLASS_COOLTRAINER_M, gUnknown_085DD3D4}, - {FACILITY_CLASS_COOLTRAINER_F, gUnknown_085DD3E8}, - {FACILITY_CLASS_POKEMANIAC, gUnknown_085DD3FC}, - {FACILITY_CLASS_KINDLER, gUnknown_085DD410}, - {FACILITY_CLASS_CAMPER, gUnknown_085DD424}, - {FACILITY_CLASS_PICNICKER, gUnknown_085DD438}, - {FACILITY_CLASS_PSYCHIC_M, gUnknown_085DD44C}, - {FACILITY_CLASS_PSYCHIC_F, gUnknown_085DD460}, - {FACILITY_CLASS_SCHOOL_KID_F, gUnknown_085DD474}, - {FACILITY_CLASS_POKEMON_BREEDER_F, gUnknown_085DD488}, - {FACILITY_CLASS_POKEFAN_F, gUnknown_085DD49C}, - {FACILITY_CLASS_SWIMMER_F, gUnknown_085DD4B0}, - {FACILITY_CLASS_SWIMMING_TRIATHLETE_M, gUnknown_085DD4C4}, - {FACILITY_CLASS_SWIMMING_TRIATHLETE_F, gUnknown_085DD4D8}, + {FACILITY_CLASS_LASS, gUnknown_085DD118}, + {FACILITY_CLASS_YOUNGSTER, gUnknown_085DD12C}, + {FACILITY_CLASS_HIKER, gUnknown_085DD140}, + {FACILITY_CLASS_BEAUTY, gUnknown_085DD154}, + {FACILITY_CLASS_FISHERMAN, gUnknown_085DD168}, + {FACILITY_CLASS_LADY, gUnknown_085DD17C}, + {FACILITY_CLASS_CYCLING_TRIATHLETE_F, gUnknown_085DD190}, + {FACILITY_CLASS_BUG_CATCHER, gUnknown_085DD1A4}, + {FACILITY_CLASS_SCHOOL_KID_M, gUnknown_085DD1B8}, + {FACILITY_CLASS_RICH_BOY, gUnknown_085DD1CC}, + {FACILITY_CLASS_BLACK_BELT, gUnknown_085DD1E0}, + {FACILITY_CLASS_TUBER_F, gUnknown_085DD1F4}, + {FACILITY_CLASS_HEX_MANIAC, gUnknown_085DD208}, + {FACILITY_CLASS_PKMN_BREEDER_M, gUnknown_085DD21C}, + {FACILITY_CLASS_RUNNING_TRIATHLETE_F, gUnknown_085DD230}, + {FACILITY_CLASS_RUNNING_TRIATHLETE_M, gUnknown_085DD244}, + {FACILITY_CLASS_BATTLE_GIRL, gUnknown_085DD258}, + {FACILITY_CLASS_CYCLING_TRIATHLETE_M, gUnknown_085DD26C}, + {FACILITY_CLASS_TUBER_M, gUnknown_085DD280}, + {FACILITY_CLASS_GUITARIST, gUnknown_085DD294}, + {FACILITY_CLASS_GENTLEMAN, gUnknown_085DD2A8}, + {FACILITY_CLASS_POKEFAN_M, gUnknown_085DD2BC}, + {FACILITY_CLASS_EXPERT_M, gUnknown_085DD2D0}, + {FACILITY_CLASS_EXPERT_F, gUnknown_085DD2E4}, + {FACILITY_CLASS_DRAGON_TAMER, gUnknown_085DD2F8}, + {FACILITY_CLASS_BIRD_KEEPER, gUnknown_085DD30C}, + {FACILITY_CLASS_NINJA_BOY, gUnknown_085DD320}, + {FACILITY_CLASS_PARASOL_LADY, gUnknown_085DD334}, + {FACILITY_CLASS_BUG_MANIAC, gUnknown_085DD348}, + {FACILITY_CLASS_SAILOR, gUnknown_085DD35C}, + {FACILITY_CLASS_COLLECTOR, gUnknown_085DD370}, + {FACILITY_CLASS_PKMN_RANGER_M, gUnknown_085DD384}, + {FACILITY_CLASS_PKMN_RANGER_F, gUnknown_085DD398}, + {FACILITY_CLASS_AROMA_LADY, gUnknown_085DD3AC}, + {FACILITY_CLASS_RUIN_MANIAC, gUnknown_085DD3C0}, + {FACILITY_CLASS_COOLTRAINER_M, gUnknown_085DD3D4}, + {FACILITY_CLASS_COOLTRAINER_F, gUnknown_085DD3E8}, + {FACILITY_CLASS_POKEMANIAC, gUnknown_085DD3FC}, + {FACILITY_CLASS_KINDLER, gUnknown_085DD410}, + {FACILITY_CLASS_CAMPER, gUnknown_085DD424}, + {FACILITY_CLASS_PICNICKER, gUnknown_085DD438}, + {FACILITY_CLASS_PSYCHIC_M, gUnknown_085DD44C}, + {FACILITY_CLASS_PSYCHIC_F, gUnknown_085DD460}, + {FACILITY_CLASS_SCHOOL_KID_F, gUnknown_085DD474}, + {FACILITY_CLASS_POKEMON_BREEDER_F, gUnknown_085DD488}, + {FACILITY_CLASS_POKEFAN_F, gUnknown_085DD49C}, + {FACILITY_CLASS_SWIMMER_F, gUnknown_085DD4B0}, + {FACILITY_CLASS_SWIMMING_TRIATHLETE_M, gUnknown_085DD4C4}, + {FACILITY_CLASS_SWIMMING_TRIATHLETE_F, gUnknown_085DD4D8}, {FACILITY_CLASS_SWIMMER_M, gUnknown_085DD4EC} }; @@ -2147,7 +2145,7 @@ static void FillFactoryTentTrainerParty(u16 trainerId, u8 firstMonId) void FrontierSpeechToString(const u16 *words) { ConvertEasyChatWordsToString(gStringVar4, words, 3, 2); - if (GetStringWidth(1, gStringVar4, -1) > 204) + if (GetStringWidth(1, gStringVar4, -1) > 204u) { s32 i = 0; diff --git a/src/battle_transition.c b/src/battle_transition.c index 37a8cd63f..786d5e869 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -3,8 +3,10 @@ #include "battle_transition.h" #include "bg.h" #include "decompress.h" +#include "event_object_movement.h" #include "field_camera.h" #include "field_effect.h" +#include "field_weather.h" #include "gpu_regs.h" #include "main.h" #include "alloc.h" @@ -57,10 +59,6 @@ struct StructRectangularSpiral typedef bool8 (*TransitionStateFunc)(struct Task *task); typedef bool8 (*TransitionSpriteCallback)(struct Sprite *sprite); -extern const struct OamData gEventObjectBaseOam_32x32; - -extern void SetWeatherScreenFadeOut(void); - // this file's functions static void LaunchBattleTransitionTask(u8 transitionId); static void Task_BattleTransitionMain(u8 taskId); diff --git a/src/battle_util2.c b/src/battle_util2.c index a9891814c..0a0f65b95 100644 --- a/src/battle_util2.c +++ b/src/battle_util2.c @@ -3,17 +3,14 @@ #include "battle_controllers.h" #include "alloc.h" #include "pokemon.h" +#include "party_menu.h" #include "event_data.h" #include "constants/abilities.h" #include "random.h" #include "battle_scripts.h" -extern u8 gUnknown_0203CF00[]; - extern void sub_81D55D0(void); extern void sub_81D5694(void); -extern u8 pokemon_order_func(u8); -extern void sub_81B8FB0(u8, u8); void AllocateBattleResources(void) { @@ -42,7 +39,7 @@ void AllocateBattleResources(void) if (gBattleTypeFlags & BATTLE_TYPE_SECRET_BASE) { - u16 currSecretBaseId = VarGet(VAR_0x4054); + u16 currSecretBaseId = VarGet(VAR_CURRENT_SECRET_BASE); CreateSecretBaseEnemyParty(&gSaveBlock1Ptr->secretBases[currSecretBaseId]); } } diff --git a/src/berry_tag_screen.c b/src/berry_tag_screen.c index 22f99a426..6e968fc0a 100644 --- a/src/berry_tag_screen.c +++ b/src/berry_tag_screen.c @@ -349,11 +349,11 @@ static bool8 LoadBerryTagGfx(void) sBerryTag->gfxState++; break; case 5: - LoadCompressedObjectPic(&gUnknown_0857FDEC); + LoadCompressedSpriteSheet(&gUnknown_0857FDEC); sBerryTag->gfxState++; break; default: - LoadCompressedObjectPalette(&gUnknown_0857FDF4); + LoadCompressedSpritePalette(&gUnknown_0857FDF4); return TRUE; // done } @@ -33,8 +33,8 @@ struct BgConfig2 u32 unk_3:18; void* tilemap; - u32 bg_x; - u32 bg_y; + s32 bg_x; + s32 bg_y; }; static IWRAM_DATA struct BgControl sGpuBgConfigs; @@ -524,12 +524,12 @@ u16 GetBgAttribute(u8 bg, u8 attributeId) case 8: switch (GetBgType(bg)) { - case 0: - return GetBgMetricTextMode(bg, 0) * 0x800; - case 1: - return GetBgMetricAffineMode(bg, 0) * 0x100; - default: - return 0; + case 0: + return GetBgMetricTextMode(bg, 0) * 0x800; + case 1: + return GetBgMetricAffineMode(bg, 0) * 0x100; + default: + return 0; } case 9: return GetBgType(bg); @@ -540,7 +540,7 @@ u16 GetBgAttribute(u8 bg, u8 attributeId) } } -u32 ChangeBgX(u8 bg, u32 value, u8 op) +s32 ChangeBgX(u8 bg, s32 value, u8 op) { u8 mode; u16 temp1; @@ -610,7 +610,7 @@ u32 ChangeBgX(u8 bg, u32 value, u8 op) return sGpuBgConfigs2[bg].bg_x; } -u32 GetBgX(u8 bg) +s32 GetBgX(u8 bg) { if (IsInvalidBg32(bg) != FALSE) return -1; @@ -620,7 +620,7 @@ u32 GetBgX(u8 bg) return sGpuBgConfigs2[bg].bg_x; } -u32 ChangeBgY(u8 bg, u32 value, u8 op) +s32 ChangeBgY(u8 bg, s32 value, u8 op) { u8 mode; u16 temp1; @@ -690,7 +690,7 @@ u32 ChangeBgY(u8 bg, u32 value, u8 op) return sGpuBgConfigs2[bg].bg_y; } -u32 ChangeBgY_ScreenOff(u8 bg, u32 value, u8 op) +s32 ChangeBgY_ScreenOff(u8 bg, u32 value, u8 op) { u8 mode; u16 temp1; @@ -761,7 +761,7 @@ u32 ChangeBgY_ScreenOff(u8 bg, u32 value, u8 op) return sGpuBgConfigs2[bg].bg_y; } -u32 GetBgY(u8 bg) +s32 GetBgY(u8 bg) { if (IsInvalidBg32(bg) != FALSE) return -1; @@ -778,14 +778,10 @@ void SetBgAffine(u8 bg, u32 srcCenterX, u32 srcCenterY, s16 dispCenterX, s16 dis u8 Unused_AdjustBgMosaic(u8 a1, u8 a2) { - u16 result; - s16 test1; - s16 test2; - - result = GetGpuReg(REG_OFFSET_MOSAIC); + u16 result = GetGpuReg(REG_OFFSET_MOSAIC); + s16 test1 = result & 0xF; + s16 test2 = (result >> 4) & 0xF; - test1 = result & 0xF; - test2 = (result >> 4) & 0xF; result &= 0xFF00; switch (a2) @@ -1039,47 +1035,43 @@ void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 widt u16 mode2; u16 attribute; u16 mode3; + u16 x16, y16; - u16 x16; - u16 y16; - - if (IsInvalidBg32(bg) == FALSE && IsTileMapOutsideWram(bg) == FALSE) + if (!IsInvalidBg32(bg) && !IsTileMapOutsideWram(bg)) { attribute = GetBgControlAttribute(bg, BG_CTRL_ATTR_SCREENSIZE); mode = GetBgMetricTextMode(bg, 0x1) * 0x20; mode2 = GetBgMetricTextMode(bg, 0x2) * 0x20; switch (GetBgType(bg)) { - case 0: - for (y16 = y; y16 < (y + height); y16++) + case 0: + for (y16 = y; y16 < (y + height); y16++) + { + for (x16 = x; x16 < (x + width); x16++) { - for (x16 = x; x16 < (x + width); x16++) - { - CopyTileMapEntry(&firstTileNum, &((u16*)sGpuBgConfigs2[bg].tilemap)[(u16)GetTileMapIndexFromCoords(x16, y16, attribute, mode, mode2)], paletteSlot, 0, 0); - firstTileNum = (firstTileNum & 0xFC00) + ((firstTileNum + tileNumDelta) & 0x3FF); - } + CopyTileMapEntry(&firstTileNum, &((u16*)sGpuBgConfigs2[bg].tilemap)[(u16)GetTileMapIndexFromCoords(x16, y16, attribute, mode, mode2)], paletteSlot, 0, 0); + firstTileNum = (firstTileNum & 0xFC00) + ((firstTileNum + tileNumDelta) & 0x3FF); } - break; - case 1: - mode3 = GetBgMetricAffineMode(bg, 0x1); - for (y16 = y; y16 < (y + height); y16++) + } + break; + case 1: + mode3 = GetBgMetricAffineMode(bg, 0x1); + for (y16 = y; y16 < (y + height); y16++) + { + for (x16 = x; x16 < (x + width); x16++) { - for (x16 = x; x16 < (x + width); x16++) - { - ((u8*)sGpuBgConfigs2[bg].tilemap)[(y16 * mode3) + x16] = firstTileNum; - firstTileNum = (firstTileNum & 0xFC00) + ((firstTileNum + tileNumDelta) & 0x3FF); - } + ((u8*)sGpuBgConfigs2[bg].tilemap)[(y16 * mode3) + x16] = firstTileNum; + firstTileNum = (firstTileNum & 0xFC00) + ((firstTileNum + tileNumDelta) & 0x3FF); } - break; + } + break; } } } u16 GetBgMetricTextMode(u8 bg, u8 whichMetric) { - u8 attribute; - - attribute = GetBgControlAttribute(bg, BG_CTRL_ATTR_SCREENSIZE); + u8 attribute = GetBgControlAttribute(bg, BG_CTRL_ATTR_SCREENSIZE); switch (whichMetric) { @@ -1125,9 +1117,7 @@ u16 GetBgMetricTextMode(u8 bg, u8 whichMetric) u32 GetBgMetricAffineMode(u8 bg, u8 whichMetric) { - u8 attribute; - - attribute = GetBgControlAttribute(bg, BG_CTRL_ATTR_SCREENSIZE); + u8 attribute = GetBgControlAttribute(bg, BG_CTRL_ATTR_SCREENSIZE); switch (whichMetric) { diff --git a/src/bike.c b/src/bike.c index b9d247c5d..1e91baab0 100644 --- a/src/bike.c +++ b/src/bike.c @@ -19,8 +19,6 @@ extern u8 sub_808B9BC(u8 direction); extern u8 sub_808B9A4(u8 direction); extern u8 sub_808C1B4(u8 direction); extern u8 sub_808B9D4(u8 direction); -extern void Overworld_ClearSavedMusic(void); -extern void Overworld_PlaySpecialMapMusic(void); // this file's functions static void MovePlayerOnMachBike(u8, u16, u16); diff --git a/src/blit.c b/src/blit.c index b4d5f7de5..26a63fe9b 100644 --- a/src/blit.c +++ b/src/blit.c @@ -1,12 +1,12 @@ #include "global.h" #include "blit.h" -void BlitBitmapRect4BitWithoutColorKey(struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height) +void BlitBitmapRect4BitWithoutColorKey(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height) { BlitBitmapRect4Bit(src, dst, srcX, srcY, dstX, dstY, width, height, 0xFF); } -void BlitBitmapRect4Bit(struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height, u8 colorKey) +void BlitBitmapRect4Bit(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height, u8 colorKey) { s32 xEnd; s32 yEnd; @@ -14,7 +14,7 @@ void BlitBitmapRect4Bit(struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 sr s32 multiplierDstY; s32 loopSrcY, loopDstY; s32 loopSrcX, loopDstX; - u8 *pixelsSrc; + const u8 *pixelsSrc; u8 *pixelsDst; s32 toOrr; s32 toAnd; @@ -103,7 +103,7 @@ void FillBitmapRect4Bit(struct Bitmap *surface, u16 x, u16 y, u16 width, u16 hei } } -void BlitBitmapRect4BitTo8Bit(struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height, u8 colorKey, u8 paletteOffset) +void BlitBitmapRect4BitTo8Bit(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height, u8 colorKey, u8 paletteOffset) { s32 palOffsetBits; s32 xEnd; @@ -112,7 +112,7 @@ void BlitBitmapRect4BitTo8Bit(struct Bitmap *src, struct Bitmap *dst, u16 srcX, s32 multiplierDstY; s32 loopSrcY, loopDstY; s32 loopSrcX, loopDstX; - u8 *pixelsSrc; + const u8 *pixelsSrc; u8 *pixelsDst; s32 colorKeyBits; @@ -252,7 +252,7 @@ void sub_81104E4(struct Sprite *sprite) if (IsContest()) gBattleAnimArgs[2] /= 2; - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; @@ -274,7 +274,7 @@ void sub_81104E4(struct Sprite *sprite) static void sub_811057C(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) { DestroyAnimSprite(sprite); return; @@ -389,7 +389,7 @@ void AnimTranslateStinger(struct Sprite *sprite) } } - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); lVarX = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[2]; lVarY = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; @@ -414,7 +414,7 @@ void AnimTranslateStinger(struct Sprite *sprite) // arg 5: wave amplitude void AnimMissileArc(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); if (GetBattlerSide(gBattleAnimAttacker)) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; diff --git a/src/cable_car.c b/src/cable_car.c index 00606c905..207a0c22d 100755 --- a/src/cable_car.c +++ b/src/cable_car.c @@ -259,7 +259,7 @@ static void CableCarMainCallback_Setup(void) break; case 2: for (i = 0; i < 3; i++) - LoadCompressedObjectPic(&gUnknown_085CDB54[i]); + LoadCompressedSpriteSheet(&gUnknown_085CDB54[i]); LoadSpritePalettes(gUnknown_085CDB74); sCableCar->mtChimneyTilemap = malloc_and_decompress(gCableCarMtChimneyTilemap, &sizeOut); @@ -351,7 +351,7 @@ static void CableCarMainCallback_Run(void) static void CleanupCableCar(void) { u8 i = 0; - + HideBg(0); HideBg(1); HideBg(2); @@ -361,7 +361,7 @@ static void CleanupCableCar(void) sub_80AB130(WEATHER_NONE); for (i = 0; i < 20; i++) gWeatherPtr->sprites.s2.ashSprites[i] = NULL; - + ResetTasks(); ResetSpriteData(); ResetPaletteFade(); diff --git a/src/clock.c b/src/clock.c index aea6c2088..2d4da92ab 100644 --- a/src/clock.c +++ b/src/clock.c @@ -1,7 +1,8 @@ #include "global.h" -#include "rom6.h" #include "event_data.h" #include "rtc.h" +#include "time_events.h" +#include "field_specials.h" #include "lottery_corner.h" #include "dewford_trend.h" #include "tv.h" diff --git a/src/contest.c b/src/contest.c index b924f1032..7845dce45 100644 --- a/src/contest.c +++ b/src/contest.c @@ -2483,7 +2483,7 @@ u8 sub_80DB0C4(void) { u8 spriteId; - LoadCompressedObjectPic(&gUnknown_08587C00); + LoadCompressedSpriteSheet(&gUnknown_08587C00); LoadCompressedPalette(gContest2Pal, 0x110, 32); spriteId = CreateSprite(&gSpriteTemplate_8587BE8, 112, 36, 30); gSprites[spriteId].oam.paletteNum = 1; @@ -2495,8 +2495,8 @@ u8 sub_80DB120(void) { u8 spriteId; - LoadCompressedObjectPic(&gUnknown_08587C08); - LoadCompressedObjectPalette(&gUnknown_08587C10); + LoadCompressedSpriteSheet(&gUnknown_08587C08); + LoadCompressedSpritePalette(&gUnknown_08587C10); spriteId = CreateSprite(&gSpriteTemplate_8587C18, 96, 10, 29); gSprites[spriteId].invisible = TRUE; gSprites[spriteId].data[0] = gSprites[spriteId].oam.tileNum; diff --git a/src/credits.c b/src/credits.c index 67ab97481..5e52e5fb7 100644 --- a/src/credits.c +++ b/src/credits.c @@ -1102,7 +1102,6 @@ static const struct SpriteTemplate gUnknown_085E7068 = .callback = sub_81772B8, }; -void sub_8175620(void); static void sub_8175744(u8 taskIdA); static void sub_8175774(u8 taskIdA); static void sub_8175808(u8 taskIdA); @@ -1964,9 +1963,9 @@ static bool8 sub_8176AB0(u8 data, u8 taskIdA) case 2: if (gSaveBlock2Ptr->playerGender == MALE) { - LoadCompressedObjectPic(gUnknown_085F5334); - LoadCompressedObjectPic(gUnknown_085F53BC); - LoadCompressedObjectPic(gUnknown_085F5354); + LoadCompressedSpriteSheet(gUnknown_085F5334); + LoadCompressedSpriteSheet(gUnknown_085F53BC); + LoadCompressedSpriteSheet(gUnknown_085F5354); LoadSpritePalettes(gUnknown_085F5384); spriteId = intro_create_brendan_sprite(120, 46); @@ -1981,9 +1980,9 @@ static bool8 sub_8176AB0(u8 data, u8 taskIdA) } else { - LoadCompressedObjectPic(gUnknown_085F5344); - LoadCompressedObjectPic(gUnknown_085F53AC); - LoadCompressedObjectPic(gUnknown_085F5354); + LoadCompressedSpriteSheet(gUnknown_085F5344); + LoadCompressedSpriteSheet(gUnknown_085F53AC); + LoadCompressedSpriteSheet(gUnknown_085F5354); LoadSpritePalettes(gUnknown_085F5384); spriteId = intro_create_may_sprite(120, 46); diff --git a/src/dark.c b/src/dark.c index d4a4f0b8a..efa6e9498 100644 --- a/src/dark.c +++ b/src/dark.c @@ -1,11 +1,29 @@ #include "global.h" #include "battle_anim.h" +#include "contest.h" +#include "gpu_regs.h" +#include "graphics.h" +#include "palette.h" +#include "scanline_effect.h" +#include "trig.h" +#include "util.h" #include "constants/rgb.h" -extern void sub_81138D4(struct Sprite *); -extern void sub_81139DC(struct Sprite *); -extern void sub_8113A90(struct Sprite *); -extern void sub_81144BC(struct Sprite *); +void sub_81138D4(struct Sprite *); +void sub_81139DC(struct Sprite *); +void sub_8113A90(struct Sprite *); +void sub_81144BC(struct Sprite *); +static void sub_811375C(u8); +static void sub_811381C(u8); +static void sub_8113950(struct Sprite *); +static void sub_8113A18(struct Sprite *); +static void sub_8113A58(struct Sprite *); +static void sub_8113B90(struct Sprite *); +static void sub_8113D60(u8); +static void sub_81140C8(u8); +static void sub_8114244(struct Task *); +static void sub_8114374(u8); +static void sub_8114748(u8); const struct SpriteTemplate gUnknown_08596FC8 = { @@ -167,3 +185,797 @@ const struct SpriteTemplate gBattleAnimSpriteTemplate_8597138 = .affineAnims = gDummySpriteAffineAnimTable, .callback = sub_81144BC, }; + +void sub_81136E8(u8 taskId) +{ + int battler; + gTasks[taskId].data[0] = gBattleAnimArgs[0]; + battler = gBattleAnimAttacker; + gTasks[taskId].data[1] = 16; + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(16, 0)); + if (GetBattlerSpriteBGPriorityRank(battler) == 1) + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1); + else + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG2); + + gTasks[taskId].func = sub_811375C; +} + +static void sub_811375C(u8 taskId) +{ + u8 blendA = gTasks[taskId].data[1] >> 8; + u8 blendB = gTasks[taskId].data[1]; + if (gTasks[taskId].data[2] == (u8)gTasks[taskId].data[0]) + { + blendA++; + blendB--; + gTasks[taskId].data[1] = BLDALPHA_BLEND(blendB, blendA); + SetGpuReg(REG_OFFSET_BLDALPHA, gTasks[taskId].data[1]); + gTasks[taskId].data[2] = 0; + if (blendA == 16) + { + gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].invisible = 1; + DestroyAnimVisualTask(taskId); + } + } + else + { + gTasks[taskId].data[2]++; + } +} + +void sub_81137E4(u8 taskId) +{ + gTasks[taskId].data[0] = gBattleAnimArgs[0]; + gTasks[taskId].data[1] = BLDALPHA_BLEND(0, 16); + gTasks[taskId].func = sub_811381C; + SetGpuReg(REG_OFFSET_BLDALPHA, gTasks[taskId].data[1]); +} + +static void sub_811381C(u8 taskId) +{ + u8 blendA = gTasks[taskId].data[1] >> 8; + u8 blendB = gTasks[taskId].data[1]; + if (gTasks[taskId].data[2] == (u8)gTasks[taskId].data[0]) + { + blendA--; + blendB++; + gTasks[taskId].data[1] = (blendA << 8) | blendB; + SetGpuReg(REG_OFFSET_BLDALPHA, gTasks[taskId].data[1]); + gTasks[taskId].data[2] = 0; + if (blendA == 0) + { + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + DestroyAnimVisualTask(taskId); + } + } + else + { + gTasks[taskId].data[2]++; + } +} + +void sub_8113888(u8 taskId) +{ + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); + if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1); + else + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG2); + + DestroyAnimVisualTask(taskId); +} + +void sub_81138D4(struct Sprite *sprite) +{ + sprite->data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->data[3] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); + sprite->data[0] = 0x7E; + InitSpriteDataForLinearTranslation(sprite); + sprite->data[3] = -sprite->data[1]; + sprite->data[4] = -sprite->data[2]; + sprite->data[6] = 0xFFD8; + sprite->callback = sub_8113950; + sprite->callback(sprite); +} + +static void sub_8113950(struct Sprite *sprite) +{ + sprite->data[3] += sprite->data[1]; + sprite->data[4] += sprite->data[2]; + sprite->pos2.x = sprite->data[3] >> 8; + sprite->pos2.y = sprite->data[4] >> 8; + if (sprite->data[7] == 0) + { + sprite->data[3] += sprite->data[1]; + sprite->data[4] += sprite->data[2]; + sprite->pos2.x = sprite->data[3] >> 8; + sprite->pos2.y = sprite->data[4] >> 8; + sprite->data[0]--; + } + + sprite->pos2.y += Sin(sprite->data[5], sprite->data[6]); + sprite->data[5] = (sprite->data[5] + 3) & 0xFF; + if (sprite->data[5] > 0x7F) + { + sprite->data[5] = 0; + sprite->data[6] += 20; + sprite->data[7]++; + } + + if (--sprite->data[0] == 0) + DestroyAnimSprite(sprite); +} + +void sub_81139DC(struct Sprite *sprite) +{ + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + StartSpriteAffineAnim(sprite, gBattleAnimArgs[2]); + sprite->data[0] = gBattleAnimArgs[3]; + sprite->data[1] = gBattleAnimArgs[4]; + sprite->data[2] = gBattleAnimArgs[5]; + sprite->callback = sub_8113A18; +} + +static void sub_8113A18(struct Sprite *sprite) +{ + sprite->data[4] += sprite->data[0]; + sprite->data[5] += sprite->data[1]; + sprite->pos2.x = sprite->data[4] >> 8; + sprite->pos2.y = sprite->data[5] >> 8; + if (++sprite->data[3] == sprite->data[2]) + sprite->callback = sub_8113A58; +} + +static void sub_8113A58(struct Sprite *sprite) +{ + sprite->data[4] -= sprite->data[0]; + sprite->data[5] -= sprite->data[1]; + sprite->pos2.x = sprite->data[4] >> 8; + sprite->pos2.y = sprite->data[5] >> 8; + if (--sprite->data[3] == 0) + DestroySpriteAndMatrix(sprite); +} + +void sub_8113A90(struct Sprite *sprite) +{ + u8 battler; + s8 xOffset; + + if (gBattleAnimArgs[0] == 0) + battler = gBattleAnimAttacker; + else + battler = gBattleAnimTarget; + + xOffset = 20; + sprite->oam.tileNum += 4; + + switch (gBattleAnimArgs[1]) + { + case 0: + sprite->pos1.x = sub_80A861C(battler, 5) - 8; + sprite->pos1.y = sub_80A861C(battler, 2) + 8; + break; + case 1: + sprite->pos1.x = sub_80A861C(battler, 5) - 14; + sprite->pos1.y = sub_80A861C(battler, 2) + 16; + break; + case 2: + sprite->pos1.x = sub_80A861C(battler, 4) + 8; + sprite->pos1.y = sub_80A861C(battler, 2) + 8; + StartSpriteAffineAnim(sprite, 1); + xOffset = -20; + break; + case 3: + sprite->pos1.x = sub_80A861C(battler, 4) + 14; + sprite->pos1.y = sub_80A861C(battler, 2) + 16; + StartSpriteAffineAnim(sprite, 1); + xOffset = -20; + break; + } + + sprite->data[0] = 32; + sprite->data[2] = sprite->pos1.x + xOffset; + sprite->data[4] = sprite->pos1.y + 12; + sprite->data[5] = -12; + + InitAnimArcTranslation(sprite); + sprite->callback = sub_8113B90; +} + +static void sub_8113B90(struct Sprite *sprite) +{ + if (TranslateAnimArc(sprite)) + DestroySpriteAndMatrix(sprite); +} + +void sub_8113BAC(u8 taskId) +{ + struct ScanlineEffectParams scanlineParams; + struct UnknownAnimStruct2 unknownStruct; + u16 i; + u8 pos; + int var0; + struct Task *task = &gTasks[taskId]; + + task->data[7] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y) + 31; + task->data[6] = sub_80A861C(gBattleAnimAttacker, 2) - 7; + task->data[5] = task->data[7]; + task->data[4] = task->data[6]; + task->data[13] = (task->data[7] - task->data[6]) << 8; + + pos = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); + task->data[14] = pos - 32; + task->data[15] = pos + 32; + + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) + task->data[8] = -12; + else + task->data[8] = -64; + + task->data[3] = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker); + if (task->data[3] == 1) + { + sub_80A6B30(&unknownStruct); + task->data[10] = gBattle_BG1_Y; + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1); + FillPalette(0, unknownStruct.unk8 << 4, 32); + scanlineParams.dmaDest = ®_BG1VOFS; + var0 = WINOUT_WIN01_BG1; + if (!IsContest()) + gBattle_BG2_X += 240; + } + else + { + task->data[10] = gBattle_BG2_Y; + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG2); + FillPalette(0, 144, 32); + scanlineParams.dmaDest = ®_BG2VOFS; + var0 = WINOUT_WIN01_BG2; + if (!IsContest()) + gBattle_BG1_X += 240; + } + + scanlineParams.dmaControl = SCANLINE_EFFECT_DMACNT_16BIT; + scanlineParams.initState = 1; + scanlineParams.unused9 = 0; + task->data[11] = 0; + task->data[12] = 16; + task->data[0] = 0; + task->data[1] = 0; + task->data[2] = 0; + sub_8114374(3); + for (i = 0; i < 112; i++) + { + gScanlineEffectRegBuffers[0][i] = task->data[10]; + gScanlineEffectRegBuffers[1][i] = task->data[10]; + } + + ScanlineEffect_SetParams(scanlineParams); + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR | (var0 ^ (WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR))); + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR); + gBattle_WIN0H = (task->data[14] << 8) | task->data[15]; + gBattle_WIN0V = 160; + + task->func = sub_8113D60; +} + +static void sub_8113D60(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + if (++task->data[1] > 1) + { + task->data[1] = 0; + if (++task->data[2] & 1) + { + if (task->data[11] != 12) + task->data[11]++; + } + else + { + if (task->data[12] != 8) + task->data[12]--; + } + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(task->data[11], task->data[12])); + + if (task->data[11] == 12 && task->data[12] == 8) + task->data[0]++; + } + break; + case 1: + task->data[4] -= 8; + sub_8114244(task); + + if (task->data[4] < task->data[8]) + task->data[0]++; + break; + case 2: + task->data[4] -= 8; + sub_8114244(task); + task->data[14] += 4; + task->data[15] -= 4; + + if (task->data[14] >= task->data[15]) + task->data[14] = task->data[15]; + + gBattle_WIN0H = (task->data[14] << 8) | task->data[15]; + + if (task->data[14] == task->data[15]) + task->data[0]++; + break; + case 3: + gScanlineEffect.state = 3; + task->data[0]++; + break; + case 4: + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_8113E78(u8 taskId) +{ + struct UnknownAnimStruct2 unknownStruct; + struct ScanlineEffectParams scanlineParams; + u8 x; + u16 i; + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + if (IsContest() == TRUE) + { + gBattle_WIN0H = 0; + gBattle_WIN0V = 0; + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR); + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR | WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR); + DestroyAnimVisualTask(taskId); + } + else + { + task->data[3] = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget); + if (task->data[3] == 1) + { + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1); + gBattle_BG2_X += 240; + } + else + { + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG2); + gBattle_BG1_X += 240; + } + + task->data[0]++; + } + break; + case 1: + if (task->data[3] == 1) + { + sub_80A6B30(&unknownStruct); + task->data[10] = gBattle_BG1_Y; + FillPalette(0, unknownStruct.unk8 << 4, 32); + } + else + { + task->data[10] = gBattle_BG2_Y; + FillPalette(0, 144, 32); + } + + sub_8114374(3); + task->data[0]++; + break; + case 2: + task->data[7] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + 31; + task->data[6] = sub_80A861C(gBattleAnimTarget, 2) - 7; + task->data[13] = (task->data[7] - task->data[6]) << 8; + x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + task->data[14] = x - 4; + task->data[15] = x + 4; + + if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) + task->data[8] = -12; + else + task->data[8] = -64; + + task->data[4] = task->data[8]; + task->data[5] = task->data[8]; + task->data[11] = 12; + task->data[12] = 8; + task->data[0]++; + break; + case 3: + if (task->data[3] == 1) + scanlineParams.dmaDest = ®_BG1VOFS; + else + scanlineParams.dmaDest = ®_BG2VOFS; + + for (i = 0; i < 112; i++) + { + gScanlineEffectRegBuffers[0][i] = task->data[10] + (159 - i); + gScanlineEffectRegBuffers[1][i] = task->data[10] + (159 - i); + } + + scanlineParams.dmaControl = SCANLINE_EFFECT_DMACNT_16BIT; + scanlineParams.initState = 1; + scanlineParams.unused9 = 0; + ScanlineEffect_SetParams(scanlineParams); + task->data[0]++; + break; + case 4: + if (task->data[3] == 1) + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR | WINOUT_WIN01_BG0 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR); + else + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR | WINOUT_WIN01_BG0 | WINOUT_WIN01_BG1 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR); + + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR); + gBattle_WIN0H = (task->data[14] << 8) | task->data[15]; + gBattle_WIN0V = 160; + + task->data[0] = 0; + task->data[1] = 0; + task->data[2] = 0; + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(12, 8)); + task->func = sub_81140C8; + break; + } +} + +static void sub_81140C8(u8 taskId) +{ + u8 pos; + u16 i; + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + task->data[5] += 8; + if (task->data[5] >= task->data[7]) + task->data[5] = task->data[7]; + + sub_8114244(task); + if (task->data[5] == task->data[7]) + task->data[0]++; + break; + case 1: + if (task->data[15] - task->data[14] < 0x40) + { + task->data[14] -= 4; + task->data[15] += 4; + } + else + { + task->data[1] = 1; + } + + gBattle_WIN0H = (task->data[14] << 8) | task->data[15]; + task->data[4] += 8; + if (task->data[4] >= task->data[6]) + task->data[4] = task->data[6]; + + sub_8114244(task); + if (task->data[4] == task->data[6] && task->data[1]) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 2: + if (++task->data[1] > 1) + { + task->data[1] = 0; + task->data[2]++; + if (task->data[2] & 1) + { + if (task->data[11]) + task->data[11]--; + } + else + { + if (task->data[12] < 16) + task->data[12]++; + } + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(task->data[11], task->data[12])); + if (task->data[11] == 0 && task->data[12] == 16) + task->data[0]++; + } + break; + case 3: + gScanlineEffect.state = 3; + task->data[0]++; + break; + case 4: + gBattle_WIN0H = 0; + gBattle_WIN0V = 0; + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR); + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR | WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR); + DestroyAnimVisualTask(taskId); + break; + } +} + +static void sub_8114244(struct Task *task) +{ + int var0, var1; + s16 var2; + s16 i; + int var4; + + var2 = task->data[5] - task->data[4]; + if (var2 != 0) + { + var0 = task->data[13] / var2; + var1 = task->data[6] << 8; + + for (i = 0; i < task->data[4]; i++) + { + gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[10] - (i - 159); + } + + for (i = task->data[4]; i <= task->data[5]; i++) + { + if (i >= 0) + { + s16 var3 = (var1 >> 8) - i; + gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = var3 + task->data[10]; + } + + var1 += var0; + } + + var4 = task->data[10] - (i - 159); + for (i = i; i < task->data[7]; i++) + { + if (i >= 0) + { + gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = var4; + var4--; + } + } + } + else + { + var4 = task->data[10] + 159; + for (i = 0; i < 112; i++) + { + gScanlineEffectRegBuffers[0][i] = var4; + gScanlineEffectRegBuffers[1][i] = var4; + var4--; + } + } +} + +static void sub_8114374(u8 priority) +{ + u16 i; + + for (i = 0; i < MAX_BATTLERS_COUNT; i++) + { + u8 spriteId = GetAnimBattlerSpriteId(i); + if (spriteId != 0xFF) + gSprites[spriteId].oam.priority = priority; + } +} + +void sub_81143C0(u8 taskId) +{ + u8 toBG2 = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) ^ 1 ? 1 : 0; + MoveBattlerSpriteToBG(gBattleAnimAttacker, toBG2, TRUE); + gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].invisible = 0; + + if (IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimAttacker))) + { + MoveBattlerSpriteToBG(gBattleAnimAttacker ^ 2, toBG2 ^ 1, TRUE); + gSprites[gBattlerSpriteIds[gBattleAnimAttacker ^ 2]].invisible = 0; + } + + DestroyAnimVisualTask(taskId); +} + +void sub_8114470(u8 taskId) +{ + u8 toBG2 = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) ^ 1 ? 1 : 0; + sub_80A477C(toBG2); + + if (IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimAttacker))) + sub_80A477C(toBG2 ^ 1); + + DestroyAnimVisualTask(taskId); +} + +void sub_81144BC(struct Sprite *sprite) +{ + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + StartSpriteAnim(sprite, gBattleAnimArgs[2]); + sprite->callback = RunStoredCallbackWhenAnimEnds; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); +} + +void sub_81144F8(u8 taskId) +{ + u16 species; + u8 spriteId; + u8 newSpriteId; + u16 paletteNum; + struct UnknownAnimStruct2 unknownStruct; + int var0 = 0; + + gBattle_WIN0H = var0; + gBattle_WIN0V = var0; + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR); + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR | WINOUT_WIN01_BG0 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR); + SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJWIN_ON); + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(8, 12)); + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 0); + SetAnimBgAttribute(1, BG_ANIM_SCREEN_SIZE, 0); + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1); + + if (IsDoubleBattle() && !IsContest()) + { + if (GetBattlerPosition(gBattleAnimAttacker) == B_POSITION_OPPONENT_RIGHT || GetBattlerPosition(gBattleAnimAttacker) == B_POSITION_PLAYER_LEFT) + { + if (IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimAttacker)) == TRUE) + { + gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimAttacker)]].oam.priority--; + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + var0 = 1; + } + } + } + + if (IsContest()) + { + species = gContestResources->field_18->species; + } + else + { + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattleAnimAttacker]], MON_DATA_SPECIES); + else + species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimAttacker]], MON_DATA_SPECIES); + } + + spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); + newSpriteId = sub_80A89C8(gBattleAnimAttacker, spriteId, species); + + sub_80A6B30(&unknownStruct); + sub_80A6D48(unknownStruct.bgId, gUnknown_08C1D210); + sub_80A6CC0(unknownStruct.bgId, gUnknown_08C1D0AC, unknownStruct.tilesOffset); + LoadCompressedPalette(gUnknown_08C1D1E8, unknownStruct.unk8 << 4, 32); + + gBattle_BG1_X = -gSprites[spriteId].pos1.x + 96; + gBattle_BG1_Y = -gSprites[spriteId].pos1.y + 32; + paletteNum = 16 + gSprites[spriteId].oam.paletteNum; + + if (gBattleAnimArgs[1] == 0) + SetGreyscaleOrOriginalPalette(paletteNum, FALSE); + else + BlendPalette(paletteNum * 16, 16, 11, gBattleAnimArgs[2]); + + gTasks[taskId].data[0] = newSpriteId; + gTasks[taskId].data[1] = gBattleAnimArgs[0]; + gTasks[taskId].data[2] = gBattleAnimArgs[1]; + gTasks[taskId].data[3] = gBattleAnimArgs[2]; + gTasks[taskId].data[6] = var0; + gTasks[taskId].func = sub_8114748; +} + +static void sub_8114748(u8 taskId) +{ + struct UnknownAnimStruct2 unknownStruct; + u16 paletteNum; + u8 spriteId; + u8 taskIdCopy = taskId; + + gTasks[taskIdCopy].data[10] += 4; + gBattle_BG1_X -= 4; + if (gTasks[taskIdCopy].data[10] == 128) + { + gTasks[taskIdCopy].data[10] = 0; + gBattle_BG1_X += 128; + gTasks[taskIdCopy].data[11]++; + if (gTasks[taskIdCopy].data[11] == 2) + { + spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); + paletteNum = 16 + gSprites[spriteId].oam.paletteNum; + if (gTasks[taskIdCopy].data[1] == 0) + SetGreyscaleOrOriginalPalette(paletteNum, 1); + + DestroySprite(&gSprites[gTasks[taskIdCopy].data[0]]); + sub_80A6B30(&unknownStruct); + sub_80A6C68(unknownStruct.bgId); + if (gTasks[taskIdCopy].data[6] == 1) + gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimAttacker)]].oam.priority++; + } + else if (gTasks[taskIdCopy].data[11] == 3) + { + gBattle_WIN0H = 0; + gBattle_WIN0V = 0; + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR); + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR | WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR); + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0); + + SetGpuReg(REG_OFFSET_DISPCNT, GetGpuReg(REG_OFFSET_DISPCNT) ^ DISPCNT_OBJWIN_ON); + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + DestroyAnimVisualTask(taskId); + } + } +} + +void sub_811489C(u8 taskId) +{ + u8 spriteId; + u8 battler; + bool8 calcSpriteId = FALSE; + u8 position = B_POSITION_PLAYER_LEFT; + + switch (gBattleAnimArgs[0]) + { + case 0: + case 1: + case 2: + case 3: + spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + break; + case 4: + position = B_POSITION_PLAYER_LEFT; + calcSpriteId = TRUE; + break; + case 5: + position = B_POSITION_PLAYER_RIGHT; + calcSpriteId = TRUE; + break; + case 6: + position = B_POSITION_OPPONENT_LEFT; + calcSpriteId = TRUE; + break; + case 7: + position = B_POSITION_OPPONENT_RIGHT; + calcSpriteId = TRUE; + break; + default: + spriteId = 0xFF; + break; + } + + if (calcSpriteId) + { + battler = GetBattlerAtPosition(position); + if (IsBattlerSpriteVisible(battler)) + spriteId = gBattlerSpriteIds[battler]; + else + spriteId = 0xFF; + } + + if (spriteId != 0xFF) + SetGreyscaleOrOriginalPalette(gSprites[spriteId].oam.paletteNum + 16, gBattleAnimArgs[1]); + + DestroyAnimVisualTask(taskId); +} + +void sub_8114960(u8 taskId) +{ + if (gAnimMoveTurn < 2) + gBattleAnimArgs[7] = 0; + + if (gAnimMoveTurn == 2) + gBattleAnimArgs[7] = 1; + + DestroyAnimVisualTask(taskId); +} diff --git a/src/data/graphics/berry_fix.h b/src/data/graphics/berry_fix.h index aede748a4..07e2cbf51 100644 --- a/src/data/graphics/berry_fix.h +++ b/src/data/graphics/berry_fix.h @@ -20,4 +20,4 @@ const u32 gBerryFixGbaTransferError_Tilemap[] = INCBIN_U32("graphics/berry_fix/g const u16 gBerryFixWindow_Pal[] = INCBIN_U16("graphics/berry_fix/window.gbapal"); const u32 gBerryFixWindow_Gfx[] = INCBIN_U32("graphics/berry_fix/window.4bpp.lz"); -const u32 gBerryFixWindow_Tilemap[] = INCBIN_U32("graphics/berry_fix/window.bin.lz");
\ No newline at end of file +const u32 gBerryFixWindow_Tilemap[] = INCBIN_U32("graphics/berry_fix/window.bin.lz"); diff --git a/src/data/pokemon/base_stats.h b/src/data/pokemon/base_stats.h index 078304888..86ebb620b 100644 --- a/src/data/pokemon/base_stats.h +++ b/src/data/pokemon/base_stats.h @@ -1,7 +1,40 @@ -// Maximum value for a female pokemon is 254 (MON_FEMALE) which is 100% female. -// 255 (MON_GENDERLESS) is reserved for genderless pokemon. +// Maximum value for a female Pokémon is 254 (MON_FEMALE) which is 100% female. +// 255 (MON_GENDERLESS) is reserved for genderless Pokémon. #define PERCENT_FEMALE(percent) min(254, ((percent * 255) / 100)) +#define OLD_UNOWN_BASE_STATS \ + { \ + .baseHP = 50, \ + .baseAttack = 150, \ + .baseDefense = 50, \ + .baseSpAttack = 150, \ + .baseSpDefense = 50, \ + .baseSpeed = 150, \ + .type1 = TYPE_NORMAL, \ + .type2 = TYPE_NORMAL, \ + .catchRate = 3, \ + .expYield = 1, \ + .evYield_HP = 2, \ + .evYield_Attack = 2, \ + .evYield_Defense = 2, \ + .evYield_Speed = 2, \ + .evYield_SpAttack = 2, \ + .evYield_SpDefense = 2, \ + .item1 = ITEM_NONE, \ + .item2 = ITEM_NONE, \ + .genderRatio = MON_GENDERLESS, \ + .eggCycles = 120, \ + .friendship = 0, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_UNDISCOVERED,\ + .eggGroup2 = EGG_GROUP_UNDISCOVERED,\ + .ability1 = ABILITY_NONE, \ + .ability2 = ABILITY_NONE, \ + .safariZoneFleeRate = 0, \ + .bodyColor = BODY_COLOR_BLACK, \ + .noFlip = FALSE, \ + } + const struct BaseStats gBaseStats[] = { [SPECIES_NONE] = {0}, @@ -8289,830 +8322,55 @@ const struct BaseStats gBaseStats[] = .noFlip = FALSE, }, - [SPECIES_OLD_UNOWN_B] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_B] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_C] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_C] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_D] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_D] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_E] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_E] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_F] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_F] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_G] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_G] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_H] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_H] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_I] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_I] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_J] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_J] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_K] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_K] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_L] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_L] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_M] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_M] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_N] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_N] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_O] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_O] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_P] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_P] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_Q] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_Q] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_R] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_R] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_S] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_S] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_T] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_T] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_U] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_U] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_V] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_V] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_W] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_W] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_X] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_X] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_Y] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_Y] = OLD_UNOWN_BASE_STATS, - [SPECIES_OLD_UNOWN_Z] = - { - .baseHP = 50, - .baseAttack = 150, - .baseDefense = 50, - .baseSpeed = 150, - .baseSpAttack = 150, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 1, - .evYield_HP = 2, - .evYield_Attack = 2, - .evYield_Defense = 2, - .evYield_Speed = 2, - .evYield_SpAttack = 2, - .evYield_SpDefense = 2, - .item1 = ITEM_NONE, - .item2 = ITEM_NONE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .ability1 = ABILITY_NONE, - .ability2 = ABILITY_NONE, - .safariZoneFleeRate = 0, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_OLD_UNOWN_Z] = OLD_UNOWN_BASE_STATS, [SPECIES_TREECKO] = { diff --git a/src/data/pokemon/tutor_learnsets.h b/src/data/pokemon/tutor_learnsets.h new file mode 100644 index 000000000..27fb40621 --- /dev/null +++ b/src/data/pokemon/tutor_learnsets.h @@ -0,0 +1,5783 @@ +#define TUTOR_MOVE_MEGA_PUNCH 0 +#define TUTOR_MOVE_SWORDS_DANCE 1 +#define TUTOR_MOVE_MEGA_KICK 2 +#define TUTOR_MOVE_BODY_SLAM 3 +#define TUTOR_MOVE_DOUBLE_EDGE 4 +#define TUTOR_MOVE_COUNTER 5 +#define TUTOR_MOVE_SEISMIC_TOSS 6 +#define TUTOR_MOVE_MIMIC 7 +#define TUTOR_MOVE_METRONOME 8 +#define TUTOR_MOVE_SOFT_BOILED 9 +#define TUTOR_MOVE_DREAM_EATER 10 +#define TUTOR_MOVE_THUNDER_WAVE 11 +#define TUTOR_MOVE_EXPLOSION 12 +#define TUTOR_MOVE_ROCK_SLIDE 13 +#define TUTOR_MOVE_SUBSTITUTE 14 +#define TUTOR_MOVE_DYNAMIC_PUNCH 15 +#define TUTOR_MOVE_ROLLOUT 16 +#define TUTOR_MOVE_PSYCH_UP 17 +#define TUTOR_MOVE_SNORE 18 +#define TUTOR_MOVE_ICY_WIND 19 +#define TUTOR_MOVE_ENDURE 20 +#define TUTOR_MOVE_MUD_SLAP 21 +#define TUTOR_MOVE_ICE_PUNCH 22 +#define TUTOR_MOVE_SWAGGER 23 +#define TUTOR_MOVE_SLEEP_TALK 24 +#define TUTOR_MOVE_SWIFT 25 +#define TUTOR_MOVE_DEFENSE_CURL 26 +#define TUTOR_MOVE_THUNDER_PUNCH 27 +#define TUTOR_MOVE_FIRE_PUNCH 28 +#define TUTOR_MOVE_FURY_CUTTER 29 + +const u16 gTutorMoves[] = +{ + [TUTOR_MOVE_MEGA_PUNCH] = MOVE_MEGA_PUNCH, + [TUTOR_MOVE_SWORDS_DANCE] = MOVE_SWORDS_DANCE, + [TUTOR_MOVE_MEGA_KICK] = MOVE_MEGA_KICK, + [TUTOR_MOVE_BODY_SLAM] = MOVE_BODY_SLAM, + [TUTOR_MOVE_DOUBLE_EDGE] = MOVE_DOUBLE_EDGE, + [TUTOR_MOVE_COUNTER] = MOVE_COUNTER, + [TUTOR_MOVE_SEISMIC_TOSS] = MOVE_SEISMIC_TOSS, + [TUTOR_MOVE_MIMIC] = MOVE_MIMIC, + [TUTOR_MOVE_METRONOME] = MOVE_METRONOME, + [TUTOR_MOVE_SOFT_BOILED] = MOVE_SOFT_BOILED, + [TUTOR_MOVE_DREAM_EATER] = MOVE_DREAM_EATER, + [TUTOR_MOVE_THUNDER_WAVE] = MOVE_THUNDER_WAVE, + [TUTOR_MOVE_EXPLOSION] = MOVE_EXPLOSION, + [TUTOR_MOVE_ROCK_SLIDE] = MOVE_ROCK_SLIDE, + [TUTOR_MOVE_SUBSTITUTE] = MOVE_SUBSTITUTE, + [TUTOR_MOVE_DYNAMIC_PUNCH] = MOVE_DYNAMIC_PUNCH, + [TUTOR_MOVE_ROLLOUT] = MOVE_ROLLOUT, + [TUTOR_MOVE_PSYCH_UP] = MOVE_PSYCH_UP, + [TUTOR_MOVE_SNORE] = MOVE_SNORE, + [TUTOR_MOVE_ICY_WIND] = MOVE_ICY_WIND, + [TUTOR_MOVE_ENDURE] = MOVE_ENDURE, + [TUTOR_MOVE_MUD_SLAP] = MOVE_MUD_SLAP, + [TUTOR_MOVE_ICE_PUNCH] = MOVE_ICE_PUNCH, + [TUTOR_MOVE_SWAGGER] = MOVE_SWAGGER, + [TUTOR_MOVE_SLEEP_TALK] = MOVE_SLEEP_TALK, + [TUTOR_MOVE_SWIFT] = MOVE_SWIFT, + [TUTOR_MOVE_DEFENSE_CURL] = MOVE_DEFENSE_CURL, + [TUTOR_MOVE_THUNDER_PUNCH] = MOVE_THUNDER_PUNCH, + [TUTOR_MOVE_FIRE_PUNCH] = MOVE_FIRE_PUNCH, + [TUTOR_MOVE_FURY_CUTTER] = MOVE_FURY_CUTTER, +}; + +#define TUTOR_LEARNSET(moves) ((u32)(moves)) +#define TUTOR(move) ((u64)1 << (TUTOR_##move)) + +static const u32 sTutorLearnsets[] = +{ + [SPECIES_NONE] = TUTOR_LEARNSET(0), + + [SPECIES_BULBASAUR] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_IVYSAUR] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_VENUSAUR] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_CHARMANDER] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_CHARMELEON] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_CHARIZARD] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_SQUIRTLE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_WARTORTLE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_BLASTOISE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_CATERPIE] = TUTOR_LEARNSET(0), + + [SPECIES_METAPOD] = TUTOR_LEARNSET(0), + + [SPECIES_BUTTERFREE] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_WEEDLE] = TUTOR_LEARNSET(0), + + [SPECIES_KAKUNA] = TUTOR_LEARNSET(0), + + [SPECIES_BEEDRILL] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_PIDGEY] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_PIDGEOTTO] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_PIDGEOT] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_RATTATA] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_RATICATE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_SPEAROW] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_FEAROW] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_EKANS] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_ARBOK] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_PIKACHU] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH)), + + [SPECIES_RAICHU] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH)), + + [SPECIES_SANDSHREW] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_SANDSLASH] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_NIDORAN_F] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_NIDORINA] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_NIDOQUEEN] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_NIDORAN_M] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_NIDORINO] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_NIDOKING] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_CLEFAIRY] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_SOFT_BOILED) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_CLEFABLE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_SOFT_BOILED) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_VULPIX] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_NINETALES] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_JIGGLYPUFF] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_WIGGLYTUFF] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_ZUBAT] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_GOLBAT] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_ODDISH] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_GLOOM] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_VILEPLUME] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_PARAS] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_PARASECT] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_VENONAT] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_VENOMOTH] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_DIGLETT] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_DUGTRIO] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_MEOWTH] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_PERSIAN] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_PSYDUCK] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_GOLDUCK] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_MANKEY] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_PRIMEAPE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_GROWLITHE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_ARCANINE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_POLIWAG] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_POLIWHIRL] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_POLIWRATH] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_ABRA] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_KADABRA] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_ALAKAZAM] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_MACHOP] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_MACHOKE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_MACHAMP] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_BELLSPROUT] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_WEEPINBELL] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_VICTREEBEL] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_TENTACOOL] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_TENTACRUEL] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_GEODUDE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_GRAVELER] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_GOLEM] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_PONYTA] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_RAPIDASH] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_SLOWPOKE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_SLOWBRO] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_MAGNEMITE] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_MAGNETON] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_FARFETCHD] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_DODUO] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_DODRIO] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_SEEL] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_DEWGONG] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_GRIMER] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_MUK] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_SHELLDER] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_CLOYSTER] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_GASTLY] = TUTOR_LEARNSET(TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_HAUNTER] = TUTOR_LEARNSET(TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_GENGAR] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_ONIX] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_DROWZEE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_HYPNO] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_KRABBY] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_KINGLER] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_VOLTORB] = TUTOR_LEARNSET(TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_ELECTRODE] = TUTOR_LEARNSET(TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_EXEGGCUTE] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_EXEGGUTOR] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_CUBONE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_MAROWAK] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_HITMONLEE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_HITMONCHAN] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_LICKITUNG] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_KOFFING] = TUTOR_LEARNSET(TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_WEEZING] = TUTOR_LEARNSET(TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_RHYHORN] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_RHYDON] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_CHANSEY] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_SOFT_BOILED) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_TANGELA] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_KANGASKHAN] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_HORSEA] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_SEADRA] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_GOLDEEN] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_SEAKING] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_STARYU] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_STARMIE] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_MR_MIME] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_SCYTHER] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_JYNX] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_ELECTABUZZ] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_MAGMAR] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_PINSIR] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_TAUROS] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_MAGIKARP] = TUTOR_LEARNSET(0), + + [SPECIES_GYARADOS] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_LAPRAS] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_DITTO] = TUTOR_LEARNSET(0), + + [SPECIES_EEVEE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_VAPOREON] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_JOLTEON] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_FLAREON] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_PORYGON] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_OMANYTE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_OMASTAR] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_KABUTO] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_KABUTOPS] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_AERODACTYL] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_SNORLAX] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_ARTICUNO] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_ZAPDOS] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_MOLTRES] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_DRATINI] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_DRAGONAIR] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_DRAGONITE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_MEWTWO] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_MEW] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_SOFT_BOILED) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_CHIKORITA] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_BAYLEEF] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_MEGANIUM] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_CYNDAQUIL] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_QUILAVA] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_TYPHLOSION] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_TOTODILE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_CROCONAW] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_FERALIGATR] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_SENTRET] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_FURRET] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_HOOTHOOT] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_NOCTOWL] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_LEDYBA] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_THUNDER_PUNCH)), + + [SPECIES_LEDIAN] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_THUNDER_PUNCH)), + + [SPECIES_SPINARAK] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_ARIADOS] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_CROBAT] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_CHINCHOU] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_LANTURN] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_PICHU] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_CLEFFA] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_SOFT_BOILED) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_IGGLYBUFF] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_TOGEPI] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_SOFT_BOILED) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_TOGETIC] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_SOFT_BOILED) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_NATU] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_XATU] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_MAREEP] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_FLAAFFY] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_AMPHAROS] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_BELLOSSOM] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_MARILL] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_AZUMARILL] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_SUDOWOODO] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_POLITOED] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_HOPPIP] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_SKIPLOOM] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_JUMPLUFF] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_AIPOM] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_SUNKERN] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_SUNFLORA] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_YANMA] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_WOOPER] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_QUAGSIRE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_ESPEON] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_UMBREON] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_MURKROW] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_SLOWKING] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_MISDREAVUS] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_UNOWN] = TUTOR_LEARNSET(0), + + [SPECIES_WOBBUFFET] = TUTOR_LEARNSET(0), + + [SPECIES_GIRAFARIG] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_PINECO] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_FORRETRESS] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_DUNSPARCE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_GLIGAR] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_STEELIX] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_SNUBBULL] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_GRANBULL] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_QWILFISH] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_SCIZOR] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_SHUCKLE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_HERACROSS] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_SNEASEL] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_TEDDIURSA] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_URSARING] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_SLUGMA] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_MAGCARGO] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_SWINUB] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_PILOSWINE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_CORSOLA] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_REMORAID] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_OCTILLERY] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_DELIBIRD] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_MANTINE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_SKARMORY] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_HOUNDOUR] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_HOUNDOOM] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_KINGDRA] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_PHANPY] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_DONPHAN] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_PORYGON2] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_STANTLER] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_SMEARGLE] = TUTOR_LEARNSET(0), + + [SPECIES_TYROGUE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_HITMONTOP] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_SMOOCHUM] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_ELEKID] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_MAGBY] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_MILTANK] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_BLISSEY] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_SOFT_BOILED) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_RAIKOU] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_ENTEI] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_SUICUNE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_LARVITAR] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_PUPITAR] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_TYRANITAR] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_LUGIA] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_HO_OH] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_CELEBI] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_TREECKO] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_GROVYLE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_SCEPTILE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_TORCHIC] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_COMBUSKEN] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_BLAZIKEN] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_MUDKIP] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_MARSHTOMP] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_SWAMPERT] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_POOCHYENA] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_MIGHTYENA] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_ZIGZAGOON] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_LINOONE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_WURMPLE] = TUTOR_LEARNSET(0), + + [SPECIES_SILCOON] = TUTOR_LEARNSET(0), + + [SPECIES_BEAUTIFLY] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_CASCOON] = TUTOR_LEARNSET(0), + + [SPECIES_DUSTOX] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_LOTAD] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_LOMBRE] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_LUDICOLO] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_SEEDOT] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_NUZLEAF] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_SHIFTRY] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_NINCADA] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_NINJASK] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_SHEDINJA] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_TAILLOW] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_SWELLOW] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_SHROOMISH] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_BRELOOM] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_SPINDA] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_WINGULL] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_PELIPPER] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_SURSKIT] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_MASQUERAIN] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_WAILMER] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_WAILORD] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_SKITTY] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_DELCATTY] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_KECLEON] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_BALTOY] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_CLAYDOL] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_NOSEPASS] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_TORKOAL] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_SABLEYE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_BARBOACH] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_WHISCASH] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_LUVDISC] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_CORPHISH] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_CRAWDAUNT] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_FEEBAS] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_MILOTIC] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_CARVANHA] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_SHARPEDO] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_TRAPINCH] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_VIBRAVA] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_FLYGON] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_MAKUHITA] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_HARIYAMA] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_ELECTRIKE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_MANECTRIC] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_NUMEL] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_CAMERUPT] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_SPHEAL] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_SEALEO] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_WALREIN] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_CACNEA] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_CACTURNE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_SNORUNT] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_GLALIE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_LUNATONE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_SOLROCK] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_AZURILL] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_SPOINK] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_GRUMPIG] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_PLUSLE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH)), + + [SPECIES_MINUN] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH)), + + [SPECIES_MAWILE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH)), + + [SPECIES_MEDITITE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_MEDICHAM] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_SWABLU] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_ALTARIA] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_WYNAUT] = TUTOR_LEARNSET(0), + + [SPECIES_DUSKULL] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_DUSCLOPS] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_ROSELIA] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_SLAKOTH] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_VIGOROTH] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_SLAKING] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_GULPIN] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_SWALOT] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_TROPIUS] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_WHISMUR] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_LOUDRED] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_EXPLOUD] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_CLAMPERL] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_HUNTAIL] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_GOREBYSS] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT)), + + [SPECIES_ABSOL] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_SHUPPET] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_BANETTE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_SEVIPER] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_ZANGOOSE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_RELICANTH] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_ARON] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_LAIRON] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_AGGRON] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_CASTFORM] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_VOLBEAT] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_THUNDER_PUNCH)), + + [SPECIES_ILLUMISE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_THUNDER_PUNCH)), + + [SPECIES_LILEEP] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_CRADILY] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK)), + + [SPECIES_ANORITH] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_ARMALDO] = TUTOR_LEARNSET(TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_RALTS] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_KIRLIA] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_GARDEVOIR] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_BAGON] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_SHELGON] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_SALAMENCE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_BELDUM] = TUTOR_LEARNSET(0), + + [SPECIES_METANG] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_METAGROSS] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_REGIROCK] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_REGICE] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH)), + + [SPECIES_REGISTEEL] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_EXPLOSION) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH)), + + [SPECIES_KYOGRE] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL)), + + [SPECIES_GROUDON] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_SWORDS_DANCE) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_RAYQUAZA] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_LATIAS] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_LATIOS] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_FURY_CUTTER)), + + [SPECIES_JIRACHI] = TUTOR_LEARNSET(TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_METRONOME) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_DEFENSE_CURL) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_DEOXYS] = TUTOR_LEARNSET(TUTOR(MOVE_MEGA_PUNCH) + | TUTOR(MOVE_MEGA_KICK) + | TUTOR(MOVE_BODY_SLAM) + | TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_COUNTER) + | TUTOR(MOVE_SEISMIC_TOSS) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_THUNDER_WAVE) + | TUTOR(MOVE_ROCK_SLIDE) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_DYNAMIC_PUNCH) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_MUD_SLAP) + | TUTOR(MOVE_ICE_PUNCH) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_SWIFT) + | TUTOR(MOVE_THUNDER_PUNCH) + | TUTOR(MOVE_FIRE_PUNCH)), + + [SPECIES_CHIMECHO] = TUTOR_LEARNSET(TUTOR(MOVE_DOUBLE_EDGE) + | TUTOR(MOVE_MIMIC) + | TUTOR(MOVE_DREAM_EATER) + | TUTOR(MOVE_SUBSTITUTE) + | TUTOR(MOVE_ROLLOUT) + | TUTOR(MOVE_PSYCH_UP) + | TUTOR(MOVE_SNORE) + | TUTOR(MOVE_ICY_WIND) + | TUTOR(MOVE_ENDURE) + | TUTOR(MOVE_SWAGGER) + | TUTOR(MOVE_SLEEP_TALK) + | TUTOR(MOVE_DEFENSE_CURL)), + +}; + diff --git a/src/data/wild_encounters.h b/src/data/wild_encounters.h new file mode 100644 index 000000000..d1f2eb616 --- /dev/null +++ b/src/data/wild_encounters.h @@ -0,0 +1,4573 @@ +// const rom data + +/*This file consists of several parts. + *First, the actual tables that define the available Pokemon and their level ranges. + *Second, the headers for each area that links the tables to the actual maps. + *Third, Battle Pyramid-specific tables and headers. + *Fourth, Battle Pike-specific tables and headers. + *And then finally, Feebas-related data. + *You can search for // to jump between the sections. + */ + + //Start of regular Pokemon tables. + +const struct WildPokemon gRoute101_LandMons[] = +{ + {2, 2, SPECIES_WURMPLE}, + {2, 2, SPECIES_POOCHYENA}, + {2, 2, SPECIES_WURMPLE}, + {3, 3, SPECIES_WURMPLE}, + {3, 3, SPECIES_POOCHYENA}, + {3, 3, SPECIES_POOCHYENA}, + {3, 3, SPECIES_WURMPLE}, + {3, 3, SPECIES_POOCHYENA}, + {2, 2, SPECIES_ZIGZAGOON}, + {2, 2, SPECIES_ZIGZAGOON}, + {3, 3, SPECIES_ZIGZAGOON}, + {3, 3, SPECIES_ZIGZAGOON}, +}; + +const struct WildPokemonInfo gRoute101_LandMonsInfo = {20, gRoute101_LandMons}; + +const struct WildPokemon gRoute102_LandMons[] = +{ + {3, 3, SPECIES_POOCHYENA}, + {3, 3, SPECIES_WURMPLE}, + {4, 4, SPECIES_POOCHYENA}, + {4, 4, SPECIES_WURMPLE}, + {3, 3, SPECIES_LOTAD}, + {4, 4, SPECIES_LOTAD}, + {3, 3, SPECIES_ZIGZAGOON}, + {3, 3, SPECIES_ZIGZAGOON}, + {4, 4, SPECIES_ZIGZAGOON}, + {4, 4, SPECIES_RALTS}, + {4, 4, SPECIES_ZIGZAGOON}, + {3, 3, SPECIES_SEEDOT}, +}; + +const struct WildPokemonInfo gRoute102_LandMonsInfo = {20, gRoute102_LandMons}; + +const struct WildPokemon gRoute102_WaterMons[] = +{ + {20, 30, SPECIES_MARILL}, + {10, 20, SPECIES_MARILL}, + {30, 35, SPECIES_MARILL}, + {5, 10, SPECIES_MARILL}, + {20, 30, SPECIES_GOLDEEN}, +}; + +const struct WildPokemonInfo gRoute102_WaterMonsInfo = {4, gRoute102_WaterMons}; + +const struct WildPokemon gRoute102_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_GOLDEEN}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_GOLDEEN}, + {10, 30, SPECIES_CORPHISH}, + {25, 30, SPECIES_CORPHISH}, + {30, 35, SPECIES_CORPHISH}, + {20, 25, SPECIES_CORPHISH}, + {35, 40, SPECIES_CORPHISH}, + {40, 45, SPECIES_CORPHISH}, +}; + +const struct WildPokemonInfo gRoute102_FishingMonsInfo = {30, gRoute102_FishingMons}; + +const struct WildPokemon gRoute103_LandMons[] = +{ + {2, 2, SPECIES_POOCHYENA}, + {3, 3, SPECIES_POOCHYENA}, + {3, 3, SPECIES_POOCHYENA}, + {4, 4, SPECIES_POOCHYENA}, + {2, 2, SPECIES_WINGULL}, + {3, 3, SPECIES_ZIGZAGOON}, + {3, 3, SPECIES_ZIGZAGOON}, + {4, 4, SPECIES_ZIGZAGOON}, + {3, 3, SPECIES_WINGULL}, + {3, 3, SPECIES_WINGULL}, + {2, 2, SPECIES_WINGULL}, + {4, 4, SPECIES_WINGULL}, +}; + +const struct WildPokemonInfo gRoute103_LandMonsInfo = {20, gRoute103_LandMons}; + +const struct WildPokemon gRoute103_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute103_WaterMonsInfo = {4, gRoute103_WaterMons}; + +const struct WildPokemon gRoute103_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_SHARPEDO}, + {30, 35, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute103_FishingMonsInfo = {30, gRoute103_FishingMons}; + +const struct WildPokemon gRoute104_LandMons[] = +{ + {4, 4, SPECIES_POOCHYENA}, + {4, 4, SPECIES_WURMPLE}, + {5, 5, SPECIES_POOCHYENA}, + {5, 5, SPECIES_MARILL}, + {4, 4, SPECIES_MARILL}, + {5, 5, SPECIES_POOCHYENA}, + {4, 4, SPECIES_TAILLOW}, + {5, 5, SPECIES_TAILLOW}, + {4, 4, SPECIES_WINGULL}, + {4, 4, SPECIES_WINGULL}, + {3, 3, SPECIES_WINGULL}, + {5, 5, SPECIES_WINGULL}, +}; + +const struct WildPokemonInfo gRoute104_LandMonsInfo = {20, gRoute104_LandMons}; + +const struct WildPokemon gRoute104_WaterMons[] = +{ + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute104_WaterMonsInfo = {4, gRoute104_WaterMons}; + +const struct WildPokemon gRoute104_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_MAGIKARP}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_MAGIKARP}, + {25, 30, SPECIES_MAGIKARP}, + {30, 35, SPECIES_MAGIKARP}, + {20, 25, SPECIES_MAGIKARP}, + {35, 40, SPECIES_MAGIKARP}, + {40, 45, SPECIES_MAGIKARP}, +}; + +const struct WildPokemonInfo gRoute104_FishingMonsInfo = {30, gRoute104_FishingMons}; + +const struct WildPokemon gRoute105_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute105_WaterMonsInfo = {4, gRoute105_WaterMons}; + +const struct WildPokemon gRoute105_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_WAILMER}, + {20, 25, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute105_FishingMonsInfo = {30, gRoute105_FishingMons}; + +const struct WildPokemon gRoute110_LandMons[] = +{ + {12, 12, SPECIES_POOCHYENA}, + {12, 12, SPECIES_ELECTRIKE}, + {12, 12, SPECIES_GULPIN}, + {13, 13, SPECIES_ELECTRIKE}, + {13, 13, SPECIES_MINUN}, + {13, 13, SPECIES_ODDISH}, + {13, 13, SPECIES_MINUN}, + {13, 13, SPECIES_GULPIN}, + {12, 12, SPECIES_WINGULL}, + {12, 12, SPECIES_WINGULL}, + {12, 12, SPECIES_PLUSLE}, + {13, 13, SPECIES_PLUSLE}, +}; + +const struct WildPokemonInfo gRoute110_LandMonsInfo = {20, gRoute110_LandMons}; + +const struct WildPokemon gRoute110_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute110_WaterMonsInfo = {4, gRoute110_WaterMons}; + +const struct WildPokemon gRoute110_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_WAILMER}, + {20, 25, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute110_FishingMonsInfo = {30, gRoute110_FishingMons}; + +const struct WildPokemon gRoute111_LandMons[] = +{ + {20, 20, SPECIES_SANDSHREW}, + {20, 20, SPECIES_TRAPINCH}, + {21, 21, SPECIES_SANDSHREW}, + {21, 21, SPECIES_TRAPINCH}, + {19, 19, SPECIES_BALTOY}, + {21, 21, SPECIES_BALTOY}, + {19, 19, SPECIES_SANDSHREW}, + {19, 19, SPECIES_TRAPINCH}, + {20, 20, SPECIES_BALTOY}, + {20, 20, SPECIES_CACNEA}, + {22, 22, SPECIES_CACNEA}, + {22, 22, SPECIES_CACNEA}, +}; + +const struct WildPokemonInfo gRoute111_LandMonsInfo = {10, gRoute111_LandMons}; + +const struct WildPokemon gRoute111_WaterMons[] = +{ + {20, 30, SPECIES_MARILL}, + {10, 20, SPECIES_MARILL}, + {30, 35, SPECIES_MARILL}, + {5, 10, SPECIES_MARILL}, + {20, 30, SPECIES_GOLDEEN}, +}; + +const struct WildPokemonInfo gRoute111_WaterMonsInfo = {4, gRoute111_WaterMons}; + +const struct WildPokemon gRoute111_RockSmashMons[] = +{ + {10, 15, SPECIES_GEODUDE}, + {5, 10, SPECIES_GEODUDE}, + {15, 20, SPECIES_GEODUDE}, + {15, 20, SPECIES_GEODUDE}, + {15, 20, SPECIES_GEODUDE}, +}; + +const struct WildPokemonInfo gRoute111_RockSmashMonsInfo = {20, gRoute111_RockSmashMons}; + +const struct WildPokemon gRoute111_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_GOLDEEN}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_GOLDEEN}, + {10, 30, SPECIES_BARBOACH}, + {25, 30, SPECIES_BARBOACH}, + {30, 35, SPECIES_BARBOACH}, + {20, 25, SPECIES_BARBOACH}, + {35, 40, SPECIES_BARBOACH}, + {40, 45, SPECIES_BARBOACH}, +}; + +const struct WildPokemonInfo gRoute111_FishingMonsInfo = {30, gRoute111_FishingMons}; + +const struct WildPokemon gRoute112_LandMons[] = +{ + {15, 15, SPECIES_NUMEL}, + {15, 15, SPECIES_NUMEL}, + {15, 15, SPECIES_MARILL}, + {14, 14, SPECIES_NUMEL}, + {14, 14, SPECIES_NUMEL}, + {14, 14, SPECIES_MARILL}, + {16, 16, SPECIES_NUMEL}, + {16, 16, SPECIES_MARILL}, + {16, 16, SPECIES_NUMEL}, + {16, 16, SPECIES_NUMEL}, + {16, 16, SPECIES_NUMEL}, + {16, 16, SPECIES_NUMEL}, +}; + +const struct WildPokemonInfo gRoute112_LandMonsInfo = {20, gRoute112_LandMons}; + +const struct WildPokemon gRoute113_LandMons[] = +{ + {15, 15, SPECIES_SPINDA}, + {15, 15, SPECIES_SPINDA}, + {15, 15, SPECIES_SLUGMA}, + {14, 14, SPECIES_SPINDA}, + {14, 14, SPECIES_SPINDA}, + {14, 14, SPECIES_SLUGMA}, + {16, 16, SPECIES_SPINDA}, + {16, 16, SPECIES_SLUGMA}, + {16, 16, SPECIES_SPINDA}, + {16, 16, SPECIES_SKARMORY}, + {16, 16, SPECIES_SPINDA}, + {16, 16, SPECIES_SKARMORY}, +}; + +const struct WildPokemonInfo gRoute113_LandMonsInfo = {20, gRoute113_LandMons}; + +const struct WildPokemon gRoute114_LandMons[] = +{ + {16, 16, SPECIES_SWABLU}, + {16, 16, SPECIES_LOTAD}, + {17, 17, SPECIES_SWABLU}, + {15, 15, SPECIES_SWABLU}, + {15, 15, SPECIES_LOTAD}, + {16, 16, SPECIES_LOMBRE}, + {16, 16, SPECIES_LOMBRE}, + {18, 18, SPECIES_LOMBRE}, + {17, 17, SPECIES_SEVIPER}, + {15, 15, SPECIES_SEVIPER}, + {17, 17, SPECIES_SEVIPER}, + {15, 15, SPECIES_NUZLEAF}, +}; + +const struct WildPokemonInfo gRoute114_LandMonsInfo = {20, gRoute114_LandMons}; + +const struct WildPokemon gRoute114_WaterMons[] = +{ + {20, 30, SPECIES_MARILL}, + {10, 20, SPECIES_MARILL}, + {30, 35, SPECIES_MARILL}, + {5, 10, SPECIES_MARILL}, + {20, 30, SPECIES_GOLDEEN}, +}; + +const struct WildPokemonInfo gRoute114_WaterMonsInfo = {4, gRoute114_WaterMons}; + +const struct WildPokemon gRoute114_RockSmashMons[] = +{ + {10, 15, SPECIES_GEODUDE}, + {5, 10, SPECIES_GEODUDE}, + {15, 20, SPECIES_GEODUDE}, + {15, 20, SPECIES_GEODUDE}, + {15, 20, SPECIES_GEODUDE}, +}; + +const struct WildPokemonInfo gRoute114_RockSmashMonsInfo = {20, gRoute114_RockSmashMons}; + +const struct WildPokemon gRoute114_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_GOLDEEN}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_GOLDEEN}, + {10, 30, SPECIES_BARBOACH}, + {25, 30, SPECIES_BARBOACH}, + {30, 35, SPECIES_BARBOACH}, + {20, 25, SPECIES_BARBOACH}, + {35, 40, SPECIES_BARBOACH}, + {40, 45, SPECIES_BARBOACH}, +}; + +const struct WildPokemonInfo gRoute114_FishingMonsInfo = {30, gRoute114_FishingMons}; + +const struct WildPokemon gRoute116_LandMons[] = +{ + {6, 6, SPECIES_POOCHYENA}, + {6, 6, SPECIES_WHISMUR}, + {6, 6, SPECIES_NINCADA}, + {7, 7, SPECIES_ABRA}, + {7, 7, SPECIES_NINCADA}, + {6, 6, SPECIES_TAILLOW}, + {7, 7, SPECIES_TAILLOW}, + {8, 8, SPECIES_TAILLOW}, + {7, 7, SPECIES_POOCHYENA}, + {8, 8, SPECIES_POOCHYENA}, + {7, 7, SPECIES_SKITTY}, + {8, 8, SPECIES_SKITTY}, +}; + +const struct WildPokemonInfo gRoute116_LandMonsInfo = {20, gRoute116_LandMons}; + +const struct WildPokemon gRoute117_LandMons[] = +{ + {13, 13, SPECIES_POOCHYENA}, + {13, 13, SPECIES_ODDISH}, + {14, 14, SPECIES_POOCHYENA}, + {14, 14, SPECIES_ODDISH}, + {13, 13, SPECIES_MARILL}, + {13, 13, SPECIES_ODDISH}, + {13, 13, SPECIES_ILLUMISE}, + {13, 13, SPECIES_ILLUMISE}, + {14, 14, SPECIES_ILLUMISE}, + {14, 14, SPECIES_ILLUMISE}, + {13, 13, SPECIES_VOLBEAT}, + {13, 13, SPECIES_SEEDOT}, +}; + +const struct WildPokemonInfo gRoute117_LandMonsInfo = {20, gRoute117_LandMons}; + +const struct WildPokemon gRoute117_WaterMons[] = +{ + {20, 30, SPECIES_MARILL}, + {10, 20, SPECIES_MARILL}, + {30, 35, SPECIES_MARILL}, + {5, 10, SPECIES_MARILL}, + {20, 30, SPECIES_GOLDEEN}, +}; + +const struct WildPokemonInfo gRoute117_WaterMonsInfo = {4, gRoute117_WaterMons}; + +const struct WildPokemon gRoute117_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_GOLDEEN}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_GOLDEEN}, + {10, 30, SPECIES_CORPHISH}, + {25, 30, SPECIES_CORPHISH}, + {30, 35, SPECIES_CORPHISH}, + {20, 25, SPECIES_CORPHISH}, + {35, 40, SPECIES_CORPHISH}, + {40, 45, SPECIES_CORPHISH}, +}; + +const struct WildPokemonInfo gRoute117_FishingMonsInfo = {30, gRoute117_FishingMons}; + +const struct WildPokemon gRoute118_LandMons[] = +{ + {24, 24, SPECIES_ZIGZAGOON}, + {24, 24, SPECIES_ELECTRIKE}, + {26, 26, SPECIES_ZIGZAGOON}, + {26, 26, SPECIES_ELECTRIKE}, + {26, 26, SPECIES_LINOONE}, + {26, 26, SPECIES_MANECTRIC}, + {25, 25, SPECIES_WINGULL}, + {25, 25, SPECIES_WINGULL}, + {26, 26, SPECIES_WINGULL}, + {26, 26, SPECIES_WINGULL}, + {27, 27, SPECIES_WINGULL}, + {25, 25, SPECIES_KECLEON}, +}; + +const struct WildPokemonInfo gRoute118_LandMonsInfo = {20, gRoute118_LandMons}; + +const struct WildPokemon gRoute118_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute118_WaterMonsInfo = {4, gRoute118_WaterMons}; + +const struct WildPokemon gRoute118_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_CARVANHA}, + {30, 35, SPECIES_SHARPEDO}, + {30, 35, SPECIES_CARVANHA}, + {20, 25, SPECIES_CARVANHA}, + {35, 40, SPECIES_CARVANHA}, + {40, 45, SPECIES_CARVANHA}, +}; + +const struct WildPokemonInfo gRoute118_FishingMonsInfo = {30, gRoute118_FishingMons}; + +const struct WildPokemon gRoute124_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute124_WaterMonsInfo = {4, gRoute124_WaterMons}; + +const struct WildPokemon gRoute124_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_SHARPEDO}, + {30, 35, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute124_FishingMonsInfo = {30, gRoute124_FishingMons}; + +const struct WildPokemon gPetalburgWoods_LandMons[] = +{ + {5, 5, SPECIES_POOCHYENA}, + {5, 5, SPECIES_WURMPLE}, + {5, 5, SPECIES_SHROOMISH}, + {6, 6, SPECIES_POOCHYENA}, + {5, 5, SPECIES_SILCOON}, + {5, 5, SPECIES_CASCOON}, + {6, 6, SPECIES_WURMPLE}, + {6, 6, SPECIES_SHROOMISH}, + {5, 5, SPECIES_TAILLOW}, + {5, 5, SPECIES_SLAKOTH}, + {6, 6, SPECIES_TAILLOW}, + {6, 6, SPECIES_SLAKOTH}, +}; + +const struct WildPokemonInfo gPetalburgWoods_LandMonsInfo = {20, gPetalburgWoods_LandMons}; + +const struct WildPokemon gRusturfTunnel_LandMons[] = +{ + {6, 6, SPECIES_WHISMUR}, + {7, 7, SPECIES_WHISMUR}, + {6, 6, SPECIES_WHISMUR}, + {6, 6, SPECIES_WHISMUR}, + {7, 7, SPECIES_WHISMUR}, + {7, 7, SPECIES_WHISMUR}, + {5, 5, SPECIES_WHISMUR}, + {8, 8, SPECIES_WHISMUR}, + {5, 5, SPECIES_WHISMUR}, + {8, 8, SPECIES_WHISMUR}, + {5, 5, SPECIES_WHISMUR}, + {8, 8, SPECIES_WHISMUR}, +}; + +const struct WildPokemonInfo gRusturfTunnel_LandMonsInfo = {10, gRusturfTunnel_LandMons}; + +const struct WildPokemon gGraniteCave_1F_LandMons[] = +{ + {7, 7, SPECIES_ZUBAT}, + {8, 8, SPECIES_MAKUHITA}, + {7, 7, SPECIES_MAKUHITA}, + {8, 8, SPECIES_ZUBAT}, + {9, 9, SPECIES_MAKUHITA}, + {8, 8, SPECIES_ABRA}, + {10, 10, SPECIES_MAKUHITA}, + {6, 6, SPECIES_MAKUHITA}, + {7, 7, SPECIES_GEODUDE}, + {8, 8, SPECIES_GEODUDE}, + {6, 6, SPECIES_GEODUDE}, + {9, 9, SPECIES_GEODUDE}, +}; + +const struct WildPokemonInfo gGraniteCave_1F_LandMonsInfo = {10, gGraniteCave_1F_LandMons}; + +const struct WildPokemon gGraniteCave_B1F_LandMons[] = +{ + {9, 9, SPECIES_ZUBAT}, + {10, 10, SPECIES_ARON}, + {9, 9, SPECIES_ARON}, + {11, 11, SPECIES_ARON}, + {10, 10, SPECIES_ZUBAT}, + {9, 9, SPECIES_ABRA}, + {10, 10, SPECIES_MAKUHITA}, + {11, 11, SPECIES_MAKUHITA}, + {10, 10, SPECIES_SABLEYE}, + {10, 10, SPECIES_SABLEYE}, + {9, 9, SPECIES_SABLEYE}, + {11, 11, SPECIES_SABLEYE}, +}; + +const struct WildPokemonInfo gGraniteCave_B1F_LandMonsInfo = {10, gGraniteCave_B1F_LandMons}; + +const struct WildPokemon gMtPyre_1F_LandMons[] = +{ + {27, 27, SPECIES_SHUPPET}, + {28, 28, SPECIES_SHUPPET}, + {26, 26, SPECIES_SHUPPET}, + {25, 25, SPECIES_SHUPPET}, + {29, 29, SPECIES_SHUPPET}, + {24, 24, SPECIES_SHUPPET}, + {23, 23, SPECIES_SHUPPET}, + {22, 22, SPECIES_SHUPPET}, + {29, 29, SPECIES_SHUPPET}, + {24, 24, SPECIES_SHUPPET}, + {29, 29, SPECIES_SHUPPET}, + {24, 24, SPECIES_SHUPPET}, +}; + +const struct WildPokemonInfo gMtPyre_1F_LandMonsInfo = {10, gMtPyre_1F_LandMons}; + +const struct WildPokemon gVictoryRoad_1F_LandMons[] = +{ + {40, 40, SPECIES_GOLBAT}, + {40, 40, SPECIES_HARIYAMA}, + {40, 40, SPECIES_LAIRON}, + {40, 40, SPECIES_LOUDRED}, + {36, 36, SPECIES_ZUBAT}, + {36, 36, SPECIES_MAKUHITA}, + {38, 38, SPECIES_GOLBAT}, + {38, 38, SPECIES_HARIYAMA}, + {36, 36, SPECIES_ARON}, + {36, 36, SPECIES_WHISMUR}, + {36, 36, SPECIES_ARON}, + {36, 36, SPECIES_WHISMUR}, +}; + +const struct WildPokemonInfo gVictoryRoad_1F_LandMonsInfo = {10, gVictoryRoad_1F_LandMons}; + +const struct WildPokemon gSafariZone_South_LandMons[] = +{ + {25, 25, SPECIES_ODDISH}, + {27, 27, SPECIES_ODDISH}, + {25, 25, SPECIES_GIRAFARIG}, + {27, 27, SPECIES_GIRAFARIG}, + {25, 25, SPECIES_NATU}, + {25, 25, SPECIES_DODUO}, + {25, 25, SPECIES_GLOOM}, + {27, 27, SPECIES_WOBBUFFET}, + {25, 25, SPECIES_PIKACHU}, + {27, 27, SPECIES_WOBBUFFET}, + {27, 27, SPECIES_PIKACHU}, + {29, 29, SPECIES_WOBBUFFET}, +}; + +const struct WildPokemonInfo gSafariZone_South_LandMonsInfo = {25, gSafariZone_South_LandMons}; + +const struct WildPokemon gUnderwater2_WaterMons[] = +{ + {20, 30, SPECIES_CLAMPERL}, + {20, 30, SPECIES_CHINCHOU}, + {30, 35, SPECIES_CLAMPERL}, + {30, 35, SPECIES_RELICANTH}, + {30, 35, SPECIES_RELICANTH}, +}; + +const struct WildPokemonInfo gUnderwater2_WaterMonsInfo = {4, gUnderwater2_WaterMons}; + +const struct WildPokemon gAbandonedShip_Rooms_B1F_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {5, 35, SPECIES_TENTACOOL}, + {5, 35, SPECIES_TENTACOOL}, + {5, 35, SPECIES_TENTACOOL}, + {30, 35, SPECIES_TENTACRUEL}, +}; + +const struct WildPokemonInfo gAbandonedShip_Rooms_B1F_WaterMonsInfo = {4, gAbandonedShip_Rooms_B1F_WaterMons}; + +const struct WildPokemon gAbandonedShip_Rooms_B1F_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_TENTACOOL}, + {25, 30, SPECIES_TENTACOOL}, + {30, 35, SPECIES_TENTACOOL}, + {30, 35, SPECIES_TENTACRUEL}, + {25, 30, SPECIES_TENTACRUEL}, + {20, 25, SPECIES_TENTACRUEL}, +}; + +const struct WildPokemonInfo gAbandonedShip_Rooms_B1F_FishingMonsInfo = {20, gAbandonedShip_Rooms_B1F_FishingMons}; + +const struct WildPokemon gGraniteCave_B2F_LandMons[] = +{ + {10, 10, SPECIES_ZUBAT}, + {11, 11, SPECIES_ARON}, + {10, 10, SPECIES_ARON}, + {11, 11, SPECIES_ZUBAT}, + {12, 12, SPECIES_ARON}, + {10, 10, SPECIES_ABRA}, + {10, 10, SPECIES_SABLEYE}, + {11, 11, SPECIES_SABLEYE}, + {12, 12, SPECIES_SABLEYE}, + {10, 10, SPECIES_SABLEYE}, + {12, 12, SPECIES_SABLEYE}, + {10, 10, SPECIES_SABLEYE}, +}; + +const struct WildPokemonInfo gGraniteCave_B2F_LandMonsInfo = {10, gGraniteCave_B2F_LandMons}; + +const struct WildPokemon gGraniteCave_B2F_RockSmashMons[] = +{ + {10, 15, SPECIES_GEODUDE}, + {10, 20, SPECIES_NOSEPASS}, + {5, 10, SPECIES_GEODUDE}, + {15, 20, SPECIES_GEODUDE}, + {15, 20, SPECIES_GEODUDE}, +}; + +const struct WildPokemonInfo gGraniteCave_B2F_RockSmashMonsInfo = {20, gGraniteCave_B2F_RockSmashMons}; + +const struct WildPokemon gFieryPath_LandMons[] = +{ + {15, 15, SPECIES_NUMEL}, + {15, 15, SPECIES_KOFFING}, + {16, 16, SPECIES_NUMEL}, + {15, 15, SPECIES_MACHOP}, + {15, 15, SPECIES_TORKOAL}, + {15, 15, SPECIES_SLUGMA}, + {16, 16, SPECIES_KOFFING}, + {16, 16, SPECIES_MACHOP}, + {14, 14, SPECIES_TORKOAL}, + {16, 16, SPECIES_TORKOAL}, + {14, 14, SPECIES_GRIMER}, + {14, 14, SPECIES_GRIMER}, +}; + +const struct WildPokemonInfo gFieryPath_LandMonsInfo = {10, gFieryPath_LandMons}; + +const struct WildPokemon gMeteorFalls_B1F_2R_LandMons[] = +{ + {33, 33, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {30, 30, SPECIES_BAGON}, + {35, 35, SPECIES_SOLROCK}, + {35, 35, SPECIES_BAGON}, + {37, 37, SPECIES_SOLROCK}, + {25, 25, SPECIES_BAGON}, + {39, 39, SPECIES_SOLROCK}, + {38, 38, SPECIES_GOLBAT}, + {40, 40, SPECIES_GOLBAT}, + {38, 38, SPECIES_GOLBAT}, + {40, 40, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gMeteorFalls_B1F_2R_LandMonsInfo = {10, gMeteorFalls_B1F_2R_LandMons}; + +const struct WildPokemon gMeteorFalls_B1F_2R_WaterMons[] = +{ + {30, 35, SPECIES_GOLBAT}, + {30, 35, SPECIES_GOLBAT}, + {25, 35, SPECIES_SOLROCK}, + {15, 25, SPECIES_SOLROCK}, + {5, 15, SPECIES_SOLROCK}, +}; + +const struct WildPokemonInfo gMeteorFalls_B1F_2R_WaterMonsInfo = {4, gMeteorFalls_B1F_2R_WaterMons}; + +const struct WildPokemon gMeteorFalls_B1F_2R_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_GOLDEEN}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_GOLDEEN}, + {10, 30, SPECIES_BARBOACH}, + {25, 30, SPECIES_BARBOACH}, + {30, 35, SPECIES_BARBOACH}, + {30, 35, SPECIES_WHISCASH}, + {35, 40, SPECIES_WHISCASH}, + {40, 45, SPECIES_WHISCASH}, +}; + +const struct WildPokemonInfo gMeteorFalls_B1F_2R_FishingMonsInfo = {30, gMeteorFalls_B1F_2R_FishingMons}; + +const struct WildPokemon gJaggedPass_LandMons[] = +{ + {21, 21, SPECIES_NUMEL}, + {21, 21, SPECIES_NUMEL}, + {21, 21, SPECIES_MACHOP}, + {20, 20, SPECIES_NUMEL}, + {20, 20, SPECIES_SPOINK}, + {20, 20, SPECIES_MACHOP}, + {21, 21, SPECIES_SPOINK}, + {22, 22, SPECIES_MACHOP}, + {22, 22, SPECIES_NUMEL}, + {22, 22, SPECIES_SPOINK}, + {22, 22, SPECIES_NUMEL}, + {22, 22, SPECIES_SPOINK}, +}; + +const struct WildPokemonInfo gJaggedPass_LandMonsInfo = {20, gJaggedPass_LandMons}; + +const struct WildPokemon gRoute106_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute106_WaterMonsInfo = {4, gRoute106_WaterMons}; + +const struct WildPokemon gRoute106_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_WAILMER}, + {20, 25, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute106_FishingMonsInfo = {30, gRoute106_FishingMons}; + +const struct WildPokemon gRoute107_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute107_WaterMonsInfo = {4, gRoute107_WaterMons}; + +const struct WildPokemon gRoute107_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_WAILMER}, + {20, 25, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute107_FishingMonsInfo = {30, gRoute107_FishingMons}; + +const struct WildPokemon gRoute108_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute108_WaterMonsInfo = {4, gRoute108_WaterMons}; + +const struct WildPokemon gRoute108_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_WAILMER}, + {20, 25, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute108_FishingMonsInfo = {30, gRoute108_FishingMons}; + +const struct WildPokemon gRoute109_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute109_WaterMonsInfo = {4, gRoute109_WaterMons}; + +const struct WildPokemon gRoute109_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_WAILMER}, + {20, 25, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute109_FishingMonsInfo = {30, gRoute109_FishingMons}; + +const struct WildPokemon gRoute115_LandMons[] = +{ + {23, 23, SPECIES_SWABLU}, + {23, 23, SPECIES_TAILLOW}, + {25, 25, SPECIES_SWABLU}, + {24, 24, SPECIES_TAILLOW}, + {25, 25, SPECIES_TAILLOW}, + {25, 25, SPECIES_SWELLOW}, + {24, 24, SPECIES_JIGGLYPUFF}, + {25, 25, SPECIES_JIGGLYPUFF}, + {24, 24, SPECIES_WINGULL}, + {24, 24, SPECIES_WINGULL}, + {26, 26, SPECIES_WINGULL}, + {25, 25, SPECIES_WINGULL}, +}; + +const struct WildPokemonInfo gRoute115_LandMonsInfo = {20, gRoute115_LandMons}; + +const struct WildPokemon gRoute115_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute115_WaterMonsInfo = {4, gRoute115_WaterMons}; + +const struct WildPokemon gRoute115_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_WAILMER}, + {20, 25, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute115_FishingMonsInfo = {30, gRoute115_FishingMons}; + +const struct WildPokemon gNewMauville_Inside_LandMons[] = +{ + {24, 24, SPECIES_VOLTORB}, + {24, 24, SPECIES_MAGNEMITE}, + {25, 25, SPECIES_VOLTORB}, + {25, 25, SPECIES_MAGNEMITE}, + {23, 23, SPECIES_VOLTORB}, + {23, 23, SPECIES_MAGNEMITE}, + {26, 26, SPECIES_VOLTORB}, + {26, 26, SPECIES_MAGNEMITE}, + {22, 22, SPECIES_VOLTORB}, + {22, 22, SPECIES_MAGNEMITE}, + {26, 26, SPECIES_ELECTRODE}, + {26, 26, SPECIES_MAGNETON}, +}; + +const struct WildPokemonInfo gNewMauville_Inside_LandMonsInfo = {10, gNewMauville_Inside_LandMons}; + +const struct WildPokemon gRoute119_LandMons[] = +{ + {25, 25, SPECIES_ZIGZAGOON}, + {25, 25, SPECIES_LINOONE}, + {27, 27, SPECIES_ZIGZAGOON}, + {25, 25, SPECIES_ODDISH}, + {27, 27, SPECIES_LINOONE}, + {26, 26, SPECIES_ODDISH}, + {27, 27, SPECIES_ODDISH}, + {24, 24, SPECIES_ODDISH}, + {25, 25, SPECIES_TROPIUS}, + {26, 26, SPECIES_TROPIUS}, + {27, 27, SPECIES_TROPIUS}, + {25, 25, SPECIES_KECLEON}, +}; + +const struct WildPokemonInfo gRoute119_LandMonsInfo = {15, gRoute119_LandMons}; + +const struct WildPokemon gRoute119_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute119_WaterMonsInfo = {4, gRoute119_WaterMons}; + +const struct WildPokemon gRoute119_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_CARVANHA}, + {25, 30, SPECIES_CARVANHA}, + {30, 35, SPECIES_CARVANHA}, + {20, 25, SPECIES_CARVANHA}, + {35, 40, SPECIES_CARVANHA}, + {40, 45, SPECIES_CARVANHA}, +}; + +const struct WildPokemonInfo gRoute119_FishingMonsInfo = {30, gRoute119_FishingMons}; + +const struct WildPokemon gRoute120_LandMons[] = +{ + {25, 25, SPECIES_POOCHYENA}, + {25, 25, SPECIES_MIGHTYENA}, + {27, 27, SPECIES_MIGHTYENA}, + {25, 25, SPECIES_ODDISH}, + {25, 25, SPECIES_MARILL}, + {26, 26, SPECIES_ODDISH}, + {27, 27, SPECIES_ODDISH}, + {27, 27, SPECIES_MARILL}, + {25, 25, SPECIES_ABSOL}, + {27, 27, SPECIES_ABSOL}, + {25, 25, SPECIES_KECLEON}, + {25, 25, SPECIES_SEEDOT}, +}; + +const struct WildPokemonInfo gRoute120_LandMonsInfo = {20, gRoute120_LandMons}; + +const struct WildPokemon gRoute120_WaterMons[] = +{ + {20, 30, SPECIES_MARILL}, + {10, 20, SPECIES_MARILL}, + {30, 35, SPECIES_MARILL}, + {5, 10, SPECIES_MARILL}, + {20, 30, SPECIES_GOLDEEN}, +}; + +const struct WildPokemonInfo gRoute120_WaterMonsInfo = {4, gRoute120_WaterMons}; + +const struct WildPokemon gRoute120_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_GOLDEEN}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_GOLDEEN}, + {10, 30, SPECIES_BARBOACH}, + {25, 30, SPECIES_BARBOACH}, + {30, 35, SPECIES_BARBOACH}, + {20, 25, SPECIES_BARBOACH}, + {35, 40, SPECIES_BARBOACH}, + {40, 45, SPECIES_BARBOACH}, +}; + +const struct WildPokemonInfo gRoute120_FishingMonsInfo = {30, gRoute120_FishingMons}; + +const struct WildPokemon gRoute121_LandMons[] = +{ + {26, 26, SPECIES_POOCHYENA}, + {26, 26, SPECIES_SHUPPET}, + {26, 26, SPECIES_MIGHTYENA}, + {28, 28, SPECIES_SHUPPET}, + {28, 28, SPECIES_MIGHTYENA}, + {26, 26, SPECIES_ODDISH}, + {28, 28, SPECIES_ODDISH}, + {28, 28, SPECIES_GLOOM}, + {26, 26, SPECIES_WINGULL}, + {27, 27, SPECIES_WINGULL}, + {28, 28, SPECIES_WINGULL}, + {25, 25, SPECIES_KECLEON}, +}; + +const struct WildPokemonInfo gRoute121_LandMonsInfo = {20, gRoute121_LandMons}; + +const struct WildPokemon gRoute121_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute121_WaterMonsInfo = {4, gRoute121_WaterMons}; + +const struct WildPokemon gRoute121_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_WAILMER}, + {20, 25, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute121_FishingMonsInfo = {30, gRoute121_FishingMons}; + +const struct WildPokemon gRoute122_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute122_WaterMonsInfo = {4, gRoute122_WaterMons}; + +const struct WildPokemon gRoute122_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_SHARPEDO}, + {30, 35, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute122_FishingMonsInfo = {30, gRoute122_FishingMons}; + +const struct WildPokemon gRoute123_LandMons[] = +{ + {26, 26, SPECIES_POOCHYENA}, + {26, 26, SPECIES_SHUPPET}, + {26, 26, SPECIES_MIGHTYENA}, + {28, 28, SPECIES_SHUPPET}, + {28, 28, SPECIES_MIGHTYENA}, + {26, 26, SPECIES_ODDISH}, + {28, 28, SPECIES_ODDISH}, + {28, 28, SPECIES_GLOOM}, + {26, 26, SPECIES_WINGULL}, + {27, 27, SPECIES_WINGULL}, + {28, 28, SPECIES_WINGULL}, + {25, 25, SPECIES_KECLEON}, +}; + +const struct WildPokemonInfo gRoute123_LandMonsInfo = {20, gRoute123_LandMons}; + +const struct WildPokemon gRoute123_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute123_WaterMonsInfo = {4, gRoute123_WaterMons}; + +const struct WildPokemon gRoute123_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_WAILMER}, + {20, 25, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute123_FishingMonsInfo = {30, gRoute123_FishingMons}; + +const struct WildPokemon gMtPyre_2F_LandMons[] = +{ + {27, 27, SPECIES_SHUPPET}, + {28, 28, SPECIES_SHUPPET}, + {26, 26, SPECIES_SHUPPET}, + {25, 25, SPECIES_SHUPPET}, + {29, 29, SPECIES_SHUPPET}, + {24, 24, SPECIES_SHUPPET}, + {23, 23, SPECIES_SHUPPET}, + {22, 22, SPECIES_SHUPPET}, + {29, 29, SPECIES_SHUPPET}, + {24, 24, SPECIES_SHUPPET}, + {29, 29, SPECIES_SHUPPET}, + {24, 24, SPECIES_SHUPPET}, +}; + +const struct WildPokemonInfo gMtPyre_2F_LandMonsInfo = {10, gMtPyre_2F_LandMons}; + +const struct WildPokemon gMtPyre_3F_LandMons[] = +{ + {27, 27, SPECIES_SHUPPET}, + {28, 28, SPECIES_SHUPPET}, + {26, 26, SPECIES_SHUPPET}, + {25, 25, SPECIES_SHUPPET}, + {29, 29, SPECIES_SHUPPET}, + {24, 24, SPECIES_SHUPPET}, + {23, 23, SPECIES_SHUPPET}, + {22, 22, SPECIES_SHUPPET}, + {29, 29, SPECIES_SHUPPET}, + {24, 24, SPECIES_SHUPPET}, + {29, 29, SPECIES_SHUPPET}, + {24, 24, SPECIES_SHUPPET}, +}; + +const struct WildPokemonInfo gMtPyre_3F_LandMonsInfo = {10, gMtPyre_3F_LandMons}; + +const struct WildPokemon gMtPyre_4F_LandMons[] = +{ + {27, 27, SPECIES_SHUPPET}, + {28, 28, SPECIES_SHUPPET}, + {26, 26, SPECIES_SHUPPET}, + {25, 25, SPECIES_SHUPPET}, + {29, 29, SPECIES_SHUPPET}, + {24, 24, SPECIES_SHUPPET}, + {23, 23, SPECIES_SHUPPET}, + {22, 22, SPECIES_SHUPPET}, + {27, 27, SPECIES_DUSKULL}, + {27, 27, SPECIES_DUSKULL}, + {25, 25, SPECIES_DUSKULL}, + {29, 29, SPECIES_DUSKULL}, +}; + +const struct WildPokemonInfo gMtPyre_4F_LandMonsInfo = {10, gMtPyre_4F_LandMons}; + +const struct WildPokemon gMtPyre_5F_LandMons[] = +{ + {27, 27, SPECIES_SHUPPET}, + {28, 28, SPECIES_SHUPPET}, + {26, 26, SPECIES_SHUPPET}, + {25, 25, SPECIES_SHUPPET}, + {29, 29, SPECIES_SHUPPET}, + {24, 24, SPECIES_SHUPPET}, + {23, 23, SPECIES_SHUPPET}, + {22, 22, SPECIES_SHUPPET}, + {27, 27, SPECIES_DUSKULL}, + {27, 27, SPECIES_DUSKULL}, + {25, 25, SPECIES_DUSKULL}, + {29, 29, SPECIES_DUSKULL}, +}; + +const struct WildPokemonInfo gMtPyre_5F_LandMonsInfo = {10, gMtPyre_5F_LandMons}; + +const struct WildPokemon gMtPyre_6F_LandMons[] = +{ + {27, 27, SPECIES_SHUPPET}, + {28, 28, SPECIES_SHUPPET}, + {26, 26, SPECIES_SHUPPET}, + {25, 25, SPECIES_SHUPPET}, + {29, 29, SPECIES_SHUPPET}, + {24, 24, SPECIES_SHUPPET}, + {23, 23, SPECIES_SHUPPET}, + {22, 22, SPECIES_SHUPPET}, + {27, 27, SPECIES_DUSKULL}, + {27, 27, SPECIES_DUSKULL}, + {25, 25, SPECIES_DUSKULL}, + {29, 29, SPECIES_DUSKULL}, +}; + +const struct WildPokemonInfo gMtPyre_6F_LandMonsInfo = {10, gMtPyre_6F_LandMons}; + +const struct WildPokemon gMtPyre_Exterior_LandMons[] = +{ + {27, 27, SPECIES_SHUPPET}, + {27, 27, SPECIES_SHUPPET}, + {28, 28, SPECIES_SHUPPET}, + {29, 29, SPECIES_SHUPPET}, + {29, 29, SPECIES_VULPIX}, + {27, 27, SPECIES_VULPIX}, + {29, 29, SPECIES_VULPIX}, + {25, 25, SPECIES_VULPIX}, + {27, 27, SPECIES_WINGULL}, + {27, 27, SPECIES_WINGULL}, + {26, 26, SPECIES_WINGULL}, + {28, 28, SPECIES_WINGULL}, +}; + +const struct WildPokemonInfo gMtPyre_Exterior_LandMonsInfo = {10, gMtPyre_Exterior_LandMons}; + +const struct WildPokemon gMtPyre_Summit_LandMons[] = +{ + {28, 28, SPECIES_SHUPPET}, + {29, 29, SPECIES_SHUPPET}, + {27, 27, SPECIES_SHUPPET}, + {26, 26, SPECIES_SHUPPET}, + {30, 30, SPECIES_SHUPPET}, + {25, 25, SPECIES_SHUPPET}, + {24, 24, SPECIES_SHUPPET}, + {28, 28, SPECIES_DUSKULL}, + {26, 26, SPECIES_DUSKULL}, + {30, 30, SPECIES_DUSKULL}, + {28, 28, SPECIES_CHIMECHO}, + {28, 28, SPECIES_CHIMECHO}, +}; + +const struct WildPokemonInfo gMtPyre_Summit_LandMonsInfo = {10, gMtPyre_Summit_LandMons}; + +const struct WildPokemon gGraniteCave_StevensRoom_LandMons[] = +{ + {7, 7, SPECIES_ZUBAT}, + {8, 8, SPECIES_MAKUHITA}, + {7, 7, SPECIES_MAKUHITA}, + {8, 8, SPECIES_ZUBAT}, + {9, 9, SPECIES_MAKUHITA}, + {8, 8, SPECIES_ABRA}, + {10, 10, SPECIES_MAKUHITA}, + {6, 6, SPECIES_MAKUHITA}, + {7, 7, SPECIES_ARON}, + {8, 8, SPECIES_ARON}, + {7, 7, SPECIES_ARON}, + {8, 8, SPECIES_ARON}, +}; + +const struct WildPokemonInfo gGraniteCave_StevensRoom_LandMonsInfo = {10, gGraniteCave_StevensRoom_LandMons}; + +const struct WildPokemon gRoute125_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute125_WaterMonsInfo = {4, gRoute125_WaterMons}; + +const struct WildPokemon gRoute125_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_SHARPEDO}, + {30, 35, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute125_FishingMonsInfo = {30, gRoute125_FishingMons}; + +const struct WildPokemon gRoute126_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute126_WaterMonsInfo = {4, gRoute126_WaterMons}; + +const struct WildPokemon gRoute126_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_SHARPEDO}, + {30, 35, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute126_FishingMonsInfo = {30, gRoute126_FishingMons}; + +const struct WildPokemon gRoute127_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute127_WaterMonsInfo = {4, gRoute127_WaterMons}; + +const struct WildPokemon gRoute127_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_SHARPEDO}, + {30, 35, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute127_FishingMonsInfo = {30, gRoute127_FishingMons}; + +const struct WildPokemon gRoute128_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute128_WaterMonsInfo = {4, gRoute128_WaterMons}; + +const struct WildPokemon gRoute128_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_LUVDISC}, + {10, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_LUVDISC}, + {30, 35, SPECIES_WAILMER}, + {30, 35, SPECIES_CORSOLA}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute128_FishingMonsInfo = {30, gRoute128_FishingMons}; + +const struct WildPokemon gRoute129_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_WAILORD}, +}; + +const struct WildPokemonInfo gRoute129_WaterMonsInfo = {4, gRoute129_WaterMons}; + +const struct WildPokemon gRoute129_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_SHARPEDO}, + {30, 35, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute129_FishingMonsInfo = {30, gRoute129_FishingMons}; + +const struct WildPokemon gRoute130_LandMons[] = +{ + {30, 30, SPECIES_WYNAUT}, + {35, 35, SPECIES_WYNAUT}, + {25, 25, SPECIES_WYNAUT}, + {40, 40, SPECIES_WYNAUT}, + {20, 20, SPECIES_WYNAUT}, + {45, 45, SPECIES_WYNAUT}, + {15, 15, SPECIES_WYNAUT}, + {50, 50, SPECIES_WYNAUT}, + {10, 10, SPECIES_WYNAUT}, + {5, 5, SPECIES_WYNAUT}, + {10, 10, SPECIES_WYNAUT}, + {5, 5, SPECIES_WYNAUT}, +}; + +const struct WildPokemonInfo gRoute130_LandMonsInfo = {20, gRoute130_LandMons}; + +const struct WildPokemon gRoute130_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute130_WaterMonsInfo = {4, gRoute130_WaterMons}; + +const struct WildPokemon gRoute130_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_SHARPEDO}, + {30, 35, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute130_FishingMonsInfo = {30, gRoute130_FishingMons}; + +const struct WildPokemon gRoute131_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute131_WaterMonsInfo = {4, gRoute131_WaterMons}; + +const struct WildPokemon gRoute131_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_SHARPEDO}, + {30, 35, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute131_FishingMonsInfo = {30, gRoute131_FishingMons}; + +const struct WildPokemon gRoute132_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute132_WaterMonsInfo = {4, gRoute132_WaterMons}; + +const struct WildPokemon gRoute132_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_SHARPEDO}, + {30, 35, SPECIES_WAILMER}, + {25, 30, SPECIES_HORSEA}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute132_FishingMonsInfo = {30, gRoute132_FishingMons}; + +const struct WildPokemon gRoute133_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute133_WaterMonsInfo = {4, gRoute133_WaterMons}; + +const struct WildPokemon gRoute133_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_SHARPEDO}, + {30, 35, SPECIES_WAILMER}, + {25, 30, SPECIES_HORSEA}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute133_FishingMonsInfo = {30, gRoute133_FishingMons}; + +const struct WildPokemon gRoute134_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gRoute134_WaterMonsInfo = {4, gRoute134_WaterMons}; + +const struct WildPokemon gRoute134_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_SHARPEDO}, + {30, 35, SPECIES_WAILMER}, + {25, 30, SPECIES_HORSEA}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gRoute134_FishingMonsInfo = {30, gRoute134_FishingMons}; + +const struct WildPokemon gAbandonedShip_HiddenFloorCorridors_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {5, 35, SPECIES_TENTACOOL}, + {5, 35, SPECIES_TENTACOOL}, + {5, 35, SPECIES_TENTACOOL}, + {30, 35, SPECIES_TENTACRUEL}, +}; + +const struct WildPokemonInfo gAbandonedShip_HiddenFloorCorridors_WaterMonsInfo = {4, gAbandonedShip_HiddenFloorCorridors_WaterMons}; + +const struct WildPokemon gAbandonedShip_HiddenFloorCorridors_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_TENTACOOL}, + {25, 30, SPECIES_TENTACOOL}, + {30, 35, SPECIES_TENTACOOL}, + {30, 35, SPECIES_TENTACRUEL}, + {25, 30, SPECIES_TENTACRUEL}, + {20, 25, SPECIES_TENTACRUEL}, +}; + +const struct WildPokemonInfo gAbandonedShip_HiddenFloorCorridors_FishingMonsInfo = {20, gAbandonedShip_HiddenFloorCorridors_FishingMons}; + +const struct WildPokemon gSeafloorCavern_Room1_LandMons[] = +{ + {30, 30, SPECIES_ZUBAT}, + {31, 31, SPECIES_ZUBAT}, + {32, 32, SPECIES_ZUBAT}, + {33, 33, SPECIES_ZUBAT}, + {28, 28, SPECIES_ZUBAT}, + {29, 29, SPECIES_ZUBAT}, + {34, 34, SPECIES_ZUBAT}, + {35, 35, SPECIES_ZUBAT}, + {34, 34, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {33, 33, SPECIES_GOLBAT}, + {36, 36, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gSeafloorCavern_Room1_LandMonsInfo = {4, gSeafloorCavern_Room1_LandMons}; + +const struct WildPokemon gSeafloorCavern_Room2_LandMons[] = +{ + {30, 30, SPECIES_ZUBAT}, + {31, 31, SPECIES_ZUBAT}, + {32, 32, SPECIES_ZUBAT}, + {33, 33, SPECIES_ZUBAT}, + {28, 28, SPECIES_ZUBAT}, + {29, 29, SPECIES_ZUBAT}, + {34, 34, SPECIES_ZUBAT}, + {35, 35, SPECIES_ZUBAT}, + {34, 34, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {33, 33, SPECIES_GOLBAT}, + {36, 36, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gSeafloorCavern_Room2_LandMonsInfo = {4, gSeafloorCavern_Room2_LandMons}; + +const struct WildPokemon gSeafloorCavern_Room3_LandMons[] = +{ + {30, 30, SPECIES_ZUBAT}, + {31, 31, SPECIES_ZUBAT}, + {32, 32, SPECIES_ZUBAT}, + {33, 33, SPECIES_ZUBAT}, + {28, 28, SPECIES_ZUBAT}, + {29, 29, SPECIES_ZUBAT}, + {34, 34, SPECIES_ZUBAT}, + {35, 35, SPECIES_ZUBAT}, + {34, 34, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {33, 33, SPECIES_GOLBAT}, + {36, 36, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gSeafloorCavern_Room3_LandMonsInfo = {4, gSeafloorCavern_Room3_LandMons}; + +const struct WildPokemon gSeafloorCavern_Room4_LandMons[] = +{ + {30, 30, SPECIES_ZUBAT}, + {31, 31, SPECIES_ZUBAT}, + {32, 32, SPECIES_ZUBAT}, + {33, 33, SPECIES_ZUBAT}, + {28, 28, SPECIES_ZUBAT}, + {29, 29, SPECIES_ZUBAT}, + {34, 34, SPECIES_ZUBAT}, + {35, 35, SPECIES_ZUBAT}, + {34, 34, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {33, 33, SPECIES_GOLBAT}, + {36, 36, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gSeafloorCavern_Room4_LandMonsInfo = {4, gSeafloorCavern_Room4_LandMons}; + +const struct WildPokemon gSeafloorCavern_Room5_LandMons[] = +{ + {30, 30, SPECIES_ZUBAT}, + {31, 31, SPECIES_ZUBAT}, + {32, 32, SPECIES_ZUBAT}, + {33, 33, SPECIES_ZUBAT}, + {28, 28, SPECIES_ZUBAT}, + {29, 29, SPECIES_ZUBAT}, + {34, 34, SPECIES_ZUBAT}, + {35, 35, SPECIES_ZUBAT}, + {34, 34, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {33, 33, SPECIES_GOLBAT}, + {36, 36, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gSeafloorCavern_Room5_LandMonsInfo = {4, gSeafloorCavern_Room5_LandMons}; + +const struct WildPokemon gSeafloorCavern_Room6_LandMons[] = +{ + {30, 30, SPECIES_ZUBAT}, + {31, 31, SPECIES_ZUBAT}, + {32, 32, SPECIES_ZUBAT}, + {33, 33, SPECIES_ZUBAT}, + {28, 28, SPECIES_ZUBAT}, + {29, 29, SPECIES_ZUBAT}, + {34, 34, SPECIES_ZUBAT}, + {35, 35, SPECIES_ZUBAT}, + {34, 34, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {33, 33, SPECIES_GOLBAT}, + {36, 36, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gSeafloorCavern_Room6_LandMonsInfo = {4, gSeafloorCavern_Room6_LandMons}; + +const struct WildPokemon gSeafloorCavern_Room6_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {5, 35, SPECIES_ZUBAT}, + {30, 35, SPECIES_ZUBAT}, + {30, 35, SPECIES_GOLBAT}, + {30, 35, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gSeafloorCavern_Room6_WaterMonsInfo = {4, gSeafloorCavern_Room6_WaterMons}; + +const struct WildPokemon gSeafloorCavern_Room6_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_WAILMER}, + {20, 25, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gSeafloorCavern_Room6_FishingMonsInfo = {10, gSeafloorCavern_Room6_FishingMons}; + +const struct WildPokemon gSeafloorCavern_Room7_LandMons[] = +{ + {30, 30, SPECIES_ZUBAT}, + {31, 31, SPECIES_ZUBAT}, + {32, 32, SPECIES_ZUBAT}, + {33, 33, SPECIES_ZUBAT}, + {28, 28, SPECIES_ZUBAT}, + {29, 29, SPECIES_ZUBAT}, + {34, 34, SPECIES_ZUBAT}, + {35, 35, SPECIES_ZUBAT}, + {34, 34, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {33, 33, SPECIES_GOLBAT}, + {36, 36, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gSeafloorCavern_Room7_LandMonsInfo = {4, gSeafloorCavern_Room7_LandMons}; + +const struct WildPokemon gSeafloorCavern_Room7_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {5, 35, SPECIES_ZUBAT}, + {30, 35, SPECIES_ZUBAT}, + {30, 35, SPECIES_GOLBAT}, + {30, 35, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gSeafloorCavern_Room7_WaterMonsInfo = {4, gSeafloorCavern_Room7_WaterMons}; + +const struct WildPokemon gSeafloorCavern_Room7_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_WAILMER}, + {20, 25, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gSeafloorCavern_Room7_FishingMonsInfo = {10, gSeafloorCavern_Room7_FishingMons}; + +const struct WildPokemon gSeafloorCavern_Room8_LandMons[] = +{ + {30, 30, SPECIES_ZUBAT}, + {31, 31, SPECIES_ZUBAT}, + {32, 32, SPECIES_ZUBAT}, + {33, 33, SPECIES_ZUBAT}, + {28, 28, SPECIES_ZUBAT}, + {29, 29, SPECIES_ZUBAT}, + {34, 34, SPECIES_ZUBAT}, + {35, 35, SPECIES_ZUBAT}, + {34, 34, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {33, 33, SPECIES_GOLBAT}, + {36, 36, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gSeafloorCavern_Room8_LandMonsInfo = {4, gSeafloorCavern_Room8_LandMons}; + +const struct WildPokemon gSeafloorCavern_Entrance_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {5, 35, SPECIES_ZUBAT}, + {30, 35, SPECIES_ZUBAT}, + {30, 35, SPECIES_GOLBAT}, + {30, 35, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gSeafloorCavern_Entrance_WaterMonsInfo = {4, gSeafloorCavern_Entrance_WaterMons}; + +const struct WildPokemon gSeafloorCavern_Entrance_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_WAILMER}, + {20, 25, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gSeafloorCavern_Entrance_FishingMonsInfo = {10, gSeafloorCavern_Entrance_FishingMons}; + +const struct WildPokemon gCaveOfOrigin_Entrance_LandMons[] = +{ + {30, 30, SPECIES_ZUBAT}, + {31, 31, SPECIES_ZUBAT}, + {32, 32, SPECIES_ZUBAT}, + {33, 33, SPECIES_ZUBAT}, + {28, 28, SPECIES_ZUBAT}, + {29, 29, SPECIES_ZUBAT}, + {34, 34, SPECIES_ZUBAT}, + {35, 35, SPECIES_ZUBAT}, + {34, 34, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {33, 33, SPECIES_GOLBAT}, + {36, 36, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gCaveOfOrigin_Entrance_LandMonsInfo = {4, gCaveOfOrigin_Entrance_LandMons}; + +const struct WildPokemon gCaveOfOrigin_1F_LandMons[] = +{ + {30, 30, SPECIES_ZUBAT}, + {31, 31, SPECIES_ZUBAT}, + {32, 32, SPECIES_ZUBAT}, + {30, 30, SPECIES_SABLEYE}, + {32, 32, SPECIES_SABLEYE}, + {34, 34, SPECIES_SABLEYE}, + {33, 33, SPECIES_ZUBAT}, + {34, 34, SPECIES_ZUBAT}, + {34, 34, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {33, 33, SPECIES_GOLBAT}, + {36, 36, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gCaveOfOrigin_1F_LandMonsInfo = {4, gCaveOfOrigin_1F_LandMons}; + +const struct WildPokemon gCaveOfOrigin_UnusedRubySapphireMap1_LandMons[] = +{ + {30, 30, SPECIES_ZUBAT}, + {31, 31, SPECIES_ZUBAT}, + {32, 32, SPECIES_ZUBAT}, + {30, 30, SPECIES_SABLEYE}, + {32, 32, SPECIES_SABLEYE}, + {34, 34, SPECIES_SABLEYE}, + {33, 33, SPECIES_ZUBAT}, + {34, 34, SPECIES_ZUBAT}, + {34, 34, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {33, 33, SPECIES_GOLBAT}, + {36, 36, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gCaveOfOrigin_UnusedRubySapphireMap1_LandMonsInfo = {4, gCaveOfOrigin_UnusedRubySapphireMap1_LandMons}; + +const struct WildPokemon gCaveOfOrigin_UnusedRubySapphireMap2_LandMons[] = +{ + {30, 30, SPECIES_ZUBAT}, + {31, 31, SPECIES_ZUBAT}, + {32, 32, SPECIES_ZUBAT}, + {30, 30, SPECIES_SABLEYE}, + {32, 32, SPECIES_SABLEYE}, + {34, 34, SPECIES_SABLEYE}, + {33, 33, SPECIES_ZUBAT}, + {34, 34, SPECIES_ZUBAT}, + {34, 34, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {33, 33, SPECIES_GOLBAT}, + {36, 36, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gCaveOfOrigin_UnusedRubySapphireMap2_LandMonsInfo = {4, gCaveOfOrigin_UnusedRubySapphireMap2_LandMons}; + +const struct WildPokemon gCaveOfOrigin_UnusedRubySapphireMap3_LandMons[] = +{ + {30, 30, SPECIES_ZUBAT}, + {31, 31, SPECIES_ZUBAT}, + {32, 32, SPECIES_ZUBAT}, + {30, 30, SPECIES_SABLEYE}, + {32, 32, SPECIES_SABLEYE}, + {34, 34, SPECIES_SABLEYE}, + {33, 33, SPECIES_ZUBAT}, + {34, 34, SPECIES_ZUBAT}, + {34, 34, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {33, 33, SPECIES_GOLBAT}, + {36, 36, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gCaveOfOrigin_UnusedRubySapphireMap3_LandMonsInfo = {4, gCaveOfOrigin_UnusedRubySapphireMap3_LandMons}; + +const struct WildPokemon gNewMauville_Entrance_LandMons[] = +{ + {24, 24, SPECIES_VOLTORB}, + {24, 24, SPECIES_MAGNEMITE}, + {25, 25, SPECIES_VOLTORB}, + {25, 25, SPECIES_MAGNEMITE}, + {23, 23, SPECIES_VOLTORB}, + {23, 23, SPECIES_MAGNEMITE}, + {26, 26, SPECIES_VOLTORB}, + {26, 26, SPECIES_MAGNEMITE}, + {22, 22, SPECIES_VOLTORB}, + {22, 22, SPECIES_MAGNEMITE}, + {22, 22, SPECIES_VOLTORB}, + {22, 22, SPECIES_MAGNEMITE}, +}; + +const struct WildPokemonInfo gNewMauville_Entrance_LandMonsInfo = {10, gNewMauville_Entrance_LandMons}; + +const struct WildPokemon gSafariZone_Southwest_LandMons[] = +{ + {25, 25, SPECIES_ODDISH}, + {27, 27, SPECIES_ODDISH}, + {25, 25, SPECIES_GIRAFARIG}, + {27, 27, SPECIES_GIRAFARIG}, + {25, 25, SPECIES_NATU}, + {27, 27, SPECIES_DODUO}, + {25, 25, SPECIES_GLOOM}, + {27, 27, SPECIES_WOBBUFFET}, + {25, 25, SPECIES_PIKACHU}, + {27, 27, SPECIES_WOBBUFFET}, + {27, 27, SPECIES_PIKACHU}, + {29, 29, SPECIES_WOBBUFFET}, +}; + +const struct WildPokemonInfo gSafariZone_Southwest_LandMonsInfo = {25, gSafariZone_Southwest_LandMons}; + +const struct WildPokemon gSafariZone_Southwest_WaterMons[] = +{ + {20, 30, SPECIES_PSYDUCK}, + {20, 30, SPECIES_PSYDUCK}, + {30, 35, SPECIES_PSYDUCK}, + {30, 35, SPECIES_PSYDUCK}, + {30, 35, SPECIES_PSYDUCK}, +}; + +const struct WildPokemonInfo gSafariZone_Southwest_WaterMonsInfo = {9, gSafariZone_Southwest_WaterMons}; + +const struct WildPokemon gSafariZone_Southwest_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_GOLDEEN}, + {10, 30, SPECIES_MAGIKARP}, + {10, 25, SPECIES_GOLDEEN}, + {10, 30, SPECIES_GOLDEEN}, + {25, 30, SPECIES_GOLDEEN}, + {30, 35, SPECIES_GOLDEEN}, + {30, 35, SPECIES_SEAKING}, + {35, 40, SPECIES_SEAKING}, + {25, 30, SPECIES_SEAKING}, +}; + +const struct WildPokemonInfo gSafariZone_Southwest_FishingMonsInfo = {35, gSafariZone_Southwest_FishingMons}; + +const struct WildPokemon gSafariZone_North_LandMons[] = +{ + {27, 27, SPECIES_PHANPY}, + {27, 27, SPECIES_ODDISH}, + {29, 29, SPECIES_PHANPY}, + {29, 29, SPECIES_ODDISH}, + {27, 27, SPECIES_NATU}, + {29, 29, SPECIES_GLOOM}, + {31, 31, SPECIES_GLOOM}, + {29, 29, SPECIES_NATU}, + {29, 29, SPECIES_XATU}, + {27, 27, SPECIES_HERACROSS}, + {31, 31, SPECIES_XATU}, + {29, 29, SPECIES_HERACROSS}, +}; + +const struct WildPokemonInfo gSafariZone_North_LandMonsInfo = {25, gSafariZone_North_LandMons}; + +const struct WildPokemon gSafariZone_North_RockSmashMons[] = +{ + {10, 15, SPECIES_GEODUDE}, + {5, 10, SPECIES_GEODUDE}, + {15, 20, SPECIES_GEODUDE}, + {20, 25, SPECIES_GEODUDE}, + {25, 30, SPECIES_GEODUDE}, +}; + +const struct WildPokemonInfo gSafariZone_North_RockSmashMonsInfo = {25, gSafariZone_North_RockSmashMons}; + +const struct WildPokemon gSafariZone_Northwest_LandMons[] = +{ + {27, 27, SPECIES_RHYHORN}, + {27, 27, SPECIES_ODDISH}, + {29, 29, SPECIES_RHYHORN}, + {29, 29, SPECIES_ODDISH}, + {27, 27, SPECIES_DODUO}, + {29, 29, SPECIES_GLOOM}, + {31, 31, SPECIES_GLOOM}, + {29, 29, SPECIES_DODUO}, + {29, 29, SPECIES_DODRIO}, + {27, 27, SPECIES_PINSIR}, + {31, 31, SPECIES_DODRIO}, + {29, 29, SPECIES_PINSIR}, +}; + +const struct WildPokemonInfo gSafariZone_Northwest_LandMonsInfo = {25, gSafariZone_Northwest_LandMons}; + +const struct WildPokemon gSafariZone_Northwest_WaterMons[] = +{ + {20, 30, SPECIES_PSYDUCK}, + {20, 30, SPECIES_PSYDUCK}, + {30, 35, SPECIES_PSYDUCK}, + {30, 35, SPECIES_GOLDUCK}, + {25, 40, SPECIES_GOLDUCK}, +}; + +const struct WildPokemonInfo gSafariZone_Northwest_WaterMonsInfo = {9, gSafariZone_Northwest_WaterMons}; + +const struct WildPokemon gSafariZone_Northwest_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_GOLDEEN}, + {10, 30, SPECIES_MAGIKARP}, + {10, 25, SPECIES_GOLDEEN}, + {10, 30, SPECIES_GOLDEEN}, + {25, 30, SPECIES_GOLDEEN}, + {30, 35, SPECIES_GOLDEEN}, + {30, 35, SPECIES_SEAKING}, + {35, 40, SPECIES_SEAKING}, + {25, 30, SPECIES_SEAKING}, +}; + +const struct WildPokemonInfo gSafariZone_Northwest_FishingMonsInfo = {35, gSafariZone_Northwest_FishingMons}; + +const struct WildPokemon gVictoryRoad_B1F_LandMons[] = +{ + {40, 40, SPECIES_GOLBAT}, + {40, 40, SPECIES_HARIYAMA}, + {40, 40, SPECIES_LAIRON}, + {40, 40, SPECIES_LAIRON}, + {38, 38, SPECIES_GOLBAT}, + {38, 38, SPECIES_HARIYAMA}, + {42, 42, SPECIES_GOLBAT}, + {42, 42, SPECIES_HARIYAMA}, + {42, 42, SPECIES_LAIRON}, + {38, 38, SPECIES_MAWILE}, + {42, 42, SPECIES_LAIRON}, + {38, 38, SPECIES_MAWILE}, +}; + +const struct WildPokemonInfo gVictoryRoad_B1F_LandMonsInfo = {10, gVictoryRoad_B1F_LandMons}; + +const struct WildPokemon gVictoryRoad_B1F_RockSmashMons[] = +{ + {30, 40, SPECIES_GRAVELER}, + {30, 40, SPECIES_GEODUDE}, + {35, 40, SPECIES_GRAVELER}, + {35, 40, SPECIES_GRAVELER}, + {35, 40, SPECIES_GRAVELER}, +}; + +const struct WildPokemonInfo gVictoryRoad_B1F_RockSmashMonsInfo = {20, gVictoryRoad_B1F_RockSmashMons}; + +const struct WildPokemon gVictoryRoad_B2F_LandMons[] = +{ + {40, 40, SPECIES_GOLBAT}, + {40, 40, SPECIES_SABLEYE}, + {40, 40, SPECIES_LAIRON}, + {40, 40, SPECIES_LAIRON}, + {42, 42, SPECIES_GOLBAT}, + {42, 42, SPECIES_SABLEYE}, + {44, 44, SPECIES_GOLBAT}, + {44, 44, SPECIES_SABLEYE}, + {42, 42, SPECIES_LAIRON}, + {42, 42, SPECIES_MAWILE}, + {44, 44, SPECIES_LAIRON}, + {44, 44, SPECIES_MAWILE}, +}; + +const struct WildPokemonInfo gVictoryRoad_B2F_LandMonsInfo = {10, gVictoryRoad_B2F_LandMons}; + +const struct WildPokemon gVictoryRoad_B2F_WaterMons[] = +{ + {30, 35, SPECIES_GOLBAT}, + {25, 30, SPECIES_GOLBAT}, + {35, 40, SPECIES_GOLBAT}, + {35, 40, SPECIES_GOLBAT}, + {35, 40, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gVictoryRoad_B2F_WaterMonsInfo = {4, gVictoryRoad_B2F_WaterMons}; + +const struct WildPokemon gVictoryRoad_B2F_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_GOLDEEN}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_GOLDEEN}, + {10, 30, SPECIES_BARBOACH}, + {25, 30, SPECIES_BARBOACH}, + {30, 35, SPECIES_BARBOACH}, + {30, 35, SPECIES_WHISCASH}, + {35, 40, SPECIES_WHISCASH}, + {40, 45, SPECIES_WHISCASH}, +}; + +const struct WildPokemonInfo gVictoryRoad_B2F_FishingMonsInfo = {30, gVictoryRoad_B2F_FishingMons}; + +const struct WildPokemon gMeteorFalls_1F_1R_LandMons[] = +{ + {16, 16, SPECIES_ZUBAT}, + {17, 17, SPECIES_ZUBAT}, + {18, 18, SPECIES_ZUBAT}, + {15, 15, SPECIES_ZUBAT}, + {14, 14, SPECIES_ZUBAT}, + {16, 16, SPECIES_SOLROCK}, + {18, 18, SPECIES_SOLROCK}, + {14, 14, SPECIES_SOLROCK}, + {19, 19, SPECIES_ZUBAT}, + {20, 20, SPECIES_ZUBAT}, + {19, 19, SPECIES_ZUBAT}, + {20, 20, SPECIES_ZUBAT}, +}; + +const struct WildPokemonInfo gMeteorFalls_1F_1R_LandMonsInfo = {10, gMeteorFalls_1F_1R_LandMons}; + +const struct WildPokemon gMeteorFalls_1F_1R_WaterMons[] = +{ + {5, 35, SPECIES_ZUBAT}, + {30, 35, SPECIES_ZUBAT}, + {25, 35, SPECIES_SOLROCK}, + {15, 25, SPECIES_SOLROCK}, + {5, 15, SPECIES_SOLROCK}, +}; + +const struct WildPokemonInfo gMeteorFalls_1F_1R_WaterMonsInfo = {4, gMeteorFalls_1F_1R_WaterMons}; + +const struct WildPokemon gMeteorFalls_1F_1R_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_GOLDEEN}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_GOLDEEN}, + {10, 30, SPECIES_BARBOACH}, + {25, 30, SPECIES_BARBOACH}, + {30, 35, SPECIES_BARBOACH}, + {20, 25, SPECIES_BARBOACH}, + {35, 40, SPECIES_BARBOACH}, + {40, 45, SPECIES_BARBOACH}, +}; + +const struct WildPokemonInfo gMeteorFalls_1F_1R_FishingMonsInfo = {30, gMeteorFalls_1F_1R_FishingMons}; + +const struct WildPokemon gMeteorFalls_1F_2R_LandMons[] = +{ + {33, 33, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {33, 33, SPECIES_GOLBAT}, + {35, 35, SPECIES_SOLROCK}, + {33, 33, SPECIES_SOLROCK}, + {37, 37, SPECIES_SOLROCK}, + {35, 35, SPECIES_GOLBAT}, + {39, 39, SPECIES_SOLROCK}, + {38, 38, SPECIES_GOLBAT}, + {40, 40, SPECIES_GOLBAT}, + {38, 38, SPECIES_GOLBAT}, + {40, 40, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gMeteorFalls_1F_2R_LandMonsInfo = {10, gMeteorFalls_1F_2R_LandMons}; + +const struct WildPokemon gMeteorFalls_1F_2R_WaterMons[] = +{ + {30, 35, SPECIES_GOLBAT}, + {30, 35, SPECIES_GOLBAT}, + {25, 35, SPECIES_SOLROCK}, + {15, 25, SPECIES_SOLROCK}, + {5, 15, SPECIES_SOLROCK}, +}; + +const struct WildPokemonInfo gMeteorFalls_1F_2R_WaterMonsInfo = {4, gMeteorFalls_1F_2R_WaterMons}; + +const struct WildPokemon gMeteorFalls_1F_2R_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_GOLDEEN}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_GOLDEEN}, + {10, 30, SPECIES_BARBOACH}, + {25, 30, SPECIES_BARBOACH}, + {30, 35, SPECIES_BARBOACH}, + {30, 35, SPECIES_WHISCASH}, + {35, 40, SPECIES_WHISCASH}, + {40, 45, SPECIES_WHISCASH}, +}; + +const struct WildPokemonInfo gMeteorFalls_1F_2R_FishingMonsInfo = {30, gMeteorFalls_1F_2R_FishingMons}; + +const struct WildPokemon gMeteorFalls_B1F_1R_LandMons[] = +{ + {33, 33, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {33, 33, SPECIES_GOLBAT}, + {35, 35, SPECIES_SOLROCK}, + {33, 33, SPECIES_SOLROCK}, + {37, 37, SPECIES_SOLROCK}, + {35, 35, SPECIES_GOLBAT}, + {39, 39, SPECIES_SOLROCK}, + {38, 38, SPECIES_GOLBAT}, + {40, 40, SPECIES_GOLBAT}, + {38, 38, SPECIES_GOLBAT}, + {40, 40, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gMeteorFalls_B1F_1R_LandMonsInfo = {10, gMeteorFalls_B1F_1R_LandMons}; + +const struct WildPokemon gMeteorFalls_B1F_1R_WaterMons[] = +{ + {30, 35, SPECIES_GOLBAT}, + {30, 35, SPECIES_GOLBAT}, + {25, 35, SPECIES_SOLROCK}, + {15, 25, SPECIES_SOLROCK}, + {5, 15, SPECIES_SOLROCK}, +}; + +const struct WildPokemonInfo gMeteorFalls_B1F_1R_WaterMonsInfo = {4, gMeteorFalls_B1F_1R_WaterMons}; + +const struct WildPokemon gMeteorFalls_B1F_1R_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_GOLDEEN}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_GOLDEEN}, + {10, 30, SPECIES_BARBOACH}, + {25, 30, SPECIES_BARBOACH}, + {30, 35, SPECIES_BARBOACH}, + {30, 35, SPECIES_WHISCASH}, + {35, 40, SPECIES_WHISCASH}, + {40, 45, SPECIES_WHISCASH}, +}; + +const struct WildPokemonInfo gMeteorFalls_B1F_1R_FishingMonsInfo = {30, gMeteorFalls_B1F_1R_FishingMons}; + +const struct WildPokemon gShoalCave_LowTideStairsRoom_LandMons[] = +{ + {26, 26, SPECIES_ZUBAT}, + {26, 26, SPECIES_SPHEAL}, + {28, 28, SPECIES_ZUBAT}, + {28, 28, SPECIES_SPHEAL}, + {30, 30, SPECIES_ZUBAT}, + {30, 30, SPECIES_SPHEAL}, + {32, 32, SPECIES_ZUBAT}, + {32, 32, SPECIES_SPHEAL}, + {32, 32, SPECIES_GOLBAT}, + {32, 32, SPECIES_SPHEAL}, + {32, 32, SPECIES_GOLBAT}, + {32, 32, SPECIES_SPHEAL}, +}; + +const struct WildPokemonInfo gShoalCave_LowTideStairsRoom_LandMonsInfo = {10, gShoalCave_LowTideStairsRoom_LandMons}; + +const struct WildPokemon gShoalCave_LowTideLowerRoom_LandMons[] = +{ + {26, 26, SPECIES_ZUBAT}, + {26, 26, SPECIES_SPHEAL}, + {28, 28, SPECIES_ZUBAT}, + {28, 28, SPECIES_SPHEAL}, + {30, 30, SPECIES_ZUBAT}, + {30, 30, SPECIES_SPHEAL}, + {32, 32, SPECIES_ZUBAT}, + {32, 32, SPECIES_SPHEAL}, + {32, 32, SPECIES_GOLBAT}, + {32, 32, SPECIES_SPHEAL}, + {32, 32, SPECIES_GOLBAT}, + {32, 32, SPECIES_SPHEAL}, +}; + +const struct WildPokemonInfo gShoalCave_LowTideLowerRoom_LandMonsInfo = {10, gShoalCave_LowTideLowerRoom_LandMons}; + +const struct WildPokemon gShoalCave_LowTideInnerRoom_LandMons[] = +{ + {26, 26, SPECIES_ZUBAT}, + {26, 26, SPECIES_SPHEAL}, + {28, 28, SPECIES_ZUBAT}, + {28, 28, SPECIES_SPHEAL}, + {30, 30, SPECIES_ZUBAT}, + {30, 30, SPECIES_SPHEAL}, + {32, 32, SPECIES_ZUBAT}, + {32, 32, SPECIES_SPHEAL}, + {32, 32, SPECIES_GOLBAT}, + {32, 32, SPECIES_SPHEAL}, + {32, 32, SPECIES_GOLBAT}, + {32, 32, SPECIES_SPHEAL}, +}; + +const struct WildPokemonInfo gShoalCave_LowTideInnerRoom_LandMonsInfo = {10, gShoalCave_LowTideInnerRoom_LandMons}; + +const struct WildPokemon gShoalCave_LowTideInnerRoom_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {5, 35, SPECIES_ZUBAT}, + {25, 30, SPECIES_SPHEAL}, + {25, 30, SPECIES_SPHEAL}, + {25, 35, SPECIES_SPHEAL}, +}; + +const struct WildPokemonInfo gShoalCave_LowTideInnerRoom_WaterMonsInfo = {4, gShoalCave_LowTideInnerRoom_WaterMons}; + +const struct WildPokemon gShoalCave_LowTideInnerRoom_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_WAILMER}, + {20, 25, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gShoalCave_LowTideInnerRoom_FishingMonsInfo = {10, gShoalCave_LowTideInnerRoom_FishingMons}; + +const struct WildPokemon gShoalCave_LowTideEntranceRoom_LandMons[] = +{ + {26, 26, SPECIES_ZUBAT}, + {26, 26, SPECIES_SPHEAL}, + {28, 28, SPECIES_ZUBAT}, + {28, 28, SPECIES_SPHEAL}, + {30, 30, SPECIES_ZUBAT}, + {30, 30, SPECIES_SPHEAL}, + {32, 32, SPECIES_ZUBAT}, + {32, 32, SPECIES_SPHEAL}, + {32, 32, SPECIES_GOLBAT}, + {32, 32, SPECIES_SPHEAL}, + {32, 32, SPECIES_GOLBAT}, + {32, 32, SPECIES_SPHEAL}, +}; + +const struct WildPokemonInfo gShoalCave_LowTideEntranceRoom_LandMonsInfo = {10, gShoalCave_LowTideEntranceRoom_LandMons}; + +const struct WildPokemon gShoalCave_LowTideEntranceRoom_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {5, 35, SPECIES_ZUBAT}, + {25, 30, SPECIES_SPHEAL}, + {25, 30, SPECIES_SPHEAL}, + {25, 35, SPECIES_SPHEAL}, +}; + +const struct WildPokemonInfo gShoalCave_LowTideEntranceRoom_WaterMonsInfo = {4, gShoalCave_LowTideEntranceRoom_WaterMons}; + +const struct WildPokemon gShoalCave_LowTideEntranceRoom_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_WAILMER}, + {20, 25, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gShoalCave_LowTideEntranceRoom_FishingMonsInfo = {10, gShoalCave_LowTideEntranceRoom_FishingMons}; + +const struct WildPokemon gLilycoveCity_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gLilycoveCity_WaterMonsInfo = {4, gLilycoveCity_WaterMons}; + +const struct WildPokemon gLilycoveCity_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_WAILMER}, + {25, 30, SPECIES_STARYU}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gLilycoveCity_FishingMonsInfo = {10, gLilycoveCity_FishingMons}; + +const struct WildPokemon gDewfordTown_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gDewfordTown_WaterMonsInfo = {4, gDewfordTown_WaterMons}; + +const struct WildPokemon gDewfordTown_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_WAILMER}, + {20, 25, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gDewfordTown_FishingMonsInfo = {10, gDewfordTown_FishingMons}; + +const struct WildPokemon gSlateportCity_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gSlateportCity_WaterMonsInfo = {4, gSlateportCity_WaterMons}; + +const struct WildPokemon gSlateportCity_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_WAILMER}, + {20, 25, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gSlateportCity_FishingMonsInfo = {10, gSlateportCity_FishingMons}; + +const struct WildPokemon gMossdeepCity_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gMossdeepCity_WaterMonsInfo = {4, gMossdeepCity_WaterMons}; + +const struct WildPokemon gMossdeepCity_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_SHARPEDO}, + {30, 35, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gMossdeepCity_FishingMonsInfo = {10, gMossdeepCity_FishingMons}; + +const struct WildPokemon gPacifidlogTown_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gPacifidlogTown_WaterMonsInfo = {4, gPacifidlogTown_WaterMons}; + +const struct WildPokemon gPacifidlogTown_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_SHARPEDO}, + {30, 35, SPECIES_WAILMER}, + {25, 30, SPECIES_WAILMER}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gPacifidlogTown_FishingMonsInfo = {10, gPacifidlogTown_FishingMons}; + +const struct WildPokemon gEverGrandeCity_WaterMons[] = +{ + {5, 35, SPECIES_TENTACOOL}, + {10, 30, SPECIES_WINGULL}, + {15, 25, SPECIES_WINGULL}, + {25, 30, SPECIES_PELIPPER}, + {25, 30, SPECIES_PELIPPER}, +}; + +const struct WildPokemonInfo gEverGrandeCity_WaterMonsInfo = {4, gEverGrandeCity_WaterMons}; + +const struct WildPokemon gEverGrandeCity_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_LUVDISC}, + {10, 30, SPECIES_WAILMER}, + {30, 35, SPECIES_LUVDISC}, + {30, 35, SPECIES_WAILMER}, + {30, 35, SPECIES_CORSOLA}, + {35, 40, SPECIES_WAILMER}, + {40, 45, SPECIES_WAILMER}, +}; + +const struct WildPokemonInfo gEverGrandeCity_FishingMonsInfo = {10, gEverGrandeCity_FishingMons}; + +const struct WildPokemon gPetalburgCity_WaterMons[] = +{ + {20, 30, SPECIES_MARILL}, + {10, 20, SPECIES_MARILL}, + {30, 35, SPECIES_MARILL}, + {5, 10, SPECIES_MARILL}, + {5, 10, SPECIES_MARILL}, +}; + +const struct WildPokemonInfo gPetalburgCity_WaterMonsInfo = {1, gPetalburgCity_WaterMons}; + +const struct WildPokemon gPetalburgCity_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_GOLDEEN}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_GOLDEEN}, + {10, 30, SPECIES_CORPHISH}, + {25, 30, SPECIES_CORPHISH}, + {30, 35, SPECIES_CORPHISH}, + {20, 25, SPECIES_CORPHISH}, + {35, 40, SPECIES_CORPHISH}, + {40, 45, SPECIES_CORPHISH}, +}; + +const struct WildPokemonInfo gPetalburgCity_FishingMonsInfo = {10, gPetalburgCity_FishingMons}; + +const struct WildPokemon gUnderwater1_WaterMons[] = +{ + {20, 30, SPECIES_CLAMPERL}, + {20, 30, SPECIES_CHINCHOU}, + {30, 35, SPECIES_CLAMPERL}, + {30, 35, SPECIES_RELICANTH}, + {30, 35, SPECIES_RELICANTH}, +}; + +const struct WildPokemonInfo gUnderwater1_WaterMonsInfo = {4, gUnderwater1_WaterMons}; + +const struct WildPokemon gShoalCave_LowTideIceRoom_LandMons[] = +{ + {26, 26, SPECIES_ZUBAT}, + {26, 26, SPECIES_SPHEAL}, + {28, 28, SPECIES_ZUBAT}, + {28, 28, SPECIES_SPHEAL}, + {30, 30, SPECIES_ZUBAT}, + {30, 30, SPECIES_SPHEAL}, + {26, 26, SPECIES_SNORUNT}, + {32, 32, SPECIES_SPHEAL}, + {30, 30, SPECIES_GOLBAT}, + {28, 28, SPECIES_SNORUNT}, + {32, 32, SPECIES_GOLBAT}, + {30, 30, SPECIES_SNORUNT}, +}; + +const struct WildPokemonInfo gShoalCave_LowTideIceRoom_LandMonsInfo = {10, gShoalCave_LowTideIceRoom_LandMons}; + +const struct WildPokemon gSkyPillar_1F_LandMons[] = +{ + {33, 33, SPECIES_SABLEYE}, + {34, 34, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {34, 34, SPECIES_SABLEYE}, + {36, 36, SPECIES_CLAYDOL}, + {37, 37, SPECIES_BANETTE}, + {38, 38, SPECIES_BANETTE}, + {36, 36, SPECIES_CLAYDOL}, + {37, 37, SPECIES_CLAYDOL}, + {38, 38, SPECIES_CLAYDOL}, + {37, 37, SPECIES_CLAYDOL}, + {38, 38, SPECIES_CLAYDOL}, +}; + +const struct WildPokemonInfo gSkyPillar_1F_LandMonsInfo = {10, gSkyPillar_1F_LandMons}; + +const struct WildPokemon gSootopolisCity_WaterMons[] = +{ + {5, 35, SPECIES_MAGIKARP}, + {10, 30, SPECIES_MAGIKARP}, + {15, 25, SPECIES_MAGIKARP}, + {25, 30, SPECIES_MAGIKARP}, + {25, 30, SPECIES_MAGIKARP}, +}; + +const struct WildPokemonInfo gSootopolisCity_WaterMonsInfo = {1, gSootopolisCity_WaterMons}; + +const struct WildPokemon gSootopolisCity_FishingMons[] = +{ + {5, 10, SPECIES_MAGIKARP}, + {5, 10, SPECIES_TENTACOOL}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_MAGIKARP}, + {10, 30, SPECIES_MAGIKARP}, + {30, 35, SPECIES_MAGIKARP}, + {30, 35, SPECIES_MAGIKARP}, + {35, 40, SPECIES_GYARADOS}, + {35, 45, SPECIES_GYARADOS}, + {5, 45, SPECIES_GYARADOS}, +}; + +const struct WildPokemonInfo gSootopolisCity_FishingMonsInfo = {10, gSootopolisCity_FishingMons}; + +const struct WildPokemon gSkyPillar_3F_LandMons[] = +{ + {33, 33, SPECIES_SABLEYE}, + {34, 34, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {34, 34, SPECIES_SABLEYE}, + {36, 36, SPECIES_CLAYDOL}, + {37, 37, SPECIES_BANETTE}, + {38, 38, SPECIES_BANETTE}, + {36, 36, SPECIES_CLAYDOL}, + {37, 37, SPECIES_CLAYDOL}, + {38, 38, SPECIES_CLAYDOL}, + {37, 37, SPECIES_CLAYDOL}, + {38, 38, SPECIES_CLAYDOL}, +}; + +const struct WildPokemonInfo gSkyPillar_3F_LandMonsInfo = {10, gSkyPillar_3F_LandMons}; + +const struct WildPokemon gSkyPillar_5F_LandMons[] = +{ + {33, 33, SPECIES_SABLEYE}, + {34, 34, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {34, 34, SPECIES_SABLEYE}, + {36, 36, SPECIES_CLAYDOL}, + {37, 37, SPECIES_BANETTE}, + {38, 38, SPECIES_BANETTE}, + {36, 36, SPECIES_CLAYDOL}, + {37, 37, SPECIES_CLAYDOL}, + {38, 38, SPECIES_ALTARIA}, + {39, 39, SPECIES_ALTARIA}, + {39, 39, SPECIES_ALTARIA}, +}; + +const struct WildPokemonInfo gSkyPillar_5F_LandMonsInfo = {10, gSkyPillar_5F_LandMons}; + +const struct WildPokemon gSafariZone_Southeast_LandMons[] = +{ + {33, 33, SPECIES_SUNKERN}, + {34, 34, SPECIES_MAREEP}, + {35, 35, SPECIES_SUNKERN}, + {36, 36, SPECIES_MAREEP}, + {34, 34, SPECIES_AIPOM}, + {33, 33, SPECIES_SPINARAK}, + {35, 35, SPECIES_HOOTHOOT}, + {34, 34, SPECIES_SNUBBULL}, + {36, 36, SPECIES_STANTLER}, + {37, 37, SPECIES_GLIGAR}, + {39, 39, SPECIES_STANTLER}, + {40, 40, SPECIES_GLIGAR}, +}; + +const struct WildPokemonInfo gSafariZone_Southeast_LandMonsInfo = {25, gSafariZone_Southeast_LandMons}; + +const struct WildPokemon gSafariZone_Southeast_WaterMons[] = +{ + {25, 30, SPECIES_WOOPER}, + {25, 30, SPECIES_MARILL}, + {25, 30, SPECIES_MARILL}, + {30, 35, SPECIES_MARILL}, + {35, 40, SPECIES_QUAGSIRE}, +}; + +const struct WildPokemonInfo gSafariZone_Southeast_WaterMonsInfo = {9, gSafariZone_Southeast_WaterMons}; + +const struct WildPokemon gSafariZone_Southeast_FishingMons[] = +{ + {25, 30, SPECIES_MAGIKARP}, + {25, 30, SPECIES_GOLDEEN}, + {25, 30, SPECIES_MAGIKARP}, + {25, 30, SPECIES_GOLDEEN}, + {30, 35, SPECIES_REMORAID}, + {25, 30, SPECIES_GOLDEEN}, + {25, 30, SPECIES_REMORAID}, + {30, 35, SPECIES_REMORAID}, + {30, 35, SPECIES_REMORAID}, + {35, 40, SPECIES_OCTILLERY}, +}; + +const struct WildPokemonInfo gSafariZone_Southeast_FishingMonsInfo = {35, gSafariZone_Southeast_FishingMons}; + +const struct WildPokemon gSafariZone_Northeast_LandMons[] = +{ + {33, 33, SPECIES_AIPOM}, + {34, 34, SPECIES_TEDDIURSA}, + {35, 35, SPECIES_AIPOM}, + {36, 36, SPECIES_TEDDIURSA}, + {34, 34, SPECIES_SUNKERN}, + {33, 33, SPECIES_LEDYBA}, + {35, 35, SPECIES_HOOTHOOT}, + {34, 34, SPECIES_PINECO}, + {36, 36, SPECIES_HOUNDOUR}, + {37, 37, SPECIES_MILTANK}, + {39, 39, SPECIES_HOUNDOUR}, + {40, 40, SPECIES_MILTANK}, +}; + +const struct WildPokemonInfo gSafariZone_Northeast_LandMonsInfo = {25, gSafariZone_Northeast_LandMons}; + +const struct WildPokemon gSafariZone_Northeast_RockSmashMons[] = +{ + {25, 30, SPECIES_SHUCKLE}, + {20, 25, SPECIES_SHUCKLE}, + {30, 35, SPECIES_SHUCKLE}, + {30, 35, SPECIES_SHUCKLE}, + {35, 40, SPECIES_SHUCKLE}, +}; + +const struct WildPokemonInfo gSafariZone_Northeast_RockSmashMonsInfo = {25, gSafariZone_Northeast_RockSmashMons}; + +const struct WildPokemon gMagmaHideout_1F_LandMons[] = +{ + {27, 27, SPECIES_GEODUDE}, + {28, 28, SPECIES_TORKOAL}, + {28, 28, SPECIES_GEODUDE}, + {30, 30, SPECIES_TORKOAL}, + {29, 29, SPECIES_GEODUDE}, + {30, 30, SPECIES_GEODUDE}, + {30, 30, SPECIES_GEODUDE}, + {30, 30, SPECIES_GRAVELER}, + {30, 30, SPECIES_GRAVELER}, + {31, 31, SPECIES_GRAVELER}, + {32, 32, SPECIES_GRAVELER}, + {33, 33, SPECIES_GRAVELER}, +}; + +const struct WildPokemonInfo gMagmaHideout_1F_LandMonsInfo = {10, gMagmaHideout_1F_LandMons}; + +const struct WildPokemon gMagmaHideout_2F_1R_LandMons[] = +{ + {27, 27, SPECIES_GEODUDE}, + {28, 28, SPECIES_TORKOAL}, + {28, 28, SPECIES_GEODUDE}, + {30, 30, SPECIES_TORKOAL}, + {29, 29, SPECIES_GEODUDE}, + {30, 30, SPECIES_GEODUDE}, + {30, 30, SPECIES_GEODUDE}, + {30, 30, SPECIES_GRAVELER}, + {30, 30, SPECIES_GRAVELER}, + {31, 31, SPECIES_GRAVELER}, + {32, 32, SPECIES_GRAVELER}, + {33, 33, SPECIES_GRAVELER}, +}; + +const struct WildPokemonInfo gMagmaHideout_2F_1R_LandMonsInfo = {10, gMagmaHideout_2F_1R_LandMons}; + +const struct WildPokemon gMagmaHideout_2F_2R_LandMons[] = +{ + {27, 27, SPECIES_GEODUDE}, + {28, 28, SPECIES_TORKOAL}, + {28, 28, SPECIES_GEODUDE}, + {30, 30, SPECIES_TORKOAL}, + {29, 29, SPECIES_GEODUDE}, + {30, 30, SPECIES_GEODUDE}, + {30, 30, SPECIES_GEODUDE}, + {30, 30, SPECIES_GRAVELER}, + {30, 30, SPECIES_GRAVELER}, + {31, 31, SPECIES_GRAVELER}, + {32, 32, SPECIES_GRAVELER}, + {33, 33, SPECIES_GRAVELER}, +}; + +const struct WildPokemonInfo gMagmaHideout_2F_2R_LandMonsInfo = {10, gMagmaHideout_2F_2R_LandMons}; + +const struct WildPokemon gMagmaHideout_3F_1R_LandMons[] = +{ + {27, 27, SPECIES_GEODUDE}, + {28, 28, SPECIES_TORKOAL}, + {28, 28, SPECIES_GEODUDE}, + {30, 30, SPECIES_TORKOAL}, + {29, 29, SPECIES_GEODUDE}, + {30, 30, SPECIES_GEODUDE}, + {30, 30, SPECIES_GEODUDE}, + {30, 30, SPECIES_GRAVELER}, + {30, 30, SPECIES_GRAVELER}, + {31, 31, SPECIES_GRAVELER}, + {32, 32, SPECIES_GRAVELER}, + {33, 33, SPECIES_GRAVELER}, +}; + +const struct WildPokemonInfo gMagmaHideout_3F_1R_LandMonsInfo = {10, gMagmaHideout_3F_1R_LandMons}; + +const struct WildPokemon gMagmaHideout_3F_2R_LandMons[] = +{ + {27, 27, SPECIES_GEODUDE}, + {28, 28, SPECIES_TORKOAL}, + {28, 28, SPECIES_GEODUDE}, + {30, 30, SPECIES_TORKOAL}, + {29, 29, SPECIES_GEODUDE}, + {30, 30, SPECIES_GEODUDE}, + {30, 30, SPECIES_GEODUDE}, + {30, 30, SPECIES_GRAVELER}, + {30, 30, SPECIES_GRAVELER}, + {31, 31, SPECIES_GRAVELER}, + {32, 32, SPECIES_GRAVELER}, + {33, 33, SPECIES_GRAVELER}, +}; + +const struct WildPokemonInfo gMagmaHideout_3F_2R_LandMonsInfo = {10, gMagmaHideout_3F_2R_LandMons}; + +const struct WildPokemon gMagmaHideout_4F_LandMons[] = +{ + {27, 27, SPECIES_GEODUDE}, + {28, 28, SPECIES_TORKOAL}, + {28, 28, SPECIES_GEODUDE}, + {30, 30, SPECIES_TORKOAL}, + {29, 29, SPECIES_GEODUDE}, + {30, 30, SPECIES_GEODUDE}, + {30, 30, SPECIES_GEODUDE}, + {30, 30, SPECIES_GRAVELER}, + {30, 30, SPECIES_GRAVELER}, + {31, 31, SPECIES_GRAVELER}, + {32, 32, SPECIES_GRAVELER}, + {33, 33, SPECIES_GRAVELER}, +}; + +const struct WildPokemonInfo gMagmaHideout_4F_LandMonsInfo = {10, gMagmaHideout_4F_LandMons}; + +const struct WildPokemon gMagmaHideout_3F_3R_LandMons[] = +{ + {27, 27, SPECIES_GEODUDE}, + {28, 28, SPECIES_TORKOAL}, + {28, 28, SPECIES_GEODUDE}, + {30, 30, SPECIES_TORKOAL}, + {29, 29, SPECIES_GEODUDE}, + {30, 30, SPECIES_GEODUDE}, + {30, 30, SPECIES_GEODUDE}, + {30, 30, SPECIES_GRAVELER}, + {30, 30, SPECIES_GRAVELER}, + {31, 31, SPECIES_GRAVELER}, + {32, 32, SPECIES_GRAVELER}, + {33, 33, SPECIES_GRAVELER}, +}; + +const struct WildPokemonInfo gMagmaHideout_3F_3R_LandMonsInfo = {10, gMagmaHideout_3F_3R_LandMons}; + +const struct WildPokemon gMagmaHideout_2F_3R_LandMons[] = +{ + {27, 27, SPECIES_GEODUDE}, + {28, 28, SPECIES_TORKOAL}, + {28, 28, SPECIES_GEODUDE}, + {30, 30, SPECIES_TORKOAL}, + {29, 29, SPECIES_GEODUDE}, + {30, 30, SPECIES_GEODUDE}, + {30, 30, SPECIES_GEODUDE}, + {30, 30, SPECIES_GRAVELER}, + {30, 30, SPECIES_GRAVELER}, + {31, 31, SPECIES_GRAVELER}, + {32, 32, SPECIES_GRAVELER}, + {33, 33, SPECIES_GRAVELER}, +}; + +const struct WildPokemonInfo gMagmaHideout_2F_3R_LandMonsInfo = {10, gMagmaHideout_2F_3R_LandMons}; + +const struct WildPokemon gMirageTower_1F_LandMons[] = +{ + {21, 21, SPECIES_SANDSHREW}, + {21, 21, SPECIES_TRAPINCH}, + {20, 20, SPECIES_SANDSHREW}, + {20, 20, SPECIES_TRAPINCH}, + {20, 20, SPECIES_SANDSHREW}, + {20, 20, SPECIES_TRAPINCH}, + {22, 22, SPECIES_SANDSHREW}, + {22, 22, SPECIES_TRAPINCH}, + {23, 23, SPECIES_SANDSHREW}, + {23, 23, SPECIES_TRAPINCH}, + {24, 24, SPECIES_SANDSHREW}, + {24, 24, SPECIES_TRAPINCH}, +}; + +const struct WildPokemonInfo gMirageTower_1F_LandMonsInfo = {10, gMirageTower_1F_LandMons}; + +const struct WildPokemon gMirageTower_2F_LandMons[] = +{ + {21, 21, SPECIES_SANDSHREW}, + {21, 21, SPECIES_TRAPINCH}, + {20, 20, SPECIES_SANDSHREW}, + {20, 20, SPECIES_TRAPINCH}, + {20, 20, SPECIES_SANDSHREW}, + {20, 20, SPECIES_TRAPINCH}, + {22, 22, SPECIES_SANDSHREW}, + {22, 22, SPECIES_TRAPINCH}, + {23, 23, SPECIES_SANDSHREW}, + {23, 23, SPECIES_TRAPINCH}, + {24, 24, SPECIES_SANDSHREW}, + {24, 24, SPECIES_TRAPINCH}, +}; + +const struct WildPokemonInfo gMirageTower_2F_LandMonsInfo = {10, gMirageTower_2F_LandMons}; + +const struct WildPokemon gMirageTower_3F_LandMons[] = +{ + {21, 21, SPECIES_SANDSHREW}, + {21, 21, SPECIES_TRAPINCH}, + {20, 20, SPECIES_SANDSHREW}, + {20, 20, SPECIES_TRAPINCH}, + {20, 20, SPECIES_SANDSHREW}, + {20, 20, SPECIES_TRAPINCH}, + {22, 22, SPECIES_SANDSHREW}, + {22, 22, SPECIES_TRAPINCH}, + {23, 23, SPECIES_SANDSHREW}, + {23, 23, SPECIES_TRAPINCH}, + {24, 24, SPECIES_SANDSHREW}, + {24, 24, SPECIES_TRAPINCH}, +}; + +const struct WildPokemonInfo gMirageTower_3F_LandMonsInfo = {10, gMirageTower_3F_LandMons}; + +const struct WildPokemon gMirageTower_4F_LandMons[] = +{ + {21, 21, SPECIES_SANDSHREW}, + {21, 21, SPECIES_TRAPINCH}, + {20, 20, SPECIES_SANDSHREW}, + {20, 20, SPECIES_TRAPINCH}, + {20, 20, SPECIES_SANDSHREW}, + {20, 20, SPECIES_TRAPINCH}, + {22, 22, SPECIES_SANDSHREW}, + {22, 22, SPECIES_TRAPINCH}, + {23, 23, SPECIES_SANDSHREW}, + {23, 23, SPECIES_TRAPINCH}, + {24, 24, SPECIES_SANDSHREW}, + {24, 24, SPECIES_TRAPINCH}, +}; + +const struct WildPokemonInfo gMirageTower_4F_LandMonsInfo = {10, gMirageTower_4F_LandMons}; + +const struct WildPokemon gDesertUnderpass_LandMons[] = +{ + {38, 38, SPECIES_DITTO}, + {35, 35, SPECIES_WHISMUR}, + {40, 40, SPECIES_DITTO}, + {40, 40, SPECIES_LOUDRED}, + {41, 41, SPECIES_DITTO}, + {36, 36, SPECIES_WHISMUR}, + {38, 38, SPECIES_LOUDRED}, + {42, 42, SPECIES_DITTO}, + {38, 38, SPECIES_WHISMUR}, + {43, 43, SPECIES_DITTO}, + {44, 44, SPECIES_LOUDRED}, + {45, 45, SPECIES_DITTO}, +}; + +const struct WildPokemonInfo gDesertUnderpass_LandMonsInfo = {10, gDesertUnderpass_LandMons}; + +const struct WildPokemon gArtisanCave_B1F_LandMons[] = +{ + {40, 40, SPECIES_SMEARGLE}, + {41, 41, SPECIES_SMEARGLE}, + {42, 42, SPECIES_SMEARGLE}, + {43, 43, SPECIES_SMEARGLE}, + {44, 44, SPECIES_SMEARGLE}, + {45, 45, SPECIES_SMEARGLE}, + {46, 46, SPECIES_SMEARGLE}, + {47, 47, SPECIES_SMEARGLE}, + {48, 48, SPECIES_SMEARGLE}, + {49, 49, SPECIES_SMEARGLE}, + {50, 50, SPECIES_SMEARGLE}, + {50, 50, SPECIES_SMEARGLE}, +}; + +const struct WildPokemonInfo gArtisanCave_B1F_LandMonsInfo = {10, gArtisanCave_B1F_LandMons}; + +const struct WildPokemon gArtisanCave_1F_LandMons[] = +{ + {40, 40, SPECIES_SMEARGLE}, + {41, 41, SPECIES_SMEARGLE}, + {42, 42, SPECIES_SMEARGLE}, + {43, 43, SPECIES_SMEARGLE}, + {44, 44, SPECIES_SMEARGLE}, + {45, 45, SPECIES_SMEARGLE}, + {46, 46, SPECIES_SMEARGLE}, + {47, 47, SPECIES_SMEARGLE}, + {48, 48, SPECIES_SMEARGLE}, + {49, 49, SPECIES_SMEARGLE}, + {50, 50, SPECIES_SMEARGLE}, + {50, 50, SPECIES_SMEARGLE}, +}; + +const struct WildPokemonInfo gArtisanCave_1F_LandMonsInfo = {10, gArtisanCave_1F_LandMons}; + +const struct WildPokemon gAlteringCave1_LandMons[] = +{ + {10, 10, SPECIES_ZUBAT}, + {12, 12, SPECIES_ZUBAT}, + {8, 8, SPECIES_ZUBAT}, + {14, 14, SPECIES_ZUBAT}, + {10, 10, SPECIES_ZUBAT}, + {12, 12, SPECIES_ZUBAT}, + {16, 16, SPECIES_ZUBAT}, + {6, 6, SPECIES_ZUBAT}, + {8, 8, SPECIES_ZUBAT}, + {14, 14, SPECIES_ZUBAT}, + {8, 8, SPECIES_ZUBAT}, + {14, 14, SPECIES_ZUBAT}, +}; + +const struct WildPokemonInfo gAlteringCave1_LandMonsInfo = {7, gAlteringCave1_LandMons}; + +const struct WildPokemon gAlteringCave2_LandMons[] = +{ + {7, 7, SPECIES_MAREEP}, + {9, 9, SPECIES_MAREEP}, + {5, 5, SPECIES_MAREEP}, + {11, 11, SPECIES_MAREEP}, + {7, 7, SPECIES_MAREEP}, + {9, 9, SPECIES_MAREEP}, + {13, 13, SPECIES_MAREEP}, + {3, 3, SPECIES_MAREEP}, + {5, 5, SPECIES_MAREEP}, + {11, 11, SPECIES_MAREEP}, + {5, 5, SPECIES_MAREEP}, + {11, 11, SPECIES_MAREEP}, +}; + +const struct WildPokemonInfo gAlteringCave2_LandMonsInfo = {7, gAlteringCave2_LandMons}; + +const struct WildPokemon gAlteringCave3_LandMons[] = +{ + {23, 23, SPECIES_PINECO}, + {25, 25, SPECIES_PINECO}, + {22, 22, SPECIES_PINECO}, + {27, 27, SPECIES_PINECO}, + {23, 23, SPECIES_PINECO}, + {25, 25, SPECIES_PINECO}, + {29, 29, SPECIES_PINECO}, + {19, 19, SPECIES_PINECO}, + {21, 21, SPECIES_PINECO}, + {27, 27, SPECIES_PINECO}, + {21, 21, SPECIES_PINECO}, + {27, 27, SPECIES_PINECO}, +}; + +const struct WildPokemonInfo gAlteringCave3_LandMonsInfo = {7, gAlteringCave3_LandMons}; + +const struct WildPokemon gAlteringCave4_LandMons[] = +{ + {16, 16, SPECIES_HOUNDOUR}, + {18, 18, SPECIES_HOUNDOUR}, + {14, 14, SPECIES_HOUNDOUR}, + {20, 20, SPECIES_HOUNDOUR}, + {16, 16, SPECIES_HOUNDOUR}, + {18, 18, SPECIES_HOUNDOUR}, + {22, 22, SPECIES_HOUNDOUR}, + {12, 12, SPECIES_HOUNDOUR}, + {14, 14, SPECIES_HOUNDOUR}, + {20, 20, SPECIES_HOUNDOUR}, + {14, 14, SPECIES_HOUNDOUR}, + {20, 20, SPECIES_HOUNDOUR}, +}; + +const struct WildPokemonInfo gAlteringCave4_LandMonsInfo = {7, gAlteringCave4_LandMons}; + +const struct WildPokemon gAlteringCave5_LandMons[] = +{ + {10, 10, SPECIES_TEDDIURSA}, + {12, 12, SPECIES_TEDDIURSA}, + {8, 8, SPECIES_TEDDIURSA}, + {14, 14, SPECIES_TEDDIURSA}, + {10, 10, SPECIES_TEDDIURSA}, + {12, 12, SPECIES_TEDDIURSA}, + {16, 16, SPECIES_TEDDIURSA}, + {6, 6, SPECIES_TEDDIURSA}, + {8, 8, SPECIES_TEDDIURSA}, + {14, 14, SPECIES_TEDDIURSA}, + {8, 8, SPECIES_TEDDIURSA}, + {14, 14, SPECIES_TEDDIURSA}, +}; + +const struct WildPokemonInfo gAlteringCave5_LandMonsInfo = {7, gAlteringCave5_LandMons}; + +const struct WildPokemon gAlteringCave6_LandMons[] = +{ + {22, 22, SPECIES_AIPOM}, + {24, 24, SPECIES_AIPOM}, + {20, 20, SPECIES_AIPOM}, + {26, 26, SPECIES_AIPOM}, + {22, 22, SPECIES_AIPOM}, + {24, 24, SPECIES_AIPOM}, + {28, 28, SPECIES_AIPOM}, + {18, 18, SPECIES_AIPOM}, + {20, 20, SPECIES_AIPOM}, + {26, 26, SPECIES_AIPOM}, + {20, 20, SPECIES_AIPOM}, + {26, 26, SPECIES_AIPOM}, +}; + +const struct WildPokemonInfo gAlteringCave6_LandMonsInfo = {7, gAlteringCave6_LandMons}; + +const struct WildPokemon gAlteringCave7_LandMons[] = +{ + {22, 22, SPECIES_SHUCKLE}, + {24, 24, SPECIES_SHUCKLE}, + {20, 20, SPECIES_SHUCKLE}, + {26, 26, SPECIES_SHUCKLE}, + {22, 22, SPECIES_SHUCKLE}, + {24, 24, SPECIES_SHUCKLE}, + {28, 28, SPECIES_SHUCKLE}, + {18, 18, SPECIES_SHUCKLE}, + {20, 20, SPECIES_SHUCKLE}, + {26, 26, SPECIES_SHUCKLE}, + {20, 20, SPECIES_SHUCKLE}, + {26, 26, SPECIES_SHUCKLE}, +}; + +const struct WildPokemonInfo gAlteringCave7_LandMonsInfo = {7, gAlteringCave7_LandMons}; + +const struct WildPokemon gAlteringCave8_LandMons[] = +{ + {22, 22, SPECIES_STANTLER}, + {24, 24, SPECIES_STANTLER}, + {20, 20, SPECIES_STANTLER}, + {26, 26, SPECIES_STANTLER}, + {22, 22, SPECIES_STANTLER}, + {24, 24, SPECIES_STANTLER}, + {28, 28, SPECIES_STANTLER}, + {18, 18, SPECIES_STANTLER}, + {20, 20, SPECIES_STANTLER}, + {26, 26, SPECIES_STANTLER}, + {20, 20, SPECIES_STANTLER}, + {26, 26, SPECIES_STANTLER}, +}; + +const struct WildPokemonInfo gAlteringCave8_LandMonsInfo = {7, gAlteringCave8_LandMons}; + +const struct WildPokemon gAlteringCave9_LandMons[] = +{ + {22, 22, SPECIES_SMEARGLE}, + {24, 24, SPECIES_SMEARGLE}, + {20, 20, SPECIES_SMEARGLE}, + {26, 26, SPECIES_SMEARGLE}, + {22, 22, SPECIES_SMEARGLE}, + {24, 24, SPECIES_SMEARGLE}, + {28, 28, SPECIES_SMEARGLE}, + {18, 18, SPECIES_SMEARGLE}, + {20, 20, SPECIES_SMEARGLE}, + {26, 26, SPECIES_SMEARGLE}, + {20, 20, SPECIES_SMEARGLE}, + {26, 26, SPECIES_SMEARGLE}, +}; + +const struct WildPokemonInfo gAlteringCave9_LandMonsInfo = {7, gAlteringCave9_LandMons}; + +const struct WildPokemon gMeteorFalls_StevensCave_LandMons[] = +{ + {33, 33, SPECIES_GOLBAT}, + {35, 35, SPECIES_GOLBAT}, + {33, 33, SPECIES_GOLBAT}, + {35, 35, SPECIES_SOLROCK}, + {33, 33, SPECIES_SOLROCK}, + {37, 37, SPECIES_SOLROCK}, + {35, 35, SPECIES_GOLBAT}, + {39, 39, SPECIES_SOLROCK}, + {38, 38, SPECIES_GOLBAT}, + {40, 40, SPECIES_GOLBAT}, + {38, 38, SPECIES_GOLBAT}, + {40, 40, SPECIES_GOLBAT}, +}; + +const struct WildPokemonInfo gMeteorFalls_StevensCave_LandMonsInfo = {10, gMeteorFalls_StevensCave_LandMons}; + +//The actual headers that link the encounter tables to particular maps start here. + +const struct WildPokemonHeader gWildMonHeaders[] = +{ + { + .mapGroup = MAP_GROUP(ROUTE101), + .mapNum = MAP_NUM(ROUTE101), + .landMonsInfo = &gRoute101_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ROUTE102), + .mapNum = MAP_NUM(ROUTE102), + .landMonsInfo = &gRoute102_LandMonsInfo, + .waterMonsInfo = &gRoute102_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute102_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE103), + .mapNum = MAP_NUM(ROUTE103), + .landMonsInfo = &gRoute103_LandMonsInfo, + .waterMonsInfo = &gRoute103_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute103_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE104), + .mapNum = MAP_NUM(ROUTE104), + .landMonsInfo = &gRoute104_LandMonsInfo, + .waterMonsInfo = &gRoute104_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute104_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE105), + .mapNum = MAP_NUM(ROUTE105), + .landMonsInfo = NULL, + .waterMonsInfo = &gRoute105_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute105_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE110), + .mapNum = MAP_NUM(ROUTE110), + .landMonsInfo = &gRoute110_LandMonsInfo, + .waterMonsInfo = &gRoute110_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute110_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE111), + .mapNum = MAP_NUM(ROUTE111), + .landMonsInfo = &gRoute111_LandMonsInfo, + .waterMonsInfo = &gRoute111_WaterMonsInfo, + .rockSmashMonsInfo = &gRoute111_RockSmashMonsInfo, + .fishingMonsInfo = &gRoute111_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE112), + .mapNum = MAP_NUM(ROUTE112), + .landMonsInfo = &gRoute112_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ROUTE113), + .mapNum = MAP_NUM(ROUTE113), + .landMonsInfo = &gRoute113_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ROUTE114), + .mapNum = MAP_NUM(ROUTE114), + .landMonsInfo = &gRoute114_LandMonsInfo, + .waterMonsInfo = &gRoute114_WaterMonsInfo, + .rockSmashMonsInfo = &gRoute114_RockSmashMonsInfo, + .fishingMonsInfo = &gRoute114_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE116), + .mapNum = MAP_NUM(ROUTE116), + .landMonsInfo = &gRoute116_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ROUTE117), + .mapNum = MAP_NUM(ROUTE117), + .landMonsInfo = &gRoute117_LandMonsInfo, + .waterMonsInfo = &gRoute117_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute117_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE118), + .mapNum = MAP_NUM(ROUTE118), + .landMonsInfo = &gRoute118_LandMonsInfo, + .waterMonsInfo = &gRoute118_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute118_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE124), + .mapNum = MAP_NUM(ROUTE124), + .landMonsInfo = NULL, + .waterMonsInfo = &gRoute124_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute124_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(PETALBURG_WOODS), + .mapNum = MAP_NUM(PETALBURG_WOODS), + .landMonsInfo = &gPetalburgWoods_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(RUSTURF_TUNNEL), + .mapNum = MAP_NUM(RUSTURF_TUNNEL), + .landMonsInfo = &gRusturfTunnel_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(GRANITE_CAVE_1F), + .mapNum = MAP_NUM(GRANITE_CAVE_1F), + .landMonsInfo = &gGraniteCave_1F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(GRANITE_CAVE_B1F), + .mapNum = MAP_NUM(GRANITE_CAVE_B1F), + .landMonsInfo = &gGraniteCave_B1F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MT_PYRE_1F), + .mapNum = MAP_NUM(MT_PYRE_1F), + .landMonsInfo = &gMtPyre_1F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(VICTORY_ROAD_1F), + .mapNum = MAP_NUM(VICTORY_ROAD_1F), + .landMonsInfo = &gVictoryRoad_1F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(SAFARI_ZONE_SOUTH), + .mapNum = MAP_NUM(SAFARI_ZONE_SOUTH), + .landMonsInfo = &gSafariZone_South_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(UNDERWATER2), + .mapNum = MAP_NUM(UNDERWATER2), + .landMonsInfo = NULL, + .waterMonsInfo = &gUnderwater2_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ABANDONED_SHIP_ROOMS_B1F), + .mapNum = MAP_NUM(ABANDONED_SHIP_ROOMS_B1F), + .landMonsInfo = NULL, + .waterMonsInfo = &gAbandonedShip_Rooms_B1F_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gAbandonedShip_Rooms_B1F_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(GRANITE_CAVE_B2F), + .mapNum = MAP_NUM(GRANITE_CAVE_B2F), + .landMonsInfo = &gGraniteCave_B2F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = &gGraniteCave_B2F_RockSmashMonsInfo, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(FIERY_PATH), + .mapNum = MAP_NUM(FIERY_PATH), + .landMonsInfo = &gFieryPath_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(METEOR_FALLS_B1F_2R), + .mapNum = MAP_NUM(METEOR_FALLS_B1F_2R), + .landMonsInfo = &gMeteorFalls_B1F_2R_LandMonsInfo, + .waterMonsInfo = &gMeteorFalls_B1F_2R_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gMeteorFalls_B1F_2R_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(JAGGED_PASS), + .mapNum = MAP_NUM(JAGGED_PASS), + .landMonsInfo = &gJaggedPass_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ROUTE106), + .mapNum = MAP_NUM(ROUTE106), + .landMonsInfo = NULL, + .waterMonsInfo = &gRoute106_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute106_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE107), + .mapNum = MAP_NUM(ROUTE107), + .landMonsInfo = NULL, + .waterMonsInfo = &gRoute107_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute107_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE108), + .mapNum = MAP_NUM(ROUTE108), + .landMonsInfo = NULL, + .waterMonsInfo = &gRoute108_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute108_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE109), + .mapNum = MAP_NUM(ROUTE109), + .landMonsInfo = NULL, + .waterMonsInfo = &gRoute109_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute109_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE115), + .mapNum = MAP_NUM(ROUTE115), + .landMonsInfo = &gRoute115_LandMonsInfo, + .waterMonsInfo = &gRoute115_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute115_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(NEW_MAUVILLE_INSIDE), + .mapNum = MAP_NUM(NEW_MAUVILLE_INSIDE), + .landMonsInfo = &gNewMauville_Inside_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ROUTE119), + .mapNum = MAP_NUM(ROUTE119), + .landMonsInfo = &gRoute119_LandMonsInfo, + .waterMonsInfo = &gRoute119_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute119_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE120), + .mapNum = MAP_NUM(ROUTE120), + .landMonsInfo = &gRoute120_LandMonsInfo, + .waterMonsInfo = &gRoute120_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute120_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE121), + .mapNum = MAP_NUM(ROUTE121), + .landMonsInfo = &gRoute121_LandMonsInfo, + .waterMonsInfo = &gRoute121_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute121_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE122), + .mapNum = MAP_NUM(ROUTE122), + .landMonsInfo = NULL, + .waterMonsInfo = &gRoute122_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute122_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE123), + .mapNum = MAP_NUM(ROUTE123), + .landMonsInfo = &gRoute123_LandMonsInfo, + .waterMonsInfo = &gRoute123_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute123_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(MT_PYRE_2F), + .mapNum = MAP_NUM(MT_PYRE_2F), + .landMonsInfo = &gMtPyre_2F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MT_PYRE_3F), + .mapNum = MAP_NUM(MT_PYRE_3F), + .landMonsInfo = &gMtPyre_3F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MT_PYRE_4F), + .mapNum = MAP_NUM(MT_PYRE_4F), + .landMonsInfo = &gMtPyre_4F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MT_PYRE_5F), + .mapNum = MAP_NUM(MT_PYRE_5F), + .landMonsInfo = &gMtPyre_5F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MT_PYRE_6F), + .mapNum = MAP_NUM(MT_PYRE_6F), + .landMonsInfo = &gMtPyre_6F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MT_PYRE_EXTERIOR), + .mapNum = MAP_NUM(MT_PYRE_EXTERIOR), + .landMonsInfo = &gMtPyre_Exterior_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MT_PYRE_SUMMIT), + .mapNum = MAP_NUM(MT_PYRE_SUMMIT), + .landMonsInfo = &gMtPyre_Summit_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(GRANITE_CAVE_STEVENS_ROOM), + .mapNum = MAP_NUM(GRANITE_CAVE_STEVENS_ROOM), + .landMonsInfo = &gGraniteCave_StevensRoom_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ROUTE125), + .mapNum = MAP_NUM(ROUTE125), + .landMonsInfo = NULL, + .waterMonsInfo = &gRoute125_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute125_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE126), + .mapNum = MAP_NUM(ROUTE126), + .landMonsInfo = NULL, + .waterMonsInfo = &gRoute126_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute126_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE127), + .mapNum = MAP_NUM(ROUTE127), + .landMonsInfo = NULL, + .waterMonsInfo = &gRoute127_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute127_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE128), + .mapNum = MAP_NUM(ROUTE128), + .landMonsInfo = NULL, + .waterMonsInfo = &gRoute128_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute128_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE129), + .mapNum = MAP_NUM(ROUTE129), + .landMonsInfo = NULL, + .waterMonsInfo = &gRoute129_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute129_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE130), + .mapNum = MAP_NUM(ROUTE130), + .landMonsInfo = &gRoute130_LandMonsInfo, + .waterMonsInfo = &gRoute130_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute130_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE131), + .mapNum = MAP_NUM(ROUTE131), + .landMonsInfo = NULL, + .waterMonsInfo = &gRoute131_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute131_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE132), + .mapNum = MAP_NUM(ROUTE132), + .landMonsInfo = NULL, + .waterMonsInfo = &gRoute132_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute132_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE133), + .mapNum = MAP_NUM(ROUTE133), + .landMonsInfo = NULL, + .waterMonsInfo = &gRoute133_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute133_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ROUTE134), + .mapNum = MAP_NUM(ROUTE134), + .landMonsInfo = NULL, + .waterMonsInfo = &gRoute134_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gRoute134_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(ABANDONED_SHIP_HIDDEN_FLOOR_CORRIDORS), + .mapNum = MAP_NUM(ABANDONED_SHIP_HIDDEN_FLOOR_CORRIDORS), + .landMonsInfo = NULL, + .waterMonsInfo = &gAbandonedShip_HiddenFloorCorridors_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gAbandonedShip_HiddenFloorCorridors_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(SEAFLOOR_CAVERN_ROOM1), + .mapNum = MAP_NUM(SEAFLOOR_CAVERN_ROOM1), + .landMonsInfo = &gSeafloorCavern_Room1_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(SEAFLOOR_CAVERN_ROOM2), + .mapNum = MAP_NUM(SEAFLOOR_CAVERN_ROOM2), + .landMonsInfo = &gSeafloorCavern_Room2_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(SEAFLOOR_CAVERN_ROOM3), + .mapNum = MAP_NUM(SEAFLOOR_CAVERN_ROOM3), + .landMonsInfo = &gSeafloorCavern_Room3_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(SEAFLOOR_CAVERN_ROOM4), + .mapNum = MAP_NUM(SEAFLOOR_CAVERN_ROOM4), + .landMonsInfo = &gSeafloorCavern_Room4_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(SEAFLOOR_CAVERN_ROOM5), + .mapNum = MAP_NUM(SEAFLOOR_CAVERN_ROOM5), + .landMonsInfo = &gSeafloorCavern_Room5_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(SEAFLOOR_CAVERN_ROOM6), + .mapNum = MAP_NUM(SEAFLOOR_CAVERN_ROOM6), + .landMonsInfo = &gSeafloorCavern_Room6_LandMonsInfo, + .waterMonsInfo = &gSeafloorCavern_Room6_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gSeafloorCavern_Room6_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(SEAFLOOR_CAVERN_ROOM7), + .mapNum = MAP_NUM(SEAFLOOR_CAVERN_ROOM7), + .landMonsInfo = &gSeafloorCavern_Room7_LandMonsInfo, + .waterMonsInfo = &gSeafloorCavern_Room7_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gSeafloorCavern_Room7_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(SEAFLOOR_CAVERN_ROOM8), + .mapNum = MAP_NUM(SEAFLOOR_CAVERN_ROOM8), + .landMonsInfo = &gSeafloorCavern_Room8_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(SEAFLOOR_CAVERN_ENTRANCE), + .mapNum = MAP_NUM(SEAFLOOR_CAVERN_ENTRANCE), + .landMonsInfo = NULL, + .waterMonsInfo = &gSeafloorCavern_Entrance_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gSeafloorCavern_Entrance_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(CAVE_OF_ORIGIN_ENTRANCE), + .mapNum = MAP_NUM(CAVE_OF_ORIGIN_ENTRANCE), + .landMonsInfo = &gCaveOfOrigin_Entrance_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(CAVE_OF_ORIGIN_1F), + .mapNum = MAP_NUM(CAVE_OF_ORIGIN_1F), + .landMonsInfo = &gCaveOfOrigin_1F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP1), + .mapNum = MAP_NUM(CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP1), + .landMonsInfo = &gCaveOfOrigin_UnusedRubySapphireMap1_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP2), + .mapNum = MAP_NUM(CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP2), + .landMonsInfo = &gCaveOfOrigin_UnusedRubySapphireMap2_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP3), + .mapNum = MAP_NUM(CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP3), + .landMonsInfo = &gCaveOfOrigin_UnusedRubySapphireMap3_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(NEW_MAUVILLE_ENTRANCE), + .mapNum = MAP_NUM(NEW_MAUVILLE_ENTRANCE), + .landMonsInfo = &gNewMauville_Entrance_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(SAFARI_ZONE_SOUTHWEST), + .mapNum = MAP_NUM(SAFARI_ZONE_SOUTHWEST), + .landMonsInfo = &gSafariZone_Southwest_LandMonsInfo, + .waterMonsInfo = &gSafariZone_Southwest_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gSafariZone_Southwest_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(SAFARI_ZONE_NORTH), + .mapNum = MAP_NUM(SAFARI_ZONE_NORTH), + .landMonsInfo = &gSafariZone_North_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = &gSafariZone_North_RockSmashMonsInfo, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(SAFARI_ZONE_NORTHWEST), + .mapNum = MAP_NUM(SAFARI_ZONE_NORTHWEST), + .landMonsInfo = &gSafariZone_Northwest_LandMonsInfo, + .waterMonsInfo = &gSafariZone_Northwest_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gSafariZone_Northwest_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(VICTORY_ROAD_B1F), + .mapNum = MAP_NUM(VICTORY_ROAD_B1F), + .landMonsInfo = &gVictoryRoad_B1F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = &gVictoryRoad_B1F_RockSmashMonsInfo, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(VICTORY_ROAD_B2F), + .mapNum = MAP_NUM(VICTORY_ROAD_B2F), + .landMonsInfo = &gVictoryRoad_B2F_LandMonsInfo, + .waterMonsInfo = &gVictoryRoad_B2F_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gVictoryRoad_B2F_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(METEOR_FALLS_1F_1R), + .mapNum = MAP_NUM(METEOR_FALLS_1F_1R), + .landMonsInfo = &gMeteorFalls_1F_1R_LandMonsInfo, + .waterMonsInfo = &gMeteorFalls_1F_1R_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gMeteorFalls_1F_1R_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(METEOR_FALLS_1F_2R), + .mapNum = MAP_NUM(METEOR_FALLS_1F_2R), + .landMonsInfo = &gMeteorFalls_1F_2R_LandMonsInfo, + .waterMonsInfo = &gMeteorFalls_1F_2R_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gMeteorFalls_1F_2R_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(METEOR_FALLS_B1F_1R), + .mapNum = MAP_NUM(METEOR_FALLS_B1F_1R), + .landMonsInfo = &gMeteorFalls_B1F_1R_LandMonsInfo, + .waterMonsInfo = &gMeteorFalls_B1F_1R_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gMeteorFalls_B1F_1R_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(SHOAL_CAVE_LOW_TIDE_STAIRS_ROOM), + .mapNum = MAP_NUM(SHOAL_CAVE_LOW_TIDE_STAIRS_ROOM), + .landMonsInfo = &gShoalCave_LowTideStairsRoom_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(SHOAL_CAVE_LOW_TIDE_LOWER_ROOM), + .mapNum = MAP_NUM(SHOAL_CAVE_LOW_TIDE_LOWER_ROOM), + .landMonsInfo = &gShoalCave_LowTideLowerRoom_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(SHOAL_CAVE_LOW_TIDE_INNER_ROOM), + .mapNum = MAP_NUM(SHOAL_CAVE_LOW_TIDE_INNER_ROOM), + .landMonsInfo = &gShoalCave_LowTideInnerRoom_LandMonsInfo, + .waterMonsInfo = &gShoalCave_LowTideInnerRoom_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gShoalCave_LowTideInnerRoom_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(SHOAL_CAVE_LOW_TIDE_ENTRANCE_ROOM), + .mapNum = MAP_NUM(SHOAL_CAVE_LOW_TIDE_ENTRANCE_ROOM), + .landMonsInfo = &gShoalCave_LowTideEntranceRoom_LandMonsInfo, + .waterMonsInfo = &gShoalCave_LowTideEntranceRoom_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gShoalCave_LowTideEntranceRoom_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(LILYCOVE_CITY), + .mapNum = MAP_NUM(LILYCOVE_CITY), + .landMonsInfo = NULL, + .waterMonsInfo = &gLilycoveCity_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gLilycoveCity_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(DEWFORD_TOWN), + .mapNum = MAP_NUM(DEWFORD_TOWN), + .landMonsInfo = NULL, + .waterMonsInfo = &gDewfordTown_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gDewfordTown_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(SLATEPORT_CITY), + .mapNum = MAP_NUM(SLATEPORT_CITY), + .landMonsInfo = NULL, + .waterMonsInfo = &gSlateportCity_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gSlateportCity_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(MOSSDEEP_CITY), + .mapNum = MAP_NUM(MOSSDEEP_CITY), + .landMonsInfo = NULL, + .waterMonsInfo = &gMossdeepCity_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gMossdeepCity_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(PACIFIDLOG_TOWN), + .mapNum = MAP_NUM(PACIFIDLOG_TOWN), + .landMonsInfo = NULL, + .waterMonsInfo = &gPacifidlogTown_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gPacifidlogTown_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(EVER_GRANDE_CITY), + .mapNum = MAP_NUM(EVER_GRANDE_CITY), + .landMonsInfo = NULL, + .waterMonsInfo = &gEverGrandeCity_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gEverGrandeCity_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(PETALBURG_CITY), + .mapNum = MAP_NUM(PETALBURG_CITY), + .landMonsInfo = NULL, + .waterMonsInfo = &gPetalburgCity_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gPetalburgCity_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(UNDERWATER1), + .mapNum = MAP_NUM(UNDERWATER1), + .landMonsInfo = NULL, + .waterMonsInfo = &gUnderwater1_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(SHOAL_CAVE_LOW_TIDE_ICE_ROOM), + .mapNum = MAP_NUM(SHOAL_CAVE_LOW_TIDE_ICE_ROOM), + .landMonsInfo = &gShoalCave_LowTideIceRoom_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(SKY_PILLAR_1F), + .mapNum = MAP_NUM(SKY_PILLAR_1F), + .landMonsInfo = &gSkyPillar_1F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(SOOTOPOLIS_CITY), + .mapNum = MAP_NUM(SOOTOPOLIS_CITY), + .landMonsInfo = NULL, + .waterMonsInfo = &gSootopolisCity_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gSootopolisCity_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(SKY_PILLAR_3F), + .mapNum = MAP_NUM(SKY_PILLAR_3F), + .landMonsInfo = &gSkyPillar_3F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(SKY_PILLAR_5F), + .mapNum = MAP_NUM(SKY_PILLAR_5F), + .landMonsInfo = &gSkyPillar_5F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(SAFARI_ZONE_SOUTHEAST), + .mapNum = MAP_NUM(SAFARI_ZONE_SOUTHEAST), + .landMonsInfo = &gSafariZone_Southeast_LandMonsInfo, + .waterMonsInfo = &gSafariZone_Southeast_WaterMonsInfo, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = &gSafariZone_Southeast_FishingMonsInfo, + }, + { + .mapGroup = MAP_GROUP(SAFARI_ZONE_NORTHEAST), + .mapNum = MAP_NUM(SAFARI_ZONE_NORTHEAST), + .landMonsInfo = &gSafariZone_Northeast_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = &gSafariZone_Northeast_RockSmashMonsInfo, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MAGMA_HIDEOUT_1F), + .mapNum = MAP_NUM(MAGMA_HIDEOUT_1F), + .landMonsInfo = &gMagmaHideout_1F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MAGMA_HIDEOUT_2F_1R), + .mapNum = MAP_NUM(MAGMA_HIDEOUT_2F_1R), + .landMonsInfo = &gMagmaHideout_2F_1R_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MAGMA_HIDEOUT_2F_2R), + .mapNum = MAP_NUM(MAGMA_HIDEOUT_2F_2R), + .landMonsInfo = &gMagmaHideout_2F_2R_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MAGMA_HIDEOUT_3F_1R), + .mapNum = MAP_NUM(MAGMA_HIDEOUT_3F_1R), + .landMonsInfo = &gMagmaHideout_3F_1R_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MAGMA_HIDEOUT_3F_2R), + .mapNum = MAP_NUM(MAGMA_HIDEOUT_3F_2R), + .landMonsInfo = &gMagmaHideout_3F_2R_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MAGMA_HIDEOUT_4F), + .mapNum = MAP_NUM(MAGMA_HIDEOUT_4F), + .landMonsInfo = &gMagmaHideout_4F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MAGMA_HIDEOUT_3F_3R), + .mapNum = MAP_NUM(MAGMA_HIDEOUT_3F_3R), + .landMonsInfo = &gMagmaHideout_3F_3R_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MAGMA_HIDEOUT_2F_3R), + .mapNum = MAP_NUM(MAGMA_HIDEOUT_2F_3R), + .landMonsInfo = &gMagmaHideout_2F_3R_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MIRAGE_TOWER_1F), + .mapNum = MAP_NUM(MIRAGE_TOWER_1F), + .landMonsInfo = &gMirageTower_1F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MIRAGE_TOWER_2F), + .mapNum = MAP_NUM(MIRAGE_TOWER_2F), + .landMonsInfo = &gMirageTower_2F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MIRAGE_TOWER_3F), + .mapNum = MAP_NUM(MIRAGE_TOWER_3F), + .landMonsInfo = &gMirageTower_3F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(MIRAGE_TOWER_4F), + .mapNum = MAP_NUM(MIRAGE_TOWER_4F), + .landMonsInfo = &gMirageTower_4F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(DESERT_UNDERPASS), + .mapNum = MAP_NUM(DESERT_UNDERPASS), + .landMonsInfo = &gDesertUnderpass_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ARTISAN_CAVE_B1F), + .mapNum = MAP_NUM(ARTISAN_CAVE_B1F), + .landMonsInfo = &gArtisanCave_B1F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ARTISAN_CAVE_1F), + .mapNum = MAP_NUM(ARTISAN_CAVE_1F), + .landMonsInfo = &gArtisanCave_1F_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ALTERING_CAVE), + .mapNum = MAP_NUM(ALTERING_CAVE), + .landMonsInfo = &gAlteringCave1_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ALTERING_CAVE), + .mapNum = MAP_NUM(ALTERING_CAVE), + .landMonsInfo = &gAlteringCave2_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ALTERING_CAVE), + .mapNum = MAP_NUM(ALTERING_CAVE), + .landMonsInfo = &gAlteringCave3_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ALTERING_CAVE), + .mapNum = MAP_NUM(ALTERING_CAVE), + .landMonsInfo = &gAlteringCave4_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ALTERING_CAVE), + .mapNum = MAP_NUM(ALTERING_CAVE), + .landMonsInfo = &gAlteringCave5_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ALTERING_CAVE), + .mapNum = MAP_NUM(ALTERING_CAVE), + .landMonsInfo = &gAlteringCave6_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ALTERING_CAVE), + .mapNum = MAP_NUM(ALTERING_CAVE), + .landMonsInfo = &gAlteringCave7_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ALTERING_CAVE), + .mapNum = MAP_NUM(ALTERING_CAVE), + .landMonsInfo = &gAlteringCave8_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(ALTERING_CAVE), + .mapNum = MAP_NUM(ALTERING_CAVE), + .landMonsInfo = &gAlteringCave9_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(METEOR_FALLS_STEVENS_CAVE), + .mapNum = MAP_NUM(METEOR_FALLS_STEVENS_CAVE), + .landMonsInfo = &gMeteorFalls_StevensCave_LandMonsInfo, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = MAP_GROUP(UNDEFINED), + .mapNum = MAP_NUM(UNDEFINED), + .landMonsInfo = NULL, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, +}; + +//Battle Pyramid-specific tables and headers start here. + +const struct WildPokemon gBattlePyramidPlaceholders_1[] = +{ + {5, 5, SPECIES_BULBASAUR}, + {5, 5, SPECIES_BULBASAUR}, + {5, 5, SPECIES_BULBASAUR}, + {5, 5, SPECIES_BULBASAUR}, + {5, 5, SPECIES_IVYSAUR}, + {5, 5, SPECIES_IVYSAUR}, + {5, 5, SPECIES_VENUSAUR}, + {5, 5, SPECIES_VENUSAUR}, + {5, 5, SPECIES_VENUSAUR}, + {5, 5, SPECIES_CHARMANDER}, + {5, 5, SPECIES_VENUSAUR}, + {5, 5, SPECIES_CHARMANDER}, +}; + +const struct WildPokemonInfo gBattlePyramidPlaceholders_1Info = {4, gBattlePyramidPlaceholders_1}; + +const struct WildPokemon gBattlePyramidPlaceholders_2[] = +{ + {5, 5, SPECIES_IVYSAUR}, + {5, 5, SPECIES_IVYSAUR}, + {5, 5, SPECIES_IVYSAUR}, + {5, 5, SPECIES_IVYSAUR}, + {5, 5, SPECIES_VENUSAUR}, + {5, 5, SPECIES_VENUSAUR}, + {5, 5, SPECIES_CHARMANDER}, + {5, 5, SPECIES_CHARMANDER}, + {5, 5, SPECIES_CHARMANDER}, + {5, 5, SPECIES_CHARMELEON}, + {5, 5, SPECIES_CHARMELEON}, + {5, 5, SPECIES_CHARMANDER}, +}; + +const struct WildPokemonInfo gBattlePyramidPlaceholders_2Info = {4, gBattlePyramidPlaceholders_2}; + +const struct WildPokemon gBattlePyramidPlaceholders_3[] = +{ + {5, 5, SPECIES_VENUSAUR}, + {5, 5, SPECIES_VENUSAUR}, + {5, 5, SPECIES_VENUSAUR}, + {5, 5, SPECIES_VENUSAUR}, + {5, 5, SPECIES_CHARMANDER}, + {5, 5, SPECIES_CHARMANDER}, + {5, 5, SPECIES_CHARMELEON}, + {5, 5, SPECIES_CHARMELEON}, + {5, 5, SPECIES_CHARMELEON}, + {5, 5, SPECIES_CHARIZARD}, + {5, 5, SPECIES_CHARMELEON}, + {5, 5, SPECIES_CHARIZARD}, +}; + +const struct WildPokemonInfo gBattlePyramidPlaceholders_3Info = {4, gBattlePyramidPlaceholders_3}; + +const struct WildPokemon gBattlePyramidPlaceholders_4[] = +{ + {5, 5, SPECIES_CHARMANDER}, + {5, 5, SPECIES_CHARMANDER}, + {5, 5, SPECIES_CHARMANDER}, + {5, 5, SPECIES_CHARMANDER}, + {5, 5, SPECIES_CHARMELEON}, + {5, 5, SPECIES_CHARMELEON}, + {5, 5, SPECIES_CHARIZARD}, + {5, 5, SPECIES_CHARIZARD}, + {5, 5, SPECIES_CHARIZARD}, + {5, 5, SPECIES_SQUIRTLE}, + {5, 5, SPECIES_CHARIZARD}, + {5, 5, SPECIES_SQUIRTLE}, +}; + +const struct WildPokemonInfo gBattlePyramidPlaceholders_4Info = {4, gBattlePyramidPlaceholders_4}; + +const struct WildPokemon gBattlePyramidPlaceholders_5[] = +{ + {5, 5, SPECIES_CHARMELEON}, + {5, 5, SPECIES_CHARMELEON}, + {5, 5, SPECIES_CHARMELEON}, + {5, 5, SPECIES_CHARMELEON}, + {5, 5, SPECIES_CHARIZARD}, + {5, 5, SPECIES_CHARIZARD}, + {5, 5, SPECIES_SQUIRTLE}, + {5, 5, SPECIES_SQUIRTLE}, + {5, 5, SPECIES_SQUIRTLE}, + {5, 5, SPECIES_WARTORTLE}, + {5, 5, SPECIES_SQUIRTLE}, + {5, 5, SPECIES_WARTORTLE}, +}; + +const struct WildPokemonInfo gBattlePyramidPlaceholders_5Info = {4, gBattlePyramidPlaceholders_5}; + +const struct WildPokemon gBattlePyramidPlaceholders_6[] = +{ + {5, 5, SPECIES_CHARIZARD}, + {5, 5, SPECIES_CHARIZARD}, + {5, 5, SPECIES_CHARIZARD}, + {5, 5, SPECIES_CHARMELEON}, + {5, 5, SPECIES_SQUIRTLE}, + {5, 5, SPECIES_SQUIRTLE}, + {5, 5, SPECIES_WARTORTLE}, + {5, 5, SPECIES_WARTORTLE}, + {5, 5, SPECIES_WARTORTLE}, + {5, 5, SPECIES_WARTORTLE}, + {5, 5, SPECIES_WARTORTLE}, + {5, 5, SPECIES_WARTORTLE}, +}; + +const struct WildPokemonInfo gBattlePyramidPlaceholders_6Info = {4, gBattlePyramidPlaceholders_6}; + +const struct WildPokemon gBattlePyramidPlaceholders_7[] = +{ + {5, 5, SPECIES_WARTORTLE}, + {5, 5, SPECIES_WARTORTLE}, + {5, 5, SPECIES_SQUIRTLE}, + {5, 5, SPECIES_SQUIRTLE}, + {5, 5, SPECIES_SQUIRTLE}, + {5, 5, SPECIES_CHARIZARD}, + {5, 5, SPECIES_CHARIZARD}, + {5, 5, SPECIES_CHARIZARD}, + {5, 5, SPECIES_CHARMELEON}, + {5, 5, SPECIES_CHARMELEON}, + {5, 5, SPECIES_CHARMELEON}, + {5, 5, SPECIES_CHARMELEON}, +}; + +const struct WildPokemonInfo gBattlePyramidPlaceholders_7Info = {8, gBattlePyramidPlaceholders_7}; + +const struct WildPokemonHeader gBattlePyramidWildMonHeaders[] = +{ + { + .mapGroup = 0, + .mapNum = 1, + .landMonsInfo = &gBattlePyramidPlaceholders_1Info, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = 0, + .mapNum = 2, + .landMonsInfo = &gBattlePyramidPlaceholders_2Info, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = 0, + .mapNum = 3, + .landMonsInfo = &gBattlePyramidPlaceholders_3Info, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = 0, + .mapNum = 4, + .landMonsInfo = &gBattlePyramidPlaceholders_4Info, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = 0, + .mapNum = 5, + .landMonsInfo = &gBattlePyramidPlaceholders_5Info, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = 0, + .mapNum = 6, + .landMonsInfo = &gBattlePyramidPlaceholders_6Info, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = 0, + .mapNum = 7, + .landMonsInfo = &gBattlePyramidPlaceholders_7Info, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = 255, + .mapNum = 255, + .landMonsInfo = NULL, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, +}; + +//Battle Pike-specific tables and headers start here. + +const struct WildPokemon gBattlePikeMons_1[] = +{ + {5, 5, SPECIES_SEVIPER}, + {5, 5, SPECIES_MILOTIC}, + {5, 5, SPECIES_DUSCLOPS}, + {5, 5, SPECIES_DUSCLOPS}, + {5, 5, SPECIES_DUSCLOPS}, + {5, 5, SPECIES_DUSCLOPS}, + {5, 5, SPECIES_SEVIPER}, + {5, 5, SPECIES_MILOTIC}, + {5, 5, SPECIES_DUSCLOPS}, + {5, 5, SPECIES_DUSCLOPS}, + {5, 5, SPECIES_SEVIPER}, + {5, 5, SPECIES_MILOTIC}, +}; + +const struct WildPokemonInfo gBattlePikeMonsInfo_1 = {10, gBattlePikeMons_1}; + +const struct WildPokemon gBattlePikeMons_2[] = +{ + {5, 5, SPECIES_SEVIPER}, + {5, 5, SPECIES_MILOTIC}, + {5, 5, SPECIES_ELECTRODE}, + {5, 5, SPECIES_ELECTRODE}, + {5, 5, SPECIES_ELECTRODE}, + {5, 5, SPECIES_ELECTRODE}, + {5, 5, SPECIES_SEVIPER}, + {5, 5, SPECIES_MILOTIC}, + {5, 5, SPECIES_ELECTRODE}, + {5, 5, SPECIES_ELECTRODE}, + {5, 5, SPECIES_SEVIPER}, + {5, 5, SPECIES_MILOTIC}, +}; + +const struct WildPokemonInfo gBattlePikeMonsInfo_2 = {10, gBattlePikeMons_2}; + +const struct WildPokemon gBattlePikeMons_3[] = +{ + {5, 5, SPECIES_SEVIPER}, + {5, 5, SPECIES_MILOTIC}, + {5, 5, SPECIES_BRELOOM}, + {5, 5, SPECIES_BRELOOM}, + {5, 5, SPECIES_BRELOOM}, + {5, 5, SPECIES_BRELOOM}, + {5, 5, SPECIES_SEVIPER}, + {5, 5, SPECIES_MILOTIC}, + {5, 5, SPECIES_BRELOOM}, + {5, 5, SPECIES_BRELOOM}, + {5, 5, SPECIES_SEVIPER}, + {5, 5, SPECIES_MILOTIC}, +}; + +const struct WildPokemonInfo gBattlePikeMonsInfo_3 = {10, gBattlePikeMons_3}; + +const struct WildPokemon gBattlePikeMons_4[] = +{ + {5, 5, SPECIES_SEVIPER}, + {5, 5, SPECIES_MILOTIC}, + {5, 5, SPECIES_WOBBUFFET}, + {5, 5, SPECIES_WOBBUFFET}, + {5, 5, SPECIES_WOBBUFFET}, + {5, 5, SPECIES_WOBBUFFET}, + {5, 5, SPECIES_SEVIPER}, + {5, 5, SPECIES_MILOTIC}, + {5, 5, SPECIES_WOBBUFFET}, + {5, 5, SPECIES_WOBBUFFET}, + {5, 5, SPECIES_SEVIPER}, + {5, 5, SPECIES_MILOTIC}, +}; + +const struct WildPokemonInfo gBattlePikeMonsInfo_4 = {10, gBattlePikeMons_4}; + +const struct WildPokemonHeader gBattlePikeWildMonHeaders[] = +{ + { + .mapGroup = 0, + .mapNum = 1, + .landMonsInfo = &gBattlePikeMonsInfo_1, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = 0, + .mapNum = 2, + .landMonsInfo = &gBattlePikeMonsInfo_2, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = 0, + .mapNum = 3, + .landMonsInfo = &gBattlePikeMonsInfo_3, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = 0, + .mapNum = 4, + .landMonsInfo = &gBattlePikeMonsInfo_4, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, + { + .mapGroup = 255, + .mapNum = 255, + .landMonsInfo = NULL, + .waterMonsInfo = NULL, + .rockSmashMonsInfo = NULL, + .fishingMonsInfo = NULL, + }, +}; + +//Special Feebas-related data. + +const struct WildPokemon gWildFeebasRoute119Data = {20, 25, SPECIES_FEEBAS}; + +const u16 gRoute119WaterTileData[] = +{ + 0, 0x2D, 0, + 0x2E, 0x5B, 0x83, + 0x5C, 0x8B, 0x12A, +}; + diff --git a/src/daycare.c b/src/daycare.c index 131540f6e..26fa0251e 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -16,33 +16,16 @@ #include "menu.h" #include "international_string_util.h" #include "script.h" +#include "strings.h" #include "task.h" #include "window.h" +#include "party_menu.h" #include "list_menu.h" #include "overworld.h" #define EGG_MOVES_ARRAY_COUNT 10 #define EGG_LVL_UP_MOVES_ARRAY_COUNT 50 -// text -extern const u8 gText_MaleSymbol4[]; -extern const u8 gText_FemaleSymbol4[]; -extern const u8 gText_GenderlessSymbol[]; -extern const u8 gText_NewLine2[]; -extern const u8 gText_Exit4[]; -extern const u8 gText_Lv[]; -extern const u8 gExpandedPlaceholder_Empty[]; -extern const u8 gText_Exit[]; -extern const u8 gDaycareText_GetAlongVeryWell[]; -extern const u8 gDaycareText_GetAlong[]; -extern const u8 gDaycareText_DontLikeOther[]; -extern const u8 gDaycareText_PlayOther[]; - -extern u8 GetCursorSelectionMonId(void); -extern u16 ItemIdToBattleMoveId(u16); -extern void sub_819746C(u8, bool8); -extern void sub_81B9328(void); - // this file's functions static void ClearDaycareMonMail(struct DayCareMail *mail); static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *daycare); @@ -901,7 +884,7 @@ static bool8 _DoEggActions_CheckHatch(struct DayCare *daycare) for (i = 0; i < DAYCARE_MON_COUNT; i++) { - if (GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SANITY_BIT2)) + if (GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SANITY_HAS_SPECIES)) daycare->mons[i].steps++, validEggs++; } @@ -922,7 +905,7 @@ static bool8 _DoEggActions_CheckHatch(struct DayCare *daycare) { if (!GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG)) continue; - if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_BIT1)) + if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_IS_BAD_EGG)) continue; steps = GetMonData(&gPlayerParty[i], MON_DATA_FRIENDSHIP); diff --git a/src/decompress.c b/src/decompress.c index 24d23209f..ed2f7a0bb 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -22,7 +22,7 @@ void LZDecompressVram(const u32 *src, void *dest) LZ77UnCompVram(src, dest); } -u16 LoadCompressedObjectPic(const struct CompressedSpriteSheet *src) +u16 LoadCompressedSpriteSheet(const struct CompressedSpriteSheet *src) { struct SpriteSheet dest; @@ -33,7 +33,7 @@ u16 LoadCompressedObjectPic(const struct CompressedSpriteSheet *src) return LoadSpriteSheet(&dest); } -void LoadCompressedObjectPicOverrideBuffer(const struct CompressedSpriteSheet *src, void *buffer) +void LoadCompressedSpriteSheetOverrideBuffer(const struct CompressedSpriteSheet *src, void *buffer) { struct SpriteSheet dest; @@ -44,7 +44,7 @@ void LoadCompressedObjectPicOverrideBuffer(const struct CompressedSpriteSheet *s LoadSpriteSheet(&dest); } -void LoadCompressedObjectPalette(const struct CompressedSpritePalette *src) +void LoadCompressedSpritePalette(const struct CompressedSpritePalette *src) { struct SpritePalette dest; @@ -54,7 +54,7 @@ void LoadCompressedObjectPalette(const struct CompressedSpritePalette *src) LoadSpritePalette(&dest); } -void LoadCompressedObjectPaletteOverrideBuffer(const struct CompressedSpritePalette *a, void *buffer) +void LoadCompressedSpritePaletteOverrideBuffer(const struct CompressedSpritePalette *a, void *buffer) { struct SpritePalette dest; @@ -465,7 +465,7 @@ u32 GetDecompressedDataSize(const u32 *ptr) return (ptr8[3] << 16) | (ptr8[2] << 8) | (ptr8[1]); } -bool8 LoadCompressedObjectPicUsingHeap(const struct CompressedSpriteSheet* src) +bool8 LoadCompressedSpriteSheetUsingHeap(const struct CompressedSpriteSheet* src) { struct SpriteSheet dest; void* buffer; @@ -482,7 +482,7 @@ bool8 LoadCompressedObjectPicUsingHeap(const struct CompressedSpriteSheet* src) return FALSE; } -bool8 LoadCompressedObjectPaletteUsingHeap(const struct CompressedSpritePalette *src) +bool8 LoadCompressedSpritePaletteUsingHeap(const struct CompressedSpritePalette *src) { struct SpritePalette dest; void* buffer; diff --git a/src/decoration.c b/src/decoration.c index dd691721a..addca6954 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -519,7 +519,7 @@ void sub_8126B80(u8 taskId) if (!gPaletteFade.active) { - menuPos = GetMenuCursorPos(); + menuPos = Menu_GetCursorPos(); switch (Menu_ProcessInput()) { default: @@ -527,7 +527,7 @@ void sub_8126B80(u8 taskId) sSecretBasePCMenuActions[sSecretBasePCMenuCursorPos].func.void_u8(taskId); break; case -2: - sSecretBasePCMenuCursorPos = GetMenuCursorPos(); + sSecretBasePCMenuCursorPos = Menu_GetCursorPos(); if ((s8)menuPos != sSecretBasePCMenuCursorPos) { sub_8126C08(); @@ -2065,7 +2065,7 @@ u8 AddDecorationIconObjectFromIconTable(u16 tilesTag, u16 paletteTag, u8 decor) LoadSpriteSheet(&sheet); palette.data = GetDecorationIconPicOrPalette(decor, 1); palette.tag = paletteTag; - LoadCompressedObjectPalette(&palette); + LoadCompressedSpritePalette(&palette); template = malloc(sizeof(struct SpriteTemplate)); *template = gItemIconSpriteTemplate; template->tileTag = tilesTag; diff --git a/src/dma3_manager.c b/src/dma3_manager.c index 28df9d932..51fa7072d 100644 --- a/src/dma3_manager.c +++ b/src/dma3_manager.c @@ -1,9 +1,6 @@ #include "global.h" #include "dma3.h" -// Maximum amount of data we will transfer in one operation -#define MAX_DMA_BLOCK_SIZE 0x1000 - #define MAX_DMA_REQUESTS 128 #define DMA_REQUEST_COPY32 1 @@ -40,49 +37,6 @@ void ClearDma3Requests(void) gDma3ManagerLocked = FALSE; } -#define Dma3CopyLarge_(src, dest, size, bit) \ -{ \ - const void *_src = src; \ - void *_dest = dest; \ - u32 _size = size; \ - while (1) \ - { \ - if (_size <= MAX_DMA_BLOCK_SIZE) \ - { \ - DmaCopy##bit(3, _src, _dest, _size); \ - break; \ - } \ - DmaCopy##bit(3, _src, _dest, MAX_DMA_BLOCK_SIZE); \ - _src += MAX_DMA_BLOCK_SIZE; \ - _dest += MAX_DMA_BLOCK_SIZE; \ - _size -= MAX_DMA_BLOCK_SIZE; \ - } \ -} - -#define Dma3CopyLarge16_(src, dest, size) Dma3CopyLarge_(src, dest, size, 16) -#define Dma3CopyLarge32_(src, dest, size) Dma3CopyLarge_(src, dest, size, 32) - -#define Dma3FillLarge_(value, dest, size, bit) \ -{ \ - void *_dest = dest; \ - u32 _size = size; \ - while (1) \ - { \ - if (_size <= MAX_DMA_BLOCK_SIZE) \ - { \ - DmaFill##bit(3, value, _dest, _size); \ - break; \ - } \ - DmaFill##bit(3, value, _dest, MAX_DMA_BLOCK_SIZE); \ - _dest += MAX_DMA_BLOCK_SIZE; \ - _size -= MAX_DMA_BLOCK_SIZE; \ - } \ -} - -#define Dma3FillLarge16_(value, dest, size) Dma3FillLarge_(value, dest, size, 16) -#define Dma3FillLarge32_(value, dest, size) Dma3FillLarge_(value, dest, size, 32) - - void ProcessDma3Requests(void) { u16 bytesTransferred; diff --git a/src/dragon.c b/src/dragon.c index 156d10ce1..68577988e 100644 --- a/src/dragon.c +++ b/src/dragon.c @@ -251,7 +251,7 @@ void sub_81131B4(struct Sprite *sprite) sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1); } - sub_80A6864(sprite, gBattleAnimArgs[1]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[1]); sprite->pos1.y += gBattleAnimArgs[2]; sprite->callback = RunStoredCallbackWhenAnimEnds; StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); @@ -329,7 +329,7 @@ void sub_81133E8(u8 taskId) struct Task *task = &gTasks[taskId]; u16 i; u8 r1; - if (sub_80A8364(gBattleAnimAttacker) == 1) + if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) { sp.dmaDest = ®_BG1HOFS; task->data[2] = gBattle_BG1_X; diff --git a/src/egg_hatch.c b/src/egg_hatch.c index e94069279..eb7772a3c 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -31,6 +31,7 @@ #include "field_weather.h" #include "international_string_util.h" #include "naming_screen.h" +#include "pokemon_storage_system.h" #include "field_screen_effect.h" #include "battle.h" // to get rid of later @@ -56,10 +57,6 @@ extern const u32 gUnknown_08331F60[]; // tilemap gameboy circle extern const u8 gText_HatchedFromEgg[]; extern const u8 gText_NickHatchPrompt[]; -extern void PlayRainSoundEffect(void); -extern u16 sub_80D22D0(void); -extern u8 CountPartyAliveNonEggMonsExcept(u8); - static void Task_EggHatch(u8 taskID); static void CB2_EggHatch_0(void); static void CB2_EggHatch_1(void); @@ -438,7 +435,7 @@ static u8 EggHatchCreateMonSprite(u8 a0, u8 switchID, u8 pokeID, u16* speciesLoc HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[(a0 * 2) + 1], species, pid); - LoadCompressedObjectPalette(GetMonSpritePalStruct(mon)); + LoadCompressedSpritePalette(GetMonSpritePalStruct(mon)); *speciesLoc = species; } break; @@ -872,7 +869,7 @@ u8 GetEggStepsToSubtract(void) u8 count, i; for (count = CalculatePlayerPartyCount(), i = 0; i < count; i++) { - if (!GetMonData(&gPlayerParty[i], MON_DATA_SANITY_BIT3)) + if (!GetMonData(&gPlayerParty[i], MON_DATA_SANITY_IS_EGG)) { u8 ability = GetMonAbility(&gPlayerParty[i]); if (ability == ABILITY_MAGMA_ARMOR || ability == ABILITY_FLAME_BODY) @@ -884,7 +881,7 @@ u8 GetEggStepsToSubtract(void) u16 sub_80722E0(void) { - u16 value = sub_80D22D0(); - value += CountPartyAliveNonEggMonsExcept(6); - return value; + u16 aliveNonEggMonsCount = CountStorageNonEggMons(); + aliveNonEggMonsCount += CountPartyAliveNonEggMonsExcept(6); + return aliveNonEggMonsCount; } diff --git a/src/electric.c b/src/electric.c index 5d772e042..142a9ca09 100644 --- a/src/electric.c +++ b/src/electric.c @@ -6,7 +6,6 @@ #include "sound.h" extern void sub_810E2C8(struct Sprite *); -extern bool8 sub_810B614(struct Task *task, u8 taskId); extern void TranslateAnimSpriteToTargetMonLocation(struct Sprite *); static void sub_810A1A8(struct Sprite *); @@ -38,6 +37,8 @@ static void sub_810B1F0(struct Sprite *); static void sub_810B23C(struct Sprite *); static bool8 sub_810B430(struct Task *task, u8 taskId); static void sub_810B51C(struct Sprite *); +static bool8 sub_810B614(struct Task *task, u8 taskId); +static void sub_810B684(struct Sprite *sprite); const union AnimCmd gUnknown_085956A4[] = { @@ -462,7 +463,7 @@ static void sub_810A1A8(struct Sprite *sprite) sprite->pos1.x -= gBattleAnimArgs[0]; else sprite->pos1.x += gBattleAnimArgs[0]; - + sprite->pos1.y += gBattleAnimArgs[1]; sprite->callback = sub_810A1F8; } @@ -479,7 +480,7 @@ static void sub_810A214(struct Sprite *sprite) sprite->pos1.x -= gBattleAnimArgs[0]; else sprite->pos1.x += gBattleAnimArgs[0]; - + sprite->callback = sub_810A258; } @@ -493,7 +494,7 @@ static void sub_810A274(struct Sprite *sprite) { sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); - + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) { sprite->pos1.x -= gBattleAnimArgs[0]; @@ -556,7 +557,7 @@ static void sub_810A308(struct Sprite *sprite) sprite->pos2.y = (gSineTable[gBattleAnimArgs[0] + 64] * gBattleAnimArgs[1]) >> 8; if (gBattleAnimArgs[6] & 1) - sprite->oam.priority = sub_80A8328(battler) + 1; + sprite->oam.priority = GetBattlerSpriteBGPriority(battler) + 1; matrixNum = sprite->oam.matrixNum; sineVal = gSineTable[gBattleAnimArgs[2]]; @@ -571,7 +572,7 @@ static void sub_810A308(struct Sprite *sprite) static void sub_810A46C(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); sprite->data[0] = gBattleAnimArgs[3]; sprite->data[1] = sprite->pos1.x; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); @@ -588,7 +589,7 @@ static void sub_810A46C(struct Sprite *sprite) static void sub_810A4F4(struct Sprite *sprite) { - if (!TranslateAnimLinear(sprite)) + if (!AnimTranslateLinear(sprite)) { sprite->pos2.x += Sin(sprite->data[7], sprite->data[5]); sprite->pos2.y += Cos(sprite->data[7], sprite->data[5]); @@ -615,7 +616,7 @@ static void sub_810A5BC(struct Sprite *sprite) { if (IsContest() || GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) gBattleAnimArgs[1] = -gBattleAnimArgs[1]; - + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + gBattleAnimArgs[1]; sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[2]; sprite->data[3] = gBattleAnimArgs[0]; @@ -665,7 +666,7 @@ static void sub_810A6EC(struct Sprite *sprite) static void sub_810A75C(struct Sprite *sprite) { - sub_80A6980(sprite, FALSE); + InitSpritePosToAnimTarget(sprite, FALSE); sprite->oam.tileNum += gBattleAnimArgs[3] * 4; if (gBattleAnimArgs[3] == 1) @@ -686,17 +687,16 @@ void sub_810A7DC(u8 taskId) gTasks[taskId].func = sub_810A834; } -#ifdef NONMATCHING // couldn't get the proper tail merging in the "CreateSprite" switch cases.(ported from ruby) static void sub_810A834(u8 taskId) { u16 r8; + u16 r2; s16 r12; - s16 r2; u8 spriteId = 0; u8 r7 = 0; u8 sp = gTasks[taskId].data[2]; - s16 r4 = gTasks[taskId].data[0]; - s16 r6 = gTasks[taskId].data[1]; + s16 x = gTasks[taskId].data[0]; + s16 y = gTasks[taskId].data[1]; if (!gTasks[taskId].data[2]) { @@ -714,27 +714,31 @@ static void sub_810A834(u8 taskId) switch (gTasks[taskId].data[10]) { case 0: - r8 += r2 * 0; - spriteId = CreateSprite(&gUnknown_08595828, r4, r6 + (r12 * 1), 2); + r12 *= 1; + spriteId = CreateSprite(&gUnknown_08595828, x, y + r12, 2); r7++; break; case 2: + r12 *= 2; r8 += r2; - spriteId = CreateSprite(&gUnknown_08595828, r4, r6 + (r12 * 2), 2); + spriteId = CreateSprite(&gUnknown_08595828, x, y + r12, 2); r7++; break; case 4: + r12 *= 3; r8 += r2 * 2; - spriteId = CreateSprite(&gUnknown_08595828, r4, r6 + (r12 * 3), 2); + spriteId = CreateSprite(&gUnknown_08595828, x, y + r12, 2); r7++; break; case 6: + r12 *= 4; r8 += r2 * 3; - spriteId = CreateSprite(&gUnknown_08595828, r4, r6 + (r12 * 4), 2); + spriteId = CreateSprite(&gUnknown_08595828, x, y + r12, 2); r7++; break; case 8: - spriteId = CreateSprite(&gUnknown_08595828, r4, r6 + (r12 * 5), 2); + r12 *= 5; + spriteId = CreateSprite(&gUnknown_08595828, x, y + r12, 2); r7++; break; case 10: @@ -751,211 +755,6 @@ static void sub_810A834(u8 taskId) gTasks[taskId].data[10]++; } -#else -NAKED -static void sub_810A834(u8 taskId) -{ - asm_unified("\n\ - push {r4-r7,lr}\n\ - mov r7, r10\n\ - mov r6, r9\n\ - mov r5, r8\n\ - push {r5-r7}\n\ - sub sp, 0x4\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - mov r9, r0\n\ - movs r5, 0\n\ - movs r7, 0\n\ - ldr r1, =gTasks\n\ - lsls r0, 2\n\ - add r0, r9\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - ldrb r2, [r0, 0xC]\n\ - str r2, [sp]\n\ - ldrh r4, [r0, 0x8]\n\ - ldrh r6, [r0, 0xA]\n\ - movs r3, 0xC\n\ - ldrsh r0, [r0, r3]\n\ - mov r10, r1\n\ - cmp r0, 0\n\ - bne _0810A878\n\ - movs r0, 0\n\ - mov r8, r0\n\ - movs r2, 0x1\n\ - movs r1, 0x10\n\ - mov r12, r1\n\ - b _0810A882\n\ - .pool\n\ -_0810A878:\n\ - movs r2, 0x10\n\ - mov r12, r2\n\ - movs r3, 0x8\n\ - mov r8, r3\n\ - movs r2, 0x4\n\ -_0810A882:\n\ - mov r0, r9\n\ - lsls r1, r0, 2\n\ - adds r0, r1, r0\n\ - lsls r0, 3\n\ - add r0, r10\n\ - movs r3, 0x1C\n\ - ldrsh r0, [r0, r3]\n\ - mov r10, r1\n\ - cmp r0, 0xA\n\ - bhi _0810A978\n\ - lsls r0, 2\n\ - ldr r1, =_0810A8A4\n\ - adds r0, r1\n\ - ldr r0, [r0]\n\ - mov pc, r0\n\ - .pool\n\ - .align 2, 0\n\ -_0810A8A4:\n\ - .4byte _0810A8D0\n\ - .4byte _0810A978\n\ - .4byte _0810A8E4\n\ - .4byte _0810A978\n\ - .4byte _0810A904\n\ - .4byte _0810A978\n\ - .4byte _0810A91A\n\ - .4byte _0810A978\n\ - .4byte _0810A93C\n\ - .4byte _0810A978\n\ - .4byte _0810A970\n\ -_0810A8D0:\n\ - ldr r0, =gUnknown_08595828\n\ - lsls r1, r4, 16\n\ - asrs r1, 16\n\ - lsls r2, r6, 16\n\ - asrs r2, 16\n\ - mov r4, r12\n\ - lsls r3, r4, 16\n\ - b _0810A952\n\ - .pool\n\ -_0810A8E4:\n\ - mov r0, r12\n\ - lsls r3, r0, 17\n\ - mov r1, r8\n\ - adds r0, r1, r2\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - mov r8, r0\n\ - ldr r0, =gUnknown_08595828\n\ - lsls r1, r4, 16\n\ - asrs r1, 16\n\ - lsls r2, r6, 16\n\ - asrs r2, 16\n\ - b _0810A952\n\ - .pool\n\ -_0810A904:\n\ - mov r3, r12\n\ - lsls r0, r3, 16\n\ - asrs r0, 16\n\ - lsls r3, r0, 1\n\ - adds r3, r0\n\ - lsls r0, r2, 1\n\ - add r0, r8\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - mov r8, r0\n\ - b _0810A946\n\ -_0810A91A:\n\ - mov r0, r12\n\ - lsls r3, r0, 18\n\ - lsls r0, r2, 1\n\ - adds r0, r2\n\ - add r0, r8\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - mov r8, r0\n\ - ldr r0, =gUnknown_08595828\n\ - lsls r1, r4, 16\n\ - asrs r1, 16\n\ - lsls r2, r6, 16\n\ - asrs r2, 16\n\ - b _0810A952\n\ - .pool\n\ -_0810A93C:\n\ - mov r1, r12\n\ - lsls r0, r1, 16\n\ - asrs r0, 16\n\ - lsls r3, r0, 2\n\ - adds r3, r0\n\ -_0810A946:\n\ - ldr r0, =gUnknown_08595828\n\ - lsls r1, r4, 16\n\ - asrs r1, 16\n\ - lsls r2, r6, 16\n\ - asrs r2, 16\n\ - lsls r3, 16\n\ -_0810A952:\n\ - asrs r3, 16\n\ - adds r2, r3\n\ - lsls r2, 16\n\ - asrs r2, 16\n\ - movs r3, 0x2\n\ - bl CreateSprite\n\ - lsls r0, 24\n\ - lsrs r5, r0, 24\n\ - adds r0, r7, 0x1\n\ - lsls r0, 24\n\ - lsrs r7, r0, 24\n\ - b _0810A978\n\ - .pool\n\ -_0810A970:\n\ - mov r0, r9\n\ - bl DestroyAnimVisualTask\n\ - b _0810A9BC\n\ -_0810A978:\n\ - cmp r7, 0\n\ - beq _0810A9AC\n\ - ldr r4, =gSprites\n\ - lsls r3, r5, 4\n\ - adds r3, r5\n\ - lsls r3, 2\n\ - adds r0, r3, r4\n\ - ldrh r5, [r0, 0x4]\n\ - lsls r2, r5, 22\n\ - lsrs r2, 22\n\ - add r2, r8\n\ - ldr r6, =0x000003ff\n\ - adds r1, r6, 0\n\ - ands r2, r1\n\ - ldr r1, =0xfffffc00\n\ - ands r1, r5\n\ - orrs r1, r2\n\ - strh r1, [r0, 0x4]\n\ - mov r1, sp\n\ - ldrh r1, [r1]\n\ - strh r1, [r0, 0x2E]\n\ - adds r4, 0x1C\n\ - adds r3, r4\n\ - ldr r1, [r3]\n\ - bl _call_via_r1\n\ -_0810A9AC:\n\ - ldr r0, =gTasks\n\ - mov r1, r10\n\ - add r1, r9\n\ - lsls r1, 3\n\ - adds r1, r0\n\ - ldrh r0, [r1, 0x1C]\n\ - adds r0, 0x1\n\ - strh r0, [r1, 0x1C]\n\ -_0810A9BC:\n\ - add sp, 0x4\n\ - pop {r3-r5}\n\ - mov r8, r3\n\ - mov r9, r4\n\ - mov r10, r5\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .pool\n\ - "); -} -#endif static void sub_810A9DC(struct Sprite *sprite) { @@ -1002,7 +801,7 @@ void sub_810AAFC(u8 taskId) { struct Task *task = &gTasks[taskId]; - if (!gBattleAnimArgs[0]) + if (!gBattleAnimArgs[0]) { task->data[14] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); task->data[15] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); @@ -1073,7 +872,7 @@ void sub_810AB78(u8 taskId) static void sub_810AC8C(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) { gTasks[sprite->data[5]].data[7]--; DestroySprite(sprite); @@ -1188,7 +987,7 @@ void sub_810AE5C(u8 taskId) } else task->data[0]++; - + } break; case 2: @@ -1334,6 +1133,7 @@ static void sub_810B23C(struct Sprite *sprite) case 1: if (sprite->affineAnimEnded) DestroySpriteAndMatrix(sprite); + break; } } @@ -1493,3 +1293,29 @@ void sub_810B55C(u8 taskId) break; } } + +bool8 sub_810B614(struct Task *task, u8 taskId) +{ + u8 spriteId = CreateSprite(&gUnknown_085956C0, task->data[13], task->data[14], task->data[12]); + + if (spriteId != MAX_SPRITES) + { + gSprites[spriteId].callback = sub_810B684; + gSprites[spriteId].data[6] = taskId; + gSprites[spriteId].data[7] = 10; + task->data[10]++; + } + if (task->data[14] >= task->data[15]) + return TRUE; + task->data[14] += 32; + return FALSE; +} + +static void sub_810B684(struct Sprite *sprite) +{ + if (sprite->animEnded) + { + gTasks[sprite->data[6]].data[sprite->data[7]]--; + DestroySprite(sprite); + } +} diff --git a/src/event_object_movement.c b/src/event_object_movement.c index ef125e564..ffa8f53c9 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1144,7 +1144,7 @@ u8 GetFirstInactiveEventObjectId(void) u8 GetEventObjectIdByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroupId) { - if (localId < 0xFF) + if (localId < EVENT_OBJ_ID_PLAYER) { return GetEventObjectIdByLocalIdAndMapInternal(localId, mapNum, mapGroupId); } diff --git a/src/evolution_graphics.c b/src/evolution_graphics.c index 022599dfb..bfd46978c 100644 --- a/src/evolution_graphics.c +++ b/src/evolution_graphics.c @@ -251,7 +251,7 @@ static void CreatePostEvoSparkleSet2(u8 arg0) void LoadEvoSparkleSpriteAndPal(void) { - LoadCompressedObjectPicUsingHeap(&sEvoSparkleSpriteSheets[0]); + LoadCompressedSpriteSheetUsingHeap(&sEvoSparkleSpriteSheets[0]); LoadSpritePalettes(sEvoSparkleSpritePals); } diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 829d72c34..3774ef2b3 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -12,7 +12,7 @@ #include "field_poison.h" #include "field_screen_effect.h" #include "field_specials.h" -#include "fldeff_80F9BCC.h" +#include "fldeff_misc.h" #include "item_menu.h" #include "link.h" #include "metatile_behavior.h" @@ -521,13 +521,13 @@ static bool8 TryStartMiscWalkingScripts(u16 metatileBehavior) } else if (MetatileBehavior_IsSecretBaseGlitterMat(metatileBehavior) == TRUE) { - sub_80FA9D0(); + DoSecretBaseGlitterMatSparkle(); return FALSE; } else if (MetatileBehavior_IsSecretBaseSoundMat(metatileBehavior) == TRUE) { PlayerGetDestCoords(&x, &y); - sub_80FA970(MapGridGetMetatileIdAt(x, y)); + PlaySecretBaseMusicNoteMatSound(MapGridGetMetatileIdAt(x, y)); return FALSE; } return FALSE; diff --git a/src/field_effect.c b/src/field_effect.c index 1442c611a..4e6f81484 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -9,7 +9,7 @@ #include "field_screen_effect.h" #include "field_weather.h" #include "fieldmap.h" -#include "fldeff_groundshake.h" +#include "fldeff.h" #include "gpu_regs.h" #include "main.h" #include "menu.h" @@ -733,8 +733,8 @@ bool8 FieldEffectActiveListContains(u8 id) u8 CreateTrainerSprite(u8 trainerSpriteID, s16 x, s16 y, u8 subpriority, u8 *buffer) { struct SpriteTemplate spriteTemplate; - LoadCompressedObjectPaletteOverrideBuffer(&gTrainerFrontPicPaletteTable[trainerSpriteID], buffer); - LoadCompressedObjectPicOverrideBuffer(&gTrainerFrontPicTable[trainerSpriteID], buffer); + LoadCompressedSpritePaletteOverrideBuffer(&gTrainerFrontPicPaletteTable[trainerSpriteID], buffer); + LoadCompressedSpriteSheetOverrideBuffer(&gTrainerFrontPicTable[trainerSpriteID], buffer); spriteTemplate.tileTag = gTrainerFrontPicTable[trainerSpriteID].tag; spriteTemplate.paletteTag = gTrainerFrontPicPaletteTable[trainerSpriteID].tag; spriteTemplate.oam = &gNewGameBirchOamAttributes; diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index 3046eccd5..53fd87e61 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -1228,13 +1228,11 @@ u32 ShowTreeDisguiseFieldEffect(void) return ShowDisguiseFieldEffect(FLDEFF_TREE_DISGUISE, 24, 4); } - u32 ShowMountainDisguiseFieldEffect(void) { return ShowDisguiseFieldEffect(FLDEFF_MOUNTAIN_DISGUISE, 25, 3); } - u32 ShowSandDisguiseFieldEffect(void) { return ShowDisguiseFieldEffect(FLDEFF_SAND_DISGUISE, 28, 2); @@ -1579,3 +1577,19 @@ static void sub_81561FC(struct Sprite *sprite, u8 z, u8 offset) } } } + +// Unused data. Feel free to remove. +static const u8 gUnknown_085CDC6E[] = +{ + 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x02, 0x02, + 0x01, 0x02, 0x02, 0x01, 0x02, 0x02, 0x01, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x02, + 0x01, 0x01, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, + 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, + 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00 +}; diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index a5aa23e32..f14ac8329 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -1310,7 +1310,7 @@ bool8 PartyHasMonWithSurf(void) { if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) == SPECIES_NONE) break; - if (pokemon_has_move(&gPlayerParty[i], MOVE_SURF)) + if (MonKnowsMove(&gPlayerParty[i], MOVE_SURF)) return TRUE; } } @@ -1845,7 +1845,7 @@ static bool8 Fishing6(struct Task *task) } else { - if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_BIT3)) + if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) { u8 ability = GetMonAbility(&gPlayerParty[0]); if (ability == ABILITY_SUCTION_CUPS || ability == ABILITY_STICKY_HOLD) diff --git a/src/field_poison.c b/src/field_poison.c index 02f37f69f..fac17dea9 100644 --- a/src/field_poison.c +++ b/src/field_poison.c @@ -4,7 +4,7 @@ #include "event_data.h" #include "field_message_box.h" #include "field_poison.h" -#include "fldeff_80F9BCC.h" +#include "fldeff_misc.h" #include "frontier_util.h" #include "party_menu.h" #include "pokenav.h" @@ -122,7 +122,7 @@ s32 DoPoisonFieldEffect(void) u32 numFainted = 0; for (i = 0; i < PARTY_SIZE; i++) { - if (GetMonData(pokemon, MON_DATA_SANITY_BIT2) && pokemon_ailments_get_primary(GetMonData(pokemon, MON_DATA_STATUS)) == AILMENT_PSN) + if (GetMonData(pokemon, MON_DATA_SANITY_HAS_SPECIES) && pokemon_ailments_get_primary(GetMonData(pokemon, MON_DATA_STATUS)) == AILMENT_PSN) { hp = GetMonData(pokemon, MON_DATA_HP); if (hp == 0 || --hp == 0) @@ -136,7 +136,7 @@ s32 DoPoisonFieldEffect(void) } if (numFainted != 0 || numPoisoned != 0) { - FldeffPoison_Start(); + FldEffPoison_Start(); } if (numFainted != 0) { diff --git a/src/field_specials.c b/src/field_specials.c index 3a50e272e..5e1c86dfe 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -1266,7 +1266,7 @@ void IsGrassTypeInParty(void) for (i = 0; i < PARTY_SIZE; i++) { pokemon = &gPlayerParty[i]; - if (GetMonData(pokemon, MON_DATA_SANITY_BIT2) && !GetMonData(pokemon, MON_DATA_IS_EGG)) + if (GetMonData(pokemon, MON_DATA_SANITY_HAS_SPECIES) && !GetMonData(pokemon, MON_DATA_IS_EGG)) { species = GetMonData(pokemon, MON_DATA_SPECIES); if (gBaseStats[species].type1 == TYPE_GRASS || gBaseStats[species].type2 == TYPE_GRASS) @@ -1279,17 +1279,17 @@ void IsGrassTypeInParty(void) gSpecialVar_Result = FALSE; } -void SpawnScriptEventObject(void) +void SpawnCameraObject(void) { - u8 obj = SpawnSpecialEventObjectParameterized(EVENT_OBJ_GFX_BOY_1, 8, 0x7F, gSaveBlock1Ptr->pos.x + 7, gSaveBlock1Ptr->pos.y + 7, 3); + u8 obj = SpawnSpecialEventObjectParameterized(EVENT_OBJ_GFX_BOY_1, 8, EVENT_OBJ_ID_CAMERA, gSaveBlock1Ptr->pos.x + 7, gSaveBlock1Ptr->pos.y + 7, 3); gEventObjects[obj].invisible = TRUE; CameraObjectSetFollowedObjectId(gEventObjects[obj].spriteId); } -void RemoveScriptEventObject(void) +void RemoveCameraObject(void) { CameraObjectSetFollowedObjectId(GetPlayerAvatarObjectId()); - RemoveEventObjectByLocalIdAndMap(0x7F, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); + RemoveEventObjectByLocalIdAndMap(EVENT_OBJ_ID_CAMERA, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); } u8 GetPokeblockNameByMonNature(void) @@ -1658,7 +1658,7 @@ bool8 sub_813990C(void) for (i = 0; i < partyCount; i++) { - if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_BIT1) == 1) + if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_IS_BAD_EGG) == 1) return TRUE; } @@ -3193,7 +3193,7 @@ void sub_813AEB4(void) i = 0; do { - if (gUnknown_0861500C[i] == gUnknown_085B320C[temp2]) + if (gTutorMoves[i] == gUnknown_085B320C[temp2]) { gSpecialVar_0x8005 = i; break; @@ -3206,7 +3206,7 @@ void sub_813AEB4(void) i = 0; do { - if (gUnknown_0861500C[i] == gUnknown_085B31F8[temp2]) + if (gTutorMoves[i] == gUnknown_085B31F8[temp2]) { gSpecialVar_0x8005 = i; break; @@ -3817,7 +3817,7 @@ void sub_813B9A0(void) } } -bool32 sub_813B9C0(void) +bool8 sub_813B9C0(void) { static const u16 gUnknown_085B3444[] = { MAP_OLDALE_TOWN_POKEMON_CENTER_1F, diff --git a/src/fieldmap.c b/src/fieldmap.c index cab200208..abdddb373 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -1,9 +1,8 @@ #include "global.h" #include "bg.h" #include "fieldmap.h" -#include "fldeff_80F9BCC.h" -#include "fldeff_cut.h" -#include "fldeff_groundshake.h" +#include "fldeff.h" +#include "fldeff_misc.h" #include "frontier_util.h" #include "menu.h" #include "overworld.h" diff --git a/src/fight.c b/src/fight.c index fb1c01b78..b7ca2e87a 100644 --- a/src/fight.c +++ b/src/fight.c @@ -416,7 +416,7 @@ const struct SpriteTemplate gUnknown_08596104 = void unc_080B08A0(struct Sprite *sprite) { - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; sprite->data[0] = 15; sprite->callback = WaitAnimForDuration; @@ -459,9 +459,9 @@ void AnimBasicFistOrFoot(struct Sprite *sprite) StartSpriteAnim(sprite, gBattleAnimArgs[4]); if (gBattleAnimArgs[3] == 0) - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); else - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[2]; sprite->callback = WaitAnimForDuration; @@ -534,7 +534,7 @@ static void sub_810D0B8(struct Sprite *sprite) void sub_810D10C(struct Sprite *sprite) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->data[0] = 30; if (gBattleAnimArgs[2] == 0) @@ -574,7 +574,7 @@ void sub_810D1B4(struct Sprite *sprite) if (BATTLE_PARTNER(gBattleAnimAttacker) == gBattleAnimTarget && GetBattlerPosition(gBattleAnimTarget) < B_POSITION_PLAYER_RIGHT) gBattleAnimArgs[0] *= -1; - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; @@ -596,7 +596,7 @@ void sub_810D1B4(struct Sprite *sprite) static void sub_810D240(struct Sprite *sprite) { - if (!TranslateAnimLinear(sprite)) + if (!AnimTranslateLinear(sprite)) { sprite->pos2.y += Sin(sprite->data[7] >> 8, sprite->data[5]); sprite->data[7] += sprite->data[6]; @@ -615,7 +615,7 @@ static void sub_810D240(struct Sprite *sprite) // arg 3: spin duration void AnimSpinningKickOrPunch(struct Sprite *sprite) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); StartSpriteAnim(sprite, gBattleAnimArgs[2]); sprite->data[0] = gBattleAnimArgs[3]; @@ -639,7 +639,7 @@ static void AnimSpinningKickOrPunchFinish(struct Sprite *sprite) // arg 2: initial wait duration void AnimStompFoot(struct Sprite *sprite) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[2]; sprite->callback = AnimStompFootStep; @@ -670,7 +670,7 @@ void sub_810D37C(struct Sprite *sprite) { if (sprite->data[0] == 0) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->data[1] = gBattleAnimArgs[2]; sprite->data[2] = gBattleAnimArgs[3]; sprite->data[0]++; @@ -800,12 +800,12 @@ void sub_810D608(struct Sprite *sprite) { sprite->pos1.x = GetBattlerSpriteCoord(gBattlerAttacker, 2); sprite->pos1.y = GetBattlerSpriteCoord(gBattlerAttacker, 3); - sprite->oam.priority = sub_80A8328(gBattleAnimAttacker); + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimAttacker); sprite->data[7] = gBattleAnimTarget; } else { - sprite->oam.priority = sub_80A8328(gBattleAnimTarget); + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget); sprite->data[7] = gBattleAnimAttacker; } @@ -903,12 +903,12 @@ void sub_810D874(struct Sprite *sprite) sprite->pos1.x = GetBattlerSpriteCoord(gBattlerAttacker, 2); sprite->pos1.y = GetBattlerSpriteCoord(gBattlerAttacker, 3); battler = gBattleAnimTarget; - sprite->oam.priority = sub_80A8328(gBattleAnimAttacker); + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimAttacker); } else { battler = gBattleAnimAttacker; - sprite->oam.priority = sub_80A8328(gBattleAnimTarget); + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget); } if (IsContest()) @@ -965,9 +965,9 @@ void sub_810D984(struct Sprite *sprite) void sub_810DA10(struct Sprite *sprite) { if (gBattleAnimArgs[2] == 0) - InitAnimSpritePos(sprite, 0); + InitSpritePosToAnimAttacker(sprite, 0); else - sub_80A6980(sprite, FALSE); + InitSpritePosToAnimTarget(sprite, FALSE); if (IsContest()) { diff --git a/src/fire.c b/src/fire.c index 18ec7b95c..5f501a340 100644 --- a/src/fire.c +++ b/src/fire.c @@ -472,14 +472,14 @@ static void sub_8108EC8(struct Sprite *sprite) static void sub_8108F08(struct Sprite *sprite) { - sub_80A6864(sprite, gBattleAnimArgs[0]); + SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; sprite->data[0] = gBattleAnimArgs[4]; sprite->data[1] = gBattleAnimArgs[2]; sprite->data[2] = gBattleAnimArgs[3]; - sprite->callback = TranslateAnimLinearSimple; + sprite->callback = AnimTranslateLinearSimple; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } @@ -644,7 +644,7 @@ static void sub_8109200(struct Sprite *sprite) //void AnimFireRing(struct Sprite *sprite) void AnimFireRing(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); sprite->data[7] = gBattleAnimArgs[2]; sprite->data[0] = 0; @@ -672,7 +672,7 @@ static void AnimFireRingStep1(struct Sprite *sprite) static void AnimFireRingStep2(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) { sprite->data[0] = 0; @@ -731,7 +731,7 @@ static void AnimFireCross(struct Sprite *sprite) static void sub_81093A4(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); sprite->data[1] = gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[3]; @@ -1054,7 +1054,7 @@ static void sub_8109AFC(struct Sprite *sprite) switch (sprite->data[0]) { case 0: - InitAnimSpritePos(sprite, 0); + InitSpritePosToAnimAttacker(sprite, 0); StartSpriteAnim(sprite, gBattleAnimArgs[2]); sprite->data[7] = gBattleAnimArgs[2]; @@ -1067,7 +1067,7 @@ static void sub_8109AFC(struct Sprite *sprite) sprite->data[4] = -4; } - sprite->oam.priority = sub_80A8328(gBattleAnimTarget); + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget); sprite->data[0]++; break; case 1: @@ -1119,7 +1119,7 @@ static void sub_8109C4C(struct Sprite *sprite) s16 initialData5; s16 newData5; - if (!TranslateAnimLinear(sprite)) + if (!AnimTranslateLinear(sprite)) { sprite->pos2.x += Sin(sprite->data[5], 16); initialData5 = sprite->data[5]; @@ -1157,9 +1157,9 @@ void sub_8109CB0(struct Sprite *sprite) if (!IsContest()) { if (sprite->data[1] < 64 || sprite->data[1] > 195) - sprite->oam.priority = sub_80A8328(gBattleAnimTarget); + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget); else - sprite->oam.priority = sub_80A8328(gBattleAnimTarget) + 1; + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget) + 1; } else { @@ -1318,4 +1318,4 @@ void sub_810A094(u8 taskId) gSprites[spriteId].pos2.y = 0; DestroyAnimVisualTask(taskId); } -}
\ No newline at end of file +} diff --git a/src/fldeff_cut.c b/src/fldeff_cut.c index 6a310efd2..60887a5cc 100644 --- a/src/fldeff_cut.c +++ b/src/fldeff_cut.c @@ -5,12 +5,11 @@ #include "field_effect.h" #include "field_player_avatar.h" #include "fieldmap.h" -#include "fldeff_cut.h" +#include "fldeff.h" #include "alloc.h" #include "metatile_behavior.h" #include "overworld.h" #include "party_menu.h" -#include "rom6.h" #include "script.h" #include "sound.h" #include "sprite.h" diff --git a/src/fldeff_dig.c b/src/fldeff_dig.c new file mode 100644 index 000000000..b39d25182 --- /dev/null +++ b/src/fldeff_dig.c @@ -0,0 +1,63 @@ +#include "global.h" +#include "braille_puzzles.h" +#include "field_effect.h" +#include "field_player_avatar.h" +#include "fldeff.h" +#include "item_use.h" +#include "overworld.h" +#include "party_menu.h" +#include "sprite.h" +#include "constants/field_effects.h" + +// static functions +static void hm2_dig(void); +static void sub_8135780(void); + +// text +bool8 SetUpFieldMove_Dig(void) +{ + if (CanUseEscapeRopeOnCurrMap() == TRUE) + { + gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu; + gPostMenuFieldCallback = hm2_dig; + return TRUE; + } + else + { + return FALSE; + } +} + +static void hm2_dig(void) +{ + Overworld_ResetStateAfterDigEscRope(); + FieldEffectStart(FLDEFF_USE_DIG); + gFieldEffectArguments[0] = GetCursorSelectionMonId(); +} + +bool8 FldEff_UseDig(void) +{ + u8 taskId = oei_task_add(); + + gTasks[taskId].data[8] = (u32)sub_8135780 >> 16; + gTasks[taskId].data[9] = (u32)sub_8135780; + if (!ShouldDoBrailleDigEffect()) + SetPlayerAvatarTransitionFlags(PLAYER_AVATAR_FLAG_ON_FOOT); + return FALSE; +} + +static void sub_8135780(void) +{ + u8 taskId; + + FieldEffectActiveListRemove(FLDEFF_USE_DIG); + if (ShouldDoBrailleDigEffect()) + { + DoBrailleDigEffect(); + } + else + { + taskId = CreateTask(task08_080A1C44, 8); + gTasks[taskId].data[0] = 0; + } +} diff --git a/src/fldeff_escalator.c b/src/fldeff_escalator.c index 7d3e07123..3d00fb162 100644 --- a/src/fldeff_escalator.c +++ b/src/fldeff_escalator.c @@ -2,18 +2,19 @@ #include "field_camera.h" #include "field_player_avatar.h" #include "fieldmap.h" +#include "fldeff.h" #include "task.h" static EWRAM_DATA u8 sEscalatorAnim_TaskId = 0; -void sub_80E12E8(u8 taskId, const s16 *list, u16 c) +static void sub_80E12E8(u8 taskId, const s16 *list, u16 c) { s16 r5 = gTasks[taskId].data[4] - 1; s16 r3 = gTasks[taskId].data[5] - 1; s16 r4 = gTasks[taskId].data[1]; s16 y; s16 x; - + if (gTasks[taskId].data[2] == 0) { for (y = 0; y < 3; y++) @@ -21,7 +22,7 @@ void sub_80E12E8(u8 taskId, const s16 *list, u16 c) for (x = 0; x < 3; x++) { s16 metatileId = MapGridGetMetatileIdAt(r5 + x, r3 + y); - + if (list[r4] == metatileId) { if (r4 != 2) @@ -39,7 +40,7 @@ void sub_80E12E8(u8 taskId, const s16 *list, u16 c) for (x = 0; x < 3; x++) { s16 metatileId = MapGridGetMetatileIdAt(r5 + x, r3 + y); - + if (list[2 - r4] == metatileId) { if (r4 != 2) @@ -60,7 +61,7 @@ static const u16 gUnknown_08589AD2[] = {0x2A0, 0x2A2, 0x2A4}; static const u16 gUnknown_08589AD8[] = {0x2A1, 0x2A3, 0x2A5}; static const u16 gUnknown_08589ADE[] = {0x2A8, 0x2AA, 0x2AC}; -void sub_80E1444(u8 taskId) +static void sub_80E1444(u8 taskId) { s16 *data = gTasks[taskId].data; @@ -100,7 +101,7 @@ void sub_80E1444(u8 taskId) } } -u8 sub_80E150C(u16 var) +static u8 sub_80E150C(u16 var) { u8 taskId = CreateTask(sub_80E1444, 0); s16 *data = gTasks[taskId].data; diff --git a/src/fldeff_flash.c b/src/fldeff_flash.c index 8862caa9f..69d198c84 100644 --- a/src/fldeff_flash.c +++ b/src/fldeff_flash.c @@ -3,12 +3,12 @@ #include "event_data.h" #include "event_scripts.h" #include "field_effect.h" +#include "fldeff.h" #include "gpu_regs.h" #include "main.h" #include "overworld.h" #include "palette.h" #include "party_menu.h" -#include "rom6.h" #include "script.h" #include "sound.h" #include "sprite.h" diff --git a/src/fldeff_groundshake.c b/src/fldeff_groundshake.c index 866606a06..bfd583981 100644 --- a/src/fldeff_groundshake.c +++ b/src/fldeff_groundshake.c @@ -2,6 +2,7 @@ #include "event_data.h" #include "event_object_movement.h" #include "field_camera.h" +#include "fldeff.h" #include "alloc.h" #include "random.h" #include "roulette_util.h" @@ -10,6 +11,7 @@ #include "sprite.h" #include "task.h" #include "constants/flags.h" +#include "constants/maps.h" #include "constants/songs.h" // structures @@ -73,7 +75,13 @@ static const struct OamData gUnknown_08617E2C = }; static const struct SpriteTemplate gUnknown_08617E34 = { - 0x0FA0, 0xFFFF, &gUnknown_08617E2C, gSpriteAnimTable_8617E28, NULL, gDummySpriteAffineAnimTable, sub_81BEAD8 + .tileTag = 0x0FA0, + .paletteTag = 0xFFFF, + .oam = &gUnknown_08617E2C, + .anims = gSpriteAnimTable_8617E28, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_81BEAD8 }; static const union AnimCmd gSpriteAnim_8617E4C[] = @@ -105,7 +113,13 @@ static const struct OamData gSpriteAnim_8617E58 = }; static const struct SpriteTemplate gUnknown_08617E60 = { - 0x0FA0, 0xFFFF, &gSpriteAnim_8617E58, gSpriteAnim_8617E54, NULL, gDummySpriteAffineAnimTable, sub_81BEAD8 + .tileTag = 0x0FA0, + .paletteTag = 0xFFFF, + .oam = &gSpriteAnim_8617E58, + .anims = gSpriteAnim_8617E54, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_81BEAD8 }; // ewram @@ -114,12 +128,13 @@ EWRAM_DATA struct Struct203CF18 *gUnknown_0203CF18 = NULL; // text bool8 sub_81BE66C(void) { - if (!(gSaveBlock1Ptr->location.mapGroup == 0x0 && gSaveBlock1Ptr->location.mapNum == 0x1A)) - return 0; - return FlagGet(FLAG_0x14E); + if (!(gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(ROUTE111) && gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE111))) + return FALSE; + else + return FlagGet(FLAG_0x14E); } -void sub_81BE698(u8 taskId) +static void sub_81BE698(u8 taskId) { sub_8151E50(&(gUnknown_0203CF18->unk4)); } @@ -131,12 +146,13 @@ void sub_81BE6AC(void) void sub_81BE6B8(void) { - if(gUnknown_0203CF18 != NULL) + if (gUnknown_0203CF18 != NULL) { gUnknown_0203CF18 = NULL; return; } - if(!(gSaveBlock1Ptr->location.mapGroup == 0x0 && gSaveBlock1Ptr->location.mapNum == 0x1A) || !FlagGet(FLAG_0x14E)) + + if (gSaveBlock1Ptr->location.mapGroup != MAP_GROUP(ROUTE111) || gSaveBlock1Ptr->location.mapNum != MAP_NUM(ROUTE111) || !FlagGet(FLAG_0x14E)) return; gUnknown_0203CF18 = (struct Struct203CF18 *)AllocZeroed(sizeof(struct Struct203CF18)); @@ -148,10 +164,13 @@ void sub_81BE6B8(void) void sub_81BE72C(void) { - if(!(gSaveBlock1Ptr->location.mapGroup == 0x0 && gSaveBlock1Ptr->location.mapNum == 0x1A) || !FlagGet(FLAG_0x14E) || gUnknown_0203CF18 == NULL) + if (gSaveBlock1Ptr->location.mapGroup != MAP_GROUP(ROUTE111) || gSaveBlock1Ptr->location.mapNum != MAP_NUM(ROUTE111) + || !FlagGet(FLAG_0x14E) || gUnknown_0203CF18 == NULL) return; - if(FuncIsActiveTask(sub_81BE698)) + + if( FuncIsActiveTask(sub_81BE698)) DestroyTask(gUnknown_0203CF18->taskId); + sub_8151D28(&(gUnknown_0203CF18->unk4), 1, 1); sub_8151C50(&(gUnknown_0203CF18->unk4), 1, 1); Free(gUnknown_0203CF18); @@ -163,16 +182,16 @@ void sub_81BE79C(void) u16 rand; bool8 chance; - if(VarGet(VAR_0x40CB) != 0) + if (VarGet(VAR_0x40CB) != 0) { FlagClear(FLAG_0x14E); return; } rand = Random(); chance = rand & 1; - if(FlagGet(FLAG_0x09D) == TRUE) + if (FlagGet(FLAG_0x09D) == TRUE) chance = TRUE; - if(chance) + if (chance) { FlagSet(FLAG_0x14E); sub_81BE6B8(); @@ -221,18 +240,17 @@ static void sp136_strengh_sound(u8 a, u8 b, u8 c, u8 d) static void sub_81BE900(u8 taskId) { - s16 *data; + s16 *data = gTasks[taskId].data; - data = gTasks[taskId].data; data[1]++; - if((data[1] % data[3]) == 0) + if ((data[1] % data[3]) == 0) { data[1] = 0; data[2]--; data[0] = -data[0]; data[4] = -data[4]; SetCameraPanning(data[0], data[4]); - if(!data[2]) + if (!data[2]) { sub_81BE968(); DestroyTask(taskId); @@ -243,10 +261,8 @@ static void sub_81BE900(u8 taskId) static void sub_81BE968(void) { - u8 taskId; - - taskId = FindTaskIdByFunc(sub_81BE9C0); - if(taskId != 0xFF) + u8 taskId = FindTaskIdByFunc(sub_81BE9C0); + if (taskId != 0xFF) gTasks[taskId].data[0]++; } @@ -260,11 +276,9 @@ void sub_81BE994(void) static void sub_81BE9C0(u8 taskId) { - u16 *data; + u16 *data = gTasks[taskId].data; - data = gTasks[taskId].data; - data[1]++; - if(data[1] == 1000 || data[0] == 17) + if (++data[1] == 1000 || data[0] == 17) gTasks[taskId].func = sub_81BEA00; } @@ -280,14 +294,14 @@ static void sub_81BEA20(void) u8 i; u8 spriteId; - for(i = 0; i < 8; i++) + for (i = 0; i < 8; i++) { spriteId = CreateSprite(&gUnknown_08617E60, gUnknown_08617D64[i][0] + 120, gUnknown_08617D64[i][1], 8); gSprites[spriteId].oam.priority = 0; gSprites[spriteId].oam.paletteNum = 0; gSprites[spriteId].data[0] = i; } - for(i = 0; i < 8; i++) + for (i = 0; i < 8; i++) { spriteId = CreateSprite(&gUnknown_08617E34, gUnknown_08617D64[i][0] + 115, gUnknown_08617D64[i][1] - 3, 8); gSprites[spriteId].oam.priority = 0; @@ -300,7 +314,7 @@ static void sub_81BEAD8(struct Sprite* sprite) { sprite->data[1] += 2; sprite->pos2.y = (sprite->data[1] / 2); - if(((sprite->pos1.y) + (sprite->pos2.y)) > gUnknown_08617D64[sprite->data[0]][2]) + if (((sprite->pos1.y) + (sprite->pos2.y)) > gUnknown_08617D64[sprite->data[0]][2]) { DestroySprite(sprite); sub_81BE968(); diff --git a/src/fldeff_misc.c b/src/fldeff_misc.c new file mode 100644 index 000000000..9d77383ae --- /dev/null +++ b/src/fldeff_misc.c @@ -0,0 +1,1307 @@ +#include "global.h" +#include "gpu_regs.h" +#include "palette.h" +#include "script.h" +#include "sound.h" +#include "task.h" +#include "strings.h" +#include "party_menu.h" +#include "fieldmap.h" +#include "field_effect.h" +#include "field_camera.h" +#include "field_player_avatar.h" +#include "fldeff.h" +#include "fldeff_misc.h" +#include "secret_base.h" +#include "event_data.h" +#include "event_scripts.h" +#include "event_object_movement.h" +#include "metatile_behavior.h" +#include "string_util.h" +#include "constants/field_effects.h" +#include "constants/metatile_behaviors.h" +#include "constants/songs.h" +#include "constants/vars.h" + +extern struct MapPosition gPlayerFacingPosition; + +static void sub_80F9C90(u8); +static void sub_80F9DFC(u8); + +static void Task_SecretBasePCTurnOn(u8); + +static void Task_PopSecretBaseBalloon(u8); +static void DoBalloonSoundEffect(s16); + +static void Task_WateringBerryTreeAnim_1(u8); +static void Task_WateringBerryTreeAnim_2(u8); +static void Task_WateringBerryTreeAnim_3(u8); + +static void sub_80F9C44(TaskFunc, u16, u16, u8); + +static void FieldCallback_SecretBaseCave(void); +static void CaveEntranceSpriteCallback1(struct Sprite *); +static void CaveEntranceSpriteCallback2(struct Sprite *); +static void CaveEntranceSpriteCallbackEnd(struct Sprite *); +static void StartSecretBaseCaveFieldEffect(void); + +static void FieldCallback_SecretBaseTree(void); +static void TreeEntranceSpriteCallback1(struct Sprite *); +static void TreeEntranceSpriteCallback2(struct Sprite *); +static void TreeEntranceSpriteCallbackEnd(struct Sprite *); +static void StartSecretBaseTreeFieldEffect(void); + +static void FieldCallback_SecretBaseShrub(void); +static void ShrubEntranceSpriteCallback1(struct Sprite *); +static void ShrubEntranceSpriteCallback2(struct Sprite *); +static void ShrubEntranceSpriteCallbackEnd(struct Sprite *); +static void StartSecretBaseShrubFieldEffect(void); + +static void SpriteCB_SandPillar_0(struct Sprite *); +static void SpriteCB_SandPillar_1(struct Sprite *); +static void SpriteCB_SandPillar_2(struct Sprite *); + +static const u8 gSpriteImage_858D978[] = INCBIN_U8("graphics/unknown/858E588/0.4bpp"); +static const u8 gSpriteImage_858D9F8[] = INCBIN_U8("graphics/unknown/858E588/1.4bpp"); +static const u8 gSpriteImage_858DA78[] = INCBIN_U8("graphics/unknown/858E588/2.4bpp"); +static const u8 gSpriteImage_858DAF8[] = INCBIN_U8("graphics/unknown/858E588/3.4bpp"); +static const u8 gSpriteImage_858DB78[] = INCBIN_U8("graphics/unknown/858E588/4.4bpp"); + +static const u8 gUnusedEmptySpace_858DBF8[32] = {0}; + +static const u16 gFieldEffectObjectPalette7[] = INCBIN_U16("graphics/event_objects/palettes/field_effect_object_palette_07.gbapal"); +static const u8 gSpriteImage_858DC38[] = INCBIN_U8("graphics/unknown/858E5D8/0.4bpp"); +static const u8 gSpriteImage_858DCB8[] = INCBIN_U8("graphics/unknown/858E5D8/1.4bpp"); +static const u8 gSpriteImage_858DD38[] = INCBIN_U8("graphics/unknown/858E5D8/2.4bpp"); +static const u8 gSpriteImage_858DDB8[] = INCBIN_U8("graphics/unknown/858E5D8/3.4bpp"); +static const u8 gSpriteImage_858DE38[] = INCBIN_U8("graphics/unknown/858E5D8/4.4bpp"); +static const u8 gSpriteImage_858DEB8[] = INCBIN_U8("graphics/unknown/858E5B0/0.4bpp"); +static const u8 gSpriteImage_858DF38[] = INCBIN_U8("graphics/unknown/858E5B0/1.4bpp"); +static const u8 gSpriteImage_858DFB8[] = INCBIN_U8("graphics/unknown/858E5B0/2.4bpp"); +static const u8 gSpriteImage_858E038[] = INCBIN_U8("graphics/unknown/858E5B0/3.4bpp"); +static const u8 gSpriteImage_858E0B8[] = INCBIN_U8("graphics/unknown/858E5B0/4.4bpp"); +static const u8 gSpriteImage_858E138[] = INCBIN_U8("graphics/unknown/858E5B0/5.4bpp"); +static const u16 gFieldEffectObjectPalette8[] = INCBIN_U16("graphics/event_objects/palettes/field_effect_object_palette_08.gbapal"); +static const u8 gSpriteImage_858E1D8[] = INCBIN_U8("graphics/unknown/858E674/0.4bpp"); +static const u8 gSpriteImage_858E2D8[] = INCBIN_U8("graphics/unknown/858E674/1.4bpp"); +static const u8 gSpriteImage_858E3D8[] = INCBIN_U8("graphics/unknown/858E674/2.4bpp"); + +static const struct OamData gOamData_858E4D8 = +{ + .y = 0, + .x = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, + .shape = ST_OAM_SQUARE, + .size = 1, + .priority = 2, +}; + +static const union AnimCmd gSpriteAnim_858E4E0[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_FRAME(1, 8), + ANIMCMD_FRAME(2, 8), + ANIMCMD_FRAME(3, 8), + ANIMCMD_FRAME(4, 8), + ANIMCMD_END, +}; + +static const union AnimCmd gSpriteAnim_858E4F8[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_FRAME(1, 8), + ANIMCMD_FRAME(2, 8), + ANIMCMD_FRAME(3, 8), + ANIMCMD_FRAME(4, 8), + ANIMCMD_END, +}; + +static const union AnimCmd gSpriteAnim_858E510[] = +{ + ANIMCMD_FRAME(4, 8), + ANIMCMD_FRAME(3, 8), + ANIMCMD_FRAME(2, 8), + ANIMCMD_FRAME(1, 8), + ANIMCMD_FRAME(0, 8), + ANIMCMD_END, +}; + +static const union AnimCmd gSpriteAnim_858E528[] = +{ + ANIMCMD_FRAME(0, 8, .hFlip = TRUE), + ANIMCMD_FRAME(1, 8, .hFlip = TRUE), + ANIMCMD_FRAME(2, 8, .hFlip = TRUE), + ANIMCMD_FRAME(3, 8, .hFlip = TRUE), + ANIMCMD_FRAME(4, 8, .hFlip = TRUE), + ANIMCMD_END, +}; + +static const union AnimCmd gSpriteAnim_858E540[] = +{ + ANIMCMD_FRAME(4, 8, .hFlip = TRUE), + ANIMCMD_FRAME(3, 8, .hFlip = TRUE), + ANIMCMD_FRAME(2, 8, .hFlip = TRUE), + ANIMCMD_FRAME(1, 8, .hFlip = TRUE), + ANIMCMD_FRAME(0, 8, .hFlip = TRUE), + ANIMCMD_END, +}; + +static const union AnimCmd gSpriteAnim_858E558[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_FRAME(1, 8), + ANIMCMD_FRAME(2, 8), + ANIMCMD_FRAME(3, 8), + ANIMCMD_FRAME(4, 8), + ANIMCMD_END, +}; + +static const union AnimCmd *const gSpriteAnimTable_858E570[] = +{ + gSpriteAnim_858E4E0, +}; + +static const union AnimCmd *const gSpriteAnimTable_858E574[] = +{ + gSpriteAnim_858E4F8, + gSpriteAnim_858E510, + gSpriteAnim_858E528, + gSpriteAnim_858E540, +}; + +static const union AnimCmd *const gSpriteAnimTable_858E584[] = +{ + gSpriteAnim_858E558, +}; + +static const struct SpriteFrameImage gUnknown_858E588[] = +{ + {gSpriteImage_858D978, 0x80}, + {gSpriteImage_858D9F8, 0x80}, + {gSpriteImage_858DA78, 0x80}, + {gSpriteImage_858DAF8, 0x80}, + {gSpriteImage_858DB78, 0x80}, +}; + +static const struct SpriteFrameImage gUnknown_858E5B0[] = +{ + {gSpriteImage_858DEB8, 0x80}, + {gSpriteImage_858DF38, 0x80}, + {gSpriteImage_858DFB8, 0x80}, + {gSpriteImage_858E038, 0x80}, + {gSpriteImage_858E0B8, 0x80}, +}; + +static const struct SpriteFrameImage gUnknown_858E5D8[] = +{ + {gSpriteImage_858DC38, 0x80}, + {gSpriteImage_858DCB8, 0x80}, + {gSpriteImage_858DD38, 0x80}, + {gSpriteImage_858DDB8, 0x80}, + {gSpriteImage_858DE38, 0x80}, +}; + +static const struct SpriteTemplate gUnknown_0858E600 = +{ + .tileTag = 0xFFFF, + .paletteTag = 0x1003, + .oam = &gOamData_858E4D8, + .anims = gSpriteAnimTable_858E570, + .images = gUnknown_858E588, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = CaveEntranceSpriteCallback1, +}; + +static const struct SpriteTemplate gUnknown_0858E618 = +{ + .tileTag = 0xFFFF, + .paletteTag = 0x1008, + .oam = &gOamData_858E4D8, + .anims = gSpriteAnimTable_858E574, + .images = gUnknown_858E5B0, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = TreeEntranceSpriteCallback1, +}; + +static const struct SpriteTemplate gUnknown_0858E630 = +{ + .tileTag = 0xFFFF, + .paletteTag = 0x1008, + .oam = &gOamData_858E4D8, + .anims = gSpriteAnimTable_858E584, + .images = gUnknown_858E5D8, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = ShrubEntranceSpriteCallback1, +}; + +const struct SpritePalette gFieldEffectObjectPaletteInfo7 = {gFieldEffectObjectPalette7, 0x1003}; +const struct SpritePalette gFieldEffectObjectPaletteInfo8 = {gFieldEffectObjectPalette8, 0x1008}; + +static const struct OamData gOamData_858E658 = +{ + .x = 0, + .y = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, + .shape = ST_OAM_V_RECTANGLE, + .size = 2, + .priority = 2, +}; + +static const union AnimCmd gSpriteAnim_858E660[] = +{ + ANIMCMD_FRAME(0, 6), + ANIMCMD_FRAME(1, 6), + ANIMCMD_FRAME(2, 6), + ANIMCMD_END, +}; + +static const union AnimCmd *const gSpriteAnimTable_858E670[] = +{ + gSpriteAnim_858E660, +}; + +static const struct SpriteFrameImage gUnknown_0858E674[] = +{ + {gSpriteImage_858E1D8, 0x100}, + {gSpriteImage_858E2D8, 0x100}, + {gSpriteImage_858E3D8, 0x100}, +}; + +static const struct SpriteTemplate gUnknown_0858E68C = +{ + .tileTag = 0xFFFF, + .paletteTag = 0x100E, + .oam = &gOamData_858E658, + .anims = gSpriteAnimTable_858E670, + .images = gUnknown_0858E674, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_SandPillar_0, +}; + +// This uses one of the secret base palettes, so there is no "field_effect_object_palette_09.pal" file. +const struct SpritePalette gFieldEffectObjectPaletteInfo9 = {gTilesetPalettes_SecretBase[5], 0x100E}; + +static const u8 gSpriteImage_858E6AC[] = INCBIN_U8("graphics/unknown/858E84C/0.4bpp"); +static const u8 gSpriteImage_858E72C[] = INCBIN_U8("graphics/unknown/858E84C/1.4bpp"); +static const u8 gSpriteImage_858E7AC[] = INCBIN_U8("graphics/unknown/858E84C/2.4bpp"); +static const u16 gUnknown_0858E82C[] = INCBIN_U16("graphics/unknown/unknown_58E82C.gbapal"); + +static const struct SpriteFrameImage gUnknown_0858E84C[] = +{ + {gSpriteImage_858E6AC, sizeof(gSpriteImage_858E6AC)}, + {gSpriteImage_858E72C, sizeof(gSpriteImage_858E72C)}, + {gSpriteImage_858E7AC, sizeof(gSpriteImage_858E7AC)}, +}; + +static const struct SpritePalette gUnknown_0858E864 = {gUnknown_0858E82C, 0x1000}; + +static const union AnimCmd gSpriteAnim_858E86C[] = +{ + ANIMCMD_FRAME(0, 30), + ANIMCMD_FRAME(1, 30), + ANIMCMD_FRAME(2, 30), + ANIMCMD_JUMP(0), +}; + +static const union AnimCmd *const gSpriteAnimTable_858E87C[] = +{ + gSpriteAnim_858E86C, +}; + +static const struct SpriteTemplate gUnknown_0858E880 = +{ + .tileTag = 0xFFFF, + .paletteTag = 0x1000, + .oam = &gEventObjectBaseOam_32x8, + .anims = gSpriteAnimTable_858E87C, + .images = gUnknown_0858E84C, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +void sub_80F9BCC(u16 a0, u16 a1, u8 a2) +{ + sub_80F9C44(sub_80F9C90, a0, a1, a2); +} + +void sub_80F9BF4(u16 a0, u16 a1, u8 a2) +{ + sub_80F9C44(sub_80F9DFC, a0, a1, a2); +} + +bool8 sub_80F9C1C(void) +{ + return FuncIsActiveTask(sub_80F9C90); +} + +bool8 sub_80F9C30(void) +{ + return FuncIsActiveTask(sub_80F9DFC); +} + +static void sub_80F9C44(void (*taskfunc) (u8), u16 a1, u16 a2, u8 a3) +{ + u8 taskId = CreateTask(taskfunc, a3); + + gTasks[taskId].data[0] = 0; + gTasks[taskId].data[1] = a1 == 0 ? 16 : a1; + gTasks[taskId].data[2] = a1 == 0 ? 20 : a1; + gTasks[taskId].func(taskId); +} + +static void sub_80F9C90(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + task->data[3] = 0x78; + task->data[4] = 0x78; + task->data[5] = 0x50; + task->data[6] = 0x51; + + SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON); + SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(task->data[3], task->data[4])); + SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(task->data[5], task->data[6])); + SetGpuReg(REG_OFFSET_WININ, 0x3F); + SetGpuReg(REG_OFFSET_WINOUT, 0); + + break; + case 1: + task->data[7] = GetGpuReg(REG_OFFSET_BLDCNT); + task->data[8] = GetGpuReg(REG_OFFSET_BLDY); + + SetGpuReg(REG_OFFSET_BLDCNT, 0xBF); + SetGpuReg(REG_OFFSET_BLDY, 0x10); + + break; + case 2: + task->data[3] -= task->data[1]; + task->data[4] += task->data[1]; + + if (task->data[3] < 1 || task->data[4] > 0xEF) + { + task->data[3] = 0; + task->data[4] = 0xF0; + SetGpuReg(REG_OFFSET_BLDY, 0); + SetGpuReg(REG_OFFSET_BLDCNT, task->data[7]); + BlendPalettes(0xFFFFFFFF, 0, 0); + gPlttBufferFaded[0] = 0; + } + SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(task->data[3], task->data[4])); + + if (task->data[3] != 0) + return; + break; + case 3: + task->data[5] -= task->data[2]; + task->data[6] += task->data[2]; + + if (task->data[5] < 1 || task->data[6] > 0x9F) + { + task->data[5] = 0; + task->data[6] = 0xA0; + ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON); + } + SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(task->data[5], task->data[6])); + + if (task->data[5] != 0) + return; + break; + default: + SetGpuReg(REG_OFFSET_BLDCNT, task->data[7]); + DestroyTask(taskId); + return; + } + task->data[0]++; +} + +static void sub_80F9DFC(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + int temp = task->data[0]; + + switch (temp) + { + case 0: + gPlttBufferFaded[0] = temp; + break; + case 1: + task->data[3] = 0; + task->data[4] = 0xF0; + task->data[5] = 0; + task->data[6] = 0xA0; + + SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON); + SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(task->data[3], task->data[4])); + SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(task->data[5], task->data[6])); + SetGpuReg(REG_OFFSET_WININ, 0x3F); + SetGpuReg(REG_OFFSET_WINOUT, 0); + break; + case 2: + task->data[5] += task->data[2]; + task->data[6] -= task->data[2]; + + if (task->data[5] > 0x4F || task->data[6] < 0x52) + { + task->data[5] = 0x50; + task->data[6] = 0x51; + SetGpuReg(REG_OFFSET_BLDCNT, 0xBF); + SetGpuReg(REG_OFFSET_BLDY, 0x10); + } + SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(task->data[5], task->data[6])); + + if (task->data[5] != 0x50) + return; + break; + case 3: + task->data[3] += task->data[1]; + task->data[4] -= task->data[1]; + + if (task->data[3] > 0x77 || task->data[4] < 0x79) + { + task->data[3] = 0x78; + task->data[4] = 0x78; + BlendPalettes(-1, 0x10, 0); + gPlttBufferFaded[0] = 0; + } + SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(task->data[3], task->data[4])); + + if (task->data[3] != 0x78) + return; + break; + default: + ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON); + SetGpuReg(REG_OFFSET_BLDY, 0); + SetGpuReg(REG_OFFSET_BLDCNT, 0); + DestroyTask(taskId); + return; + } + task->data[0]++; +} + +static void SetCurrentSecretBase(void) +{ + sub_80E9608(&gPlayerFacingPosition, gMapHeader.events); + sub_80E8B6C(); +} + +static void AdjustSecretPowerSpritePixelOffsets(void) +{ + if (gPlayerAvatar.flags & 0x6) + { + switch (gFieldEffectArguments[1]) + { + case DIR_SOUTH: + gFieldEffectArguments[5] = 16; + gFieldEffectArguments[6] = 40; + break; + case DIR_NORTH: + gFieldEffectArguments[5] = 16; + gFieldEffectArguments[6] = 8; + break; + case DIR_WEST: + gFieldEffectArguments[5] = -8; + gFieldEffectArguments[6] = 24; + break; + case DIR_EAST: + gFieldEffectArguments[5] = 24; + gFieldEffectArguments[6] = 24; + break; + } + } + else + { + switch (gFieldEffectArguments[1]) + { + case DIR_SOUTH: + gFieldEffectArguments[5] = 8; + gFieldEffectArguments[6] = 40; + break; + case DIR_NORTH: + gFieldEffectArguments[5] = 8; + gFieldEffectArguments[6] = 8; + break; + case DIR_WEST: + gFieldEffectArguments[5] = -8; + gFieldEffectArguments[6] = 24; + break; + case DIR_EAST: + gFieldEffectArguments[5] = 24; + gFieldEffectArguments[6] = 24; + break; + } + } +} + +bool8 SetUpFieldMove_SecretPower(void) +{ + u8 mb; + + sub_80E8BC8(); + + if (gSpecialVar_Result == 1 || GetPlayerFacingDirection() != DIR_NORTH) + return FALSE; + + GetXYCoordsOneStepInFrontOfPlayer(&gPlayerFacingPosition.x, &gPlayerFacingPosition.y); + mb = MapGridGetMetatileBehaviorAt(gPlayerFacingPosition.x, gPlayerFacingPosition.y); + + if (MetatileBehavior_IsSecretBaseCave(mb) == TRUE) + { + SetCurrentSecretBase(); + gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu; + gPostMenuFieldCallback = FieldCallback_SecretBaseCave; + return TRUE; + } + + if (MetatileBehavior_IsSecretBaseTree(mb) == TRUE) + { + SetCurrentSecretBase(); + gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu; + gPostMenuFieldCallback = FieldCallback_SecretBaseTree; + return TRUE; + } + + if (MetatileBehavior_IsSecretBaseShrub(mb) == TRUE) + { + SetCurrentSecretBase(); + gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu; + gPostMenuFieldCallback = FieldCallback_SecretBaseShrub; + return TRUE; + } + + return FALSE; +} + +static void FieldCallback_SecretBaseCave(void) +{ + gFieldEffectArguments[0] = GetCursorSelectionMonId(); + ScriptContext1_SetupScript(EventScript_275A86); +} + +bool8 FldEff_UseSecretPowerCave(void) +{ + u8 taskId = oei_task_add(); + + gTasks[taskId].data[8] = (u32)StartSecretBaseCaveFieldEffect >> 16; + gTasks[taskId].data[9] = (u32)StartSecretBaseCaveFieldEffect; + + return FALSE; +} + +static void StartSecretBaseCaveFieldEffect(void) +{ + FieldEffectActiveListRemove(FLDEFF_USE_SECRET_POWER_CAVE); + FieldEffectStart(FLDEFF_SECRET_POWER_CAVE); +} + +bool8 FldEff_SecretPowerCave(void) +{ + AdjustSecretPowerSpritePixelOffsets(); + CreateSprite(&gUnknown_0858E600, + gSprites[gPlayerAvatar.spriteId].oam.x + gFieldEffectArguments[5], + gSprites[gPlayerAvatar.spriteId].oam.y + gFieldEffectArguments[6], + 148); + return FALSE; +} + +static void CaveEntranceSpriteCallback1(struct Sprite *sprite) +{ + PlaySE(SE_W088); + + sprite->data[0] = 0; + sprite->callback = CaveEntranceSpriteCallback2; +} + +static void CaveEntranceSpriteCallback2(struct Sprite *sprite) +{ + if (sprite->data[0] < 40) + { + sprite->data[0]++; + + if (sprite->data[0] == 20) + sub_80E8D4C(); + } + else + { + sprite->data[0] = 0; + sprite->callback = CaveEntranceSpriteCallbackEnd; + } +} + +static void CaveEntranceSpriteCallbackEnd(struct Sprite *sprite) +{ + FieldEffectStop(sprite, FLDEFF_SECRET_POWER_CAVE); + EnableBothScriptContexts(); +} + +static void FieldCallback_SecretBaseTree(void) +{ + gFieldEffectArguments[0] = GetCursorSelectionMonId(); + ScriptContext1_SetupScript(EventScript_275ADF); +} + +bool8 FldEff_UseSecretPowerTree(void) +{ + u8 taskId = oei_task_add(); + + gTasks[taskId].data[8] = (u32)StartSecretBaseTreeFieldEffect >> 16; + gTasks[taskId].data[9] = (u32)StartSecretBaseTreeFieldEffect; + + return FALSE; +} + +static void StartSecretBaseTreeFieldEffect(void) +{ + FieldEffectActiveListRemove(FLDEFF_USE_SECRET_POWER_TREE); + FieldEffectStart(FLDEFF_SECRET_POWER_TREE); +} + +bool8 FldEff_SecretPowerTree(void) +{ + s16 mb = MapGridGetMetatileBehaviorAt(gPlayerFacingPosition.x, gPlayerFacingPosition.y) & 0xFFF; + + if (mb == MB_SECRET_BASE_SPOT_TREE_LEFT) + gFieldEffectArguments[7] = 0; + + if (mb == MB_SECRET_BASE_SPOT_TREE_RIGHT) + gFieldEffectArguments[7] = 2; + + AdjustSecretPowerSpritePixelOffsets(); + + CreateSprite(&gUnknown_0858E618, + gSprites[gPlayerAvatar.spriteId].oam.x + gFieldEffectArguments[5], + gSprites[gPlayerAvatar.spriteId].oam.y + gFieldEffectArguments[6], + 148); + + if (gFieldEffectArguments[7] == 1 || gFieldEffectArguments[7] == 3) + sub_80E8D4C(); + + return FALSE; +} + +static void TreeEntranceSpriteCallback1(struct Sprite *sprite) +{ + PlaySE(SE_W010); + + sprite->animNum = gFieldEffectArguments[7]; + sprite->data[0] = 0; + sprite->callback = TreeEntranceSpriteCallback2; +} + +static void TreeEntranceSpriteCallback2(struct Sprite *sprite) +{ + sprite->data[0]++; + + if (sprite->data[0] >= 40) + { + if (gFieldEffectArguments[7] == 0 || gFieldEffectArguments[7] == 2) + sub_80E8D4C(); + + sprite->data[0] = 0; + sprite->callback = TreeEntranceSpriteCallbackEnd; + } +} + +static void TreeEntranceSpriteCallbackEnd(struct Sprite *sprite) +{ + FieldEffectStop(sprite, FLDEFF_SECRET_POWER_TREE); + EnableBothScriptContexts(); +} + +static void FieldCallback_SecretBaseShrub(void) +{ + gFieldEffectArguments[0] = GetCursorSelectionMonId(); + ScriptContext1_SetupScript(EventScript_275B38); +} + +bool8 FldEff_UseSecretPowerShrub(void) +{ + u8 taskId = oei_task_add(); + + gTasks[taskId].data[8] = (u32)StartSecretBaseShrubFieldEffect >> 16; + gTasks[taskId].data[9] = (u32)StartSecretBaseShrubFieldEffect; + + return FALSE; +} + +static void StartSecretBaseShrubFieldEffect(void) +{ + FieldEffectActiveListRemove(FLDEFF_USE_SECRET_POWER_SHRUB); + FieldEffectStart(FLDEFF_SECRET_POWER_SHRUB); +} + +bool8 FldEff_SecretPowerShrub(void) +{ + AdjustSecretPowerSpritePixelOffsets(); + + CreateSprite(&gUnknown_0858E630, + gSprites[gPlayerAvatar.spriteId].oam.x + gFieldEffectArguments[5], + gSprites[gPlayerAvatar.spriteId].oam.y + gFieldEffectArguments[6], + 148); + + return FALSE; +} + +static void ShrubEntranceSpriteCallback1(struct Sprite *sprite) +{ + PlaySE(SE_W077); + + sprite->data[0] = 0; + sprite->callback = ShrubEntranceSpriteCallback2; +} + +static void ShrubEntranceSpriteCallback2(struct Sprite *sprite) +{ + if (sprite->data[0] < 40) + { + sprite->data[0]++; + + if (sprite->data[0] == 20) + sub_80E8D4C(); + } + else + { + sprite->data[0] = 0; + sprite->callback = ShrubEntranceSpriteCallbackEnd; + } +} + +static void ShrubEntranceSpriteCallbackEnd(struct Sprite *sprite) +{ + FieldEffectStop(sprite, FLDEFF_SECRET_POWER_SHRUB); + EnableBothScriptContexts(); +} + +bool8 FldEff_SecretBasePCTurnOn(void) +{ + s16 x, y; + u8 taskId; + + GetXYCoordsOneStepInFrontOfPlayer(&x, &y); + + taskId = CreateTask(Task_SecretBasePCTurnOn, 0); + gTasks[taskId].data[0] = x; + gTasks[taskId].data[1] = y; + gTasks[taskId].data[2] = 0; + + return FALSE; +} + +static void Task_SecretBasePCTurnOn(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + switch (data[2]) + { + case 4: + case 12: + MapGridSetMetatileIdAt(data[0], data[1], 548); + CurrentMapDrawMetatileAt(data[0], data[1]); + break; + case 8: + case 16: + MapGridSetMetatileIdAt(data[0], data[1], 544); + CurrentMapDrawMetatileAt(data[0], data[1]); + break; + case 20: + MapGridSetMetatileIdAt(data[0], data[1], 548); + CurrentMapDrawMetatileAt(data[0], data[1]); + FieldEffectActiveListRemove(FLDEFF_PCTURN_ON); + EnableBothScriptContexts(); + DestroyTask(taskId); + return; + } + + data[2]++; +} + +void DoSecretBasePCTurnOffEffect(void) +{ + s16 x, y; + + GetXYCoordsOneStepInFrontOfPlayer(&x, &y); + PlaySE(SE_PC_OFF); + + if (!VarGet(VAR_CURRENT_SECRET_BASE)) + MapGridSetMetatileIdAt(x, y, 3616); + else + MapGridSetMetatileIdAt(x, y, 3617); + + CurrentMapDrawMetatileAt(x, y); +} + +void PopSecretBaseBalloon(s16 metatileId, s16 x, s16 y) +{ + u8 taskId = CreateTask(Task_PopSecretBaseBalloon, 0); + + gTasks[taskId].data[0] = metatileId; + gTasks[taskId].data[1] = x; + gTasks[taskId].data[2] = y; + gTasks[taskId].data[3] = 0; + gTasks[taskId].data[4] = 1; +} + +static void Task_PopSecretBaseBalloon(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + if (data[3] == 6) + data[3] = 0; + else + data[3]++; + + if (data[3] == 0) + { + if (data[4] == 2) + DoBalloonSoundEffect(data[0]); + + MapGridSetMetatileIdAt(data[1], data[2], data[0] + data[4]); + CurrentMapDrawMetatileAt(data[1], data[2]); + + if (data[4] == 3) + DestroyTask(taskId); + else + data[4]++; + } +} + +static void DoBalloonSoundEffect(s16 metatileId) +{ + switch (metatileId) + { + case 824: + PlaySE(SE_FUUSEN1); + break; + case 828: + PlaySE(SE_FUUSEN2); + break; + case 832: + PlaySE(SE_FUUSEN3); + break; + case 552: + PlaySE(SE_TOY_DANGO); + break; + } +} + +bool8 FldEff_NopA6FC(void) +{ + return FALSE; +} + +bool8 FldEff_NopA700(void) +{ + return FALSE; +} + +static void DoSecretBaseBreakableDoorEffect(s16 x, s16 y) +{ + PlaySE(SE_TOY_KABE); + MapGridSetMetatileIdAt(x, y, 630); + MapGridSetMetatileIdAt(x, y - 1, 622); + CurrentMapDrawMetatileAt(x, y); + CurrentMapDrawMetatileAt(x, y - 1); +} + +static void Task_ShatterSecretBaseBreakableDoor(u8 taskId) +{ + if (gTasks[taskId].data[0] == 7) + { + DoSecretBaseBreakableDoorEffect(gTasks[taskId].data[1], gTasks[taskId].data[2]); + DestroyTask(taskId); + } + else + { + gTasks[taskId].data[0]++; + } +} + +void ShatterSecretBaseBreakableDoor(s16 x, s16 y) +{ + u8 dir = GetPlayerFacingDirection(); + + if (dir == DIR_SOUTH) + { + DoSecretBaseBreakableDoorEffect(x, y); + } + else if (dir == DIR_NORTH) + { + u8 taskId = CreateTask(Task_ShatterSecretBaseBreakableDoor, 5); + gTasks[taskId].data[0] = 0; + gTasks[taskId].data[1] = x; + gTasks[taskId].data[2] = y; + } +} + +#define tMetatileID data[0] +static void Task_SecretBaseMusicNoteMatSound(u8 taskId) +{ + if (gTasks[taskId].data[1] == 7) + { + switch (gTasks[taskId].tMetatileID) + { + case 632: + PlaySE(SE_TOY_C); + break; + case 633: + PlaySE(SE_TOY_D); + break; + case 634: + PlaySE(SE_TOY_E); + break; + case 635: + PlaySE(SE_TOY_F); + break; + case 636: + PlaySE(SE_TOY_G); + break; + case 637: + PlaySE(SE_TOY_A); + break; + case 638: + PlaySE(SE_TOY_B); + break; + case 691: + PlaySE(SE_TOY_C1); + break; + } + + DestroyTask(taskId); + } + else + { + gTasks[taskId].data[1]++; + } +} + +void PlaySecretBaseMusicNoteMatSound(s16 metatileId) +{ + u8 taskId = CreateTask(Task_SecretBaseMusicNoteMatSound, 5); + + gTasks[taskId].tMetatileID = metatileId; + gTasks[taskId].data[1] = 0; +} +#undef tMetatileID + +static void SpriteCB_GlitterMatSparkle(struct Sprite *sprite) +{ + sprite->data[0]++; + + if (sprite->data[0] == 8) + PlaySE(SE_W215); + + if (sprite->data[0] >= 32) + DestroySprite(sprite); +} + +void DoSecretBaseGlitterMatSparkle(void) +{ + s16 x = gEventObjects[gPlayerAvatar.eventObjectId].currentCoords.x; + s16 y = gEventObjects[gPlayerAvatar.eventObjectId].currentCoords.y; + u8 spriteId; + + sub_80930E0(&x, &y, 8, 4); + + spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[22], x, y, 0); + if (spriteId != MAX_SPRITES) + { + gSprites[spriteId].coordOffsetEnabled = TRUE; + gSprites[spriteId].oam.priority = 1; + gSprites[spriteId].oam.paletteNum = 5; + gSprites[spriteId].callback = SpriteCB_GlitterMatSparkle; + gSprites[spriteId].data[0] = 0; + } +} + +bool8 FldEff_SandPillar(void) +{ + s16 x, y; + + ScriptContext2_Enable(); + GetXYCoordsOneStepInFrontOfPlayer(&x, &y); + + gFieldEffectArguments[5] = x; + gFieldEffectArguments[6] = y; + + switch (GetPlayerFacingDirection()) + { + case DIR_SOUTH: + CreateSprite(&gUnknown_0858E68C, + gSprites[gPlayerAvatar.spriteId].oam.x + 8, + gSprites[gPlayerAvatar.spriteId].oam.y + 32, + 0); + + break; + + case DIR_NORTH: + CreateSprite(&gUnknown_0858E68C, + gSprites[gPlayerAvatar.spriteId].oam.x + 8, + gSprites[gPlayerAvatar.spriteId].oam.y, + 148); + + break; + + case DIR_WEST: + CreateSprite(&gUnknown_0858E68C, + gSprites[gPlayerAvatar.spriteId].oam.x - 8, + gSprites[gPlayerAvatar.spriteId].oam.y + 16, + 148); + + break; + + case DIR_EAST: + CreateSprite(&gUnknown_0858E68C, + gSprites[gPlayerAvatar.spriteId].oam.x + 24, + gSprites[gPlayerAvatar.spriteId].oam.y + 16, + 148); + + break; + } + + return FALSE; +} + +static void SpriteCB_SandPillar_0(struct Sprite *sprite) +{ + PlaySE(SE_W088); + + if (MapGridGetMetatileIdAt(gFieldEffectArguments[5], gFieldEffectArguments[6] - 1) == 646) + MapGridSetMetatileIdAt(gFieldEffectArguments[5], gFieldEffectArguments[6] - 1, 3586); + else + MapGridSetMetatileIdAt(gFieldEffectArguments[5], gFieldEffectArguments[6] - 1, 644); + + MapGridSetMetatileIdAt(gFieldEffectArguments[5], gFieldEffectArguments[6], 522); + CurrentMapDrawMetatileAt(gFieldEffectArguments[5], gFieldEffectArguments[6] - 1); + CurrentMapDrawMetatileAt(gFieldEffectArguments[5], gFieldEffectArguments[6]); + + sprite->data[0] = 0; + sprite->callback = SpriteCB_SandPillar_1; +} + +static void SpriteCB_SandPillar_1(struct Sprite *sprite) +{ + if (sprite->data[0] < 18) + { + sprite->data[0]++; + } + else + { + MapGridSetMetatileIdAt(gFieldEffectArguments[5], gFieldEffectArguments[6], 3724); + CurrentMapDrawMetatileAt(gFieldEffectArguments[5], gFieldEffectArguments[6]); + sprite->data[0] = 0; + sprite->callback = SpriteCB_SandPillar_2; + } +} + +static void SpriteCB_SandPillar_2(struct Sprite *sprite) +{ + FieldEffectStop(sprite, FLDEFF_SAND_PILLAR); + EnableBothScriptContexts(); +} + +void GetShieldToyTVDecorationInfo(void) +{ + s16 x, y; + s32 metatileId; + + GetXYCoordsOneStepInFrontOfPlayer(&x, &y); + + metatileId = MapGridGetMetatileIdAt(x, y); + + switch (metatileId) + { + case 822: + ConvertIntToDecimalStringN(gStringVar1, 100, STR_CONV_MODE_LEFT_ALIGN, 3); + StringCopy(gStringVar2, gText_Gold); + + gSpecialVar_Result = 0; + + if (!VarGet(VAR_CURRENT_SECRET_BASE)) + return; + + VarSet(VAR_0x40EE, VarGet(VAR_0x40EE) | 0x10); + break; + case 734: + ConvertIntToDecimalStringN(gStringVar1, 50, STR_CONV_MODE_LEFT_ALIGN, 2); + StringCopy(gStringVar2, gText_Silver); + + gSpecialVar_Result = 0; + + if (!VarGet(VAR_CURRENT_SECRET_BASE)) + return; + + VarSet(VAR_0x40EE, VarGet(VAR_0x40EE) | 0x20); + break; + case 756: + gSpecialVar_Result = 1; + + if (!VarGet(VAR_CURRENT_SECRET_BASE)) + return; + + VarSet(VAR_0x40EE, VarGet(VAR_0x40EE) | 0x80); + break; + case 757: + gSpecialVar_Result = 2; + + if (!VarGet(VAR_CURRENT_SECRET_BASE)) + return; + + VarSet(VAR_0x40EE, VarGet(VAR_0x40EE) | 0x80); + break; + case 758: + gSpecialVar_Result = 3; + + if (!VarGet(VAR_CURRENT_SECRET_BASE)) + return; + + VarSet(VAR_0x40EE, VarGet(VAR_0x40EE) | 0x80); + break; + } +} + +bool8 sub_80FADE4(u16 arg0, u8 arg1) +{ + if (!CurrentMapIsSecretBase()) + return FALSE; + + if (!arg1) + { + if (arg0 == 0x285 || arg0 == 0x286) + return TRUE; + if (arg0 == 0x237) + return TRUE; + } + else + { + if (arg0 == 0x28d) + return TRUE; + if (arg0 == 0x23F) + return TRUE; + } + + return FALSE; +} + +static void Task_FieldPoisonEffect(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + switch (data[0]) + { + case 0: + data[1] += 2; + if (data[1] > 8) + data[0]++; + break; + case 1: + data[1] -= 2; + if (data[1] == 0) + data[0]++; + break; + case 2: + DestroyTask(taskId); + return; + } + SetGpuReg(REG_OFFSET_MOSAIC, (data[1] << 4) | data[1]); +} + +void FldEffPoison_Start(void) +{ + PlaySE(SE_DOKU); + CreateTask(Task_FieldPoisonEffect, 80); +} + +bool32 FldEffPoison_IsActive(void) +{ + return FuncIsActiveTask(Task_FieldPoisonEffect); +} + +static void Task_WateringBerryTreeAnim_0(u8 taskId) +{ + gTasks[taskId].func = Task_WateringBerryTreeAnim_1; +} + +static void Task_WateringBerryTreeAnim_1(u8 taskId) +{ + struct EventObject *playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId]; + + if (!EventObjectIsMovementOverridden(playerEventObj) + || EventObjectClearHeldMovementIfFinished(playerEventObj)) + { + sub_808C228(GetPlayerFacingDirection()); + EventObjectSetHeldMovement(playerEventObj, GetWalkInPlaceNormalMovementAction(GetPlayerFacingDirection())); + gTasks[taskId].func = Task_WateringBerryTreeAnim_2; + } +} + +static void Task_WateringBerryTreeAnim_2(u8 taskId) +{ + struct EventObject *playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId]; + + if (EventObjectClearHeldMovementIfFinished(playerEventObj)) + { + s16 value = gTasks[taskId].data[1]++; + + if (value < 10) + EventObjectSetHeldMovement(playerEventObj, GetWalkInPlaceNormalMovementAction(GetPlayerFacingDirection())); + + else + gTasks[taskId].func = Task_WateringBerryTreeAnim_3; + } +} + +static void Task_WateringBerryTreeAnim_3(u8 taskId) +{ + SetPlayerAvatarTransitionFlags(sub_808BCD0()); + DestroyTask(taskId); + EnableBothScriptContexts(); +} + +void DoWateringBerryTreeAnim(void) +{ + CreateTask(Task_WateringBerryTreeAnim_0, 80); +} + +u8 CreateRecordMixingSprite(void) +{ + u8 spriteId; + + LoadSpritePalette(&gUnknown_0858E864); + + spriteId = CreateSprite(&gUnknown_0858E880, 0, 0, 82); + + if (spriteId == MAX_SPRITES) + { + return MAX_SPRITES; + } + else + { + struct Sprite *sprite = &gSprites[spriteId]; + sub_8092FF0(16, 13, &sprite->pos1.x, &sprite->pos1.y); + sprite->coordOffsetEnabled = TRUE; + sprite->pos1.x += 16; + sprite->pos1.y += 2; + } + return spriteId; +} + +void DestroyRecordMixingSprite(void) +{ + int i; + + for (i = 0; i < MAX_SPRITES; i++) + { + if (gSprites[i].template == &gUnknown_0858E880) + { + FreeSpritePalette(&gSprites[i]); + DestroySprite(&gSprites[i]); + } + } +} diff --git a/src/rom6.c b/src/fldeff_rocksmash.c index 8043730d2..9181b5532 100644 --- a/src/rom6.c +++ b/src/fldeff_rocksmash.c @@ -5,10 +5,10 @@ #include "event_scripts.h" #include "field_effect.h" #include "field_player_avatar.h" +#include "fldeff.h" #include "item_use.h" #include "overworld.h" #include "party_menu.h" -#include "rom6.h" #include "script.h" #include "sound.h" #include "sprite.h" @@ -26,8 +26,6 @@ static void sub_813552C(u8 taskId); static void sub_813561C(u8 taskId); static void sub_81356C4(void); static void sub_8135714(void); -static void hm2_dig(void); -static void sub_8135780(void); // extern RAM loc extern struct MapPosition gPlayerFacingPosition; @@ -162,51 +160,3 @@ static void sub_8135714(void) FieldEffectActiveListRemove(FLDEFF_USE_ROCK_SMASH); EnableBothScriptContexts(); } - -bool8 SetUpFieldMove_Dig(void) -{ - if (CanUseEscapeRopeOnCurrMap() == TRUE) - { - gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu; - gPostMenuFieldCallback = hm2_dig; - return TRUE; - } - else - { - return FALSE; - } -} - -static void hm2_dig(void) -{ - Overworld_ResetStateAfterDigEscRope(); - FieldEffectStart(FLDEFF_USE_DIG); - gFieldEffectArguments[0] = GetCursorSelectionMonId(); -} - -bool8 FldEff_UseDig(void) -{ - u8 taskId = oei_task_add(); - - gTasks[taskId].data[8] = (u32)sub_8135780 >> 16; - gTasks[taskId].data[9] = (u32)sub_8135780; - if (!ShouldDoBrailleDigEffect()) - SetPlayerAvatarTransitionFlags(PLAYER_AVATAR_FLAG_ON_FOOT); - return FALSE; -} - -static void sub_8135780(void) -{ - u8 taskId; - - FieldEffectActiveListRemove(FLDEFF_USE_DIG); - if (ShouldDoBrailleDigEffect()) - { - DoBrailleDigEffect(); - } - else - { - taskId = CreateTask(task08_080A1C44, 8); - gTasks[taskId].data[0] = 0; - } -} diff --git a/src/fldeff_softboiled.c b/src/fldeff_softboiled.c index 471a83c61..adec780b3 100644 --- a/src/fldeff_softboiled.c +++ b/src/fldeff_softboiled.c @@ -103,7 +103,7 @@ static void sub_8161784(u8 taskId) static void sub_81617B8(u8 taskId) { PlaySE(SE_SELECT); - sub_81B1B5C(&gText_CantBeUsedOnPkmn, 0); + sub_81B1B5C(gText_CantBeUsedOnPkmn, 0); schedule_bg_copy_tilemap_to_vram(2); gTasks[taskId].func = sub_8161784; } diff --git a/src/fldeff_strength.c b/src/fldeff_strength.c index f796ecea6..c57ab8cdc 100644 --- a/src/fldeff_strength.c +++ b/src/fldeff_strength.c @@ -2,8 +2,8 @@ #include "event_data.h" #include "event_scripts.h" #include "field_effect.h" +#include "fldeff.h" #include "party_menu.h" -#include "rom6.h" #include "script.h" #include "string_util.h" #include "task.h" diff --git a/src/fldeff_sweetscent.c b/src/fldeff_sweetscent.c index cd8fa400d..2363e8162 100644 --- a/src/fldeff_sweetscent.c +++ b/src/fldeff_sweetscent.c @@ -5,9 +5,9 @@ #include "field_player_avatar.h" #include "field_screen_effect.h" #include "field_weather.h" +#include "fldeff.h" #include "palette.h" #include "party_menu.h" -#include "rom6.h" #include "script.h" #include "sound.h" #include "sprite.h" @@ -21,8 +21,6 @@ static void FieldCallback_SweetScent(void); static void StartSweetScentFieldEffect(void); static void TrySweetScentEncounter(u8 taskId); static void FailSweetScentEncounter(u8 taskId); -void sub_81BE6B8(void); -void sub_81BE72C(void); bool8 SetUpFieldMove_SweetScent(void) { diff --git a/src/fldeff_teleport.c b/src/fldeff_teleport.c index 8562908bd..cbf8ee6cc 100644 --- a/src/fldeff_teleport.c +++ b/src/fldeff_teleport.c @@ -1,9 +1,9 @@ #include "global.h" #include "field_effect.h" #include "field_player_avatar.h" +#include "fldeff.h" #include "party_menu.h" #include "overworld.h" -#include "rom6.h" #include "task.h" #include "constants/field_effects.h" diff --git a/src/ghost.c b/src/ghost.c index d4f6512a8..a755783b7 100644 --- a/src/ghost.c +++ b/src/ghost.c @@ -217,7 +217,7 @@ const struct SpriteTemplate gUnknown_08596E48 = static void sub_811160C(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = sprite->pos1.x; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); @@ -235,7 +235,7 @@ static void sub_8111674(struct Sprite *sprite) s16 r0; s16 r2; sub_8111764(sprite); - if (TranslateAnimLinear(sprite)) + if (AnimTranslateLinear(sprite)) { sprite->callback = sub_81116E8; return; @@ -258,7 +258,7 @@ static void sub_81116E8(struct Sprite *sprite) s16 r2; s16 r0; sprite->data[0] = 1; - TranslateAnimLinear(sprite); + AnimTranslateLinear(sprite); sprite->pos2.x += Sin(sprite->data[5], 10); sprite->pos2.y += Cos(sprite->data[5], 15); @@ -313,7 +313,7 @@ static void sub_8111764(struct Sprite *sprite) static void sub_81117F4(struct Sprite *sprite) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->callback = sub_8111814; sprite->callback(sprite); } @@ -461,7 +461,7 @@ static void AnimShadowBallStep(struct Sprite *sprite) static void sub_8111B9C(struct Sprite *sprite) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->callback = sub_8111BB4; } @@ -536,7 +536,7 @@ void sub_8111C50(u8 taskId) gSprites[task->data[0]].data[3] = 0; gSprites[task->data[0]].data[4] = 0; StoreSpriteCallbackInData6(&gSprites[task->data[0]], SpriteCallbackDummy); - gSprites[task->data[0]].callback = TranslateAnimLinearSimple; + gSprites[task->data[0]].callback = AnimTranslateLinearSimple; task->func = sub_8111D78; } @@ -590,7 +590,7 @@ static void sub_8111E78(u8 taskId) { s16 startLine; struct Task *task = &gTasks[taskId]; - u8 position = sub_80A8364(gBattleAnimTarget); + u8 position = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget); switch (task->data[15]) { @@ -698,7 +698,7 @@ static void sub_81120DC(u8 taskId) static void sub_8112170(u8 taskId) { struct Task *task = &gTasks[taskId]; - u8 position = sub_80A8364(gBattleAnimTarget); + u8 position = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget); switch (task->data[15]) { @@ -1026,7 +1026,7 @@ static void sub_81129F0(struct Sprite *sprite) s16 xDelta; s16 xDelta2; - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) { xDelta = 24; @@ -1170,7 +1170,7 @@ void sub_8112C6C(u8 taskId) task->data[10] = GetBattlerYCoordWithElevation(gBattleAnimAttacker); task->data[11] = (sub_80A861C(gBattleAnimAttacker, 1) / 2) + 8; task->data[7] = 0; - task->data[5] = sub_80A8328(gBattleAnimAttacker); + task->data[5] = GetBattlerSpriteBGPriority(gBattleAnimAttacker); task->data[6] = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 2; task->data[3] = 0; task->data[4] = 16; diff --git a/src/gpu_regs.c b/src/gpu_regs.c index 2d48b304a..e5ff4fe8f 100644 --- a/src/gpu_regs.c +++ b/src/gpu_regs.c @@ -72,16 +72,20 @@ void SetGpuReg(u8 regOffset, u16 value) GPU_REG_BUF(regOffset) = value; vcount = REG_VCOUNT & 0xFF; - if ((vcount >= 161 && vcount <= 225) - || (REG_DISPCNT & DISPCNT_FORCED_BLANK)) { + if ((vcount >= 161 && vcount <= 225) || (REG_DISPCNT & DISPCNT_FORCED_BLANK)) + { CopyBufferedValueToGpuReg(regOffset); - } else { + } + else + { s32 i; sGpuRegBufferLocked = TRUE; - for (i = 0; i < GPU_REG_BUF_SIZE && sGpuRegWaitingList[i] != EMPTY_SLOT; i++) { - if (sGpuRegWaitingList[i] == regOffset) { + for (i = 0; i < GPU_REG_BUF_SIZE && sGpuRegWaitingList[i] != EMPTY_SLOT; i++) + { + if (sGpuRegWaitingList[i] == regOffset) + { sGpuRegBufferLocked = FALSE; return; } @@ -99,15 +103,20 @@ void SetGpuReg_ForcedBlank(u8 regOffset, u16 value) { GPU_REG_BUF(regOffset) = value; - if (REG_DISPCNT & DISPCNT_FORCED_BLANK) { + if (REG_DISPCNT & DISPCNT_FORCED_BLANK) + { CopyBufferedValueToGpuReg(regOffset); - } else { + } + else + { s32 i; sGpuRegBufferLocked = TRUE; - for (i = 0; i < GPU_REG_BUF_SIZE && sGpuRegWaitingList[i] != EMPTY_SLOT; i++) { - if (sGpuRegWaitingList[i] == regOffset) { + for (i = 0; i < GPU_REG_BUF_SIZE && sGpuRegWaitingList[i] != EMPTY_SLOT; i++) + { + if (sGpuRegWaitingList[i] == regOffset) + { sGpuRegBufferLocked = FALSE; return; } @@ -144,7 +153,8 @@ void ClearGpuRegBits(u8 regOffset, u16 mask) static void SyncRegIE(void) { - if (sShouldSyncRegIE) { + if (sShouldSyncRegIE) + { u16 temp = REG_IME; REG_IME = 0; REG_IE = sRegIE; diff --git a/src/ground.c b/src/ground.c index 77acd3919..807205ad8 100644 --- a/src/ground.c +++ b/src/ground.c @@ -183,7 +183,7 @@ static void AnimBonemerangProjectileEnd(struct Sprite *sprite) // arg 4: duration void AnimBoneHitProjectile(struct Sprite *sprite) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; @@ -205,7 +205,7 @@ void AnimDirtScatter(struct Sprite *sprite) u8 targetXPos, targetYPos; s16 xOffset, yOffset; - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); targetXPos = GetBattlerSpriteCoord2(gBattleAnimTarget, 2); targetYPos = GetBattlerSpriteCoord2(gBattleAnimTarget, 3); @@ -306,7 +306,7 @@ static void sub_8114CFC(u8 taskId) { case 0: task->data[10] = GetAnimBattlerSpriteId(0); - task->data[11] = sub_80A8364(gBattleAnimAttacker); + task->data[11] = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker); if (task->data[11] == 1) { task->data[12] = gBattle_BG1_X; @@ -375,7 +375,7 @@ static void sub_8114EB4(u8 taskId) gSprites[spriteId].pos2.x = 0; gSprites[spriteId].pos2.y = 0; - if (sub_80A8364(gBattleAnimAttacker) == 1) + if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) gBattle_BG1_Y = 0; else gBattle_BG2_Y = 0; @@ -422,7 +422,7 @@ static void sub_8114FD8(u8 taskId) { case 0: task->data[10] = GetAnimBattlerSpriteId(0); - task->data[11] = sub_80A8364(gBattleAnimAttacker); + task->data[11] = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker); if (task->data[11] == 1) task->data[12] = gBattle_BG1_X; else diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index f7792e935..b973798f6 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -14,7 +14,9 @@ #include "constants/songs.h" #include "decompress.h" #include "save.h" +#include "strings.h" #include "window.h" +#include "credits.h" #include "bg.h" #include "constants/species.h" #include "constants/game_stat.h" @@ -28,6 +30,7 @@ #include "event_data.h" #include "overworld.h" #include "menu.h" +#include "fldeff_misc.h" #include "trainer_pokemon_sprites.h" #include "data2.h" #include "rom_81520A8.h" @@ -59,37 +62,11 @@ static EWRAM_DATA u32 sUnknown_0203BCD4 = 0; static EWRAM_DATA struct HallofFameTeam *sHofMonPtr = NULL; static EWRAM_DATA struct HofGfx *sHofGfxPtr = NULL; -extern bool8 gHasHallOfFameRecords; extern struct MusicPlayerInfo gMPlayInfo_BGM; #define HALL_OF_FAME_MAX_TEAMS 50 -// strings -extern const u8 gText_SavingDontTurnOffPower[]; -extern const u8 gText_LeagueChamp[]; -extern const u8 gText_HOFNumber[]; -extern const u8 gText_PickNextCancel[]; -extern const u8 gText_PickCancel[]; -extern const u8 gText_UnkCtrlF800Exit[]; -extern const u8 gText_HOFCorrupted[]; -extern const u8 gText_WelcomeToHOF[]; -extern const u8 gText_Number[]; -extern const u8 gText_Level[]; -extern const u8 gText_IDNumber[]; -extern const u8 gText_Name[]; -extern const u8 gText_MainMenuTime[]; - -extern void sub_8175620(void); -extern bool8 sub_80F9C30(void); -extern void sub_8198314(void); extern void ReturnFromHallOfFamePC(void); -extern void sub_8198180(const u8 *src, u8, u8); -extern void sub_80F9BF4(u16, u16, u8); -extern void sub_81980F0(u8, u8, u8, u8, u16); -extern void sub_80F9BCC(u16, u16, u8); -extern bool8 sub_80F9C1C(void); -extern void sub_81971D0(void); -extern void sub_8197200(void); // this file's functions static void ClearVramOamPltt_LoadHofPal(void); @@ -1088,7 +1065,7 @@ static void Task_HofPC_HandleExit(u8 taskId) static void Task_HofPC_PrintDataIsCorrupted(u8 taskId) { - sub_8198180(gText_UnkCtrlF800Exit, 8, 1); + sub_8198180(gText_UnkCtrlF800Exit, 8, TRUE); NewMenuHelpers_DrawDialogueFrame(0, 0); AddTextPrinterParameterized2(0, 1, gText_HOFCorrupted, 0, NULL, 2, 1, 3); CopyWindowToVram(0, 3); @@ -1283,8 +1260,8 @@ static void sub_8174F70(void) ResetAllPicSprites(); FreeAllSpritePalettes(); gReservedSpritePaletteCount = 8; - LoadCompressedObjectPic(sHallOfFame_ConfettiSpriteSheet); - LoadCompressedObjectPalette(sHallOfFame_ConfettiSpritePalette); + LoadCompressedSpriteSheet(sHallOfFame_ConfettiSpriteSheet); + LoadCompressedSpritePalette(sHallOfFame_ConfettiSpritePalette); } static void sub_8174FAC(void) @@ -1475,8 +1452,8 @@ static void sub_8175364(u8 taskId) gSpecialVar_0x8004 = var; gSpecialVar_0x8005 = 0xFFFF; } - LoadCompressedObjectPic(sHallOfFame_ConfettiSpriteSheet); - LoadCompressedObjectPalette(sHallOfFame_ConfettiSpritePalette); + LoadCompressedSpriteSheet(sHallOfFame_ConfettiSpriteSheet); + LoadCompressedSpritePalette(sHallOfFame_ConfettiSpritePalette); data[0]++; break; case 1: @@ -1,21 +1,54 @@ #include "global.h" #include "battle_anim.h" +#include "bg.h" +#include "field_weather.h" +#include "gpu_regs.h" +#include "graphics.h" +#include "main.h" +#include "palette.h" +#include "random.h" +#include "sprite.h" +#include "task.h" +#include "trig.h" +#include "constants/battle_anim.h" #include "constants/rgb.h" -extern void sub_810B6C4(struct Sprite *); -extern void sub_810B8AC(struct Sprite *); -extern void sub_810B8EC(struct Sprite *); -extern void sub_810B974(struct Sprite *); -extern void sub_810BA24(struct Sprite *); -extern void sub_810BC94(struct Sprite *); -extern void sub_810BE48(struct Sprite *); -extern void sub_810BED0(struct Sprite *); -extern void sub_810C2F0(struct Sprite *); -extern void sub_810C560(struct Sprite *); -extern void sub_810CB58(struct Sprite *); +struct HailStruct { + s32 unk0:10; + s32 unk1:10; + s32 unk2:8; + s32 unk3:4; +}; + +static void sub_810B6C4(struct Sprite *); +extern void sub_810B848(struct Sprite *); +extern void AnimIcePunchSwirlingParticle(struct Sprite *); +extern void AnimIceBeamParticle(struct Sprite *); +extern void AnimIceEffectParticle(struct Sprite *); +extern void AnimFlickerIceEffectParticle(struct Sprite *); +extern void AnimSwirlingSnowball_Step1(struct Sprite *); +extern void AnimSwirlingSnowball_Step2(struct Sprite *); +extern void AnimSwirlingSnowball_Step3(struct Sprite *); +extern void AnimSwirlingSnowball_End(struct Sprite *); +extern void AnimMoveParticleBeyondTarget(struct Sprite *); +extern void AnimWiggleParticleTowardsTarget(struct Sprite *); +extern void AnimWaveFromCenterOfTarget(struct Sprite *); +extern void InitSwirlingFogAnim(struct Sprite *); +extern void AnimSwirlingFogAnim(struct Sprite *); +extern void AnimThrowMistBall(struct Sprite *); +extern void InitPoisonGasCloudAnim(struct Sprite *); +extern void MovePoisonGasCloud(struct Sprite *); +extern void AnimHailBegin(struct Sprite *); +extern void AnimHailContinue(struct Sprite *); extern void sub_80A8EE4(struct Sprite *); -extern void unc_080B06FC(struct Sprite *); -extern void sub_810CD4C(struct Sprite *); +extern void InitIceBallAnim(struct Sprite *); +extern void AnimThrowIceBall(struct Sprite *); +extern void InitIceBallParticle(struct Sprite *); +extern void AnimIceBallParticle(struct Sprite *); +void AnimTask_Haze2(u8); +void AnimTask_OverlayFogTiles(u8); +void AnimTask_Hail2(u8); +bool8 GenerateHailParticle(u8, u8, u8, u8); const union AnimCmd gUnknown_08595A48[] = { @@ -127,7 +160,7 @@ const struct SpriteTemplate gUnknown_08595AD0 = .anims = gUnknown_08595AA8, .images = NULL, .affineAnims = gUnknown_08595ACC, - .callback = sub_810B8AC, + .callback = AnimIcePunchSwirlingParticle, }; const struct SpriteTemplate gUnknown_08595AE8 = @@ -138,7 +171,7 @@ const struct SpriteTemplate gUnknown_08595AE8 = .anims = gUnknown_08595AAC, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_810B8AC, + .callback = AnimIcePunchSwirlingParticle, }; const union AffineAnimCmd gUnknown_08595B00[] = @@ -160,7 +193,7 @@ const struct SpriteTemplate gUnknown_08595B14 = .anims = gUnknown_08595AA8, .images = NULL, .affineAnims = gUnknown_08595B10, - .callback = sub_810B8EC, + .callback = AnimIceBeamParticle, }; const struct SpriteTemplate gUnknown_08595B2C = @@ -171,7 +204,7 @@ const struct SpriteTemplate gUnknown_08595B2C = .anims = gUnknown_08595AAC, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_810B8EC, + .callback = AnimIceBeamParticle, }; const union AffineAnimCmd gUnknown_08595B44[] = @@ -195,7 +228,7 @@ const struct SpriteTemplate gUnknown_08595B68 = .anims = gUnknown_08595AA8, .images = NULL, .affineAnims = gUnknown_08595B64, - .callback = sub_810B974, + .callback = AnimIceEffectParticle, }; const struct SpriteTemplate gUnknown_08595B80 = @@ -206,7 +239,7 @@ const struct SpriteTemplate gUnknown_08595B80 = .anims = gUnknown_08595AAC, .images = NULL, .affineAnims = gUnknown_08595B64, - .callback = sub_810B974, + .callback = AnimIceEffectParticle, }; const struct SpriteTemplate gUnknown_08595B98 = @@ -217,7 +250,7 @@ const struct SpriteTemplate gUnknown_08595B98 = .anims = gUnknown_08595AB0, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_810BA24, + .callback = AnimSwirlingSnowball_Step1, }; const struct SpriteTemplate gUnknown_08595BB0 = @@ -228,7 +261,7 @@ const struct SpriteTemplate gUnknown_08595BB0 = .anims = gUnknown_08595AB4, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_810BC94, + .callback = AnimMoveParticleBeyondTarget, }; const struct SpriteTemplate gUnknown_08595BC8 = @@ -239,7 +272,7 @@ const struct SpriteTemplate gUnknown_08595BC8 = .anims = gUnknown_08595AB0, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_810BC94, + .callback = AnimMoveParticleBeyondTarget, }; const union AnimCmd gUnknown_08595BE0[] = @@ -267,7 +300,7 @@ const struct SpriteTemplate gUnknown_08595C04 = .anims = gUnknown_08595C00, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_810BE48, + .callback = AnimWaveFromCenterOfTarget, }; const union AnimCmd gUnknown_08595C1C[] = @@ -290,7 +323,7 @@ const struct SpriteTemplate gUnknown_08595C2C = .anims = gUnknown_08595C28, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_810BED0, + .callback = InitSwirlingFogAnim, }; const struct SpriteTemplate gUnknown_08595C44 = @@ -301,7 +334,7 @@ const struct SpriteTemplate gUnknown_08595C44 = .anims = gUnknown_08595C28, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_810BED0, + .callback = InitSwirlingFogAnim, }; const u8 gUnknown_08595C5C[] = @@ -317,7 +350,7 @@ const struct SpriteTemplate gUnknown_08595C70 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_810C2F0, + .callback = AnimThrowMistBall, }; const u8 gUnknown_08595C88[] = @@ -333,21 +366,21 @@ const struct SpriteTemplate gUnknown_08595C9C = .anims = gUnknown_08595C28, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_810C560, + .callback = InitPoisonGasCloudAnim, }; -const u8 gUnknown_08595CB4[][4] = +const struct HailStruct gUnknown_08595CB4[] = { - {0x64, 0xE0, 0x01, 0x20}, - {0x55, 0xE0, 0x01, 0x00}, - {0xF2, 0xE0, 0x11, 0x10}, - {0x42, 0xE0, 0x21, 0x10}, - {0xB6, 0xE0, 0x31, 0x00}, - {0x3C, 0xE0, 0x01, 0x20}, - {0xD6, 0xE0, 0x11, 0x00}, - {0x71, 0xE0, 0x01, 0x10}, - {0xD2, 0xE0, 0x31, 0x10}, - {0x26, 0xE0, 0x21, 0x00}, + {100, 120, 0, 2}, + {85, 120, 0, 0}, + {242, 120, 1, 1}, + {66, 120, 2, 1}, + {182, 120, 3, 0}, + {60, 120, 0, 2}, + {214, 120, 1, 0}, + {113, 120, 0, 1}, + {210, 120, 3, 1}, + {38, 120, 2, 0}, }; const union AffineAnimCmd gUnknown_08595CDC[] = @@ -394,7 +427,7 @@ const struct SpriteTemplate gUnknown_08595D2C = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gUnknown_08595D1C, - .callback = sub_810CB58, + .callback = AnimHailBegin, }; const struct SpriteTemplate gUnknown_08595D44 = @@ -476,7 +509,7 @@ const struct SpriteTemplate gUnknown_08595DE4 = .anims = gUnknown_08595D78, .images = NULL, .affineAnims = gUnknown_08595DD0, - .callback = unc_080B06FC, + .callback = InitIceBallAnim, }; const struct SpriteTemplate gUnknown_08595DFC = @@ -487,5 +520,1421 @@ const struct SpriteTemplate gUnknown_08595DFC = .anims = gUnknown_08595AAC, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_810CD4C, + .callback = InitIceBallParticle, }; + + +// probably unused +#ifdef NONMATCHING +static void sub_810B6C4(struct Sprite *sprite) +{ + s16 targetX, targetY, attackerX, attackerY; + s16 i; + + sprite->oam.tileNum += 7; + targetX = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + targetY = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + attackerX = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + attackerY = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->data[0] = gBattleAnimArgs[4]; + sprite->data[1] = gBattleAnimArgs[0] + attackerX; + sprite->data[2] = gBattleAnimArgs[2] + targetX; + sprite->data[3] = gBattleAnimArgs[1] + attackerY; + sprite->data[4] = gBattleAnimArgs[3] + targetY; + sub_80A64EC(sprite); + while ((targetX >= -32 && targetX <= 272) && (targetY >= -32 && targetY <= 192)) + { + targetX += sprite->data[1]; + targetY += sprite->data[2]; + } + sprite->data[1] = -sprite->data[1]; + sprite->data[2] = -sprite->data[2]; + while ((attackerX >= -32 && attackerX <= 272) && (attackerY >= -32 && attackerY <= 192)) + { + attackerX += sprite->data[1]; + attackerY += sprite->data[2]; + } + sprite->pos1.x = attackerX; + sprite->pos1.y = attackerY; + sprite->data[0] = gBattleAnimArgs[4]; + sprite->data[1] = attackerX; + sprite->data[2] = targetX; + sprite->data[3] = attackerY; + sprite->data[4] = targetY; + sub_80A64EC(sprite); + sprite->data[3] = gBattleAnimArgs[5]; + sprite->data[4] = gBattleAnimArgs[6]; + sprite->callback = sub_810B848; +} +#else +NAKED +static void sub_810B6C4(struct Sprite *sprite) +{ + asm_unified("push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0x4\n\ + adds r5, r0, 0\n\ + ldrh r2, [r5, 0x4]\n\ + lsls r1, r2, 22\n\ + lsrs r1, 22\n\ + adds r1, 0x7\n\ + ldr r3, =0x000003ff\n\ + adds r0, r3, 0\n\ + ands r1, r0\n\ + ldr r0, =0xfffffc00\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strh r0, [r5, 0x4]\n\ + ldr r4, =gBattleAnimTarget\n\ + ldrb r0, [r4]\n\ + movs r1, 0x2\n\ + bl GetBattlerSpriteCoord\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r9, r0\n\ + ldrb r0, [r4]\n\ + movs r1, 0x3\n\ + bl GetBattlerSpriteCoord\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r8, r0\n\ + ldr r4, =gBattleAnimAttacker\n\ + ldrb r0, [r4]\n\ + movs r1, 0x2\n\ + bl GetBattlerSpriteCoord\n\ + lsls r0, 24\n\ + lsrs r3, r0, 24\n\ + ldrb r0, [r4]\n\ + movs r1, 0x3\n\ + str r3, [sp]\n\ + bl GetBattlerSpriteCoord\n\ + lsls r0, 24\n\ + lsrs r6, r0, 24\n\ + ldr r1, =gBattleAnimArgs\n\ + ldrh r0, [r1, 0x8]\n\ + strh r0, [r5, 0x2E]\n\ + ldrh r0, [r1]\n\ + ldr r3, [sp]\n\ + adds r0, r3\n\ + strh r0, [r5, 0x30]\n\ + ldrh r0, [r1, 0x4]\n\ + mov r4, r9\n\ + adds r0, r4, r0\n\ + strh r0, [r5, 0x32]\n\ + ldrh r0, [r1, 0x2]\n\ + adds r0, r6\n\ + strh r0, [r5, 0x34]\n\ + ldrh r0, [r1, 0x6]\n\ + mov r7, r8\n\ + adds r0, r7, r0\n\ + strh r0, [r5, 0x36]\n\ + adds r0, r5, 0\n\ + bl sub_80A64EC\n\ + adds r4, 0x20\n\ + movs r0, 0x98\n\ + lsls r0, 1\n\ + mov r12, r0\n\ + ldr r3, [sp]\n\ + cmp r4, r12\n\ + bhi _0810B79E\n\ + adds r0, r7, 0\n\ + adds r0, 0x20\n\ + ldrh r1, [r5, 0x30]\n\ + ldrh r2, [r5, 0x32]\n\ + cmp r0, 0xE0\n\ + bhi _0810B79E\n\ + adds r4, r1, 0\n\ + mov r10, r12\n\ +_0810B76A:\n\ + mov r7, r9\n\ + lsls r1, r7, 16\n\ + asrs r1, 16\n\ + adds r1, r4\n\ + lsls r1, 16\n\ + mov r7, r8\n\ + lsls r0, r7, 16\n\ + asrs r0, 16\n\ + adds r0, r2\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + mov r8, r0\n\ + lsrs r0, r1, 16\n\ + mov r9, r0\n\ + movs r7, 0x80\n\ + lsls r7, 14\n\ + adds r1, r7\n\ + lsrs r1, 16\n\ + cmp r1, r10\n\ + bhi _0810B79E\n\ + mov r1, r8\n\ + lsls r0, r1, 16\n\ + adds r0, r7\n\ + lsrs r0, 16\n\ + cmp r0, 0xE0\n\ + bls _0810B76A\n\ +_0810B79E:\n\ + ldrh r0, [r5, 0x30]\n\ + negs r7, r0\n\ + strh r7, [r5, 0x30]\n\ + ldrh r0, [r5, 0x32]\n\ + negs r4, r0\n\ + strh r4, [r5, 0x32]\n\ + lsls r0, r3, 16\n\ + movs r1, 0x80\n\ + lsls r1, 14\n\ + adds r0, r1\n\ + lsrs r0, 16\n\ + movs r2, 0x98\n\ + lsls r2, 1\n\ + mov r12, r2\n\ + ldr r1, =gBattleAnimArgs\n\ + mov r10, r1\n\ + cmp r0, r12\n\ + bhi _0810B80A\n\ + lsls r1, r6, 16\n\ + movs r2, 0x80\n\ + lsls r2, 14\n\ + adds r0, r1, r2\n\ + b _0810B802\n\ + .pool\n\ +_0810B7E0:\n\ + lsls r1, r3, 16\n\ + asrs r1, 16\n\ + adds r1, r7\n\ + lsls r1, 16\n\ + asrs r0, r2, 16\n\ + adds r0, r4\n\ + lsls r0, 16\n\ + lsrs r6, r0, 16\n\ + lsrs r3, r1, 16\n\ + movs r0, 0x80\n\ + lsls r0, 14\n\ + adds r1, r0\n\ + lsrs r1, 16\n\ + cmp r1, r12\n\ + bhi _0810B80A\n\ + lsls r1, r6, 16\n\ + adds r0, r1, r0\n\ +_0810B802:\n\ + lsrs r0, 16\n\ + adds r2, r1, 0\n\ + cmp r0, 0xE0\n\ + bls _0810B7E0\n\ +_0810B80A:\n\ + strh r3, [r5, 0x20]\n\ + strh r6, [r5, 0x22]\n\ + mov r1, r10\n\ + ldrh r0, [r1, 0x8]\n\ + strh r0, [r5, 0x2E]\n\ + strh r3, [r5, 0x30]\n\ + mov r2, r9\n\ + strh r2, [r5, 0x32]\n\ + strh r6, [r5, 0x34]\n\ + mov r3, r8\n\ + strh r3, [r5, 0x36]\n\ + adds r0, r5, 0\n\ + bl sub_80A64EC\n\ + mov r7, r10\n\ + ldrh r0, [r7, 0xA]\n\ + strh r0, [r5, 0x34]\n\ + ldrh r0, [r7, 0xC]\n\ + strh r0, [r5, 0x36]\n\ + ldr r0, =sub_810B848\n\ + str r0, [r5, 0x1C]\n\ + add sp, 0x4\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n"); +} +#endif + +void sub_810B848(struct Sprite *sprite) +{ + if (sprite->data[0] != 0) + { + sprite->data[5] += sprite->data[1]; + sprite->data[6] += sprite->data[2]; + sprite->pos2.x = sprite->data[5]; + sprite->pos2.y = sprite->data[6]; + sprite->pos2.x += Sin(sprite->data[7], sprite->data[3]); + sprite->pos2.y += Sin(sprite->data[7], sprite->data[3]); + sprite->data[7] = (sprite->data[7] + sprite->data[4]) & 0xFF; + sprite->data[0]--; + } + else + { + DestroyAnimSprite(sprite); + } +} + +// Animates the swirling ice crystals in Ice Punch. +// arg 0: initial position angle around circle (0-256) +void AnimIcePunchSwirlingParticle(struct Sprite *sprite) +{ + sprite->data[0] = gBattleAnimArgs[0]; + sprite->data[1] = 60; + sprite->data[2] = 9; + sprite->data[3] = 30; + sprite->data[4] = -512; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); + sprite->callback = TranslateSpriteInGrowingCircleOverDuration; + sprite->callback(sprite); +} + +// Animates the ice particles in Ice Beam. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: target x offset +// arg 3: target y offset +// arg 4: duration +void AnimIceBeamParticle(struct Sprite *sprite) +{ + InitSpritePosToAnimAttacker(sprite, TRUE); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + sprite->data[2] -= gBattleAnimArgs[2]; + else + sprite->data[2] += gBattleAnimArgs[2]; + + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; + sprite->data[0] = gBattleAnimArgs[4]; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); + sprite->callback = StartAnimLinearTranslation; +} + +// Animates the ice crystals at the end of Ice Punch, Ice Beam, Tri Attack, +// Weather Ball (Hail), Blizzard, and Powder Snow. +// arg 0: target x offset +// arg 1: target y offset +// arg 2: ??? unknown boolean +void AnimIceEffectParticle(struct Sprite *sprite) +{ + if (gBattleAnimArgs[2] == 0) + { + InitSpritePosToAnimTarget(sprite, TRUE); + } + else + { + SetAverageBattlerPositions(gBattleAnimTarget, 1, &sprite->pos1.x, &sprite->pos1.y); + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + gBattleAnimArgs[0] = -gBattleAnimArgs[0]; + + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + } + + StoreSpriteCallbackInData6(sprite, AnimFlickerIceEffectParticle); + sprite->callback = RunStoredCallbackWhenAffineAnimEnds; +} + +void AnimFlickerIceEffectParticle(struct Sprite *sprite) +{ + sprite->invisible ^= 1; + sprite->data[0] += 1; + if (sprite->data[0] == 20) + DestroySpriteAndMatrix(sprite); +} + +// Animates the small snowballs that swirl around the target in Blizzard and Icy Wind. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: target x offset +// arg 3: target y offset +// arg 4: particle speed +// arg 5: multiple targets? (boolean) +void AnimSwirlingSnowball_Step1(struct Sprite *sprite) +{ + int i; + s16 tempDataHolder[8]; + + InitSpritePosToAnimAttacker(sprite, TRUE); + + sprite->data[0] = gBattleAnimArgs[4]; + sprite->data[1] = sprite->pos1.x; + sprite->data[3] = sprite->pos1.y; + + if (!gBattleAnimArgs[5]) + { + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; + } + else + { + SetAverageBattlerPositions(gBattleAnimTarget, 1, &sprite->data[2], &sprite->data[4]); + } + + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + sprite->data[2] -= gBattleAnimArgs[2]; + else + sprite->data[2] += gBattleAnimArgs[2]; + + for (i = 0; i < 8; i++) + tempDataHolder[i] = sprite->data[i]; + + InitAnimFastLinearTranslationWithSpeed(sprite); + sprite->data[1] ^= 1; + sprite->data[2] ^= 1; + + while (1) + { + sprite->data[0] = 1; + AnimFastTranslateLinear(sprite); + + if ((u32)(sprite->pos1.x + sprite->pos2.x + 16) > 272 + || sprite->pos1.y + sprite->pos2.y > 160 + || sprite->pos1.y + sprite->pos2.y < -16) + break; + } + + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + sprite->pos2.y = 0; + sprite->pos2.x = 0; + + for (i = 0; i < 8; i++) + sprite->data[i] = tempDataHolder[i]; + + sprite->callback = sub_80A718C; + StoreSpriteCallbackInData6(sprite, AnimSwirlingSnowball_Step2); +} + +void AnimSwirlingSnowball_Step2(struct Sprite *sprite) +{ + s16 tempVar; + + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + sprite->pos2.y = 0; + sprite->pos2.x = 0; + sprite->data[0] = 128; + + tempVar = GetBattlerSide(gBattleAnimAttacker) != 0 ? 20 : -20; + + sprite->data[3] = Sin(sprite->data[0], tempVar); + sprite->data[4] = Cos(sprite->data[0], 0xF); + sprite->data[5] = 0; + sprite->callback = AnimSwirlingSnowball_Step3; + sprite->callback(sprite); +} + +void AnimSwirlingSnowball_Step3(struct Sprite *sprite) +{ + s16 tempVar; + tempVar = GetBattlerSide(gBattleAnimAttacker) != 0 ? 20 : -20; + + if (sprite->data[5] <= 31) + { + sprite->pos2.x = Sin(sprite->data[0], tempVar) - sprite->data[3]; + sprite->pos2.y = Cos(sprite->data[0], 15) - sprite->data[4]; + sprite->data[0] = (sprite->data[0] + 16) & 0xFF; + sprite->data[5] += 1; + } + else + { + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + sprite->pos2.y = 0; + sprite->pos2.x = 0; + sprite->data[4] = 0; + sprite->data[3] = 0; + sprite->callback = AnimSwirlingSnowball_End; + } +} + +void AnimSwirlingSnowball_End(struct Sprite *sprite) +{ + sprite->data[0] = 1; + AnimFastTranslateLinear(sprite); + + if ((u32)(sprite->pos1.x + sprite->pos2.x + 16) > 272 + || sprite->pos1.y + sprite->pos2.y > 256 + || sprite->pos1.y + sprite->pos2.y < -16) + DestroyAnimSprite(sprite); +} + +// Moves particles towards the target mon and off the screen. Used to animate +// the large snowballs in Blizzard and the small snowballs in Powder Snow. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: target x offset +// arg 3: target y offset +// arg 4: speed +// arg 5: wave amplitude +// arg 6: wave frequency +// arg 7: multiple targets? (boolean) +void AnimMoveParticleBeyondTarget(struct Sprite *sprite) +{ + int i; + s16 tempDataHolder[8]; + + InitSpritePosToAnimAttacker(sprite, TRUE); + + sprite->data[0] = gBattleAnimArgs[4]; + sprite->data[1] = sprite->pos1.x; + sprite->data[3] = sprite->pos1.y; + + if (!gBattleAnimArgs[7]) + { + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + } + else + { + SetAverageBattlerPositions(gBattleAnimTarget, 1, &sprite->data[2], &sprite->data[4]); + } + + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + sprite->data[2] -= gBattleAnimArgs[2]; + else + sprite->data[2] += gBattleAnimArgs[2]; + + sprite->data[4] += gBattleAnimArgs[3]; + InitAnimFastLinearTranslationWithSpeed(sprite); + for (i = 0; i < 8; i++) + tempDataHolder[i] = sprite->data[i]; + + sprite->data[1] ^= 1; + sprite->data[2] ^= 1; + + while (1) + { + sprite->data[0] = 1; + AnimFastTranslateLinear(sprite); + if ((u32)(sprite->pos1.x + sprite->pos2.x + 16) > 272 + || sprite->pos1.y + sprite->pos2.y > 160 + || sprite->pos1.y + sprite->pos2.y < -16) + break; + } + + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + sprite->pos2.y = 0; + sprite->pos2.x = 0; + + for (i = 0; i < 8; i++) + sprite->data[i] = tempDataHolder[i]; + + sprite->data[5] = gBattleAnimArgs[5]; + sprite->data[6] = gBattleAnimArgs[6]; + sprite->callback = AnimWiggleParticleTowardsTarget; +} + +// Moves particles in a sine wave towards the target. +void AnimWiggleParticleTowardsTarget(struct Sprite *sprite) +{ + AnimFastTranslateLinear(sprite); + if (sprite->data[0] == 0) + sprite->data[0] = 1; + + sprite->pos2.y += Sin(sprite->data[7], sprite->data[5]); + sprite->data[7] = (sprite->data[7] + sprite->data[6]) & 0xFF; + if (sprite->data[0] == 1) + { + if ((u32)(sprite->pos1.x + sprite->pos2.x + 16) > 272 + || sprite->pos1.y + sprite->pos2.y > 160 + || sprite->pos1.y + sprite->pos2.y < -16) + DestroyAnimSprite(sprite); + } +} + +// Animates the ice pilar wave used by Icy Wind. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: ??? unknown boolean +void AnimWaveFromCenterOfTarget(struct Sprite *sprite) +{ + if (sprite->data[0] == 0) + { + if (gBattleAnimArgs[2] == 0) + { + InitSpritePosToAnimTarget(sprite, FALSE); + } + else + { + SetAverageBattlerPositions(gBattleAnimTarget, 0, &sprite->pos1.x, &sprite->pos1.y); + + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + gBattleAnimArgs[0] = -gBattleAnimArgs[0]; + + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + } + + sprite->data[0]++; + } + else + { + if (sprite->animEnded) + DestroyAnimSprite(sprite); + } +} + +// Animates the fog that swirls around the mon in Mist and Smog. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: change in y pixels per rotation +// arg 3: duration +// arg 4: animate on opponent? (boolean) +// arg 5: ??? unknown boolean +void InitSwirlingFogAnim(struct Sprite *sprite) +{ + s16 tempVar; + u8 battler; + + if (gBattleAnimArgs[4] == 0) + { + if (gBattleAnimArgs[5] == 0) + { + InitSpritePosToAnimAttacker(sprite, FALSE); + } + else + { + SetAverageBattlerPositions(gBattleAnimAttacker, 0, &sprite->pos1.x, &sprite->pos1.y); + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + sprite->pos1.x -= gBattleAnimArgs[0]; + else + sprite->pos1.x += gBattleAnimArgs[0]; + + sprite->pos1.y += gBattleAnimArgs[1]; + } + + battler = gBattleAnimAttacker; + } + else + { + if (gBattleAnimArgs[5] == 0) + { + InitSpritePosToAnimTarget(sprite, FALSE); + } + else + { + SetAverageBattlerPositions(gBattleAnimTarget, 0, &sprite->pos1.x, &sprite->pos1.y); + if (GetBattlerSide(gBattleAnimTarget) != B_SIDE_PLAYER) + sprite->pos1.x -= gBattleAnimArgs[0]; + else + sprite->pos1.x += gBattleAnimArgs[0]; + + sprite->pos1.y += gBattleAnimArgs[1]; + } + + battler = gBattleAnimTarget; + } + + sprite->data[7] = battler; + if (gBattleAnimArgs[5] == 0 || !IsDoubleBattle()) + tempVar = 0x20; + else + tempVar = 0x40; + + sprite->data[6] = tempVar; + if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) + sprite->pos1.y += 8; + + sprite->data[0] = gBattleAnimArgs[3]; + sprite->data[1] = sprite->pos1.x; + sprite->data[2] = sprite->pos1.x; + sprite->data[3] = sprite->pos1.y; + sprite->data[4] = sprite->pos1.y + gBattleAnimArgs[2]; + + InitAnimLinearTranslation(sprite); + + sprite->data[5] = 64; + sprite->callback = AnimSwirlingFogAnim; + sprite->callback(sprite); +} + +// Animates swirling fog initialized by InitSwirlingFogAnim. +void AnimSwirlingFogAnim(struct Sprite *sprite) +{ + if (!AnimTranslateLinear(sprite)) + { + sprite->pos2.x += Sin(sprite->data[5], sprite->data[6]); + sprite->pos2.y += Cos(sprite->data[5], -6); + + if ((u16)(sprite->data[5] - 64) <= 0x7F) + sprite->oam.priority = GetBattlerSpriteBGPriority(sprite->data[7]); + else + sprite->oam.priority = GetBattlerSpriteBGPriority(sprite->data[7]) + 1; + + sprite->data[5] = (sprite->data[5] + 3) & 0xFF; + } + else + { + DestroyAnimSprite(sprite); + } +} + +// Fades mons to black and places foggy overlay in Haze. +void AnimTask_Haze1(u8 taskId) +{ + struct UnknownAnimStruct2 subStruct; + + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG1 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + SetAnimBgAttribute(1, BG_ANIM_SCREEN_SIZE, 0); + + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1); + + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); + SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); + + sub_80A6B30(&subStruct); + LoadBgTiles(subStruct.bgId, gWeatherFog1Tiles, 0x800, subStruct.tilesOffset); + sub_80A6D60(&subStruct, gBattleAnimFogTilemap, 0); + LoadPalette(&gUnknown_083970E8, subStruct.unk8 * 16, 32); + + gTasks[taskId].func = AnimTask_Haze2; +} + +void AnimTask_Haze2(u8 taskId) +{ + struct UnknownAnimStruct2 subStruct; + + gBattle_BG1_X += -1; + gBattle_BG1_Y += 0; + + switch (gTasks[taskId].data[12]) + { + case 0: + if (++gTasks[taskId].data[10] == 4) + { + gTasks[taskId].data[10] = 0; + gTasks[taskId].data[9]++; + gTasks[taskId].data[11] = gUnknown_08595C5C[gTasks[taskId].data[9]]; + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 16 - gTasks[taskId].data[11])); + if (gTasks[taskId].data[11] == 9) + { + gTasks[taskId].data[12]++; + gTasks[taskId].data[11] = 0; + } + } + break; + case 1: + if (++gTasks[taskId].data[11] == 0x51) + { + gTasks[taskId].data[11] = 9; + gTasks[taskId].data[12]++; + } + break; + case 2: + if (++gTasks[taskId].data[10] == 4) + { + gTasks[taskId].data[10] = 0; + gTasks[taskId].data[11]--; + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 16 - gTasks[taskId].data[11])); + if (gTasks[taskId].data[11] == 0) + { + gTasks[taskId].data[12]++; + gTasks[taskId].data[11] = 0; + } + } + break; + case 3: + sub_80A6B30(&subStruct); + sub_80A6C68(1); + sub_80A6C68(2); + + gTasks[taskId].data[12]++; + + // fall through + case 4: + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0); + + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 0)); + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + DestroyAnimVisualTask(taskId); + } +} + +// Throws the ball in Mist Ball. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: targey x offset +// arg 3: target y offset +// arg 4: duration +// arg 5: ??? unknown (seems to vibrate target mon somehow) +void AnimThrowMistBall(struct Sprite *sprite) +{ + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->callback = TranslateAnimSpriteToTargetMonLocation; +} + +// Displays misty background in Mist Ball. +void AnimTask_LoadMistTiles(u8 taskId) +{ + struct UnknownAnimStruct2 subStruct; + + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG1 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + SetAnimBgAttribute(1, BG_ANIM_SCREEN_SIZE, 0); + + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1); + + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); + SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); + + sub_80A6B30(&subStruct); + LoadBgTiles(subStruct.bgId, gWeatherFog1Tiles, 0x800, subStruct.tilesOffset); + sub_80A6D60(&subStruct, gBattleAnimFogTilemap, 0); + LoadPalette(&gUnknown_083970E8, subStruct.unk8 * 16, 32); + + gTasks[taskId].data[15] = -1; + gTasks[taskId].func = AnimTask_OverlayFogTiles; +} + +void AnimTask_OverlayFogTiles(u8 taskId) +{ + struct UnknownAnimStruct2 subStruct; + + gBattle_BG1_X += gTasks[taskId].data[15]; + gBattle_BG1_Y += 0; + + switch (gTasks[taskId].data[12]) + { + case 0: + gTasks[taskId].data[9] += 1; + gTasks[taskId].data[11] = gUnknown_08595C88[gTasks[taskId].data[9]]; + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 17 - gTasks[taskId].data[11])); + if (gTasks[taskId].data[11] == 5) + { + gTasks[taskId].data[12]++; + gTasks[taskId].data[11] = 0; + } + break; + case 1: + if (++gTasks[taskId].data[11] == 0x51) + { + gTasks[taskId].data[11] = 5; + gTasks[taskId].data[12]++; + } + break; + case 2: + if (++gTasks[taskId].data[10] == 4) + { + gTasks[taskId].data[10] = 0; + gTasks[taskId].data[11] -= 1; + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 16 - gTasks[taskId].data[11])); + if (gTasks[taskId].data[11] == 0) + { + gTasks[taskId].data[12]++; + gTasks[taskId].data[11] = 0; + } + } + break; + case 3: + sub_80A6B30(&subStruct); + sub_80A6C68(1); + sub_80A6C68(2); + + gTasks[taskId].data[12]++; + + // fall through + case 4: + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0); + + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 0)); + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + DestroyAnimVisualTask(taskId); + } +} + +// Initializes gas clouds in the Poison Gas animation. +// arg 0: duration +// arg 1: ? target x offset +// arg 2: ? target y offset +// arg 3: ? swirl start x +// arg 4: ? swirl start y +// arg 5: ??? unknown +// arg 6: ??? unknown +// arg 7: ??? unknown boolean +void InitPoisonGasCloudAnim(struct Sprite *sprite) +{ + sprite->data[0] = gBattleAnimArgs[0]; + + if (GetBattlerSpriteCoord(gBattleAnimAttacker, 2) < GetBattlerSpriteCoord(gBattleAnimTarget, 2)) + sprite->data[7] = 0x8000; + + if (!(gBattlerPositions[gBattleAnimTarget] & 1)) + { + gBattleAnimArgs[1] = -gBattleAnimArgs[1]; + gBattleAnimArgs[3] = -gBattleAnimArgs[3]; + + if ((sprite->data[7] & 0x8000) && !(gBattlerPositions[gBattleAnimAttacker] & 1)) + sprite->subpriority = gSprites[GetAnimBattlerSpriteId(ANIM_TARGET)].subpriority + 1; + + sprite->data[6] = 1; + } + + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + if (gBattleAnimArgs[7]) + { + sprite->data[1] = sprite->pos1.x + gBattleAnimArgs[1]; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[3]; + sprite->data[3] = sprite->pos1.y + gBattleAnimArgs[2]; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[4]; + sprite->data[7] |= GetBattlerSpriteBGPriority(gBattleAnimTarget) << 8; + } + else + { + sprite->data[1] = sprite->pos1.x + gBattleAnimArgs[1]; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 0) + gBattleAnimArgs[3]; + sprite->data[3] = sprite->pos1.y + gBattleAnimArgs[2]; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + gBattleAnimArgs[4]; + sprite->data[7] |= GetBattlerSpriteBGPriority(gBattleAnimTarget) << 8; + } + + if (IsContest()) + { + sprite->data[6] = 1; + sprite->subpriority = 0x80; + } + + InitAnimLinearTranslation(sprite); + sprite->callback = MovePoisonGasCloud; +} + +void MovePoisonGasCloud(struct Sprite *sprite) +{ + int value; + register s16 value2 asm("r5"); + int unused; + + switch (sprite->data[7] & 0xFF) + { + case 0: + AnimTranslateLinear(sprite); + value = gSineTable[sprite->data[5]]; + sprite->pos2.x += value >> 4; + if (sprite->data[6]) + sprite->data[5] = (sprite->data[5] - 8) & 0xFF; + else + sprite->data[5] = (sprite->data[5] + 8) & 0xFF; + + if (sprite->data[0] <= 0) + { + value2 = 80; + sprite->data[0] = value2; + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 0); + sprite->data[1] = sprite->pos1.x; + sprite->data[2] = sprite->pos1.x; + sprite->pos1.y += sprite->pos2.y; + sprite->data[3] = sprite->pos1.y; + sprite->data[4] = sprite->pos1.y + 29; + sprite->data[7]++; + if (!IsContest() && gBattlerPositions[gBattleAnimTarget] & 1) + sprite->data[5] = 204; + else + sprite->data[5] = value2; + + sprite->pos2.y = 0; + value = gSineTable[sprite->data[5]]; + sprite->pos2.x = value >> 3; + sprite->data[5] = (sprite->data[5] + 2) & 0xFF; + InitAnimLinearTranslation(sprite); + } + break; + case 1: + AnimTranslateLinear(sprite); + value = gSineTable[sprite->data[5]]; + sprite->pos2.x += value >> 3; + sprite->pos2.y += (gSineTable[sprite->data[5] + 0x40] * -3) >> 8; + if (!IsContest()) + { + u16 var0 = sprite->data[5] - 0x40; + if (var0 <= 0x7F) + sprite->oam.priority = sprite->data[7] >> 8; + else + sprite->oam.priority = (sprite->data[7] >> 8) + 1; + + sprite->data[5] = (sprite->data[5] + 4) & 0xFF; + } + else + { + u16 var0 = sprite->data[5] - 0x40; + if (var0 <= 0x7F) + sprite->subpriority = 128; + else + sprite->subpriority = 140; + + sprite->data[5] = (sprite->data[5] - 4) & 0xFF; + } + + if (sprite->data[0] <= 0) + { + asm("mov r5, #0"); // unused local variable? + unused = 0; + sprite->data[0] = 0x300; + sprite->data[1] = sprite->pos1.x += sprite->pos2.x; + sprite->data[3] = sprite->pos1.y += sprite->pos2.y; + sprite->data[4] = sprite->pos1.y + 4; + if (!IsContest() && gBattlerPositions[gBattleAnimTarget] & 1) + sprite->data[2] = 0x100; + else + sprite->data[2] = -0x10; + + sprite->data[7]++; + sprite->pos2.x = sprite->pos2.y = 0; + sub_80A6FD4(sprite); + } + break; + case 2: + if (AnimTranslateLinear(sprite)) + { + if (sprite->oam.affineMode & 1) + { + FreeOamMatrix(sprite->oam.matrixNum); + sprite->oam.affineMode = ST_OAM_AFFINE_OFF; + } + + DestroySprite(sprite); + gAnimVisualTaskCount--; + } + break; + } +} + +// Creates Hail. +void AnimTask_Hail1(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + task->func = AnimTask_Hail2; +} + +void AnimTask_Hail2(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + switch (task->data[0]) + { + case 0: + if (++task->data[4] > 2) + { + task->data[4] = 0; + task->data[5] = 0; + task->data[2] = 0; + task->data[0]++; + } + break; + case 1: + if (task->data[5] == 0) + { + if (GenerateHailParticle(task->data[3], task->data[2], taskId, 1)) + task->data[1]++; + + if (++task->data[2] == 3) + { + if (++task->data[3] == 10) + task->data[0]++; + else + task->data[0]--; + } + else + { + task->data[5] = 1; + } + + } + else + { + task->data[5]--; + } + break; + case 2: + if (task->data[1] == 0) + DestroyAnimVisualTask(taskId); + break; + } +} + +#ifdef NONMATCHING +bool8 GenerateHailParticle(u8 a, u8 b, u8 taskId, u8 c) +{ + bool8 possibleBool = FALSE; + // s8 unk = gUnknown_08595CB4[a].unk3; + const struct HailStruct *hailData = &gUnknown_08595CB4[a]; + s8 unk = hailData->unk3; + u8 battler; + s16 battlerX, battlerY; + u8 spriteId; + // struct Sprite *sprite; + s16 spriteX; + + if (unk != 2) + { + battler = GetBattlerAtPosition(hailData->unk2); + if (IsBattlerSpriteVisible(battler)) + { + possibleBool = TRUE; + battlerX = GetBattlerSpriteCoord(battler, 2); + battlerY = GetBattlerSpriteCoord(battler, 3); + switch (unk) + { + case 0: + battlerX -= sub_80A861C(battler, 1) / 6; + battlerY -= sub_80A861C(battler, 0) / 6; + break; + case 1: + battlerX += sub_80A861C(battler, 1) / 6; + battlerY += sub_80A861C(battler, 0) / 6; + break; + } + } + } + else + { + battlerX = (hailData->unk0); + battlerY = (hailData->unk1); + } + spriteX = battlerX - ((battlerY + 8) / 2); + spriteId = CreateSprite(&gUnknown_08595D2C, spriteX, -8, 18); + if (spriteId == MAX_SPRITES) + return FALSE; + // sprite = &gSprites[spriteId]; + StartSpriteAffineAnim(&gSprites[spriteId], b); + gSprites[spriteId].data[0] = possibleBool; + gSprites[spriteId].data[3] = battlerX; + gSprites[spriteId].data[4] = battlerY; + gSprites[spriteId].data[5] = b; + gSprites[spriteId].data[6] = taskId; + gSprites[spriteId].data[7] = c; + return TRUE; +} +#else +NAKED +bool8 GenerateHailParticle(u8 a, u8 b, u8 taskId, u8 c) +{ + asm_unified("push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0x8\n\ + lsls r0, 24\n\ + lsls r1, 24\n\ + lsrs r1, 24\n\ + mov r9, r1\n\ + lsls r2, 24\n\ + lsrs r2, 24\n\ + str r2, [sp]\n\ + lsls r3, 24\n\ + lsrs r3, 24\n\ + mov r10, r3\n\ + movs r1, 0\n\ + str r1, [sp, 0x4]\n\ + ldr r1, =gUnknown_08595CB4\n\ + lsrs r0, 22\n\ + adds r4, r0, r1\n\ + ldrb r0, [r4, 0x3]\n\ + lsls r0, 24\n\ + asrs r0, 28\n\ + mov r8, r0\n\ + cmp r0, 0x2\n\ + beq _0810CAD0\n\ + ldrh r0, [r4, 0x2]\n\ + lsls r0, 20\n\ + lsrs r0, 24\n\ + bl GetBattlerAtPosition\n\ + lsls r0, 24\n\ + lsrs r5, r0, 24\n\ + adds r0, r5, 0\n\ + bl IsBattlerSpriteVisible\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + beq _0810CAD0\n\ + movs r0, 0x1\n\ + str r0, [sp, 0x4]\n\ + adds r0, r5, 0\n\ + movs r1, 0x2\n\ + bl GetBattlerSpriteCoord\n\ + lsls r0, 24\n\ + lsrs r7, r0, 24\n\ + adds r0, r5, 0\n\ + movs r1, 0x3\n\ + bl GetBattlerSpriteCoord\n\ + lsls r0, 24\n\ + lsrs r6, r0, 24\n\ + mov r1, r8\n\ + cmp r1, 0\n\ + beq _0810CA60\n\ + cmp r1, 0x1\n\ + beq _0810CA96\n\ + b _0810CAE2\n\ + .pool\n\ +_0810CA60:\n\ + adds r0, r5, 0\n\ + movs r1, 0x1\n\ + bl sub_80A861C\n\ + lsls r0, 16\n\ + asrs r0, 16\n\ + movs r1, 0x6\n\ + bl __divsi3\n\ + lsls r1, r7, 16\n\ + asrs r1, 16\n\ + subs r1, r0\n\ + lsls r1, 16\n\ + lsrs r7, r1, 16\n\ + adds r0, r5, 0\n\ + movs r1, 0\n\ + bl sub_80A861C\n\ + lsls r0, 16\n\ + asrs r0, 16\n\ + movs r1, 0x6\n\ + bl __divsi3\n\ + lsls r1, r6, 16\n\ + asrs r1, 16\n\ + subs r1, r0\n\ + b _0810CACA\n\ +_0810CA96:\n\ + adds r0, r5, 0\n\ + movs r1, 0x1\n\ + bl sub_80A861C\n\ + lsls r0, 16\n\ + asrs r0, 16\n\ + movs r1, 0x6\n\ + bl __divsi3\n\ + lsls r1, r7, 16\n\ + asrs r1, 16\n\ + adds r1, r0\n\ + lsls r1, 16\n\ + lsrs r7, r1, 16\n\ + adds r0, r5, 0\n\ + movs r1, 0\n\ + bl sub_80A861C\n\ + lsls r0, 16\n\ + asrs r0, 16\n\ + movs r1, 0x6\n\ + bl __divsi3\n\ + lsls r1, r6, 16\n\ + asrs r1, 16\n\ + adds r1, r0\n\ +_0810CACA:\n\ + lsls r1, 16\n\ + lsrs r6, r1, 16\n\ + b _0810CAE2\n\ +_0810CAD0:\n\ + ldrh r0, [r4]\n\ + lsls r0, 22\n\ + asrs r0, 6\n\ + lsrs r7, r0, 16\n\ + ldr r0, [r4]\n\ + lsls r0, 12\n\ + asrs r0, 22\n\ + lsls r0, 16\n\ + lsrs r6, r0, 16\n\ +_0810CAE2:\n\ + lsls r0, r6, 16\n\ + asrs r0, 16\n\ + adds r0, 0x8\n\ + lsrs r1, r0, 31\n\ + adds r0, r1\n\ + asrs r0, 1\n\ + lsls r1, r7, 16\n\ + asrs r1, 16\n\ + subs r1, r0\n\ + ldr r0, =gUnknown_08595D2C\n\ + lsls r1, 16\n\ + asrs r1, 16\n\ + movs r2, 0x8\n\ + negs r2, r2\n\ + movs r3, 0x12\n\ + bl CreateSprite\n\ + lsls r0, 24\n\ + lsrs r5, r0, 24\n\ + cmp r5, 0x40\n\ + beq _0810CB44\n\ + lsls r4, r5, 4\n\ + adds r4, r5\n\ + lsls r4, 2\n\ + ldr r0, =gSprites\n\ + adds r4, r0\n\ + adds r0, r4, 0\n\ + mov r1, r9\n\ + bl StartSpriteAffineAnim\n\ + mov r0, sp\n\ + ldrh r0, [r0, 0x4]\n\ + strh r0, [r4, 0x2E]\n\ + strh r7, [r4, 0x34]\n\ + strh r6, [r4, 0x36]\n\ + mov r1, r9\n\ + strh r1, [r4, 0x38]\n\ + mov r0, sp\n\ + ldrh r0, [r0]\n\ + strh r0, [r4, 0x3A]\n\ + mov r1, r10\n\ + strh r1, [r4, 0x3C]\n\ + movs r0, 0x1\n\ + b _0810CB46\n\ + .pool\n\ +_0810CB44:\n\ + movs r0, 0\n\ +_0810CB46:\n\ + add sp, 0x8\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r1}\n\ + bx r1\n"); +} +#endif + +void AnimHailBegin(struct Sprite *sprite) +{ + u8 spriteId; + + sprite->pos1.x += 4; + sprite->pos1.y += 8; + + if (sprite->pos1.x < sprite->data[3] && sprite->pos1.y < sprite->data[4]) + return; + + if (sprite->data[0] == 1 && sprite->data[5] == 0) + { + spriteId = CreateSprite(&gUnknown_08595B68, + sprite->data[3], sprite->data[4], sprite->subpriority); + + sprite->data[0] = spriteId; + if (spriteId != 64) + { + gSprites[sprite->data[0]].callback = AnimHailContinue; + gSprites[sprite->data[0]].data[6] = sprite->data[6]; + gSprites[sprite->data[0]].data[7] = sprite->data[7]; + } + + FreeOamMatrix(sprite->oam.matrixNum); + DestroySprite(sprite); + } + else + { + gTasks[sprite->data[6]].data[sprite->data[7]]--; + FreeOamMatrix(sprite->oam.matrixNum); + DestroySprite(sprite); + } +} + +void AnimHailContinue(struct Sprite *sprite) +{ + if (++sprite->data[0] == 20) + { + gTasks[sprite->data[6]].data[sprite->data[7]]--; + FreeOamMatrix(sprite->oam.matrixNum); + DestroySprite(sprite); + } +} + +// Initializes the animation for Ice Ball. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: target x offset +// arg 3: target y offset +// arg 4: duration +// arg 5: arc height (negative) +void InitIceBallAnim(struct Sprite *sprite) +{ + u8 animNum = gAnimDisableStructPtr->rolloutTimerStartValue - gAnimDisableStructPtr->rolloutTimer - 1; + + if (animNum > 4) + animNum = 4; + + StartSpriteAffineAnim(sprite, animNum); + InitSpritePosToAnimAttacker(sprite, 1); + + sprite->data[0] = gBattleAnimArgs[4]; + + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + gBattleAnimArgs[2] = -gBattleAnimArgs[2]; + + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[2]; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; + sprite->data[5] = gBattleAnimArgs[5]; + + InitAnimArcTranslation(sprite); + + sprite->callback = AnimThrowIceBall; +} + +// Throws the ball of ice in Ice Ball. +void AnimThrowIceBall(struct Sprite *sprite) +{ + if (!TranslateAnimArc(sprite)) + return; + + StartSpriteAnim(sprite, 1); + sprite->callback = RunStoredCallbackWhenAnimEnds; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); +} + +// Initializes the particles that scatter at the end of the Ice Ball animation. +void InitIceBallParticle(struct Sprite *sprite) +{ + s16 randA, randB; + + sprite->oam.tileNum += 8; + InitSpritePosToAnimTarget(sprite, TRUE); + + randA = (Random2() & 0xFF) + 256; + randB = Random2() & 0x1FF; + + if (randB > 0xFF) + randB = 256 - randB; + + sprite->data[1] = randA; + sprite->data[2] = randB; + sprite->callback = AnimIceBallParticle; +} + +// Animates the particles created by InitIceBallParticle. +void AnimIceBallParticle(struct Sprite *sprite) +{ + sprite->data[3] += sprite->data[1]; + sprite->data[4] += sprite->data[2]; + + if (sprite->data[1] & 1) + sprite->pos2.x = -(sprite->data[3] >> 8); + else + sprite->pos2.x = sprite->data[3] >> 8; + + sprite->pos2.y = sprite->data[4] >> 8; + + if (++sprite->data[0] == 21) + DestroyAnimSprite(sprite); +} + +// Counter for Ice Ball. +void AnimTask_GetRolloutCounter(u8 taskId) +{ + u8 arg = gBattleAnimArgs[0]; + + gBattleAnimArgs[arg] = gAnimDisableStructPtr->rolloutTimerStartValue - gAnimDisableStructPtr->rolloutTimer - 1; + DestroyAnimVisualTask(taskId); +} diff --git a/src/intro.c b/src/intro.c index 94692e6ec..18a899fb0 100644 --- a/src/intro.c +++ b/src/intro.c @@ -1044,10 +1044,10 @@ static void Task_IntroLoadPart1Graphics(u8 taskId) SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(2) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(20) | BGCNT_16COLOR | BGCNT_TXT256x512); SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(1) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(18) | BGCNT_16COLOR | BGCNT_TXT256x512); SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(16) | BGCNT_16COLOR | BGCNT_TXT256x512); - LoadCompressedObjectPic(gUnknown_085E4FDC); - LoadCompressedObjectPic(gUnknown_085E4FEC); + LoadCompressedSpriteSheet(gUnknown_085E4FDC); + LoadCompressedSpriteSheet(gUnknown_085E4FEC); LoadSpritePalettes(gUnknown_085E4FFC); - LoadCompressedObjectPic(gUnknown_085E4A74); + LoadCompressedSpriteSheet(gUnknown_085E4A74); LoadSpritePalettes(gUnknown_085E4A84); CpuCopy16(gPlttBufferUnfaded + 0x100, gPlttBufferUnfaded + 0x1F0, 0x20); CpuCopy16(gPlttBufferUnfaded + 0x100, gPlttBufferUnfaded + 0x1E1, 0x1E); @@ -1204,16 +1204,16 @@ static void Task_IntroStartBikeRide(u8 taskId) u8 spriteId; if (gUnknown_0203BCC8 == 0) - LoadCompressedObjectPic(gIntro2BrendanSpriteSheet); + LoadCompressedSpriteSheet(gIntro2BrendanSpriteSheet); else - LoadCompressedObjectPic(gIntro2MaySpriteSheet); + LoadCompressedSpriteSheet(gIntro2MaySpriteSheet); - LoadCompressedObjectPic(gIntro2BicycleSpriteSheet); - LoadCompressedObjectPic(gIntro2FlygonSpriteSheet); + LoadCompressedSpriteSheet(gIntro2BicycleSpriteSheet); + LoadCompressedSpriteSheet(gIntro2FlygonSpriteSheet); for (spriteId = 0; spriteId < 3; spriteId++) { - LoadCompressedObjectPic(&gUnknown_085E4AE8[spriteId]); + LoadCompressedSpriteSheet(&gUnknown_085E4AE8[spriteId]); } LoadSpritePalettes(gUnknown_085F530C); @@ -1542,8 +1542,8 @@ static void Task_IntroLoadPart1Graphics3(u8 taskId) LZDecompressVram(gIntro3GroudonTilemap, (void *)(VRAM + 0xC000)); LZDecompressVram(gIntro3LegendBgGfx, (void *)(VRAM + 0x4000)); LZDecompressVram(gIntro3GroudonBgTilemap, (void *)(VRAM + 0xE000)); - LoadCompressedObjectPicUsingHeap(&gBattleAnimPicTable[GET_TRUE_SPRITE_INDEX(ANIM_TAG_ROCKS)]); - LoadCompressedObjectPaletteUsingHeap(&gBattleAnimPaletteTable[GET_TRUE_SPRITE_INDEX(ANIM_TAG_ROCKS)]); + LoadCompressedSpriteSheetUsingHeap(&gBattleAnimPicTable[GET_TRUE_SPRITE_INDEX(ANIM_TAG_ROCKS)]); + LoadCompressedSpritePaletteUsingHeap(&gBattleAnimPaletteTable[GET_TRUE_SPRITE_INDEX(ANIM_TAG_ROCKS)]); CpuCopy16(gIntro3BgPal, gPlttBufferUnfaded, sizeof(gIntro3BgPal)); gTasks[taskId].func = Task_IntroLoadPart1Graphics4; } @@ -1764,7 +1764,7 @@ static void Task_IntroLoadPart1Graphics9(u8 taskId) LZDecompressVram(gIntro3KyogreGfx, (void *)VRAM); LZDecompressVram(gIntro3KyogreTilemap, (void *)(VRAM + 0xC000)); LZDecompressVram(gIntro3KyogreBgTilemap, (void *)(VRAM + 0xE000)); - LoadCompressedObjectPic(gUnknown_085E4C88); + LoadCompressedSpriteSheet(gUnknown_085E4C88); LoadSpritePalette(gUnknown_085E4C98); BeginNormalPaletteFade(0xFFFFFFFE, 0, 0x10, 0, RGB_WHITEALPHA); gTasks[taskId].func = Task_IntroFadeIn0; @@ -2092,7 +2092,7 @@ static void Task_IntroFadeIn5(u8 taskId) gTasks[taskId].data[0] = 0; gTasks[taskId].data[6] = 1; gTasks[taskId].data[7] = 0; - LoadCompressedObjectPicUsingHeap(gUnknown_085E4BF4); + LoadCompressedSpriteSheetUsingHeap(gUnknown_085E4BF4); LoadSpritePalettes(gUnknown_085E4C04); } @@ -2169,7 +2169,7 @@ static void Task_IntroFadeIn7(u8 taskId) { u8 newTaskId; - LoadCompressedObjectPic(gUnknown_085E5048); + LoadCompressedSpriteSheet(gUnknown_085E5048); LoadSpritePalettes(gUnknown_085E5058); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP diff --git a/src/intro_credits_graphics.c b/src/intro_credits_graphics.c index 20a360901..d85e58938 100644 --- a/src/intro_credits_graphics.c +++ b/src/intro_credits_graphics.c @@ -341,7 +341,7 @@ void load_intro_part2_graphics(u8 a) LZ77UnCompVram(gUnknown_085F0DBC, (void *)(VRAM)); LZ77UnCompVram(gUnknown_085F1398, (void *)(VRAM + 0x3000)); LoadPalette(&gUnknown_085F0CFC, 0, 96); - LoadCompressedObjectPic(gUnknown_085F5064); + LoadCompressedSpriteSheet(gUnknown_085F5064); LoadPalette(&gUnknown_085F1668, 256, 32); sub_817B76C(); break; @@ -349,7 +349,7 @@ void load_intro_part2_graphics(u8 a) LZ77UnCompVram(gUnknown_085F1824, (void *)(VRAM)); LZ77UnCompVram(gUnknown_085F1EAC, (void *)(VRAM + 0x3000)); LoadPalette(&gUnknown_085F17E4, 0, 32); - LoadCompressedObjectPic(gUnknown_085F50EC); + LoadCompressedSpriteSheet(gUnknown_085F50EC); LoadPalette(&gUnknown_085F21B0, 256, 32); sub_817B788(); break; @@ -447,7 +447,7 @@ void sub_817B1C8(u8 a) LZ77UnCompVram(gUnknown_085F0DBC, (void *)(VRAM)); LZ77UnCompVram(gUnknown_085F1398, (void *)(VRAM + 0x3000)); LoadPalette(&gUnknown_085F0CFC, 0, 96); - LoadCompressedObjectPic(gUnknown_085F5064); + LoadCompressedSpriteSheet(gUnknown_085F5064); LZ77UnCompVram(gUnknown_085F16A8, (void *)(VRAM + 0x10000)); LoadPalette(&gUnknown_085F1668, 256, 32); sub_817B76C(); @@ -457,7 +457,7 @@ void sub_817B1C8(u8 a) LZ77UnCompVram(gUnknown_085F0DBC, (void *)(VRAM)); LZ77UnCompVram(gUnknown_085F1398, (void *)(VRAM + 0x3000)); LoadPalette(&gUnknown_085F0D5C, 0, 96); - LoadCompressedObjectPic(gUnknown_085F5064); + LoadCompressedSpriteSheet(gUnknown_085F5064); LZ77UnCompVram(gUnknown_085F16A8, (void *)(VRAM + 0x10000)); LoadPalette(&gUnknown_085F1688, 256, 32); sub_817B76C(); @@ -468,7 +468,7 @@ void sub_817B1C8(u8 a) LZ77UnCompVram(gUnknown_085F1824, (void *)(VRAM)); LZ77UnCompVram(gUnknown_085F1EAC, (void *)(VRAM + 0x3000)); LoadPalette(&gUnknown_085F1804, 0, 32); - LoadCompressedObjectPic(gUnknown_085F50EC); + LoadCompressedSpriteSheet(gUnknown_085F50EC); LoadPalette(&gUnknown_085F1804, 256, 32); sub_817B788(); break; @@ -477,7 +477,7 @@ void sub_817B1C8(u8 a) LZ77UnCompVram(gUnknown_085F235C, (void *)(VRAM)); LZ77UnCompVram(gUnknown_085F2568, (void *)(VRAM + 0x3000)); LoadPalette(&gUnknown_085F231C, 0, 64); - LoadCompressedObjectPic(gUnknown_085F5180); + LoadCompressedSpriteSheet(gUnknown_085F5180); LoadPalette(&gUnknown_085F2548, 256, 32); sub_817B7A4(); break; diff --git a/src/item_icon.c b/src/item_icon.c index d037782bd..e9379dbba 100644 --- a/src/item_icon.c +++ b/src/item_icon.c @@ -107,7 +107,7 @@ u8 AddItemIconSprite(u16 tilesTag, u16 paletteTag, u16 itemId) spritePalette.data = GetItemIconPicOrPalette(itemId, 1); spritePalette.tag = paletteTag; - LoadCompressedObjectPalette(&spritePalette); + LoadCompressedSpritePalette(&spritePalette); spriteTemplate = Alloc(sizeof(*spriteTemplate)); CpuCopy16(&gItemIconSpriteTemplate, spriteTemplate, sizeof(*spriteTemplate)); @@ -144,7 +144,7 @@ u8 AddCustomItemIconSprite(struct SpriteTemplate *customSpriteTemplate, u16 tile spritePalette.data = GetItemIconPicOrPalette(itemId, 1); spritePalette.tag = paletteTag; - LoadCompressedObjectPalette(&spritePalette); + LoadCompressedSpritePalette(&spritePalette); spriteTemplate = Alloc(sizeof(*spriteTemplate)); CpuCopy16(customSpriteTemplate, spriteTemplate, sizeof(*spriteTemplate)); diff --git a/src/item_menu.c b/src/item_menu.c index 32c42ac31..a220f02ef 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -713,13 +713,13 @@ bool8 load_bag_menu_graphics(void) break; case 3: if (IsWallysBag() == TRUE || gSaveBlock2Ptr->playerGender == MALE) - LoadCompressedObjectPic(&gUnknown_0857FB34); + LoadCompressedSpriteSheet(&gUnknown_0857FB34); else - LoadCompressedObjectPic(&gUnknown_0857FB3C); + LoadCompressedSpriteSheet(&gUnknown_0857FB3C); gUnknown_0203CE54->unk834++; break; case 4: - LoadCompressedObjectPalette(&gUnknown_0857FB44); + LoadCompressedSpritePalette(&gUnknown_0857FB44); gUnknown_0203CE54->unk834++; break; default: @@ -1564,7 +1564,7 @@ void Task_HandleOutOfBattleItemMenuInput(u8 taskId) { if (sub_81221EC() != TRUE) { - s8 cursorPos = GetMenuCursorPos(); + s8 cursorPos = Menu_GetCursorPos(); if (gMain.newKeys & DPAD_UP) { if (cursorPos > 0 && sub_81ACDFC(cursorPos - 2)) diff --git a/src/item_menu_icons.c b/src/item_menu_icons.c index 894574ec9..669195b33 100644 --- a/src/item_menu_icons.c +++ b/src/item_menu_icons.c @@ -583,7 +583,7 @@ static void sub_80D5070(u8 berryId) pal.data = gBerryPicTable[berryId].pal; pal.tag = 0x7544; - LoadCompressedObjectPalette(&pal); + LoadCompressedSpritePalette(&pal); LZDecompressWram(gBerryPicTable[berryId].tiles, &gDecompressionBuffer[0x1000]); sub_80D5018(&gDecompressionBuffer[0x1000], &gDecompressionBuffer[0]); } diff --git a/src/item_use.c b/src/item_use.c index 474b16ae1..f82071a17 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -38,7 +38,7 @@ #include "constants/vars.h" extern void(*gUnknown_0203A0F4)(u8 taskId); -extern void (*gUnknown_03006328)(u8, u16, TaskFunc); +extern void (*gUnknown_03006328)(u8, TaskFunc); extern void unknown_ItemMenu_Confirm(u8 taskId); extern void sub_81C5B14(u8 taskId); extern void ScriptUnfreezeEventObjects(void); @@ -52,7 +52,7 @@ extern u8 BattleFrontier_OutsideEast_EventScript_242CFC[]; extern int sub_80247BC(void); extern struct MapHeader* mapconnection_get_mapheader(struct MapConnection *connection); extern void SetUpItemUseCallback(u8 taskId); -extern void ItemUseCB_Medicine(u8, u16, TaskFunc); +extern void ItemUseCB_Medicine(u8, TaskFunc); extern void bag_menu_yes_no(u8, u8, const struct YesNoFuncTable*); extern void sub_81C5924(void); extern void sub_81C59BC(void); diff --git a/src/lilycove_lady.c b/src/lilycove_lady.c index 1012a8e08..3d4f8a90d 100644 --- a/src/lilycove_lady.c +++ b/src/lilycove_lady.c @@ -5,7 +5,9 @@ #include "global.h" #include "main.h" #include "overworld.h" -#include "rom6.h" +#include "fldeff.h" +#include "field_specials.h" +#include "pokeblock.h" #include "event_data.h" #include "script.h" #include "random.h" diff --git a/src/link_rfu.c b/src/link_rfu.c index 2c6e22475..5f4beadee 100644 --- a/src/link_rfu.c +++ b/src/link_rfu.c @@ -2244,7 +2244,7 @@ void sub_800E0E8(void) { if (GetSpriteTileStartByTag(sWirelessStatusIndicatorSpriteSheet.tag) == 0xFFFF) { - LoadCompressedObjectPic(&sWirelessStatusIndicatorSpriteSheet); + LoadCompressedSpriteSheet(&sWirelessStatusIndicatorSpriteSheet); } LoadSpritePalette(&sWirelessStatusIndicatorSpritePalette); gWirelessStatusIndicatorSpriteId = 0xFF; diff --git a/src/list_menu.c b/src/list_menu.c index caf4b798d..2476fae26 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -1074,7 +1074,7 @@ u8 AddScrollIndicatorArrowPair(const struct ScrollArrowsTemplate *arrowInfo, u16 spriteSheet.data = sRedArrowOtherGfx; spriteSheet.size = 0x100; spriteSheet.tag = arrowInfo->tileTag; - LoadCompressedObjectPic(&spriteSheet); + LoadCompressedSpriteSheet(&spriteSheet); if (arrowInfo->palTag == SPRITE_INVALID_TAG) { @@ -1320,7 +1320,7 @@ static u8 ListMenuAddRedOutlineCursorObject(struct CursorStruct *cursor) spriteSheet.data = sSelectorOutlineGfx; spriteSheet.size = 0x100; spriteSheet.tag = cursor->tileTag; - LoadCompressedObjectPic(&spriteSheet); + LoadCompressedSpriteSheet(&spriteSheet); if (cursor->palTag == SPRITE_INVALID_TAG) { @@ -1405,7 +1405,7 @@ static u8 ListMenuAddRedArrowCursorObject(struct CursorStruct *cursor) spriteSheet.data = sRedArrowGfx; spriteSheet.size = 0x80; spriteSheet.tag = cursor->tileTag; - LoadCompressedObjectPic(&spriteSheet); + LoadCompressedSpriteSheet(&spriteSheet); if (cursor->palTag == SPRITE_INVALID_TAG) { diff --git a/src/load_save.c b/src/load_save.c index 8ecf89959..963626428 100644 --- a/src/load_save.c +++ b/src/load_save.c @@ -3,6 +3,7 @@ #include "load_save.h" #include "main.h" #include "pokemon.h" +#include "pokemon_storage_system.h" #include "random.h" #include "alloc.h" #include "item.h" diff --git a/src/main_menu.c b/src/main_menu.c index e11f783eb..4cd5c8e14 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -1394,7 +1394,7 @@ static void Task_NewGameBirchSpeech_ChooseGender(u8 taskId) gTasks[taskId].func = Task_NewGameBirchSpeech_WhatsYourName; break; } - gender2 = GetMenuCursorPos(); + gender2 = Menu_GetCursorPos(); if (gender2 != gTasks[taskId].tPlayerGender) { gTasks[taskId].tPlayerGender = gender2; diff --git a/src/menu.c b/src/menu.c index 61096138a..e0e5eb4eb 100644 --- a/src/menu.c +++ b/src/menu.c @@ -132,7 +132,7 @@ extern void sub_8197BB4(u8, u8, u8, u8, u8, u8); extern void sub_8197E30(u8, u8, u8, u8, u8, u8); extern void DrawWindowBorder(u8, u8, u8, u8, u8, u8); extern void sub_81980A8(u8, u8, u8, u8, u8, u8); -extern u8 MoveMenuCursor(s8); +extern u8 Menu_MoveCursor(s8); extern u8 sub_8199134(s8, s8); extern void sub_8198C78(void); extern void task_free_buf_after_copying_tile_data_to_vram(u8 taskId); @@ -910,7 +910,7 @@ u8 sub_8198348(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numC else gUnknown_0203CD90.cursorPos = pos; - MoveMenuCursor(0); + Menu_MoveCursor(0); return gUnknown_0203CD90.cursorPos; } @@ -935,7 +935,7 @@ void RedrawMenuCursor(u8 oldPos, u8 newPos) AddTextPrinterParameterized(gUnknown_0203CD90.windowId, gUnknown_0203CD90.fontId, gText_SelectorArrow3, gUnknown_0203CD90.left, gUnknown_0203CD90.optionHeight * newPos + gUnknown_0203CD90.top, 0, 0); } -u8 MoveMenuCursor(s8 cursorDelta) +u8 Menu_MoveCursor(s8 cursorDelta) { u8 oldPos = gUnknown_0203CD90.cursorPos; int newPos = gUnknown_0203CD90.cursorPos + cursorDelta; @@ -951,7 +951,7 @@ u8 MoveMenuCursor(s8 cursorDelta) return gUnknown_0203CD90.cursorPos; } -u8 MoveMenuCursorNoWrapAround(s8 cursorDelta) +u8 Menu_MoveCursorNoWrapAround(s8 cursorDelta) { u8 oldPos = gUnknown_0203CD90.cursorPos; int newPos = gUnknown_0203CD90.cursorPos + cursorDelta; @@ -967,7 +967,7 @@ u8 MoveMenuCursorNoWrapAround(s8 cursorDelta) return gUnknown_0203CD90.cursorPos; } -u8 GetMenuCursorPos(void) +u8 Menu_GetCursorPos(void) { return gUnknown_0203CD90.cursorPos; } @@ -987,13 +987,13 @@ s8 Menu_ProcessInput(void) else if (gMain.newKeys & DPAD_UP) { PlaySE(SE_SELECT); - MoveMenuCursor(-1); + Menu_MoveCursor(-1); return MENU_NOTHING_CHOSEN; } else if (gMain.newKeys & DPAD_DOWN) { PlaySE(SE_SELECT); - MoveMenuCursor(1); + Menu_MoveCursor(1); return MENU_NOTHING_CHOSEN; } @@ -1016,13 +1016,13 @@ s8 Menu_ProcessInputNoWrap(void) } else if (gMain.newKeys & DPAD_UP) { - if (oldPos != MoveMenuCursorNoWrapAround(-1)) + if (oldPos != Menu_MoveCursorNoWrapAround(-1)) PlaySE(SE_SELECT); return MENU_NOTHING_CHOSEN; } else if (gMain.newKeys & DPAD_DOWN) { - if (oldPos != MoveMenuCursorNoWrapAround(1)) + if (oldPos != Menu_MoveCursorNoWrapAround(1)) PlaySE(SE_SELECT); return MENU_NOTHING_CHOSEN; } @@ -1045,13 +1045,13 @@ s8 ProcessMenuInput_other(void) else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP) { PlaySE(SE_SELECT); - MoveMenuCursor(-1); + Menu_MoveCursor(-1); return MENU_NOTHING_CHOSEN; } else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN) { PlaySE(SE_SELECT); - MoveMenuCursor(1); + Menu_MoveCursor(1); return MENU_NOTHING_CHOSEN; } @@ -1074,13 +1074,13 @@ s8 Menu_ProcessInputNoWrapAround_other(void) } else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP) { - if (oldPos != MoveMenuCursorNoWrapAround(-1)) + if (oldPos != Menu_MoveCursorNoWrapAround(-1)) PlaySE(SE_SELECT); return MENU_NOTHING_CHOSEN; } else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN) { - if (oldPos != MoveMenuCursorNoWrapAround(1)) + if (oldPos != Menu_MoveCursorNoWrapAround(1)) PlaySE(SE_SELECT); return MENU_NOTHING_CHOSEN; } @@ -1588,7 +1588,7 @@ u8 InitMenuInUpperLeftCorner(u8 windowId, u8 itemCount, u8 initialCursorPos, boo else gUnknown_0203CD90.cursorPos = pos; - return MoveMenuCursor(0); + return Menu_MoveCursor(0); } u8 InitMenuInUpperLeftCornerPlaySoundWhenAPressed(u8 windowId, u8 itemCount, u8 initialCursorPos) @@ -1797,9 +1797,9 @@ bool8 free_temp_tile_data_buffers_if_possible(void) } } -void *decompress_and_copy_tile_data_to_vram(u8 bgId, const void *src, int size, u16 offset, u8 mode) +void *decompress_and_copy_tile_data_to_vram(u8 bgId, const void *src, u32 size, u16 offset, u8 mode) { - int sizeOut; + u32 sizeOut; if (gUnknown_0203CDA8 < ARRAY_COUNT(gUnknown_0203CDAC)) { void *ptr = malloc_and_decompress(src, &sizeOut); @@ -1815,9 +1815,9 @@ void *decompress_and_copy_tile_data_to_vram(u8 bgId, const void *src, int size, return NULL; } -void DecompressAndLoadBgGfxUsingHeap(u8 bgId, const void *src, int size, u16 offset, u8 mode) +void DecompressAndLoadBgGfxUsingHeap(u8 bgId, const void *src, u32 size, u16 offset, u8 mode) { - int sizeOut; + u32 sizeOut; void *ptr = malloc_and_decompress(src, &sizeOut); if (!size) size = sizeOut; @@ -1838,7 +1838,7 @@ void task_free_buf_after_copying_tile_data_to_vram(u8 taskId) } } -void *malloc_and_decompress(const void *src, int *size) +void *malloc_and_decompress(const void *src, u32 *size) { void *ptr; u8 *sizeAsBytes = (u8 *)size; diff --git a/src/menu_helpers.c b/src/menu_helpers.c index a3c0be36a..0adc6228e 100644 --- a/src/menu_helpers.c +++ b/src/menu_helpers.c @@ -394,8 +394,8 @@ void sub_8122298(u16 *arg0, u16 *arg1, u8 arg2, u8 arg3, u8 arg4) void LoadListMenuArrowsGfx(void) { - LoadCompressedObjectPic(&gUnknown_0859F514); - LoadCompressedObjectPalette(&gUnknown_0859F51C); + LoadCompressedSpriteSheet(&gUnknown_0859F514); + LoadCompressedSpritePalette(&gUnknown_0859F51C); } void sub_8122344(u8 *spriteIds, u8 count) diff --git a/src/mon_markings.c b/src/mon_markings.c index 30015dbef..48f0f5ecb 100644 --- a/src/mon_markings.c +++ b/src/mon_markings.c @@ -390,7 +390,6 @@ void sub_811FAF8(void) } } - bool8 sub_811FBA4(void) { u16 i; diff --git a/src/money.c b/src/money.c index a347f818d..faf830637 100644 --- a/src/money.c +++ b/src/money.c @@ -186,8 +186,8 @@ void HideMoneyBox(void) void AddMoneyLabelObject(u16 x, u16 y) { - LoadCompressedObjectPic(&sSpriteSheet_MoneyLabel); - LoadCompressedObjectPalette(&sSpritePalette_MoneyLabel); + LoadCompressedSpriteSheet(&sSpriteSheet_MoneyLabel); + LoadCompressedSpritePalette(&sSpritePalette_MoneyLabel); sMoneyLabelSpriteId = CreateSprite(&sSpriteTemplate_MoneyLabel, x, y, 0); } diff --git a/src/normal.c b/src/normal.c index e20f74588..95c99d29e 100644 --- a/src/normal.c +++ b/src/normal.c @@ -880,9 +880,9 @@ void sub_8116388(struct Sprite *sprite) { StartSpriteAffineAnim(sprite, gBattleAnimArgs[3]); if (gBattleAnimArgs[2] == 0) - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); else - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->callback = RunStoredCallbackWhenAffineAnimEnds; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); @@ -892,9 +892,9 @@ static void sub_81163D0(struct Sprite *sprite) { StartSpriteAffineAnim(sprite, gBattleAnimArgs[3]); if (gBattleAnimArgs[2] == 0) - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); else - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[4]; sprite->callback = RunStoredCallbackWhenAffineAnimEnds; @@ -916,9 +916,9 @@ void sub_8116458(struct Sprite *sprite) StartSpriteAffineAnim(sprite, gBattleAnimArgs[1]); if (gBattleAnimArgs[0] == 0) - InitAnimSpritePos(sprite, 0); + InitSpritePosToAnimAttacker(sprite, 0); else - sub_80A6980(sprite, FALSE); + InitSpritePosToAnimTarget(sprite, FALSE); sprite->pos2.x += (Random2() % 48) - 24; sprite->pos2.y += (Random2() % 24) - 12; @@ -942,9 +942,9 @@ void sub_81164F0(struct Sprite *sprite) void sub_8116560(struct Sprite *sprite) { if (gBattleAnimArgs[2] == 0) - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); else - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[3]; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); @@ -955,9 +955,9 @@ void sub_81165A8(struct Sprite *sprite) { StartSpriteAffineAnim(sprite, gBattleAnimArgs[3]); if (gBattleAnimArgs[2] == 0) - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); else - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); sprite->callback = sub_81165E4; } diff --git a/src/overworld.c b/src/overworld.c index 6998c9d98..27bd0425a 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1340,7 +1340,7 @@ void UpdateAmbientCry(s16 *state, u16 *delayCounter) monsCount = CalculatePlayerPartyCount(); for (i = 0; i < monsCount; i++) { - if (!GetMonData(&gPlayerParty[i], MON_DATA_SANITY_BIT3) + if (!GetMonData(&gPlayerParty[i], MON_DATA_SANITY_IS_EGG) && GetMonAbility(&gPlayerParty[0]) == ABILITY_SWARM) { divBy = 2; diff --git a/src/party_menu.c b/src/party_menu.c new file mode 100755 index 000000000..f8e312217 --- /dev/null +++ b/src/party_menu.c @@ -0,0 +1,7434 @@ +#include "global.h" +#include "alloc.h" +#include "battle.h" +#include "battle_anim.h" +#include "battle_controllers.h" +#include "battle_gfx_sfx_util.h" +#include "battle_interface.h" +#include "battle_pike.h" +#include "battle_pyramid.h" +#include "battle_pyramid_bag.h" +#include "bg.h" +#include "contest.h" +#include "data2.h" +#include "decompress.h" +#include "easy_chat.h" +#include "event_data.h" +#include "evolution_scene.h" +#include "field_control_avatar.h" +#include "field_effect.h" +#include "field_player_avatar.h" +#include "field_screen_effect.h" +#include "field_specials.h" +#include "field_weather.h" +#include "fieldmap.h" +#include "fldeff.h" +#include "fldeff_misc.h" +#include "frontier_util.h" +#include "gpu_regs.h" +#include "graphics.h" +#include "international_string_util.h" +#include "item.h" +#include "item_menu.h" +#include "item_use.h" +#include "link.h" +#include "link_rfu.h" +#include "mail.h" +#include "main.h" +#include "menu.h" +#include "menu_helpers.h" +#include "metatile_behavior.h" +#include "overworld.h" +#include "palette.h" +#include "party_menu.h" +#include "pokemon.h" +#include "pokemon_icon.h" +#include "pokemon_storage_system.h" +#include "pokemon_summary_screen.h" +#include "pokenav.h" +#include "region_map.h" +#include "reshow_battle_screen.h" +#include "rom_8011DC0.h" +#include "scanline_effect.h" +#include "script.h" +#include "sound.h" +#include "sprite.h" +#include "start_menu.h" +#include "string_util.h" +#include "strings.h" +#include "task.h" +#include "text.h" +#include "text_window.h" +#include "trade.h" +#include "window.h" +#include "constants/battle.h" +#include "constants/battle_frontier.h" +#include "constants/field_effects.h" +#include "constants/flags.h" +#include "constants/items.h" +#include "constants/maps.h" +#include "constants/moves.h" +#include "constants/rgb.h" +#include "constants/songs.h" +#include "constants/species.h" +#include "constants/vars.h" + +enum +{ + CAN_LEARN_MOVE, + CANNOT_LEARN_MOVE, + ALREADY_KNOWS_MOVE, + CANNOT_LEARN_MOVE_IS_EGG +}; + +struct Unk_Rodata1 +{ + void (*unk0)(u8, u8, u8, u8, u8, u8); + u8 unk4[24]; + u8 unk1C; + u8 unk1D; + u8 unk1E; + u8 unk1F; +}; + +struct Struct203CEC4 +{ + TaskFunc unk0; + MainCallback exitCallback; + u32 unk8_0:1; + u32 unk8_1:3; + u32 unk8_2:7; + u32 unk9_0:7; + u32 unkA_0:14; + u8 unkC[3]; + u8 unkF[8]; + u8 unk17; + u16 palBuffer[0xB0]; + u8 filler[0xA0]; + s16 data[16]; +}; + +struct Struct203CEDC +{ + const struct Unk_Rodata1 *unk0; + const u8 *unk4; + u8 windowId; + u8 unk9; + u8 unkA; + u8 unkB; + u8 unkC; +}; + +static EWRAM_DATA struct Struct203CEC4 *gUnknown_0203CEC4 = NULL; +EWRAM_DATA struct Struct203CEC8 gUnknown_0203CEC8 = {0}; +static EWRAM_DATA struct Struct203CEDC *gUnknown_0203CEDC = NULL; +static EWRAM_DATA u8 *gUnknown_0203CEE0 = NULL; +static EWRAM_DATA u8 *gUnknown_0203CEE4 = NULL; +EWRAM_DATA u8 gUnknown_0203CEE8 = 0; +EWRAM_DATA u8 gUnknown_0203CEE9 = 0; +EWRAM_DATA MainCallback gPostMenuFieldCallback = NULL; +static EWRAM_DATA u16 *gUnknown_0203CEF0 = 0; +static EWRAM_DATA u16 *gUnknown_0203CEF4 = 0; +EWRAM_DATA u8 gSelectedOrderFromParty[4] = {0}; +static EWRAM_DATA u16 gUnknown_0203CEFC = 0; +static EWRAM_DATA u16 gUnknown_0203CEFE = 0; // unused +EWRAM_DATA u8 gUnknown_0203CF00[3] = {0}; + +extern void (*gUnknown_03006328)(u8, TaskFunc); + +static void reset_brm(void); +static void PartyMenuInitCallback(void); +static bool8 PartyMenuSetup(void); +static void sub_81B209C(void); +static void PartyMenuExit(void); +static bool8 AllocPartyMenuBg(void); +static bool8 AllocPartyMiscGfx(void); +static void sub_81B239C(u8); +static void PartyMenuInitHelperStructs(u8); +static void LoadPartyMenuPokeballGfx(void); +static void LoadPartyMenuAilmentGfx(void); +static bool8 party_menu_add_per_mon_objects(void); +static bool8 RenderPartyMenuBoxes(void); +static void sub_81B0F28(void); +static void sub_81B2428(u8); +static void PartyMenuExitTask(u8); +static void FreePartyPointers(void); +static void PartyPaletteBufferCopy(u8); +static void sub_81B0CEC(u8); +static void UpdateSelectedPartyBox(struct Struct203CEDC *, u8); +static void sub_81B2720(u8); +static void DisplayPartyPokemonSelectForRelearner(u8); +static void DisplayPartyPokemonSelectForContest(u8); +static void DisplayPartyPokemonSelectForBattle(u8); +static void sub_81B0B98(u8); +static void DisplayPartyPokemonSelectHeldItemRelated(u8); +static bool8 sub_81B0BFC(u8); +static void DisplayPartyPokemonData(u8); +static void DisplayPartyPokemonNickname(struct Pokemon *, struct Struct203CEDC *, u8); +static void DisplayPartyPokemonLevelCheck(struct Pokemon *, struct Struct203CEDC *, u8); +static void DisplayPartyPokemonGenderNidoranCheck(struct Pokemon *, struct Struct203CEDC *, u8); +static void DisplayPartyPokemonHPCheck(struct Pokemon *, struct Struct203CEDC *, u8); +static void DisplayPartyPokemonMaxHPCheck(struct Pokemon *, struct Struct203CEDC *, u8); +static void DisplayPartyPokemonHPBarCheck(struct Pokemon *, struct Struct203CEDC *); +static void DisplayPartyPokemonOtherText(u8, struct Struct203CEDC *, u8); +static u8 sub_81B8830(void); +static bool8 GetBattleEntryEligibility(struct Pokemon *); +static bool8 sub_81B218C(u8); +static void DisplayPartyPokemonSelectToTeachMove(u8, u16, u8); +static u8 CanMonLearnTMTutor(struct Pokemon *, u16, u8); +static void DisplayPartyPokemonBarDetail(u8, const u8*, u8, const u8*); +static void DisplayPartyPokemonLevel(u8, struct Struct203CEDC *); +static void DisplayPartyPokemonGender(u8, u16, u8*, struct Struct203CEDC *); +static void DisplayPartyPokemonHP(u16, struct Struct203CEDC *); +static void DisplayPartyPokemonMaxHP(u16, struct Struct203CEDC *); +static void DisplayPartyPokemonHPBar(u16, u16, struct Struct203CEDC *); +static void party_menu_link_mon_icon_anim(u16, u32, struct Struct203CEDC *, u8, u32); +static void party_menu_link_mon_held_item_object(u16, u16, struct Struct203CEDC *); +static void party_menu_link_mon_pokeball_object(u16, struct Struct203CEDC *); +static void party_menu_link_mon_status_condition_object(u16, u8, struct Struct203CEDC *); +static void party_menu_held_item_object(struct Pokemon *, struct Struct203CEDC *); +static void party_menu_pokeball_object(struct Pokemon *, struct Struct203CEDC *); +static void party_menu_icon_anim(struct Pokemon *, struct Struct203CEDC *, u32); +static void party_menu_status_condition_object(struct Pokemon *, struct Struct203CEDC *); +static u8 sub_81B5F74(u8, u8); +static void sub_81B120C(void); +static u8 sub_81B5F34(u8, u8); +static void AnimateSelectedPartyIcon(u8, u8); +static void sub_81B5F98(u8, u8); +static u8 GetPartyBoxPalBitfield(u8, u8); +static bool8 PartyBoxPal_ParnterOrDisqualifiedInArena(u8); +static u8 sub_81B8F38(u8); +static void c3_0811FAB4(u8); +static void sub_81B9080(void); +static void sub_81B4F88(void); +static void sub_81B15D0(u8, s8*); +static void sub_81B140C(u8, s8*); +static u16 PartyMenuButtonHandler(s8*); +static s8* sub_81B13EC(void); +static bool8 sub_81B15A4(u8*); +static void sub_81B302C(u8*); +static void sub_81B9140(void); +static void sub_81B6794(u8); +static void sub_81B7E4C(u8); +static void sub_81B8474(u8); +static void sub_81B7FAC(u8); +static void sub_81B3938(u8); +static void sub_81B21AC(u8, u8); +static void sub_81B36FC(u8); +static void sub_81B407C(u8); +static void sub_81B2210(u8); +static bool8 sub_81B1660(u8); +static const u8* sub_81B88BC(void); +static void sub_81B16D4(u8); +static void sub_81B334C(void); +static void sub_81B1708(u8); +static void sub_81B1C1C(u8); +static void UpdateCurrentPartySelection(s8*, s8); +static void SetNewPartySelectTarget1(s8*, s8); +static void SetNewPartySelectTarget2(s8*, s8); +static s8 sub_81B1B00(s8, s8); +static void sub_81B3300(const u8*); +static void sub_81B1B8C(u8); +static void DisplayPartyPokemonHPCheck(struct Pokemon*, struct Struct203CEDC*, u8); +static void DisplayPartyPokemonHPBarCheck(struct Pokemon*, struct Struct203CEDC*); +static bool16 sub_81B2134(struct Pokemon*); +static bool16 sub_81B2164(struct Pokemon*); +static void sub_81B2248(u8); +static void sub_81B227C(u8); +static bool8 CanLearnTutorMove(u16, u8); +static u16 GetTutorMove(u8); +static bool8 sub_81B314C(void); +static void sub_81B3414(struct Pokemon*, u8); +static u8 sub_81B8A2C(struct Pokemon*); +static u8 sub_81B856C(s8); +static void sub_81B469C(u8); +static void HandleMenuInput(u8); +static void sub_81B3828(void); +static void pokemon_change_order(void); +static void sub_81B3894(void); +static void sub_81B3CC0(u8); +static void sub_81B3D48(u8); +static void swap_pokemon_and_oams(void); +static void sub_81B3E60(u8); +static void sub_81B41C4(void); +static void c2_8123744(void); +static void sub_81B452C(void); +static void sub_81B4350(u8); +static void sub_81B42D0(u8); +static void sub_81B43A8(u8); +static void sub_81B43DC(u8); +static void sub_81B44FC(u8); +static void sub_81B4578(void); +static void sub_81B4624(u8); +static void sub_81B5C94(struct Pokemon*, struct Struct203CEDC*); +static void sub_81B48A8(u8); +static void sub_81B48DC(u8); +static void sub_81B4988(u8); +static void sub_81B4A98(void); +static void sub_81B4AE0(void); +static void sub_81B4B6C(u8); +static void sub_81B4BA0(u8); +static void sub_81B4C60(u8); +static void sub_81B4C94(u8); +static bool8 sub_81B8A7C(void); +static void sub_81B53FC(u8); +static void sub_81B5430(u8); +static void task_brm_cancel_1_on_keypad_a_or_b(u8); +static void sub_81B5674(u8); +static void sub_81B57DC(void); +static void sub_81B5864(void); +static void sub_81B56A4(u8); +static void sub_81B56D8(u8); +static void task_launch_hm_phase_2(u8); +static u16 brm_get_selected_species(void); +static void sub_81B5B38(u8, struct Pokemon*); +static void UpdatePartyMonIconFrame(struct Sprite*); +static void UpdatePartyMonIconFrameAndBounce(struct Sprite*); +static void sub_81B5CB0(u16, struct Struct203CEDC*); +static void sub_81B5DF0(u8, u8); +static void sub_81B5E74(struct Sprite*); +static void party_menu_get_status_condition_and_update_object(struct Pokemon*, struct Struct203CEDC*); +static void party_menu_update_status_condition_object(u8, struct Struct203CEDC*); +static u8 sub_81B8984(void); +static void sub_81B6280(u8); +static void c2_815ABFC(void); +static void sub_81B672C(u8); +static u16 sub_81B691C(struct Pokemon*, u8); +static void option_menu_get_string(u8, u8*); +static void sub_81B6BB4(u8); +static void ether_effect_related_2(u8); +static void ether_effect_related(u8); +static void sub_81B6EB4(u8); +static void sub_81B6FF4(u8); +static void sub_81B6F60(u8); +static void sub_81B6F98(u8); +static void sub_81B77AC(u8); +static void sub_81B7028(u8); +static void sub_81B7088(u8); +static void sub_81B7230(u8); +static void sub_81B70B8(void); +static void sub_81B70F0(void); +static void sub_81B711C(u8); +static void sub_81B7154(u8); +static void sub_81B71D4(u8); +static void sub_81B7294(u8); +static void sub_81B72C8(u8); +static void sub_81B73E4(u8); +static void sub_81B79A0(struct Pokemon*, s16*); +static void sub_81B754C(u8, struct Pokemon*); +static void sub_81B75D4(u8); +static void sub_81B767C(u8); +static void sub_81B7634(u8); +static void sub_81B76C8(u8); +static void sub_81B7704(u8); +static void sub_81B7810(u8); +static void sub_81B787C(u8); +static void sub_81B7910(u8, u16); +static void sub_81B7A28(u8); +static void task_sacred_ash_party_loop(u8); +static void sub_81B7C10(u8); +static void sub_81B8044(u8); +static void sub_81B83B8(u8); +static void sub_81B82A0(u8); +static void sub_81B83F0(u16); +static void sub_81B814C(void); +static void sub_81B8088(u8); +static void sub_81B8104(u8); +static void sub_81B81A8(void); +static bool8 sub_81B841C(u16); +static void sub_81B8230(u8); +static void sub_81B82D4(u8); +static void sub_81B879C(u8); +static bool8 GetBattleEntryEligibility(struct Pokemon*); +static bool8 sub_81B8770(u8); +static u8 sub_81B8888(void); +static u8 sub_81B885C(void); +static void sub_81B87E8(u8); +static void sub_81B8C88(u8*, bool8); +static void sub_81B8D88(u8*, u8, u8); +static void sub_81B917C(u8); +static void sub_81B91B4(u8); +static void sub_81B9294(u8); +static void sub_81B9240(u8); +static void sub_81B9390(void); +static void task_hm_without_phase_2(u8); +static void sub_81B9424(u8); +static void sub_81B9470(void); +static void sub_81B94D0(u8); +static void sub_81B953C(u8); +static void sub_81B9588(void); +static void sub_81B9640(u8); +static void sub_81B97DC(struct Pokemon*, u8, u8); +static void BlitBitmapToPartyWindow_Default1(u8 windowId, u8 x, u8 y, u8 width, u8 height, u8 f); +static void BlitBitmapToPartyWindow_Default2(u8 windowId, u8 x, u8 y, u8 width, u8 height, u8 f); +static void CursorCb_Summary(u8 taskId); +static void CursorCb_Switch(u8 taskId); +static void CursorCb_Cancel1(u8 taskId); +static void CursorCb_Item(u8 taskId); +static void CursorCb_Give(u8 taskId); +static void CursorCb_TakeItem(u8 taskId); +static void CursorCb_Mail(u8 taskId); +static void CursorCb_Read(u8 taskId); +static void CursorCb_TakeMail(u8 taskId); +static void CursorCb_Cancel2(u8 taskId); +static void CursorCb_SendMon(u8 taskId); +static void CursorCb_Enter(u8 taskId); +static void CursorCb_NoEntry(u8 taskId); +static void CursorCb_Store(u8 taskId); +static void CursorCb_Register(u8 taskId); +static void CursorCb_Trade1(u8 taskId); +static void CursorCb_Trade2(u8 taskId); +static void CursorCb_Toss(u8 taskId); +static void CursorCb_FieldMove(u8 taskId); +static bool8 SetUpFieldMove_Surf(void); +static bool8 SetUpFieldMove_Fly(void); +static bool8 SetUpFieldMove_Waterfall(void); +static bool8 SetUpFieldMove_Dive(void); + +// static const data +#include "data/pokemon/tutor_learnsets.h" + +static const struct BgTemplate gUnknown_086156B8[] = +{ + { + .bg = 0, + .charBaseIndex = 0, + .mapBaseIndex = 31, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 1, + .charBaseIndex = 0, + .mapBaseIndex = 30, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 0, + .mapBaseIndex = 28, + .screenSize = 1, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, +}; + +static const struct Unk_Rodata1 gUnknown_086156C4[] = +{ + {BlitBitmapToPartyWindow_Default1, {0x18, 0xB, 0x28, 0xD, 0x20, 0x14, 0x20, 8, 0x40, 0x14, 8, 8, 0x26, 0x25, 0x18, 8, 0x35, 0x25, 0x18, 8, 0x18, 0x23, 0x30, 3}, 0xC, 0x22, 0x40, 0x10}, + {BlitBitmapToPartyWindow_Default2, {0x16, 3, 0x28, 0xD, 0x1E, 0xC, 0x20, 8, 0x3E, 0xC, 8, 8, 0x66, 0xC, 0x18, 8, 0x75, 0xC, 0x18, 8, 0x58, 0xA, 0x30, 3}, 0x4D, 4, 0x40, 0x10}, +}; + +static const u8 gUnknown_08615704[][6][8] = +{ + { + {16, 40, 20, 50, 50, 52, 16, 34}, + {104, 18, 108, 28, 136, 27, 102, 25}, + {104, 42, 108, 52, 136, 51, 102, 49}, + {104, 66, 108, 76, 136, 75, 102, 73}, + {104, 90, 108, 100, 136, 99, 102, 97}, + {104, 114, 108, 124, 136, 123, 102, 121}, + }, + { + {16, 24, 20, 34, 50, 36, 16, 18}, + {16, 80, 20, 90, 50, 92, 16, 74}, + {104, 18, 108, 28, 136, 27, 102, 25}, + {104, 50, 108, 60, 136, 59, 102, 57}, + {104, 82, 108, 92, 136, 91, 102, 89}, + {104, 114, 108, 124, 136, 123, 102, 121}, + }, + { + {16, 24, 20, 34, 50, 36, 16, 18}, + {16, 80, 20, 90, 50, 92, 16, 74}, + {104, 26, 106, 36, 136, 35, 102, 33}, + {104, 50, 106, 60, 136, 59, 102, 57}, + {104, 82, 106, 92, 136, 91, 102, 89}, + {104, 106, 106, 116, 136, 115, 102, 113}, + }, + { + {16, 32, 20, 42, 50, 44, 16, 26}, + {104, 34, 106, 44, 136, 43, 102, 41}, + {104, 58, 106, 68, 136, 67, 102, 65}, + {16, 104, 20, 114, 50, 116, 16, 98}, + {104, 106, 106, 116, 136, 115, 102, 113}, + {104, 130, 106, 140, 136, 139, 102, 137}, + }, +}; + +static const u32 gUnknown_086157C4[] = INCBIN_U32("graphics/interface/unknown_6157C4.bin"); +static const u32 gUnknown_086157E0[] = INCBIN_U32("graphics/interface/unknown_6157E0.bin"); + +static const u8 gUnknown_086157FC[][3] = +{ + {0, 3, 2}, + {0, 1, 6}, + {0, 11, 12}, + {1, 2, 3}, + {1, 8, 9}, + {0, 1, 2}, +}; + +static const struct WindowTemplate gUnknown_08615810[] = +{ + { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 3, + .width = 10, + .height = 7, + .paletteNum = 3, + .baseBlock = 0x63, + }, + { + .bg = 0, + .tilemapLeft = 12, + .tilemapTop = 1, + .width = 18, + .height = 3, + .paletteNum = 4, + .baseBlock = 0xA9, + }, + { + .bg = 0, + .tilemapLeft = 12, + .tilemapTop = 4, + .width = 18, + .height = 3, + .paletteNum = 5, + .baseBlock = 0xDF, + }, + { + .bg = 0, + .tilemapLeft = 12, + .tilemapTop = 7, + .width = 18, + .height = 3, + .paletteNum = 6, + .baseBlock = 0x115, + }, + { + .bg = 0, + .tilemapLeft = 12, + .tilemapTop = 10, + .width = 18, + .height = 3, + .paletteNum = 7, + .baseBlock = 0x14B, + }, + { + .bg = 0, + .tilemapLeft = 12, + .tilemapTop = 13, + .width = 18, + .height = 3, + .paletteNum = 8, + .baseBlock = 0x181, + }, + { + .bg = 2, + .tilemapLeft = 1, + .tilemapTop = 15, + .width = 28, + .height = 4, + .paletteNum = 14, + .baseBlock = 0x1DF, + }, + DUMMY_WIN_TEMPLATE +}; + +static const struct WindowTemplate gUnknown_08615850[] = +{ + { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = 10, + .height = 7, + .paletteNum = 3, + .baseBlock = 0x63, + }, + { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 8, + .width = 10, + .height = 7, + .paletteNum = 4, + .baseBlock = 0xA9, + }, + { + .bg = 0, + .tilemapLeft = 12, + .tilemapTop = 1, + .width = 18, + .height = 3, + .paletteNum = 5, + .baseBlock = 0xEF, + }, + { + .bg = 0, + .tilemapLeft = 12, + .tilemapTop = 5, + .width = 18, + .height = 3, + .paletteNum = 6, + .baseBlock = 0x125, + }, + { + .bg = 0, + .tilemapLeft = 12, + .tilemapTop = 9, + .width = 18, + .height = 3, + .paletteNum = 7, + .baseBlock = 0x15B, + }, + { + .bg = 0, + .tilemapLeft = 12, + .tilemapTop = 13, + .width = 18, + .height = 3, + .paletteNum = 8, + .baseBlock = 0x191, + }, + { + .bg = 2, + .tilemapLeft = 1, + .tilemapTop = 15, + .width = 28, + .height = 4, + .paletteNum = 14, + .baseBlock = 0x1DF, + }, + DUMMY_WIN_TEMPLATE +}; + +static const struct WindowTemplate gUnknown_08615890[] = +{ + { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = 10, + .height = 7, + .paletteNum = 3, + .baseBlock = 0x63, + }, + { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 8, + .width = 10, + .height = 7, + .paletteNum = 4, + .baseBlock = 0xA9, + }, + { + .bg = 0, + .tilemapLeft = 12, + .tilemapTop = 2, + .width = 18, + .height = 3, + .paletteNum = 5, + .baseBlock = 0xEF, + }, + { + .bg = 0, + .tilemapLeft = 12, + .tilemapTop = 5, + .width = 18, + .height = 3, + .paletteNum = 6, + .baseBlock = 0x125, + }, + { + .bg = 0, + .tilemapLeft = 12, + .tilemapTop = 9, + .width = 18, + .height = 3, + .paletteNum = 7, + .baseBlock = 0x15B, + }, + { + .bg = 0, + .tilemapLeft = 12, + .tilemapTop = 12, + .width = 18, + .height = 3, + .paletteNum = 8, + .baseBlock = 0x191, + }, + { + .bg = 2, + .tilemapLeft = 1, + .tilemapTop = 15, + .width = 28, + .height = 4, + .paletteNum = 14, + .baseBlock = 0x1DF, + }, + DUMMY_WIN_TEMPLATE +}; + +static const struct WindowTemplate gUnknown_086158D0[] = +{ + { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 2, + .width = 10, + .height = 7, + .paletteNum = 3, + .baseBlock = 0x63, + }, + { + .bg = 0, + .tilemapLeft = 12, + .tilemapTop = 3, + .width = 18, + .height = 3, + .paletteNum = 5, + .baseBlock = 0xA9, + }, + { + .bg = 0, + .tilemapLeft = 12, + .tilemapTop = 6, + .width = 18, + .height = 3, + .paletteNum = 6, + .baseBlock = 0xDF, + }, + { + .bg = 2, + .tilemapLeft = 1, + .tilemapTop = 11, + .width = 10, + .height = 7, + .paletteNum = 4, + .baseBlock = 0x115, + }, + { + .bg = 2, + .tilemapLeft = 12, + .tilemapTop = 12, + .width = 18, + .height = 3, + .paletteNum = 7, + .baseBlock = 0x16B, + }, + { + .bg = 2, + .tilemapLeft = 12, + .tilemapTop = 15, + .width = 18, + .height = 3, + .paletteNum = 8, + .baseBlock = 0x1A1, + }, + DUMMY_WIN_TEMPLATE +}; + +static const struct WindowTemplate gUnknown_08615908 = +{ + .bg = 0, + .tilemapLeft = 24, + .tilemapTop = 17, + .width = 6, + .height = 2, + .paletteNum = 3, + .baseBlock = 0x1C7, +}; + +static const struct WindowTemplate gUnknown_08615910 = +{ + .bg = 0, + .tilemapLeft = 24, + .tilemapTop = 18, + .width = 6, + .height = 2, + .paletteNum = 3, + .baseBlock = 0x1C7, +}; + +static const struct WindowTemplate gUnknown_08615918 = +{ + .bg = 0, + .tilemapLeft = 24, + .tilemapTop = 16, + .width = 6, + .height = 2, + .paletteNum = 3, + .baseBlock = 0x1D3, +}; + +static const struct WindowTemplate gUnknown_08615920 = +{ + .bg = 2, + .tilemapLeft = 1, + .tilemapTop = 17, + .width = 21, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x24F, +}; + +static const struct WindowTemplate gUnknown_08615928 = +{ + .bg = 2, + .tilemapLeft = 1, + .tilemapTop = 17, + .width = 16, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x279, +}; + +static const struct WindowTemplate gUnknown_08615930 = +{ + .bg = 2, + .tilemapLeft = 1, + .tilemapTop = 17, + .width = 20, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x299, +}; + +static const struct WindowTemplate gUnknown_08615938 = +{ + .bg = 2, + .tilemapLeft = 1, + .tilemapTop = 17, + .width = 18, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x299, +}; + +static const struct WindowTemplate gUnknown_08615940 = +{ + .bg = 2, + .tilemapLeft = 1, + .tilemapTop = 17, + .width = 16, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x299, +}; + +static const struct WindowTemplate gUnknown_08615948 = +{ + .bg = 2, + .tilemapLeft = 1, + .tilemapTop = 15, + .width = 20, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x299, +}; + +static const struct WindowTemplate gUnknown_08615950 = +{ + .bg = 2, + .tilemapLeft = 23, + .tilemapTop = 13, + .width = 6, + .height = 6, + .paletteNum = 14, + .baseBlock = 0x39D, +}; + +static const struct WindowTemplate gUnknown_08615958 = +{ + .bg = 2, + .tilemapLeft = 21, + .tilemapTop = 13, + .width = 8, + .height = 6, + .paletteNum = 14, + .baseBlock = 0x39D, +}; + +static const struct WindowTemplate gUnknown_08615960 = +{ + .bg = 2, + .tilemapLeft = 19, + .tilemapTop = 11, + .width = 10, + .height = 8, + .paletteNum = 14, + .baseBlock = 0x2E9, +}; + +static const struct WindowTemplate gUnknown_08615968 = +{ + .bg = 2, + .tilemapLeft = 21, + .tilemapTop = 9, + .width = 5, + .height = 4, + .paletteNum = 14, + .baseBlock = 0x2E9, +}; + +static const struct WindowTemplate gUnknown_08615970 = +{ + .bg = 2, + .tilemapLeft = 19, + .tilemapTop = 1, + .width = 10, + .height = 11, + .paletteNum = 14, + .baseBlock = 0x2E9, +}; + +// Unused. +static const struct WindowTemplate gUnknown_08615978 = +{ + .bg = 2, + .tilemapLeft = 2, + .tilemapTop = 15, + .width = 27, + .height = 4, + .paletteNum = 14, + .baseBlock = 0x1DF, +}; + +// Unused. +static const struct WindowTemplate gUnknown_08615980 = +{ + .bg = 2, + .tilemapLeft = 0, + .tilemapTop = 13, + .width = 18, + .height = 3, + .paletteNum = 12, + .baseBlock = 0x39D, +}; + +static const u8 gUnknown_08615988[] = {24, 25, 25, 25, 25, 25, 25, 25, 25, 26, 32, 33, 33, 33, 33, 33, 33, 33, 33, 34, 32, 33, 33, 33, 33, 33, 33, 33, 33, 34, 32, 33, 33, 33, 33, 33, 33, 33, 33, 34, 40, 59, 60, 58, 58, 58, 58, 58, 58, 61, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 46, 47, 47, 47, 47, 47, 47, 47, 47, 48}; +static const u8 gUnknown_086159CE[] = {24, 25, 25, 25, 25, 25, 25, 25, 25, 26, 32, 33, 33, 33, 33, 33, 33, 33, 33, 34, 32, 33, 33, 33, 33, 33, 33, 33, 33, 34, 32, 33, 33, 33, 33, 33, 33, 33, 33, 34, 40, 41, 41, 41, 41, 41, 41, 41, 41, 42, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 46, 47, 47, 47, 47, 47, 47, 47, 47, 48}; +static const u8 gUnknown_08615A14[] = {43, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 49, 33, 33, 33, 33, 33, 33, 33, 33, 52, 53, 51, 51, 51, 51, 51, 51, 54, 55, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 57}; +static const u8 gUnknown_08615A4A[] = {43, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 49, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 50, 55, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 57}; +static const u8 gUnknown_08615A80[] = {21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 37, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 39}; +static const u8 gUnknown_08615AB6[] = {11, 12}; +static const u8 gUnknown_08615AB8[] = {9, 10}; +static const u8 gUnknown_08615ABA[] = {4, 5, 6}; +static const u8 gUnknown_08615ABD[] = {1, 7, 8}; +static const u8 gUnknown_08615AC0[] = {1, 11, 12}; +static const u8 gUnknown_08615AC3[] = {59, 60}; +static const u8 gUnknown_08615AC5[] = {75, 76}; +static const u8 gUnknown_08615AC7[] = {57, 58}; +static const u8 gUnknown_08615AC9[] = {73, 74}; +static const u8 gUnknown_08615ACB[] = {89, 90}; +static const u8 gUnknown_08615ACD[] = {52, 53, 54}; +static const u8 gUnknown_08615AD0[] = {68, 69, 70}; +static const u8 gUnknown_08615AD3[] = {84, 85, 86}; +static const u8 gUnknown_08615AD6[] = {116, 117, 118}; +static const u8 gUnknown_08615AD9[] = {132, 133, 134}; +static const u8 gUnknown_08615ADC[] = {148, 149, 150}; +static const u8 gUnknown_08615ADF[] = {100, 101, 102}; +static const u8 gUnknown_08615AE2[] = {49, 55, 56}; +static const u8 gUnknown_08615AE5[] = {65, 71, 72}; +static const u8 gUnknown_08615AE8[] = {81, 87, 88}; +static const u8 gUnknown_08615AEB[] = {97, 103, 104}; +static const u8 gUnknown_08615AEE[] = {161, 167, 168}; +static const u8 gUnknown_08615AF1[] = {17, 27, 28}; + +static const u8 *const gUnknown_08615AF4[] = +{ + gUnknown_085E9E43, + gUnknown_085EA010, + gUnknown_085EA02A, + gUnknown_085E9E55, + gUnknown_085E9E64, + gUnknown_085E9E79, + gUnknown_085E9E8F, + gUnknown_085E9EBC, + gUnknown_085E9ED4, + gUnknown_085E9EE9, + gUnknown_085E9FDB, + gUnknown_085EA046, + gUnknown_085EA05B, + gUnknown_085E9F01, + gUnknown_085E9F58, + gUnknown_085E9F6F, + gUnknown_085E9F81, + gUnknown_085E9F90, + gUnknown_085E9FA7, + gUnknown_085E9FC2, + gText_EmptyString2, + gUnknown_085E9EA6, + gUnknown_085E9F16, + gUnknown_085E9F2A, + gUnknown_085E9F42, + gUnknown_085E9FF9, + gUnknown_085EA073, +}; + +static const u8 *const gUnknown_08615B60[] = +{ + gUnknown_085EA091, + gUnknown_085EA099, + gUnknown_085EA09E, + gUnknown_085EA0A4, + gUnknown_085EA0AB, + gUnknown_085EA0E7, + gUnknown_085EA0B1, + gUnknown_085EA0B6, + gUnknown_085EA0BF, + gUnknown_085EA0C5, + gUnknown_085EA0CF, + gUnknown_085EA0D7, + gUnknown_085EA0DC, +}; + +// Unknown unused data. Feel free to remove. +static const u16 gUnknown_08615B94[] = +{ + 0x0108, 0x0151, 0x0160, 0x015b, 0x002e, 0x005c, 0x0102, 0x0153, 0x014b, 0x00ed, 0x00f1, 0x010d, 0x003a, 0x003b, 0x003f, 0x0071, + 0x00b6, 0x00f0, 0x00ca, 0x00db, 0x00da, 0x004c, 0x00e7, 0x0055, 0x0057, 0x0059, 0x00d8, 0x005b, 0x005e, 0x00f7, 0x0118, 0x0068, + 0x0073, 0x015f, 0x0035, 0x00bc, 0x00c9, 0x007e, 0x013d, 0x014c, 0x0103, 0x0107, 0x0122, 0x009c, 0x00d5, 0x00a8, 0x00d3, 0x011d, + 0x0121, 0x013b, 0x000f, 0x0013, 0x0039, 0x0046, 0x0094, 0x00f9, 0x007f, 0x0123, +}; + +enum +{ + MENU_SUMMARY, + MENU_SWITCH, + MENU_CANCEL1, + MENU_ITEM, + MENU_GIVE, + MENU_TAKE_ITEM, + MENU_MAIL, + MENU_TAKE_MAIL, + MENU_READ, + MENU_CANCEL2, + MENU_SHIFT, + MENU_SEND_OUT, + MENU_ENTER, + MENU_NO_ENTRY, + MENU_STORE, + MENU_REGISTER, + MENU_TRADE1, + MENU_TRADE2, + MENU_TOSS, + MENU_FIELD_MOVES, +}; + +enum +{ + FIELD_MOVE_CUT, + FIELD_MOVE_FLASH, + FIELD_MOVE_ROCK_SMASH, + FIELD_MOVE_STRENGTH, + FIELD_MOVE_SURF, + FIELD_MOVE_FLY, + FIELD_MOVE_DIVE, + FIELD_MOVE_WATERFALL, + FIELD_MOVE_TELEPORT, + FIELD_MOVE_DIG, + FIELD_MOVE_SECRET_POWER, + FIELD_MOVE_MILK_DRINK, + FIELD_MOVE_SOFT_BOILED, + FIELD_MOVE_SWEET_SCENT, +}; + +// What a weird choice of table termination; +#define FIELD_MOVE_TERMINATOR MOVE_SWORDS_DANCE + +struct +{ + const u8 *text; + TaskFunc func; +} static const sCursorOptions[] = +{ + [MENU_SUMMARY] = {gText_Summary5, CursorCb_Summary}, + [MENU_SWITCH] = {gText_Switch2, CursorCb_Switch}, + [MENU_CANCEL1] = {gText_Cancel2, CursorCb_Cancel1}, + [MENU_ITEM] = {gText_Item, CursorCb_Item}, + [MENU_GIVE] = {gMenuText_Give, CursorCb_Give}, + [MENU_TAKE_ITEM] = {gText_Take, CursorCb_TakeItem}, + [MENU_MAIL] = {gText_Mail, CursorCb_Mail}, + [MENU_TAKE_MAIL] = {gText_Take2, CursorCb_TakeMail}, + [MENU_READ] = {gText_Read2, CursorCb_Read}, + [MENU_CANCEL2] = {gText_Cancel2, CursorCb_Cancel2}, + [MENU_SHIFT] = {gText_Shift, CursorCb_SendMon}, + [MENU_SEND_OUT] = {gText_SendOut, CursorCb_SendMon}, + [MENU_ENTER] = {gText_Enter, CursorCb_Enter}, + [MENU_NO_ENTRY] = {gText_NoEntry, CursorCb_NoEntry}, + [MENU_STORE] = {gText_Store, CursorCb_Store}, + [MENU_REGISTER] = {gText_Register, CursorCb_Register}, + [MENU_TRADE1] = {gText_Trade4, CursorCb_Trade1}, + [MENU_TRADE2] = {gText_Trade4, CursorCb_Trade2}, + [MENU_TOSS] = {gMenuText_Toss, CursorCb_Toss}, + [MENU_FIELD_MOVES + FIELD_MOVE_CUT] = {gMoveNames[MOVE_CUT], CursorCb_FieldMove}, + [MENU_FIELD_MOVES + FIELD_MOVE_FLASH] = {gMoveNames[MOVE_FLASH], CursorCb_FieldMove}, + [MENU_FIELD_MOVES + FIELD_MOVE_ROCK_SMASH] = {gMoveNames[MOVE_ROCK_SMASH], CursorCb_FieldMove}, + [MENU_FIELD_MOVES + FIELD_MOVE_STRENGTH] = {gMoveNames[MOVE_STRENGTH], CursorCb_FieldMove}, + [MENU_FIELD_MOVES + FIELD_MOVE_SURF] = {gMoveNames[MOVE_SURF], CursorCb_FieldMove}, + [MENU_FIELD_MOVES + FIELD_MOVE_FLY] = {gMoveNames[MOVE_FLY], CursorCb_FieldMove}, + [MENU_FIELD_MOVES + FIELD_MOVE_DIVE] = {gMoveNames[MOVE_DIVE], CursorCb_FieldMove}, + [MENU_FIELD_MOVES + FIELD_MOVE_WATERFALL] = {gMoveNames[MOVE_WATERFALL], CursorCb_FieldMove}, + [MENU_FIELD_MOVES + FIELD_MOVE_TELEPORT] = {gMoveNames[MOVE_TELEPORT], CursorCb_FieldMove}, + [MENU_FIELD_MOVES + FIELD_MOVE_DIG] = {gMoveNames[MOVE_DIG], CursorCb_FieldMove}, + [MENU_FIELD_MOVES + FIELD_MOVE_SECRET_POWER] = {gMoveNames[MOVE_SECRET_POWER], CursorCb_FieldMove}, + [MENU_FIELD_MOVES + FIELD_MOVE_MILK_DRINK] = {gMoveNames[MOVE_MILK_DRINK], CursorCb_FieldMove}, + [MENU_FIELD_MOVES + FIELD_MOVE_SOFT_BOILED] = {gMoveNames[MOVE_SOFT_BOILED], CursorCb_FieldMove}, + [MENU_FIELD_MOVES + FIELD_MOVE_SWEET_SCENT] = {gMoveNames[MOVE_SWEET_SCENT], CursorCb_FieldMove}, +}; + +static const u8 gUnknown_08615D10[] = {0, 1, 2}; +static const u8 gUnknown_08615D13[] = {10, 0, 2}; +static const u8 gUnknown_08615D16[] = {11, 0, 2}; +static const u8 gUnknown_08615D19[] = {0, 2}; +static const u8 gUnknown_08615D1B[] = {12, 0, 2}; +static const u8 gUnknown_08615D1E[] = {13, 0, 2}; +static const u8 gUnknown_08615D21[] = {14, 0, 2}; +static const u8 gUnknown_08615D24[] = {4, 5, 9}; +static const u8 gUnknown_08615D27[] = {8, 7, 9}; +static const u8 gUnknown_08615D2A[] = {15, 0, 2}; +static const u8 gUnknown_08615D2D[] = {16, 0, 2}; +static const u8 gUnknown_08615D30[] = {17, 0, 2}; +static const u8 gUnknown_08615D33[] = {5, 18, 2}; + +static const u8 *const gUnknown_08615D38[] = +{ + NULL, + gUnknown_08615D10, + gUnknown_08615D13, + gUnknown_08615D16, + gUnknown_08615D1B, + gUnknown_08615D1E, + gUnknown_08615D21, + gUnknown_08615D19, + gUnknown_08615D24, + gUnknown_08615D27, + gUnknown_08615D2A, + gUnknown_08615D2D, + gUnknown_08615D30, + gUnknown_08615D33, +}; + +static const u8 gUnknown_08615D70[] = {0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}; + +static const u16 sFieldMoves[] = +{ + MOVE_CUT, MOVE_FLASH, MOVE_ROCK_SMASH, MOVE_STRENGTH, MOVE_SURF, MOVE_FLY, MOVE_DIVE, MOVE_WATERFALL, MOVE_TELEPORT, + MOVE_DIG, MOVE_SECRET_POWER, MOVE_MILK_DRINK, MOVE_SOFT_BOILED, MOVE_SWEET_SCENT, FIELD_MOVE_TERMINATOR +}; + +struct +{ + bool8 (*fieldMoveFunc)(void); + u8 msgId; +} static const sFieldMoveCursorCallbacks[] = +{ + [FIELD_MOVE_CUT] = {SetUpFieldMove_Cut, 0x07}, + [FIELD_MOVE_FLASH] = {SetUpFieldMove_Flash, 0x0d}, + [FIELD_MOVE_ROCK_SMASH] = {SetUpFieldMove_RockSmash, 0x0d}, + [FIELD_MOVE_STRENGTH] = {SetUpFieldMove_Strength, 0x0d}, + [FIELD_MOVE_SURF] = {SetUpFieldMove_Surf, 0x08}, + [FIELD_MOVE_FLY] = {SetUpFieldMove_Fly, 0x0d}, + [FIELD_MOVE_DIVE] = {SetUpFieldMove_Dive, 0x0d}, + [FIELD_MOVE_WATERFALL] = {SetUpFieldMove_Waterfall, 0x0d}, + [FIELD_MOVE_TELEPORT] = {SetUpFieldMove_Teleport, 0x0d}, + [FIELD_MOVE_DIG] = {SetUpFieldMove_Dig, 0x0d}, + [FIELD_MOVE_SECRET_POWER] = {SetUpFieldMove_SecretPower, 0x0d}, + [FIELD_MOVE_MILK_DRINK] = {SetUpFieldMove_SoftBoiled, 0x10}, + [FIELD_MOVE_SOFT_BOILED] = {SetUpFieldMove_SoftBoiled, 0x10}, + [FIELD_MOVE_SWEET_SCENT] = {SetUpFieldMove_SweetScent, 0x0d}, +}; + +static const u8 *const gUnknown_08615E0C[] = +{ + gText_NotPkmnOtherTrainerWants, + gText_ThatIsntAnEgg, + gText_PkmnCantBeTradedNow, + gText_PkmnCantBeTradedNow, + gText_OtherTrainersPkmnCantBeTraded, + gText_EggCantBeTradedNow, + gText_OtherTrainerCantAcceptPkmn, + gText_CantTradeWithTrainer, + gText_CantTradeWithTrainer, +}; + +static const u32 gUnknown_08615E30[] = INCBIN_U32("graphics/interface/hold_icons.4bpp"); +static const u16 gUnknown_08615E70[] = INCBIN_U16("graphics/interface/hold_icons.gbapal"); + +static const struct OamData gOamData_83765EC = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 0, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0, +}; + +static const union AnimCmd gSpriteAnim_83765F4[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END +}; + +static const union AnimCmd gSpriteAnim_83765FC[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END +}; + +static const union AnimCmd *const gSpriteAnimTable_8376604[] = +{ + gSpriteAnim_83765F4, + gSpriteAnim_83765FC, +}; + +static const struct SpriteSheet gUnknown_08615EB0 = +{ + gUnknown_08615E30, sizeof(gUnknown_08615E30), 0xd750 +}; + +static const struct SpritePalette gUnknown_08615EB8 = +{ + gUnknown_08615E70, 0xd750 +}; + +static const struct SpriteTemplate gSpriteTemplate_8615EC0 = +{ + 0xd750, + 0xd750, + &gOamData_83765EC, + gSpriteAnimTable_8376604, + NULL, + gDummySpriteAffineAnimTable, + SpriteCallbackDummy +}; + +static const struct OamData sOamData_8615ED8 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 2, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0 +}; + +static const union AnimCmd sSpriteAnim_8615EE0[] = +{ + ANIMCMD_FRAME(0, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8615EE8[] = +{ + ANIMCMD_FRAME(16, 0), + ANIMCMD_END +}; + +static const union AnimCmd *const sSpriteAnimTable_8615EF0[] = +{ + sSpriteAnim_8615EE0, + sSpriteAnim_8615EE8 +}; + +static const struct CompressedSpriteSheet gUnknown_08615EF8 = +{ + gPartyMenuPokeball_Gfx, 0x400, 0x04b0 +}; + +static const struct CompressedSpritePalette gUnknown_08615F00 = +{ + gPartyMenuPokeball_Pal, 0x04b0 +}; + +static const struct SpriteTemplate gSpriteTemplate_8615F08 = +{ + .tileTag = 0x04b0, + .paletteTag = 0x04b0, + .oam = &sOamData_8615ED8, + .anims = sSpriteAnimTable_8615EF0, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +static const struct OamData sOamData_8615F20 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 1, + .tileNum = 0, + .priority = 2, + .paletteNum = 0, + .affineParam = 0 +}; + +static const union AnimCmd sSpriteAnim_8615F28[] = +{ + ANIMCMD_FRAME(0, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8615F30[] = +{ + ANIMCMD_FRAME(4, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8615F38[] = +{ + ANIMCMD_FRAME(8, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8615F40[] = +{ + ANIMCMD_FRAME(12, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8615F48[] = +{ + ANIMCMD_FRAME(16, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8615F50[] = +{ + ANIMCMD_FRAME(20, 0), + ANIMCMD_END +}; + +static const union AnimCmd *const sSpriteAnimTable_8615F58[] = +{ + sSpriteAnim_8615F28, + sSpriteAnim_8615F30, + sSpriteAnim_8615F38, + sSpriteAnim_8615F40, + sSpriteAnim_8615F48, + sSpriteAnim_8615F50 +}; + +static const struct CompressedSpriteSheet gUnknown_08615F70 = +{ + gPartyMenuPokeballSmall_Gfx, 0x0300, 0x04b1 +}; + +static const struct SpriteTemplate gSpriteTemplate_8615F78 = +{ + .tileTag = 1201, + .paletteTag = 1200, + .oam = &sOamData_8615F20, + .anims = sSpriteAnimTable_8615F58, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +static const struct OamData sOamData_8615F90 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 1, + .x = 0, + .matrixNum = 0, + .size = 1, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0 +}; + +static const union AnimCmd sSpriteAnim_8615F98[] = +{ + ANIMCMD_FRAME(0, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8615FA0[] = +{ + ANIMCMD_FRAME(4, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8615FA8[] = +{ + ANIMCMD_FRAME(8, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8615FB0[] = +{ + ANIMCMD_FRAME(12, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8615FB8[] = +{ + ANIMCMD_FRAME(16, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8615FC0[] = +{ + ANIMCMD_FRAME(20, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8615FC8[] = +{ + ANIMCMD_FRAME(24, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8615FD0[] = +{ + ANIMCMD_FRAME(28, 0), + ANIMCMD_END +}; + +static const union AnimCmd *const sSpriteAnimTable_8615FD8[] = +{ + sSpriteAnim_8615F98, + sSpriteAnim_8615FA0, + sSpriteAnim_8615FA8, + sSpriteAnim_8615FB0, + sSpriteAnim_8615FB8, + sSpriteAnim_8615FC0, + sSpriteAnim_8615FC8, + sSpriteAnim_8615FD0 +}; + +static const struct CompressedSpriteSheet gUnknown_08615FF8 = +{ + gStatusGfx_Icons, 0x400, 1202 +}; + +static const struct CompressedSpritePalette gUnknown_08616000 = +{ + gStatusPal_Icons, 1202 +}; + +static const struct SpriteTemplate gSpriteTemplate_8616008 = +{ + .tileTag = 1202, + .paletteTag = 1202, + .oam = &sOamData_8615F90, + .anims = sSpriteAnimTable_8615FD8, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +static const u8 gUnknown_08616020[] = {0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00}; + +// Unused table of pointers to strings of statistics. +static const u8 *const gUnknown_08616028[] = +{ + gText_HP4, + gText_Attack3, + gText_Defense3, + gText_SpAtk4, + gText_SpDef4, + gText_Speed2 +}; + +static const u16 gTMHMMoves[] = +{ + MOVE_FOCUS_PUNCH, + MOVE_DRAGON_CLAW, + MOVE_WATER_PULSE, + MOVE_CALM_MIND, + MOVE_ROAR, + MOVE_TOXIC, + MOVE_HAIL, + MOVE_BULK_UP, + MOVE_BULLET_SEED, + MOVE_HIDDEN_POWER, + MOVE_SUNNY_DAY, + MOVE_TAUNT, + MOVE_ICE_BEAM, + MOVE_BLIZZARD, + MOVE_HYPER_BEAM, + MOVE_LIGHT_SCREEN, + MOVE_PROTECT, + MOVE_RAIN_DANCE, + MOVE_GIGA_DRAIN, + MOVE_SAFEGUARD, + MOVE_FRUSTRATION, + MOVE_SOLAR_BEAM, + MOVE_IRON_TAIL, + MOVE_THUNDERBOLT, + MOVE_THUNDER, + MOVE_EARTHQUAKE, + MOVE_RETURN, + MOVE_DIG, + MOVE_PSYCHIC, + MOVE_SHADOW_BALL, + MOVE_BRICK_BREAK, + MOVE_DOUBLE_TEAM, + MOVE_REFLECT, + MOVE_SHOCK_WAVE, + MOVE_FLAMETHROWER, + MOVE_SLUDGE_BOMB, + MOVE_SANDSTORM, + MOVE_FIRE_BLAST, + MOVE_ROCK_TOMB, + MOVE_AERIAL_ACE, + MOVE_TORMENT, + MOVE_FACADE, + MOVE_SECRET_POWER, + MOVE_REST, + MOVE_ATTRACT, + MOVE_THIEF, + MOVE_STEEL_WING, + MOVE_SKILL_SWAP, + MOVE_SNATCH, + MOVE_OVERHEAT, + MOVE_CUT, + MOVE_FLY, + MOVE_SURF, + MOVE_STRENGTH, + MOVE_FLASH, + MOVE_ROCK_SMASH, + MOVE_WATERFALL, + MOVE_DIVE, +}; + +// code +static void InitPartyMenu(u8 a, u8 b, u8 c, u8 d, u8 e, TaskFunc task, MainCallback callback) +{ + u16 i; + + reset_brm(); + gUnknown_0203CEC4 = Alloc(sizeof(struct Struct203CEC4)); + if (gUnknown_0203CEC4 == NULL) + { + SetMainCallback2(callback); + } + else + { + gUnknown_0203CEC8.unk8_0 = a; + gUnknown_0203CEC8.exitCallback = callback; + gUnknown_0203CEC8.unkB = c; + gUnknown_0203CEC4->unkA_0 = e; + gUnknown_0203CEC4->unk0 = task; + gUnknown_0203CEC4->exitCallback = NULL; + gUnknown_0203CEC4->unk8_1 = 0; + gUnknown_0203CEC4->unk8_2 = 0xFF; + gUnknown_0203CEC4->unk9_0 = 0xFF; + + if (a == 4) + gUnknown_0203CEC4->unk8_0 = TRUE; + else + gUnknown_0203CEC4->unk8_0 = FALSE; + + if (b != 0xFF) + gUnknown_0203CEC8.mode = b; + + for (i = 0; i <= 15; i++) + gUnknown_0203CEC4->data[i] = 0; + for (i = 0; i < 3; i++) + gUnknown_0203CEC4->unkC[i] |= 0xFF; + + if (d == 0) + gUnknown_0203CEC8.unk9 = 0; + else if (gUnknown_0203CEC8.unk9 > 5 || GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_SPECIES) == SPECIES_NONE) + gUnknown_0203CEC8.unk9 = 0; // wut why is this else if? + + gTextFlags.autoScroll = 0; + CalculatePlayerPartyCount(); + SetMainCallback2(PartyMenuInitCallback); + } +} + +static void PartyMenuCallback(void) +{ + RunTasks(); + AnimateSprites(); + BuildOamBuffer(); + do_scheduled_bg_tilemap_copies_to_vram(); + UpdatePaletteFade(); +} + +static void PartyMenuVBlankCallback(void) +{ + LoadOam(); + ProcessSpriteCopyRequests(); + TransferPlttBuffer(); +} + +static void PartyMenuInitCallback(void) +{ + while (TRUE) + { + if (sub_81221EC() == TRUE || PartyMenuSetup() == TRUE || sub_81221AC() == TRUE) + break; + } +} + +static bool8 PartyMenuSetup(void) +{ + switch (gMain.state) + { + case 0: + SetVBlankHBlankCallbacksToNull(); + ResetVramOamAndBgCntRegs(); + clear_scheduled_bg_copies_to_vram(); + gMain.state++; + break; + case 1: + ScanlineEffect_Stop(); + gMain.state++; + break; + case 2: + ResetPaletteFade(); + gPaletteFade.bufferTransferDisabled = TRUE; + gMain.state++; + break; + case 3: + ResetSpriteData(); + gMain.state++; + break; + case 4: + FreeAllSpritePalettes(); + gMain.state++; + break; + case 5: + if (!sub_81221AC()) + ResetTasks(); + gMain.state++; + break; + case 6: + sub_81B209C(); + gMain.state++; + break; + case 7: + if (!AllocPartyMenuBg()) + { + PartyMenuExit(); + return TRUE; + } + else + { + gUnknown_0203CEC4->data[0] = 0; + gMain.state++; + } + break; + case 8: + if (AllocPartyMiscGfx()) + gMain.state++; + break; + case 9: + sub_81B239C(gUnknown_0203CEC8.mode); + gMain.state++; + break; + case 10: + PartyMenuInitHelperStructs(gUnknown_0203CEC8.mode); + gUnknown_0203CEC4->data[0] = 0; + gMain.state++; + break; + case 11: + LoadHeldItemIcons(); + gMain.state++; + break; + case 12: + LoadPartyMenuPokeballGfx(); + gMain.state++; + break; + case 13: + LoadPartyMenuAilmentGfx(); + gMain.state++; + break; + case 14: + LoadMonIconPalettes(); + gMain.state++; + break; + case 15: + if (party_menu_add_per_mon_objects()) + { + gUnknown_0203CEC4->data[0] = 0; + gMain.state++; + } + break; + case 16: + if (RenderPartyMenuBoxes()) + { + gUnknown_0203CEC4->data[0] = 0; + gMain.state++; + } + break; + case 17: + sub_81B0F28(); + gMain.state++; + break; + case 18: + sub_81B2428(gUnknown_0203CEC4->unk8_0); + gMain.state++; + break; + case 19: + gMain.state++; + break; + case 20: + CreateTask(gUnknown_0203CEC4->unk0, 0); + display_pokemon_menu_message(gUnknown_0203CEC4->unkA_0); + gMain.state++; + break; + case 21: + BlendPalettes(0xFFFFFFFF, 16, 0); + gPaletteFade.bufferTransferDisabled = FALSE; + gMain.state++; + break; + case 22: + BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + gMain.state++; + break; + default: + SetVBlankCallback(PartyMenuVBlankCallback); + SetMainCallback2(PartyMenuCallback); + return TRUE; + } + return FALSE; +} + +static void PartyMenuExit(void) +{ + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + CreateTask(PartyMenuExitTask, 0); + SetVBlankCallback(PartyMenuVBlankCallback); + SetMainCallback2(PartyMenuCallback); +} + +static void PartyMenuExitTask(u8 taskId) +{ + if (!gPaletteFade.active) + { + SetMainCallback2(gUnknown_0203CEC8.exitCallback); + FreePartyPointers(); + DestroyTask(taskId); + } +} + +static void reset_brm(void) +{ + gUnknown_0203CEC4 = NULL; + gUnknown_0203CEE4 = NULL; + gUnknown_0203CEDC = NULL; + gUnknown_0203CEE0 = NULL; +} + +static bool8 AllocPartyMenuBg(void) +{ + gUnknown_0203CEE4 = Alloc(0x800); + if (gUnknown_0203CEE4 == NULL) + return FALSE; + + memset(gUnknown_0203CEE4, 0, 0x800); + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(0, gUnknown_086156B8, ARRAY_COUNT(gUnknown_086156B8)); + SetBgTilemapBuffer(1, gUnknown_0203CEE4); + ResetAllBgsCoordinates(); + schedule_bg_copy_tilemap_to_vram(1); + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); + SetGpuReg(REG_OFFSET_BLDCNT, 0); + ShowBg(0); + ShowBg(1); + ShowBg(2); + return TRUE; +} + +static bool8 AllocPartyMiscGfx(void) +{ + int sizeout; + + switch (gUnknown_0203CEC4->data[0]) + { + case 0: + gUnknown_0203CEE0 = malloc_and_decompress(gPartyMenuMisc_Gfx, &sizeout); + LoadBgTiles(1, gUnknown_0203CEE0, sizeout, 0); + gUnknown_0203CEC4->data[0]++; + break; + case 1: + if (!IsDma3ManagerBusyWithBgCopy()) + { + LZDecompressWram(gPartyMenuMisc_Tilemap, gUnknown_0203CEE4); + gUnknown_0203CEC4->data[0]++; + } + break; + case 2: + LoadCompressedPalette(gPartyMenuMisc_Pal, 0, 0x160); + CpuCopy16(gPlttBufferUnfaded, gUnknown_0203CEC4->palBuffer, 0x160); + gUnknown_0203CEC4->data[0]++; + break; + case 3: + PartyPaletteBufferCopy(4); + gUnknown_0203CEC4->data[0]++; + break; + case 4: + PartyPaletteBufferCopy(5); + gUnknown_0203CEC4->data[0]++; + break; + case 5: + PartyPaletteBufferCopy(6); + gUnknown_0203CEC4->data[0]++; + break; + case 6: + PartyPaletteBufferCopy(7); + gUnknown_0203CEC4->data[0]++; + break; + case 7: + PartyPaletteBufferCopy(8); + gUnknown_0203CEC4->data[0]++; + break; + default: + return TRUE; + } + return FALSE; +} + +static void PartyPaletteBufferCopy(u8 offset) +{ + offset *= 16; + CpuCopy16(&gPlttBufferUnfaded[0x30], &gPlttBufferUnfaded[offset], 32); + CpuCopy16(&gPlttBufferUnfaded[0x30], &gPlttBufferFaded[offset], 32); +} + +static void FreePartyPointers(void) +{ + if (gUnknown_0203CEC4) + Free(gUnknown_0203CEC4); + if (gUnknown_0203CEE4) + Free(gUnknown_0203CEE4); + if (gUnknown_0203CEE0) + Free(gUnknown_0203CEE0); + if (gUnknown_0203CEDC) + Free(gUnknown_0203CEDC); + FreeAllWindowBuffers(); +} + +static void PartyMenuInitHelperStructs(u8 a) +{ + u8 i; + + gUnknown_0203CEDC = Alloc(sizeof(struct Struct203CEDC[PARTY_SIZE])); + + for (i = 0; i < PARTY_SIZE; i++) + { + gUnknown_0203CEDC[i].unk0 = &gUnknown_086156C4[1]; + gUnknown_0203CEDC[i].unk4 = gUnknown_08615704[a][i]; + gUnknown_0203CEDC[i].windowId = i; + gUnknown_0203CEDC[i].unk9 |= 0xFF; + gUnknown_0203CEDC[i].unkA |= 0xFF; + gUnknown_0203CEDC[i].unkB |= 0xFF; + gUnknown_0203CEDC[i].unkC |= 0xFF; + } + gUnknown_0203CEDC[0].unk0 = &gUnknown_086156C4[0]; + if (a == 3) + gUnknown_0203CEDC[3].unk0 = &gUnknown_086156C4[0]; + else if (a != 0) + gUnknown_0203CEDC[1].unk0 = &gUnknown_086156C4[0]; +} + +static void RenderPartyMenuBox(u8 slot) +{ + if (gUnknown_0203CEC8.unk8_0 == 5 && slot > 2) + { + sub_81B0CEC(slot); + if (gUnknown_02022FF8[slot - 3].species == SPECIES_NONE) + UpdateSelectedPartyBox(&gUnknown_0203CEDC[slot], 0x40); + else + UpdateSelectedPartyBox(&gUnknown_0203CEDC[slot], 8); + CopyWindowToVram(gUnknown_0203CEDC[slot].windowId, 2); + PutWindowTilemap(gUnknown_0203CEDC[slot].windowId); + schedule_bg_copy_tilemap_to_vram(2); + } + else + { + if (GetMonData(&gPlayerParty[slot], MON_DATA_SPECIES) == SPECIES_NONE) + { + sub_81B2720(gUnknown_0203CEDC[slot].windowId); + UpdateSelectedPartyBox(&gUnknown_0203CEDC[slot], 0x40); + CopyWindowToVram(gUnknown_0203CEDC[slot].windowId, 2); + } + else + { + if (gUnknown_0203CEC8.unk8_0 == 7) + DisplayPartyPokemonSelectForRelearner(slot); + else if (gUnknown_0203CEC8.unk8_0 == 2) + DisplayPartyPokemonSelectForContest(slot); + else if (gUnknown_0203CEC8.unk8_0 == 4) + DisplayPartyPokemonSelectForBattle(slot); + else if (gUnknown_0203CEC8.unk8_0 == 11) + sub_81B0B98(slot); + else if (gUnknown_0203CEC8.unk8_0 == 12) + DisplayPartyPokemonSelectHeldItemRelated(slot); + else if (!sub_81B0BFC(slot)) + DisplayPartyPokemonData(slot); + + if (gUnknown_0203CEC8.unk8_0 == 5) + sub_81B0FCC(slot, 0); + else if (gUnknown_0203CEC8.unk9 == slot) + sub_81B0FCC(slot, 1); + else + sub_81B0FCC(slot, 0); + } + PutWindowTilemap(gUnknown_0203CEDC[slot].windowId); + schedule_bg_copy_tilemap_to_vram(0); + } +} + +static void DisplayPartyPokemonData(u8 slot) +{ + if (GetMonData(&gPlayerParty[slot], MON_DATA_IS_EGG)) + { + gUnknown_0203CEDC[slot].unk0->unk0(gUnknown_0203CEDC[slot].windowId, 0, 0, 0, 0, 1); + DisplayPartyPokemonNickname(&gPlayerParty[slot], &gUnknown_0203CEDC[slot], 0); + } + else + { + gUnknown_0203CEDC[slot].unk0->unk0(gUnknown_0203CEDC[slot].windowId, 0, 0, 0, 0, 0); + DisplayPartyPokemonNickname(&gPlayerParty[slot], &gUnknown_0203CEDC[slot], 0); + DisplayPartyPokemonLevelCheck(&gPlayerParty[slot], &gUnknown_0203CEDC[slot], 0); + DisplayPartyPokemonGenderNidoranCheck(&gPlayerParty[slot], &gUnknown_0203CEDC[slot], 0); + DisplayPartyPokemonHPCheck(&gPlayerParty[slot], &gUnknown_0203CEDC[slot], 0); + DisplayPartyPokemonMaxHPCheck(&gPlayerParty[slot], &gUnknown_0203CEDC[slot], 0); + DisplayPartyPokemonHPBarCheck(&gPlayerParty[slot], &gUnknown_0203CEDC[slot]); + } +} + +static void DisplayPartyPokemonSelectData(u8 slot, u8 stringID) +{ + struct Pokemon *mon = &gPlayerParty[slot]; + + gUnknown_0203CEDC[slot].unk0->unk0(gUnknown_0203CEDC[slot].windowId, 0, 0, 0, 0, 1); + DisplayPartyPokemonNickname(mon, &gUnknown_0203CEDC[slot], 0); + if (!GetMonData(mon, MON_DATA_IS_EGG)) + { + DisplayPartyPokemonLevelCheck(mon, &gUnknown_0203CEDC[slot], 0); + DisplayPartyPokemonGenderNidoranCheck(mon, &gUnknown_0203CEDC[slot], 0); + } + DisplayPartyPokemonOtherText(stringID, &gUnknown_0203CEDC[slot], 0); +} + +static void DisplayPartyPokemonSelectForBattle(u8 slot) +{ + u8 i; + struct Pokemon *mon = &gPlayerParty[slot]; + u8 *ptr = gSelectedOrderFromParty; + + if (!GetBattleEntryEligibility(mon)) + { + DisplayPartyPokemonSelectData(slot, 7); + return; + } + else + { + for (i = 0; i < sub_81B8830(); i++) + { + if (ptr[i] != 0 && (ptr[i] - 1) == slot) + { + DisplayPartyPokemonSelectData(slot, i + 2); + return; + } + } + DisplayPartyPokemonSelectData(slot, 1); + } +} + +static void DisplayPartyPokemonSelectForContest(u8 slot) +{ + switch (sub_80DAE0C(&gPlayerParty[slot])) + { + case 0: + case 3: + case 4: + DisplayPartyPokemonSelectData(slot, 7); + break; + case 1: + case 2: + DisplayPartyPokemonSelectData(slot, 6); + break; + } +} + +static void DisplayPartyPokemonSelectForRelearner(u8 slot) +{ + if (GetNumberOfRelearnableMoves(&gPlayerParty[slot]) == 0) + DisplayPartyPokemonSelectData(slot, 9); + else + DisplayPartyPokemonSelectData(slot, 8); +} + +static void sub_81B0B98(u8 slot) +{ + if (sub_81B218C(slot) == TRUE) + DisplayPartyPokemonSelectData(slot, 6); + else + DisplayPartyPokemonSelectData(slot, 7); +} + +static void DisplayPartyPokemonSelectHeldItemRelated(u8 slot) +{ + if (GetMonData(&gPlayerParty[slot], MON_DATA_HELD_ITEM)) + DisplayPartyPokemonSelectData(slot, 11); + else + DisplayPartyPokemonSelectData(slot, 12); +} + +static bool8 sub_81B0BFC(u8 slot) +{ + struct Pokemon *currentPokemon = &gPlayerParty[slot]; + u16 item = gSpecialVar_ItemId; + + if (gUnknown_0203CEC8.unkB == 12) + { + gSpecialVar_Result = FALSE; + DisplayPartyPokemonSelectToTeachMove(slot, 0, gSpecialVar_0x8005); + } + else + { + if (gUnknown_0203CEC8.unkB != 3) + return FALSE; + + switch (CheckIfItemIsTMHMOrEvolutionStone(item)) + { + default: + return FALSE; + case 1: + DisplayPartyPokemonSelectToTeachMove(slot, item, 0); + break; + case 2: + if (!GetMonData(currentPokemon, MON_DATA_IS_EGG) && GetEvolutionTargetSpecies(currentPokemon, 3, item) != SPECIES_NONE) + return FALSE; + DisplayPartyPokemonSelectData(slot, 0); + break; + } + } + return TRUE; +} + +static void DisplayPartyPokemonSelectToTeachMove(u8 slot, u16 item, u8 tutor) +{ + switch (CanMonLearnTMTutor(&gPlayerParty[slot], item, tutor)) + { + case CANNOT_LEARN_MOVE: + case CANNOT_LEARN_MOVE_IS_EGG: + DisplayPartyPokemonSelectData(slot, 9); + break; + case ALREADY_KNOWS_MOVE: + DisplayPartyPokemonSelectData(slot, 10); + break; + default: + DisplayPartyPokemonSelectData(slot, 8); + break; + } +} + +static void sub_81B0CEC(u8 slot) +{ + struct Struct203CEDC *structPtr = &gUnknown_0203CEDC[slot]; + u8 actualSlot = slot - 3; + + if (gUnknown_02022FF8[actualSlot].species == SPECIES_NONE) + { + sub_81B2720(structPtr->windowId); + } + else + { + structPtr->unk0->unk0(structPtr->windowId, 0, 0, 0, 0, 0); + StringCopy(gStringVar1, gUnknown_02022FF8[actualSlot].nickname); + StringGetEnd10(gStringVar1); + sub_81DB52C(gStringVar1); + DisplayPartyPokemonBarDetail(structPtr->windowId, gStringVar1, 0, structPtr->unk0->unk4); + DisplayPartyPokemonLevel(gUnknown_02022FF8[actualSlot].level, structPtr); + DisplayPartyPokemonGender(gUnknown_02022FF8[actualSlot].gender, gUnknown_02022FF8[actualSlot].species, gUnknown_02022FF8[actualSlot].nickname, structPtr); + DisplayPartyPokemonHP(gUnknown_02022FF8[actualSlot].hp, structPtr); + DisplayPartyPokemonMaxHP(gUnknown_02022FF8[actualSlot].maxhp, structPtr); + DisplayPartyPokemonHPBar(gUnknown_02022FF8[actualSlot].hp, gUnknown_02022FF8[actualSlot].maxhp, structPtr); + } +} + +static bool8 RenderPartyMenuBoxes(void) +{ + RenderPartyMenuBox(gUnknown_0203CEC4->data[0]); + if (++gUnknown_0203CEC4->data[0] == 6) + return TRUE; + return FALSE; +} + +static u8* GetPartyMiscGraphicsTile(u16 tileId) +{ + return &gUnknown_0203CEE0[tileId << 5]; +} + +static void party_menu_add_per_mon_objects_internal(u8 slot) +{ + u8 actualSlot; + + if (gUnknown_0203CEC8.unk8_0 == 5 && slot > 2) + { + u8 status; + actualSlot = slot - 3; + + if (gUnknown_02022FF8[actualSlot].species != SPECIES_NONE) + { + party_menu_link_mon_icon_anim(gUnknown_02022FF8[actualSlot].species, gUnknown_02022FF8[actualSlot].personality, &gUnknown_0203CEDC[slot], 0, 0); + party_menu_link_mon_held_item_object(gUnknown_02022FF8[actualSlot].species, gUnknown_02022FF8[actualSlot].heldItem, &gUnknown_0203CEDC[slot]); + party_menu_link_mon_pokeball_object(gUnknown_02022FF8[actualSlot].species, &gUnknown_0203CEDC[slot]); + if (gUnknown_02022FF8[actualSlot].hp == 0) + status = AILMENT_FNT; + else + status = pokemon_ailments_get_primary(gUnknown_02022FF8[actualSlot].status); + party_menu_link_mon_status_condition_object(gUnknown_02022FF8[actualSlot].species, status, &gUnknown_0203CEDC[slot]); + } + } + else if (GetMonData(&gPlayerParty[slot], MON_DATA_SPECIES) != SPECIES_NONE) + { + party_menu_icon_anim(&gPlayerParty[slot], &gUnknown_0203CEDC[slot], slot); + party_menu_held_item_object(&gPlayerParty[slot], &gUnknown_0203CEDC[slot]); + party_menu_pokeball_object(&gPlayerParty[slot], &gUnknown_0203CEDC[slot]); + party_menu_status_condition_object(&gPlayerParty[slot], &gUnknown_0203CEDC[slot]); + } +} + +static bool8 party_menu_add_per_mon_objects(void) +{ + party_menu_add_per_mon_objects_internal(gUnknown_0203CEC4->data[0]); + if (++gUnknown_0203CEC4->data[0] == 6) + return TRUE; + return FALSE; +} + +static void sub_81B0F28(void) +{ + if (gUnknown_0203CEC8.unk8_0 == 5) + { + FillBgTilemapBufferRect(1, 14, 23, 17, 7, 2, 1); + } + else + { + if (gUnknown_0203CEC4->unk8_0) + { + gUnknown_0203CEC4->unk8_2 = sub_81B5F74(0xBF, 0x88); + sub_81B120C(); + gUnknown_0203CEC4->unk9_0 = sub_81B5F74(0xBF, 0x98); + } + else + { + gUnknown_0203CEC4->unk9_0 = sub_81B5F34(0xC6, 0x94); + } + sub_81B0FCC(gUnknown_0203CEC8.unk9, 1); + } +} + +void sub_81B0FCC(u8 slot, u8 b) +{ + u8 spriteId; + + switch (slot) + { + default: + if (GetMonData(&gPlayerParty[slot], MON_DATA_SPECIES) != SPECIES_NONE) + { + UpdateSelectedPartyBox(&gUnknown_0203CEDC[slot], GetPartyBoxPalBitfield(slot, b)); + AnimateSelectedPartyIcon(gUnknown_0203CEDC[slot].unk9, b); + sub_81B5F98(gUnknown_0203CEDC[slot].unkB, b); + } + return; + case 6: + if (b == 0) + sub_8199C30(1, 23, 16, 7, 2, 1); + else + sub_8199C30(1, 23, 16, 7, 2, 2); + spriteId = gUnknown_0203CEC4->unk8_2; + break; + case 7: + if (!gUnknown_0203CEC4->unk8_0) + { + if (b == 0) + sub_8199C30(1, 23, 17, 7, 2, 1); + else + sub_8199C30(1, 23, 17, 7, 2, 2); + } + else if (b == 0) + { + sub_8199C30(1, 23, 18, 7, 2, 1); + } + else + { + sub_8199C30(1, 23, 18, 7, 2, 2); + } + spriteId = gUnknown_0203CEC4->unk9_0; + break; + } + sub_81B5F98(spriteId, b); + schedule_bg_copy_tilemap_to_vram(1); +} + +static u8 GetPartyBoxPalBitfield(u8 slot, u8 b) +{ + u8 returnVar = 0; + if (b == 1) + returnVar |= 1; + if (GetMonData(&gPlayerParty[slot], MON_DATA_HP) == 0) + returnVar |= 2; + if (PartyBoxPal_ParnterOrDisqualifiedInArena(slot) == TRUE) + returnVar |= 8; + if (gUnknown_0203CEC8.unkB == 9) + returnVar |= 16; + if (gUnknown_0203CEC8.unkB == 8) + { + if (slot == gUnknown_0203CEC8.unk9 || slot == gUnknown_0203CEC8.unkA) + returnVar |= 4; + } + if (gUnknown_0203CEC8.unkB == 10 && slot == gUnknown_0203CEC8.unk9 ) + returnVar |= 32; + + return returnVar; +} + +static bool8 PartyBoxPal_ParnterOrDisqualifiedInArena(u8 slot) +{ + if (gUnknown_0203CEC8.mode == 2 && (slot == 1 || slot == 4 || slot == 5)) + return TRUE; + + if (slot < 3 && (gBattleTypeFlags & BATTLE_TYPE_ARENA) && gMain.inBattle && (gBattleStruct->arenaLostPlayerMons >> sub_81B8F38(slot) & 1)) + return TRUE; + + return FALSE; +} + +static void sub_81B120C(void) +{ + CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_086157C4, 23, 16, 7, 2, 17); + CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_086157E0, 23, 18, 7, 2, 17); + schedule_bg_copy_tilemap_to_vram(1); +} + +bool8 IsMultiBattle(void) +{ + if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_DOUBLE && gBattleTypeFlags & BATTLE_TYPE_TRAINER && gMain.inBattle) + return TRUE; + else + return FALSE; +} + +static void sub_81B1288(struct Pokemon *partySlot, struct Pokemon *pokemon) +{ + struct Pokemon *temp = Alloc(sizeof(struct Pokemon)); + + *temp = *partySlot; + *partySlot = *pokemon; + *pokemon = *temp; + + Free(temp); +} + +static void sub_81B12C0(u8 taskId) +{ + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + gTasks[taskId].func = c3_0811FAB4; +} + +static void c3_0811FAB4(u8 taskId) +{ + if (!gPaletteFade.active) + { + if (gUnknown_0203CEC8.unk8_0 == 1) + sub_81B9080(); + + if (gUnknown_0203CEC4->exitCallback != NULL) + SetMainCallback2(gUnknown_0203CEC4->exitCallback); + else + SetMainCallback2(gUnknown_0203CEC8.exitCallback); + + ResetSpriteData(); + FreePartyPointers(); + DestroyTask(taskId); + } +} + +u8 GetCursorSelectionMonId(void) +{ + return gUnknown_0203CEC8.unk9; +} + +u8 sub_81B1360(void) +{ + return gUnknown_0203CEC8.unk8_0; +} + +void sub_81B1370(u8 taskId) +{ + if (!gPaletteFade.active && sub_81221EC() != TRUE) + { + s8 *ptr = sub_81B13EC(); + + switch (PartyMenuButtonHandler(ptr)) + { + case 1: + sub_81B140C(taskId, ptr); + break; + case 2: + sub_81B15D0(taskId, ptr); + break; + case 8: + if (gUnknown_0203CEC4->unk8_0) + { + PlaySE(SE_SELECT); + sub_81B4F88(); + } + break; + } + } +} + +static s8* sub_81B13EC(void) +{ + if (gUnknown_0203CEC8.unkB == 8 || gUnknown_0203CEC8.unkB == 10) + return &gUnknown_0203CEC8.unkA; + return &gUnknown_0203CEC8.unk9; +} + +static void sub_81B140C(u8 taskId, s8 *ptr) +{ + if (*ptr == 6) + { + gUnknown_0203CEC8.unk4(taskId); + } + else + { + switch (gUnknown_0203CEC8.unkB - 3) + { + case 7: + if (sub_81B15A4((u8*)ptr)) + { + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + sub_81615A8(taskId); + } + break; + case 0: + if (sub_81B15A4((u8*)ptr)) + { + if (gUnknown_0203CEC8.unk8_0 == 1) + gUnknown_0203CEC4->exitCallback = sub_81B9140; + + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + gUnknown_03006328(taskId, sub_81B6794); + } + break; + case 9: + if (sub_81B15A4((u8*)ptr)) + { + PlaySE(SE_SELECT); + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + sub_81B7E4C(taskId); + } + break; + case 4: + if (sub_81B15A4((u8*)ptr)) + { + PlaySE(SE_SELECT); + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + sub_81B8474(taskId); + } + break; + case 2: + case 3: + if (sub_81B15A4((u8*)ptr)) + { + PlaySE(SE_SELECT); + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + sub_81B7FAC(taskId); + } + break; + case 5: + PlaySE(SE_SELECT); + sub_81B3938(taskId); + break; + case 8: + PlaySE(SE_SELECT); + sub_81B12C0(taskId); + break; + case 10: + if (sub_81B15A4((u8*)ptr)) + { + sub_81B21AC(taskId, (u8)*ptr); + } + break; + default: + case 1: + case 6: + PlaySE(SE_SELECT); + sub_81B36FC(taskId); + break; + } + } +} + +static bool8 sub_81B15A4(u8 *slotPtr) +{ + if (GetMonData(&gPlayerParty[*slotPtr], MON_DATA_IS_EGG) == TRUE) + { + PlaySE(SE_HAZURE); + return FALSE; + } + return TRUE; +} + +static void sub_81B15D0(u8 taskId, s8 *ptr) +{ + switch (gUnknown_0203CEC8.unkB) + { + case 1: + PlaySE(SE_HAZURE); + break; + case 8: + case 10: + PlaySE(SE_SELECT); + sub_81B407C(taskId); + break; + case 13: + PlaySE(SE_SELECT); + sub_81B2210(taskId); + break; + default: + PlaySE(SE_SELECT); + if (sub_81B1660(taskId) != TRUE) + { + if (!sub_81221AC()) + gSpecialVar_0x8004 = 7; + gUnknown_0203CEE8 = 0; + *ptr = 7; + sub_81B12C0(taskId); + } + break; + } +} + +static bool8 sub_81B1660(u8 taskId) +{ + const u8* stringPtr = NULL; + + if (gUnknown_0203CEC8.unk8_0 == 2) + stringPtr = gText_CancelParticipation; + else if (gUnknown_0203CEC8.unk8_0 == 4) + stringPtr = sub_81B88BC(); + + if (stringPtr == NULL) + return FALSE; + + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + StringExpandPlaceholders(gStringVar4, stringPtr); + sub_81B1B5C(gStringVar4, 1); + gTasks[taskId].func = sub_81B16D4; + return TRUE; +} + +static void sub_81B16D4(u8 taskId) +{ + if (sub_81B1BD4() != TRUE) + { + sub_81B334C(); + gTasks[taskId].func = sub_81B1708; + } +} + +static void sub_81B1708(u8 taskId) +{ + switch (Menu_ProcessInputNoWrapClearOnChoose()) + { + case 0: + gUnknown_0203CEE8 = 0; + gUnknown_0203CEC8.unk9 = 7; + sub_81B8558(); + sub_81B12C0(taskId); + break; + case MENU_B_PRESSED: + PlaySE(SE_SELECT); + case 1: + sub_81B1C1C(taskId); + break; + } +} + +static u16 PartyMenuButtonHandler(s8 *ptr) +{ + s8 movementDir; + + switch (gMain.newAndRepeatedKeys) + { + case DPAD_UP: + movementDir = -1; + break; + case DPAD_DOWN: + movementDir = 1; + break; + case DPAD_LEFT: + movementDir = -2; + break; + case DPAD_RIGHT: + movementDir = 2; + break; + default: + switch (sub_812210C()) + { + case 1: + movementDir = -1; + break; + case 2: + movementDir = 1; + break; + default: + movementDir = 0; + break; + } + break; + } + + if (gMain.newKeys & START_BUTTON) + return 8; + + if (movementDir) + { + UpdateCurrentPartySelection(ptr, movementDir); + return 0; + } + + if ((gMain.newKeys & A_BUTTON) && *ptr == 7) + return 2; + + return gMain.newKeys & (A_BUTTON | B_BUTTON); +} + +static void UpdateCurrentPartySelection(s8 *ptr, s8 movementDir) +{ + s8 slot = *ptr; + u8 mode = gUnknown_0203CEC8.mode; + + if (mode == 0) + SetNewPartySelectTarget1(ptr, movementDir); + else + SetNewPartySelectTarget2(ptr, movementDir); + + if (*ptr != slot) + { + PlaySE(SE_SELECT); + sub_81B0FCC(slot, 0); + sub_81B0FCC(*ptr, 1); + } +} + +static void SetNewPartySelectTarget1(s8 *ptr, s8 b) +{ + switch (b) + { + case -1: + if (*ptr == 0) + { + *ptr = 7; + } + else if (*ptr == 6) + { + *ptr = gPlayerPartyCount - 1; + } + else if (*ptr == 7) + { + if (gUnknown_0203CEC4->unk8_0) + *ptr = 6; + else + *ptr = gPlayerPartyCount - 1; + } + else + { + (*ptr)--; + } + break; + case 1: + if (*ptr == 7) + { + *ptr = 0; + } + else + { + if (*ptr == gPlayerPartyCount - 1) + { + if (gUnknown_0203CEC4->unk8_0) + *ptr = 6; + else + *ptr = 7; + } + else + { + (*ptr)++; + } + } + break; + case 2: + if (gPlayerPartyCount != 1 && *ptr == 0) + { + if (gUnknown_0203CEC4->unk8_1 == 0) + *ptr = 1; + else + *ptr = gUnknown_0203CEC4->unk8_1; + } + break; + case -2: + if (*ptr != 0 && *ptr != 6 && *ptr != 7) + { + gUnknown_0203CEC4->unk8_1 = *ptr; + *ptr = 0; + } + break; + } +} + +static void SetNewPartySelectTarget2(s8 *ptr, s8 b) +{ + s8 unk2 = b; + + switch (b) + { + case -1: + if (*ptr == 0) + { + *ptr = 7; + break; + } + else if (*ptr == 6) + { + *ptr = gPlayerPartyCount - 1; + break; + } + else if (*ptr == 7) + { + if (gUnknown_0203CEC4->unk8_0) + { + *ptr = 6; + break; + } + (*ptr)--; + } + unk2 = sub_81B1B00(*ptr, unk2); + if (unk2 != -1) + *ptr = unk2; + break; + case 1: + if (*ptr == 6) + { + *ptr = 7; + } + else if (*ptr == 7) + { + *ptr = 0; + } + else + { + unk2 = sub_81B1B00(*ptr, 1); + if (unk2 == -1) + { + if (gUnknown_0203CEC4->unk8_0) + *ptr = 6; + else + *ptr = 7; + } + else + { + *ptr = unk2; + } + } + break; + case 2: + if (*ptr == 0) + { + if (gUnknown_0203CEC4->unk8_1 == 3) + { + if (GetMonData(&gPlayerParty[3], MON_DATA_SPECIES) != SPECIES_NONE) + *ptr = 3; + } + else if (GetMonData(&gPlayerParty[2], MON_DATA_SPECIES) != SPECIES_NONE) + { + *ptr = 2; + } + } + else if (*ptr == 1) + { + if (gUnknown_0203CEC4->unk8_1 == 5) + { + if (GetMonData(&gPlayerParty[5], MON_DATA_SPECIES) != SPECIES_NONE) + *ptr = 5; + } + else if (GetMonData(&gPlayerParty[4], MON_DATA_SPECIES) != SPECIES_NONE) + { + *ptr = 4; + } + } + break; + case -2: + if (*ptr == 2 || *ptr == 3) + { + gUnknown_0203CEC4->unk8_1 = *ptr; + *ptr = 0; + } + else if (*ptr == 4 || *ptr == 5) + { + gUnknown_0203CEC4->unk8_1 = *ptr; + *ptr = 1; + } + break; + } +} + +static s8 sub_81B1B00(s8 a, s8 b) +{ + while (TRUE) + { + a += b; + if ((u8)a >= 6) + return -1; + if (GetMonData(&gPlayerParty[a], MON_DATA_SPECIES) != SPECIES_NONE) + return a; + } +} + +u8* GetMonNickname(struct Pokemon *mon, u8 *dest) +{ + GetMonData(mon, MON_DATA_NICKNAME, dest); + return StringGetEnd10(dest); +} + +u8 sub_81B1B5C(const u8* str, u8 b) +{ + u8 taskId; + + sub_81B3300(str); + taskId = CreateTask(sub_81B1B8C, 1); + gTasks[taskId].data[0] = b; + return taskId; +} + +static void sub_81B1B8C(u8 taskId) +{ + if (RunTextPrintersRetIsActive(6) != TRUE) + { + if (gTasks[taskId].data[0] == 0) + { + sub_8198070(6, 0); + ClearWindowTilemap(6); + } + DestroyTask(taskId); + } +} + +bool8 sub_81B1BD4(void) +{ + return FuncIsActiveTask(sub_81B1B8C); +} + +static void sub_81B1BE8(u8 taskId) +{ + if (sub_81221EC() != TRUE) + { + display_pokemon_menu_message(0); + gTasks[taskId].func = sub_81B1370; + } +} + +static void sub_81B1C1C(u8 taskId) +{ + if (sub_81B1BD4() != TRUE) + { + sub_8198070(6, 0); + ClearWindowTilemap(6); + if (sub_81221AC() == TRUE) + { + gTasks[taskId].func = sub_81B1BE8; + } + else + { + display_pokemon_menu_message(0); + gTasks[taskId].func = sub_81B1370; + } + } +} + +static void sub_81B1C84(struct Pokemon *mon, u16 item, u8 c, u8 unused) +{ + GetMonNickname(mon, gStringVar1); + CopyItemName(item, gStringVar2); + StringExpandPlaceholders(gStringVar4, gText_PkmnWasGivenItem); + sub_81B1B5C(gStringVar4, c); + schedule_bg_copy_tilemap_to_vram(2); +} + +static void sub_81B1CD0(struct Pokemon *mon, u16 item, u8 c) +{ + GetMonNickname(mon, gStringVar1); + CopyItemName(item, gStringVar2); + StringExpandPlaceholders(gStringVar4, gText_RecievedItemFromPkmn); + sub_81B1B5C(gStringVar4, c); + schedule_bg_copy_tilemap_to_vram(2); +} + +static void sub_81B1D1C(struct Pokemon *mon, u16 item, u8 c) +{ + GetMonNickname(mon, gStringVar1); + CopyItemName(item, gStringVar2); + StringExpandPlaceholders(gStringVar4, gText_SwitchPkmnItem); + sub_81B1B5C(gStringVar4, c); + schedule_bg_copy_tilemap_to_vram(2); +} + +static void sub_81B1D68(u16 item, u16 item2, u8 c) +{ + CopyItemName(item, gStringVar1); + CopyItemName(item2, gStringVar2); + StringExpandPlaceholders(gStringVar4, gText_SwitchedPkmnItem); + sub_81B1B5C(gStringVar4, c); + schedule_bg_copy_tilemap_to_vram(2); +} + +static void sub_81B1DB8(struct Pokemon *mon, u16 item) +{ + u8 itemBytes[2]; + + if (ItemIsMail(item) == TRUE) + { + if (GiveMailToMon(mon, item) == 0xFF) + return; + } + itemBytes[0] = item; + itemBytes[1] = item >> 8; + SetMonData(mon, MON_DATA_HELD_ITEM, itemBytes); +} + +static u8 sub_81B1E00(struct Pokemon* mon) +{ + u16 item = GetMonData(mon, MON_DATA_HELD_ITEM); + + if (item == ITEM_NONE) + return 0; + if (AddBagItem(item, 1) == FALSE) + return 1; + + item = ITEM_NONE; + SetMonData(mon, MON_DATA_HELD_ITEM, &item); + return 2; +} + +static void pokemon_item_not_removed(u16 itemUnused) +{ + StringExpandPlaceholders(gStringVar4, gText_BagFullCouldNotRemoveItem); +} + +static void sub_81B1E60(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + data[0] += data[2]; + data[3]--; + SetMonData(&gPlayerParty[data[4]], MON_DATA_HP, &data[0]); + DisplayPartyPokemonHPCheck(&gPlayerParty[data[4]], &gUnknown_0203CEDC[data[4]], 1); + DisplayPartyPokemonHPBarCheck(&gPlayerParty[data[4]], &gUnknown_0203CEDC[data[4]]); + if (data[3] == 0 || data[0] == 0 || data[0] == data[1]) + { + if (data[0] > data[5]) + ConvertIntToDecimalStringN(gStringVar2, data[0] - data[5], 0, 3); + SwitchTaskToFollowupFunc(taskId); + } +} + +void sub_81B1F18(u8 taskId, u8 slot, s8 c, s16 HPDifference, TaskFunc func) +{ + struct Pokemon *mon = &gPlayerParty[slot]; + s16 *data = gTasks[taskId].data; + + data[0] = GetMonData(mon, MON_DATA_HP); + data[1] = GetMonData(mon, MON_DATA_MAX_HP); + data[2] = c; + data[3] = HPDifference; + data[4] = slot; + data[5] = data[0]; + SetTaskFuncWithFollowupFunc(taskId, sub_81B1E60, func); +} + +static void sub_81B1FA8(u8 taskId, u8 b, u32 hp) +{ + s16 *data = gTasks[taskId].data; + + switch (b) // only case 0 is used + { + case 0: + data[0] = hp; + data[5] = hp; + break; + case 1: + data[1] = hp; + break; + case 2: + data[2] = hp; + break; + case 3: + data[3] = hp; + break; + case 4: + data[4] = hp; + break; + case 5: + SetTaskFuncWithFollowupFunc(taskId, sub_81B1E60, (TaskFunc)hp); // >casting hp as a taskfunc + break; + } +} + +u8 pokemon_ailments_get_primary(u32 status) +{ + if (status & STATUS1_PSN_ANY) + return AILMENT_PSN; + if (status & STATUS1_PARALYSIS) + return AILMENT_PRZ; + if (status & STATUS1_SLEEP) + return AILMENT_SLP; + if (status & STATUS1_FREEZE) + return AILMENT_FRZ; + if (status & STATUS1_BURN) + return AILMENT_BRN; + return AILMENT_NONE; +} + +u8 sub_81B205C(struct Pokemon *mon) +{ + u8 ailment; + + if (GetMonData(mon, MON_DATA_HP) == 0) + return AILMENT_FNT; + ailment = pokemon_ailments_get_primary(GetMonData(mon, MON_DATA_STATUS)); + if (ailment != AILMENT_NONE) + return ailment; + if (CheckPartyPokerus(mon, 0)) + return AILMENT_PKRS; + return AILMENT_NONE; +} + +static void sub_81B209C(void) +{ + u16 *ptr; + + if (gUnknown_0203CEC8.unk8_0 == 11) + { + u8 i; + + ptr = &gUnknown_0203CEC8.unkE; + gUnknown_0203CEC8.unkE = 0; + if (gSpecialVar_0x8005 == 0) + { + for (i = 0; i < gPlayerPartyCount; i++) + *ptr += sub_81B2134(&gPlayerParty[i]) << i; + } + else + { + for (i = 0; i < gPlayerPartyCount; i++) + *ptr += sub_81B2164(&gPlayerParty[i]) << i; + } + } +} + +static bool16 sub_81B2134(struct Pokemon *mon) +{ + if (GetMonData(mon, MON_DATA_IS_EGG) != TRUE && sub_802C908(GetMonData(mon, MON_DATA_SPECIES))) + return TRUE; + return FALSE; +} + +// Dodrio Berry Picking select? + +static bool16 sub_81B2164(struct Pokemon *mon) +{ + if (GetMonData(mon, MON_DATA_IS_EGG) != TRUE && GetMonData(mon, MON_DATA_SPECIES) == SPECIES_DODRIO) + return TRUE; + return FALSE; +} + +static bool8 sub_81B218C(u8 slot) +{ + if (!((gUnknown_0203CEC8.unkE >> slot) & 1)) + return FALSE; + return TRUE; +} + +static void sub_81B21AC(u8 taskId, u8 slot) +{ + if (sub_81B218C(slot) == TRUE) + { + PlaySE(SE_SELECT); + gSpecialVar_0x8004 = slot; + sub_81B12C0(taskId); + } + else + { + PlaySE(SE_HAZURE); + sub_81B1B5C(gText_PkmnCantParticipate, 0); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = sub_81B1C1C; + } +} + +static void sub_81B2210(u8 taskId) +{ + sub_81B1B5C(gText_CancelParticipation, 1); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = sub_81B2248; +} + +static void sub_81B2248(u8 taskId) +{ + if (sub_81B1BD4() != TRUE) + { + sub_81B334C(); + gTasks[taskId].func = sub_81B227C; + } +} + +static void sub_81B227C(u8 taskId) +{ + switch (Menu_ProcessInputNoWrapClearOnChoose()) + { + case 0: + gSpecialVar_0x8004 = 7; + sub_81B12C0(taskId); + break; + case MENU_B_PRESSED: + PlaySE(SE_SELECT); + case 1: + gTasks[taskId].func = sub_81B1C1C; + break; + } +} + +static u8 CanMonLearnTMTutor(struct Pokemon *mon, u16 item, u8 tutor) +{ + u16 move; + + if (GetMonData(mon, MON_DATA_IS_EGG)) + return CANNOT_LEARN_MOVE_IS_EGG; + + if (item >= ITEM_TM01_FOCUS_PUNCH) + { + if (CanMonLearnTMHM(mon, item - ITEM_TM01_FOCUS_PUNCH)) + move = ItemIdToBattleMoveId(item); + else + return CANNOT_LEARN_MOVE; + do {} while (0); // :morphon: + } + else if (CanLearnTutorMove(GetMonData(mon, MON_DATA_SPECIES), tutor) == FALSE) + { + return CANNOT_LEARN_MOVE; + } + else + { + move = GetTutorMove(tutor); + } + + if (MonKnowsMove(mon, move) == TRUE) + return ALREADY_KNOWS_MOVE; + else + return CAN_LEARN_MOVE; +} + +static u16 GetTutorMove(u8 tutor) +{ + return gTutorMoves[tutor]; +} + +static bool8 CanLearnTutorMove(u16 species, u8 tutor) +{ + if (sTutorLearnsets[species] & (1 << tutor)) + return TRUE; + else + return FALSE; +} + +static void sub_81B239C(u8 a) +{ + u8 i; + + switch (a) + { + case 0: + InitWindows(gUnknown_08615810); + break; + case 1: + InitWindows(gUnknown_08615850); + break; + case 2: + InitWindows(gUnknown_08615890); + break; + default: + InitWindows(gUnknown_086158D0); + break; + } + DeactivateAllTextPrinters(); + for (i = 0; i < PARTY_SIZE; i++) + FillWindowPixelBuffer(i, 0); + LoadUserWindowBorderGfx(0, 0x4F, 0xD0); + LoadPalette(GetOverworldTextboxPalettePtr(), 0xE0, 0x20); + LoadPalette(gUnknown_0860F074, 0xF0, 0x20); +} + +static void sub_81B2428(bool8 a) +{ + u8 firstWindowId; + u8 windowId; + u8 offset; + u8 mainOffset; + + if (gUnknown_0203CEC8.unk8_0 != 5) + { + if (a == TRUE) + { + firstWindowId = AddWindow(&gUnknown_08615918); + FillWindowPixelBuffer(firstWindowId, 0); + mainOffset = GetStringCenterAlignXOffset(0, gMenuText_Confirm, 48); + AddTextPrinterParameterized4(firstWindowId, 0, mainOffset, 1, 0, 0, gUnknown_086157FC[0], -1, gMenuText_Confirm); + PutWindowTilemap(firstWindowId); + CopyWindowToVram(firstWindowId, 2); + windowId = AddWindow(&gUnknown_08615910); + offset = 0; + } + else + { + windowId = AddWindow(&gUnknown_08615908); + offset = 3; + } + FillWindowPixelBuffer(windowId, 0); + if (gUnknown_0203CEC8.unk8_0 != 10) + { + mainOffset = GetStringCenterAlignXOffset(0, gText_Cancel, 48); + AddTextPrinterParameterized3(windowId, 0, mainOffset + offset, 1, gUnknown_086157FC[0], -1, gText_Cancel); + } + else + { + mainOffset = GetStringCenterAlignXOffset(0, gText_Cancel2, 48); + AddTextPrinterParameterized3(windowId, 0, mainOffset + offset, 1, gUnknown_086157FC[0], -1, gText_Cancel2); + } + PutWindowTilemap(windowId); + CopyWindowToVram(windowId, 2); + schedule_bg_copy_tilemap_to_vram(0); + } +} + +static u16* GetPartyMenuPaletteFromBuffer(u8 paletteId) +{ + return &gUnknown_0203CEC4->palBuffer[paletteId]; +} + +static void BlitBitmapToPartyWindow(u8 windowId, const u8 *b, u8 c, u8 x, u8 y, u8 width, u8 height) +{ + u8 *pixels = AllocZeroed(height * width * 32); + u8 i, j; + + if (pixels != NULL) + { + for (i = 0; i < height; i++) + { + for (j = 0; j < width; j++) + CpuCopy16(GetPartyMiscGraphicsTile(b[x + j + ((y + i) * c)]), &pixels[(i * width + j) * 32], 32); + } + BlitBitmapToWindow(windowId, pixels, x * 8, y * 8, width * 8, height * 8); + Free(pixels); + } +} + +static void BlitBitmapToPartyWindow_Default1(u8 windowId, u8 x, u8 y, u8 width, u8 height, u8 f) +{ + if (width == 0 && height == 0) + { + width = 10; + height = 7; + } + if (f == 0) + BlitBitmapToPartyWindow(windowId, gUnknown_08615988, 10, x, y, width, height); + else + BlitBitmapToPartyWindow(windowId, gUnknown_086159CE, 10, x, y, width, height); +} + +static void BlitBitmapToPartyWindow_Default2(u8 windowId, u8 x, u8 y, u8 width, u8 height, u8 f) +{ + if (width == 0 && height == 0) + { + width = 18; + height = 3; + } + if (f == 0) + BlitBitmapToPartyWindow(windowId, gUnknown_08615A14, 18, x, y, width, height); + else + BlitBitmapToPartyWindow(windowId, gUnknown_08615A4A, 18, x, y, width, height); +} + +static void sub_81B2720(u8 windowId) +{ + BlitBitmapToPartyWindow(windowId, gUnknown_08615A80, 18, 0, 0, 18, 3); +} + +static void UpdateSelectedPartyBox(struct Struct203CEDC *ptr, u8 bitfield) +{ + u8 palNum = GetWindowAttribute(ptr->windowId, WINDOW_PALETTE_NUM) * 16; + + if (bitfield & 0x40) + { + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AF1[0]), gUnknown_08615AC0[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AF1[1]), gUnknown_08615AC0[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AF1[2]), gUnknown_08615AC0[2] + palNum, 2); + } + else if (bitfield & 0x20) + { + if (bitfield & 1) + { + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ADF[0]), gUnknown_08615ABA[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ADF[1]), gUnknown_08615ABA[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ADF[2]), gUnknown_08615ABA[2] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEB[0]), gUnknown_08615ABD[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEB[1]), gUnknown_08615ABD[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEB[2]), gUnknown_08615ABD[2] + palNum, 2); + } + else + { + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ADF[0]), gUnknown_08615ABA[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ADF[1]), gUnknown_08615ABA[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ADF[2]), gUnknown_08615ABA[2] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEE[0]), gUnknown_08615ABD[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEE[1]), gUnknown_08615ABD[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEE[2]), gUnknown_08615ABD[2] + palNum, 2); + } + } + else if (bitfield & 0x10) + { + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ADF[0]), gUnknown_08615ABA[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ADF[1]), gUnknown_08615ABA[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ADF[2]), gUnknown_08615ABA[2] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEE[0]), gUnknown_08615ABD[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEE[1]), gUnknown_08615ABD[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEE[2]), gUnknown_08615ABD[2] + palNum, 2); + } + else if (bitfield & 4) + { + if (bitfield & 1) + { + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ADF[0]), gUnknown_08615ABA[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ADF[1]), gUnknown_08615ABA[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ADF[2]), gUnknown_08615ABA[2] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEB[0]), gUnknown_08615ABD[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEB[1]), gUnknown_08615ABD[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEB[2]), gUnknown_08615ABD[2] + palNum, 2); + } + else + { + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ADF[0]), gUnknown_08615ABA[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ADF[1]), gUnknown_08615ABA[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ADF[2]), gUnknown_08615ABA[2] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEE[0]), gUnknown_08615ABD[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEE[1]), gUnknown_08615ABD[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEE[2]), gUnknown_08615ABD[2] + palNum, 2); + } + } + else if (bitfield & 2) + { + if (bitfield & 1) + { + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ADC[0]), gUnknown_08615ABA[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ADC[1]), gUnknown_08615ABA[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ADC[2]), gUnknown_08615ABA[2] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEB[0]), gUnknown_08615ABD[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEB[1]), gUnknown_08615ABD[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEB[2]), gUnknown_08615ABD[2] + palNum, 2); + } + else + { + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AD3[0]), gUnknown_08615ABA[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AD3[1]), gUnknown_08615ABA[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AD3[2]), gUnknown_08615ABA[2] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AE8[0]), gUnknown_08615ABD[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AE8[1]), gUnknown_08615ABD[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AE8[2]), gUnknown_08615ABD[2] + palNum, 2); + } + } + else if (bitfield & 8) + { + if (bitfield & 1) + { + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AD9[0]), gUnknown_08615ABA[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AD9[1]), gUnknown_08615ABA[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AD9[2]), gUnknown_08615ABA[2] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEB[0]), gUnknown_08615ABD[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEB[1]), gUnknown_08615ABD[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEB[2]), gUnknown_08615ABD[2] + palNum, 2); + } + else + { + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AD0[0]), gUnknown_08615ABA[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AD0[1]), gUnknown_08615ABA[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AD0[2]), gUnknown_08615ABA[2] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AE5[0]), gUnknown_08615ABD[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AE5[1]), gUnknown_08615ABD[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AE5[2]), gUnknown_08615ABD[2] + palNum, 2); + } + } + else if (bitfield & 1) + { + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AD6[0]), gUnknown_08615ABA[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AD6[1]), gUnknown_08615ABA[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AD6[2]), gUnknown_08615ABA[2] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEB[0]), gUnknown_08615ABD[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEB[1]), gUnknown_08615ABD[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AEB[2]), gUnknown_08615ABD[2] + palNum, 2); + } + else + { + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ACD[0]), gUnknown_08615ABA[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ACD[1]), gUnknown_08615ABA[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ACD[2]), gUnknown_08615ABA[2] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AE2[0]), gUnknown_08615ABD[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AE2[1]), gUnknown_08615ABD[1] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AE2[2]), gUnknown_08615ABD[2] + palNum, 2); + } +} + +static void DisplayPartyPokemonBarDetail(u8 windowId, const u8 *str, u8 color, const u8 *align) +{ + AddTextPrinterParameterized3(windowId, 0, align[0], align[1], gUnknown_086157FC[color], 0, str); +} + +static void DisplayPartyPokemonNickname(struct Pokemon *mon, struct Struct203CEDC *ptr, u8 c) +{ + u8 nickname[POKEMON_NAME_LENGTH + 1]; + + if (GetMonData(mon, MON_DATA_SPECIES) != SPECIES_NONE) + { + if (c == 1) + ptr->unk0->unk0(ptr->windowId, ptr->unk0->unk4[0] >> 3, ptr->unk0->unk4[1] >> 3, ptr->unk0->unk4[2] >> 3, ptr->unk0->unk4[3] >> 3, 0); + GetMonNickname(mon, nickname); + DisplayPartyPokemonBarDetail(ptr->windowId, nickname, 0, ptr->unk0->unk4); + } +} + +static void DisplayPartyPokemonLevelCheck(struct Pokemon *mon, struct Struct203CEDC *ptr, u8 c) +{ + if (GetMonData(mon, MON_DATA_SPECIES) != SPECIES_NONE) + { + u8 ailment = sub_81B205C(mon); + if (ailment == AILMENT_NONE || ailment == AILMENT_PKRS) + { + if (c != 0) + ptr->unk0->unk0(ptr->windowId, ptr->unk0->unk4[4] >> 3, (ptr->unk0->unk4[5] >> 3) + 1, ptr->unk0->unk4[6] >> 3, ptr->unk0->unk4[7] >> 3, 0); + if (c != 2) + DisplayPartyPokemonLevel(GetMonData(mon, MON_DATA_LEVEL), ptr); + } + } +} + +static void DisplayPartyPokemonLevel(u8 level, struct Struct203CEDC *ptr) +{ + ConvertIntToDecimalStringN(gStringVar2, level, 0, 3); + StringCopy(gStringVar1, gText_LevelSymbol); + StringAppend(gStringVar1, gStringVar2); + DisplayPartyPokemonBarDetail(ptr->windowId, gStringVar1, 0, &ptr->unk0->unk4[4]); +} + +static void DisplayPartyPokemonGenderNidoranCheck(struct Pokemon *mon, struct Struct203CEDC *ptr, u8 c) +{ + u8 nickname[POKEMON_NAME_LENGTH + 1]; + + if (c == 1) + ptr->unk0->unk0(ptr->windowId, ptr->unk0->unk4[8] >> 3, (ptr->unk0->unk4[9] >> 3) + 1, ptr->unk0->unk4[10] >> 3, ptr->unk0->unk4[11] >> 3, 0); + GetMonNickname(mon, nickname); + DisplayPartyPokemonGender(GetMonGender(mon), GetMonData(mon, MON_DATA_SPECIES), nickname, ptr); +} + +static void DisplayPartyPokemonGender(u8 gender, u16 species, u8 *nickname, struct Struct203CEDC *ptr) +{ + u8 palNum = GetWindowAttribute(ptr->windowId, WINDOW_PALETTE_NUM) * 16; + + if (species == SPECIES_NONE) + return; + if ((species == SPECIES_NIDORAN_M || species == SPECIES_NIDORAN_F) && StringCompare(nickname, gSpeciesNames[species]) == 0) + return; + switch (gender) + { + case MON_MALE: + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AC3[0]), gUnknown_08615AB6[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AC3[1]), gUnknown_08615AB6[1] + palNum, 2); + DisplayPartyPokemonBarDetail(ptr->windowId, gText_MaleSymbol, 2, &ptr->unk0->unk4[8]); + break; + case MON_FEMALE: + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AC5[0]), gUnknown_08615AB6[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AC5[1]), gUnknown_08615AB6[1] + palNum, 2); + DisplayPartyPokemonBarDetail(ptr->windowId, gText_FemaleSymbol, 2, &ptr->unk0->unk4[8]); + break; + } +} + +static void DisplayPartyPokemonHPCheck(struct Pokemon *mon, struct Struct203CEDC *ptr, u8 c) +{ + if (GetMonData(mon, MON_DATA_SPECIES) != SPECIES_NONE) + { + if (c != 0) + ptr->unk0->unk0(ptr->windowId, ptr->unk0->unk4[12] >> 3, (ptr->unk0->unk4[13] >> 3) + 1, ptr->unk0->unk4[14] >> 3, ptr->unk0->unk4[15] >> 3, 0); + if (c != 2) + DisplayPartyPokemonHP(GetMonData(mon, MON_DATA_HP), ptr); + } +} + +static void DisplayPartyPokemonHP(u16 hp, struct Struct203CEDC *ptr) +{ + u8 *strOut = ConvertIntToDecimalStringN(gStringVar1, hp, 1, 3); + + strOut[0] = CHAR_SLASH; + strOut[1] = EOS; + + DisplayPartyPokemonBarDetail(ptr->windowId, gStringVar1, 0, &ptr->unk0->unk4[12]); +} + +static void DisplayPartyPokemonMaxHPCheck(struct Pokemon *mon, struct Struct203CEDC *ptr, u8 c) +{ + if (GetMonData(mon, MON_DATA_SPECIES) != SPECIES_NONE) + { + if (c != 0) + ptr->unk0->unk0(ptr->windowId, (ptr->unk0->unk4[16] >> 3) + 1, (ptr->unk0->unk4[17] >> 3) + 1, ptr->unk0->unk4[18] >> 3, ptr->unk0->unk4[19] >> 3, 0); + if (c != 2) + DisplayPartyPokemonMaxHP(GetMonData(mon, MON_DATA_MAX_HP), ptr); + } +} + +static void DisplayPartyPokemonMaxHP(u16 maxhp, struct Struct203CEDC *ptr) +{ + ConvertIntToDecimalStringN(gStringVar2, maxhp, 1, 3); + StringCopy(gStringVar1, gText_Slash); + StringAppend(gStringVar1, gStringVar2); + DisplayPartyPokemonBarDetail(ptr->windowId, gStringVar1, 0, &ptr->unk0->unk4[16]); +} + +static void DisplayPartyPokemonHPBarCheck(struct Pokemon *mon, struct Struct203CEDC *ptr) +{ + if (GetMonData(mon, MON_DATA_SPECIES) != SPECIES_NONE) + DisplayPartyPokemonHPBar(GetMonData(mon, MON_DATA_HP), GetMonData(mon, MON_DATA_MAX_HP), ptr); +} + +static void DisplayPartyPokemonHPBar(u16 hp, u16 maxhp, struct Struct203CEDC *ptr) +{ + u8 palNum = GetWindowAttribute(ptr->windowId, WINDOW_PALETTE_NUM) * 16; + u8 hpFraction; + + switch (GetHPBarLevel(hp, maxhp)) + { + case HP_BAR_GREEN: + case HP_BAR_FULL: + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AC7[0]), gUnknown_08615AB8[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AC7[1]), gUnknown_08615AB8[1] + palNum, 2); + break; + case HP_BAR_YELLOW: + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AC9[0]), gUnknown_08615AB8[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615AC9[1]), gUnknown_08615AB8[1] + palNum, 2); + break; + default: + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ACB[0]), gUnknown_08615AB8[0] + palNum, 2); + LoadPalette(GetPartyMenuPaletteFromBuffer(gUnknown_08615ACB[1]), gUnknown_08615AB8[1] + palNum, 2); + break; + } + + hpFraction = GetScaledHPFraction(hp, maxhp, ptr->unk0->unk4[22]); + FillWindowPixelRect(ptr->windowId, gUnknown_08615AB8[1], ptr->unk0->unk4[20], ptr->unk0->unk4[21], hpFraction, 1); + FillWindowPixelRect(ptr->windowId, gUnknown_08615AB8[0], ptr->unk0->unk4[20], ptr->unk0->unk4[21] + 1, hpFraction, 2); + if (hpFraction != ptr->unk0->unk4[22]) + { + FillWindowPixelRect(ptr->windowId, 13, ptr->unk0->unk4[20] + hpFraction, ptr->unk0->unk4[21], ptr->unk0->unk4[22] - hpFraction, 1); + FillWindowPixelRect(ptr->windowId, 2, ptr->unk0->unk4[20] + hpFraction, ptr->unk0->unk4[21] + 1, ptr->unk0->unk4[22] - hpFraction, 2); + } + CopyWindowToVram(ptr->windowId, 2); +} + +static void DisplayPartyPokemonOtherText(u8 stringID, struct Struct203CEDC *ptr, u8 c) +{ + if (c != 0) + { + int unk = ((ptr->unk0->unk1C % 8) + ptr->unk0->unk1E + 7) / 8; + int unk2 = ((ptr->unk0->unk1D % 8) + ptr->unk0->unk1F + 7) / 8; + ptr->unk0->unk0(ptr->windowId, ptr->unk0->unk1C >> 3, ptr->unk0->unk1D >> 3, unk, unk2, 1); + } + if (c != 2) + AddTextPrinterParameterized3(ptr->windowId, 1, ptr->unk0->unk1C, ptr->unk0->unk1D, gUnknown_086157FC[0], 0, gUnknown_08615B60[stringID]); +} + +static void sub_81B302C(u8 *ptr) +{ + if (*ptr != 0xFF) + { + sub_8198070(*ptr, 0); + RemoveWindow(*ptr); + *ptr = 0xFF; + schedule_bg_copy_tilemap_to_vram(2); + } +} + +void display_pokemon_menu_message(u32 stringID) +{ + u8 *windowPtr = &gUnknown_0203CEC4->unkC[1]; + + if (*windowPtr != 0xFF) + sub_81B302C(windowPtr); + + if (stringID != 0x7F) + { + switch (stringID) + { + case 21: + *windowPtr = AddWindow(&gUnknown_08615928); + break; + case 24: + *windowPtr = AddWindow(&gUnknown_08615930); + break; + case 25: + *windowPtr = AddWindow(&gUnknown_08615938); + break; + case 22: + case 23: + *windowPtr = AddWindow(&gUnknown_08615940); + break; + case 26: + *windowPtr = AddWindow(&gUnknown_08615948); + break; + default: + *windowPtr = AddWindow(&gUnknown_08615920); + break; + } + if (stringID == 0) + { + if (gUnknown_0203CEC4->unk8_0) + stringID = 2; + else if (sub_81B314C() == FALSE) + stringID = 1; + } + SetWindowBorderStyle(*windowPtr, FALSE, 0x4F, 0xD); + StringExpandPlaceholders(gStringVar4, gUnknown_08615AF4[stringID]); + AddTextPrinterParameterized(*windowPtr, 1, gStringVar4, 0, 1, 0, 0); + schedule_bg_copy_tilemap_to_vram(2); + } +} + +static bool8 sub_81B314C(void) +{ + struct Pokemon *party = gPlayerParty; + u8 i; + u8 j = 0; + + if (gUnknown_0203CEC8.unkB == 1) + return TRUE; + + for (i = 0; i < 6; i++) + { + if (GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE && (GetMonData(&party[i], MON_DATA_HP) != 0 || GetMonData(&party[i], MON_DATA_IS_EGG))) + j++; + if (j > 1) + return TRUE; + } + return FALSE; +} + +static u8 sub_81B31B0(u8 a) +{ + struct WindowTemplate window; + u8 cursorDimension; + u8 fontAttribute; + u8 i; + + switch (a) + { + case 0: + SetWindowTemplateFields(&window, 2, 19, 19 - (gUnknown_0203CEC4->unk17 * 2), 10, gUnknown_0203CEC4->unk17 * 2, 14, 0x2E9); + break; + case 1: + window = gUnknown_08615950; + break; + case 2: + window = gUnknown_08615958; + break; + default: + window = gUnknown_08615960; + break; + } + + gUnknown_0203CEC4->unkC[0] = AddWindow(&window); + SetWindowBorderStyle(gUnknown_0203CEC4->unkC[0], FALSE, 0x4F, 13); + if (a == 3) + return gUnknown_0203CEC4->unkC[0]; + cursorDimension = GetMenuCursorDimensionByFont(1, 0); + fontAttribute = GetFontAttribute(1, 2); + + for (i = 0; i < gUnknown_0203CEC4->unk17; i++) + { + u8 unk = (gUnknown_0203CEC4->unkF[i] > 18) ? 4 : 3; + AddTextPrinterParameterized4(gUnknown_0203CEC4->unkC[0], 1, cursorDimension, (i * 16) + 1, fontAttribute, 0, gUnknown_086157FC[unk], 0, sCursorOptions[gUnknown_0203CEC4->unkF[i]].text); + } + + InitMenuInUpperLeftCorner(gUnknown_0203CEC4->unkC[0], gUnknown_0203CEC4->unk17, 0, 1); + schedule_bg_copy_tilemap_to_vram(2); + + return gUnknown_0203CEC4->unkC[0]; +} + +static void sub_81B3300(const u8 *text) +{ + SetWindowBorderStyle(6, FALSE, 0x4F, 13); + gTextFlags.canABSpeedUpPrint = TRUE; + AddTextPrinterParameterized2(6, 1, text, GetPlayerTextSpeedDelay(), 0, 2, 1, 3); +} + +static void sub_81B334C(void) +{ + CreateYesNoMenu(&gUnknown_08615968, 0x4F, 13, 0); +} + +static u8 sub_81B3364(void) +{ + gUnknown_0203CEC4->unkC[0] = AddWindow(&gUnknown_08615970); + SetWindowBorderStyle(gUnknown_0203CEC4->unkC[0], FALSE, 0x4F, 13); + return gUnknown_0203CEC4->unkC[0]; +} + +static void sub_81B3394(void) +{ + ClearWindowTilemap(gUnknown_0203CEC4->unkC[0]); + sub_81B302C(&gUnknown_0203CEC4->unkC[0]); +} + +static void sub_81B33B4(struct Pokemon *mons, u8 a, u8 b) +{ + u8 i; + + if (b == 0) + { + sub_81B3414(mons, a); + } + else + { + gUnknown_0203CEC4->unk17 = gUnknown_08615D70[b]; + for (i = 0; i < gUnknown_0203CEC4->unk17; i++) + gUnknown_0203CEC4->unkF[i] = gUnknown_08615D38[b][i]; + } +} + +static void sub_81B3414(struct Pokemon *mons, u8 a) +{ + u8 i, j; + + gUnknown_0203CEC4->unk17 = 0; + AppendToList(gUnknown_0203CEC4->unkF, &gUnknown_0203CEC4->unk17, 0); + for (i = 0; i < MAX_MON_MOVES; i++) + { + for (j = 0; sFieldMoves[j] != FIELD_MOVE_TERMINATOR; j++) + { + if (GetMonData(&mons[a], i + MON_DATA_MOVE1) == sFieldMoves[j]) + { + AppendToList(gUnknown_0203CEC4->unkF, &gUnknown_0203CEC4->unk17, j + 19); + break; + } + } + } + + if (!InBattlePike()) + { + if (GetMonData(&mons[1], MON_DATA_SPECIES) != SPECIES_NONE) + AppendToList(gUnknown_0203CEC4->unkF, &gUnknown_0203CEC4->unk17, 1); + if (ItemIsMail(GetMonData(&mons[a], MON_DATA_HELD_ITEM))) + AppendToList(gUnknown_0203CEC4->unkF, &gUnknown_0203CEC4->unk17, 6); + else + AppendToList(gUnknown_0203CEC4->unkF, &gUnknown_0203CEC4->unk17, 3); + } + AppendToList(gUnknown_0203CEC4->unkF, &gUnknown_0203CEC4->unk17, 2); +} + +static u8 sub_81B353C(struct Pokemon *mon) +{ + u32 returnVar; + + switch (gUnknown_0203CEC8.unk8_0) + { + case 0: + if (InMultiBattleRoom() == TRUE || GetMonData(mon, MON_DATA_IS_EGG)) + returnVar = 1; + else + returnVar = 0; + break; + case 1: + returnVar = sub_81B8A2C(mon); + break; + case 4: + switch (sub_81B856C(gUnknown_0203CEC8.unk9)) + { + default: + returnVar = 7; + break; + case 0: + returnVar = 4; + break; + case 1: + returnVar = 5; + break; + } + break; + case 6: + returnVar = (GetMonData(mon, MON_DATA_IS_EGG)) ? 7 : 6; + break; + case 8: + returnVar = 10; + break; + case 9: + returnVar = 11; + break; + case 10: + returnVar = 12; + break; + case 12: + returnVar = 13; + break; + default: + returnVar = 0; + break; + } + return returnVar; +} + +static bool8 sub_81B3608(u8 taskId) +{ + struct Pokemon *mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + u16 item; + + GetMonNickname(mon, gStringVar1); + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + if (gUnknown_0203CEC8.unk8_0 != 12) + { + sub_81B33B4(gPlayerParty, gUnknown_0203CEC8.unk9, sub_81B353C(mon)); + sub_81B31B0(0); + display_pokemon_menu_message(21); + } + else + { + item = GetMonData(mon, MON_DATA_HELD_ITEM); + if (item != ITEM_NONE) + { + sub_81B33B4(gPlayerParty, gUnknown_0203CEC8.unk9, sub_81B353C(mon)); + sub_81B31B0(1); + CopyItemName(item, gStringVar2); + display_pokemon_menu_message(26); + } + else + { + StringExpandPlaceholders(gStringVar4, gText_PkmnNotHolding); + sub_81B1B5C(gStringVar4, 1); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = sub_81B469C; + return FALSE; + } + } + return TRUE; +} + +static void sub_81B36FC(u8 taskId) +{ + if (sub_81B3608(taskId)) + { + gTasks[taskId].data[0] = 0xFF; + gTasks[taskId].func = HandleMenuInput; + } +} + +static void HandleMenuInput(u8 taskId) +{ + if (!gPaletteFade.active && sub_81221EC() != TRUE) + { + s8 input; + s16 *data = gTasks[taskId].data; + + if (gUnknown_0203CEC4->unk17 <= 3) + input = Menu_ProcessInputNoWrapAround_other(); + else + input = ProcessMenuInput_other(); + + data[0] = Menu_GetCursorPos(); + switch (input) + { + case MENU_NOTHING_CHOSEN: + break; + case MENU_B_PRESSED: + PlaySE(SE_SELECT); + sub_81B302C(&gUnknown_0203CEC4->unkC[2]); + sCursorOptions[gUnknown_0203CEC4->unkF[gUnknown_0203CEC4->unk17 - 1]].func(taskId); + break; + default: + sub_81B302C(&gUnknown_0203CEC4->unkC[2]); + sCursorOptions[gUnknown_0203CEC4->unkF[input]].func(taskId); + break; + } + } +} + +static void CursorCb_Summary(u8 taskId) +{ + PlaySE(SE_SELECT); + gUnknown_0203CEC4->exitCallback = sub_81B3828; + sub_81B12C0(taskId); +} + +static void sub_81B3828(void) +{ + if (gUnknown_0203CEC8.unk8_0 == 1) + { + pokemon_change_order(); + ShowPokemonSummaryScreen(PSS_MODE_UNK1, gPlayerParty, gUnknown_0203CEC8.unk9, gPlayerPartyCount - 1, sub_81B3894); + } + else + { + ShowPokemonSummaryScreen(PSS_MODE_NORMAL, gPlayerParty, gUnknown_0203CEC8.unk9, gPlayerPartyCount - 1, sub_81B3894); + } +} + +static void sub_81B3894(void) +{ + gPaletteFade.bufferTransferDisabled = TRUE; + gUnknown_0203CEC8.unk9 = gUnknown_0203CF20; + InitPartyMenu(gUnknown_0203CEC8.unk8_0, 0xFF, gUnknown_0203CEC8.unkB, 1, 21, sub_81B36FC, gUnknown_0203CEC8.exitCallback); +} + +static void CursorCb_Switch(u8 taskId) +{ + PlaySE(SE_SELECT); + gUnknown_0203CEC8.unkB = 8; + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + sub_81B302C(&gUnknown_0203CEC4->unkC[0]); + display_pokemon_menu_message(3); + sub_81B0FCC(gUnknown_0203CEC8.unk9, 1); + gUnknown_0203CEC8.unkA = gUnknown_0203CEC8.unk9; + gTasks[taskId].func = sub_81B1370; +} + +static void sub_81B3938(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + u8 windowIds[2]; + + if (gUnknown_0203CEC8.unkA == gUnknown_0203CEC8.unk9) + { + sub_81B407C(taskId); + } + else + { + windowIds[0] = gUnknown_0203CEDC[gUnknown_0203CEC8.unk9].windowId; + data[0] = GetWindowAttribute(windowIds[0], WINDOW_TILEMAP_LEFT); + data[1] = GetWindowAttribute(windowIds[0], WINDOW_TILEMAP_TOP); + data[2] = GetWindowAttribute(windowIds[0], WINDOW_WIDTH); + data[3] = GetWindowAttribute(windowIds[0], WINDOW_HEIGHT); + data[8] = 0; + if (data[2] == 10) + data[10] = -1; + else + data[10] = 1; + windowIds[1] = gUnknown_0203CEDC[gUnknown_0203CEC8.unkA].windowId; + data[4] = GetWindowAttribute(windowIds[1], WINDOW_TILEMAP_LEFT); + data[5] = GetWindowAttribute(windowIds[1], WINDOW_TILEMAP_TOP); + data[6] = GetWindowAttribute(windowIds[1], WINDOW_WIDTH); + data[7] = GetWindowAttribute(windowIds[1], WINDOW_HEIGHT); + data[9] = 0; + if (data[6] == 10) + data[11] = -1; + else + data[11] = 1; + gUnknown_0203CEF0 = Alloc(data[2] * (data[3] << 1)); + gUnknown_0203CEF4 = Alloc(data[6] * (data[7] << 1)); + sub_8199CBC(0, gUnknown_0203CEF0, data[0], data[1], data[2], data[3]); + sub_8199CBC(0, gUnknown_0203CEF4, data[4], data[5], data[6], data[7]); + ClearWindowTilemap(windowIds[0]); + ClearWindowTilemap(windowIds[1]); + gUnknown_0203CEC8.unkB = 9; + sub_81B0FCC(gUnknown_0203CEC8.unk9, 1); + sub_81B0FCC(gUnknown_0203CEC8.unkA, 1); + sub_81B3CC0(taskId); + gTasks[taskId].func = sub_81B3D48; + } +} + +static bool8 sub_81B3AD8(s16 a, s16 b, u8 *c, u8 *d, u8 *e) +{ + if ((a + b) < 0) + return FALSE; + if (a > 31) + return FALSE; + + if (a < 0) + { + *c = a * -1; + *d = 0; + *e = b + a; + } + else + { + *c = 0; + *d = a; + if ((a + b) > 31) + *e = 32 - a; + else + *e = b; + + } + return TRUE; +} + +static void sub_81B3B40(const void *rectSrc, s16 a, s16 b, s16 c, s16 d, s16 e) +{ + u8 f, g, h; + + if (sub_81B3AD8(a, c, &f, &g, &h)) + { + FillBgTilemapBufferRect_Palette0(0, 0, g, b, h, d); + if (sub_81B3AD8(a + e, c, &f, &g, &h)) + CopyRectToBgTilemapBufferRect(0, rectSrc, f, 0, c, d, g, b, h, d, 17, 0, 0); + } +} + +static void sub_81B3C0C(struct Struct203CEDC *ptr, s16 a) +{ + gSprites[ptr->unkB].pos2.x += a * 8; + gSprites[ptr->unkA].pos2.x += a * 8; + gSprites[ptr->unk9].pos2.x += a * 8; + gSprites[ptr->unkC].pos2.x += a * 8; +} + +static void sub_81B3C60(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + if (data[10] != 0) + sub_81B3C0C(&gUnknown_0203CEDC[gUnknown_0203CEC8.unk9], data[10]); + if (data[11] != 0) + sub_81B3C0C(&gUnknown_0203CEDC[gUnknown_0203CEC8.unkA], data[11]); +} + +static void sub_81B3CC0(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + if (data[10] != 0) + sub_81B3B40(gUnknown_0203CEF0, data[0] + data[8], data[1], data[2], data[3], data[10]); + if (data[11] != 0) + sub_81B3B40(gUnknown_0203CEF4, data[4] + data[9], data[5], data[6], data[7], data[11]); + schedule_bg_copy_tilemap_to_vram(0); +} + +static void sub_81B3D48(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + u16 tilemapRelatedMaybe[2]; + + sub_81B3CC0(taskId); + sub_81B3C60(taskId); + data[8] += data[10]; + data[9] += data[11]; + tilemapRelatedMaybe[0] = data[0] + data[8]; + tilemapRelatedMaybe[1] = data[4] + data[9]; + if (tilemapRelatedMaybe[0] > 33 && tilemapRelatedMaybe[1] > 33) + { + data[10] *= -1; + data[11] *= -1; + swap_pokemon_and_oams(); + DisplayPartyPokemonData(gUnknown_0203CEC8.unk9); + DisplayPartyPokemonData(gUnknown_0203CEC8.unkA); + PutWindowTilemap(gUnknown_0203CEDC[gUnknown_0203CEC8.unk9].windowId); + PutWindowTilemap(gUnknown_0203CEDC[gUnknown_0203CEC8.unkA].windowId); + sub_8199CBC(0, gUnknown_0203CEF0, data[0], data[1], data[2], data[3]); + sub_8199CBC(0, gUnknown_0203CEF4, data[4], data[5], data[6], data[7]); + ClearWindowTilemap(gUnknown_0203CEDC[gUnknown_0203CEC8.unk9].windowId); + ClearWindowTilemap(gUnknown_0203CEDC[gUnknown_0203CEC8.unkA].windowId); + gTasks[taskId].func = sub_81B3E60; + } +} + +static void sub_81B3E60(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + sub_81B3CC0(taskId); + sub_81B3C60(taskId); + if (data[10] == 0 && data[11] == 0) + { + PutWindowTilemap(gUnknown_0203CEDC[gUnknown_0203CEC8.unk9].windowId); + PutWindowTilemap(gUnknown_0203CEDC[gUnknown_0203CEC8.unkA].windowId); + schedule_bg_copy_tilemap_to_vram(0); + Free(gUnknown_0203CEF0); + Free(gUnknown_0203CEF4); + sub_81B407C(taskId); + } + else + { + data[8] += data[10]; + data[9] += data[11]; + if (data[8] == 0) + data[10] = 0; + if (data[9] == 0) + data[11] = 0; + } +} + +static void oamt_swap_pos(u8 *spriteIdPtr1, u8 *spriteIdPtr2) +{ + u8 spriteIdBuffer = *spriteIdPtr1; + u16 xBuffer1, yBuffer1, xBuffer2, yBuffer2; + + *spriteIdPtr1 = *spriteIdPtr2; + *spriteIdPtr2 = spriteIdBuffer; + xBuffer1 = gSprites[*spriteIdPtr1].pos1.x; + yBuffer1 = gSprites[*spriteIdPtr1].pos1.y; + xBuffer2 = gSprites[*spriteIdPtr1].pos2.x; + yBuffer2 = gSprites[*spriteIdPtr1].pos2.y; + gSprites[*spriteIdPtr1].pos1.x = gSprites[*spriteIdPtr2].pos1.x; + gSprites[*spriteIdPtr1].pos1.y = gSprites[*spriteIdPtr2].pos1.y; + gSprites[*spriteIdPtr1].pos2.x = gSprites[*spriteIdPtr2].pos2.x; + gSprites[*spriteIdPtr1].pos2.y = gSprites[*spriteIdPtr2].pos2.y; + gSprites[*spriteIdPtr2].pos1.x = xBuffer1; + gSprites[*spriteIdPtr2].pos1.y = yBuffer1; + gSprites[*spriteIdPtr2].pos2.x = xBuffer2; + gSprites[*spriteIdPtr2].pos2.y = yBuffer2; +} + +static void swap_pokemon_and_oams(void) +{ + struct Struct203CEDC *structPtrs[2]; + struct Pokemon *mon1, *mon2; + struct Pokemon *monBuffer; + + structPtrs[0] = &gUnknown_0203CEDC[gUnknown_0203CEC8.unk9]; + structPtrs[1] = &gUnknown_0203CEDC[gUnknown_0203CEC8.unkA]; + mon1 = &gPlayerParty[gUnknown_0203CEC8.unk9]; + mon2 = &gPlayerParty[gUnknown_0203CEC8.unkA]; + monBuffer = Alloc(sizeof(struct Pokemon)); + *monBuffer = *mon1; + *mon1 = *mon2; + *mon2 = *monBuffer; + Free(monBuffer); + oamt_swap_pos(&structPtrs[0]->unkB, &structPtrs[1]->unkB); + oamt_swap_pos(&structPtrs[0]->unkA, &structPtrs[1]->unkA); + oamt_swap_pos(&structPtrs[0]->unk9, &structPtrs[1]->unk9); + oamt_swap_pos(&structPtrs[0]->unkC, &structPtrs[1]->unkC); +} + +static void sub_81B407C(u8 taskId) +{ + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + gUnknown_0203CEC8.unkB = 0; + sub_81B0FCC(gUnknown_0203CEC8.unk9, 0); + gUnknown_0203CEC8.unk9 = gUnknown_0203CEC8.unkA; + sub_81B0FCC(gUnknown_0203CEC8.unkA, 1); + display_pokemon_menu_message(0); + gTasks[taskId].func = sub_81B1370; +} + +static void CursorCb_Cancel1(u8 taskId) +{ + PlaySE(SE_SELECT); + sub_81B302C(&gUnknown_0203CEC4->unkC[0]); + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + if (gUnknown_0203CEC8.unk8_0 == 6) + display_pokemon_menu_message(15); + else + display_pokemon_menu_message(0); + gTasks[taskId].func = sub_81B1370; +} + +static void CursorCb_Item(u8 taskId) +{ + PlaySE(SE_SELECT); + sub_81B302C(&gUnknown_0203CEC4->unkC[0]); + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + sub_81B33B4(gPlayerParty, gUnknown_0203CEC8.unk9, 8); + sub_81B31B0(1); + display_pokemon_menu_message(24); + gTasks[taskId].data[0] = 0xFF; + gTasks[taskId].func = HandleMenuInput; +} + +static void CursorCb_Give(u8 taskId) +{ + PlaySE(SE_SELECT); + gUnknown_0203CEC4->exitCallback = sub_81B41C4; + sub_81B12C0(taskId); +} + +static void sub_81B41C4(void) +{ + if (InBattlePyramid() == FALSE) + GoToBagMenu(RETURN_LOCATION_POKEMON_LIST, POCKETS_COUNT, c2_8123744); + else + sub_81C4F98(2, c2_8123744); +} + +static void c2_8123744(void) +{ + if (gSpecialVar_ItemId == ITEM_NONE) + { + InitPartyMenu(gUnknown_0203CEC8.unk8_0, 0xFF, gUnknown_0203CEC8.unkB, 1, 0x7F, sub_81B36FC, gUnknown_0203CEC8.exitCallback); + } + else + { + gUnknown_0203CEFC = GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_HELD_ITEM); + if (gUnknown_0203CEFC != ITEM_NONE) + { + InitPartyMenu(gUnknown_0203CEC8.unk8_0, 0xFF, gUnknown_0203CEC8.unkB, 1, 0x7F, sub_81B4350, gUnknown_0203CEC8.exitCallback); + } + else if (ItemIsMail(gSpecialVar_ItemId)) + { + RemoveBagItem(gSpecialVar_ItemId, 1); + sub_81B1DB8(&gPlayerParty[gUnknown_0203CEC8.unk9], gSpecialVar_ItemId); + sub_81B452C(); + } + else + { + InitPartyMenu(gUnknown_0203CEC8.unk8_0, 0xFF, gUnknown_0203CEC8.unkB, 1, 0x7F, sub_81B42D0, gUnknown_0203CEC8.exitCallback); + } + } +} + +static void sub_81B42D0(u8 taskId) +{ + u16 item; + + if (!gPaletteFade.active) + { + item = gSpecialVar_ItemId; + sub_81B1C84(&gPlayerParty[gUnknown_0203CEC8.unk9], item, 0, 0); + sub_81B1DB8(&gPlayerParty[gUnknown_0203CEC8.unk9], item); + RemoveBagItem(item, 1); + gTasks[taskId].func = sub_81B469C; + } +} + +static void sub_81B4350(u8 taskId) +{ + if (!gPaletteFade.active) + { + sub_81B1D1C(&gPlayerParty[gUnknown_0203CEC8.unk9], gUnknown_0203CEFC, 1); + gTasks[taskId].func = sub_81B43A8; + } +} + +static void sub_81B43A8(u8 taskId) +{ + if (sub_81B1BD4() != TRUE) + { + sub_81B334C(); + gTasks[taskId].func = sub_81B43DC; + } +} + +static void sub_81B43DC(u8 taskId) +{ + switch (Menu_ProcessInputNoWrapClearOnChoose()) + { + case 0: + RemoveBagItem(gSpecialVar_ItemId, 1); + if (AddBagItem(gUnknown_0203CEFC, 1) == FALSE) + { + AddBagItem(gSpecialVar_ItemId, 1); + pokemon_item_not_removed(gUnknown_0203CEFC); + sub_81B1B5C(gStringVar4, 0); + gTasks[taskId].func = sub_81B1C1C; + } + else if (ItemIsMail(gSpecialVar_ItemId)) + { + sub_81B1DB8(&gPlayerParty[gUnknown_0203CEC8.unk9], gSpecialVar_ItemId); + gTasks[taskId].func = sub_81B44FC; + } + else + { + sub_81B1DB8(&gPlayerParty[gUnknown_0203CEC8.unk9], gSpecialVar_ItemId); + sub_81B1D68(gSpecialVar_ItemId, gUnknown_0203CEFC, 1); + gTasks[taskId].func = sub_81B469C; + } + break; + case MENU_B_PRESSED: + PlaySE(SE_SELECT); + case 1: + gTasks[taskId].func = sub_81B1C1C; + break; + } +} + +static void sub_81B44FC(u8 taskId) +{ + if (sub_81B1BD4() != TRUE) + { + gUnknown_0203CEC4->exitCallback = sub_81B452C; + sub_81B12C0(taskId); + } +} + +static void sub_81B452C(void) +{ + u8 mail = GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_MAIL); + + sub_811A20C(4, gSaveBlock1Ptr->mail[mail].words, sub_81B4578, 3); +} + +static void sub_81B4578(void) +{ + struct Pokemon *mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + u16 item = GetMonData(mon, MON_DATA_HELD_ITEM); + + if (gSpecialVar_Result == FALSE) + { + TakeMailFromMon(mon); + SetMonData(mon, MON_DATA_HELD_ITEM, &gUnknown_0203CEFC); + RemoveBagItem(gUnknown_0203CEFC, 1); + AddBagItem(item, 1); + InitPartyMenu(gUnknown_0203CEC8.unk8_0, 0xFF, gUnknown_0203CEC8.unkB, 1, 0, sub_81B36FC, gUnknown_0203CEC8.exitCallback); + } + else + { + InitPartyMenu(gUnknown_0203CEC8.unk8_0, 0xFF, gUnknown_0203CEC8.unkB, 1, 0x7F, sub_81B4624, gUnknown_0203CEC8.exitCallback); + } +} + +static void sub_81B4624(u8 taskId) +{ + if (!gPaletteFade.active) + { + if (gUnknown_0203CEFC == ITEM_NONE) + sub_81B1C84(&gPlayerParty[gUnknown_0203CEC8.unk9], gSpecialVar_ItemId, 0, 0); + else + sub_81B1D68(gSpecialVar_ItemId, gUnknown_0203CEFC, 0); + gTasks[taskId].func = sub_81B469C; + } +} + +static void sub_81B469C(u8 taskId) +{ + struct Pokemon *mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + + if (sub_81B1BD4() != TRUE) + { + sub_81B5C94(mon, &gUnknown_0203CEDC[gUnknown_0203CEC8.unk9]); + if (gUnknown_0203CEC8.unk8_0 == 12) + { + if (GetMonData(mon, MON_DATA_HELD_ITEM) != ITEM_NONE) + DisplayPartyPokemonOtherText(11, &gUnknown_0203CEDC[gUnknown_0203CEC8.unk9], 1); + else + DisplayPartyPokemonOtherText(12, &gUnknown_0203CEDC[gUnknown_0203CEC8.unk9], 1); + } + sub_81B1C1C(taskId); + } +} + +static void CursorCb_TakeItem(u8 taskId) +{ + struct Pokemon *mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + u16 item = GetMonData(mon, MON_DATA_HELD_ITEM); + + PlaySE(SE_SELECT); + sub_81B302C(&gUnknown_0203CEC4->unkC[0]); + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + switch (sub_81B1E00(mon)) + { + case 0: + GetMonNickname(mon, gStringVar1); + StringExpandPlaceholders(gStringVar4, gText_PkmnNotHolding); + sub_81B1B5C(gStringVar4, 1); + break; + case 1: + pokemon_item_not_removed(item); + sub_81B1B5C(gStringVar4, 1); + break; + default: + sub_81B1CD0(mon, item, 1); + break; + } + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = sub_81B469C; +} + +static void CursorCb_Toss(u8 taskId) +{ + struct Pokemon *mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + u16 item = GetMonData(mon, MON_DATA_HELD_ITEM); + + PlaySE(SE_SELECT); + sub_81B302C(&gUnknown_0203CEC4->unkC[0]); + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + if (item == ITEM_NONE) + { + GetMonNickname(mon, gStringVar1); + StringExpandPlaceholders(gStringVar4, gText_PkmnNotHolding); + sub_81B1B5C(gStringVar4, 1); + gTasks[taskId].func = sub_81B469C; + } + else + { + CopyItemName(item, gStringVar1); + StringExpandPlaceholders(gStringVar4, gText_ThrowAwayItem); + sub_81B1B5C(gStringVar4, 1); + gTasks[taskId].func = sub_81B48A8; + } +} + +static void sub_81B48A8(u8 taskId) +{ + if (sub_81B1BD4() != TRUE) + { + sub_81B334C(); + gTasks[taskId].func = sub_81B48DC; + } +} + +static void sub_81B48DC(u8 taskId) +{ + struct Pokemon *mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + + switch (Menu_ProcessInputNoWrapClearOnChoose()) + { + case 0: + CopyItemName(GetMonData(mon, MON_DATA_HELD_ITEM), gStringVar1); + StringExpandPlaceholders(gStringVar4, gText_ItemThrownAway); + sub_81B1B5C(gStringVar4, 0); + gTasks[taskId].func = sub_81B4988; + break; + case MENU_B_PRESSED: + PlaySE(SE_SELECT); + case 1: + gTasks[taskId].func = sub_81B1C1C; + break; + } +} + +static void sub_81B4988(u8 taskId) +{ + struct Pokemon *mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + + if (sub_81B1BD4() != TRUE) + { + u16 item = ITEM_NONE; + + SetMonData(mon, MON_DATA_HELD_ITEM, &item); + sub_81B5C94(mon, &gUnknown_0203CEDC[gUnknown_0203CEC8.unk9]); + DisplayPartyPokemonOtherText(12, &gUnknown_0203CEDC[gUnknown_0203CEC8.unk9], 1); + gTasks[taskId].func = sub_81B1C1C; + } +} + +static void CursorCb_Mail(u8 taskId) +{ + PlaySE(SE_SELECT); + sub_81B302C(&gUnknown_0203CEC4->unkC[0]); + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + sub_81B33B4(gPlayerParty, gUnknown_0203CEC8.unk9, 9); + sub_81B31B0(2); + display_pokemon_menu_message(25); + gTasks[taskId].data[0] = 0xFF; + gTasks[taskId].func = HandleMenuInput; +} + +static void CursorCb_Read(u8 taskId) +{ + PlaySE(SE_SELECT); + gUnknown_0203CEC4->exitCallback = sub_81B4A98; + sub_81B12C0(taskId); +} + +static void sub_81B4A98(void) +{ + ReadMail(&gSaveBlock1Ptr->mail[GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_MAIL)], sub_81B4AE0, 1); +} + +static void sub_81B4AE0(void) +{ + gPaletteFade.bufferTransferDisabled = TRUE; + InitPartyMenu(gUnknown_0203CEC8.unk8_0, 0xFF, gUnknown_0203CEC8.unkB, 1, 21, sub_81B36FC, gUnknown_0203CEC8.exitCallback); +} + +static void CursorCb_TakeMail(u8 taskId) +{ + PlaySE(SE_SELECT); + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + sub_81B302C(&gUnknown_0203CEC4->unkC[0]); + sub_81B1B5C(gText_SendMailToPC, 1); + gTasks[taskId].func = sub_81B4B6C; +} + +static void sub_81B4B6C(u8 taskId) +{ + if (sub_81B1BD4() != TRUE) + { + sub_81B334C(); + gTasks[taskId].func = sub_81B4BA0; + } +} + +static void sub_81B4BA0(u8 taskId) +{ + switch (Menu_ProcessInputNoWrapClearOnChoose()) + { + case 0: + if (TakeMailFromMon2(&gPlayerParty[gUnknown_0203CEC8.unk9]) != 0xFF) + { + sub_81B1B5C(gText_MailSentToPC, 0); + gTasks[taskId].func = sub_81B469C; + } + else + { + sub_81B1B5C(gText_PCMailboxFull, 0); + gTasks[taskId].func = sub_81B1C1C; + } + break; + case MENU_B_PRESSED: + PlaySE(SE_SELECT); + case 1: + sub_81B1B5C(gText_MailMessageWillBeLost, 1); + gTasks[taskId].func = sub_81B4C60; + break; + } +} + +static void sub_81B4C60(u8 taskId) +{ + if (sub_81B1BD4() != TRUE) + { + sub_81B334C(); + gTasks[taskId].func = sub_81B4C94; + } +} + +static void sub_81B4C94(u8 taskId) +{ + u16 item; + + switch (Menu_ProcessInputNoWrapClearOnChoose()) + { + case 0: + item = GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_HELD_ITEM); + if (AddBagItem(item, 1) == TRUE) + { + TakeMailFromMon(&gPlayerParty[gUnknown_0203CEC8.unk9]); + sub_81B1B5C(gText_MailTakenFromPkmn, 0); + gTasks[taskId].func = sub_81B469C; + } + else + { + pokemon_item_not_removed(item); + sub_81B1B5C(gStringVar4, 0); + gTasks[taskId].func = sub_81B1C1C; + } + break; + case MENU_B_PRESSED: + PlaySE(SE_SELECT); + case 1: + gTasks[taskId].func = sub_81B1C1C; + break; + } +} + +static void CursorCb_Cancel2(u8 taskId) +{ + struct Pokemon *mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + + PlaySE(SE_SELECT); + sub_81B302C(&gUnknown_0203CEC4->unkC[0]); + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + sub_81B33B4(gPlayerParty, gUnknown_0203CEC8.unk9, sub_81B353C(mon)); + if (gUnknown_0203CEC8.unk8_0 != 12) + { + sub_81B31B0(0); + display_pokemon_menu_message(21); + } + else + { + sub_81B31B0(1); + CopyItemName(GetMonData(mon, MON_DATA_HELD_ITEM), gStringVar2); + display_pokemon_menu_message(26); + } + gTasks[taskId].data[0] = 0xFF; + gTasks[taskId].func = HandleMenuInput; +} + +static void CursorCb_SendMon(u8 taskId) +{ + PlaySE(SE_SELECT); + sub_81B302C(&gUnknown_0203CEC4->unkC[0]); + if (sub_81B8A7C() == TRUE) + { + sub_81B12C0(taskId); + } + else + { + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + sub_81B1B5C(gStringVar4, 1); + gTasks[taskId].func = sub_81B1C1C; + } +} + +static void CursorCb_Enter(u8 taskId) +{ + u8 unk; + u8 i; + + sub_81B302C(&gUnknown_0203CEC4->unkC[0]); + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + unk = sub_81B8830(); + for (i = 0; i < unk; i++) + { + if (gSelectedOrderFromParty[i] == 0) + { + PlaySE(SE_SELECT); + gSelectedOrderFromParty[i] = gUnknown_0203CEC8.unk9 + 1; + DisplayPartyPokemonOtherText(i + 2, &gUnknown_0203CEDC[gUnknown_0203CEC8.unk9], 1); + if (i == (unk - 1)) + sub_81B4F88(); + display_pokemon_menu_message(0); + gTasks[taskId].func = sub_81B1370; + return; + } + } + ConvertIntToDecimalStringN(gStringVar1, unk, 0, 1); + StringExpandPlaceholders(gStringVar4, gText_NoMoreThanVar1Pkmn); + PlaySE(SE_HAZURE); + sub_81B1B5C(gStringVar4, 1); + gTasks[taskId].func = sub_81B1C1C; +} + +static void sub_81B4F88(void) +{ + sub_81B0FCC(gUnknown_0203CEC8.unk9, 0); + gUnknown_0203CEC8.unk9 = 6; + sub_81B0FCC(gUnknown_0203CEC8.unk9, 1); +} + +static void CursorCb_NoEntry(u8 taskId) +{ + u8 unk; + u8 i, j; + + PlaySE(SE_SELECT); + sub_81B302C(&gUnknown_0203CEC4->unkC[0]); + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + unk = sub_81B8830(); + for (i = 0; i < unk; i++) + { + if (gSelectedOrderFromParty[i] == (gUnknown_0203CEC8.unk9 + 1)) + { + for (j = i; j < (unk - 1); j++) + gSelectedOrderFromParty[j] = gSelectedOrderFromParty[j + 1]; + gSelectedOrderFromParty[j] = 0; + break; + } + } + DisplayPartyPokemonOtherText(1, &gUnknown_0203CEDC[gUnknown_0203CEC8.unk9], 1); + for (i = 0; i < (unk - 1); i++) + { + if (gSelectedOrderFromParty[i] != 0) + DisplayPartyPokemonOtherText(i + 2, &gUnknown_0203CEDC[gSelectedOrderFromParty[i] - 1], 1); + } + display_pokemon_menu_message(0); + gTasks[taskId].func = sub_81B1370; +} + +static void CursorCb_Store(u8 taskId) +{ + PlaySE(SE_SELECT); + sub_81B12C0(taskId); +} + +static void CursorCb_Register(u8 taskId) +{ + u16 species2 = GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_SPECIES2); + u16 species = GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_SPECIES); + u8 obedience = GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_OBEDIENCE); + + switch (sub_807A8D0(*(u32 *)sub_800F7DC() /* dirty cast, probably needs to be changed */, species2, species, obedience)) + { + case 1: + StringExpandPlaceholders(gStringVar4, gText_PkmnCantBeTradedNow); + break; + case 2: + StringExpandPlaceholders(gStringVar4, gText_EggCantBeTradedNow); + break; + default: + PlaySE(SE_SELECT); + sub_81B12C0(taskId); + return; + } + PlaySE(SE_HAZURE); + sub_81B302C(&gUnknown_0203CEC4->unkC[0]); + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + StringAppend(gStringVar4, gText_PauseUntilPress); + sub_81B1B5C(gStringVar4, 1); + gTasks[taskId].func = sub_81B1C1C; +} + +static void CursorCb_Trade1(u8 taskId) +{ + u16 species2 = GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_SPECIES2); + u16 species = GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_SPECIES); + u8 obedience = GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_OBEDIENCE); + u32 stringId = sub_807A7E0(*(struct UnkLinkRfuStruct_02022B14Substruct *)sub_800F7DC(), gUnknown_02022C38, species2, gUnknown_02022C3C, gUnknown_02022C3E, species, obedience); + + if (stringId != 0) + { + StringExpandPlaceholders(gStringVar4, gUnknown_08615E0C[stringId - 1]); + PlaySE(SE_HAZURE); + sub_81B302C(&gUnknown_0203CEC4->unkC[0]); + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + StringAppend(gStringVar4, gText_PauseUntilPress); + sub_81B1B5C(gStringVar4, 1); + gTasks[taskId].func = sub_81B1C1C; + } + else + { + PlaySE(SE_SELECT); + sub_81B12C0(taskId); + } +} + +static void CursorCb_Trade2(u8 taskId) +{ + sub_81B302C(&gUnknown_0203CEC4->unkC[0]); + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + switch (sub_807A918(gPlayerParty, gUnknown_0203CEC8.unk9)) + { + case 1: + StringExpandPlaceholders(gStringVar4, gText_OnlyPkmnForBattle); + break; + case 2: + StringExpandPlaceholders(gStringVar4, gText_PkmnCantBeTradedNow); + break; + case 3: + StringExpandPlaceholders(gStringVar4, gText_EggCantBeTradedNow); + break; + default: + PlaySE(SE_SELECT); + GetMonNickname(&gPlayerParty[gUnknown_0203CEC8.unk9], gStringVar1); + StringExpandPlaceholders(gStringVar4, gJPText_PutVar1IntoSpinner); + sub_81B1B5C(gStringVar4, 1); + gTasks[taskId].func = sub_81B53FC; + return; + } + PlaySE(SE_HAZURE); + StringAppend(gStringVar4, gText_PauseUntilPress); + sub_81B1B5C(gStringVar4, 1); + gTasks[taskId].func = sub_81B1C1C; +} + +static void sub_81B53FC(u8 taskId) +{ + if (sub_81B1BD4() != TRUE) + { + sub_81B334C(); + gTasks[taskId].func = sub_81B5430; + } +} + +static void sub_81B5430(u8 taskId) +{ + switch (Menu_ProcessInputNoWrapClearOnChoose()) + { + case 0: + sub_81B12C0(taskId); + break; + case MENU_B_PRESSED: + PlaySE(SE_SELECT); + case 1: + sub_81B1C1C(taskId); + break; + } +} + +static void CursorCb_FieldMove(u8 taskId) +{ + u8 fieldMove = gUnknown_0203CEC4->unkF[Menu_GetCursorPos()] - MENU_FIELD_MOVES; + const struct MapHeader *mapHeader; + + PlaySE(SE_SELECT); + if (sFieldMoveCursorCallbacks[fieldMove].fieldMoveFunc == NULL) + return; + + sub_81B302C(&gUnknown_0203CEC4->unkC[0]); + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + if (sub_81221AC() == TRUE || InUnionRoom() == TRUE) + { + if (fieldMove == FIELD_MOVE_MILK_DRINK || fieldMove == FIELD_MOVE_SOFT_BOILED) + display_pokemon_menu_message(13); + else + display_pokemon_menu_message(sFieldMoveCursorCallbacks[fieldMove].msgId); + + gTasks[taskId].func = task_brm_cancel_1_on_keypad_a_or_b; + } + else + { + // All field moves before WATERFALL are HMs. + if (fieldMove <= FIELD_MOVE_WATERFALL && FlagGet(FLAG_BADGE01_GET + fieldMove) != TRUE) + { + sub_81B1B5C(gText_CantUseUntilNewBadge, 1); + gTasks[taskId].func = sub_81B1C1C; + } + else if (sFieldMoveCursorCallbacks[fieldMove].fieldMoveFunc() == TRUE) + { + switch (fieldMove) + { + case FIELD_MOVE_MILK_DRINK: + case FIELD_MOVE_SOFT_BOILED: + sub_8161560(taskId); + break; + case FIELD_MOVE_TELEPORT: + mapHeader = Overworld_GetMapHeaderByGroupAndId(gSaveBlock1Ptr->lastHealLocation.mapGroup, gSaveBlock1Ptr->lastHealLocation.mapNum); + sub_81245DC(gStringVar1, mapHeader->regionMapSectionId); + StringExpandPlaceholders(gStringVar4, gText_ReturnToHealingSpot); + sub_81B5674(taskId); + gUnknown_0203CEC4->data[0] = fieldMove; + break; + case FIELD_MOVE_DIG: + mapHeader = Overworld_GetMapHeaderByGroupAndId(gSaveBlock1Ptr->warp4.mapGroup, gSaveBlock1Ptr->warp4.mapNum); + sub_81245DC(gStringVar1, mapHeader->regionMapSectionId); + StringExpandPlaceholders(gStringVar4, gText_EscapeFromHere); + sub_81B5674(taskId); + gUnknown_0203CEC4->data[0] = fieldMove; + break; + case FIELD_MOVE_FLY: + gUnknown_0203CEC8.exitCallback = MCB2_FlyMap; + sub_81B12C0(taskId); + break; + default: + gUnknown_0203CEC8.exitCallback = CB2_ReturnToField; + sub_81B12C0(taskId); + break; + } + } + else + { + switch (fieldMove) + { + case FIELD_MOVE_SURF: + sub_81B5864(); + break; + case FIELD_MOVE_FLASH: + sub_81B57DC(); + break; + default: + display_pokemon_menu_message(sFieldMoveCursorCallbacks[fieldMove].msgId); + break; + } + gTasks[taskId].func = task_brm_cancel_1_on_keypad_a_or_b; + } + } +} + +static void sub_81B5674(u8 taskId) +{ + sub_81B1B5C(gStringVar4, 1); + gTasks[taskId].func = sub_81B56A4; +} + +static void sub_81B56A4(u8 taskId) +{ + if (sub_81B1BD4() != TRUE) + { + sub_81B334C(); + gTasks[taskId].func = sub_81B56D8; + } +} + +static void sub_81B56D8(u8 taskId) +{ + switch (Menu_ProcessInputNoWrapClearOnChoose()) + { + case 0: + gUnknown_0203CEC8.exitCallback = CB2_ReturnToField; + sub_81B12C0(taskId); + break; + case MENU_B_PRESSED: + PlaySE(SE_SELECT); + case 1: + gFieldCallback2 = NULL; + gPostMenuFieldCallback = NULL; + sub_81B1C1C(taskId); + break; + } +} + +bool8 FieldCallback_PrepareFadeInFromMenu(void) +{ + pal_fill_black(); + CreateTask(task_launch_hm_phase_2, 8); + return TRUE; +} + +static void task_launch_hm_phase_2(u8 taskId) +{ + if (IsWeatherNotFadingIn() == TRUE) + { + gFieldEffectArguments[0] = brm_get_selected_species(); + gPostMenuFieldCallback(); + DestroyTask(taskId); + } +} + +static u16 brm_get_selected_species(void) +{ + return GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_SPECIES); +} + +static void task_brm_cancel_1_on_keypad_a_or_b(u8 taskId) +{ + if ((gMain.newKeys & A_BUTTON) || (gMain.newKeys & B_BUTTON)) + CursorCb_Cancel1(taskId); +} + +static void sub_81B57DC(void) +{ + if (FlagGet(FLAG_SYS_USE_FLASH) == TRUE) + display_pokemon_menu_message(12); + else + display_pokemon_menu_message(13); +} + +static void hm_surf_run_dp02scr(void) +{ + gFieldEffectArguments[0] = GetCursorSelectionMonId(); + FieldEffectStart(FLDEFF_USE_SURF); +} + +static bool8 SetUpFieldMove_Surf(void) +{ + if (PartyHasMonWithSurf() == TRUE && IsPlayerFacingSurfableFishableWater() == TRUE) + { + gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu; + gPostMenuFieldCallback = hm_surf_run_dp02scr; + return TRUE; + } + return FALSE; +} + +static void sub_81B5864(void) +{ + if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING)) + display_pokemon_menu_message(9); + else + display_pokemon_menu_message(8); +} + +static bool8 SetUpFieldMove_Fly(void) +{ + if (Overworld_MapTypeAllowsTeleportAndFly(gMapHeader.mapType) == TRUE) + return TRUE; + else + return FALSE; +} + +void sub_81B58A8(void) +{ + InitPartyMenu(0, 0, 0, 1, 0, sub_81B1370, CB2_ReturnToFieldWithOpenMenu); +} + +static void hm2_waterfall(void) +{ + gFieldEffectArguments[0] = GetCursorSelectionMonId(); + FieldEffectStart(FLDEFF_USE_WATERFALL); +} + +static bool8 SetUpFieldMove_Waterfall(void) +{ + s16 x, y; + + GetXYCoordsOneStepInFrontOfPlayer(&x, &y); + if (MetatileBehavior_IsWaterfall(MapGridGetMetatileBehaviorAt(x, y)) == TRUE && IsPlayerSurfingNorth() == TRUE) + { + gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu; + gPostMenuFieldCallback = hm2_waterfall; + return TRUE; + } + return FALSE; +} + +static void sub_81B5958(void) +{ + gFieldEffectArguments[0] = GetCursorSelectionMonId(); + FieldEffectStart(FLDEFF_USE_DIVE); +} + +static bool8 SetUpFieldMove_Dive(void) +{ + gFieldEffectArguments[1] = TrySetDiveWarp(); + if (gFieldEffectArguments[1] != 0) + { + gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu; + gPostMenuFieldCallback = sub_81B5958; + return TRUE; + } + return FALSE; +} + +static void party_menu_icon_anim(struct Pokemon *mon, struct Struct203CEDC *ptr, u32 a) +{ + u32 bit = 1; + u16 species2; + + if (IsMultiBattle() == TRUE && gMain.inBattle) + bit = (gUnknown_08616020[a] ^ bit) ? 1 : 0; + species2 = GetMonData(mon, MON_DATA_SPECIES2); + party_menu_link_mon_icon_anim(species2, GetMonData(mon, MON_DATA_PERSONALITY), ptr, 1, bit); + sub_81B5B38(ptr->unk9, mon); +} + +static void party_menu_link_mon_icon_anim(u16 species, u32 pid, struct Struct203CEDC *ptr, u8 priority, u32 bit) +{ + if (species != SPECIES_NONE) + { + ptr->unk9 = CreateMonIcon(species, sub_80D3014, ptr->unk4[0], ptr->unk4[1], 4, pid, bit); + gSprites[ptr->unk9].oam.priority = priority; + } +} + +static void sub_81B5A8C(u8 spriteId, u16 hp, u16 maxhp) +{ + switch (GetHPBarLevel(hp, maxhp)) + { + case HP_BAR_FULL: + sub_80D32C8(&gSprites[spriteId], 0); + break; + case HP_BAR_GREEN: + sub_80D32C8(&gSprites[spriteId], 1); + break; + case HP_BAR_YELLOW: + sub_80D32C8(&gSprites[spriteId], 2); + break; + case HP_BAR_RED: + sub_80D32C8(&gSprites[spriteId], 3); + break; + default: + sub_80D32C8(&gSprites[spriteId], 4); + break; + } +} + +static void sub_81B5B38(u8 spriteId, struct Pokemon *mon) +{ + sub_81B5A8C(spriteId, GetMonData(mon, MON_DATA_HP), GetMonData(mon, MON_DATA_MAX_HP)); +} + +static void AnimateSelectedPartyIcon(u8 spriteId, u8 a) +{ + gSprites[spriteId].data[0] = 0; + if (a == 0) + { + if (gSprites[spriteId].pos1.x == 16) + { + gSprites[spriteId].pos2.x = 0; + gSprites[spriteId].pos2.y = -4; + } + else + { + gSprites[spriteId].pos2.x = -4; + gSprites[spriteId].pos2.y = 0; + } + gSprites[spriteId].callback = UpdatePartyMonIconFrame; + } + else + { + gSprites[spriteId].pos2.x = 0; + gSprites[spriteId].pos2.y = 0; + gSprites[spriteId].callback = UpdatePartyMonIconFrameAndBounce; + } +} + +static void UpdatePartyMonIconFrameAndBounce(struct Sprite *sprite) +{ + u8 unk = UpdateMonIconFrame(sprite); + + if (unk != 0) + { + if (unk & 1) + sprite->pos2.y = -3; + else + sprite->pos2.y = 1; + } +} + +static void UpdatePartyMonIconFrame(struct Sprite *sprite) +{ + UpdateMonIconFrame(sprite); +} + +static void party_menu_held_item_object(struct Pokemon *mon, struct Struct203CEDC *ptr) +{ + if (GetMonData(mon, MON_DATA_SPECIES) != SPECIES_NONE) + { + ptr->unkA = CreateSprite(&gSpriteTemplate_8615EC0, ptr->unk4[2], ptr->unk4[3], 0); + sub_81B5C94(mon, ptr); + } +} + +static void party_menu_link_mon_held_item_object(u16 species, u16 item, struct Struct203CEDC *ptr) +{ + if (species != SPECIES_NONE) + { + ptr->unkA = CreateSprite(&gSpriteTemplate_8615EC0, ptr->unk4[2], ptr->unk4[3], 0); + gSprites[ptr->unkA].oam.priority = 0; + sub_81B5CB0(item, ptr); + } +} + +static void sub_81B5C94(struct Pokemon *mon, struct Struct203CEDC *ptr) +{ + sub_81B5CB0(GetMonData(mon, MON_DATA_HELD_ITEM), ptr); +} + +static void sub_81B5CB0(u16 item, struct Struct203CEDC *ptr) +{ + if (item == ITEM_NONE) + { + gSprites[ptr->unkA].invisible = TRUE; + } + else + { + if (ItemIsMail(item)) + StartSpriteAnim(&gSprites[ptr->unkA], 1); + else + StartSpriteAnim(&gSprites[ptr->unkA], 0); + gSprites[ptr->unkA].invisible = FALSE; + } +} + +void LoadHeldItemIcons(void) +{ + LoadSpriteSheet(&gUnknown_08615EB0); + LoadSpritePalette(&gUnknown_08615EB8); +} + +void sub_81B5D4C(u8 *a, u8 *b, u8 c) +{ + u16 i; + u16 item; + + switch (c) + { + case 0: + for (i = 0; i < a[0]; i++) + { + item = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); + if (item != ITEM_NONE) + sub_81B5DF0(b[i], ItemIsMail(item)); + } + break; + case 1: + for (i = 0; i < a[1]; i++) + { + item = GetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM); + if (item != ITEM_NONE) + sub_81B5DF0(b[i + 6], ItemIsMail(item)); + } + break; + } +} + +static void sub_81B5DF0(u8 spriteId, u8 isMail) +{ + u8 subpriority = gSprites[spriteId].subpriority; + u8 newSpriteId = CreateSprite(&gSpriteTemplate_8615EC0, 250, 170, subpriority - 1); + + gSprites[newSpriteId].pos2.x = 4; + gSprites[newSpriteId].pos2.y = 10; + gSprites[newSpriteId].callback = sub_81B5E74; + gSprites[newSpriteId].data[7] = spriteId; + StartSpriteAnim(&gSprites[newSpriteId], isMail); + gSprites[newSpriteId].callback(&gSprites[newSpriteId]); +} + +static void sub_81B5E74(struct Sprite *sprite) +{ + u8 otherSpriteId = sprite->data[7]; + + if (gSprites[otherSpriteId].invisible) + { + sprite->invisible = TRUE; + } + else + { + sprite->invisible = FALSE; + sprite->pos1.x = gSprites[otherSpriteId].pos1.x + gSprites[otherSpriteId].pos2.x; + sprite->pos1.y = gSprites[otherSpriteId].pos1.y + gSprites[otherSpriteId].pos2.y; + } +} + +static void party_menu_pokeball_object(struct Pokemon *mon, struct Struct203CEDC *ptr) +{ + if (GetMonData(mon, MON_DATA_SPECIES) != SPECIES_NONE) + ptr->unkB = CreateSprite(&gSpriteTemplate_8615F08, ptr->unk4[6], ptr->unk4[7], 8); +} + +static void party_menu_link_mon_pokeball_object(u16 species, struct Struct203CEDC *ptr) +{ + if (species != SPECIES_NONE) + { + ptr->unkB = CreateSprite(&gSpriteTemplate_8615F08, ptr->unk4[6], ptr->unk4[7], 8); + gSprites[ptr->unkB].oam.priority = 0; + } +} + +static u8 sub_81B5F34(u8 x, u8 y) +{ + u8 spriteId = CreateSprite(&gSpriteTemplate_8615F08, x, y, 8); + + gSprites[spriteId].oam.priority = 2; + return spriteId; +} + +static u8 sub_81B5F74(u8 x, u8 y) +{ + return CreateSprite(&gSpriteTemplate_8615F78, x, y, 8); +} + +static void sub_81B5F98(u8 spriteId, u8 a) +{ + StartSpriteAnim(&gSprites[spriteId], a); +} + +static void sub_81B5FBC(u8 spriteId, u8 spriteId2, u8 a) +{ + if (a == 0) + { + StartSpriteAnim(&gSprites[spriteId], 2); + StartSpriteAnim(&gSprites[spriteId2], 4); + gSprites[spriteId].pos2.y = 0; + gSprites[spriteId2].pos2.y = 0; + } + else + { + StartSpriteAnim(&gSprites[spriteId], 3); + StartSpriteAnim(&gSprites[spriteId2], 5); + gSprites[spriteId].pos2.y = -4; + gSprites[spriteId2].pos2.y = 4; + } +} + +static void LoadPartyMenuPokeballGfx(void) +{ + LoadCompressedSpriteSheet(&gUnknown_08615EF8); + LoadCompressedSpriteSheet(&gUnknown_08615F70); + LoadCompressedSpritePalette(&gUnknown_08615F00); +} + +static void party_menu_status_condition_object(struct Pokemon *mon, struct Struct203CEDC *ptr) +{ + if (GetMonData(mon, MON_DATA_SPECIES) != SPECIES_NONE) + { + ptr->unkC = CreateSprite(&gSpriteTemplate_8616008, ptr->unk4[4], ptr->unk4[5], 0); + party_menu_get_status_condition_and_update_object(mon, ptr); + } +} + +static void party_menu_link_mon_status_condition_object(u16 species, u8 status, struct Struct203CEDC *ptr) +{ + if (species != SPECIES_NONE) + { + ptr->unkC = CreateSprite(&gSpriteTemplate_8616008, ptr->unk4[4], ptr->unk4[5], 0); + party_menu_update_status_condition_object(status, ptr); + gSprites[ptr->unkC].oam.priority = 0; + } +} + +static void party_menu_get_status_condition_and_update_object(struct Pokemon *mon, struct Struct203CEDC *ptr) +{ + party_menu_update_status_condition_object(sub_81B205C(mon), ptr); +} + +static void party_menu_update_status_condition_object(u8 status, struct Struct203CEDC *ptr) +{ + switch (status) + { + case AILMENT_NONE: + case AILMENT_PKRS: + gSprites[ptr->unkC].invisible = TRUE; + break; + default: + StartSpriteAnim(&gSprites[ptr->unkC], status - 1); + gSprites[ptr->unkC].invisible = FALSE; + break; + } +} + +static void LoadPartyMenuAilmentGfx(void) +{ + LoadCompressedSpriteSheet(&gUnknown_08615FF8); + LoadCompressedSpritePalette(&gUnknown_08616000); +} + +void sub_81B617C(void) +{ + MainCallback callback = c2_815ABFC; + u8 doubleBattleStatus; + bool8 inBattle; + u8 i; + u8 msgIdMaybe; + register TaskFunc task asm("r0"); + + if (gMain.inBattle) + { + inBattle = TRUE; + doubleBattleStatus = sub_81B8984(); + } + else + { + inBattle = FALSE; + doubleBattleStatus = 0; + } + if (GetItemEffectType(gSpecialVar_ItemId) == 10) + { + gUnknown_0203CEC8.unk9 = 0; + for (i = 0; i < PARTY_SIZE; i++) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) != SPECIES_NONE && GetMonData(&gPlayerParty[i], MON_DATA_HP) == 0) + { + gUnknown_0203CEC8.unk9 = i; + break; + } + } + task = sub_81B6280; + msgIdMaybe = 0x7F; + } + else + { + msgIdMaybe = (GetPocketByItemId(gSpecialVar_ItemId) == POCKET_TM_HM) ? 4 : 5; + task = sub_81B1370; + } + InitPartyMenu(inBattle, doubleBattleStatus, 3, 1, msgIdMaybe, task, callback); +} + +static void c2_815ABFC(void) +{ + if (InBattlePyramid() == FALSE) + GoToBagMenu(RETURN_LOCATION_UNCHANGED, POCKETS_COUNT, NULL); + else + sub_81C4F98(4, gPyramidBagCursorData.callback); +} + +static void sub_81B6280(u8 taskId) +{ + if (!gPaletteFade.active) + { + if (gUnknown_0203CEC8.unk8_0 == 1) + gUnknown_0203CEC4->exitCallback = sub_81B9140; + gUnknown_03006328(taskId, sub_81B6794); + } +} + +static bool8 IsHPRecoveryItem(u16 item) +{ + const u8 *effect; + + if (item == ITEM_ENIGMA_BERRY) + effect = gSaveBlock1Ptr->enigmaBerry.itemEffect; + else + effect = gItemEffectTable[item - ITEM_POTION]; + if ((effect[4] & 4) != 0) + return TRUE; + return FALSE; +} + +static void GetMedicineItemEffectMessage(u16 item) +{ + switch (GetItemEffectType(item)) + { + case 3: + StringExpandPlaceholders(gStringVar4, gText_PkmnCuredOfPoison); + break; + case 4: + StringExpandPlaceholders(gStringVar4, gText_PkmnWokeUp2); + break; + case 5: + StringExpandPlaceholders(gStringVar4, gText_PkmnBurnHealed); + break; + case 6: + StringExpandPlaceholders(gStringVar4, gText_PkmnThawedOut); + break; + case 7: + StringExpandPlaceholders(gStringVar4, gText_PkmnCuredOfParalysis); + break; + case 8: + StringExpandPlaceholders(gStringVar4, gText_PkmnSnappedOutOfConfusion); + break; + case 9: + StringExpandPlaceholders(gStringVar4, gText_PkmnGotOverInfatuation); + break; + case 11: + StringExpandPlaceholders(gStringVar4, gText_PkmnBecameHealthy); + break; + case 13: + StringCopy(gStringVar2, gText_HP3); + StringExpandPlaceholders(gStringVar4, gText_PkmnBaseVar2StatIncreased); + break; + case 12: + StringCopy(gStringVar2, gText_Attack3); + StringExpandPlaceholders(gStringVar4, gText_PkmnBaseVar2StatIncreased); + break; + case 17: + StringCopy(gStringVar2, gText_Defense3); + StringExpandPlaceholders(gStringVar4, gText_PkmnBaseVar2StatIncreased); + break; + case 16: + StringCopy(gStringVar2, gText_Speed2); + StringExpandPlaceholders(gStringVar4, gText_PkmnBaseVar2StatIncreased); + break; + case 14: + StringCopy(gStringVar2, gText_SpAtk3); + StringExpandPlaceholders(gStringVar4, gText_PkmnBaseVar2StatIncreased); + break; + case 15: + StringCopy(gStringVar2, gText_SpDef3); + StringExpandPlaceholders(gStringVar4, gText_PkmnBaseVar2StatIncreased); + break; + case 19: + case 20: + StringExpandPlaceholders(gStringVar4, gText_MovesPPIncreased); + break; + case 21: + StringExpandPlaceholders(gStringVar4, gText_PPWasRestored); + break; + default: + StringExpandPlaceholders(gStringVar4, gText_WontHaveEffect); + break; + } +} + +static bool8 UsingHPEVItemOnShedinja(struct Pokemon *mon, u16 item) +{ + if (GetItemEffectType(item) == 13 && GetMonData(mon, MON_DATA_SPECIES) == SPECIES_SHEDINJA) + return FALSE; + return TRUE; +} + +static bool8 IsBlueYellowRedFlute(u16 item) +{ + if (item == ITEM_BLUE_FLUTE || item == ITEM_RED_FLUTE || item == ITEM_YELLOW_FLUTE) + return TRUE; + return FALSE; +} + +static bool8 ExecuteTableBasedItemEffect__(u8 partyMonIndex, u16 item, u8 monMoveIndex) +{ + if (gMain.inBattle) + return ExecuteTableBasedItemEffect(&gPlayerParty[partyMonIndex], item, sub_81B8F38(partyMonIndex), monMoveIndex); + else + return ExecuteTableBasedItemEffect(&gPlayerParty[partyMonIndex], item, partyMonIndex, monMoveIndex); +} + +void ItemUseCB_Medicine(u8 taskId, TaskFunc task) +{ + u16 hp = 0; + struct Pokemon *mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + u16 item = gSpecialVar_ItemId; + bool8 canHeal; + + if (UsingHPEVItemOnShedinja(mon, item)) + { + canHeal = IsHPRecoveryItem(item); + if (canHeal == TRUE) + { + hp = GetMonData(mon, MON_DATA_HP); + if (hp == GetMonData(mon, MON_DATA_MAX_HP)) + canHeal = FALSE; + } + if (ExecuteTableBasedItemEffect__(gUnknown_0203CEC8.unk9, item, 0)) + { + iTriedHonestlyIDid: + gUnknown_0203CEE8 = 0; + PlaySE(SE_SELECT); + sub_81B1B5C(gText_WontHaveEffect, 1); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = task; + return; + } + } + else + { + goto iTriedHonestlyIDid; + } + gUnknown_0203CEE8 = 1; + if (IsBlueYellowRedFlute(item) == FALSE) + { + PlaySE(SE_KAIFUKU); + if (gUnknown_0203CEC8.unkB != 14) + RemoveBagItem(item, 1); + } + else + { + PlaySE(SE_BIDORO); + } + party_menu_get_status_condition_and_update_object(mon, &gUnknown_0203CEDC[gUnknown_0203CEC8.unk9]); + if (gSprites[gUnknown_0203CEDC[gUnknown_0203CEC8.unk9].unkC].invisible) + DisplayPartyPokemonLevelCheck(mon, &gUnknown_0203CEDC[gUnknown_0203CEC8.unk9], 1); + if (canHeal == TRUE) + { + if (hp == 0) + sub_81B0FCC(gUnknown_0203CEC8.unk9, 1); + sub_81B1F18(taskId, gUnknown_0203CEC8.unk9, 1, GetMonData(mon, MON_DATA_HP) - hp, sub_81B672C); + sub_81B1FA8(taskId, 0, hp); + return; + } + else + { + GetMonNickname(mon, gStringVar1); + GetMedicineItemEffectMessage(item); + sub_81B1B5C(gStringVar4, 1); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = task; + } +} + +static void sub_81B672C(u8 taskId) +{ + GetMonNickname(&gPlayerParty[gUnknown_0203CEC8.unk9], gStringVar1); + StringExpandPlaceholders(gStringVar4, gText_PkmnHPRestoredByVar2); + sub_81B1B5C(gStringVar4, 0); + schedule_bg_copy_tilemap_to_vram(2); + HandleBattleLowHpMusicChange(); + gTasks[taskId].func = sub_81B6794; +} + +static void sub_81B6794(u8 taskId) +{ + if (sub_81B1BD4() != TRUE) + { + if (gUnknown_0203CEE8 == 0) + gUnknown_0203CEC4->exitCallback = NULL; + sub_81B12C0(taskId); + } +} + +void sub_81B67C8(u8 taskId, TaskFunc task) +{ + struct Pokemon *mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + u16 item = gSpecialVar_ItemId; + u8 effectType = GetItemEffectType(item); + u16 friendship = GetMonData(mon, MON_DATA_FRIENDSHIP); + u16 relevantEV = sub_81B691C(mon, effectType); + bool8 cannotUseEffect = ExecuteTableBasedItemEffect__(gUnknown_0203CEC8.unk9, item, 0); + u16 newFriendship = GetMonData(mon, MON_DATA_FRIENDSHIP); + u16 newRelevantEV = sub_81B691C(mon, effectType); + + if (cannotUseEffect || (friendship == newFriendship && relevantEV == newRelevantEV)) + { + gUnknown_0203CEE8 = 0; + PlaySE(SE_SELECT); + sub_81B1B5C(gText_WontHaveEffect, 1); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = task; + } + else + { + gUnknown_0203CEE8 = 1; + PlaySE(SE_KAIFUKU); + RemoveBagItem(item, 1); + GetMonNickname(mon, gStringVar1); + option_menu_get_string(effectType, gStringVar2); + if (friendship != newFriendship) + { + if (relevantEV != newRelevantEV) + StringExpandPlaceholders(gStringVar4, gText_PkmnFriendlyBaseVar2Fell); + else + StringExpandPlaceholders(gStringVar4, gText_PkmnFriendlyBaseVar2CantFall); + } + else + { + StringExpandPlaceholders(gStringVar4, gText_PkmnAdoresBaseVar2Fell); + } + sub_81B1B5C(gStringVar4, 1); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = task; + } +} + +static u16 sub_81B691C(struct Pokemon *mon, u8 effectType) +{ + switch (effectType) + { + case 13: + if (GetMonData(mon, MON_DATA_SPECIES) != SPECIES_SHEDINJA) + return GetMonData(mon, MON_DATA_HP_EV); + break; + case 12: + return GetMonData(mon, MON_DATA_ATK_EV); + case 17: + return GetMonData(mon, MON_DATA_DEF_EV); + case 16: + return GetMonData(mon, MON_DATA_SPEED_EV); + case 14: + return GetMonData(mon, MON_DATA_SPATK_EV); + case 15: + return GetMonData(mon, MON_DATA_SPDEF_EV); + } + return 0; +} + +static void option_menu_get_string(u8 effectType, u8 *dest) +{ + switch (effectType) + { + case 13: + StringCopy(dest, gText_HP3); + break; + case 12: + StringCopy(dest, gText_Attack3); + break; + case 17: + StringCopy(dest, gText_Defense3); + break; + case 16: + StringCopy(dest, gText_Speed2); + break; + case 14: + StringCopy(dest, gText_SpAtk3); + break; + case 15: + StringCopy(dest, gText_SpDef3); + break; + } +} + +static void sub_81B6A10(u8 slot) +{ + u8 i; + u8 moveCount = 0; + u8 fontId = 1; + u8 windowId = sub_81B31B0(3); + u16 move; + + for (i = 0; i < MAX_MON_MOVES; i++) + { + move = GetMonData(&gPlayerParty[slot], MON_DATA_MOVE1 + i); + AddTextPrinterParameterized(windowId, fontId, gMoveNames[move], 8, (i * 16) + 1, 0xFF, NULL); + if (move != MOVE_NONE) + moveCount++; + } + InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, moveCount, 0); + schedule_bg_copy_tilemap_to_vram(2); +} + +static void ether_effect_related_3(u8 taskId) +{ + s8 input = Menu_ProcessInput(); + + if (input != MENU_NOTHING_CHOSEN) + { + if (input == MENU_B_PRESSED) + { + PlaySE(SE_SELECT); + sub_81B6BB4(taskId); + } + else + { + sub_81B302C(&gUnknown_0203CEC4->unkC[1]); + ether_effect_related_2(taskId); + } + } +} + +void dp05_ether(u8 taskId, TaskFunc task) +{ + const u8 *effect; + u16 item = gSpecialVar_ItemId; + + if (item == ITEM_ENIGMA_BERRY) + effect = gSaveBlock1Ptr->enigmaBerry.itemEffect; + else + effect = gItemEffectTable[item - ITEM_POTION]; + if ((effect[4] & 0x10) == 0) + { + gUnknown_0203CEC8.unkE = 0; + ether_effect_related(taskId); + } + else + { + PlaySE(SE_SELECT); + display_pokemon_menu_message(22); + sub_81B6A10(gUnknown_0203CEC8.unk9); + gTasks[taskId].func = ether_effect_related_3; + } +} + +static void ether_effect_related_2(u8 taskId) +{ + sub_81B302C(&gUnknown_0203CEC4->unkC[0]); + gUnknown_0203CEC8.unkE = Menu_GetCursorPos(); + ether_effect_related(taskId); +} + +static void sub_81B6BB4(u8 taskId) +{ + gTasks[taskId].func = sub_81B1370; + gUnknown_0203CEC4->exitCallback = NULL; + sub_81B302C(&gUnknown_0203CEC4->unkC[0]); + display_pokemon_menu_message(5); +} + +static void ether_effect_related(u8 taskId) +{ + u16 move = MOVE_NONE; + s16 *moveslot = &gUnknown_0203CEC8.unkE; + u16 item = gSpecialVar_ItemId; + struct Struct203CEC8 *ptr = &gUnknown_0203CEC8; + struct Pokemon *mon; + + if (ExecuteTableBasedItemEffect__(ptr->unk9, item, *moveslot)) + { + gUnknown_0203CEE8 = 0; + PlaySE(SE_SELECT); + sub_81B1B5C(gText_WontHaveEffect, 1); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = sub_81B6794; + } + else + { + gUnknown_0203CEE8 = 1; + mon = &gPlayerParty[ptr->unk9]; + PlaySE(SE_KAIFUKU); + RemoveBagItem(item, 1); + move = GetMonData(mon, MON_DATA_MOVE1 + *moveslot); + StringCopy(gStringVar1, gMoveNames[move]); + GetMedicineItemEffectMessage(item); + sub_81B1B5C(gStringVar4, 1); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = sub_81B6794; + } +} + +void dp05_pp_up(u8 taskId, TaskFunc task) +{ + PlaySE(SE_SELECT); + display_pokemon_menu_message(23); + sub_81B6A10(gUnknown_0203CEC8.unk9); + gTasks[taskId].func = ether_effect_related_3; +} + +u16 ItemIdToBattleMoveId(u16 item) +{ + u16 tmNumber = item - ITEM_TM01_FOCUS_PUNCH; + return gTMHMMoves[tmNumber]; +} + +bool8 IsMoveHm(u16 move) +{ + u8 i; + + for (i = 0; i < NUM_HIDDEN_MACHINES; i++) + { + if (gTMHMMoves[i + NUM_TECHNICAL_MACHINES] == move) + return TRUE; + } + return FALSE; +} + +bool8 MonKnowsMove(struct Pokemon *mon, u16 move) +{ + u8 i; + + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (GetMonData(mon, MON_DATA_MOVE1 + i) == move) + return TRUE; + } + return FALSE; +} + +static void sub_81B6D74(const u8 *str) +{ + StringExpandPlaceholders(gStringVar4, str); + sub_81B1B5C(gStringVar4, 1); + schedule_bg_copy_tilemap_to_vram(2); +} + +static void sub_81B6D98(u8 taskId, const u8 *str) +{ + sub_81B6D74(str); + gTasks[taskId].func = sub_81B6794; +} + +// move[1] doesn't use constants cause I don't know if it's actually a move ID storage + +void sub_81B6DC4(u8 taskId, TaskFunc task) +{ + struct Pokemon *mon; + s16 *move; + u16 item; + + PlaySE(SE_SELECT); + mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + move = &gUnknown_0203CEC8.unkE; + item = gSpecialVar_ItemId; + GetMonNickname(mon, gStringVar1); + move[0] = ItemIdToBattleMoveId(item); + StringCopy(gStringVar2, gMoveNames[move[0]]); + move[1] = 0; + + switch (CanMonLearnTMTutor(mon, item, 0)) + { + case CANNOT_LEARN_MOVE: + sub_81B6D98(taskId, gText_PkmnCantLearnMove); + return; + case ALREADY_KNOWS_MOVE: + sub_81B6D98(taskId, gText_PkmnAlreadyKnows); + return; + } + + if (GiveMoveToMon(mon, move[0]) != 0xFFFF) + { + gTasks[taskId].func = sub_81B6EB4; + } + else + { + sub_81B6D74(gText_PkmnNeedsToReplaceMove); + gTasks[taskId].func = sub_81B6FF4; + } +} + +static void sub_81B6EB4(u8 taskId) +{ + struct Pokemon *mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + s16 *move = &gUnknown_0203CEC8.unkE; + u16 item = gSpecialVar_ItemId; + + if (move[1] == 0) + { + AdjustFriendship(mon, 4); + if (item < ITEM_HM01_CUT) + RemoveBagItem(item, 1); + } + GetMonNickname(mon, gStringVar1); + StringCopy(gStringVar2, gMoveNames[move[0]]); + StringExpandPlaceholders(gStringVar4, gText_PkmnLearnedMove3); + sub_81B1B5C(gStringVar4, 1); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = sub_81B6F60; +} + +static void sub_81B6F60(u8 taskId) +{ + if (sub_81B1BD4() != TRUE) + { + PlayFanfare(MUS_FANFA1); + gTasks[taskId].func = sub_81B6F98; + } +} + +static void sub_81B6F98(u8 taskId) +{ + if (IsFanfareTaskInactive() && ((gMain.newKeys & A_BUTTON) || (gMain.newKeys & B_BUTTON))) + { + if (gUnknown_0203CEC8.unk10 == 1) + sub_81B77AC(taskId); + else + { + if (gUnknown_0203CEC8.unk10 == 2) + gSpecialVar_Result = TRUE; + sub_81B12C0(taskId); + } + } +} + +static void sub_81B6FF4(u8 taskId) +{ + if (sub_81B1BD4() != TRUE) + { + sub_81B334C(); + gTasks[taskId].func = sub_81B7028; + } +} + +static void sub_81B7028(u8 taskId) +{ + switch (Menu_ProcessInputNoWrapClearOnChoose()) + { + case 0: + sub_81B1B5C(gText_WhichMoveToForget, 1); + gTasks[taskId].func = sub_81B7088; + break; + case MENU_B_PRESSED: + PlaySE(SE_SELECT); + case 1: + sub_81B7230(taskId); + break; + } +} + +static void sub_81B7088(u8 taskId) +{ + if (sub_81B1BD4() != TRUE) + { + gUnknown_0203CEC4->exitCallback = sub_81B70B8; + sub_81B12C0(taskId); + } +} + +static void sub_81B70B8(void) +{ + ShowSelectMovePokemonSummaryScreen(gPlayerParty, gUnknown_0203CEC8.unk9, gPlayerPartyCount - 1, sub_81B70F0, gUnknown_0203CEC8.unkE); +} + +static void sub_81B70F0(void) +{ + InitPartyMenu(0, 0, 0, 1, 0x7F, sub_81B711C, gUnknown_0203CEC8.exitCallback); +} + +static void sub_81B711C(u8 taskId) +{ + if (!gPaletteFade.active) + { + if (sub_81C1B94() != 4) + sub_81B7154(taskId); + else + sub_81B7230(taskId); + } +} + +static void sub_81B7154(u8 taskId) +{ + struct Pokemon *mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + u16 move = GetMonData(mon, MON_DATA_MOVE1 + sub_81C1B94()); + + GetMonNickname(mon, gStringVar1); + StringCopy(gStringVar2, gMoveNames[move]); + sub_81B6D74(gText_12PoofForgotMove); + gTasks[taskId].func = sub_81B71D4; +} + +static void sub_81B71D4(u8 taskId) +{ + struct Pokemon *mon; + u16 move; + + if (sub_81B1BD4() != TRUE) + { + mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + RemoveMonPPBonus(mon, sub_81C1B94()); + move = gUnknown_0203CEC8.unkE; + SetMonMoveSlot(mon, move, sub_81C1B94()); + sub_81B6EB4(taskId); + } +} + +static void sub_81B7230(u8 taskId) +{ + StringCopy(gStringVar2, gMoveNames[gUnknown_0203CEC8.unkE]); + StringExpandPlaceholders(gStringVar4, gText_StopLearningMove2); + sub_81B1B5C(gStringVar4, 1); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = sub_81B7294; +} + +static void sub_81B7294(u8 taskId) +{ + if (sub_81B1BD4() != TRUE) + { + sub_81B334C(); + gTasks[taskId].func = sub_81B72C8; + } +} + +static void sub_81B72C8(u8 taskId) +{ + struct Pokemon *mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + + switch (Menu_ProcessInputNoWrapClearOnChoose()) + { + case 0: + GetMonNickname(mon, gStringVar1); + StringCopy(gStringVar2, gMoveNames[gUnknown_0203CEC8.unkE]); + StringExpandPlaceholders(gStringVar4, gText_MoveNotLearned); + sub_81B1B5C(gStringVar4, 1); + if (gUnknown_0203CEC8.unk10 == 1) + { + gTasks[taskId].func = sub_81B73E4; + } + else + { + if (gUnknown_0203CEC8.unk10 == 2) + gSpecialVar_Result = FALSE; + gTasks[taskId].func = sub_81B6794; + } + break; + case MENU_B_PRESSED: + PlaySE(SE_SELECT); + case 1: + GetMonNickname(mon, gStringVar1); + StringCopy(gStringVar2, gMoveNames[gUnknown_0203CEC8.unkE]); + sub_81B6D74(gText_PkmnNeedsToReplaceMove); + gTasks[taskId].func = sub_81B6FF4; + break; + } +} + +static void sub_81B73E4(u8 taskId) +{ + if (sub_81B1BD4() != TRUE) + sub_81B77AC(taskId); +} + +void dp05_rare_candy(u8 taskId, TaskFunc task) +{ + struct Pokemon *mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + struct Struct203CEC4 *ptr = gUnknown_0203CEC4; + s16 *arrayPtr = ptr->data; + u16 *itemPtr = &gSpecialVar_ItemId; + bool8 cannotUseEffect; + + if (GetMonData(mon, MON_DATA_LEVEL) != MAX_LEVEL) + { + sub_81B79A0(mon, arrayPtr); + cannotUseEffect = ExecuteTableBasedItemEffect__(gUnknown_0203CEC8.unk9, *itemPtr, 0); + sub_81B79A0(mon, &ptr->data[6]); + } + else + { + cannotUseEffect = TRUE; + } + PlaySE(SE_SELECT); + if (cannotUseEffect) + { + gUnknown_0203CEE8 = 0; + sub_81B1B5C(gText_WontHaveEffect, 1); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = task; + } + else + { + gUnknown_0203CEE8 = 1; + PlayFanfareByFanfareNum(0); + sub_81B754C(gUnknown_0203CEC8.unk9, mon); + RemoveBagItem(gSpecialVar_ItemId, 1); + GetMonNickname(mon, gStringVar1); + ConvertIntToDecimalStringN(gStringVar2, GetMonData(mon, MON_DATA_LEVEL), 0, 3); + StringExpandPlaceholders(gStringVar4, gText_PkmnElevatedToLvVar2); + sub_81B1B5C(gStringVar4, 1); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = sub_81B75D4; + } +} + +static void sub_81B754C(u8 slot, struct Pokemon *mon) +{ + party_menu_get_status_condition_and_update_object(mon, &gUnknown_0203CEDC[slot]); + if (gSprites[gUnknown_0203CEDC[slot].unkC].invisible) + DisplayPartyPokemonLevelCheck(mon, &gUnknown_0203CEDC[slot], 1); + DisplayPartyPokemonHPCheck(mon, &gUnknown_0203CEDC[slot], 1); + DisplayPartyPokemonMaxHPCheck(mon, &gUnknown_0203CEDC[slot], 1); + DisplayPartyPokemonHPBarCheck(mon, &gUnknown_0203CEDC[slot]); + sub_81B5B38(gUnknown_0203CEDC[slot].unk9, mon); + sub_81B0FCC(slot, 1); + schedule_bg_copy_tilemap_to_vram(0); +} + +static void sub_81B75D4(u8 taskId) +{ + if (WaitFanfare(FALSE) && sub_81B1BD4() != TRUE && ((gMain.newKeys & A_BUTTON) || (gMain.newKeys & B_BUTTON))) + { + PlaySE(SE_SELECT); + sub_81B767C(taskId); + gTasks[taskId].func = sub_81B7634; + } +} + +static void sub_81B7634(u8 taskId) +{ + if ((gMain.newKeys & A_BUTTON) || (gMain.newKeys & B_BUTTON)) + { + PlaySE(SE_SELECT); + sub_81B76C8(taskId); + gTasks[taskId].func = sub_81B7704; + } +} + +static void sub_81B767C(u8 taskId) +{ + s16 *arrayPtr = gUnknown_0203CEC4->data; + + arrayPtr[12] = sub_81B3364(); + sub_81D3640(arrayPtr[12], arrayPtr, &arrayPtr[6], 1, 2, 3); + CopyWindowToVram(arrayPtr[12], 2); + schedule_bg_copy_tilemap_to_vram(2); +} + +static void sub_81B76C8(u8 taskId) +{ + s16 *arrayPtr = gUnknown_0203CEC4->data; + + sub_81D3784(arrayPtr[12], &arrayPtr[6], 1, 2, 3); + CopyWindowToVram(arrayPtr[12], 2); + schedule_bg_copy_tilemap_to_vram(2); +} + +static void sub_81B7704(u8 taskId) +{ + u16 result; + + if (WaitFanfare(0) && ((gMain.newKeys & A_BUTTON) || (gMain.newKeys & B_BUTTON))) + { + sub_81B3394(); + result = MonTryLearningNewMove(&gPlayerParty[gUnknown_0203CEC8.unk9], 1); + gUnknown_0203CEC8.unk10 = 1; + switch (result) + { + case 0: + sub_81B7810(taskId); + break; + case 0xFFFF: + sub_81B787C(taskId); + break; + case 0xFFFE: + gTasks[taskId].func = sub_81B77AC; + break; + default: + sub_81B7910(taskId, result); + break; + } + } +} + +static void sub_81B77AC(u8 taskId) +{ + u16 result = MonTryLearningNewMove(&gPlayerParty[gUnknown_0203CEC8.unk9], 0); + + switch (result) + { + case 0: + sub_81B7810(taskId); + break; + case 0xFFFF: + sub_81B787C(taskId); + break; + case 0xFFFE: + return; + default: + sub_81B7910(taskId, result); + break; + } +} + +static void sub_81B7810(u8 taskId) +{ + struct Pokemon *mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + u16 targetSpecies = GetEvolutionTargetSpecies(mon, 0, 0); + + if (targetSpecies != SPECIES_NONE) + { + FreePartyPointers(); + gCB2_AfterEvolution = gUnknown_0203CEC8.exitCallback; + BeginEvolutionScene(mon, targetSpecies, 1, gUnknown_0203CEC8.unk9); + DestroyTask(taskId); + } + else + { + gTasks[taskId].func = sub_81B6794; + } +} + +static void sub_81B787C(u8 taskId) +{ + GetMonNickname(&gPlayerParty[gUnknown_0203CEC8.unk9], gStringVar1); + StringCopy(gStringVar2, gMoveNames[gMoveToLearn]); + StringExpandPlaceholders(gStringVar4, gText_PkmnNeedsToReplaceMove); + sub_81B1B5C(gStringVar4, 1); + schedule_bg_copy_tilemap_to_vram(2); + gUnknown_0203CEC8.unkE = gMoveToLearn; + gTasks[taskId].func = sub_81B6FF4; +} + +static void sub_81B7910(u8 taskId, u16 move) +{ + GetMonNickname(&gPlayerParty[gUnknown_0203CEC8.unk9], gStringVar1); + StringCopy(gStringVar2, gMoveNames[move]); + StringExpandPlaceholders(gStringVar4, gText_PkmnLearnedMove3); + sub_81B1B5C(gStringVar4, 1); + schedule_bg_copy_tilemap_to_vram(2); + gUnknown_0203CEC8.unkE = move; + gTasks[taskId].func = sub_81B6F60; +} + +static void sub_81B79A0(struct Pokemon *mon, s16 *data) +{ + data[0] = GetMonData(mon, MON_DATA_MAX_HP); + data[1] = GetMonData(mon, MON_DATA_ATK); + data[2] = GetMonData(mon, MON_DATA_DEF); + data[4] = GetMonData(mon, MON_DATA_SPATK); + data[5] = GetMonData(mon, MON_DATA_SPDEF); + data[3] = GetMonData(mon, MON_DATA_SPEED); +} + +void sub_81B79E8(u8 taskId, TaskFunc task) +{ + gUnknown_0203CEC4->data[0] = 0; + gUnknown_0203CEC4->data[1] = 0; + gUnknown_0203CEC4->data[2] = gUnknown_0203CEC8.unk9; + sub_81B7A28(taskId); +} + +static void sub_81B7A28(u8 taskId) +{ + struct Pokemon *mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + u16 hp; + + if (GetMonData(mon, MON_DATA_SPECIES) == SPECIES_NONE) + { + gTasks[taskId].func = task_sacred_ash_party_loop; + return; + } + + hp = GetMonData(mon, MON_DATA_HP); + if (ExecuteTableBasedItemEffect__(gUnknown_0203CEC8.unk9, gSpecialVar_ItemId, 0)) + { + gTasks[taskId].func = task_sacred_ash_party_loop; + return; + } + + PlaySE(SE_KAIFUKU); + party_menu_get_status_condition_and_update_object(mon, &gUnknown_0203CEDC[gUnknown_0203CEC8.unk9]); + if (gSprites[gUnknown_0203CEDC[gUnknown_0203CEC8.unk9].unkC].invisible) + DisplayPartyPokemonLevelCheck(mon, &gUnknown_0203CEDC[gUnknown_0203CEC8.unk9], 1); + sub_81B0FCC(gUnknown_0203CEC4->data[2], 0); + sub_81B0FCC(gUnknown_0203CEC8.unk9, 1); + sub_81B1F18(taskId, gUnknown_0203CEC8.unk9, 1, GetMonData(mon, MON_DATA_HP) - hp, sub_81B7C10); + sub_81B1FA8(taskId, 0, hp); + gUnknown_0203CEC4->data[0] = 1; + gUnknown_0203CEC4->data[1] = 1; +} + +static void task_sacred_ash_party_loop(u8 taskId) +{ + if (sub_81B1BD4() != TRUE) + { + if (gUnknown_0203CEC4->data[0] == 1) + { + gUnknown_0203CEC4->data[0] = 0; + gUnknown_0203CEC4->data[2] = gUnknown_0203CEC8.unk9; + } + if (++(gUnknown_0203CEC8.unk9) == PARTY_SIZE) + { + if (gUnknown_0203CEC4->data[1] == 0) + { + gUnknown_0203CEE8 = 0; + sub_81B1B5C(gText_WontHaveEffect, 1); + schedule_bg_copy_tilemap_to_vram(2); + } + else + { + gUnknown_0203CEE8 = 1; + RemoveBagItem(gSpecialVar_ItemId, 1); + } + gTasks[taskId].func = sub_81B6794; + gUnknown_0203CEC8.unk9 = 0; + } + else + { + sub_81B7A28(taskId); + } + } +} + +static void sub_81B7C10(u8 taskId) +{ + GetMonNickname(&gPlayerParty[gUnknown_0203CEC8.unk9], gStringVar1); + StringExpandPlaceholders(gStringVar4, gText_PkmnHPRestoredByVar2); + sub_81B1B5C(gStringVar4, 0); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = task_sacred_ash_party_loop; +} + +void sub_81B7C74(u8 taskId, TaskFunc task) +{ + PlaySE(SE_SELECT); + gCB2_AfterEvolution = gUnknown_0203CEC8.exitCallback; + if (ExecuteTableBasedItemEffect__(gUnknown_0203CEC8.unk9, gSpecialVar_ItemId, 0)) + { + gUnknown_0203CEE8 = 0; + sub_81B1B5C(gText_WontHaveEffect, 1); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = task; + } + else + { + RemoveBagItem(gSpecialVar_ItemId, 1); + FreePartyPointers(); + } +} + +u8 GetItemEffectType(u16 item) +{ + const u8 *itemEffect; +#ifndef NONMATCHING + register u8 itemEffect0 asm("r1"); + register u8 itemEffect3 asm("r3"); + register u32 itemEffect0_r0 asm("r0"); // u32 to prevent shifting when transferring itemEffect0 to this + u8 mask; +#else +#define itemEffect0 itemEffect[0] +#define itemEffect3 itemEffect[3] +#define mask 0x3F +#endif + + if (!IS_POKEMON_ITEM(item)) + { + return 22; + } + else + { + // Read the item's effect properties. + if (item == ITEM_ENIGMA_BERRY) + { + itemEffect = gSaveBlock1Ptr->enigmaBerry.itemEffect; + } + else + { + itemEffect = gItemEffectTable[item - ITEM_POTION]; + } + +#ifndef NONMATCHING + itemEffect0 = itemEffect[0]; + mask = 0x3F; +#endif + + if ((itemEffect0 & mask) || itemEffect[1] || itemEffect[2]) + { + return 0; + } +#ifndef NONMATCHING + itemEffect3 = itemEffect[3]; +#endif + if (itemEffect3 & 0x80) + { + return 0; + } + else if (itemEffect0 & 0x40) + { + return 10; + } + else if (itemEffect3 & 0x40) + { + return 1; + } + else if ((itemEffect3 & mask) || (itemEffect0 >> 7)) + { + if ((itemEffect3 & mask) == 0x20) + { + return 4; + } + else if ((itemEffect3 & mask) == 0x10) + { + return 3; + } + else if ((itemEffect3 & mask) == 0x8) + { + return 5; + } + else if ((itemEffect3 & mask) == 0x4) + { + return 6; + } + else if ((itemEffect3 & mask) == 0x2) + { + return 7; + } + else if ((itemEffect3 & mask) == 0x1) + { + return 8; + } + // alternate fakematching + // itemEffect0_r0 = itemEffect0 >> 7; + // asm(""); // increase live length for greg + // if ((itemEffect0_r0 != 0) && (itemEffect3 & mask) == 0) +#ifndef NONMATCHING + else if (((itemEffect0_r0 = itemEffect0 >> 7) != 0) && (itemEffect3 & mask) == 0) +#else + else if (((itemEffect[0] >> 7) != 0) && (itemEffect[3] & 0x3F) == 0) +#endif + { + return 9; + } + else + { + return 11; + } + } + else if (itemEffect[4] & 0x44) + { + return 2; + } + else if (itemEffect[4] & 0x2) + { + return 12; + } + else if (itemEffect[4] & 0x1) + { + return 13; + } + else if (itemEffect[5] & 0x8) + { + return 14; + } + else if (itemEffect[5] & 0x4) + { + return 15; + } + else if (itemEffect[5] & 0x2) + { + return 16; + } + else if (itemEffect[5] & 0x1) + { + return 17; + } + else if (itemEffect[4] & 0x80) + { + return 18; + } + else if (itemEffect[4] & 0x20) + { + return 19; + } + else if (itemEffect[5] & 0x10) + { + return 20; + } + else if (itemEffect[4] & 0x18) + { + return 21; + } + return 22; + } +#ifdef NONMATCHING +#undef itemEffect0 +#undef itemEffect3 +#undef mask +#endif +} + +static void sub_81B7E4C(u8 taskId) +{ + struct Pokemon *mon; + s16 *move; + + if (!gPaletteFade.active) + { + mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + move = &gUnknown_0203CEC8.unkE; + GetMonNickname(mon, gStringVar1); + gUnknown_0203CEC8.unkE = GetTutorMove(gSpecialVar_0x8005); + StringCopy(gStringVar2, gMoveNames[gUnknown_0203CEC8.unkE]); + move[1] = 2; + switch (CanMonLearnTMTutor(mon, 0, gSpecialVar_0x8005)) + { + case CANNOT_LEARN_MOVE: + sub_81B6D98(taskId, gText_PkmnCantLearnMove); + return; + case ALREADY_KNOWS_MOVE: + sub_81B6D98(taskId, gText_PkmnAlreadyKnows); + return; + default: + if (GiveMoveToMon(mon, gUnknown_0203CEC8.unkE) != 0xFFFF) + { + sub_81B6EB4(taskId); + return; + } + break; + } + sub_81B6D74(gText_PkmnNeedsToReplaceMove); + gTasks[taskId].func = sub_81B6FF4; + } +} + +void CB2_PartyMenuFromStartMenu(void) +{ + InitPartyMenu(0, 0, 0, 0, 0, sub_81B1370, CB2_ReturnToFieldWithOpenMenu); +} + +void sub_81B7F60(void) +{ + MainCallback callback = (InBattlePyramid() == FALSE) ? c2_815ABFC : sub_81C4F84; + InitPartyMenu(0, 0, 5, 0, 6, sub_81B1370, callback); + gUnknown_0203CEC8.unkC = gSpecialVar_ItemId; +} + +static void sub_81B7FAC(u8 taskId) +{ + gUnknown_0203CEFC = GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_HELD_ITEM); + if (gUnknown_0203CEFC == ITEM_NONE) + { + sub_81B8044(taskId); + } + else if (ItemIsMail(gUnknown_0203CEFC)) + { + sub_81B83B8(taskId); + } + else + { + sub_81B1D1C(&gPlayerParty[gUnknown_0203CEC8.unk9], gUnknown_0203CEFC, 1); + gTasks[taskId].func = sub_81B82A0; + } +} + +static void sub_81B8044(u8 taskId) +{ + if (ItemIsMail(gUnknown_0203CEC8.unkC)) + { + sub_81B83F0(gUnknown_0203CEC8.unkC); + gUnknown_0203CEC4->exitCallback = sub_81B814C; + sub_81B12C0(taskId); + } + else + { + sub_81B8088(taskId); + } +} + +static void sub_81B8088(u8 taskId) +{ + u16 item; + + if (!gPaletteFade.active) + { + item = gUnknown_0203CEC8.unkC; + sub_81B1C84(&gPlayerParty[gUnknown_0203CEC8.unk9], item, 0, 1); + sub_81B1DB8(&gPlayerParty[gUnknown_0203CEC8.unk9], item); + sub_81B83F0(item); + gTasks[taskId].func = sub_81B8104; + } +} + +static void sub_81B8104(u8 taskId) +{ + s8 slot = gUnknown_0203CEC8.unk9; + + if (sub_81B1BD4() != TRUE) + { + sub_81B5C94(&gPlayerParty[slot], &gUnknown_0203CEDC[slot]); + sub_81B12C0(taskId); + } +} + +static void sub_81B814C(void) +{ + u8 mail; + + sub_81B1DB8(&gPlayerParty[gUnknown_0203CEC8.unk9], gUnknown_0203CEC8.unkC); + mail = GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_MAIL); + sub_811A20C(4, gSaveBlock1Ptr->mail[mail].words, sub_81B81A8, 3); +} + +static void sub_81B81A8(void) +{ + struct Pokemon *mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + u16 item = GetMonData(mon, MON_DATA_HELD_ITEM); + + if (gSpecialVar_Result == FALSE) + { + TakeMailFromMon(mon); + SetMonData(mon, MON_DATA_HELD_ITEM, &gUnknown_0203CEFC); + RemoveBagItem(gUnknown_0203CEFC, 1); + sub_81B841C(item); + SetMainCallback2(gUnknown_0203CEC8.exitCallback); + } + else + { + InitPartyMenu(gUnknown_0203CEC8.unk8_0, 0xFF, gUnknown_0203CEC8.unkB, 1, 0x7F, sub_81B8230, gUnknown_0203CEC8.exitCallback); + } +} + +static void sub_81B8230(u8 taskId) +{ + if (!gPaletteFade.active) + { + if (gUnknown_0203CEFC != ITEM_NONE) + sub_81B1D68(gUnknown_0203CEC8.unkC, gUnknown_0203CEFC, 0); + else + sub_81B1C84(&gPlayerParty[gUnknown_0203CEC8.unk9], gUnknown_0203CEC8.unkC, 0, 1); + gTasks[taskId].func = sub_81B8104; + } +} + +static void sub_81B82A0(u8 taskId) +{ + if (sub_81B1BD4() != TRUE) + { + sub_81B334C(); + gTasks[taskId].func = sub_81B82D4; + } +} + +static void sub_81B82D4(u8 taskId) +{ + u16 item; + + switch (Menu_ProcessInputNoWrapClearOnChoose()) + { + case 0: + item = gUnknown_0203CEC8.unkC; + sub_81B83F0(item); + if (AddBagItem(gUnknown_0203CEFC, 1) == FALSE) + { + sub_81B841C(item); + pokemon_item_not_removed(gUnknown_0203CEFC); + sub_81B1B5C(gStringVar4, 0); + gTasks[taskId].func = sub_81B8104; + } + else if (ItemIsMail(item)) + { + gUnknown_0203CEC4->exitCallback = sub_81B814C; + sub_81B12C0(taskId); + } + else + { + sub_81B1DB8(&gPlayerParty[gUnknown_0203CEC8.unk9], item); + sub_81B1D68(item, gUnknown_0203CEFC, 1); + gTasks[taskId].func = sub_81B8104; + } + break; + case MENU_B_PRESSED: + PlaySE(SE_SELECT); + case 1: + gTasks[taskId].func = sub_81B8104; + break; + } +} + +static void sub_81B83B8(u8 taskId) +{ + sub_81B1B5C(gText_RemoveMailBeforeItem, 1); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = sub_81B8104; +} + +static void sub_81B83F0(u16 item) +{ + if (gUnknown_0203CEC8.unkB == 6) + RemovePCItem(item, 1); + else + RemoveBagItem(item, 1); +} + +static bool8 sub_81B841C(u16 item) +{ + if (gUnknown_0203CEC8.unkB == 5) + return AddBagItem(item, 1); + else + return AddPCItem(item, 1); +} + +void sub_81B8448(void) +{ + InitPartyMenu(0, 0, 7, 0, 6, sub_81B1370, Mailbox_ReturnToMailListAfterDeposit); +} + +static void sub_81B8474(u8 taskId) +{ + struct Pokemon *mon = &gPlayerParty[gUnknown_0203CEC8.unk9]; + struct MailStruct *mail; + + gUnknown_0203CEE8 = 0; + mail = &gSaveBlock1Ptr->mail[playerPCItemPageInfo.itemsAbove + 6 + playerPCItemPageInfo.cursorPos]; + if (GetMonData(mon, MON_DATA_HELD_ITEM) != ITEM_NONE) + { + sub_81B1B5C(gText_PkmnHoldingItemCantHoldMail, 1); + } + else + { + GiveMailToMon2(mon, mail); + ClearMailStruct(mail); + sub_81B1B5C(gText_MailTransferredFromMailbox, 1); + } + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = sub_81B8104; +} + +void sub_81B8518(u8 unused) +{ + sub_81B8558(); + InitPartyMenu(4, 0, 0, 0, 0, sub_81B1370, gMain.savedCallback); + gUnknown_0203CEC8.unk4 = sub_81B879C; +} + +void sub_81B8558(void) +{ + memset(gSelectedOrderFromParty, 0, sizeof(gSelectedOrderFromParty)); +} + +static u8 sub_81B856C(s8 slot) +{ + if (GetBattleEntryEligibility(&gPlayerParty[slot]) == FALSE) + return 2; + if (sub_81B8770(slot + 1) == TRUE) + return 1; + return 0; +} + +static bool8 GetBattleEntryEligibility(struct Pokemon *mon) +{ + u16 i = 0; + u16 species; + + if (GetMonData(mon, MON_DATA_IS_EGG) + || GetMonData(mon, MON_DATA_LEVEL) > sub_81B8888() + || (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(BATTLE_FRONTIER_BATTLE_PYRAMID_LOBBY) + && gSaveBlock1Ptr->location.mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PYRAMID_LOBBY) + && GetMonData(mon, MON_DATA_HELD_ITEM) != ITEM_NONE)) + { + return FALSE; + } + + switch (VarGet(VAR_FRONTIER_FACILITY)) // oddly the specific cases are beyond 6, turns out case 9 is apparently related to link battles + { + case 9: + if (GetMonData(mon, MON_DATA_HP) != 0) + return TRUE; + return FALSE; + case 8: + return TRUE; + default: + species = GetMonData(mon, MON_DATA_SPECIES); + for (; gFrontierBannedSpecies[i] != 0xFFFF; i++) + { + if (gFrontierBannedSpecies[i] == species) + return FALSE; + } + return TRUE; + } +} + +static u8 sub_81B865C(void) +{ + u8 unk2; + u8 i, j; + u8 facility; + struct Pokemon *party = gPlayerParty; + u8 unk = sub_81B885C(); + u8 *order = gSelectedOrderFromParty; + + if (order[unk - 1] == 0) + { + if (unk == 1) + return 14; + ConvertIntToDecimalStringN(gStringVar1, unk, 0, 1); + return 17; + } + + facility = VarGet(VAR_FRONTIER_FACILITY); + if (facility == 8 || facility == 9) + return 0xFF; + + unk2 = sub_81B8830(); + for (i = 0; i < unk2 - 1; i++) + { + u16 species = GetMonData(&party[order[i] - 1], MON_DATA_SPECIES); + u16 item = GetMonData(&party[order[i] - 1], MON_DATA_HELD_ITEM); + for (j = i + 1; j < unk2; j++) + { + if (species == GetMonData(&party[order[j] - 1], MON_DATA_SPECIES)) + return 18; + if (item != ITEM_NONE && item == GetMonData(&party[order[j] - 1], MON_DATA_HELD_ITEM)) + return 19; + } + } + + return 0xFF; +} + +static bool8 sub_81B8770(u8 slot) +{ + u8 i; + + for (i = 0; i < 4; i++) + { + if (gSelectedOrderFromParty[i] == slot) + return TRUE; + } + return FALSE; +} + +static void sub_81B879C(u8 taskId) +{ + u8 msgId = sub_81B865C(); + + if (msgId != 0xFF) + { + PlaySE(SE_HAZURE); + display_pokemon_menu_message(msgId); + gTasks[taskId].func = sub_81B87E8; + } + else + { + PlaySE(SE_SELECT); + sub_81B12C0(taskId); + } +} + +static void sub_81B87E8(u8 taskId) +{ + if ((gMain.newKeys & A_BUTTON) || (gMain.newKeys & B_BUTTON)) + { + PlaySE(SE_SELECT); + display_pokemon_menu_message(0); + gTasks[taskId].func = sub_81B1370; + } +} + +static u8 sub_81B8830(void) +{ + switch (VarGet(VAR_FRONTIER_FACILITY)) + { + case 9: + return 3; + case 8: + return 2; + default: + return gSpecialVar_0x8005; + } +} + +static u8 sub_81B885C(void) +{ + switch (VarGet(VAR_FRONTIER_FACILITY)) + { + case 9: + return 1; + case 8: + return 2; + default: + return gSpecialVar_0x8005; + } +} + +static u8 sub_81B8888(void) +{ + switch (VarGet(VAR_FRONTIER_FACILITY)) + { + case 9: + return 100; + case 8: + return 30; + default: + if (gSpecialVar_0x8004 == 0) + return 50; + return 100; + } +} + +static const u8* sub_81B88BC(void) +{ + u8 facilityNum = VarGet(VAR_FRONTIER_FACILITY); + + if (!(facilityNum != 8 && facilityNum != 9)) + return gText_CancelBattle; + else if (facilityNum == FRONTIER_FACILITY_DOME && gSpecialVar_0x8005 == 2) + return gText_ReturnToWaitingRoom; + else + return gText_CancelChallenge; +} + +void sub_81B8904(u8 initArg, MainCallback callback) +{ + InitPartyMenu(initArg, 0, 0, 0, 0, sub_81B1370, callback); +} + +void sub_81B892C(void) +{ + InitPartyMenu(0, 0, 12, 0, 4, sub_81B1370, CB2_ReturnToFieldContinueScriptPlayMapMusic); +} + +void sub_81B8958(void) +{ + InitPartyMenu(11, 0, 13, 0, 1, sub_81B1370, CB2_ReturnToFieldContinueScriptPlayMapMusic); +} + +static u8 sub_81B8984(void) +{ + if (IsDoubleBattle() == FALSE) + return 0; + if (IsMultiBattle() == TRUE) + return 2; + return 1; +} + +void OpenPartyMenuInBattle(u8 arg) +{ + InitPartyMenu(1, sub_81B8984(), arg, 0, 0, sub_81B1370, SetCB2ToReshowScreenAfterMenu); + nullsub_35(); + pokemon_change_order(); +} + +void sub_81B89F0(void) +{ + InitPartyMenu(1, sub_81B8984(), 3, 0, 5, sub_81B1370, c2_815ABFC); + nullsub_35(); + pokemon_change_order(); +} + +static u8 sub_81B8A2C(struct Pokemon *mon) +{ + if (GetMonData(&gPlayerParty[1], MON_DATA_SPECIES) != SPECIES_NONE && GetMonData(mon, MON_DATA_IS_EGG) == FALSE) + { + if (gUnknown_0203CEC8.unkB == 1) + return 3; + if (!(gBattleTypeFlags & BATTLE_TYPE_ARENA)) + return 2; + } + return 7; +} + +static bool8 sub_81B8A7C(void) +{ + u8 slot = GetCursorSelectionMonId(); + u8 newSlot; + u8 i; + + if (IsMultiBattle() == TRUE && (slot == 1 || slot == 4 || slot == 5)) + { + StringCopy(gStringVar1, GetTrainerPartnerName()); + StringExpandPlaceholders(gStringVar4, gText_CantSwitchWithAlly); + return FALSE; + } + if (GetMonData(&gPlayerParty[slot], MON_DATA_HP) == 0) + { + GetMonNickname(&gPlayerParty[slot], gStringVar1); + StringExpandPlaceholders(gStringVar4, gText_PkmnHasNoEnergy); + return FALSE; + } + for (i = 0; i < gBattlersCount; i++) + { + if (GetBattlerSide(i) == B_SIDE_PLAYER && sub_81B8F38(slot) == gBattlerPartyIndexes[i]) + { + GetMonNickname(&gPlayerParty[slot], gStringVar1); + StringExpandPlaceholders(gStringVar4, gText_PkmnAlreadyInBattle); + return FALSE; + } + } + if (GetMonData(&gPlayerParty[slot], MON_DATA_IS_EGG)) + { + StringExpandPlaceholders(gStringVar4, gText_EggCantBattle); + return FALSE; + } + if (sub_81B8F38(slot) == gBattleStruct->field_8B) + { + GetMonNickname(&gPlayerParty[slot], gStringVar1); + StringExpandPlaceholders(gStringVar4, gText_PkmnAlreadySelected); + return FALSE; + } + if (gUnknown_0203CEC8.unkB == 4) + { + SetMonPreventsSwitchingString(); + return FALSE; + } + if (gUnknown_0203CEC8.unkB == 2) + { + u8 currBattler = gBattlerInMenuId; + GetMonNickname(&gPlayerParty[pokemon_order_func(gBattlerPartyIndexes[currBattler])], gStringVar1); + StringExpandPlaceholders(gStringVar4, gText_PkmnCantSwitchOut); + return FALSE; + } + gUnknown_0203CEE9 = sub_81B8F38(slot); + gUnknown_0203CEE8 = 1; + newSlot = pokemon_order_func(gBattlerPartyIndexes[gBattlerInMenuId]); + sub_81B8FB0(newSlot, slot); + sub_81B1288(&gPlayerParty[newSlot], &gPlayerParty[slot]); + return TRUE; +} + +void sub_81B8C68(void) +{ + sub_81B8C88(gUnknown_0203CF00, sub_806D7EC()); +} + +static void sub_81B8C88(u8 *ptr, bool8 multiplayerFlag) +{ + u8 partyIndexes[6]; + int i, j; + + if (IsMultiBattle() == TRUE) + { + if (multiplayerFlag) + { + ptr[0] = 0 | (3 << 4); + ptr[1] = 5 | (4 << 4); + ptr[2] = 2 | (1 << 4); + } + else + { + ptr[0] = 3 | (0 << 4); + ptr[1] = 2 | (1 << 4); + ptr[2] = 5 | (4 << 4); + } + return; + } + else if (IsDoubleBattle() == FALSE) + { + j = 1; + partyIndexes[0] = gBattlerPartyIndexes[GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)]; + for (i = 0; i < PARTY_SIZE; i++) + { + if (i != partyIndexes[0]) + { + partyIndexes[j] = i; + j++; + } + } + } + else + { + j = 2; + partyIndexes[0] = gBattlerPartyIndexes[GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)]; + partyIndexes[1] = gBattlerPartyIndexes[GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT)]; + for (i = 0; i < PARTY_SIZE; i++) + { + if (i != partyIndexes[0] && i != partyIndexes[1]) + { + partyIndexes[j] = i; + j++; + } + } + } + for (i = 0; i < 3; i++) + ptr[i] = (partyIndexes[0 + (i * 2)] << 4) | partyIndexes[1 + (i * 2)]; +} + +void sub_81B8D64(u8 battlerId, u8 multiplayerFlag) +{ + sub_81B8D88(gBattleStruct->field_60[battlerId], multiplayerFlag, battlerId); +} + +static void sub_81B8D88(u8 *ptr, bool8 multiplayerFlag, u8 battlerId) +{ + u8 partyIndexes[6]; + int i, j; + u8 leftBattler; + u8 rightBattler; + + if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) + { + leftBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); + rightBattler = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); + } + else + { + leftBattler = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); + rightBattler = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); + } + + if (IsMultiBattle() == TRUE) + { + if (multiplayerFlag) + { + ptr[0] = 0 | (3 << 4); + ptr[1] = 5 | (4 << 4); + ptr[2] = 2 | (1 << 4); + } + else + { + ptr[0] = 3 | (0 << 4); + ptr[1] = 2 | (1 << 4); + ptr[2] = 5 | (4 << 4); + } + return; + } + else if (IsDoubleBattle() == FALSE) + { + j = 1; + partyIndexes[0] = gBattlerPartyIndexes[leftBattler]; + for (i = 0; i < PARTY_SIZE; i++) + { + if (i != partyIndexes[0]) + { + partyIndexes[j] = i; + j++; + } + } + } + else + { + j = 2; + partyIndexes[0] = gBattlerPartyIndexes[leftBattler]; + partyIndexes[1] = gBattlerPartyIndexes[rightBattler]; + for (i = 0; i < PARTY_SIZE; i++) + { + if (i != partyIndexes[0] && i != partyIndexes[1]) + { + partyIndexes[j] = i; + j++; + } + } + } + + for (i = 0; i < 3; i++) + ptr[i] = (partyIndexes[0 + (i * 2)] << 4) | partyIndexes[1 + (i * 2)]; +} + +void sub_81B8E80(u8 battlerId, u8 unk, u8 arrayIndex) +{ + u8 possiblePartyIndexes[6]; + u8 unk2 = 0; + int i, j; + u8 *battleStructRelated; + u8 possiblePartyIndexBuffer; + + if (IsMultiBattle()) + { + battleStructRelated = gBattleStruct->field_60[battlerId]; + for (i = j = 0; i < 3; j++, i++) + { + possiblePartyIndexes[j] = battleStructRelated[i] >> 4; + j++; + possiblePartyIndexes[j] = battleStructRelated[i] & 0xF; + } + possiblePartyIndexBuffer = possiblePartyIndexes[arrayIndex]; + for (i = 0; i < PARTY_SIZE; i++) + { + if (possiblePartyIndexes[i] == unk) + { + unk2 = possiblePartyIndexes[i]; + possiblePartyIndexes[i] = possiblePartyIndexBuffer; + break; + } + } + if (i != PARTY_SIZE) + { + possiblePartyIndexes[arrayIndex] = unk2; + battleStructRelated[0] = (possiblePartyIndexes[0] << 4) | possiblePartyIndexes[1]; + battleStructRelated[1] = (possiblePartyIndexes[2] << 4) | possiblePartyIndexes[3]; + battleStructRelated[2] = (possiblePartyIndexes[4] << 4) | possiblePartyIndexes[5]; + } + } +} + +static u8 sub_81B8F38(u8 slot) +{ + u8 modResult = slot & 1; + u8 retVal; + + slot /= 2; + if (modResult != 0) + retVal = gUnknown_0203CF00[slot] & 0xF; + else + retVal = gUnknown_0203CF00[slot] >> 4; + return retVal; +} + +static void sub_81B8F6C(u8 slot, u8 setVal) +{ + bool32 modResult = slot & 1; + + slot /= 2; + if (modResult != 0) + gUnknown_0203CF00[slot] = (gUnknown_0203CF00[slot] & 0xF0) | setVal; + else + gUnknown_0203CF00[slot] = (gUnknown_0203CF00[slot] & 0xF) | (setVal << 4); +} + +void sub_81B8FB0(u8 slot, u8 slot2) +{ + u8 valBuffer = sub_81B8F38(slot); + sub_81B8F6C(slot, sub_81B8F38(slot2)); + sub_81B8F6C(slot2, valBuffer); +} + +u8 pokemon_order_func(u8 slot) +{ + u8 i, j; + + for (j = i = 0; i < 3; j++, i++) + { + if ((gUnknown_0203CF00[i] >> 4) != slot) + { + j++; + if ((gUnknown_0203CF00[i] & 0xF) == slot) + return j; + } + else + { + return j; + } + } + return 0; +} + +static void pokemon_change_order(void) +{ + struct Pokemon *partyBuffer = Alloc(sizeof(gPlayerParty)); + u8 i; + + memcpy(partyBuffer, gPlayerParty, sizeof(gPlayerParty)); + for (i = 0; i < PARTY_SIZE; i++) + memcpy(&gPlayerParty[pokemon_order_func(i)], &partyBuffer[i], sizeof(struct Pokemon)); + Free(partyBuffer); +} + +static void sub_81B9080(void) +{ + struct Pokemon *partyBuffer = Alloc(sizeof(gPlayerParty)); + u8 i; + + memcpy(partyBuffer, gPlayerParty, sizeof(gPlayerParty)); + for (i = 0; i < PARTY_SIZE; i++) + memcpy(&gPlayerParty[sub_81B8F38(i)], &partyBuffer[i], sizeof(struct Pokemon)); + Free(partyBuffer); +} + +static void sub_81B90D0(void) +{ + u8 i; + struct Pokemon *mon; + u8 leadVal; + + for (i = 1; i < PARTY_SIZE; i++) + { + mon = &gPlayerParty[sub_81B8F38(i)]; + if (GetMonData(mon, MON_DATA_SPECIES) != SPECIES_NONE && GetMonData(mon, MON_DATA_HP) != 0) + { + leadVal = sub_81B8F38(0); + sub_81B8FB0(0, i); + sub_81B1288(&gPlayerParty[leadVal], mon); + break; + } + } +} + +static void sub_81B9140(void) +{ + SetMainCallback2(SetCB2ToReshowScreenAfterMenu); +} + +void sub_81B9150(void) +{ + InitPartyMenu(5, 3, 0, 0, 0x7F, sub_81B917C, gMain.savedCallback); +} + +static void sub_81B917C(u8 taskId) +{ + gTasks[taskId].data[0] = 256; + sub_81B9294(taskId); + ChangeBgX(2, 0x10000, 0); + gTasks[taskId].func = sub_81B91B4; +} + +static void sub_81B91B4(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + u8 i; + + if (!gPaletteFade.active) + { + data[0] -= 8; + sub_81B9294(taskId); + if (data[0] == 0) + { + for (i = 3; i < PARTY_SIZE; i++) + { + if (gUnknown_02022FF8[i - 3].species != SPECIES_NONE) + AnimateSelectedPartyIcon(gUnknown_0203CEDC[i].unk9, 0); + } + PlaySE(SE_W231); // Harden SE? + gTasks[taskId].func = sub_81B9240; + } + } +} + +static void sub_81B9240(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + if (++data[0] == 0x100) + sub_81B12C0(taskId); +} + +static void sub_81B9270(u8 spriteId, s16 x) +{ + if (x >= 0) + gSprites[spriteId].pos2.x = x; +} + +static void sub_81B9294(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + u8 i; + + for (i = 3; i < PARTY_SIZE; i++) + { + if (gUnknown_02022FF8[i - 3].species != SPECIES_NONE) + { + sub_81B9270(gUnknown_0203CEDC[i].unk9, data[0] - 8); + sub_81B9270(gUnknown_0203CEDC[i].unkA, data[0] - 8); + sub_81B9270(gUnknown_0203CEDC[i].unkB, data[0] - 8); + sub_81B9270(gUnknown_0203CEDC[i].unkC, data[0] - 8); + } + } + ChangeBgX(2, 0x800, 1); +} + +void sub_81B9328(void) +{ + InitPartyMenu(6, 0, 0, 0, 15, sub_81B1370, sub_81B9390); +} + +static void sub_81B9354(u8 arg1) +{ + gFieldCallback2 = hm_add_c3_without_phase_2; + InitPartyMenu(arg1, 0, 11, 0, 0, sub_81B1370, CB2_ReturnToField); +} + +static void sub_81B9390(void) +{ + gSpecialVar_0x8004 = GetCursorSelectionMonId(); + if (gSpecialVar_0x8004 >= PARTY_SIZE) + gSpecialVar_0x8004 = 0xFF; + gFieldCallback2 = hm_add_c3_without_phase_2; + SetMainCallback2(CB2_ReturnToField); +} + +bool8 hm_add_c3_without_phase_2(void) // might not be bool +{ + pal_fill_black(); + CreateTask(task_hm_without_phase_2, 10); + return TRUE; +} + +static void task_hm_without_phase_2(u8 taskId) +{ + if (IsWeatherNotFadingIn()) + { + DestroyTask(taskId); + ScriptContext2_Disable(); + EnableBothScriptContexts(); + } +} + +void sub_81B9404(void) +{ + ScriptContext2_Enable(); + FadeScreen(FADE_TO_BLACK, 0); + CreateTask(sub_81B9424, 10); +} + +static void sub_81B9424(u8 taskId) +{ + if (!gPaletteFade.active) + { + overworld_free_bg_tilemaps(); + InitPartyMenu(2, 0, 11, 0, 0, sub_81B1370, sub_81B9470); + DestroyTask(taskId); + } +} + +static void sub_81B9470(void) +{ + gUnknown_02039F24 = GetCursorSelectionMonId(); + if (gUnknown_02039F24 >= PARTY_SIZE) + gUnknown_02039F24 = 0xFF; + gSpecialVar_0x8004 = gUnknown_02039F24; + gFieldCallback2 = hm_add_c3_without_phase_2; + SetMainCallback2(CB2_ReturnToField); +} + +void sub_81B94B0(void) +{ + ScriptContext2_Enable(); + FadeScreen(FADE_TO_BLACK, 0); + CreateTask(sub_81B94D0, 10); +} + +static void sub_81B94D0(u8 taskId) +{ + if (!gPaletteFade.active) + { + overworld_free_bg_tilemaps(); + InitPartyMenu(3, 0, 11, 0, 0, sub_81B1370, sub_81B9390); + DestroyTask(taskId); + } +} + +void sub_81B951C(void) +{ + ScriptContext2_Enable(); + FadeScreen(FADE_TO_BLACK, 0); + CreateTask(sub_81B953C, 10); +} + +static void sub_81B953C(u8 taskId) +{ + if (!gPaletteFade.active) + { + overworld_free_bg_tilemaps(); + InitPartyMenu(7, 0, 11, 0, 0, sub_81B1370, sub_81B9588); + DestroyTask(taskId); + } +} + +static void sub_81B9588(void) +{ + gSpecialVar_0x8004 = GetCursorSelectionMonId(); + if (gSpecialVar_0x8004 >= PARTY_SIZE) + gSpecialVar_0x8004 = 0xFF; + else + gSpecialVar_0x8005 = GetNumberOfRelearnableMoves(&gPlayerParty[gSpecialVar_0x8004]); + gFieldCallback2 = hm_add_c3_without_phase_2; + SetMainCallback2(CB2_ReturnToField); +} + +void sub_81B95E0(void) +{ + u8 i; + + gSpecialVar_Result = FALSE; + for (i = 0; i < 3; i++) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM) != ITEM_NONE) + { + gSpecialVar_Result = TRUE; + break; + } + } +} + +void sub_81B9620(void) +{ + ScriptContext2_Enable(); + FadeScreen(FADE_TO_BLACK, 0); + CreateTask(sub_81B9640, 10); +} + +static void sub_81B9640(u8 taskId) +{ + if (!gPaletteFade.active) + { + overworld_free_bg_tilemaps(); + InitPartyMenu(12, 0, 0, 0, 0, sub_81B1370, sub_81B9390); + DestroyTask(taskId); + } +} + +void sub_81B968C(void) +{ + ShowPokemonSummaryScreen(PSS_MODE_SELECT_MOVE, gPlayerParty, gSpecialVar_0x8004, gPlayerPartyCount - 1, CB2_ReturnToField); + gFieldCallback = sub_80AF168; +} + +void sub_81B96D0(void) +{ + u8 i; + + gSpecialVar_Result = 0; + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_MOVE1 + i) != ITEM_NONE) + gSpecialVar_Result++; + } +} + +void sub_81B9718(void) +{ + struct Pokemon *mon = &gPlayerParty[gSpecialVar_0x8004]; + u16 move = GetMonData(mon, MON_DATA_MOVE1 + gSpecialVar_0x8005); + + GetMonNickname(mon, gStringVar1); + StringCopy(gStringVar2, gMoveNames[move]); +} + +void sub_81B9770(void) +{ + u16 i; + + SetMonMoveSlot(&gPlayerParty[gSpecialVar_0x8004], MOVE_NONE, gSpecialVar_0x8005); + RemoveMonPPBonus(&gPlayerParty[gSpecialVar_0x8004], gSpecialVar_0x8005); + for (i = gSpecialVar_0x8005; i < MAX_MON_MOVES - 1; i++) + sub_81B97DC(&gPlayerParty[gSpecialVar_0x8004], i, i + 1); +} + +static void sub_81B97DC(struct Pokemon *mon, u8 slotTo, u8 slotFrom) +{ + u16 move1 = GetMonData(mon, MON_DATA_MOVE1 + slotTo); + u16 move0 = GetMonData(mon, MON_DATA_MOVE1 + slotFrom); + u8 pp1 = GetMonData(mon, MON_DATA_PP1 + slotTo); + u8 pp0 = GetMonData(mon, MON_DATA_PP1 + slotFrom); + u8 ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES); + u8 ppBonusMask1 = gUnknown_08329D22[slotTo]; + u8 ppBonusMove1 = (ppBonuses & ppBonusMask1) >> (slotTo * 2); + u8 ppBonusMask2 = gUnknown_08329D22[slotFrom]; + u8 ppBonusMove2 = (ppBonuses & ppBonusMask2) >> (slotFrom * 2); + ppBonuses &= ~ppBonusMask1; + ppBonuses &= ~ppBonusMask2; + ppBonuses |= (ppBonusMove1 << (slotFrom * 2)) + (ppBonusMove2 << (slotTo * 2)); + SetMonData(mon, MON_DATA_MOVE1 + slotTo, &move0); + SetMonData(mon, MON_DATA_MOVE1 + slotFrom, &move1); + SetMonData(mon, MON_DATA_PP1 + slotTo, &pp0); + SetMonData(mon, MON_DATA_PP1 + slotFrom, &pp1); + SetMonData(mon, MON_DATA_PP_BONUSES, &ppBonuses); +} + +void sub_81B98DC(void) +{ + if (GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_IS_EGG)) + gSpecialVar_Result = TRUE; + else + gSpecialVar_Result = FALSE; +} + +void sub_81B9918(void) +{ + u16 move; + u32 i, j; + + gSpecialVar_Result = FALSE; + move = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_MOVE1 + gSpecialVar_0x8005); + if (move == MOVE_SURF) + { + for (i = 0; i < CalculatePlayerPartyCount(); i++) + { + if (i != gSpecialVar_0x8004) + { + for (j = 0; j < MAX_MON_MOVES; j++) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_MOVE1 + j) == MOVE_SURF) + return; + } + } + } + if (AnyStorageMonWithMove(move) != TRUE) + gSpecialVar_Result = TRUE; + } +} diff --git a/src/player_pc.c b/src/player_pc.c index c41dfa380..b7380cee3 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -461,9 +461,9 @@ static void ItemStorageMenuProcessInput(u8 taskId) s8 r2; s8 inputOptionId; - r5 = GetMenuCursorPos(); + r5 = Menu_GetCursorPos(); inputOptionId = Menu_ProcessInput(); - r2 = GetMenuCursorPos(); + r2 = Menu_GetCursorPos(); switch(inputOptionId) { case -2: diff --git a/src/poison.c b/src/poison.c index c52299e3a..a72aab111 100644 --- a/src/poison.c +++ b/src/poison.c @@ -194,7 +194,7 @@ void sub_810DBAC(struct Sprite *sprite) if (!gBattleAnimArgs[3]) StartSpriteAnim(sprite, 2); - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); @@ -218,7 +218,7 @@ void sub_810DC2C(struct Sprite *sprite) if (!gBattleAnimArgs[3]) StartSpriteAnim(sprite, 2); - InitAnimSpritePos(sprite, 1); + InitSpritePosToAnimAttacker(sprite, 1); SetAverageBattlerPositions(gBattleAnimTarget, 1, &l1, &l2); if (GetBattlerSide(gBattleAnimAttacker)) @@ -258,7 +258,7 @@ void sub_810DCD0(struct Sprite *sprite) static void sub_810DD24(struct Sprite *sprite) { - TranslateAnimLinearSimple(sprite); + AnimTranslateLinearSimple(sprite); sprite->data[1] -= sprite->data[5]; sprite->data[2] -= sprite->data[6]; @@ -295,7 +295,7 @@ void AnimBubbleEffect(struct Sprite *sprite) { if (!gBattleAnimArgs[2]) { - sub_80A6980(sprite, TRUE); + InitSpritePosToAnimTarget(sprite, TRUE); } else { diff --git a/src/pokeball.c b/src/pokeball.c index 82d2f2cea..baa165649 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -922,7 +922,7 @@ static void SpriteCB_PlayerMonSendOut_2(struct Sprite *sprite) StartSpriteAffineAnim(sprite, 4); } r4 = sprite->data[0]; - TranslateAnimLinear(sprite); + AnimTranslateLinear(sprite); sprite->data[7] += sprite->sBattler / 3; sprite->pos2.y += Sin(HIBYTE(sprite->data[7]), sprite->data[5]); sprite->oam.affineParam += 0x100; @@ -999,8 +999,8 @@ void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 battlerId, u8 x, u8 y, { u8 spriteId; - LoadCompressedObjectPicUsingHeap(&gBallSpriteSheets[0]); - LoadCompressedObjectPaletteUsingHeap(&gBallSpritePalettes[0]); + LoadCompressedSpriteSheetUsingHeap(&gBallSpriteSheets[0]); + LoadCompressedSpritePaletteUsingHeap(&gBallSpritePalettes[0]); spriteId = CreateSprite(&gBallSpriteTemplates[0], x, y, subpriortiy); gSprites[spriteId].data[0] = monSpriteId; @@ -1101,8 +1101,8 @@ u8 sub_807671C(u8 a, u8 b, u8 x, u8 y, u8 oamPriority, u8 subPriority, u8 g, u32 { u8 spriteId; - LoadCompressedObjectPicUsingHeap(&gBallSpriteSheets[0]); - LoadCompressedObjectPaletteUsingHeap(&gBallSpritePalettes[0]); + LoadCompressedSpriteSheetUsingHeap(&gBallSpriteSheets[0]); + LoadCompressedSpritePaletteUsingHeap(&gBallSpritePalettes[0]); spriteId = CreateSprite(&gBallSpriteTemplates[0], x, y, subPriority); gSprites[spriteId].data[0] = a; gSprites[spriteId].data[1] = g; @@ -1245,8 +1245,8 @@ void LoadBallGfx(u8 ballId) if (GetSpriteTileStartByTag(gBallSpriteSheets[ballId].tag) == 0xFFFF) { - LoadCompressedObjectPicUsingHeap(&gBallSpriteSheets[ballId]); - LoadCompressedObjectPaletteUsingHeap(&gBallSpritePalettes[ballId]); + LoadCompressedSpriteSheetUsingHeap(&gBallSpriteSheets[ballId]); + LoadCompressedSpritePaletteUsingHeap(&gBallSpritePalettes[ballId]); } switch (ballId) { diff --git a/src/pokeblock.c b/src/pokeblock.c index 1418588b8..7c07f9655 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -1,4 +1,5 @@ #include "global.h" +#include "alloc.h" #include "battle.h" #include "battle_controllers.h" #include "battle_message.h" @@ -6,14 +7,15 @@ #include "bg.h" #include "decompress.h" #include "event_data.h" +#include "field_screen_effect.h" #include "gpu_regs.h" #include "graphics.h" #include "international_string_util.h" #include "item.h" +#include "item_menu.h" #include "lilycove_lady.h" #include "list_menu.h" #include "main.h" -#include "alloc.h" #include "menu.h" #include "menu_helpers.h" #include "overworld.h" @@ -70,14 +72,9 @@ enum PKBL_GIVE_TO_LADY }; -extern u16 gSpecialVar_ItemId; extern const u16 gUnknown_0860F074[]; -extern void CB2_ReturnToField(void); -extern bool8 sub_81221EC(void); -extern void sub_80AF168(void); - // this file's functions static void CB2_InitPokeblockMenu(void); static bool8 InitPokeblockMenu(void); @@ -640,11 +637,11 @@ static bool8 LoadPokeblockMenuGfx(void) sPokeblockMenu->gfxState++; break; case 3: - LoadCompressedObjectPic(&gPokeblockCase_SpriteSheet); + LoadCompressedSpriteSheet(&gPokeblockCase_SpriteSheet); sPokeblockMenu->gfxState++; break; case 4: - LoadCompressedObjectPalette(&gPokeblockCase_SpritePal); + LoadCompressedSpritePalette(&gPokeblockCase_SpritePal); sPokeblockMenu->gfxState++; break; case 5: diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index 2271d7adf..b1f182b66 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -656,25 +656,25 @@ static bool8 LoadMonAndSceneGfx(struct Pokemon *mon) trainerId = GetMonData(mon, MON_DATA_OT_ID); palette = GetMonSpritePalStructFromOtIdPersonality(species, trainerId, personality); - LoadCompressedObjectPalette(palette); + LoadCompressedSpritePalette(palette); SetMultiuseSpriteTemplateToPokemon(palette->tag, 1); sPokeblockFeed->loadGfxState++; break; case 2: - LoadCompressedObjectPic(&gPokeblockCase_SpriteSheet); + LoadCompressedSpriteSheet(&gPokeblockCase_SpriteSheet); sPokeblockFeed->loadGfxState++; break; case 3: - LoadCompressedObjectPalette(&gPokeblockCase_SpritePal); + LoadCompressedSpritePalette(&gPokeblockCase_SpritePal); sPokeblockFeed->loadGfxState++; break; case 4: - LoadCompressedObjectPic(&sPokeblock_SpriteSheet); + LoadCompressedSpriteSheet(&sPokeblock_SpriteSheet); sPokeblockFeed->loadGfxState++; break; case 5: SetPokeblockSpritePal(gSpecialVar_ItemId); - LoadCompressedObjectPalette(&sPokeblockSpritePal); + LoadCompressedSpritePalette(&sPokeblockSpritePal); sPokeblockFeed->loadGfxState++; break; case 6: diff --git a/src/pokedex.c b/src/pokedex.c index ef8905bb6..755a46821 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -1803,7 +1803,7 @@ bool8 sub_80BC514(u8 a) ResetSpriteData(); FreeAllSpritePalettes(); gReservedSpritePaletteCount = 8; - LoadCompressedObjectPic(&sInterfaceSpriteSheet[0]); + LoadCompressedSpriteSheet(&sInterfaceSpriteSheet[0]); LoadSpritePalettes(sInterfaceSpritePalette); CreateInterfaceSprites(a); gMain.state++; @@ -4815,7 +4815,7 @@ void sub_80C12E0(u8 taskId) } break; case 1: - LoadCompressedObjectPic(sInterfaceSpriteSheet); + LoadCompressedSpriteSheet(sInterfaceSpriteSheet); LoadSpritePalettes(sInterfaceSpritePalette); sub_80C2594(taskId); for (i = 0; i < 16; i++) diff --git a/src/pokemon.c b/src/pokemon.c index 640d70776..7c4103855 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -1,4 +1,5 @@ #include "global.h" +#include "alloc.h" #include "apprentice.h" #include "battle.h" #include "battle_controllers.h" @@ -12,12 +13,14 @@ #include "item.h" #include "link.h" #include "main.h" -#include "alloc.h" +#include "overworld.h" #include "m4a.h" +#include "party_menu.h" #include "pokedex.h" #include "pokeblock.h" #include "pokemon.h" #include "pokemon_animation.h" +#include "pokemon_summary_screen.h" #include "pokemon_storage_system.h" #include "pokenav.h" #include "random.h" @@ -45,8 +48,6 @@ struct SpeciesItem u16 item; }; -extern const struct OamData gUnknown_0831ACB0; -extern const struct OamData gUnknown_0831ACA8; extern const struct SpriteFrameImage gUnknown_082FF3A8[]; extern const struct SpriteFrameImage gUnknown_082FF3C8[]; extern const struct SpriteFrameImage gUnknown_082FF3E8[]; @@ -70,15 +71,10 @@ extern const struct CompressedSpritePalette gMonPaletteTable[]; extern const struct CompressedSpritePalette gMonShinyPaletteTable[]; extern const u8 gTrainerClassNames[][13]; -extern u8 pokemon_order_func(u8); extern u16 get_unknown_box_id(void); -extern u8 StorageGetCurrentBox(void); extern void set_unknown_box_id(u8); -extern void sub_803FA70(u8 battlerId); -extern u8 sav1_map_get_name(void); extern bool8 sub_806F104(void); extern u8 sub_81D63C8(u16 trainerOpponentId); -extern void SummaryScreen_SetUnknownTaskId(u8); // this file's functions static u16 CalculateBoxMonChecksum(struct BoxPokemon *boxMon); @@ -2298,7 +2294,7 @@ const struct SpriteTemplate gUnknown_08329D98[MAX_BATTLERS_COUNT] = { // B_POSITION_PLAYER_LEFT .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gUnknown_0831ACB0, + .oam = &gOamData_831ACB0, .anims = NULL, .images = gUnknown_082FF3A8, .affineAnims = gUnknown_082FF618, @@ -2307,16 +2303,16 @@ const struct SpriteTemplate gUnknown_08329D98[MAX_BATTLERS_COUNT] = { // B_POSITION_OPPONENT_LEFT .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gUnknown_0831ACA8, + .oam = &gOamData_831ACA8, .anims = NULL, .images = gUnknown_082FF3C8, .affineAnims = gUnknown_082FF694, - .callback = oac_poke_opponent, + .callback = SpriteCb_WildMon, }, { // B_POSITION_PLAYER_RIGHT .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gUnknown_0831ACB0, + .oam = &gOamData_831ACB0, .anims = NULL, .images = gUnknown_082FF3E8, .affineAnims = gUnknown_082FF618, @@ -2325,11 +2321,11 @@ const struct SpriteTemplate gUnknown_08329D98[MAX_BATTLERS_COUNT] = { // B_POSITION_OPPONENT_RIGHT .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gUnknown_0831ACA8, + .oam = &gOamData_831ACA8, .anims = NULL, .images = gUnknown_082FF408, .affineAnims = gUnknown_082FF694, - .callback = oac_poke_opponent + .callback = SpriteCb_WildMon }, }; @@ -2338,7 +2334,7 @@ static const struct SpriteTemplate gUnknown_08329DF8[] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gUnknown_0831ACB0, + .oam = &gOamData_831ACB0, .anims = NULL, .images = gUnknown_082FF428, .affineAnims = gUnknown_082FF618, @@ -2347,7 +2343,7 @@ static const struct SpriteTemplate gUnknown_08329DF8[] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gUnknown_0831ACB0, + .oam = &gOamData_831ACB0, .anims = NULL, .images = gUnknown_082FF448, .affineAnims = gUnknown_082FF618, @@ -2356,7 +2352,7 @@ static const struct SpriteTemplate gUnknown_08329DF8[] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gUnknown_0831ACB0, + .oam = &gOamData_831ACB0, .anims = NULL, .images = gUnknown_082FF468, .affineAnims = gUnknown_082FF618, @@ -2365,7 +2361,7 @@ static const struct SpriteTemplate gUnknown_08329DF8[] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gUnknown_0831ACB0, + .oam = &gOamData_831ACB0, .anims = NULL, .images = gUnknown_082FF490, .affineAnims = gUnknown_082FF618, @@ -2374,7 +2370,7 @@ static const struct SpriteTemplate gUnknown_08329DF8[] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gUnknown_0831ACB0, + .oam = &gOamData_831ACB0, .anims = NULL, .images = gUnknown_082FF4B8, .affineAnims = gUnknown_082FF618, @@ -2383,7 +2379,7 @@ static const struct SpriteTemplate gUnknown_08329DF8[] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gUnknown_0831ACB0, + .oam = &gOamData_831ACB0, .anims = NULL, .images = gUnknown_082FF4D8, .affineAnims = gUnknown_082FF618, @@ -2392,7 +2388,7 @@ static const struct SpriteTemplate gUnknown_08329DF8[] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gUnknown_0831ACB0, + .oam = &gOamData_831ACB0, .anims = NULL, .images = gUnknown_082FF4F8, .affineAnims = gUnknown_082FF618, @@ -2401,7 +2397,7 @@ static const struct SpriteTemplate gUnknown_08329DF8[] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gUnknown_0831ACB0, + .oam = &gOamData_831ACB0, .anims = NULL, .images = gUnknown_082FF518, .affineAnims = gUnknown_082FF618, @@ -4091,13 +4087,13 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data) case MON_DATA_LANGUAGE: retVal = boxMon->language; break; - case MON_DATA_SANITY_BIT1: + case MON_DATA_SANITY_IS_BAD_EGG: retVal = boxMon->isBadEgg; break; - case MON_DATA_SANITY_BIT2: + case MON_DATA_SANITY_HAS_SPECIES: retVal = boxMon->hasSpecies; break; - case MON_DATA_SANITY_BIT3: + case MON_DATA_SANITY_IS_EGG: retVal = boxMon->isEgg; break; case MON_DATA_OT_NAME: @@ -4298,7 +4294,7 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data) u16 *moves = (u16 *)data; s32 i = 0; - while (moves[i] != 355) + while (moves[i] != MOVES_COUNT) { u16 move = moves[i]; if (substruct1->moves[0] == move @@ -4460,13 +4456,13 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg) case MON_DATA_LANGUAGE: SET8(boxMon->language); break; - case MON_DATA_SANITY_BIT1: + case MON_DATA_SANITY_IS_BAD_EGG: SET8(boxMon->isBadEgg); break; - case MON_DATA_SANITY_BIT2: + case MON_DATA_SANITY_HAS_SPECIES: SET8(boxMon->hasSpecies); break; - case MON_DATA_SANITY_BIT3: + case MON_DATA_SANITY_IS_EGG: SET8(boxMon->isEgg); break; case MON_DATA_OT_NAME: @@ -4722,7 +4718,7 @@ u8 SendMonToPC(struct Pokemon* mon) do { - for (boxPos = 0; boxPos < 30; boxPos++) + for (boxPos = 0; boxPos < IN_BOX_COUNT; boxPos++) { struct BoxPokemon* checkingMon = GetBoxedMonPtr(boxNo, boxPos); if (GetBoxMonData(checkingMon, MON_DATA_SPECIES, NULL) == SPECIES_NONE) @@ -4739,7 +4735,7 @@ u8 SendMonToPC(struct Pokemon* mon) } boxNo++; - if (boxNo == 14) + if (boxNo == TOTAL_BOXES_COUNT) boxNo = 0; } while (boxNo != StorageGetCurrentBox()); @@ -4889,9 +4885,9 @@ bool8 IsPokemonStorageFull(void) { s32 i, j; - for (i = 0; i < 14; i++) - for (j = 0; j < 30; j++) - if (GetBoxMonDataFromAnyBox(i, j, MON_DATA_SPECIES) == SPECIES_NONE) + for (i = 0; i < TOTAL_BOXES_COUNT; i++) + for (j = 0; j < IN_BOX_COUNT; j++) + if (GetBoxMonDataAt(i, j, MON_DATA_SPECIES) == SPECIES_NONE) return FALSE; return TRUE; @@ -6847,7 +6843,7 @@ void SetWildMonHeldItem(void) u16 species = GetMonData(&gEnemyParty[0], MON_DATA_SPECIES, 0); u16 var1 = 45; u16 var2 = 95; - if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_BIT3, 0) + if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG, 0) && GetMonAbility(&gPlayerParty[0]) == ABILITY_COMPOUND_EYES) { var1 = 20; diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c index 8c468d9f4..52fa6db51 100644 --- a/src/pokemon_animation.c +++ b/src/pokemon_animation.c @@ -1,4 +1,5 @@ #include "global.h" +#include "battle.h" #include "pokemon.h" #include "pokemon_animation.h" #include "sprite.h" @@ -18,8 +19,6 @@ struct UnkAnimStruct s16 field_8; }; -extern u16 gBattlerPartyIndexes[]; - // this file's functions static void pokemonanimfunc_00(struct Sprite *sprite); static void pokemonanimfunc_01(struct Sprite *sprite); diff --git a/src/pokemon_icon.c b/src/pokemon_icon.c index c24c8a898..36a7da0ee 100644 --- a/src/pokemon_icon.c +++ b/src/pokemon_icon.c @@ -1076,7 +1076,7 @@ u8 sub_80D2D78(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 return spriteId; } -u16 mon_icon_convert_unown_species_id(u16 species, u32 personality) +u16 GetIconSpecies(u16 species, u32 personality) { u16 result; @@ -1104,7 +1104,8 @@ u16 GetUnownLetterByPersonality(u32 personality) { if (!personality) return 0; - return (((personality & 0x3000000) >> 18) | ((personality & 0x30000) >> 12) | ((personality & 0x300) >> 6) | (personality & 0x3)) % 0x1C; + else + return (((personality & 0x3000000) >> 18) | ((personality & 0x30000) >> 12) | ((personality & 0x300) >> 6) | (personality & 0x3)) % 0x1C; } u16 sub_80D2E84(u16 species) @@ -1121,19 +1122,17 @@ u16 sub_80D2E84(u16 species) } else { - if(species > (SPECIES_UNOWN_B - 1)) - species = 260; - return mon_icon_convert_unown_species_id(species, 0); + if (species > (SPECIES_UNOWN_B - 1)) + species = SPECIES_OLD_UNOWN_J; // That's an oddly specific species. + return GetIconSpecies(species, 0); } } const u8 *GetMonIconPtr(u16 species, u32 personality, bool32 extra) { - return GetMonIconTiles(mon_icon_convert_unown_species_id(species, personality), extra); + return GetMonIconTiles(GetIconSpecies(species, personality), extra); } - - void sub_80D2EF8(struct Sprite *sprite) { sub_80D328C(sprite); @@ -1220,7 +1219,7 @@ void sub_80D304C(u16 offset) } } -u8 sub_80D3080(u16 species) +u8 GetValidMonIconPalIndex(u16 species) { if (species > SPECIES_EGG) species = 260; diff --git a/src/pokemon_size_record.c b/src/pokemon_size_record.c index 2d9a2f08f..b0e14d2b1 100644 --- a/src/pokemon_size_record.c +++ b/src/pokemon_size_record.c @@ -210,7 +210,7 @@ void GiveGiftRibbonToParty(u8 index, u8 ribbonId) { struct Pokemon *mon = &gPlayerParty[i]; - if (GetMonData(mon, MON_DATA_SPECIES) != 0 && GetMonData(mon, MON_DATA_SANITY_BIT3) == 0) + if (GetMonData(mon, MON_DATA_SPECIES) != 0 && GetMonData(mon, MON_DATA_SANITY_IS_EGG) == 0) { SetMonData(mon, array[index], &data); gotRibbon = TRUE; diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index ad56b1678..7b1d8da7c 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1,55 +1,725 @@ #include "global.h" +#include "alloc.h" #include "bg.h" +#include "data2.h" +#include "decompress.h" +#include "dma3.h" +#include "dynamic_placeholder_text_util.h" #include "event_data.h" #include "field_screen_effect.h" #include "field_weather.h" +#include "fldeff_misc.h" #include "gpu_regs.h" +#include "graphics.h" #include "international_string_util.h" +#include "item.h" +#include "item_icon.h" +#include "item_menu.h" +#include "mail.h" #include "main.h" #include "menu.h" +#include "mon_markings.h" +#include "naming_screen.h" #include "overworld.h" #include "palette.h" +#include "pc_screen_effect.h" #include "pokemon.h" +#include "pokemon_icon.h" +#include "pokemon_summary_screen.h" #include "pokemon_storage_system.h" #include "script.h" #include "sound.h" #include "string_util.h" #include "strings.h" #include "text.h" +#include "text_window.h" +#include "trig.h" #include "walda_phrase.h" #include "window.h" +#include "constants/maps.h" +#include "constants/moves.h" +#include "constants/rgb.h" #include "constants/songs.h" #include "constants/species.h" -IWRAM_DATA u8 gUnknown_03000F78[0x188]; +struct WallpaperTable +{ + const u32 *tiles; + const u32 *tileMap; + const u16 *palettes; +}; + +struct PokemonStorageSystemFunc +{ + u8 (*func)(void); + s8 unk4; +}; + +struct StorageAction +{ + const u8 *text; + u8 format; +}; + +struct StorageMenu +{ + const u8 *text; + int textId; +}; + +struct PSS_MenuStringPtrs +{ + const u8 *text; + const u8 *desc; +}; + +struct UnkStruct_2000028 +{ + const u8 *unk_00; + u8 *unk_04; + u16 unk_08; + u16 unk_0a; + u16 newField; + void (*unk_0c)(struct UnkStruct_2000028 *data); +}; + +struct UnkStruct_2000020 +{ + struct UnkStruct_2000028 *unk_00; + u8 unk_04; + u8 unk_05; +}; + +struct UnkPSSStruct_2002370 +{ + struct Sprite *unk_0000; + struct Sprite *unk_0004[4]; + u32 unk_0014[3]; + struct Sprite *unk_0020[2]; + u8 filler_0028[0x214]; + u32 unk_023c; + u16 unk_0240; + u16 unk_0242; + u8 curBox; + u8 unk_0245; + u8 unk_0246; +}; -extern const u8 gText_PartyFull[]; -extern const u8 gText_Box[]; -extern const u8 gText_JustOnePkmn[]; +struct UnkStorageStruct +{ + struct Sprite *sprite; + u8 *tiles; + u16 palIndex; + u8 unk8; + u8 unk9; + u8 unk10; +}; + +struct PokemonStorageSystemData +{ + u8 state; + u8 boxOption; + u8 screenChangeType; + bool8 isReshowingPSS; + u8 taskId; + struct UnkStruct_2000020 unk_0020; + struct UnkStruct_2000028 unk_0028[8]; + u16 field_B0[528 / 2]; + u16 field_2C0; + u16 field_2C2; + u8 field_2C4; + u8 field_2C5; + u8 showPartyMenuState; + u8 unk_02C7; + u8 unk_02C8; + bool8 unk_02C9; + s16 newCurrBoxId; + u16 bg2_X; + s16 field_2CE; + u16 field_2D0; + u8 field_2D2; + u8 field_2D3; + u8 field_2D4; + u16 field_2D6; + s16 field_2D8; + u16 field_2DA; + u16 field_2DC; + u16 field_2DE; + u16 field_2E0; + u8 filler[22]; + u8 field_2F8[1024]; + u8 field_6F8; + u8 field_6F9; + u8 field_6FA; + s8 field_6FB; + u16 field_6FC[16]; + u16 field_71C; + u16 field_71E; + struct Sprite *field_720[2]; + struct Sprite *field_728[2]; + struct Sprite *field_730[2]; + u32 field_738; + u8 field_73C[80]; + u16 field_78C; + s16 wallpaperSetId; + s16 wallpaperId; + u16 field_792[360]; + u8 wallpaperChangeState; + u8 field_A63; + u8 field_A64; + s8 field_A65; + u8 *wallpaperTiles; + struct Sprite *movingMonSprite; + struct Sprite *partySprites[PARTY_SIZE]; + struct Sprite *boxMonsSprites[IN_BOX_COUNT]; + struct Sprite **field_B00; + struct Sprite **field_B04; + u16 field_B08[40]; + u16 field_B58[40]; + u16 boxSpecies[IN_BOX_COUNT]; + u32 boxPersonalities[IN_BOX_COUNT]; + u8 field_C5C; + u8 field_C5D; + u8 field_C5E; + u16 field_C60; + s16 field_C62; + s16 field_C64; + u16 field_C66; + u8 field_C68; + s8 field_C69; + u8 field_C6A; + u8 field_C6B; + struct WindowTemplate menuWindow; + struct StorageMenu menuItems[7]; + u8 menuItemsCount; + u8 menuWidth; + u8 field_CAE; + u16 field_CB0; + struct Sprite *field_CB4; + struct Sprite *field_CB8; + s32 field_CBC; + s32 field_CC0; + u32 field_CC4; + u32 field_CC8; + s16 field_CCC; + s16 field_CCE; + u16 field_CD0; + s8 field_CD2; + s8 field_CD3; + u8 field_CD4; + u8 field_CD5; + u8 field_CD6; + u8 field_CD7; + u8 field_CD8[2]; + const u32 *cursorMonPalette; + u32 cursorMonPersonality; + u16 cursorMonSpecies; + u16 cursorMonItem; + u16 field_CE8; + bool8 setMosaic; + u8 cursorMonMarkings; + u8 cursorMonLevel; + bool8 cursorMonIsEgg; + u8 cursorMonNick[POKEMON_NAME_LENGTH + 1]; + u8 cursorMonNickText[36]; + u8 cursorMonSpeciesName[36]; + u8 cursorMonGenderLvlText[36]; + u8 cursorMonItemName[36]; + bool8 (*monPlaceChangeFunc)(void); + u8 monPlaceChangeState; + u8 field_D91; + struct Sprite *field_D94; + struct Sprite *field_D98[2]; + u16 *field_DA0; + struct PokemonMarkMenu field_DA4; + struct UnkPSSStruct_2002370 field_1E5C; + struct Pokemon movingMon; + struct Pokemon field_2108; + s8 field_216C; + u8 field_216D; + s8 field_216E; + s8 field_216F; + s8 field_2170; + s8 field_2171; + u16 field_2172; + u16 field_2174; + u16 field_2176[8]; + u8 field_2186; + u8 field_2187; + u8 field_2188; + union + { + struct Pokemon *mon; + struct BoxPokemon *box; + } field_218C; + u8 field_2190[40]; + u8 field_21B8[40]; + u8 field_21E0[POKEMON_NAME_LENGTH + 1]; + u8 itemName[20]; + u8 inBoxMovingMode; + u16 field_2200; + struct UnkStorageStruct field_2204[3]; + u16 movingItem; + u16 field_2236; + u8 field_2238; + u16 field_223A; + u16 *field_223C; + struct Sprite *cursorMonSprite; + u16 field_2244[0x40]; + u8 field_22C4[0x800]; + u8 field_2AC4[0x1800]; + u8 field_42C4[0x800]; + u8 field_4AC4[0x1000]; + u8 field_5AC4[0x800]; +}; -extern u8 gUnknown_02039D00; +struct UnkSubStruct_2039D84 +{ + s16 field_0; + s16 field_2; + u16 field_4; + u16 field_6; + s16 field_8; + s16 field_A; +}; + +struct UnkStruct_2039D84 +{ + struct UnkSubStruct_2039D84 field_0[2]; + const void *field_18; + const void *field_1C; + u16 field_20; + u16 field_22; + u16 field_24; + u16 field_26; + u16 field_28; + u8 field_2A; + u8 field_2B; + u8 field_2C; + u8 field_2D; +}; + +enum +{ + BOX_OPTION_WITHDRAW, + BOX_OPTION_DEPOSIT, + BOX_OPTION_MOVE_MONS, + BOX_OPTION_MOVE_ITEMS, + BOX_OPTION_EXIT, +}; + +enum +{ + PC_TEXT_EXIT_BOX, + PC_TEXT_WHAT_YOU_DO, + PC_TEXT_PICK_A_THEME, + PC_TEXT_PICK_A_WALLPAPER, + PC_TEXT_IS_SELECTED, + PC_TEXT_JUMP_TO_WHICH_BOX, + PC_TEXT_DEPOSIT_IN_WHICH_BOX, + PC_TEXT_WAS_DEPOSITED, + PC_TEXT_BOX_IS_FULL, + PC_TEXT_RELEASE_POKE, + PC_TEXT_WAS_RELEASED, + PC_TEXT_BYE_BYE, + PC_TEXT_MARK_POKE, + PC_TEXT_LAST_POKE, + PC_TEXT_PARTY_FULL, + PC_TEXT_HOLDING_POKE, + PC_TEXT_WHICH_ONE_WILL_TAKE, + PC_TEXT_CANT_RELEASE_EGG, + PC_TEXT_CONTINUE_BOX, + PC_TEXT_CAME_BACK, + PC_TEXT_WORRIED, + PC_TEXT_SURPRISE, + PC_TEXT_PLEASE_REMOVE_MAIL, + PC_TEXT_IS_SELECTED2, + PC_TEXT_GIVE_TO_MON, + PC_TEXT_PLACED_IN_BAG, + PC_TEXT_BAG_FULL, + PC_TEXT_PUT_IN_BAG, + PC_TEXT_ITEM_IS_HELD, + PC_TEXT_CHANGED_TO_ITEM, + PC_TEXT_CANT_STORE_MAIL, +}; + +enum +{ + PC_TEXT_FMT_NORMAL, + PC_TEXT_FMT_MON_NAME_1, + PC_TEXT_FMT_MON_NAME_2, + PC_TEXT_FMT_MON_NAME_3, + PC_TEXT_FMT_MON_NAME_4, + PC_TEXT_FMT_MON_NAME_5, + PC_TEXT_FMT_MON_NAME_6, + PC_TEXT_FMT_ITEM_NAME, +}; + +enum +{ + SCREEN_CHANGE_EXIT_BOX, + SCREEN_CHANGE_SUMMARY_SCREEN, + SCREEN_CHANGE_NAME_BOX, + SCREEN_CHANGE_ITEM_FROM_BAG, +}; + +enum +{ + MODE_PARTY, + MODE_BOX, + MODE_2, +}; + +enum +{ + WALLPAPER_FOREST, + WALLPAPER_CITY, + WALLPAPER_DESERT, + WALLPAPER_SAVANNA, + WALLPAPER_CRAG, + WALLPAPER_VOLCANO, + WALLPAPER_SNOW, + WALLPAPER_CAVE, + WALLPAPER_BEACH, + WALLPAPER_SEAFLOOR, + WALLPAPER_RIVER, + WALLPAPER_SKY, + WALLPAPER_POLKADOT, + WALLPAPER_POKECENTER, + WALLPAPER_MACHINE, + WALLPAPER_PLAIN, + WALLPAPER_FRIENDS, // The one received as a gift from Walda's parents. + WALLPAPER_COUNT +}; + +enum +{ + FRIENDS_ZIGZAGOON, + FRIENDS_SCREEN, + FRIENDS_HORIZONTAL, + FRIENDS_DIAGONAL, + FRIENDS_BLOCK, + FRIENDS_RIBBON, + FRIENDS_POKECENTER2, + FRIENDS_FRAME, + FRIENDS_BLANK, + FRIENDS_CIRCLES, + FRIENDS_AZUMARILL, + FRIENDS_PIKACHU, + FRIENDS_LEGENDARY, + FRIENDS_DUSCLOPS, + FRIENDS_LUDICOLO, + FRIENDS_WHISCASH, + FRIENDS_WALLPAPERS_COUNT +}; + +enum +{ + CURSOR_AREA_IN_BOX, + CURSOR_AREA_IN_PARTY, + CURSOR_AREA_BOX, + CURSOR_AREA_BUTTONS, // Party Pokemon and Close Box +}; + +#define TAG_PAL_WAVEFORM 0xDACA +#define TAG_PAL_DAC8 0xDAC8 +#define TAG_PAL_DAC6 0xDAC6 +#define TAG_PAL_DACE 0xDACE +#define TAG_PAL_DAC7 0xDAC7 +#define TAG_PAL_DAC9 0xDAC9 +#define TAG_PAL_DAC0 0xDAC0 +#define TAG_PAL_DACB 0xDACB + +#define TAG_TILE_WAVEFORM 0x5 +#define TAG_TILE_10 0x10 +#define TAG_TILE_2 0x2 +#define TAG_TILE_D 0xD +#define TAG_TILE_A 0xA +#define TAG_TILE_3 0x3 +#define TAG_TILE_4 0x4 +#define TAG_TILE_12 0x12 +#define TAG_TILE_7 0x7 +#define TAG_TILE_0 0x0 +#define TAG_TILE_1 0x1 + +// IWRAM bss +IWRAM_DATA static u32 gUnknown_03000F78[98]; + +// EWRAM DATA +EWRAM_DATA static u8 sPreviousBoxOption = 0; +EWRAM_DATA static struct UnkPSSStruct_2002370 *gUnknown_02039D04 = NULL; +EWRAM_DATA static struct PokemonStorageSystemData *sPSSData = NULL; +EWRAM_DATA static bool8 sInPartyMenu = 0; +EWRAM_DATA static u8 sCurrentBoxOption = 0; +EWRAM_DATA static u8 gUnknown_02039D0E = 0; +EWRAM_DATA static u8 sWhichToReshow = 0; +EWRAM_DATA static u8 gUnknown_02039D10 = 0; +EWRAM_DATA static u16 gUnknown_02039D12 = 0; +EWRAM_DATA static struct Pokemon gUnknown_02039D14 = {0}; +EWRAM_DATA static s8 sBoxCursorArea = 0; +EWRAM_DATA static s8 sBoxCursorPosition = 0; +EWRAM_DATA static bool8 sIsMonBeingMoved = 0; +EWRAM_DATA static u8 sMovingMonOrigBoxId = 0; +EWRAM_DATA static u8 sMovingMonOrigBoxPos = 0; +EWRAM_DATA static bool8 sCanOnlyMove = 0; + +extern void sub_80C6D80(u8 *arg0, void *arg1, u8 arg2, u8 arg3, s32 arg4); + +extern const struct CompressedSpriteSheet gMonFrontPicTable[]; // This file's functions. -void StorageSystemCreatePrimaryMenu(u8 whichMenu, s16 *windowIdPtr); -void sub_80C7D74(u8); -u8 sub_80CAEA0(void); -void SetBoxWallpaper(u8 boxId, u8 wallpaperId); -void SetCurrentBox(u8 boxId); -void ClearMonInBox(u8 boxId, u8 boxPos); -void ResetWaldaWallpaper(void); -void sub_80C7958(u8 curBox); -void sub_80C7B14(void); -void sub_80C7BB4(void); -void sub_80CA028(void); -void sub_80C7B80(void); -void sub_80D2AA4(void); -void sub_80C7BE4(void); -void sub_80CAA14(void); -void sub_80C7CF4(struct Sprite *sprite); -struct Sprite *sub_80CD2E8(u16 x, u16 y, u8 animId, u8 priority, u8 subpriority); - -// const rom data -const struct PSS_MenuStringPtrs gUnknown_085716C0[] = +static void CreatePCMenu(u8 whichMenu, s16 *windowIdPtr); +static void Cb2_EnterPSS(u8 boxOption); +static u8 GetCurrentBoxOption(void); +static u8 HandleInput(void); +static u8 sub_80CDC2C(void); +static u8 sub_80CB9BC(void); +static void LoadWallpaperGfx(u8 boxId, s8 direction); +static void sub_80CCCFC(u8 boxId, s8 direction); +static void sub_80CD0B8(s8 direction); +static void SetCurrentBox(u8 boxId); +static void sub_80CC32C(u8 boxId); +static void sub_80C7958(u8 curBox); +static void sub_80CCAE0(void *arg0); +static void sub_80C7B14(void); +static void sub_80C7BB4(void); +static void ScrollBackground(void); +static void sub_80C7B80(void); +static void sub_80C7BE4(void); +static void sub_80CAA14(void); +static void sub_80CFDC4(void); +static void sub_80CE790(void); +static void sub_80CE8E4(void); +static void GiveChosenBagItem(void); +static void SetUpHidePartyMenu(void); +static void DestroyAllPartyMonIcons(void); +static void sub_80D11CC(void); +static void LoadPSSMenuGfx(void); +static void LoadWaveformSpritePalette(void); +static void sub_80CDC18(void); +static void sub_80CD36C(void); +static void sub_80CD3EC(void); +static void sub_80CAC1C(void); +static void sub_80CEBDC(void); +static void SetScrollingBackground(void); +static void sub_80CABE0(void); +static void sub_80CAEAC(void); +static void sub_80D0C60(void); +static void sub_80CFEA8(void); +static void sub_80CDC0C(void); +static void sub_80CAF04(void); +static void sub_80CA0D8(void); +static void AddMenu(void); +static void sub_80CE250(void); +static void InitCanRelaseMonVars(void); +static void sub_80D01B8(void); +static void ReleaseMon(void); +static void RefreshCursorMonData(void); +static void LoadCursorMonSprite(void); +static void sub_80CA154(void); +static void sub_80CA1C4(void); +static void sub_80CC064(void); +static void sub_80CE324(void); +static void ClearBottomWindow(void); +static void sub_80CA704(void); +static void sub_80D013C(void); +static void sub_80CE00C(void); +static void sub_80D1194(void); +static void PrintCursorMonInfo(void); +static void sub_80CA65C(void); +static void AddWallpaperSetsMenu(void); +static void sub_80CD02C(void); +static void InitMenu(void); +static void sub_80CD158(void); +static void sub_80CFC14(void); +static void sub_80CEB40(void); +static void sub_80CCEE0(void); +static void sub_80D1818(void); +static void sub_80D19B4(u32 arg0); +static void sub_80CAA74(void); +static void PrintItemDescription(void); +static void sub_80CE760(void); +static void sub_80CDBA0(void); +static void sub_80CE7E8(void); +static void sub_80CFECC(void); +static void sub_80CA9EC(void); +static void FreePSSData(void); +static void AddBoxMenu(void); +static void sub_80CCF9C(void); +static void MoveMon(void); +static void PlaceMon(void); +static void sub_80CAB20(void); +static void sub_80CE22C(void); +static void sub_80CDA68(void); +static void sub_80CB950(void); +static void sub_80CA9C0(void); +static void SetUpDoShowPartyMenu(void); +static void BoxSetMosaic(void); +static void sub_80C7CF4(struct Sprite *sprite); +static void sub_80CC100(struct Sprite *sprite); +static void sub_80CB278(struct Sprite *sprite); +static void sub_80CD210(struct Sprite *sprite); +static bool32 WaitForWallpaperGfxLoad(void); +static bool8 InitPSSWindows(void); +static bool8 sub_80CC0A0(void); +static bool8 sub_80CE2A8(void); +static bool8 sub_80D0164(void); +static bool8 sub_80CC35C(void); +static bool8 sub_80D01E4(void); +static bool8 sub_80CDED4(void); +static bool8 sub_80CDF08(void); +static bool8 sub_80D184C(void); +static bool8 sub_80D18E4(void); +static bool8 DoShowPartyMenu(void); +static bool8 sub_80D1218(void); +static bool8 ScrollToBox(void); +static bool8 sub_80CD554(void); +static bool8 HidePartyMenu(void); +static bool8 IsActiveItemMoving(void); +static bool8 sub_80D0580(u8 arg0); +static bool8 sub_80D0BC0(void); +static bool8 sub_80CA2B8(void); +static bool8 DoWallpaperGfxChange(void); +static bool8 DoMonPlaceChange(void); +static bool8 sub_80D00A8(void); +static bool8 CanMovePartyMon(void); +static bool8 CanShiftMon(void); +static bool8 IsCursorOnCloseBox(void); +static bool8 IsCursorOnBox(void); +static bool8 IsCursorInBox(void); +static bool8 IsMonBeingMoved(void); +static bool8 TryStorePartyMonInBox(u8 boxId); +static void Cb_InitPSS(u8 taskId); +static void Cb_PlaceMon(u8 taskId); +static void Cb_ChangeScreen(u8 taskId); +static void Cb_ShowPSS(u8 taskId); +static void Cb_OnBPressed(u8 taskId); +static void Cb_HandleBoxOptions(u8 taskId); +static void Cb_OnSelectedMon(u8 taskId); +static void Cb_OnCloseBoxPressed(u8 taskId); +static void Cb_HidePartyPokemon(u8 taskId); +static void Cb_DepositMenu(u8 taskId); +static void Cb_MoveMon(u8 taskId); +static void Cb_GiveMovingItemToMon(u8 taskId); +static void Cb_SwitchSelectedItem(u8 taskId); +static void Cb_TakeItemForMoving(u8 taskId); +static void Cb_WithdrawMon(u8 taskId); +static void Cb_ShiftMon(u8 taskId); +static void Cb_ShowPartyPokemon(u8 taskId); +static void Cb_ShowItemInfo(u8 taskId); +static void Cb_GiveItemFromBag(u8 taskId); +static void Cb_ItemToBag(u8 taskId); +static void Cb_TakeItemForMoving(u8 taskId); +static void Cb_ShowMarkMenu(u8 taskId); +static void Cb_ShowMonSummary(u8 taskId); +static void Cb_ReleaseMon(u8 taskId); +static void Cb_ReshowPSS(u8 taskId); +static void Cb_MainPSS(u8 taskId); +static void Cb_JumpBox(u8 taskId); +static void Cb_HandleWallpapers(u8 taskId); +static void Cb_NameBox(u8 taskId); +static void Cb_PrintCantStoreMail(u8 taskId); +static void Cb_HandleMovingMonFromParty(u8 taskId); +static void SetUpScrollToBox(u8 boxId); +static void sub_80CFE54(u8 animNum); +static void SetMovingMonPriority(u8 priority); +static void InitMonPlaceChange(u8 arg0); +static void SetMonMarkings(u8 markings); +static void ShowYesNoWindow(s8 cursorPos); +static void sub_80CDBF8(u8 cursorBoxPosition); +static void sub_80D01D0(u8 arg0); +static void sub_80CD1A8(bool8 arg0); +static void sub_80CA984(bool8 arg0); +static void CreatePartyMonsSprites(bool8 arg0); +static void PrintStorageActionText(u8 id); +static s16 sub_80D00AC(void); +static s8 RunCanReleaseMon(void); +static u8 GetBoxCursorPosition(void); +static void Item_FromMonToMoving(u8 cursorArea, u8 cursorPos); +static void Item_GiveMovingToMon(u8 cursorArea, u8 cursorPos); +static void Item_TakeMons(u8 cursorArea, u8 cursorPos); +static void Item_SwitchMonsWithMoving(u8 cursorArea, u8 cursorPos); +static struct Sprite *sub_80CD2E8(u16 x, u16 y, u8 animId, u8 priority, u8 subpriority); +static void SetWallpaperForCurrentBox(u8 wallpaperId); +static void AddWallpapersMenu(u8 wallpaperSet); +static u16 GetMovingItem(void); +static void LoadCursorMonGfx(u16 species, u32 pid); +static void sub_80CA2D0(struct Sprite *sprite); +static void sub_80CCF64(struct Sprite *sprite); +static void sub_80CBA3C(struct Sprite *sprite); +static void sub_80CCF30(struct Sprite *sprite); +static void sub_80CBAF0(s16 yDelta); +static void sub_80CAAA8(u8 arg0, bool8 isPartyMon); +static const u8 *GetMovingItemName(void); +static void SetMenuText(u8 textId); +static void sub_80D0D8C(u8 cursorArea, u8 cursorPos); +static void sub_80D0E50(u8 cursorArea, u8 cursorPos); +static void sub_80D0F38(u16 item); +static struct Sprite *CreateMonIconSprite(u16 species, u32 personality, s16 x, s16 y, u8 oamPriority, u8 subpriority); +static void DestroyBoxMonIcon(struct Sprite *sprite); +static void SetBoxSpeciesAndPersonalities(u8 boxId); +static void sub_80CB9D0(struct Sprite *sprite, u16 partyId); +static void sub_80CC370(u8 taskId); +static void sub_80CCB50(u8 boxId); +static s8 sub_80CC644(u8 boxId); +static void sub_80CCA3C(const void *tilemap, s8 direction, u8 arg2); +static s16 sub_80CD00C(const u8 *string); +static bool8 MonPlaceChange_Shift(void); +static bool8 MonPlaceChange_Move(void); +static bool8 MonPlaceChange_Place(void); +static bool8 sub_80CDEC4(void); +static bool8 sub_80CDEB4(void); +static void sub_80CD444(u8 cursorArea, u8 cursorPosition, u16 *x, u16 *y); +static void SetShiftedMonData(u8 boxId, u8 position); +static void SetMovedMonData(u8 boxId, u8 position); +static void SetPlacedMonData(u8 boxId, u8 position); +static void PurgeMonOrBoxMon(u8 boxId, u8 position); +static void SetCursorMonData(void *pokemon, u8 mode); +static bool32 AtLeastThreeUsableMons(void); +static u8 InBoxInput_Normal(void); +static u8 InBoxInput_MovingMultiple(void); +static u8 InBoxInput_GrabbingMultiple(void); +static s8 sub_80CFF98(u8 arg0); +static u8 sub_80CFA5C(void); +static u8 sub_80D0BA4(void); +static bool8 sub_80CFA84(void); +static bool8 sub_80CFB44(void); +static bool8 sub_80D024C(void); +static bool8 sub_80D0344(void); +static bool8 sub_80D03B0(void); +static bool8 sub_80D0420(void); +static bool8 sub_80D04A0(void); +static bool8 sub_80D04C8(void); +static void sub_80D07B0(u8 arg0, u8 arg1); +static void sub_80D0834(u8 arg0, u8 arg1); +static void sub_80D0B5C(void); +static void sub_80D062C(void); +static void sub_80D0884(u16 arg0, u16 arg1, u16 arg2); +static void sub_80D08CC(void); +static void sub_80D09A4(void); +static void sub_80D0A1C(void); +static void sub_80D0AAC(void); +static u8 sub_80D0894(void); +static void sub_80D0778(u8 arg0, u8 arg1, u8 arg2); +static void sub_80D0708(u8 arg0, u8 arg1, u8 arg2); +static void sub_80D06D0(u8 arg0, u8 arg1, u8 arg2); +static void sub_80D0740(u8 arg0, u8 arg1, u8 arg2); +static void sub_80D27AC(u8 id, u16 arg1, u16 arg2, u16 arg3, u16 arg4); +static void sub_80D27F4(u8 id, u8 arg1, s8 arg2); +static void sub_80D2644(u8 id, u8 bg, const void *arg2, u16 arg3, u16 arg4); +static void sub_80D2770(u8 id, u16 arg1, u16 arg2); +static void sub_80D259C(u8 count); +static void sub_80D25F0(void); +static void sub_80D2918(u8 id); +static void sub_80D2960(u8 id); +static void sub_80D29F8(u8 id); +static void sub_80D2A90(struct UnkStruct_2000020 *arg0, struct UnkStruct_2000028 *arg1, u32 arg2); +static void sub_80D2AA4(void); +static void sub_80D2B88(struct UnkStruct_2000028 *unkStruct); +static void sub_80D2C1C(struct UnkStruct_2000028 *unkStruct); + +// static const rom data +static const struct PSS_MenuStringPtrs gUnknown_085716C0[] = { {gText_WithdrawPokemon, gText_WithdrawMonDescription}, {gText_DepositPokemon, gText_DepositMonDescription}, @@ -58,7 +728,16 @@ const struct PSS_MenuStringPtrs gUnknown_085716C0[] = {gText_SeeYa, gText_SeeYaDescription} }; -const struct WindowTemplate gUnknown_085716E8 = {0, 1, 1, 0x11, 0xA, 0xF, 1}; +static const struct WindowTemplate gUnknown_085716E8 = +{ + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = 17, + .height = 10, + .paletteNum = 15, + .baseBlock = 0x1, +}; static const union AnimCmd sSpriteAnim_85716F0[] = { @@ -84,7 +763,7 @@ static const union AnimCmd sSpriteAnim_8571708[] = ANIMCMD_END }; -const union AnimCmd *const sSpriteAnimTable_8571710[] = +static const union AnimCmd *const sSpriteAnimTable_8571710[] = { sSpriteAnim_85716F0, sSpriteAnim_85716F8, @@ -103,12 +782,765 @@ static const union AffineAnimCmd *const sSpriteAffineAnimTable_8571730[] = sSpriteAffineAnim_8571720 }; -const u8 gUnknown_08571734[] = {4, 0xF, 0xE}; -const u8 gUnknown_08571737[] = _("/30"); +static const u8 gUnknown_08571734[] = {4, 0xF, 0xE}; +static const u8 gUnknown_08571737[] = _("/30"); + +static const u16 gBoxSelectionPopupPalette[] = INCBIN_U16("graphics/unknown/unknown_57173C.gbapal"); +static const u8 gBoxSelectionPopupCenterTiles[] = INCBIN_U8("graphics/pokemon_storage/box_selection_popup_center.4bpp"); +static const u8 gBoxSelectionPopupSidesTiles[] = INCBIN_U8("graphics/pokemon_storage/box_selection_popup_sides.4bpp"); +static const u32 gPokemonStorageScrollingBGTileset[] = INCBIN_U32("graphics/pokemon_storage/scrolling_bg.4bpp.lz"); +static const u32 gPokemonStorageScrollingBGTilemap[] = INCBIN_U32("graphics/pokemon_storage/scrolling_bg.bin.lz"); +static const u32 gUnknown_08572280[] = INCBIN_U32("graphics/unknown/unknown_572280.gbapal"); +static const u32 gUnknown_085722A0[] = INCBIN_U32("graphics/unknown/unknown_5722A0.bin.lz"); + +static const u16 gUnknown_0857239C[] = +{ + 0x0101, 0x0102, 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0x0108, 0x0111, 0x0112, 0x0113, 0x0114, 0x0115, 0x0116, 0x0117, 0x0118, + 0x2101, 0x2102, 0x2103, 0x2104, 0x2105, 0x2106, 0x2107, 0x2108, 0x2111, 0x2112, 0x2113, 0x2114, 0x2115, 0x2116, 0x2117, 0x2118, +}; + +static const u16 gUnknown_085723DC[] = INCBIN_U16("graphics/unknown/unknown_5723DC.gbapal"); // Left-most part and Close Box. +static const u16 gUnknown_085723FC[] = INCBIN_U16("graphics/unknown/unknown_5723FC.gbapal"); +static const u16 gUnknown_0857241C[] = INCBIN_U16("graphics/unknown/unknown_57241C.gbapal"); +static const u16 gUnknown_0857243C[] = INCBIN_U16("graphics/unknown/unknown_57243C.gbapal"); + +static const u16 gUnknown_0857245C[] = +{ + 0x014c, 0x014d, 0x014e, 0x014f, 0x0170, 0x0171, 0x0172, 0x0173, 0x0174, 0x015c, 0x015d, 0x015e, 0x015f, 0x0180, 0x0181, 0x0182, + 0x0183, 0x0184, 0x0175, 0x0176, 0x0177, 0x0178, 0x0179, 0x017a, 0x017b, 0x017c, 0x017d, 0x0185, 0x0186, 0x0187, 0x0188, 0x0189, + 0x018a, 0x018b, 0x018c, 0x018d +}; +static const u16 gUnknown_085724A4[] = +{ + 0x1140, 0x1141, 0x1141, 0x1142, 0x1150, 0x1151, 0x1151, 0x1152, 0x1160, 0x1161, 0x1161, 0x1162, +}; +static const u16 gUnknown_085724BC[] = +{ + 0x1143, 0x1144, 0x1144, 0x1145, 0x1153, 0x1154, 0x1154, 0x1155, 0x1163, 0x1164, 0x1164, 0x1165, +}; + +static const u16 gWaveformPalette[] = INCBIN_U16("graphics/pokemon_storage/waveform.gbapal"); +static const u32 gWaveformTiles[] = INCBIN_U32("graphics/pokemon_storage/waveform.4bpp"); +static const u32 gUnknown_085726B4[] = INCBIN_U32("graphics/unused/unknown_5726B4.gbapal"); +static const u32 gUnknown_085726F4[] = INCBIN_U32("graphics/unknown/unknown_5726F4.gbapal"); + +static const struct WindowTemplate gUnknown_08572714[] = +{ + { // 0 + .bg = 1, + .tilemapLeft = 0, + .tilemapTop = 11, + .width = 9, + .height = 7, + .paletteNum = 3, + .baseBlock = 0xC0, + }, + { // 1 + .bg = 0, + .tilemapLeft = 11, + .tilemapTop = 17, + .width = 18, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x14, + }, + { // 2 + .bg = 0, + .tilemapLeft = 0, + .tilemapTop = 13, + .width = 21, + .height = 7, + .paletteNum = 15, + .baseBlock = 0x14, + }, + DUMMY_WIN_TEMPLATE +}; + +static const struct BgTemplate gUnknown_08572734[] = +{ + { + .bg = 0, + .charBaseIndex = 0, + .mapBaseIndex = 29, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, + { + .bg = 1, + .charBaseIndex = 1, + .mapBaseIndex = 30, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0x100 + }, + { + .bg = 2, + .charBaseIndex = 2, + .mapBaseIndex = 27, + .screenSize = 1, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + }, + { + .bg = 3, + .charBaseIndex = 3, + .mapBaseIndex = 31, + .screenSize = 0, + .paletteMode = 0, + .priority = 3, + .baseTile = 0 + }, +}; + +static const struct SpritePalette gWaveformSpritePalette = +{ + gWaveformPalette, TAG_PAL_WAVEFORM +}; + +static const struct SpriteSheet gWaveformSpriteSheet = +{ + gWaveformTiles, sizeof(gWaveformTiles), TAG_TILE_WAVEFORM +}; + +static const struct OamData sOamData_857286C; +static const struct SpriteTemplate sSpriteTemplate_CursorMon = +{ + .tileTag = TAG_TILE_2, + .paletteTag = TAG_PAL_DAC6, + .oam = &sOamData_857286C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +static const struct StorageAction gPCStorageActionTexts[] = +{ + [PC_TEXT_EXIT_BOX] = {gText_ExitFromBox, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_WHAT_YOU_DO] = {gText_WhatDoYouWantToDo, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_PICK_A_THEME] = {gText_PleasePickATheme, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_PICK_A_WALLPAPER] = {gText_PickTheWallpaper, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_IS_SELECTED] = {gText_PkmnIsSelected, PC_TEXT_FMT_MON_NAME_1}, + [PC_TEXT_JUMP_TO_WHICH_BOX] = {gText_JumpToWhichBox, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_DEPOSIT_IN_WHICH_BOX] = {gText_DepositInWhichBox, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_WAS_DEPOSITED] = {gText_PkmnWasDeposited, PC_TEXT_FMT_MON_NAME_1}, + [PC_TEXT_BOX_IS_FULL] = {gText_BoxIsFull2, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_RELEASE_POKE] = {gText_ReleaseThisPokemon, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_WAS_RELEASED] = {gText_PkmnWasReleased, PC_TEXT_FMT_MON_NAME_4}, + [PC_TEXT_BYE_BYE] = {gText_ByeByePkmn, PC_TEXT_FMT_MON_NAME_6}, + [PC_TEXT_MARK_POKE] = {gText_MarkYourPkmn, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_LAST_POKE] = {gText_ThatsYourLastPkmn, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_PARTY_FULL] = {gText_YourPartysFull, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_HOLDING_POKE] = {gText_YoureHoldingAPkmn, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_WHICH_ONE_WILL_TAKE] = {gText_WhichOneWillYouTake, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_CANT_RELEASE_EGG] = {gText_YouCantReleaseAnEgg, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_CONTINUE_BOX] = {gText_ContinueBoxOperations, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_CAME_BACK] = {gText_PkmnCameBack, PC_TEXT_FMT_MON_NAME_1}, + [PC_TEXT_WORRIED] = {gText_WasItWorriedAboutYou, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_SURPRISE] = {gText_FourEllipsesExclamation, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_PLEASE_REMOVE_MAIL] = {gText_PleaseRemoveTheMail, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_IS_SELECTED2] = {gText_PkmnIsSelected, PC_TEXT_FMT_ITEM_NAME}, + [PC_TEXT_GIVE_TO_MON] = {gText_GiveToAPkmn, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_PLACED_IN_BAG] = {gText_PlacedItemInBag, PC_TEXT_FMT_ITEM_NAME}, + [PC_TEXT_BAG_FULL] = {gText_BagIsFull2, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_PUT_IN_BAG] = {gText_PutItemInBag, PC_TEXT_FMT_NORMAL}, + [PC_TEXT_ITEM_IS_HELD] = {gText_ItemIsNowHeld, PC_TEXT_FMT_ITEM_NAME}, + [PC_TEXT_CHANGED_TO_ITEM] = {gText_ChangedToNewItem, PC_TEXT_FMT_ITEM_NAME}, + [PC_TEXT_CANT_STORE_MAIL] = {gText_MailCantBeStored, PC_TEXT_FMT_NORMAL}, +}; + +static const struct WindowTemplate sYesNoWindowTemplate = +{ + .bg = 0, + .tilemapLeft = 24, + .tilemapTop = 11, + .width = 5, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x5C, +}; + +static const struct OamData sOamData_857286C = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0 +}; + +static const struct OamData sOamData_8572874 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 1, + .x = 0, + .matrixNum = 0, + .size = 0, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0 +}; + +static const union AnimCmd sSpriteAnim_857287C[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8572884[] = +{ + ANIMCMD_FRAME(2, 8), + ANIMCMD_FRAME(4, 8), + ANIMCMD_FRAME(6, 8), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd sSpriteAnim_8572894[] = +{ + ANIMCMD_FRAME(8, 5), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_857289C[] = +{ + ANIMCMD_FRAME(10, 8), + ANIMCMD_FRAME(4, 8), + ANIMCMD_FRAME(12, 8), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd *const sSpriteAnimTable_85728AC[] = +{ + sSpriteAnim_857287C, + sSpriteAnim_8572884, + sSpriteAnim_8572894, + sSpriteAnim_857289C +}; + +static const struct SpriteTemplate sSpriteTemplate_Waveform = +{ + .tileTag = TAG_TILE_WAVEFORM, + .paletteTag = TAG_PAL_WAVEFORM, + .oam = &sOamData_8572874, + .anims = sSpriteAnimTable_85728AC, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +static const struct OamData sOamData_85728EC; +static const struct SpriteTemplate gUnknown_085728D4 = +{ + .tileTag = TAG_TILE_12, + .paletteTag = TAG_PAL_DAC0, + .oam = &sOamData_85728EC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +static const struct OamData sOamData_85728EC = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 2, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0 +}; + +static const union AffineAnimCmd gSpriteAffineAnim_85728F4[] = +{ + AFFINEANIMCMD_FRAME(-2, -2, 0, 120), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd gSpriteAffineAnim_8572904[] = +{ + AFFINEANIMCMD_FRAME(16, 16, 0, 0), + AFFINEANIMCMD_FRAME(16, 16, 0, 15), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd *const gSpriteAffineAnimTable_857291C[] = +{ + gSpriteAffineAnim_85728F4, + gSpriteAffineAnim_8572904 +}; + +static const u16 gWallpaperPalettes_Forest[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/forest_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/forest_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Forest[] = INCBIN_U32("graphics/pokemon_storage/forest.4bpp.lz"); +static const u32 gWallpaperTilemap_Forest[] = INCBIN_U32("graphics/pokemon_storage/forest.bin.lz"); + +static const u16 gWallpaperPalettes_City[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/city_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/city_bg.gbapal"), +}; +static const u32 gWallpaperTiles_City[] = INCBIN_U32("graphics/pokemon_storage/city.4bpp.lz"); +static const u32 gWallpaperTilemap_City[] = INCBIN_U32("graphics/pokemon_storage/city.bin.lz"); + +static const u16 gWallpaperPalettes_Desert[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/desert_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/desert_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Desert[] = INCBIN_U32("graphics/pokemon_storage/desert.4bpp.lz"); +static const u32 gWallpaperTilemap_Desert[] = INCBIN_U32("graphics/pokemon_storage/desert.bin.lz"); + +static const u16 gWallpaperPalettes_Savanna[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/savanna_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/savanna_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Savanna[] = INCBIN_U32("graphics/pokemon_storage/savanna.4bpp.lz"); +static const u32 gWallpaperTilemap_Savanna[] = INCBIN_U32("graphics/pokemon_storage/savanna.bin.lz"); + +static const u16 gWallpaperPalettes_Crag[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/crag_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/crag_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Crag[] = INCBIN_U32("graphics/pokemon_storage/crag.4bpp.lz"); +static const u32 gWallpaperTilemap_Crag[] = INCBIN_U32("graphics/pokemon_storage/crag.bin.lz"); + +static const u16 gWallpaperPalettes_Volcano[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/volcano_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/volcano_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Volcano[] = INCBIN_U32("graphics/pokemon_storage/volcano.4bpp.lz"); +static const u32 gWallpaperTilemap_Volcano[] = INCBIN_U32("graphics/pokemon_storage/volcano.bin.lz"); + +static const u16 gWallpaperPalettes_Snow[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/snow_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/snow_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Snow[] = INCBIN_U32("graphics/pokemon_storage/snow.4bpp.lz"); +static const u32 gWallpaperTilemap_Snow[] = INCBIN_U32("graphics/pokemon_storage/snow.bin.lz"); + +static const u16 gWallpaperPalettes_Cave[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/cave_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/cave_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Cave[] = INCBIN_U32("graphics/pokemon_storage/cave.4bpp.lz"); +static const u32 gWallpaperTilemap_Cave[] = INCBIN_U32("graphics/pokemon_storage/cave.bin.lz"); + +static const u16 gWallpaperPalettes_Beach[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/beach_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/beach_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Beach[] = INCBIN_U32("graphics/pokemon_storage/beach.4bpp.lz"); +static const u32 gWallpaperTilemap_Beach[] = INCBIN_U32("graphics/pokemon_storage/beach.bin.lz"); + +static const u16 gWallpaperPalettes_Seafloor[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/seafloor_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/seafloor_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Seafloor[] = INCBIN_U32("graphics/pokemon_storage/seafloor.4bpp.lz"); +static const u32 gWallpaperTilemap_Seafloor[] = INCBIN_U32("graphics/pokemon_storage/seafloor.bin.lz"); + +static const u16 gWallpaperPalettes_River[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/river_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/river_bg.gbapal"), +}; +static const u32 gWallpaperTiles_River[] = INCBIN_U32("graphics/pokemon_storage/river.4bpp.lz"); +static const u32 gWallpaperTilemap_River[] = INCBIN_U32("graphics/pokemon_storage/river.bin.lz"); +static const u16 gWallpaperPalettes_Sky[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/sky_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/sky_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Sky[] = INCBIN_U32("graphics/pokemon_storage/sky.4bpp.lz"); +static const u32 gWallpaperTilemap_Sky[] = INCBIN_U32("graphics/pokemon_storage/sky.bin.lz"); + +static const u16 gWallpaperPalettes_PolkaDot[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/polkadot_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/polkadot_bg.gbapal"), +}; +static const u32 gWallpaperTiles_PolkaDot[] = INCBIN_U32("graphics/pokemon_storage/polkadot.4bpp.lz"); +static const u32 gWallpaperTilemap_PolkaDot[] = INCBIN_U32("graphics/pokemon_storage/polkadot.bin.lz"); + +static const u16 gWallpaperPalettes_Pokecenter[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/pokecenter_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/pokecenter_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Pokecenter[] = INCBIN_U32("graphics/pokemon_storage/pokecenter.4bpp.lz"); +static const u32 gWallpaperTilemap_Pokecenter[] = INCBIN_U32("graphics/pokemon_storage/pokecenter.bin.lz"); + +static const u16 gWallpaperPalettes_Machine[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/machine_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/machine_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Machine[] = INCBIN_U32("graphics/pokemon_storage/machine.4bpp.lz"); +static const u32 gWallpaperTilemap_Machine[] = INCBIN_U32("graphics/pokemon_storage/machine.bin.lz"); + +static const u16 gWallpaperPalettes_Plain[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/plain_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/plain_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Plain[] = INCBIN_U32("graphics/pokemon_storage/plain.4bpp.lz"); +static const u32 gWallpaperTilemap_Plain[] = INCBIN_U32("graphics/pokemon_storage/plain.bin.lz"); + +// 12×18 tilemap +static const u32 gUnknown_085773C4[] = INCBIN_U32("graphics/unused/tilemap_5773C4.bin"); + +static const u16 gUnknown_08577574[][2] = +{ + {0x1CE7, 0x7FFF}, + {0x1CE7, 0x7FFF}, + {0x1CE7, 0x7FFF}, + {0x1CE7, 0x7FFF}, + {0x1CE7, 0x7FFF}, + {0x1CE7, 0x7FFF}, + {0x1CE7, 0x7FFF}, + {0x1CE7, 0x7FFF}, + {0x1CE7, 0x7FFF}, + {0x1CE7, 0x7FFF}, + {0x1CE7, 0x7FFF}, + {0x1CE7, 0x7FFF}, + {0x1CE7, 0x7FFF}, + {0x1CE7, 0x7FFF}, + {0x1CE7, 0x7FFF}, + {0x1CE7, 0x7FFF}, + {0x1CE7, 0x7FFF} +}; + +#define WALLPAPER_ENTRY(name) {gWallpaperTiles_##name, gWallpaperTilemap_##name, gWallpaperPalettes_##name[0]} + +static const struct WallpaperTable gWallpaperTable[] = +{ + [WALLPAPER_FOREST] = WALLPAPER_ENTRY(Forest), + [WALLPAPER_CITY] = WALLPAPER_ENTRY(City), + [WALLPAPER_DESERT] = WALLPAPER_ENTRY(Desert), + [WALLPAPER_SAVANNA] = WALLPAPER_ENTRY(Savanna), + [WALLPAPER_CRAG] = WALLPAPER_ENTRY(Crag), + [WALLPAPER_VOLCANO] = WALLPAPER_ENTRY(Volcano), + [WALLPAPER_SNOW] = WALLPAPER_ENTRY(Snow), + [WALLPAPER_CAVE] = WALLPAPER_ENTRY(Cave), + [WALLPAPER_BEACH] = WALLPAPER_ENTRY(Beach), + [WALLPAPER_SEAFLOOR] = WALLPAPER_ENTRY(Seafloor), + [WALLPAPER_RIVER] = WALLPAPER_ENTRY(River), + [WALLPAPER_SKY] = WALLPAPER_ENTRY(Sky), + [WALLPAPER_POLKADOT] = WALLPAPER_ENTRY(PolkaDot), + [WALLPAPER_POKECENTER] = WALLPAPER_ENTRY(Pokecenter), + [WALLPAPER_MACHINE] = WALLPAPER_ENTRY(Machine), + [WALLPAPER_PLAIN] = WALLPAPER_ENTRY(Plain), +}; + +static const u8 gPCGfx_Arrow[] = INCBIN_U8("graphics/pokemon_storage/arrow.4bpp"); + +static const u16 gWallpaperPalettes_Zigzagoon[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame1.gbapal"), + INCBIN_U16("graphics/pokemon_storage/zigzagoon_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Zigzagoon[] = INCBIN_U32("graphics/pokemon_storage/zigzagoon.4bpp.lz"); +static const u32 gWallpaperTilemap_Zigzagoon[] = INCBIN_U32("graphics/pokemon_storage/zigzagoon.bin.lz"); + +static const u16 gWallpaperPalettes_Screen[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame1.gbapal"), + INCBIN_U16("graphics/pokemon_storage/screen_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Screen[] = INCBIN_U32("graphics/pokemon_storage/screen.4bpp.lz"); +static const u32 gWallpaperTilemap_Screen[] = INCBIN_U32("graphics/pokemon_storage/screen.bin.lz"); + +static const u16 gWallpaperPalettes_Diagonal[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame1.gbapal"), + INCBIN_U16("graphics/pokemon_storage/diagonal_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Diagonal[] = INCBIN_U32("graphics/pokemon_storage/diagonal.4bpp.lz"); +static const u32 gWallpaperTilemap_Diagonal[] = INCBIN_U32("graphics/pokemon_storage/diagonal.bin.lz"); + +static const u16 gWallpaperPalettes_Block[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/block_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/block_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Block[] = INCBIN_U32("graphics/pokemon_storage/block.4bpp.lz"); +static const u32 gWallpaperTilemap_Block[] = INCBIN_U32("graphics/pokemon_storage/block.bin.lz"); + +static const u16 gWallpaperPalettes_Pokecenter2[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/pokecenter2_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/pokecenter2_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Pokecenter2[] = INCBIN_U32("graphics/pokemon_storage/pokecenter2.4bpp.lz"); +static const u32 gWallpaperTilemap_Pokecenter2[] = INCBIN_U32("graphics/pokemon_storage/pokecenter2.bin.lz"); + +static const u16 gWallpaperPalettes_Frame[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/frame_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/frame_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Frame[] = INCBIN_U32("graphics/pokemon_storage/frame.4bpp.lz"); +static const u32 gWallpaperTilemap_Frame[] = INCBIN_U32("graphics/pokemon_storage/frame.bin.lz"); + +static const u16 gWallpaperPalettes_Blank[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame1.gbapal"), + INCBIN_U16("graphics/pokemon_storage/zigzagoon_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Blank[] = INCBIN_U32("graphics/pokemon_storage/blank.4bpp.lz"); +static const u32 gWallpaperTilemap_Blank[] = INCBIN_U32("graphics/pokemon_storage/blank.bin.lz"); + +static const u16 gWallpaperPalettes_Circles[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/circles_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Circles[] = INCBIN_U32("graphics/pokemon_storage/circles.4bpp.lz"); +static const u32 gWallpaperTilemap_Circles[] = INCBIN_U32("graphics/pokemon_storage/circles.bin.lz"); + +static const u16 gWallpaperPalettes_Azumarill[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/azumarill_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Azumarill[] = INCBIN_U32("graphics/pokemon_storage/azumarill.4bpp.lz"); +static const u32 gWallpaperTilemap_Azumarill[] = INCBIN_U32("graphics/pokemon_storage/azumarill.bin.lz"); + +static const u16 gWallpaperPalettes_Pikachu[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/pikachu_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Pikachu[] = INCBIN_U32("graphics/pokemon_storage/pikachu.4bpp.lz"); +static const u32 gWallpaperTilemap_Pikachu[] = INCBIN_U32("graphics/pokemon_storage/pikachu.bin.lz"); + +static const u16 gWallpaperPalettes_Legendary[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/legendary_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Legendary[] = INCBIN_U32("graphics/pokemon_storage/legendary.4bpp.lz"); +static const u32 gWallpaperTilemap_Legendary[] = INCBIN_U32("graphics/pokemon_storage/legendary.bin.lz"); + +static const u16 gWallpaperPalettes_Dusclops[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/dusclops_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Dusclops[] = INCBIN_U32("graphics/pokemon_storage/dusclops.4bpp.lz"); +static const u32 gWallpaperTilemap_Dusclops[] = INCBIN_U32("graphics/pokemon_storage/dusclops.bin.lz"); + +static const u16 gWallpaperPalettes_Ludicolo[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/ludicolo_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Ludicolo[] = INCBIN_U32("graphics/pokemon_storage/ludicolo.4bpp.lz"); +static const u32 gWallpaperTilemap_Ludicolo[] = INCBIN_U32("graphics/pokemon_storage/ludicolo.bin.lz"); + +static const u16 gWallpaperPalettes_Whiscash[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/whiscash_bg.gbapal"), +}; +static const u32 gWallpaperTiles_Whiscash[] = INCBIN_U32("graphics/pokemon_storage/whiscash.4bpp.lz"); +static const u32 gWallpaperTilemap_Whiscash[] = INCBIN_U32("graphics/pokemon_storage/whiscash.bin.lz"); + +static const u32 gWallpaperIcon_Aqua[] = INCBIN_U32("graphics/pokemon_storage/aqua_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Heart[] = INCBIN_U32("graphics/pokemon_storage/heart_icon.4bpp.lz"); +static const u32 gWallpaperIcon_FiveStar[] = INCBIN_U32("graphics/pokemon_storage/five_star_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Brick[] = INCBIN_U32("graphics/pokemon_storage/brick_icon.4bpp.lz"); +static const u32 gWallpaperIcon_FourStar[] = INCBIN_U32("graphics/pokemon_storage/four_star_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Asterisk[] = INCBIN_U32("graphics/pokemon_storage/asterisk_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Dot[] = INCBIN_U32("graphics/pokemon_storage/dot_icon.4bpp.lz"); +static const u32 gWallpaperIcon_LineCircle[] = INCBIN_U32("graphics/pokemon_storage/line_circle_icon.4bpp.lz"); +static const u32 gWallpaperIcon_PokeBall[] = INCBIN_U32("graphics/pokemon_storage/pokeball_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Maze[] = INCBIN_U32("graphics/pokemon_storage/maze_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Footprint[] = INCBIN_U32("graphics/pokemon_storage/footprint_icon.4bpp.lz"); +static const u32 gWallpaperIcon_BigAsterisk[] = INCBIN_U32("graphics/pokemon_storage/big_asterisk_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Circle[] = INCBIN_U32("graphics/pokemon_storage/circle_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Koffing[] = INCBIN_U32("graphics/pokemon_storage/koffing_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Ribbon[] = INCBIN_U32("graphics/pokemon_storage/ribbon_icon.4bpp.lz"); +static const u32 gWallpaperIcon_FourCircles[] = INCBIN_U32("graphics/pokemon_storage/four_circles_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Lotad[] = INCBIN_U32("graphics/pokemon_storage/lotad_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Crystal[] = INCBIN_U32("graphics/pokemon_storage/crystal_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Pichu[] = INCBIN_U32("graphics/pokemon_storage/pichu_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Diglett[] = INCBIN_U32("graphics/pokemon_storage/diglett_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Luvdisc[] = INCBIN_U32("graphics/pokemon_storage/luvdisc_icon.4bpp.lz"); +static const u32 gWallpaperIcon_StarInCircle[] = INCBIN_U32("graphics/pokemon_storage/star_in_circle_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Spinda[] = INCBIN_U32("graphics/pokemon_storage/spinda_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Latis[] = INCBIN_U32("graphics/pokemon_storage/latis_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Minun[] = INCBIN_U32("graphics/pokemon_storage/minun_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Togepi[] = INCBIN_U32("graphics/pokemon_storage/togepi_icon.4bpp.lz"); +static const u32 gWallpaperIcon_Magma[] = INCBIN_U32("graphics/pokemon_storage/magma_icon.4bpp.lz"); + +static const struct WallpaperTable gFriendsWallpaperTable[] = +{ + WALLPAPER_ENTRY(Zigzagoon), + WALLPAPER_ENTRY(Screen), + WALLPAPER_ENTRY(Horizontal), + WALLPAPER_ENTRY(Diagonal), + WALLPAPER_ENTRY(Block), + WALLPAPER_ENTRY(Ribbon), + WALLPAPER_ENTRY(Pokecenter2), + WALLPAPER_ENTRY(Frame), + WALLPAPER_ENTRY(Blank), + WALLPAPER_ENTRY(Circles), + WALLPAPER_ENTRY(Azumarill), + WALLPAPER_ENTRY(Pikachu), + WALLPAPER_ENTRY(Legendary), + WALLPAPER_ENTRY(Dusclops), + WALLPAPER_ENTRY(Ludicolo), + WALLPAPER_ENTRY(Whiscash), +}; + +static const u32 *const gFriendsIcons[] = +{ + gWallpaperIcon_Aqua, + gWallpaperIcon_Heart, + gWallpaperIcon_FiveStar, + gWallpaperIcon_Brick, + gWallpaperIcon_FourStar, + gWallpaperIcon_Asterisk, + gWallpaperIcon_Dot, + gWallpaperIcon_Cross, + gWallpaperIcon_LineCircle, + gWallpaperIcon_PokeBall, + gWallpaperIcon_Maze, + gWallpaperIcon_Footprint, + gWallpaperIcon_BigAsterisk, + gWallpaperIcon_Circle, + gWallpaperIcon_Koffing, + gWallpaperIcon_Ribbon, + gWallpaperIcon_Bolt, + gWallpaperIcon_FourCircles, + gWallpaperIcon_Lotad, + gWallpaperIcon_Crystal, + gWallpaperIcon_Pichu, + gWallpaperIcon_Diglett, + gWallpaperIcon_Luvdisc, + gWallpaperIcon_StarInCircle, + gWallpaperIcon_Spinda, + gWallpaperIcon_Latis, + gWallpaperIcon_Plusle, + gWallpaperIcon_Minun, + gWallpaperIcon_Togepi, + gWallpaperIcon_Magma, +}; + +// Unknown Unused data. +static const u16 gUnknown_0857B07C = 0x23BA; -const u16 gBoxSelectionPopupPalette[] = INCBIN_U16("graphics/unknown/unknown_57173C.gbapal"); -const u8 gBoxSelectionPopupCenterTiles[] = INCBIN_U8("graphics/pokemon_storage/box_selection_popup_center.4bpp"); -const u8 gBoxSelectionPopupSidesTiles[] = INCBIN_U8("graphics/pokemon_storage/box_selection_popup_sides.4bpp"); +static const struct SpriteSheet gUnknown_0857B080 = {gPCGfx_Arrow, 0x80, 6}; + +static const struct OamData gOamData_83BB298 = +{ + .shape = ST_OAM_H_RECTANGLE, + .size = 2, + .priority = 2 +}; + +static const union AnimCmd gSpriteAnim_83BB2A0[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END +}; + +static const union AnimCmd gSpriteAnim_83BB2A8[] = +{ + ANIMCMD_FRAME(8, 5), + ANIMCMD_END +}; + +static const union AnimCmd *const gSpriteAnimTable_83BB2B0[] = +{ + gSpriteAnim_83BB2A0, + gSpriteAnim_83BB2A8 +}; + +static const struct SpriteTemplate gSpriteTemplate_857B0A8 = +{ + TAG_TILE_3, + TAG_PAL_DAC9, + &gOamData_83BB298, + gSpriteAnimTable_83BB2B0, + NULL, + gDummySpriteAffineAnimTable, + SpriteCallbackDummy +}; + +static const struct OamData gOamData_83BB2D0 = +{ + .shape = ST_OAM_V_RECTANGLE, + .priority = 2 +}; + +static const union AnimCmd gSpriteAnim_83BB2D8[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END +}; + +static const union AnimCmd gSpriteAnim_83BB2E0[] = +{ + ANIMCMD_FRAME(2, 5), + ANIMCMD_END +}; + +static const union AnimCmd *const gSpriteAnimTable_83BB2E8[] = +{ + gSpriteAnim_83BB2D8, + gSpriteAnim_83BB2E0 +}; + +static const struct SpriteTemplate gUnknown_0857B0E0 = +{ + 6, + TAG_PAL_WAVEFORM, + &gOamData_83BB2D0, + gSpriteAnimTable_83BB2E8, + NULL, + gDummySpriteAffineAnimTable, + sub_80CD210 +}; + +static const u16 gHandCursorPalette[] = INCBIN_U16("graphics/pokemon_storage/hand_cursor.gbapal"); +static const u8 gHandCursorTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cursor.4bpp"); +static const u8 gHandCursorShadowTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cursor_shadow.4bpp"); // code u8 CountMonsInBox(u8 boxId) @@ -117,7 +1549,7 @@ u8 CountMonsInBox(u8 boxId) for (i = 0, count = 0; i < IN_BOX_COUNT; i++) { - if (GetBoxMonDataFromAnyBox(boxId, i, MON_DATA_SPECIES) != SPECIES_NONE) + if (GetBoxMonDataAt(boxId, i, MON_DATA_SPECIES) != SPECIES_NONE) count++; } @@ -130,7 +1562,7 @@ s16 GetFirstFreeBoxSpot(u8 boxId) for (i = 0; i < IN_BOX_COUNT; i++) { - if (GetBoxMonDataFromAnyBox(boxId, i, MON_DATA_SPECIES) == SPECIES_NONE) + if (GetBoxMonDataAt(boxId, i, MON_DATA_SPECIES) == SPECIES_NONE) return i; } @@ -191,7 +1623,7 @@ u8 CountPartyMons(void) return count; } -static u8 *StringCopyAndFillWithSpaces(u8 *dst, const u8 *src, u16 n) +u8 *StringCopyAndFillWithSpaces(u8 *dst, const u8 *src, u16 n) { u8 *str; @@ -217,28 +1649,7 @@ static void sub_80C7128(u16 *dest, u16 dest_left, u16 dest_top, const u16 *src, } } -#define MAX_DMA_BLOCK_SIZE 0x1000 -#define Dma3FillLarge_(value, dest, size, bit) \ -{ \ - void *_dest = dest; \ - u32 _size = size; \ - while (1) \ - { \ - if (_size <= MAX_DMA_BLOCK_SIZE) \ - { \ - DmaFill##bit(3, value, _dest, _size); \ - break; \ - } \ - DmaFill##bit(3, value, _dest, MAX_DMA_BLOCK_SIZE); \ - _dest += MAX_DMA_BLOCK_SIZE; \ - _size -= MAX_DMA_BLOCK_SIZE; \ - } \ -} - -#define Dma3FillLarge16_(value, dest, size) Dma3FillLarge_(value, dest, size, 16) -#define Dma3FillLarge32_(value, dest, size) Dma3FillLarge_(value, dest, size, 32) - -void sub_80C71A4(u16 *dest, u16 dest_left, u16 dest_top, u16 width, u16 height) +static void sub_80C71A4(u16 *dest, u16 dest_left, u16 dest_top, u16 width, u16 height) { u16 i; @@ -248,13 +1659,14 @@ void sub_80C71A4(u16 *dest, u16 dest_left, u16 dest_top, u16 width, u16 height) Dma3FillLarge16_(0, dest, width); } -void Task_PokemonStorageSystem(u8 taskId) +static void Task_PokemonStorageSystemPC(u8 taskId) { - struct Task *task = gTasks + taskId; + struct Task *task = &gTasks[taskId]; + switch (task->data[0]) { case 0: - StorageSystemCreatePrimaryMenu(task->data[1], &task->data[15]); + CreatePCMenu(task->data[1], &task->data[15]); sub_81973A4(); NewMenuHelpers_DrawDialogueFrame(0, 0); FillWindowPixelBuffer(0, 0x11); @@ -327,8 +1739,8 @@ void Task_PokemonStorageSystem(u8 taskId) { if (--task->data[1] < 0) task->data[1] = 4; - MoveMenuCursor(-1); - task->data[1] = GetMenuCursorPos(); + Menu_MoveCursor(-1); + task->data[1] = Menu_GetCursorPos(); FillWindowPixelBuffer(0, 0x11); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, 0, NULL, 2, 1, 3); task->data[0] = 2; @@ -337,8 +1749,8 @@ void Task_PokemonStorageSystem(u8 taskId) { if (++task->data[1] > 3) task->data[1] = 0; - MoveMenuCursor(1); - task->data[1] = GetMenuCursorPos(); + Menu_MoveCursor(1); + task->data[1] = Menu_GetCursorPos(); FillWindowPixelBuffer(0, 0x11); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, 0, NULL, 2, 1, 3); task->data[0] = 2; @@ -348,7 +1760,7 @@ void Task_PokemonStorageSystem(u8 taskId) if (!gPaletteFade.active) { overworld_free_bg_tilemaps(); - sub_80C7D74(task->data[2]); + Cb2_EnterPSS(task->data[2]); RemoveWindow(task->data[15]); DestroyTask(taskId); } @@ -356,29 +1768,29 @@ void Task_PokemonStorageSystem(u8 taskId) } } -void ShowPokemonStorageSystem(void) +void ShowPokemonStorageSystemPC(void) { - u8 taskId = CreateTask(Task_PokemonStorageSystem, 80); + u8 taskId = CreateTask(Task_PokemonStorageSystemPC, 80); gTasks[taskId].data[0] = 0; gTasks[taskId].data[1] = 0; ScriptContext2_Enable(); } -void mapldr_0808C6D8(void) +static void FieldCb_ReturnToPcMenu(void) { u8 taskId; MainCallback vblankCb = gMain.vblankCallback; SetVBlankCallback(NULL); - taskId = CreateTask(Task_PokemonStorageSystem, 80); + taskId = CreateTask(Task_PokemonStorageSystemPC, 80); gTasks[taskId].data[0] = 0; - gTasks[taskId].data[1] = gUnknown_02039D00; - Task_PokemonStorageSystem(taskId); + gTasks[taskId].data[1] = sPreviousBoxOption; + Task_PokemonStorageSystemPC(taskId); SetVBlankCallback(vblankCb); pal_fill_black(); } -void StorageSystemCreatePrimaryMenu(u8 whichMenu, s16 *windowIdPtr) +static void CreatePCMenu(u8 whichMenu, s16 *windowIdPtr) { s16 windowId; struct WindowTemplate winTemplate = gUnknown_085716E8; @@ -391,14 +1803,14 @@ void StorageSystemCreatePrimaryMenu(u8 whichMenu, s16 *windowIdPtr) *windowIdPtr = windowId; } -void sub_80C7678(void) +static void Cb2_ExitPSS(void) { - gUnknown_02039D00 = sub_80CAEA0(); - gFieldCallback = mapldr_0808C6D8; + sPreviousBoxOption = GetCurrentBoxOption(); + gFieldCallback = FieldCb_ReturnToPcMenu; SetMainCallback2(CB2_ReturnToField); } -s16 StorageSystemGetNextMonIndex(struct BoxPokemon *box, s8 startIdx, u8 stopIdx, u8 mode) +static s16 StorageSystemGetNextMonIndex(struct BoxPokemon *box, s8 startIdx, u8 stopIdx, u8 mode) { s16 i; s16 direction; @@ -431,14 +1843,13 @@ s16 StorageSystemGetNextMonIndex(struct BoxPokemon *box, s8 startIdx, u8 stopIdx void ResetPokemonStorageSystem(void) { - u16 boxId; - u16 boxMon; + u16 boxId, boxPosition; SetCurrentBox(0); for (boxId = 0; boxId < TOTAL_BOXES_COUNT; boxId++) { - for (boxMon = 0; boxMon < IN_BOX_COUNT; boxMon++) - ClearMonInBox(boxId, boxMon); + for (boxPosition = 0; boxPosition < IN_BOX_COUNT; boxPosition++) + ZeroBoxMonAt(boxId, boxPosition); } for (boxId = 0; boxId < TOTAL_BOXES_COUNT; boxId++) { @@ -452,7 +1863,7 @@ void ResetPokemonStorageSystem(void) ResetWaldaWallpaper(); } -void sub_80C77E8(struct UnkPSSStruct_2002370 *a0, u16 tileTag, u16 palTag, u8 a3, bool32 loadPal) +static void sub_80C77E8(struct UnkPSSStruct_2002370 *a0, u16 tileTag, u16 palTag, u8 a3, bool32 loadPal) { struct SpritePalette palette = { @@ -476,7 +1887,7 @@ void sub_80C77E8(struct UnkPSSStruct_2002370 *a0, u16 tileTag, u16 palTag, u8 a3 a0->unk_023c = loadPal; } -void sub_80C7890(void) +static void sub_80C7890(void) { if (gUnknown_02039D04->unk_023c) FreeSpritePaletteByTag(gUnknown_02039D04->unk_0242); @@ -484,17 +1895,17 @@ void sub_80C7890(void) FreeSpriteTilesByTag(gUnknown_02039D04->unk_0240 + 1); } -void sub_80C78D4(u8 curBox) +static void sub_80C78D4(u8 curBox) { sub_80C7958(curBox); } -void sub_80C78E4(void) +static void sub_80C78E4(void) { sub_80C7B14(); } -u8 sub_80C78F0(void) +static u8 HandleBoxChooseSelectionInput(void) { if (gMain.newKeys & B_BUTTON) { @@ -519,7 +1930,7 @@ u8 sub_80C78F0(void) return 200; } -void sub_80C7958(u8 curBox) +static void sub_80C7958(u8 curBox) { u16 i; u8 spriteId; @@ -535,7 +1946,7 @@ void sub_80C7958(u8 curBox) template.tileTag = gUnknown_02039D04->unk_0240; template.paletteTag = gUnknown_02039D04->unk_0242; - spriteId = CreateSprite(&template, 0xA0, 0x60, 0); + spriteId = CreateSprite(&template, 160, 96, 0); gUnknown_02039D04->unk_0000 = gSprites + spriteId; oamData.shape = ST_OAM_V_RECTANGLE; @@ -545,17 +1956,17 @@ void sub_80C7958(u8 curBox) for (i = 0; i < 4; i++) { u16 r5; - spriteId = CreateSprite(&template, 0x7c, 0x50, gUnknown_02039D04->unk_0246); + spriteId = CreateSprite(&template, 124, 80, gUnknown_02039D04->unk_0246); gUnknown_02039D04->unk_0004[i] = gSprites + spriteId; r5 = 0; if (i & 2) { - gUnknown_02039D04->unk_0004[i]->pos1.x = 0xc4; + gUnknown_02039D04->unk_0004[i]->pos1.x = 196; r5 = 2; } if (i & 1) { - gUnknown_02039D04->unk_0004[i]->pos1.y = 0x70; + gUnknown_02039D04->unk_0004[i]->pos1.y = 112; gUnknown_02039D04->unk_0004[i]->oam.size = 0; r5++; } @@ -573,7 +1984,7 @@ void sub_80C7958(u8 curBox) sub_80C7BE4(); } -void sub_80C7B14(void) +static void sub_80C7B14(void) { u16 i; if (gUnknown_02039D04->unk_0000) @@ -596,20 +2007,20 @@ void sub_80C7B14(void) } } -void sub_80C7B80(void) +static void sub_80C7B80(void) { if (++gUnknown_02039D04->curBox >= TOTAL_BOXES_COUNT) gUnknown_02039D04->curBox = 0; sub_80C7BE4(); } -void sub_80C7BB4(void) +static void sub_80C7BB4(void) { gUnknown_02039D04->curBox = (gUnknown_02039D04->curBox == 0 ? TOTAL_BOXES_COUNT - 1 : gUnknown_02039D04->curBox - 1); sub_80C7BE4(); } -void sub_80C7BE4(void) +static void sub_80C7BE4(void) { u8 text[16]; struct WindowTemplate winTemplate; @@ -626,13 +2037,13 @@ void sub_80C7BE4(void) windowId = AddWindow(&winTemplate); FillWindowPixelBuffer(windowId, 0x44); - center = GetStringCenterAlignXOffset(1, boxName, 0x40); + center = GetStringCenterAlignXOffset(1, boxName, 64); AddTextPrinterParameterized3(windowId, 1, center, 1, gUnknown_08571734, TEXT_SPEED_FF, boxName); ConvertIntToDecimalStringN(text, nPokemonInBox, 1, 2); StringAppend(text, gUnknown_08571737); - center = GetStringCenterAlignXOffset(1, text, 0x40); - AddTextPrinterParameterized3(windowId, 1, center, 0x11, gUnknown_08571734, TEXT_SPEED_FF, text); + center = GetStringCenterAlignXOffset(1, text, 64); + AddTextPrinterParameterized3(windowId, 1, center, 17, gUnknown_08571734, TEXT_SPEED_FF, text); winTileData = GetWindowAttribute(windowId, WINDOW_TILE_DATA); CpuCopy32((void *)winTileData, (void *)OBJ_VRAM0 + 0x100 + (GetSpriteTileStartByTag(gUnknown_02039D04->unk_0240) * 32), 0x400); @@ -640,7 +2051,7 @@ void sub_80C7BE4(void) RemoveWindow(windowId); } -void sub_80C7CF4(struct Sprite *sprite) +static void sub_80C7CF4(struct Sprite *sprite) { if (++sprite->data[1] > 3) { @@ -654,21 +2065,8587 @@ void sub_80C7CF4(struct Sprite *sprite) } } -void sub_80C7D28(void) +static void VblankCb_PSS(void) { LoadOam(); ProcessSpriteCopyRequests(); sub_80D2AA4(); TransferPlttBuffer(); - SetGpuReg(REG_OFFSET_BG2HOFS, gUnknown_02039D08->bg2_X); + SetGpuReg(REG_OFFSET_BG2HOFS, sPSSData->bg2_X); } -void c2_Box(void) +static void Cb2_PSS(void) { RunTasks(); do_scheduled_bg_tilemap_copies_to_vram(); - sub_80CA028(); + ScrollBackground(); sub_80CAA14(); AnimateSprites(); BuildOamBuffer(); } + +static void Cb2_EnterPSS(u8 boxOption) +{ + ResetTasks(); + sCurrentBoxOption = boxOption; + sPSSData = Alloc(sizeof(*sPSSData)); + if (sPSSData == NULL) + { + SetMainCallback2(Cb2_ExitPSS); + } + else + { + sPSSData->boxOption = boxOption; + sPSSData->isReshowingPSS = FALSE; + gUnknown_02039D12 = 0; + sPSSData->state = 0; + sPSSData->taskId = CreateTask(Cb_InitPSS, 3); + gUnknown_02039D10 = StorageGetCurrentBox(); + SetMainCallback2(Cb2_PSS); + } +} + +static void Cb2_ReturnToPSS(void) +{ + ResetTasks(); + sPSSData = Alloc(sizeof(*sPSSData)); + if (sPSSData == NULL) + { + SetMainCallback2(Cb2_ExitPSS); + } + else + { + sPSSData->boxOption = sCurrentBoxOption; + sPSSData->isReshowingPSS = TRUE; + sPSSData->state = 0; + sPSSData->taskId = CreateTask(Cb_InitPSS, 3); + SetMainCallback2(Cb2_PSS); + } +} + +static void ResetAllBgCoords(void) +{ + SetGpuReg(REG_OFFSET_BG0HOFS, 0); + SetGpuReg(REG_OFFSET_BG0VOFS, 0); + SetGpuReg(REG_OFFSET_BG1HOFS, 0); + SetGpuReg(REG_OFFSET_BG1VOFS, 0); + SetGpuReg(REG_OFFSET_BG2HOFS, 0); + SetGpuReg(REG_OFFSET_BG2VOFS, 0); + SetGpuReg(REG_OFFSET_BG3HOFS, 0); + SetGpuReg(REG_OFFSET_BG3VOFS, 0); +} + +static void sub_80C7E98(void) +{ + ResetPaletteFade(); + ResetSpriteData(); + FreeSpriteTileRanges(); + FreeAllSpritePalettes(); + ClearDma3Requests(); + gReservedSpriteTileCount = 0x280; + sub_80D2A90(&sPSSData->unk_0020, sPSSData->unk_0028, 8); + gKeyRepeatStartDelay = 20; + clear_scheduled_bg_copies_to_vram(); + sub_80D259C(3); + sub_80D2644(0, 1, gUnknown_0857239C, 8, 4); + sub_80D2770(0, 1, 0); + sPSSData->unk_02C7 = 0; +} + +static void sub_80C7F1C(void) +{ + sub_80CDC0C(); + sInPartyMenu = (sPSSData->boxOption == BOX_OPTION_DEPOSIT); + gUnknown_02039D0E = 0; +} + +static void sub_80C7F4C(void) +{ + if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + { + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(7, 11)); + } + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_BG_ALL_ON | DISPCNT_OBJ_1D_MAP); +} + +static void SetPSSCallback(TaskFunc newFunc) +{ + gTasks[sPSSData->taskId].func = newFunc; + sPSSData->state = 0; +} + +static void Cb_InitPSS(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + SetVBlankCallback(NULL); + SetGpuReg(REG_OFFSET_DISPCNT, 0); + sub_80C7E98(); + if (sPSSData->isReshowingPSS) + { + switch (sWhichToReshow) + { + case 1: + sub_80CE790(); + break; + case 0: + sub_80CE8E4(); + break; + case 2: + GiveChosenBagItem(); + break; + } + } + LoadPSSMenuGfx(); + LoadWaveformSpritePalette(); + break; + case 1: + if (!InitPSSWindows()) + { + SetPSSCallback(Cb_ChangeScreen); + return; + } + break; + case 2: + PutWindowTilemap(0); + ClearWindowTilemap(1); + CpuFill32(0, (void *)VRAM, 0x200); + LoadUserWindowBorderGfx(1, 0xB, 0xE0); + break; + case 3: + ResetAllBgCoords(); + if (!sPSSData->isReshowingPSS) + sub_80C7F1C(); + break; + case 4: + sub_80CAF04(); + if (!sPSSData->isReshowingPSS) + sub_80CD36C(); + else + sub_80CD3EC(); + break; + case 5: + if (!sub_80D0164()) + { + SetPSSCallback(Cb_ChangeScreen); + return; + } + else + { + SetScrollingBackground(); + sub_80CAC1C(); + } + break; + case 6: + sub_80CA0D8(); + break; + case 7: + sub_80CA704(); + break; + case 8: + sub_80CC32C(StorageGetCurrentBox()); + break; + case 9: + if (sub_80CC35C()) + return; + + if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + { + sPSSData->field_DA4.baseTileTag = TAG_TILE_D; + sPSSData->field_DA4.basePaletteTag = TAG_PAL_DACE; + sub_811F90C(&sPSSData->field_DA4); + sub_811FA90(); + } + else + { + sub_80D0C60(); + sub_80CAEAC(); + } + break; + case 10: + sub_80C7F4C(); + if (!sPSSData->isReshowingPSS) + { + BlendPalettes(0xFFFFFFFF, 0x10, RGB_BLACK); + SetPSSCallback(Cb_ShowPSS); + } + else + { + BlendPalettes(0xFFFFFFFF, 0x10, RGB_BLACK); + SetPSSCallback(Cb_ReshowPSS); + } + SetVBlankCallback(VblankCb_PSS); + return; + default: + return; + } + + sPSSData->state++; +} + +static void Cb_ShowPSS(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + PlaySE(SE_PC_LOGIN); + sub_80F9BCC(0x14, 0, 1); + sPSSData->state++; + break; + case 1: + if (!sub_80F9C1C()) + SetPSSCallback(Cb_MainPSS); + break; + } +} + +static void Cb_ReshowPSS(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + BeginNormalPaletteFade(0xFFFFFFFF, -1, 0x10, 0, RGB_BLACK); + sPSSData->state++; + break; + case 1: + if (!UpdatePaletteFade()) + { + if (sWhichToReshow == 2 && gSpecialVar_ItemId != 0) + { + PrintStorageActionText(PC_TEXT_ITEM_IS_HELD); + sPSSData->state++; + } + else + { + SetPSSCallback(Cb_MainPSS); + } + } + break; + case 2: + if (!IsDma3ManagerBusyWithBgCopy() && gMain.newKeys & (A_BUTTON | B_BUTTON)) + { + ClearBottomWindow(); + sPSSData->state++; + } + break; + case 3: + if (!IsDma3ManagerBusyWithBgCopy()) + SetPSSCallback(Cb_MainPSS); + break; + } +} + +static void Cb_MainPSS(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + switch (HandleInput()) + { + case 1: + PlaySE(SE_SELECT); + sPSSData->state = 1; + break; + case 5: + if (sPSSData->boxOption != BOX_OPTION_MOVE_MONS && sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + { + PrintStorageActionText(PC_TEXT_WHICH_ONE_WILL_TAKE); + sPSSData->state = 3; + } + else + { + sub_80CDC0C(); + SetPSSCallback(Cb_ShowPartyPokemon); + } + break; + case 6: + if (sPSSData->boxOption == BOX_OPTION_MOVE_MONS) + { + if (IsMonBeingMoved() && ItemIsMail(sPSSData->cursorMonItem)) + sPSSData->state = 5; + else + SetPSSCallback(Cb_HidePartyPokemon); + } + else if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + { + SetPSSCallback(Cb_HidePartyPokemon); + } + break; + case 4: + SetPSSCallback(Cb_OnCloseBoxPressed); + break; + case 19: + SetPSSCallback(Cb_OnBPressed); + break; + case 7: + PlaySE(SE_SELECT); + SetPSSCallback(Cb_HandleBoxOptions); + break; + case 8: + SetPSSCallback(Cb_OnSelectedMon); + break; + case 9: + PlaySE(SE_SELECT); + sPSSData->newCurrBoxId = StorageGetCurrentBox() + 1; + if (sPSSData->newCurrBoxId >= TOTAL_BOXES_COUNT) + sPSSData->newCurrBoxId = 0; + if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + { + SetUpScrollToBox(sPSSData->newCurrBoxId); + sPSSData->state = 2; + } + else + { + sub_80CFEA8(); + sPSSData->state = 10; + } + break; + case 10: + PlaySE(SE_SELECT); + sPSSData->newCurrBoxId = StorageGetCurrentBox() - 1; + if (sPSSData->newCurrBoxId < 0) + sPSSData->newCurrBoxId = TOTAL_BOXES_COUNT - 1; + if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + { + SetUpScrollToBox(sPSSData->newCurrBoxId); + sPSSData->state = 2; + } + else + { + sub_80CFEA8(); + sPSSData->state = 10; + } + break; + case 11: + if (!CanMovePartyMon()) + { + if (ItemIsMail(sPSSData->cursorMonItem)) + { + sPSSData->state = 5; + } + else + { + PlaySE(SE_SELECT); + SetPSSCallback(Cb_DepositMenu); + } + } + else + { + sPSSData->state = 4; + } + break; + case 13: + if (CanMovePartyMon()) + { + sPSSData->state = 4; + } + else + { + PlaySE(SE_SELECT); + SetPSSCallback(Cb_MoveMon); + } + break; + case 14: + if (!CanShiftMon()) + { + sPSSData->state = 4; + } + else + { + PlaySE(SE_SELECT); + SetPSSCallback(Cb_ShiftMon); + } + break; + case 12: + PlaySE(SE_SELECT); + SetPSSCallback(Cb_WithdrawMon); + break; + case 15: + PlaySE(SE_SELECT); + SetPSSCallback(Cb_PlaceMon); + break; + case 16: + PlaySE(SE_SELECT); + SetPSSCallback(Cb_TakeItemForMoving); + break; + case 17: + PlaySE(SE_SELECT); + SetPSSCallback(Cb_GiveMovingItemToMon); + break; + case 18: + PlaySE(SE_SELECT); + SetPSSCallback(Cb_SwitchSelectedItem); + break; + case 20: + PlaySE(SE_SELECT); + sub_80D01D0(0); + sPSSData->state = 7; + break; + case 22: + sub_80D01D0(1); + sPSSData->state = 8; + break; + case 21: + PlaySE(SE_SELECT); + sub_80D01D0(2); + sPSSData->state = 9; + break; + case 23: + sub_80D01D0(3); + sPSSData->state = 7; + break; + case 25: + PlaySE(SE_SELECT); + sub_80D01D0(4); + sPSSData->state = 9; + break; + case 26: + PlaySE(SE_SELECT); + sub_80D01D0(5); + sPSSData->state = 7; + break; + case 24: + PlaySE(SE_HAZURE); + break; + } + break; + case 1: + if (!sub_80CD554()) + { + if (IsCursorOnCloseBox()) + sub_80CA9C0(); + else + sub_80CA9EC(); + + if (sPSSData->setMosaic) + BoxSetMosaic(); + sPSSData->state = 0; + } + break; + case 2: + if (!ScrollToBox()) + { + SetCurrentBox(sPSSData->newCurrBoxId); + if (!sInPartyMenu && !IsMonBeingMoved()) + { + sub_80CE00C(); + BoxSetMosaic(); + } + + if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + { + sub_80CFECC(); + sPSSData->state = 11; + } + else + { + sPSSData->state = 0; + } + } + break; + case 3: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + ClearBottomWindow(); + sPSSData->state = 0; + } + break; + case 4: + PlaySE(SE_HAZURE); + PrintStorageActionText(PC_TEXT_LAST_POKE); + sPSSData->state = 6; + break; + case 5: + PlaySE(SE_HAZURE); + PrintStorageActionText(PC_TEXT_PLEASE_REMOVE_MAIL); + sPSSData->state = 6; + break; + case 6: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + ClearBottomWindow(); + SetPSSCallback(Cb_MainPSS); + } + break; + case 7: + if (!sub_80D01E4()) + sPSSData->state = 0; + break; + case 8: + if (!sub_80D01E4()) + SetPSSCallback(Cb_MoveMon); + break; + case 9: + if (!sub_80D01E4()) + { + if (sPSSData->setMosaic) + BoxSetMosaic(); + sPSSData->state = 0; + } + break; + case 10: + if (!sub_80D1218()) + { + SetUpScrollToBox(sPSSData->newCurrBoxId); + sPSSData->state = 2; + } + break; + case 11: + if (!sub_80D1218()) + sPSSData->state = 0; + break; + } +} + +static void Cb_ShowPartyPokemon(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + SetUpDoShowPartyMenu(); + sPSSData->state++; + break; + case 1: + if (!DoShowPartyMenu()) + SetPSSCallback(Cb_MainPSS); + break; + } +} + +static void Cb_HidePartyPokemon(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + PlaySE(SE_SELECT); + SetUpHidePartyMenu(); + sPSSData->state++; + break; + case 1: + if (!HidePartyMenu()) + { + sub_80CDBF8(sub_80CDC2C()); + sPSSData->state++; + } + break; + case 2: + if (!sub_80CD554()) + { + if (sPSSData->setMosaic) + BoxSetMosaic(); + SetPSSCallback(Cb_MainPSS); + } + break; + } +} + +static void Cb_OnSelectedMon(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + if (!sub_80CA2B8()) + { + PlaySE(SE_SELECT); + if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + PrintStorageActionText(PC_TEXT_IS_SELECTED); + else if (IsActiveItemMoving() || sPSSData->cursorMonItem != 0) + PrintStorageActionText(PC_TEXT_IS_SELECTED2); + else + PrintStorageActionText(PC_TEXT_GIVE_TO_MON); + + AddMenu(); + sPSSData->state = 1; + } + break; + case 1: // debug? + if (!sub_80D00A8()) + sPSSData->state = 2; + break; + case 2: + switch (sub_80D00AC()) + { + case -1: + case 0: + ClearBottomWindow(); + SetPSSCallback(Cb_MainPSS); + break; + case 3: + if (CanMovePartyMon()) + { + sPSSData->state = 3; + } + else + { + PlaySE(SE_SELECT); + ClearBottomWindow(); + SetPSSCallback(Cb_MoveMon); + } + break; + case 5: + PlaySE(SE_SELECT); + ClearBottomWindow(); + SetPSSCallback(Cb_PlaceMon); + break; + case 4: + if (!CanShiftMon()) + { + sPSSData->state = 3; + } + else + { + PlaySE(SE_SELECT); + ClearBottomWindow(); + SetPSSCallback(Cb_ShiftMon); + } + break; + case 2: + PlaySE(SE_SELECT); + ClearBottomWindow(); + SetPSSCallback(Cb_WithdrawMon); + break; + case 1: + if (CanMovePartyMon()) + { + sPSSData->state = 3; + } + else if (ItemIsMail(sPSSData->cursorMonItem)) + { + sPSSData->state = 4; + } + else + { + PlaySE(SE_SELECT); + ClearBottomWindow(); + SetPSSCallback(Cb_DepositMenu); + } + break; + case 7: + if (CanMovePartyMon()) + { + sPSSData->state = 3; + } + else if (sPSSData->cursorMonIsEgg) + { + sPSSData->state = 5; // Cannot release an Egg. + } + else if (ItemIsMail(sPSSData->cursorMonItem)) + { + sPSSData->state = 4; + } + else + { + PlaySE(SE_SELECT); + SetPSSCallback(Cb_ReleaseMon); + } + break; + case 6: + PlaySE(SE_SELECT); + SetPSSCallback(Cb_ShowMonSummary); + break; + case 8: + PlaySE(SE_SELECT); + SetPSSCallback(Cb_ShowMarkMenu); + break; + case 12: + PlaySE(SE_SELECT); + SetPSSCallback(Cb_TakeItemForMoving); + break; + case 13: + PlaySE(SE_SELECT); + SetPSSCallback(Cb_GiveMovingItemToMon); + break; + case 16: + SetPSSCallback(Cb_ItemToBag); + break; + case 15: + PlaySE(SE_SELECT); + SetPSSCallback(Cb_SwitchSelectedItem); + break; + case 14: + PlaySE(SE_SELECT); + SetPSSCallback(Cb_GiveItemFromBag); + break; + case 17: + SetPSSCallback(Cb_ShowItemInfo); + break; + } + break; + case 3: + PlaySE(SE_HAZURE); + PrintStorageActionText(PC_TEXT_LAST_POKE); + sPSSData->state = 6; + break; + case 5: + PlaySE(SE_HAZURE); + PrintStorageActionText(PC_TEXT_CANT_RELEASE_EGG); + sPSSData->state = 6; + break; + case 4: + PlaySE(SE_HAZURE); + PrintStorageActionText(PC_TEXT_PLEASE_REMOVE_MAIL); + sPSSData->state = 6; + break; + case 6: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + ClearBottomWindow(); + SetPSSCallback(Cb_MainPSS); + } + break; + } +} + +static void Cb_MoveMon(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + InitMonPlaceChange(0); + sPSSData->state++; + break; + case 1: + if (!DoMonPlaceChange()) + { + if (sInPartyMenu) + SetPSSCallback(Cb_HandleMovingMonFromParty); + else + SetPSSCallback(Cb_MainPSS); + } + break; + } +} + +static void Cb_PlaceMon(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + InitMonPlaceChange(1); + sPSSData->state++; + break; + case 1: + if (!DoMonPlaceChange()) + { + if (sInPartyMenu) + SetPSSCallback(Cb_HandleMovingMonFromParty); + else + SetPSSCallback(Cb_MainPSS); + } + break; + } +} + +static void Cb_ShiftMon(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + InitMonPlaceChange(2); + sPSSData->state++; + break; + case 1: + if (!DoMonPlaceChange()) + { + BoxSetMosaic(); + SetPSSCallback(Cb_MainPSS); + } + break; + } +} + +static void Cb_WithdrawMon(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + if (CalculatePlayerPartyCount() == PARTY_SIZE) + { + PrintStorageActionText(PC_TEXT_PARTY_FULL); + sPSSData->state = 1; + } + else + { + sub_80CDC18(); + InitMonPlaceChange(0); + sPSSData->state = 2; + } + break; + case 1: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + ClearBottomWindow(); + SetPSSCallback(Cb_MainPSS); + } + break; + case 2: + if (!DoMonPlaceChange()) + { + SetMovingMonPriority(1); + SetUpDoShowPartyMenu(); + sPSSData->state++; + } + break; + case 3: + if (!DoShowPartyMenu()) + { + InitMonPlaceChange(1); + sPSSData->state++; + } + break; + case 4: + if (!DoMonPlaceChange()) + { + sub_80CAB20(); + sPSSData->state++; + } + break; + case 5: + SetPSSCallback(Cb_HidePartyPokemon); + break; + } +} + +static void Cb_DepositMenu(u8 taskId) +{ + u8 boxId; + + switch (sPSSData->state) + { + case 0: + PrintStorageActionText(PC_TEXT_DEPOSIT_IN_WHICH_BOX); + sub_80C77E8(&sPSSData->field_1E5C, TAG_TILE_A, TAG_PAL_DAC7, 3, FALSE); + sub_80C78D4(gUnknown_02039D0E); + sPSSData->state++; + break; + case 1: + boxId = HandleBoxChooseSelectionInput(); + if (boxId == 200) + { + // no box chosen yet + } + else if (boxId == 201) + { + ClearBottomWindow(); + sub_80C78E4(); + sub_80C7890(); + SetPSSCallback(Cb_MainPSS); + } + else + { + if (TryStorePartyMonInBox(boxId)) + { + gUnknown_02039D0E = boxId; + ClearBottomWindow(); + sub_80C78E4(); + sub_80C7890(); + sPSSData->state = 2; + } + else + { + PrintStorageActionText(PC_TEXT_BOX_IS_FULL); + sPSSData->state = 4; + } + } + break; + case 2: + CompactPartySlots(); + sub_80CB950(); + sPSSData->state++; + break; + case 3: + if (!sub_80CB9BC()) + { + sub_80CE22C(); + BoxSetMosaic(); + sub_80CAB20(); + SetPSSCallback(Cb_MainPSS); + } + break; + case 4: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + PrintStorageActionText(PC_TEXT_DEPOSIT_IN_WHICH_BOX); + sPSSData->state = 1; + } + break; + } +} + +static void Cb_ReleaseMon(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + PrintStorageActionText(PC_TEXT_RELEASE_POKE); + ShowYesNoWindow(1); + sPSSData->state++; + // fallthrough + case 1: + switch (Menu_ProcessInputNoWrapClearOnChoose()) + { + case MENU_B_PRESSED: + case 1: + ClearBottomWindow(); + SetPSSCallback(Cb_MainPSS); + break; + case 0: + ClearBottomWindow(); + InitCanRelaseMonVars(); + sub_80CE250(); + sPSSData->state++; + break; + } + break; + case 2: + RunCanReleaseMon(); + if (!sub_80CE2A8()) + { + while (1) + { + s8 r0 = RunCanReleaseMon(); + if (r0 == 1) + { + sPSSData->state++; + break; + } + else if (r0 == 0) + { + sPSSData->state = 8; // Can't release the mon. + break; + } + } + } + break; + case 3: + ReleaseMon(); + RefreshCursorMonData(); + PrintStorageActionText(PC_TEXT_WAS_RELEASED); + sPSSData->state++; + break; + case 4: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + PrintStorageActionText(PC_TEXT_BYE_BYE); + sPSSData->state++; + } + break; + case 5: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + ClearBottomWindow(); + if (sInPartyMenu) + { + CompactPartySlots(); + sub_80CB950(); + sPSSData->state++; + } + else + { + sPSSData->state = 7; + } + } + break; + case 6: + if (!sub_80CB9BC()) + { + sub_80CE00C(); + BoxSetMosaic(); + sub_80CAB20(); + sPSSData->state++; + } + break; + case 7: + SetPSSCallback(Cb_MainPSS); + break; + case 8: + PrintStorageActionText(PC_TEXT_WAS_RELEASED); + sPSSData->state++; + break; + case 9: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + PrintStorageActionText(PC_TEXT_SURPRISE); + sPSSData->state++; + } + break; + case 10: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + ClearBottomWindow(); + sub_80CC064(); + sPSSData->state++; + } + break; + case 11: + if (!sub_80CC0A0()) + { + sub_80CE324(); + PrintStorageActionText(PC_TEXT_CAME_BACK); + sPSSData->state++; + } + break; + case 12: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + PrintStorageActionText(PC_TEXT_WORRIED); + sPSSData->state++; + } + break; + case 13: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + ClearBottomWindow(); + SetPSSCallback(Cb_MainPSS); + } + break; + } +} + +static void Cb_ShowMarkMenu(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + PrintStorageActionText(PC_TEXT_MARK_POKE); + sPSSData->field_DA4.markings = sPSSData->cursorMonMarkings; + sub_811FAA4(sPSSData->cursorMonMarkings, 0xb0, 0x10); + sPSSData->state++; + break; + case 1: + if (!sub_811FBA4()) + { + sub_811FAF8(); + ClearBottomWindow(); + SetMonMarkings(sPSSData->field_DA4.markings); + RefreshCursorMonData(); + SetPSSCallback(Cb_MainPSS); + } + break; + } +} + +static void Cb_TakeItemForMoving(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + if (!ItemIsMail(sPSSData->cursorMonItem)) + { + ClearBottomWindow(); + sPSSData->state++; + } + else + { + SetPSSCallback(Cb_PrintCantStoreMail); + } + break; + case 1: + sub_80CFE54(2); + Item_FromMonToMoving((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetBoxCursorPosition()); + sPSSData->state++; + break; + case 2: + if (!sub_80D1218()) + { + sub_80CFE54(3); + ClearBottomWindow(); + sub_80CE00C(); + PrintCursorMonInfo(); + sPSSData->state++; + } + break; + case 3: + if (!IsDma3ManagerBusyWithBgCopy()) + SetPSSCallback(Cb_MainPSS); + break; + } +} + +static void Cb_GiveMovingItemToMon(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + ClearBottomWindow(); + sPSSData->state++; + break; + case 1: + sub_80CFE54(2); + Item_GiveMovingToMon((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetBoxCursorPosition()); + sPSSData->state++; + break; + case 2: + if (!sub_80D1218()) + { + sub_80CFE54(0); + sub_80CE00C(); + PrintCursorMonInfo(); + PrintStorageActionText(PC_TEXT_ITEM_IS_HELD); + sPSSData->state++; + } + break; + case 3: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + ClearBottomWindow(); + sPSSData->state++; + } + break; + case 4: + if (!IsDma3ManagerBusyWithBgCopy()) + SetPSSCallback(Cb_MainPSS); + break; + } +} + +static void Cb_ItemToBag(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + if (!AddBagItem(sPSSData->cursorMonItem, 1)) + { + PlaySE(SE_HAZURE); + PrintStorageActionText(PC_TEXT_BAG_FULL); + sPSSData->state = 3; + } + else + { + PlaySE(SE_SELECT); + Item_TakeMons((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetBoxCursorPosition()); + sPSSData->state = 1; + } + break; + case 1: + if (!sub_80D1218()) + { + PrintStorageActionText(PC_TEXT_PLACED_IN_BAG); + sPSSData->state = 2; + } + break; + case 2: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + ClearBottomWindow(); + sub_80CE00C(); + PrintCursorMonInfo(); + sPSSData->state = 4; + } + break; + case 4: + if (!IsDma3ManagerBusyWithBgCopy()) + SetPSSCallback(Cb_MainPSS); + break; + case 3: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + ClearBottomWindow(); + SetPSSCallback(Cb_MainPSS); + } + break; + } +} + +static void Cb_SwitchSelectedItem(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + if (!ItemIsMail(sPSSData->cursorMonItem)) + { + ClearBottomWindow(); + sPSSData->state++; + } + else + { + SetPSSCallback(Cb_PrintCantStoreMail); + } + break; + case 1: + sub_80CFE54(2); + Item_SwitchMonsWithMoving((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetBoxCursorPosition()); + sPSSData->state++; + break; + case 2: + if (!sub_80D1218()) + { + sub_80CFE54(3); + sub_80CE00C(); + PrintCursorMonInfo(); + PrintStorageActionText(PC_TEXT_CHANGED_TO_ITEM); + sPSSData->state++; + } + break; + case 3: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + ClearBottomWindow(); + sPSSData->state++; + } + break; + case 4: + if (!IsDma3ManagerBusyWithBgCopy()) + SetPSSCallback(Cb_MainPSS); + break; + } +} + +static void Cb_ShowItemInfo(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + ClearBottomWindow(); + sPSSData->state++; + break; + case 1: + if (!IsDma3ManagerBusyWithBgCopy()) + { + PlaySE(SE_WIN_OPEN); + PrintItemDescription(); + sub_80D1818(); + sPSSData->state++; + } + break; + case 2: + if (!sub_80D184C()) + sPSSData->state++; + break; + case 3: + if (!IsDma3ManagerBusyWithBgCopy()) + sPSSData->state++; + break; + case 4: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + PlaySE(SE_WIN_OPEN); + sPSSData->state++; + } + break; + case 5: + if (!sub_80D18E4()) + sPSSData->state++; + break; + case 6: + if (!IsDma3ManagerBusyWithBgCopy()) + SetPSSCallback(Cb_MainPSS); + break; + } +} + +static void Cb_CloseBoxWhileHoldingItem(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + PlaySE(SE_SELECT); + PrintStorageActionText(PC_TEXT_PUT_IN_BAG); + ShowYesNoWindow(0); + sPSSData->state = 1; + break; + case 1: + switch (Menu_ProcessInputNoWrapClearOnChoose()) + { + case MENU_B_PRESSED: + case 1: + ClearBottomWindow(); + SetPSSCallback(Cb_MainPSS); + break; + case 0: + if (AddBagItem(sPSSData->movingItem, 1) == TRUE) + { + ClearBottomWindow(); + sPSSData->state = 3; + } + else + { + PrintStorageActionText(PC_TEXT_BAG_FULL); + sPSSData->state = 2; + } + break; + } + break; + case 2: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + ClearBottomWindow(); + sPSSData->state = 5; + } + break; + case 3: + sub_80D1194(); + sPSSData->state = 4; + break; + case 4: + if (!sub_80D1218()) + { + sub_80CFE54(0); + SetPSSCallback(Cb_MainPSS); + } + break; + case 5: + if (!IsDma3ManagerBusyWithBgCopy()) + SetPSSCallback(Cb_MainPSS); + break; + } +} + +static void Cb_HandleMovingMonFromParty(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + CompactPartySlots(); + sub_80CB950(); + sPSSData->state++; + break; + case 1: + if (!sub_80CB9BC()) + { + sub_80CAB20(); + SetPSSCallback(Cb_MainPSS); + } + break; + } +} + +static void Cb_PrintCantStoreMail(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + PrintStorageActionText(PC_TEXT_CANT_STORE_MAIL); + sPSSData->state++; + break; + case 1: + if (!IsDma3ManagerBusyWithBgCopy()) + sPSSData->state++; + break; + case 2: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + ClearBottomWindow(); + sPSSData->state++; + } + break; + case 3: + if (!IsDma3ManagerBusyWithBgCopy()) + SetPSSCallback(Cb_MainPSS); + break; + } +} + +static void Cb_HandleBoxOptions(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + PrintStorageActionText(PC_TEXT_WHAT_YOU_DO); + AddMenu(); + sPSSData->state++; + break; + case 1: + if (sub_80D00A8()) + return; + sPSSData->state++; + case 2: + switch (sub_80D00AC()) + { + case -1: + case 0: + sub_80CD1A8(TRUE); + ClearBottomWindow(); + SetPSSCallback(Cb_MainPSS); + break; + case 11: + PlaySE(SE_SELECT); + SetPSSCallback(Cb_NameBox); + break; + case 10: + PlaySE(SE_SELECT); + ClearBottomWindow(); + SetPSSCallback(Cb_HandleWallpapers); + break; + case 9: + PlaySE(SE_SELECT); + ClearBottomWindow(); + SetPSSCallback(Cb_JumpBox); + break; + } + break; + } +} + +static void Cb_HandleWallpapers(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + AddWallpaperSetsMenu(); + PrintStorageActionText(PC_TEXT_PICK_A_THEME); + sPSSData->state++; + break; + case 1: + if (!sub_80D00A8()) + sPSSData->state++; + break; + case 2: + sPSSData->wallpaperSetId = sub_80D00AC(); + switch (sPSSData->wallpaperSetId) + { + case -1: + sub_80CD1A8(TRUE); + ClearBottomWindow(); + SetPSSCallback(Cb_MainPSS); + break; + case 18 ... 21: + PlaySE(SE_SELECT); + sub_80D013C(); + sPSSData->wallpaperSetId -= 18; + sPSSData->state++; + break; + // New wallpaper from Walda. + case 22: + PlaySE(SE_SELECT); + sPSSData->wallpaperId = 16; + sub_80D013C(); + ClearBottomWindow(); + sPSSData->state = 6; + break; + } + break; + case 3: + if (!IsDma3ManagerBusyWithBgCopy()) + { + AddWallpapersMenu(sPSSData->wallpaperSetId); + PrintStorageActionText(PC_TEXT_PICK_A_WALLPAPER); + sPSSData->state++; + } + break; + case 4: + sPSSData->wallpaperId = sub_80D00AC(); + switch (sPSSData->wallpaperId) + { + case -2: + break; + case -1: + ClearBottomWindow(); + sPSSData->state = 0; + break; + default: + PlaySE(SE_SELECT); + ClearBottomWindow(); + sPSSData->wallpaperId -= 23; + SetWallpaperForCurrentBox(sPSSData->wallpaperId); + sPSSData->state++; + break; + } + break; + case 5: + if (!DoWallpaperGfxChange()) + { + sub_80CD1A8(TRUE); + SetPSSCallback(Cb_MainPSS); + } + break; + case 6: + if (!IsDma3ManagerBusyWithBgCopy()) + { + SetWallpaperForCurrentBox(sPSSData->wallpaperId); + sPSSData->state = 5; + } + break; + } +} + +static void Cb_JumpBox(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + PrintStorageActionText(PC_TEXT_JUMP_TO_WHICH_BOX); + sub_80C77E8(&sPSSData->field_1E5C, TAG_TILE_A, TAG_PAL_DAC7, 3, FALSE); + sub_80C78D4(StorageGetCurrentBox()); + sPSSData->state++; + break; + case 1: + sPSSData->newCurrBoxId = HandleBoxChooseSelectionInput(); + switch (sPSSData->newCurrBoxId) + { + case 200: + break; + default: + ClearBottomWindow(); + sub_80C78E4(); + sub_80C7890(); + if (sPSSData->newCurrBoxId == 201 || sPSSData->newCurrBoxId == StorageGetCurrentBox()) + { + sub_80CD1A8(TRUE); + SetPSSCallback(Cb_MainPSS); + } + else + { + sPSSData->state++; + } + break; + } + break; + case 2: + SetUpScrollToBox(sPSSData->newCurrBoxId); + sPSSData->state++; + break; + case 3: + if (!ScrollToBox()) + { + SetCurrentBox(sPSSData->newCurrBoxId); + SetPSSCallback(Cb_MainPSS); + } + break; + } +} + +static void Cb_NameBox(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + sub_80CE760(); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + sPSSData->state++; + break; + case 1: + if (!UpdatePaletteFade()) + { + sWhichToReshow = 1; + sPSSData->screenChangeType = SCREEN_CHANGE_NAME_BOX; + SetPSSCallback(Cb_ChangeScreen); + } + break; + } +} + +static void Cb_ShowMonSummary(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + sub_80CE7E8(); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + sPSSData->state++; + break; + case 1: + if (!UpdatePaletteFade()) + { + sWhichToReshow = 0; + sPSSData->screenChangeType = SCREEN_CHANGE_SUMMARY_SCREEN; + SetPSSCallback(Cb_ChangeScreen); + } + break; + } +} + +static void Cb_GiveItemFromBag(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + sPSSData->state++; + break; + case 1: + if (!UpdatePaletteFade()) + { + sWhichToReshow = 2; + sPSSData->screenChangeType = SCREEN_CHANGE_ITEM_FROM_BAG; + SetPSSCallback(Cb_ChangeScreen); + } + break; + } +} + +static void Cb_OnCloseBoxPressed(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + if (IsMonBeingMoved()) + { + PlaySE(SE_HAZURE); + PrintStorageActionText(PC_TEXT_HOLDING_POKE); + sPSSData->state = 1; + } + else if (IsActiveItemMoving()) + { + SetPSSCallback(Cb_CloseBoxWhileHoldingItem); + } + else + { + PlaySE(SE_SELECT); + PrintStorageActionText(PC_TEXT_EXIT_BOX); + ShowYesNoWindow(0); + sPSSData->state = 2; + } + break; + case 1: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + ClearBottomWindow(); + SetPSSCallback(Cb_MainPSS); + } + break; + case 2: + switch (Menu_ProcessInputNoWrapClearOnChoose()) + { + case MENU_B_PRESSED: + case 1: + ClearBottomWindow(); + SetPSSCallback(Cb_MainPSS); + break; + case 0: + PlaySE(SE_PC_OFF); + ClearBottomWindow(); + sPSSData->state++; + break; + } + break; + case 3: + sub_80F9BF4(0x14, 0, 1); + sPSSData->state++; + break; + case 4: + if (!sub_80F9C30()) + { + sub_80CABE0(); + gPlayerPartyCount = CalculatePlayerPartyCount(); + sPSSData->screenChangeType = SCREEN_CHANGE_EXIT_BOX; + SetPSSCallback(Cb_ChangeScreen); + } + break; + } +} + +static void Cb_OnBPressed(u8 taskId) +{ + switch (sPSSData->state) + { + case 0: + if (IsMonBeingMoved()) + { + PlaySE(SE_HAZURE); + PrintStorageActionText(PC_TEXT_HOLDING_POKE); + sPSSData->state = 1; + } + else if (IsActiveItemMoving()) + { + SetPSSCallback(Cb_CloseBoxWhileHoldingItem); + } + else + { + PlaySE(SE_SELECT); + PrintStorageActionText(PC_TEXT_CONTINUE_BOX); + ShowYesNoWindow(0); + sPSSData->state = 2; + } + break; + case 1: + if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) + { + ClearBottomWindow(); + SetPSSCallback(Cb_MainPSS); + } + break; + case 2: + switch (Menu_ProcessInputNoWrapClearOnChoose()) + { + case 0: + ClearBottomWindow(); + SetPSSCallback(Cb_MainPSS); + break; + case 1: + case MENU_B_PRESSED: + PlaySE(SE_PC_OFF); + ClearBottomWindow(); + sPSSData->state++; + break; + } + break; + case 3: + sub_80F9BF4(0x14, 0, 0); + sPSSData->state++; + break; + case 4: + if (!sub_80F9C30()) + { + sub_80CABE0(); + gPlayerPartyCount = CalculatePlayerPartyCount(); + sPSSData->screenChangeType = SCREEN_CHANGE_EXIT_BOX; + SetPSSCallback(Cb_ChangeScreen); + } + break; + } +} + +static void Cb_ChangeScreen(u8 taskId) +{ + struct BoxPokemon *boxMons; + u8 mode, monIndex, maxMonIndex; + u8 screenChangeType = sPSSData->screenChangeType; + + if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS && IsActiveItemMoving() == TRUE) + gUnknown_02039D12 = GetMovingItem(); + else + gUnknown_02039D12 = 0; + + switch (screenChangeType) + { + case SCREEN_CHANGE_EXIT_BOX: + default: + FreePSSData(); + SetMainCallback2(Cb2_ExitPSS); + break; + case SCREEN_CHANGE_SUMMARY_SCREEN: + boxMons = sPSSData->field_218C.box; + monIndex = sPSSData->field_2187; + maxMonIndex = sPSSData->field_2186; + mode = sPSSData->field_2188; + FreePSSData(); + if (mode == PSS_MODE_NORMAL && boxMons == &gUnknown_02039D14.box) + ShowPokemonSummaryScreenSet40EF(mode, boxMons, monIndex, maxMonIndex, Cb2_ReturnToPSS); + else + ShowPokemonSummaryScreen(mode, boxMons, monIndex, maxMonIndex, Cb2_ReturnToPSS); + break; + case SCREEN_CHANGE_NAME_BOX: + FreePSSData(); + DoNamingScreen(NAMING_SCREEN_BOX, GetBoxNamePtr(StorageGetCurrentBox()), 0, 0, 0, Cb2_ReturnToPSS); + break; + case SCREEN_CHANGE_ITEM_FROM_BAG: + FreePSSData(); + GoToBagMenu(11, 0, Cb2_ReturnToPSS); + break; + } + + DestroyTask(taskId); +} + +static void GiveChosenBagItem(void) +{ + u16 item = gSpecialVar_ItemId; + + if (item != 0) + { + u8 id = GetBoxCursorPosition(); + + if (sInPartyMenu) + SetMonData(&gPlayerParty[id], MON_DATA_HELD_ITEM, &item); + else + SetCurrentBoxMonData(id, MON_DATA_HELD_ITEM, &item); + + RemoveBagItem(item, 1); + } +} + +static void FreePSSData(void) +{ + sub_80D25F0(); + sub_80D01B8(); + FREE_AND_SET_NULL(sPSSData); + FreeAllWindowBuffers(); +} + +static void SetScrollingBackground(void) +{ + SetGpuReg(REG_OFFSET_BG3CNT, BGCNT_PRIORITY(3) | BGCNT_CHARBASE(3) | BGCNT_16COLOR | BGCNT_SCREENBASE(31)); + DecompressAndLoadBgGfxUsingHeap(3, gPokemonStorageScrollingBGTileset, 0, 0, 0); + LZ77UnCompVram(gPokemonStorageScrollingBGTilemap, (void *)VRAM + 0xF800); +} + +static void ScrollBackground(void) +{ + ChangeBgX(3, 128, 1); + ChangeBgY(3, 128, 2); +} + +static void LoadPSSMenuGfx(void) +{ + InitBgsFromTemplates(0, gUnknown_08572734, ARRAY_COUNT(gUnknown_08572734)); + DecompressAndLoadBgGfxUsingHeap(1, gPSSMenu_Gfx, 0, 0, 0); + LZ77UnCompWram(gUnknown_085722A0, sPSSData->field_5AC4); + SetBgTilemapBuffer(1, sPSSData->field_5AC4); + ShowBg(1); + schedule_bg_copy_tilemap_to_vram(1); +} + +static bool8 InitPSSWindows(void) +{ + if (!InitWindows(gUnknown_08572714)) + { + return FALSE; + } + else + { + DeactivateAllTextPrinters(); + return TRUE; + } +} + +static void LoadWaveformSpritePalette(void) +{ + LoadSpritePalette(&gWaveformSpritePalette); +} + +static void sub_80CA0D8(void) +{ + LoadPalette(gUnknown_085723DC, 0, 0x20); + LoadPalette(gUnknown_085723FC, 0x20, 0x20); + LoadPalette(gUnknown_085726F4, 0xF0, 0x20); + if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + LoadPalette(gUnknown_0857241C, 0x30, 0x20); + else + LoadPalette(gUnknown_0857243C, 0x30, 0x20); + + SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(1) | BGCNT_CHARBASE(1) | BGCNT_16COLOR | BGCNT_SCREENBASE(30)); + LoadCursorMonSprite(); + sub_80CA154(); + sub_80CA1C4(); + RefreshCursorMonData(); +} + +static void sub_80CA154(void) +{ + sPSSData->field_D94 = sub_811FFB4(TAG_TILE_10, TAG_PAL_DAC8, NULL); + sPSSData->field_D94->oam.priority = 1; + sPSSData->field_D94->subpriority = 1; + sPSSData->field_D94->pos1.x = 40; + sPSSData->field_D94->pos1.y = 150; + sPSSData->field_DA0 = (void*) OBJ_VRAM0 + 32 * GetSpriteTileStartByTag(TAG_TILE_10); +} + +static void sub_80CA1C4(void) +{ + u16 i; + struct SpriteSheet sheet = gWaveformSpriteSheet; + + LoadSpriteSheet(&sheet); + for (i = 0; i < 2; i++) + { + u8 spriteId = CreateSprite(&sSpriteTemplate_Waveform, i * 63 + 8, 9, 2); + sPSSData->field_D98[i] = &gSprites[spriteId]; + } +} + +static void RefreshCursorMonData(void) +{ + LoadCursorMonGfx(sPSSData->cursorMonSpecies, sPSSData->cursorMonPersonality); + PrintCursorMonInfo(); + sub_80CA65C(); + schedule_bg_copy_tilemap_to_vram(0); +} + +static void BoxSetMosaic(void) +{ + RefreshCursorMonData(); + if (sPSSData->cursorMonSprite) + { + sPSSData->cursorMonSprite->oam.mosaic = TRUE; + sPSSData->cursorMonSprite->data[0] = 10; + sPSSData->cursorMonSprite->data[1] = 1; + sPSSData->cursorMonSprite->callback = sub_80CA2D0; + SetGpuReg(REG_OFFSET_MOSAIC, (sPSSData->cursorMonSprite->data[0] << 12) | (sPSSData->cursorMonSprite->data[0] << 8)); + } +} + +static u8 sub_80CA2B8(void) +{ + return sPSSData->cursorMonSprite->oam.mosaic; +} + +static void sub_80CA2D0(struct Sprite *sprite) +{ + sprite->data[0] -= sprite->data[1]; + if (sprite->data[0] < 0) + sprite->data[0] = 0; + SetGpuReg(REG_OFFSET_MOSAIC, (sprite->data[0] << 12) | (sprite->data[0] << 8)); + if (sprite->data[0] == 0) + { + sprite->oam.mosaic = FALSE; + sprite->callback = SpriteCallbackDummy; + } +} + +static void LoadCursorMonSprite(void) +{ + u16 i; + u16 tileStart; + u8 palSlot; + u8 spriteId; + struct SpriteSheet sheet = {sPSSData->field_22C4, 0x800, TAG_TILE_2}; + struct SpritePalette palette = {sPSSData->field_2244, TAG_PAL_DAC6}; + struct SpriteTemplate template = sSpriteTemplate_CursorMon; + + for (i = 0; i < 0x800; i++) + sPSSData->field_22C4[i] = 0; + for (i = 0; i < 0x10; i++) + sPSSData->field_2244[i] = 0; + + sPSSData->cursorMonSprite = NULL; + + do + { + tileStart = LoadSpriteSheet(&sheet); + if (tileStart == 0) + break; + + palSlot = LoadSpritePalette(&palette); + if (palSlot == 0xFF) + break; + + spriteId = CreateSprite(&template, 40, 48, 0); + if (spriteId == MAX_SPRITES) + break; + + sPSSData->cursorMonSprite = &gSprites[spriteId]; + sPSSData->field_223A = palSlot * 16 + 0x100; + sPSSData->field_223C = (void*) OBJ_VRAM0 + tileStart * 32; + } while (0); + + if (sPSSData->cursorMonSprite == NULL) + { + FreeSpriteTilesByTag(TAG_TILE_2); + FreeSpritePaletteByTag(TAG_PAL_DAC6); + } +} + +static void LoadCursorMonGfx(u16 species, u32 pid) +{ + if (sPSSData->cursorMonSprite == NULL) + return; + + if (species != SPECIES_NONE) + { + LoadSpecialPokePic(&gMonFrontPicTable[species], sPSSData->field_22C4, species, pid, TRUE); + LZ77UnCompWram(sPSSData->cursorMonPalette, sPSSData->field_2244); + CpuCopy32(sPSSData->field_22C4, sPSSData->field_223C, 0x800); + LoadPalette(sPSSData->field_2244, sPSSData->field_223A, 0x20); + sPSSData->cursorMonSprite->invisible = FALSE; + } + else + { + sPSSData->cursorMonSprite->invisible = TRUE; + } +} + +static void PrintCursorMonInfo(void) +{ + FillWindowPixelBuffer(0, 0x11); + if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + { + AddTextPrinterParameterized(0, 1, sPSSData->cursorMonNickText, 6, 0, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 2, sPSSData->cursorMonSpeciesName, 6, 15, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 2, sPSSData->cursorMonGenderLvlText, 10, 29, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 0, sPSSData->cursorMonItemName, 6, 43, TEXT_SPEED_FF, NULL); + } + else + { + AddTextPrinterParameterized(0, 0, sPSSData->cursorMonItemName, 6, 0, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 1, sPSSData->cursorMonNickText, 6, 13, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 2, sPSSData->cursorMonSpeciesName, 6, 28, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 2, sPSSData->cursorMonGenderLvlText, 10, 42, TEXT_SPEED_FF, NULL); + } + + CopyWindowToVram(0, 2); + if (sPSSData->cursorMonSpecies != SPECIES_NONE) + { + sub_8120084(sPSSData->cursorMonMarkings, sPSSData->field_DA0); + sPSSData->field_D94->invisible = FALSE; + } + else + { + sPSSData->field_D94->invisible = TRUE; + } +} + +static void sub_80CA65C(void) +{ + u16 i; + + if (sPSSData->cursorMonSpecies != SPECIES_NONE) + { + sub_80D27AC(0, 0, 0, 8, 2); + for (i = 0; i < 2; i++) + StartSpriteAnimIfDifferent(sPSSData->field_D98[i], i * 2 + 1); + } + else + { + sub_80D27AC(0, 0, 2, 8, 2); + for (i = 0; i < 2; i++) + StartSpriteAnim(sPSSData->field_D98[i], i * 2); + } + + sub_80D2918(0); + schedule_bg_copy_tilemap_to_vram(1); +} + +static void sub_80CA704(void) +{ + LZ77UnCompWram(gUnknown_08DD36C8, sPSSData->field_B0); + LoadPalette(gPSSMenu_Pal, 0x10, 0x20); + sub_80D2644(1, 1, sPSSData->field_B0, 12, 22); + sub_80D2644(2, 1, gUnknown_0857245C, 9, 4); + sub_80D2770(1, 10, 0); + sub_80D2770(2, 21, 0); + sub_80CAA74(); + if (sInPartyMenu) + { + sub_80CA984(TRUE); + CreatePartyMonsSprites(TRUE); + sub_80D2918(2); + sub_80D2918(1); + } + else + { + sub_80D27AC(1, 0, 20, 12, 2); + sub_80CA984(TRUE); + sub_80D2918(1); + sub_80D2918(2); + } + + schedule_bg_copy_tilemap_to_vram(1); + sPSSData->unk_02C7 = 0; +} + +static void SetUpShowPartyMenu(void) +{ + sPSSData->field_2C0 = 20; + sPSSData->field_2C2 = 2; + sPSSData->field_2C5 = 0; + CreatePartyMonsSprites(FALSE); +} + +static bool8 ShowPartyMenu(void) +{ + if (sPSSData->field_2C5 == 20) + return FALSE; + + sPSSData->field_2C0--; + sPSSData->field_2C2++; + sub_80D27F4(1, 3, 1); + sub_80D2918(1); + schedule_bg_copy_tilemap_to_vram(1); + sub_80CBAF0(8); + if (++sPSSData->field_2C5 == 20) + { + sInPartyMenu = TRUE; + return FALSE; + } + else + { + return TRUE; + } +} + +static void SetUpHidePartyMenu(void) +{ + sPSSData->field_2C0 = 0; + sPSSData->field_2C2 = 22; + sPSSData->field_2C5 = 0; + if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + sub_80D11CC(); +} + +static bool8 HidePartyMenu(void) +{ + if (sPSSData->field_2C5 != 20) + { + sPSSData->field_2C0++; + sPSSData->field_2C2--; + sub_80D27F4(1, 3, -1); + sub_80D2918(1); + FillBgTilemapBufferRect_Palette0(1, 0x100, 10, sPSSData->field_2C2, 12, 1); + sub_80CBAF0(-8); + if (++sPSSData->field_2C5 != 20) + { + schedule_bg_copy_tilemap_to_vram(1); + return TRUE; + } + else + { + sInPartyMenu = FALSE; + DestroyAllPartyMonIcons(); + CompactPartySlots(); + sub_80D27AC(2, 0, 0, 9, 2); + sub_80D2918(2); + schedule_bg_copy_tilemap_to_vram(1); + return FALSE; + } + } + + return FALSE; +} + +static void sub_80CA984(bool8 arg0) +{ + if (arg0) + sub_80D27AC(2, 0, 0, 9, 2); + else + sub_80D27AC(2, 0, 2, 9, 2); + + sub_80D2918(2); + schedule_bg_copy_tilemap_to_vram(1); +} + +static void sub_80CA9C0(void) +{ + sPSSData->unk_02C7 = 1; + sPSSData->unk_02C8 = 30; + sPSSData->unk_02C9 = TRUE; +} + +static void sub_80CA9EC(void) +{ + if (sPSSData->unk_02C7) + { + sPSSData->unk_02C7 = 0; + sub_80CA984(TRUE); + } +} + +static void sub_80CAA14(void) +{ + if (sPSSData->unk_02C7 && ++sPSSData->unk_02C8 > 30) + { + sPSSData->unk_02C8 = 0; + sPSSData->unk_02C9 = (sPSSData->unk_02C9 == FALSE); + sub_80CA984(sPSSData->unk_02C9); + } +} + +static void sub_80CAA74(void) +{ + u8 i; + + for (i = 1; i < PARTY_SIZE; i++) + { + s32 species = GetMonData(gPlayerParty + i, MON_DATA_SPECIES); + sub_80CAAA8(i, (species != SPECIES_NONE)); + } +} + +static void sub_80CAAA8(u8 arg0, bool8 isPartyMon) +{ + u16 i, j, index; + const u16 *data; + + if (isPartyMon) + data = gUnknown_085724A4; + else + data = gUnknown_085724BC; + + index = 3 * (3 * (arg0 - 1) + 1); + index *= 4; + index += 7; + for (i = 0; i < 3; i++) + { + for (j = 0; j < 4; j++) + { + sPSSData->field_B0[index + j] = data[j]; + } + data += 4; + index += 12; + } +} + +static void sub_80CAB20(void) +{ + sub_80CAA74(); + sub_80D27AC(1, 0, 0, 12, 22); + sub_80D2918(1); + schedule_bg_copy_tilemap_to_vram(1); +} + +static void SetUpDoShowPartyMenu(void) +{ + sPSSData->showPartyMenuState = 0; + PlaySE(SE_WIN_OPEN); + SetUpShowPartyMenu(); +} + +static bool8 DoShowPartyMenu(void) +{ + switch (sPSSData->showPartyMenuState) + { + case 0: + if (!ShowPartyMenu()) + { + sub_80CDBA0(); + sPSSData->showPartyMenuState++; + } + break; + case 1: + if (!sub_80CD554()) + { + if (sPSSData->setMosaic) + BoxSetMosaic(); + sPSSData->showPartyMenuState++; + } + break; + case 2: + return FALSE; + } + return TRUE; +} + +static void sub_80CABE0(void) +{ + if (gUnknown_02039D10 != StorageGetCurrentBox()) + { + FlagClear(FLAG_SYS_STORAGE_UNKNOWN_FLAG); + VarSet(VAR_STORAGE_UNKNOWN, StorageGetCurrentBox()); + } +} + +static void sub_80CAC1C(void) +{ + SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(29)); + LoadUserWindowBorderGfx(1, 2, 208); + FillBgTilemapBufferRect(0, 0, 0, 0, 32, 20, 17); + CopyBgTilemapBufferToVram(0); +} + +static void PrintStorageActionText(u8 id) +{ + u8 *txtPtr; + + DynamicPlaceholderTextUtil_Reset(); + switch (gPCStorageActionTexts[id].format) + { + case PC_TEXT_FMT_NORMAL: + break; + case PC_TEXT_FMT_MON_NAME_1: + case PC_TEXT_FMT_MON_NAME_2: + case PC_TEXT_FMT_MON_NAME_3: + DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sPSSData->cursorMonNick); + break; + case PC_TEXT_FMT_MON_NAME_4: + case PC_TEXT_FMT_MON_NAME_5: + case PC_TEXT_FMT_MON_NAME_6: + DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sPSSData->field_21E0); + break; + case PC_TEXT_FMT_ITEM_NAME: + if (IsActiveItemMoving()) + txtPtr = StringCopy(sPSSData->itemName, GetMovingItemName()); + else + txtPtr = StringCopy(sPSSData->itemName, sPSSData->cursorMonItemName); + + while (*(txtPtr - 1) == CHAR_SPACE) + txtPtr--; + + *txtPtr = EOS; + DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sPSSData->itemName); + break; + } + + DynamicPlaceholderTextUtil_ExpandPlaceholders(sPSSData->field_2190, gPCStorageActionTexts[id].text); + FillWindowPixelBuffer(1, 0x11); + AddTextPrinterParameterized(1, 1, sPSSData->field_2190, 0, 1, TEXT_SPEED_FF, NULL); + sub_8098858(1, 2, 14); + PutWindowTilemap(1); + CopyWindowToVram(1, 2); + schedule_bg_copy_tilemap_to_vram(0); +} + +static void ShowYesNoWindow(s8 cursorPos) +{ + CreateYesNoMenu(&sYesNoWindowTemplate, 11, 14, 0); + Menu_MoveCursorNoWrapAround(cursorPos); +} + +static void ClearBottomWindow(void) +{ + sub_8198070(1, FALSE); + schedule_bg_copy_tilemap_to_vram(0); +} + +static void AddWallpaperSetsMenu(void) +{ + InitMenu(); + SetMenuText(18); + SetMenuText(19); + SetMenuText(20); + SetMenuText(21); + if (IsWaldaWallpaperUnlocked()) + SetMenuText(22); + AddMenu(); +} + +static void AddWallpapersMenu(u8 wallpaperSet) +{ + InitMenu(); + switch (wallpaperSet) + { + case 0: + SetMenuText(23); + SetMenuText(24); + SetMenuText(25); + SetMenuText(26); + break; + case 1: + SetMenuText(27); + SetMenuText(28); + SetMenuText(29); + SetMenuText(30); + break; + case 2: + SetMenuText(31); + SetMenuText(32); + SetMenuText(33); + SetMenuText(34); + break; + case 3: + SetMenuText(35); + SetMenuText(36); + SetMenuText(37); + SetMenuText(38); + break; + } + AddMenu(); +} + +static u8 GetCurrentBoxOption(void) +{ + return sCurrentBoxOption; +} + +static void sub_80CAEAC(void) +{ + if (!IsCursorOnBox()) + { + if (sInPartyMenu) + sub_80D0D8C(CURSOR_AREA_IN_PARTY, GetBoxCursorPosition()); + else + sub_80D0D8C(CURSOR_AREA_IN_BOX, GetBoxCursorPosition()); + } + + if (gUnknown_02039D12 != 0) + { + sub_80D0F38(gUnknown_02039D12); + sub_80CFE54(3); + } +} + +static void sub_80CAF04(void) +{ + u16 i; + + LoadMonIconPalettes(); + for (i = 0; i < 40; i++) + sPSSData->field_B08[i] = 0; + for (i = 0; i < 40; i++) + sPSSData->field_B58[i] = 0; + for (i = 0; i < PARTY_SIZE; i++) + sPSSData->partySprites[i] = NULL; + for (i = 0; i < IN_BOX_COUNT; i++) + sPSSData->boxMonsSprites[i] = NULL; + + sPSSData->movingMonSprite = NULL; + sPSSData->field_78C = 0; +} + +static u8 sub_80CAFAC(void) +{ + return (IsCursorInBox() ? 2 : 1); +} + +static void CreateMovingMonIcon(void) +{ + u32 personality = GetMonData(&sPSSData->movingMon, MON_DATA_PERSONALITY); + u16 species = GetMonData(&sPSSData->movingMon, MON_DATA_SPECIES2); + u8 priority = sub_80CAFAC(); + + sPSSData->movingMonSprite = CreateMonIconSprite(species, personality, 0, 0, priority, 7); + sPSSData->movingMonSprite->callback = sub_80CC100; +} + +static void sub_80CB028(u8 boxId) +{ + u8 boxPosition; + u16 i, j, count; + u16 species; + u32 personality; + + count = 0; + boxPosition = 0; + for (i = 0; i < IN_BOX_COLUMNS; i++) + { + for (j = 0; j < IN_BOX_ROWS; j++) + { + species = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_SPECIES2); + if (species != SPECIES_NONE) + { + personality = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_PERSONALITY); + sPSSData->boxMonsSprites[count] = CreateMonIconSprite(species, personality, 8 * (3 * j) + 100, 8 * (3 * i) + 44, 2, 19 - j); + } + else + { + sPSSData->boxMonsSprites[count] = NULL; + } + boxPosition++; + count++; + } + } + + if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + { + for (boxPosition = 0; boxPosition < IN_BOX_COUNT; boxPosition++) + { + if (GetBoxMonDataAt(boxId, boxPosition, MON_DATA_HELD_ITEM) == 0) + sPSSData->boxMonsSprites[boxPosition]->oam.objMode = 1; + } + } +} + +static void sub_80CB140(u8 boxPosition) +{ + u16 species = GetCurrentBoxMonData(boxPosition, MON_DATA_SPECIES2); + + if (species != SPECIES_NONE) + { + s16 x = 8 * (3 * (boxPosition % IN_BOX_ROWS)) + 100; + s16 y = 8 * (3 * (boxPosition / IN_BOX_ROWS)) + 44; + u32 personality = GetCurrentBoxMonData(boxPosition, MON_DATA_PERSONALITY); + + sPSSData->boxMonsSprites[boxPosition] = CreateMonIconSprite(species, personality, x, y, 2, 19 - (boxPosition % IN_BOX_ROWS)); + if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + sPSSData->boxMonsSprites[boxPosition]->oam.objMode = 1; + } +} + +static void sub_80CB1F0(s16 arg0) +{ + u16 i; + + for (i = 0; i < IN_BOX_COUNT; i++) + { + if (sPSSData->boxMonsSprites[i] != NULL) + { + sPSSData->boxMonsSprites[i]->data[2] = arg0; + sPSSData->boxMonsSprites[i]->data[4] = 1; + sPSSData->boxMonsSprites[i]->callback = sub_80CB278; + } + } +} + +static void sub_80CB234(struct Sprite *sprite) +{ + if (sprite->data[1] != 0) + { + sprite->data[1]--; + sprite->pos1.x += sprite->data[2]; + } + else + { + sPSSData->field_C66--; + sprite->pos1.x = sprite->data[3]; + sprite->callback = SpriteCallbackDummy; + } +} + +static void sub_80CB278(struct Sprite *sprite) +{ + if (sprite->data[4] != 0) + { + sprite->data[4]--; + } + else + { + sprite->pos1.x += sprite->data[2]; + sprite->data[5] = sprite->pos1.x + sprite->pos2.x; + if (sprite->data[5] <= 68 || sprite->data[5] >= 252) + sprite->callback = SpriteCallbackDummy; + } +} + +static void DestroyAllIconsInRow(u8 row) +{ + u16 column; + u8 boxPosition = row; + + for (column = 0; column < IN_BOX_COLUMNS; column++) + { + if (sPSSData->boxMonsSprites[boxPosition] != NULL) + { + DestroyBoxMonIcon(sPSSData->boxMonsSprites[boxPosition]); + sPSSData->boxMonsSprites[boxPosition] = NULL; + } + boxPosition += IN_BOX_ROWS; + } +} + +static u8 sub_80CB2F8(u8 row, u16 times, s16 xDelta) +{ + s32 i; + u16 y = 44; + s16 xDest = 8 * (3 * row) + 100; + u16 x = xDest - ((times + 1) * xDelta); + u8 subpriority = 19 - row; + u8 count = 0; + u8 boxPosition = row; + + if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + { + for (i = 0; i < IN_BOX_COLUMNS; i++) + { + if (sPSSData->boxSpecies[boxPosition] != SPECIES_NONE) + { + sPSSData->boxMonsSprites[boxPosition] = CreateMonIconSprite(sPSSData->boxSpecies[boxPosition], + sPSSData->boxPersonalities[boxPosition], + x, y, 2, subpriority); + if (sPSSData->boxMonsSprites[boxPosition] != NULL) + { + sPSSData->boxMonsSprites[boxPosition]->data[1] = times; + sPSSData->boxMonsSprites[boxPosition]->data[2] = xDelta; + sPSSData->boxMonsSprites[boxPosition]->data[3] = xDest; + sPSSData->boxMonsSprites[boxPosition]->callback = sub_80CB234; + count++; + } + } + boxPosition += IN_BOX_ROWS; + y += 24; + } + } + else + { + for (i = 0; i < IN_BOX_COLUMNS; i++) + { + if (sPSSData->boxSpecies[boxPosition] != SPECIES_NONE) + { + sPSSData->boxMonsSprites[boxPosition] = CreateMonIconSprite(sPSSData->boxSpecies[boxPosition], + sPSSData->boxPersonalities[boxPosition], + x, y, 2, subpriority); + if (sPSSData->boxMonsSprites[boxPosition] != NULL) + { + sPSSData->boxMonsSprites[boxPosition]->data[1] = times; + sPSSData->boxMonsSprites[boxPosition]->data[2] = xDelta; + sPSSData->boxMonsSprites[boxPosition]->data[3] = xDest; + sPSSData->boxMonsSprites[boxPosition]->callback = sub_80CB234; + if (GetBoxMonDataAt(sPSSData->field_C5C, boxPosition, MON_DATA_HELD_ITEM) == 0) + sPSSData->boxMonsSprites[boxPosition]->oam.objMode = 1; + count++; + } + } + boxPosition += IN_BOX_ROWS; + y += 24; + } + } + + return count; +} + +static void sub_80CB4CC(u8 boxId, s8 direction) +{ + sPSSData->field_C6A = 0; + sPSSData->field_C6B = boxId; + sPSSData->field_C69 = direction; + sPSSData->field_C60 = 32; + sPSSData->field_C64 = -(6 * direction); + sPSSData->field_C66 = 0; + SetBoxSpeciesAndPersonalities(boxId); + if (direction > 0) + sPSSData->field_C68 = 0; + else + sPSSData->field_C68 = IN_BOX_ROWS - 1; + + sPSSData->field_C62 = (24 * sPSSData->field_C68) + 100; + sub_80CB1F0(sPSSData->field_C64); +} + +static bool8 sub_80CB584(void) +{ + if (sPSSData->field_C60 != 0) + sPSSData->field_C60--; + + switch (sPSSData->field_C6A) + { + case 0: + sPSSData->field_C62 += sPSSData->field_C64; + if (sPSSData->field_C62 <= 64 || sPSSData->field_C62 >= 252) + { + DestroyAllIconsInRow(sPSSData->field_C68); + sPSSData->field_C62 += sPSSData->field_C69 * 24; + sPSSData->field_C6A++; + } + break; + case 1: + sPSSData->field_C62 += sPSSData->field_C64; + sPSSData->field_C66 += sub_80CB2F8(sPSSData->field_C68, sPSSData->field_C60, sPSSData->field_C64); + if ((sPSSData->field_C69 > 0 && sPSSData->field_C68 == IN_BOX_ROWS - 1) + || (sPSSData->field_C69 < 0 && sPSSData->field_C68 == 0)) + { + sPSSData->field_C6A++; + } + else + { + sPSSData->field_C68 += sPSSData->field_C69; + sPSSData->field_C6A = 0; + } + break; + case 2: + if (sPSSData->field_C66 == 0) + { + sPSSData->field_C60++; + return FALSE; + } + break; + default: + return FALSE; + } + + return TRUE; +} + +static void SetBoxSpeciesAndPersonalities(u8 boxId) +{ + s32 i, j, boxPosition; + + boxPosition = 0; + for (i = 0; i < IN_BOX_COLUMNS; i++) + { + for (j = 0; j < IN_BOX_ROWS; j++) + { + sPSSData->boxSpecies[boxPosition] = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_SPECIES2); + if (sPSSData->boxSpecies[boxPosition] != SPECIES_NONE) + sPSSData->boxPersonalities[boxPosition] = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_PERSONALITY); + boxPosition++; + } + } + + sPSSData->field_C5C = boxId; +} + +static void DestroyBoxMonIconAtPosition(u8 boxPosition) +{ + if (sPSSData->boxMonsSprites[boxPosition] != NULL) + { + DestroyBoxMonIcon(sPSSData->boxMonsSprites[boxPosition]); + sPSSData->boxMonsSprites[boxPosition] = NULL; + } +} + +static void SetBoxMonIconObjMode(u8 boxPosition, u8 objMode) +{ + if (sPSSData->boxMonsSprites[boxPosition] != NULL) + { + sPSSData->boxMonsSprites[boxPosition]->oam.objMode = objMode; + } +} + +static void CreatePartyMonsSprites(bool8 arg0) +{ + u16 i, count; + u16 species = GetMonData(&gPlayerParty[0], MON_DATA_SPECIES2); + u32 personality = GetMonData(&gPlayerParty[0], MON_DATA_PERSONALITY); + + sPSSData->partySprites[0] = CreateMonIconSprite(species, personality, 104, 64, 1, 12); + count = 1; + for (i = 1; i < PARTY_SIZE; i++) + { + species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2); + if (species != SPECIES_NONE) + { + personality = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY); + sPSSData->partySprites[i] = CreateMonIconSprite(species, personality, 152, 8 * (3 * (i - 1)) + 16, 1, 12); + count++; + } + else + { + sPSSData->partySprites[i] = NULL; + } + } + + if (!arg0) + { + for (i = 0; i < count; i++) + { + sPSSData->partySprites[i]->pos1.y -= 160; + sPSSData->partySprites[i]->invisible = TRUE; + } + } + + if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + { + for (i = 0; i < PARTY_SIZE; i++) + { + if (sPSSData->partySprites[i] != NULL && GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM) == 0) + sPSSData->partySprites[i]->oam.objMode = 1; + } + } +} + +static void sub_80CB950(void) +{ + u16 i, count; + + sPSSData->field_C5E = 0; + for (i = 0, count = 0; i < PARTY_SIZE; i++) + { + if (sPSSData->partySprites[i] != NULL) + { + if (i != count) + { + sub_80CB9D0(sPSSData->partySprites[i], count); + sPSSData->partySprites[i] = NULL; + sPSSData->field_C5E++; + } + count++; + } + } +} + +static u8 sub_80CB9BC(void) +{ + return sPSSData->field_C5E; +} + +static void sub_80CB9D0(struct Sprite *sprite, u16 partyId) +{ + s16 x, y; + + sprite->data[1] = partyId; + if (partyId == 0) + x = 104, y = 64; + else + x = 152, y = 8 * (3 * (partyId - 1)) + 16; + + sprite->data[2] = (u16)(sprite->pos1.x) * 8; + sprite->data[3] = (u16)(sprite->pos1.y) * 8; + sprite->data[4] = ((x * 8) - sprite->data[2]) / 8; + sprite->data[5] = ((y * 8) - sprite->data[3]) / 8; + sprite->data[6] = 8; + sprite->callback = sub_80CBA3C; +} + +static void sub_80CBA3C(struct Sprite *sprite) +{ + if (sprite->data[6] != 0) + { + s16 x = sprite->data[2] += sprite->data[4]; + s16 y = sprite->data[3] += sprite->data[5]; + sprite->pos1.x = x / 8u; + sprite->pos1.y = y / 8u; + sprite->data[6]--; + } + else + { + if (sprite->data[1] == 0) + { + sprite->pos1.x = 104; + sprite->pos1.y = 64; + } + else + { + sprite->pos1.x = 152; + sprite->pos1.y = 8 * (3 * (sprite->data[1] - 1)) + 16; + } + sprite->callback = SpriteCallbackDummy; + sPSSData->partySprites[sprite->data[1]] = sprite; + sPSSData->field_C5E--; + } +} + +static void DestroyMovingMonIcon(void) +{ + if (sPSSData->movingMonSprite != NULL) + { + DestroyBoxMonIcon(sPSSData->movingMonSprite); + sPSSData->movingMonSprite = NULL; + } +} + +static void sub_80CBAF0(s16 yDelta) +{ + u16 i, posY; + + for (i = 0; i < PARTY_SIZE; i++) + { + if (sPSSData->partySprites[i] != NULL) + { + sPSSData->partySprites[i]->pos1.y += yDelta; + posY = sPSSData->partySprites[i]->pos1.y + sPSSData->partySprites[i]->pos2.y + sPSSData->partySprites[i]->centerToCornerVecY; + posY += 16; + if (posY > 192) + sPSSData->partySprites[i]->invisible = TRUE; + else + sPSSData->partySprites[i]->invisible = FALSE; + } + } +} + +static void DestroyPartyMonIcon(u8 partyId) +{ + if (sPSSData->partySprites[partyId] != NULL) + { + DestroyBoxMonIcon(sPSSData->partySprites[partyId]); + sPSSData->partySprites[partyId] = NULL; + } +} + +static void DestroyAllPartyMonIcons(void) +{ + u16 i; + + for (i = 0; i < PARTY_SIZE; i++) + { + if (sPSSData->partySprites[i] != NULL) + { + DestroyBoxMonIcon(sPSSData->partySprites[i]); + sPSSData->partySprites[i] = NULL; + } + } +} + +static void SetPartyMonIconObjMode(u8 partyId, u8 objMode) +{ + if (sPSSData->partySprites[partyId] != NULL) + { + sPSSData->partySprites[partyId]->oam.objMode = objMode; + } +} + +static void sub_80CBC14(u8 mode, u8 id) +{ + if (mode == MODE_PARTY) + { + sPSSData->movingMonSprite = sPSSData->partySprites[id]; + sPSSData->partySprites[id] = NULL; + } + else if (mode == MODE_BOX) + { + sPSSData->movingMonSprite = sPSSData->boxMonsSprites[id]; + sPSSData->boxMonsSprites[id] = NULL; + } + else + { + return; + } + + sPSSData->movingMonSprite->callback = sub_80CC100; + sPSSData->movingMonSprite->oam.priority = sub_80CAFAC(); + sPSSData->movingMonSprite->subpriority = 7; +} + +static void sub_80CBCAC(u8 boxId, u8 position) +{ + if (boxId == TOTAL_BOXES_COUNT) // party mon + { + sPSSData->partySprites[position] = sPSSData->movingMonSprite; + sPSSData->partySprites[position]->oam.priority = 1; + sPSSData->partySprites[position]->subpriority = 12; + } + else + { + sPSSData->boxMonsSprites[position] = sPSSData->movingMonSprite; + sPSSData->boxMonsSprites[position]->oam.priority = 2; + sPSSData->boxMonsSprites[position]->subpriority = 19 - (position % IN_BOX_ROWS); + } + sPSSData->movingMonSprite->callback = SpriteCallbackDummy; + sPSSData->movingMonSprite = NULL; +} + +static void sub_80CBD5C(u8 boxId, u8 position) +{ + if (boxId == TOTAL_BOXES_COUNT) // party mon + sPSSData->field_B00 = &sPSSData->partySprites[position]; + else + sPSSData->field_B00 = &sPSSData->boxMonsSprites[position]; + + sPSSData->movingMonSprite->callback = SpriteCallbackDummy; + sPSSData->field_C5D = 0; +} + +static bool8 sub_80CBDC4(void) +{ + if (sPSSData->field_C5D == 16) + return FALSE; + + sPSSData->field_C5D++; + if (sPSSData->field_C5D & 1) + { + (*sPSSData->field_B00)->pos1.y--; + sPSSData->movingMonSprite->pos1.y++; + } + + (*sPSSData->field_B00)->pos2.x = gSineTable[sPSSData->field_C5D * 8] / 16; + sPSSData->movingMonSprite->pos2.x = -(gSineTable[sPSSData->field_C5D * 8] / 16); + if (sPSSData->field_C5D == 8) + { + sPSSData->movingMonSprite->oam.priority = (*sPSSData->field_B00)->oam.priority; + sPSSData->movingMonSprite->subpriority = (*sPSSData->field_B00)->subpriority; + (*sPSSData->field_B00)->oam.priority = sub_80CAFAC(); + (*sPSSData->field_B00)->subpriority = 7; + } + + if (sPSSData->field_C5D == 16) + { + struct Sprite *sprite = sPSSData->movingMonSprite; + sPSSData->movingMonSprite = (*sPSSData->field_B00); + *sPSSData->field_B00 = sprite; + + sPSSData->movingMonSprite->callback = sub_80CC100; + (*sPSSData->field_B00)->callback = SpriteCallbackDummy; + } + + return TRUE; +} + +static void sub_80CBF14(u8 mode, u8 position) +{ + switch (mode) + { + case MODE_PARTY: + sPSSData->field_B04 = &sPSSData->partySprites[position]; + break; + case MODE_BOX: + sPSSData->field_B04 = &sPSSData->boxMonsSprites[position]; + break; + case MODE_2: + sPSSData->field_B04 = &sPSSData->movingMonSprite; + break; + default: + return; + } + + if (*sPSSData->field_B04 != NULL) + { + InitSpriteAffineAnim(*sPSSData->field_B04); + (*sPSSData->field_B04)->oam.affineMode = 1; + (*sPSSData->field_B04)->affineAnims = gSpriteAffineAnimTable_857291C; + StartSpriteAffineAnim(*sPSSData->field_B04, 0); + } +} + +static bool8 sub_80CBFD8(void) +{ + if (*sPSSData->field_B04 == NULL || (*sPSSData->field_B04)->invisible) + return FALSE; + + if ((*sPSSData->field_B04)->affineAnimEnded) + (*sPSSData->field_B04)->invisible = TRUE; + + return TRUE; +} + +static void sub_80CC020(void) +{ + if (*sPSSData->field_B04 != NULL) + { + FreeOamMatrix((*sPSSData->field_B04)->oam.matrixNum); + DestroyBoxMonIcon(*sPSSData->field_B04); + *sPSSData->field_B04 = NULL; + } +} + +static void sub_80CC064(void) +{ + if (*sPSSData->field_B04 != NULL) + { + (*sPSSData->field_B04)->invisible = FALSE; + StartSpriteAffineAnim(*sPSSData->field_B04, 1); + } +} + +static bool8 sub_80CC0A0(void) +{ + if (sPSSData->field_B04 == NULL) + return FALSE; + + if ((*sPSSData->field_B04)->affineAnimEnded) + sPSSData->field_B04 = NULL; + + return TRUE; +} + +static void SetMovingMonPriority(u8 priority) +{ + sPSSData->movingMonSprite->oam.priority = priority; +} + +static void sub_80CC100(struct Sprite *sprite) +{ + sprite->pos1.x = sPSSData->field_CB4->pos1.x; + sprite->pos1.y = sPSSData->field_CB4->pos1.y + sPSSData->field_CB4->pos2.y + 4; +} + +static u16 sub_80CC124(u16 species) +{ + u16 i, var; + + for (i = 0; i < 40; i++) + { + if (sPSSData->field_B58[i] == species) + break; + } + + if (i == 40) + { + for (i = 0; i < 40; i++) + { + if (sPSSData->field_B58[i] == 0) + break; + } + if (i == 40) + return 0xFFFF; + } + + sPSSData->field_B58[i] = species; + sPSSData->field_B08[i]++; + var = 16 * i; + CpuCopy32(GetMonIconTiles(species, TRUE), (void*)(OBJ_VRAM0) + var * 32, 0x200); + + return var; +} + +static void sub_80CC1E0(u16 species) +{ + u16 i; + + for (i = 0; i < 40; i++) + { + if (sPSSData->field_B58[i] == species) + { + if (--sPSSData->field_B08[i] == 0) + sPSSData->field_B58[i] = 0; + break; + } + } +} + +static struct Sprite *CreateMonIconSprite(u16 species, u32 personality, s16 x, s16 y, u8 oamPriority, u8 subpriority) +{ + u16 tileNum; + u8 spriteId; + struct SpriteTemplate tempalte = gUnknown_085728D4; + + species = GetIconSpecies(species, personality); + tempalte.paletteTag = 0xDAC0 + gMonIconPaletteIndices[species]; + tileNum = sub_80CC124(species); + if (tileNum == 0xFFFF) + return NULL; + + spriteId = CreateSprite(&tempalte, x, y, subpriority); + if (spriteId == MAX_SPRITES) + { + sub_80CC1E0(species); + return NULL; + } + + gSprites[spriteId].oam.tileNum = tileNum; + gSprites[spriteId].oam.priority = oamPriority; + gSprites[spriteId].data[0] = species; + return &gSprites[spriteId]; +} + +static void DestroyBoxMonIcon(struct Sprite *sprite) +{ + sub_80CC1E0(sprite->data[0]); + DestroySprite(sprite); +} + +static void sub_80CC32C(u8 boxId) +{ + u8 taskId = CreateTask(sub_80CC370, 2); + + gTasks[taskId].data[2] = boxId; +} + +static bool8 sub_80CC35C(void) +{ + return FuncIsActiveTask(sub_80CC370); +} + +static void sub_80CC370(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + sPSSData->field_2D2 = 0; + sPSSData->bg2_X = 0; + task->data[1] = RequestDma3Fill(0, sPSSData->field_4AC4, 0x1000, 1); + break; + case 1: + if (CheckForSpaceForDma3Request(task->data[1]) == -1) + return; + + SetBgTilemapBuffer(2, sPSSData->field_4AC4); + ShowBg(2); + break; + case 2: + LoadWallpaperGfx(task->data[2], 0); + break; + case 3: + if (!WaitForWallpaperGfxLoad()) + return; + + sub_80CCB50(task->data[2]); + sub_80CD02C(); + sub_80CB028(task->data[2]); + SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(2) | BGCNT_CHARBASE(2) | BGCNT_SCREENBASE(27) | BGCNT_TXT512x256); + break; + case 4: + DestroyTask(taskId); + break; + default: + task->data[0] = 0; + return; + } + + task->data[0]++; +} + +static void SetUpScrollToBox(u8 boxId) +{ + s8 direction = sub_80CC644(boxId); + + sPSSData->field_2CE = (direction > 0) ? 6 : -6; + sPSSData->field_2D3 = (direction > 0) ? 1 : 2; + sPSSData->field_2D0 = 32; + sPSSData->field_2D4 = boxId; + sPSSData->field_2D6 = (direction <= 0) ? 5 : 0; + sPSSData->field_2D8 = direction; + sPSSData->field_2DA = (direction > 0) ? 264 : 56; + sPSSData->field_2DC = (direction <= 0) ? 5 : 0; + sPSSData->field_2DE = 0; + sPSSData->field_2E0 = 2; + sPSSData->field_A64 = boxId; + sPSSData->field_A65 = direction; + sPSSData->field_A63 = 0; +} + +static bool8 ScrollToBox(void) +{ + bool8 var; + + switch (sPSSData->field_A63) + { + case 0: + LoadWallpaperGfx(sPSSData->field_A64, sPSSData->field_A65); + sPSSData->field_A63++; + case 1: + if (!WaitForWallpaperGfxLoad()) + return TRUE; + + sub_80CB4CC(sPSSData->field_A64, sPSSData->field_A65); + sub_80CCCFC(sPSSData->field_A64, sPSSData->field_A65); + sub_80CD0B8(sPSSData->field_A65); + break; + case 2: + var = sub_80CB584(); + if (sPSSData->field_2D0 != 0) + { + sPSSData->bg2_X += sPSSData->field_2CE; + if (--sPSSData->field_2D0 != 0) + return TRUE; + sub_80CCEE0(); + sub_80CD158(); + } + return var; + } + + sPSSData->field_A63++; + return TRUE; +} + +static s8 sub_80CC644(u8 boxId) +{ + u8 i; + u8 currentBox = StorageGetCurrentBox(); + + for (i = 0; currentBox != boxId; i++) + { + currentBox++; + if (currentBox >= TOTAL_BOXES_COUNT) + currentBox = 0; + } + + return (i < TOTAL_BOXES_COUNT / 2) ? 1 : -1; +} + +static void SetWallpaperForCurrentBox(u8 wallpaperId) +{ + u8 boxId = StorageGetCurrentBox(); + SetBoxWallpaper(boxId, wallpaperId); + sPSSData->wallpaperChangeState = 0; +} + +static bool8 DoWallpaperGfxChange(void) +{ + switch (sPSSData->wallpaperChangeState) + { + case 0: + BeginNormalPaletteFade(sPSSData->field_738, 1, 0, 16, RGB_WHITEALPHA); + sPSSData->wallpaperChangeState++; + break; + case 1: + if (!UpdatePaletteFade()) + { + u8 curBox = StorageGetCurrentBox(); + LoadWallpaperGfx(curBox, 0); + sPSSData->wallpaperChangeState++; + } + break; + case 2: + if (WaitForWallpaperGfxLoad() == TRUE) + { + sub_80CCF9C(); + BeginNormalPaletteFade(sPSSData->field_738, 1, 16, 0, RGB_WHITEALPHA); + sPSSData->wallpaperChangeState++; + } + break; + case 3: + if (!UpdatePaletteFade()) + sPSSData->wallpaperChangeState++; + break; + case 4: + return FALSE; + } + + return TRUE; +} + +static void LoadWallpaperGfx(u8 boxId, s8 direction) +{ + u8 wallpaperId; + const struct WallpaperTable *wallpaperGfx; + void *iconGfx; + u32 size1, size2; + + sPSSData->field_6F9 = 0; + sPSSData->field_6FA = boxId; + sPSSData->field_6FB = direction; + if (sPSSData->field_6FB != 0) + { + sPSSData->field_2D2 = (sPSSData->field_2D2 == 0); + sub_80CCAE0(sPSSData->field_4AC4); + } + + wallpaperId = GetBoxWallpaper(sPSSData->field_6FA); + if (wallpaperId != WALLPAPER_FRIENDS) + { + wallpaperGfx = &gWallpaperTable[wallpaperId]; + LZ77UnCompWram(wallpaperGfx->tileMap, sPSSData->field_792); + sub_80CCA3C(sPSSData->field_792, sPSSData->field_6FB, sPSSData->field_2D2); + + if (sPSSData->field_6FB != 0) + LoadPalette(wallpaperGfx->palettes, (sPSSData->field_2D2 * 32) + 0x40, 0x40); + else + CpuCopy16(wallpaperGfx->palettes, &gPlttBufferUnfaded[(sPSSData->field_2D2 * 32) + 0x40], 0x40); + + sPSSData->wallpaperTiles = malloc_and_decompress(wallpaperGfx->tiles, &size1); + LoadBgTiles(2, sPSSData->wallpaperTiles, size1, sPSSData->field_2D2 << 8); + } + else + { + wallpaperGfx = &gFriendsWallpaperTable[GetWaldaWallpaperPatternId()]; + LZ77UnCompWram(wallpaperGfx->tileMap, sPSSData->field_792); + sub_80CCA3C(sPSSData->field_792, sPSSData->field_6FB, sPSSData->field_2D2); + + CpuCopy16(wallpaperGfx->palettes, sPSSData->field_792, 0x40); + CpuCopy16(GetWaldaWallpaperColorsPtr(), &sPSSData->field_792[1], 4); + CpuCopy16(GetWaldaWallpaperColorsPtr(), &sPSSData->field_792[17], 4); + + if (sPSSData->field_6FB != 0) + LoadPalette(sPSSData->field_792, (sPSSData->field_2D2 * 32) + 0x40, 0x40); + else + CpuCopy16(sPSSData->field_792, &gPlttBufferUnfaded[(sPSSData->field_2D2 * 32) + 0x40], 0x40); + + sPSSData->wallpaperTiles = malloc_and_decompress(wallpaperGfx->tiles, &size1); + iconGfx = malloc_and_decompress(gFriendsIcons[GetWaldaWallpaperIconId()], &size2); + CpuCopy32(iconGfx, sPSSData->wallpaperTiles + 0x800, size2); + Free(iconGfx); + LoadBgTiles(2, sPSSData->wallpaperTiles, size1, sPSSData->field_2D2 << 8); + } + + CopyBgTilemapBufferToVram(2); +} + +static bool32 WaitForWallpaperGfxLoad(void) +{ + if (IsDma3ManagerBusyWithBgCopy()) + return FALSE; + + if (sPSSData->wallpaperTiles != NULL) + { + Free(sPSSData->wallpaperTiles); + sPSSData->wallpaperTiles = NULL; + } + return TRUE; +} + +static void sub_80CCA3C(const void *tilemap, s8 direction, u8 arg2) +{ + s16 var = (arg2 * 2) + 3; + s16 x = ((sPSSData->bg2_X / 8 + 10) + (direction * 24)) & 0x3F; + + CopyRectToBgTilemapBufferRect(2, tilemap, 0, 0, 0x14, 0x12, x, 2, 0x14, 0x12, 0x11, arg2 << 8, var); + + if (direction == 0) + return; + else if (direction > 0) + x *= 1, x += 0x14; // x * 1 is needed to match, but can be safely removed as it makes no functional difference + else + x -= 4; + + FillBgTilemapBufferRect(2, 0, x, 2, 4, 0x12, 0x11); +} + +static void sub_80CCAE0(void *arg0) +{ + u16 i; + u16 *dest = arg0; + s16 r3 = ((sPSSData->bg2_X / 8) + 30) & 0x3F; + + if (r3 <= 31) + dest += r3 + 0x260; + else + dest += r3 + 0x640; + + for (i = 0; i < 0x2C; i++) + { + *dest++ = 0; + r3 = (r3 + 1) & 0x3F; + if (r3 == 0) + dest -= 0x420; + if (r3 == 0x20) + dest += 0x3e0; + } +} + +static void sub_80CCB50(u8 boxId) +{ + u8 tagIndex; + s16 r6; + u16 i; + + struct SpriteSheet spriteSheet = {sPSSData->field_2F8, 0x200, TAG_TILE_3}; + struct SpritePalette palettes[] = { + {sPSSData->field_6FC, TAG_PAL_DAC9}, + {} + }; + + u16 wallpaperId = GetBoxWallpaper(boxId); + + sPSSData->field_6FC[14] = gUnknown_08577574[wallpaperId][0]; + sPSSData->field_6FC[15] = gUnknown_08577574[wallpaperId][1]; + LoadSpritePalettes(palettes); + sPSSData->field_738 = 0x3f0; + + tagIndex = IndexOfSpritePaletteTag(TAG_PAL_DAC9); + sPSSData->field_71C = 0x10e + 16 * tagIndex; + sPSSData->field_738 |= 0x10000 << tagIndex; + + tagIndex = IndexOfSpritePaletteTag(TAG_PAL_DAC9); + sPSSData->field_71E = 0x10e + 16 * tagIndex; + sPSSData->field_738 |= 0x10000 << tagIndex; + + StringCopyPadded(sPSSData->field_21B8, GetBoxNamePtr(boxId), 0, 8); + sub_80C6D80(sPSSData->field_21B8, sPSSData->field_2F8, 0, 0, 2); + LoadSpriteSheet(&spriteSheet); + r6 = sub_80CD00C(GetBoxNamePtr(boxId)); + + for (i = 0; i < 2; i++) + { + u8 spriteId = CreateSprite(&gSpriteTemplate_857B0A8, r6 + i * 32, 28, 24); + sPSSData->field_720[i] = &gSprites[spriteId]; + StartSpriteAnim(sPSSData->field_720[i], i); + } + sPSSData->field_6F8 = 0; +} + +static void sub_80CCCFC(u8 boxId, s8 direction) +{ + u16 r8; + s16 x, x2; + u16 i; + struct SpriteSheet spriteSheet = {sPSSData->field_2F8, 0x200, TAG_TILE_3}; + struct SpriteTemplate template = gSpriteTemplate_857B0A8; + + sPSSData->field_6F8 = (sPSSData->field_6F8 == 0); + if (sPSSData->field_6F8 == 0) + { + spriteSheet.tag = TAG_TILE_3; + r8 = sPSSData->field_71C; + } + else + { + spriteSheet.tag = TAG_TILE_4; + r8 = sPSSData->field_71C; + template.tileTag = TAG_TILE_4; + template.paletteTag = TAG_PAL_DAC9; + } + + StringCopyPadded(sPSSData->field_21B8, GetBoxNamePtr(boxId), 0, 8); + sub_80C6D80(sPSSData->field_21B8, sPSSData->field_2F8, 0, 0, 2); + LoadSpriteSheet(&spriteSheet); + LoadPalette(gUnknown_08577574[GetBoxWallpaper(boxId)], r8, 4); + x = sub_80CD00C(GetBoxNamePtr(boxId)); + x2 = x; + x2 += direction * 192; + + for (i = 0; i < 2; i++) + { + u8 spriteId = CreateSprite(&template, i * 32 + x2, 28, 24); + + sPSSData->field_728[i] = &gSprites[spriteId]; + sPSSData->field_728[i]->data[0] = (-direction) * 6; + sPSSData->field_728[i]->data[1] = i * 32 + x; + sPSSData->field_728[i]->data[2] = 0; + sPSSData->field_728[i]->callback = sub_80CCF30; + StartSpriteAnim(sPSSData->field_728[i], i); + + sPSSData->field_720[i]->data[0] = (-direction) * 6; + sPSSData->field_720[i]->data[1] = 1; + sPSSData->field_720[i]->callback = sub_80CCF64; + } +} + +static void sub_80CCEE0(void) +{ + if (sPSSData->field_6F8 == 0) + FreeSpriteTilesByTag(TAG_TILE_4); + else + FreeSpriteTilesByTag(TAG_TILE_3); + + sPSSData->field_720[0] = sPSSData->field_728[0]; + sPSSData->field_720[1] = sPSSData->field_728[1]; +} + +static void sub_80CCF30(struct Sprite *sprite) +{ + if (sprite->data[2] != 0) + sprite->data[2]--; + else if ((sprite->pos1.x += sprite->data[0]) == sprite->data[1]) + sprite->callback = SpriteCallbackDummy; +} + +static void sub_80CCF64(struct Sprite *sprite) +{ + if (sprite->data[1] != 0) + { + sprite->data[1]--; + } + else + { + sprite->pos1.x += sprite->data[0]; + sprite->data[2] = sprite->pos1.x + sprite->pos2.x; + if (sprite->data[2] < 0x40 || sprite->data[2] > 0x100) + DestroySprite(sprite); + } +} + +static void sub_80CCF9C(void) +{ + u8 boxId = StorageGetCurrentBox(); + u8 wallpaperId = GetBoxWallpaper(boxId); + if (sPSSData->field_6F8 == 0) + CpuCopy16(gUnknown_08577574[wallpaperId], gPlttBufferUnfaded + sPSSData->field_71C, 4); + else + CpuCopy16(gUnknown_08577574[wallpaperId], gPlttBufferUnfaded + sPSSData->field_71E, 4); +} + +static s16 sub_80CD00C(const u8 *string) +{ + return 0xB0 - GetStringWidth(1, string, 0) / 2; +} + +static void sub_80CD02C(void) +{ + u16 i; + + LoadSpriteSheet(&gUnknown_0857B080); + for (i = 0; i < 2; i++) + { + u8 spriteId = CreateSprite(&gUnknown_0857B0E0, 0x5c + i * 0x88, 28, 22); + if (spriteId != MAX_SPRITES) + { + struct Sprite *sprite = &gSprites[spriteId]; + StartSpriteAnim(sprite, i); + sprite->data[3] = (i == 0) ? -1 : 1; + sPSSData->field_730[i] = sprite; + } + } + if (IsCursorOnBox()) + sub_80CD1A8(TRUE); +} + +static void sub_80CD0B8(s8 direction) +{ + u16 i; + + for (i = 0; i < 2; i++) + { + sPSSData->field_730[i]->pos2.x = 0; + sPSSData->field_730[i]->data[0] = 2; + } + if (direction < 0) + { + sPSSData->field_730[0]->data[1] = 29; + sPSSData->field_730[1]->data[1] = 5; + sPSSData->field_730[0]->data[2] = 0x48; + sPSSData->field_730[1]->data[2] = 0x48; + } + else + { + sPSSData->field_730[0]->data[1] = 5; + sPSSData->field_730[1]->data[1] = 29; + sPSSData->field_730[0]->data[2] = 0xF8; + sPSSData->field_730[1]->data[2] = 0xF8; + } + sPSSData->field_730[0]->data[7] = 0; + sPSSData->field_730[1]->data[7] = 1; +} + +static void sub_80CD158(void) +{ + u16 i; + + for (i = 0; i < 2; i++) + { + sPSSData->field_730[i]->pos1.x = 0x88 * i + 0x5c; + sPSSData->field_730[i]->pos2.x = 0; + sPSSData->field_730[i]->invisible = FALSE; + } + sub_80CD1A8(TRUE); +} + +static void sub_80CD1A8(bool8 a0) +{ + u16 i; + + if (a0) + { + for (i = 0; i < 2; i++) + { + sPSSData->field_730[i]->data[0] = 1; + sPSSData->field_730[i]->data[1] = 0; + sPSSData->field_730[i]->data[2] = 0; + sPSSData->field_730[i]->data[4] = 0; + } + } + else + { + for (i = 0; i < 2; i++) + { + sPSSData->field_730[i]->data[0] = 0; + } + } +} + +static void sub_80CD210(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->pos2.x = 0; + break; + case 1: + if (++sprite->data[1] > 3) + { + sprite->data[1] = 0; + sprite->pos2.x += sprite->data[3]; + if (++sprite->data[2] > 5) + { + sprite->data[2] = 0; + sprite->pos2.x = 0; + } + } + break; + case 2: + sprite->data[0] = 3; + break; + case 3: + sprite->pos1.x -= sPSSData->field_2CE; + if (sprite->pos1.x < 73 || sprite->pos1.x > 247) + sprite->invisible = TRUE; + if (--sprite->data[1] == 0) + { + sprite->pos1.x = sprite->data[2]; + sprite->invisible = FALSE; + sprite->data[0] = 4; + } + break; + case 4: + sprite->pos1.x -= sPSSData->field_2CE; + break; + } +} + +static struct Sprite *sub_80CD2E8(u16 x, u16 y, u8 animId, u8 priority, u8 subpriority) +{ + u8 spriteId = CreateSprite(&gUnknown_0857B0E0, x, y, subpriority); + if (spriteId == MAX_SPRITES) + return NULL; + + animId %= 2; + StartSpriteAnim(&gSprites[spriteId], animId); + gSprites[spriteId].oam.priority = priority; + gSprites[spriteId].callback = SpriteCallbackDummy; + return &gSprites[spriteId]; +} + +static void sub_80CD36C(void) +{ + if (sPSSData->boxOption != BOX_OPTION_DEPOSIT) + sBoxCursorArea = CURSOR_AREA_IN_BOX; + else + sBoxCursorArea = CURSOR_AREA_IN_PARTY; + + sBoxCursorPosition = 0; + sIsMonBeingMoved = FALSE; + sMovingMonOrigBoxId = 0; + sMovingMonOrigBoxPos = 0; + sCanOnlyMove = FALSE; + sub_80CDC0C(); + sub_80CFC14(); + sPSSData->field_CD6 = 1; + sPSSData->inBoxMovingMode = 0; + sub_80CEB40(); +} + +static void sub_80CD3EC(void) +{ + sub_80CFC14(); + sub_80CEBDC(); + sPSSData->field_CD6 = 1; + sPSSData->inBoxMovingMode = 0; + if (sIsMonBeingMoved) + { + sPSSData->movingMon = gUnknown_02039D14; + CreateMovingMonIcon(); + } +} + +static void sub_80CD444(u8 cursorArea, u8 cursorPosition, u16 *x, u16 *y) +{ + switch (cursorArea) + { + case CURSOR_AREA_IN_BOX: + *x = (cursorPosition % IN_BOX_ROWS) * 24 + 100; + *y = (cursorPosition / IN_BOX_ROWS) * 24 + 32; + break; + case CURSOR_AREA_IN_PARTY: + if (cursorPosition == 0) + { + *x = 0x68; + *y = 0x34; + } + else if (cursorPosition == PARTY_SIZE) + { + *x = 0x98; + *y = 0x84; + } + else + { + *x = 0x98; + *y = (cursorPosition - 1) * 24 + 4; + } + break; + case CURSOR_AREA_BOX: + *x = 0xa2; + *y = 0x0c; + break; + case CURSOR_AREA_BUTTONS: + *y = sIsMonBeingMoved ? 8 : 14; + *x = cursorPosition * 0x58 + 0x78; + break; + case 4: + *x = 0xa0; + *y = 0x60; + break; + } +} + +static u16 sub_80CD504(void) +{ + switch (sBoxCursorArea) + { + case CURSOR_AREA_IN_PARTY: + return GetMonData(&gPlayerParty[sBoxCursorPosition], MON_DATA_SPECIES); + case CURSOR_AREA_IN_BOX: + return GetCurrentBoxMonData(sBoxCursorPosition, MON_DATA_SPECIES); + default: + return SPECIES_NONE; + } +} + +static bool8 sub_80CD554(void) +{ + s16 tmp; + + if (sPSSData->field_CD0 == 0) + { + if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + return FALSE; + else + return sub_80D1218(); + } + else if (--sPSSData->field_CD0 != 0) + { + sPSSData->field_CBC += sPSSData->field_CC4; + sPSSData->field_CC0 += sPSSData->field_CC8; + sPSSData->field_CB4->pos1.x = sPSSData->field_CBC >> 8; + sPSSData->field_CB4->pos1.y = sPSSData->field_CC0 >> 8; + if (sPSSData->field_CB4->pos1.x > 0x100) + { + tmp = sPSSData->field_CB4->pos1.x - 0x100; + sPSSData->field_CB4->pos1.x = tmp + 0x40; + } + if (sPSSData->field_CB4->pos1.x < 0x40) + { + tmp = 0x40 - sPSSData->field_CB4->pos1.x; + sPSSData->field_CB4->pos1.x = 0x100 - tmp; + } + if (sPSSData->field_CB4->pos1.y > 0xb0) + { + tmp = sPSSData->field_CB4->pos1.y - 0xb0; + sPSSData->field_CB4->pos1.y = tmp - 0x10; + } + if (sPSSData->field_CB4->pos1.y < -0x10) + { + tmp = -0x10 - sPSSData->field_CB4->pos1.y; + sPSSData->field_CB4->pos1.y = 0xb0 - tmp; + } + if (sPSSData->field_CD7 && --sPSSData->field_CD7 == 0) + sPSSData->field_CB4->vFlip = (sPSSData->field_CB4->vFlip == FALSE); + } + else + { + sPSSData->field_CB4->pos1.x = sPSSData->field_CCC; + sPSSData->field_CB4->pos1.y = sPSSData->field_CCE; + sub_80CDA68(); + } + + return TRUE; +} + +static void sub_80CD6AC(u8 newCurosrArea, u8 newCursorPosition) +{ + u16 x, y; + + sub_80CD444(newCurosrArea, newCursorPosition, &x, &y); + sPSSData->field_CD4 = newCurosrArea; + sPSSData->field_CD5 = newCursorPosition; + sPSSData->field_CCC = x; + sPSSData->field_CCE = y; +} + +static void sub_80CD70C(void) +{ + int r7, r0; + + if (sPSSData->field_CD2 != 0 || sPSSData->field_CD3 != 0) + sPSSData->field_CD0 = 12; + else + sPSSData->field_CD0 = 6; + + if (sPSSData->field_CD7) + sPSSData->field_CD7 = sPSSData->field_CD0 >> 1; + + switch (sPSSData->field_CD2) + { + default: + r7 = sPSSData->field_CCE - sPSSData->field_CB4->pos1.y; + break; + case -1: + r7 = sPSSData->field_CCE - 0xc0 - sPSSData->field_CB4->pos1.y; + break; + case 1: + r7 = sPSSData->field_CCE + 0xc0 - sPSSData->field_CB4->pos1.y; + break; + } + + switch (sPSSData->field_CD3) + { + default: + r0 = sPSSData->field_CCC - sPSSData->field_CB4->pos1.x; + break; + case -1: + r0 = sPSSData->field_CCC - 0xc0 - sPSSData->field_CB4->pos1.x; + break; + case 1: + r0 = sPSSData->field_CCC + 0xc0 - sPSSData->field_CB4->pos1.x; + break; + } + + r7 <<= 8; + r0 <<= 8; + sPSSData->field_CC4 = r0 / sPSSData->field_CD0; + sPSSData->field_CC8 = r7 / sPSSData->field_CD0; + sPSSData->field_CBC = sPSSData->field_CB4->pos1.x << 8; + sPSSData->field_CC0 = sPSSData->field_CB4->pos1.y << 8; +} + +static void sub_80CD894(u8 newCurosrArea, u8 newCursorPosition) +{ + sub_80CD6AC(newCurosrArea, newCursorPosition); + sub_80CD70C(); + if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + { + if (sPSSData->inBoxMovingMode == 0 && !sIsMonBeingMoved) + StartSpriteAnim(sPSSData->field_CB4, 1); + } + else + { + if (!IsActiveItemMoving()) + StartSpriteAnim(sPSSData->field_CB4, 1); + } + + if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + { + if (sBoxCursorArea == CURSOR_AREA_IN_BOX) + sub_80D0E50(CURSOR_AREA_IN_BOX, sBoxCursorPosition); + else if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) + sub_80D0E50(CURSOR_AREA_IN_PARTY, sBoxCursorPosition); + + if (newCurosrArea == CURSOR_AREA_IN_BOX) + sub_80D0D8C(newCurosrArea, newCursorPosition); + else if (newCurosrArea == CURSOR_AREA_IN_PARTY) + sub_80D0D8C(newCurosrArea, newCursorPosition); + } + + if (newCurosrArea == CURSOR_AREA_IN_PARTY && sBoxCursorArea != CURSOR_AREA_IN_PARTY) + { + sPSSData->field_CD6 = newCurosrArea; + sPSSData->field_CB8->invisible = TRUE; + } + + switch (newCurosrArea) + { + case CURSOR_AREA_IN_PARTY: + case CURSOR_AREA_BOX: + case CURSOR_AREA_BUTTONS: + sPSSData->field_CB4->oam.priority = 1; + sPSSData->field_CB8->invisible = TRUE; + sPSSData->field_CB8->oam.priority = 1; + break; + case CURSOR_AREA_IN_BOX: + if (sPSSData->inBoxMovingMode != 0) + { + sPSSData->field_CB4->oam.priority = 0; + sPSSData->field_CB8->invisible = TRUE; + } + else + { + sPSSData->field_CB4->oam.priority = 2; + if (sBoxCursorArea == CURSOR_AREA_IN_BOX && sIsMonBeingMoved) + SetMovingMonPriority(2); + } + break; + } +} + +static void sub_80CDA68(void) +{ + sBoxCursorArea = sPSSData->field_CD4; + sBoxCursorPosition = sPSSData->field_CD5; + if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + { + if (sPSSData->inBoxMovingMode == 0 && !sIsMonBeingMoved) + StartSpriteAnim(sPSSData->field_CB4, 0); + } + else + { + if (!IsActiveItemMoving()) + StartSpriteAnim(sPSSData->field_CB4, 0); + } + + sub_80CEB40(); + switch (sBoxCursorArea) + { + case CURSOR_AREA_BUTTONS: + SetMovingMonPriority(1); + break; + case CURSOR_AREA_BOX: + sub_80CD1A8(TRUE); + break; + case CURSOR_AREA_IN_PARTY: + sPSSData->field_CB8->subpriority = 13; + SetMovingMonPriority(1); + break; + case CURSOR_AREA_IN_BOX: + if (sPSSData->inBoxMovingMode == 0) + { + sPSSData->field_CB4->oam.priority = 1; + sPSSData->field_CB8->oam.priority = 2; + sPSSData->field_CB8->subpriority = 21; + sPSSData->field_CB8->invisible = FALSE; + SetMovingMonPriority(2); + } + break; + } +} + +static void sub_80CDBA0(void) +{ + u8 partyCount; + + if (!sIsMonBeingMoved) + { + partyCount = 0; + } + else + { + partyCount = CalculatePlayerPartyCount(); + if (partyCount >= PARTY_SIZE) + partyCount = PARTY_SIZE - 1; + } + if (sPSSData->field_CB4->vFlip) + sPSSData->field_CD7 = 1; + sub_80CD894(CURSOR_AREA_IN_PARTY, partyCount); +} + +static void sub_80CDBF8(u8 cursorBoxPosition) +{ + sub_80CD894(CURSOR_AREA_IN_BOX, cursorBoxPosition); +} + +EWRAM_DATA static u8 gUnknown_02039D7E = 0; + +static void sub_80CDC0C(void) +{ + gUnknown_02039D7E = 0; +} + +static void sub_80CDC18(void) +{ + gUnknown_02039D7E = sBoxCursorPosition; +} + +static u8 sub_80CDC2C(void) +{ + return gUnknown_02039D7E; +} + +static void InitMonPlaceChange(u8 a0) +{ + static bool8 (*const placeChangeFuncs[])(void) = + { + MonPlaceChange_Move, + MonPlaceChange_Place, + MonPlaceChange_Shift, + }; + + sPSSData->monPlaceChangeFunc = placeChangeFuncs[a0]; + sPSSData->monPlaceChangeState = 0; +} + +static void sub_80CDC64(bool8 arg0) +{ + if (!arg0) + sPSSData->monPlaceChangeFunc = sub_80CDEB4; + else + sPSSData->monPlaceChangeFunc = sub_80CDEC4; + + sPSSData->monPlaceChangeState = 0; +} + +static bool8 DoMonPlaceChange(void) +{ + return sPSSData->monPlaceChangeFunc(); +} + +static bool8 MonPlaceChange_Move(void) +{ + switch (sPSSData->monPlaceChangeState) + { + case 0: + if (sIsMonBeingMoved) + return FALSE; + StartSpriteAnim(sPSSData->field_CB4, 2); + sPSSData->monPlaceChangeState++; + break; + case 1: + if (!sub_80CDED4()) + { + StartSpriteAnim(sPSSData->field_CB4, 3); + MoveMon(); + sPSSData->monPlaceChangeState++; + } + break; + case 2: + if (!sub_80CDF08()) + sPSSData->monPlaceChangeState++; + break; + case 3: + return FALSE; + } + + return TRUE; +} + +static bool8 MonPlaceChange_Place(void) +{ + switch (sPSSData->monPlaceChangeState) + { + case 0: + if (!sub_80CDED4()) + { + StartSpriteAnim(sPSSData->field_CB4, 2); + PlaceMon(); + sPSSData->monPlaceChangeState++; + } + break; + case 1: + if (!sub_80CDF08()) + { + StartSpriteAnim(sPSSData->field_CB4, 0); + sPSSData->monPlaceChangeState++; + } + break; + case 2: + return FALSE; + } + + return TRUE; +} + +static bool8 MonPlaceChange_Shift(void) +{ + switch (sPSSData->monPlaceChangeState) + { + case 0: + switch (sBoxCursorArea) + { + case CURSOR_AREA_IN_PARTY: + sPSSData->field_D91 = TOTAL_BOXES_COUNT; + break; + case CURSOR_AREA_IN_BOX: + sPSSData->field_D91 = StorageGetCurrentBox(); + break; + default: + return FALSE; + } + StartSpriteAnim(sPSSData->field_CB4, 2); + sub_80CBD5C(sPSSData->field_D91, sBoxCursorPosition); + sPSSData->monPlaceChangeState++; + break; + case 1: + if (!sub_80CBDC4()) + { + StartSpriteAnim(sPSSData->field_CB4, 3); + SetShiftedMonData(sPSSData->field_D91, sBoxCursorPosition); + sPSSData->monPlaceChangeState++; + } + break; + case 2: + return FALSE; + } + + return TRUE; +} + +static bool8 sub_80CDEB4(void) +{ + return sub_80CDED4(); +} + +static bool8 sub_80CDEC4(void) +{ + return sub_80CDF08(); +} + +static bool8 sub_80CDED4(void) +{ + switch (sPSSData->field_CB4->pos2.y) + { + default: + sPSSData->field_CB4->pos2.y++; + break; + case 0: + sPSSData->field_CB4->pos2.y++; + break; + case 8: + return FALSE; + } + + return TRUE; +} + +static bool8 sub_80CDF08(void) +{ + switch (sPSSData->field_CB4->pos2.y) + { + case 0: + return FALSE; + default: + sPSSData->field_CB4->pos2.y--; + break; + } + + return TRUE; +} + +static void MoveMon(void) +{ + switch (sBoxCursorArea) + { + case CURSOR_AREA_IN_PARTY: + SetMovedMonData(TOTAL_BOXES_COUNT, sBoxCursorPosition); + sub_80CBC14(MODE_PARTY, sBoxCursorPosition); + break; + case CURSOR_AREA_IN_BOX: + if (sPSSData->inBoxMovingMode == 0) + { + SetMovedMonData(StorageGetCurrentBox(), sBoxCursorPosition); + sub_80CBC14(MODE_BOX, sBoxCursorPosition); + } + break; + default: + return; + } + + sIsMonBeingMoved = TRUE; +} + +static void PlaceMon(void) +{ + u8 boxId; + + switch (sBoxCursorArea) + { + case CURSOR_AREA_IN_PARTY: + SetPlacedMonData(TOTAL_BOXES_COUNT, sBoxCursorPosition); + sub_80CBCAC(TOTAL_BOXES_COUNT, sBoxCursorPosition); + break; + case CURSOR_AREA_IN_BOX: + boxId = StorageGetCurrentBox(); + SetPlacedMonData(boxId, sBoxCursorPosition); + sub_80CBCAC(boxId, sBoxCursorPosition); + break; + default: + return; + } + + sIsMonBeingMoved = FALSE; +} + +static void sub_80CE00C(void) +{ + sub_80CEB40(); +} + +static void SetMovedMonData(u8 boxId, u8 position) +{ + if (boxId == TOTAL_BOXES_COUNT) + sPSSData->movingMon = gPlayerParty[sBoxCursorPosition]; + else + BoxMonAtToMon(boxId, position, &sPSSData->movingMon); + + PurgeMonOrBoxMon(boxId, position); + sMovingMonOrigBoxId = boxId; + sMovingMonOrigBoxPos = position; +} + +static void SetPlacedMonData(u8 boxId, u8 position) +{ + if (boxId == TOTAL_BOXES_COUNT) + { + gPlayerParty[position] = sPSSData->movingMon; + } + else + { + BoxMonRestorePP(&sPSSData->movingMon.box); + SetBoxMonAt(boxId, position, &sPSSData->movingMon.box); + } +} + +static void PurgeMonOrBoxMon(u8 boxId, u8 position) +{ + if (boxId == TOTAL_BOXES_COUNT) + ZeroMonData(&gPlayerParty[position]); + else + ZeroBoxMonAt(boxId, position); +} + +static void SetShiftedMonData(u8 boxId, u8 position) +{ + if (boxId == TOTAL_BOXES_COUNT) + sPSSData->field_2108 = gPlayerParty[position]; + else + BoxMonAtToMon(boxId, position, &sPSSData->field_2108); + + SetPlacedMonData(boxId, position); + sPSSData->movingMon = sPSSData->field_2108; + SetCursorMonData(&sPSSData->movingMon, MODE_PARTY); + sMovingMonOrigBoxId = boxId; + sMovingMonOrigBoxPos = position; +} + +static bool8 TryStorePartyMonInBox(u8 boxId) +{ + s16 boxPosition = GetFirstFreeBoxSpot(boxId); + if (boxPosition == -1) + return FALSE; + + if (sIsMonBeingMoved) + { + SetPlacedMonData(boxId, boxPosition); + DestroyMovingMonIcon(); + sIsMonBeingMoved = FALSE; + } + else + { + SetMovedMonData(TOTAL_BOXES_COUNT, sBoxCursorPosition); + SetPlacedMonData(boxId, boxPosition); + DestroyPartyMonIcon(sBoxCursorPosition); + } + + if (boxId == StorageGetCurrentBox()) + sub_80CB140(boxPosition); + + StartSpriteAnim(sPSSData->field_CB4, 1); + return TRUE; +} + +static void sub_80CE22C(void) +{ + StartSpriteAnim(sPSSData->field_CB4, 0); + sub_80CEB40(); +} + +static void sub_80CE250(void) +{ + u8 mode; + + if (sIsMonBeingMoved) + mode = MODE_2; + else if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) + mode = MODE_PARTY; + else + mode = MODE_BOX; + + sub_80CBF14(mode, sBoxCursorPosition); + StringCopy(sPSSData->field_21E0, sPSSData->cursorMonNick); +} + +static bool8 sub_80CE2A8(void) +{ + if (!sub_80CBFD8()) + { + StartSpriteAnim(sPSSData->field_CB4, 0); + return FALSE; + } + else + { + return TRUE; + } +} + +static void ReleaseMon(void) +{ + u8 boxId; + + sub_80CC020(); + if (sIsMonBeingMoved) + { + sIsMonBeingMoved = FALSE; + } + else + { + if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) + boxId = TOTAL_BOXES_COUNT; + else + boxId = StorageGetCurrentBox(); + + PurgeMonOrBoxMon(boxId, sBoxCursorPosition); + } + sub_80CEB40(); +} + +static void sub_80CE324(void) +{ + if (sIsMonBeingMoved) + StartSpriteAnim(sPSSData->field_CB4, 3); +} + +struct +{ + s8 mapGroup; + s8 mapNum; + u16 move; +} static const gUnknown_0857B9A4[] = +{ + {MAP_GROUPS_COUNT, 0, MOVE_SURF}, + {MAP_GROUPS_COUNT, 0, MOVE_DIVE}, + {MAP_GROUP(EVER_GRANDE_CITY_POKEMON_LEAGUE_1F), MAP_NUM(EVER_GRANDE_CITY_POKEMON_LEAGUE_1F), MOVE_STRENGTH}, + {MAP_GROUP(EVER_GRANDE_CITY_POKEMON_LEAGUE_1F), MAP_NUM(EVER_GRANDE_CITY_POKEMON_LEAGUE_1F), MOVE_ROCK_SMASH}, + {MAP_GROUP(EVER_GRANDE_CITY_POKEMON_LEAGUE_2F), MAP_NUM(EVER_GRANDE_CITY_POKEMON_LEAGUE_2F), MOVE_STRENGTH}, + {MAP_GROUP(EVER_GRANDE_CITY_POKEMON_LEAGUE_2F), MAP_NUM(EVER_GRANDE_CITY_POKEMON_LEAGUE_2F), MOVE_ROCK_SMASH}, +}; + +static void sub_80CE350(u16 *moves) +{ + s32 i; + + for (i = 0; i < ARRAY_COUNT(gUnknown_0857B9A4); i++) + { + if (gUnknown_0857B9A4[i].mapGroup == MAP_GROUPS_COUNT + || (gUnknown_0857B9A4[i].mapGroup == gSaveBlock1Ptr->location.mapGroup && gUnknown_0857B9A4[i].mapNum == gSaveBlock1Ptr->location.mapNum)) + { + *moves = gUnknown_0857B9A4[i].move; + moves++; + } + } + + *moves = MOVES_COUNT; +} + +static void InitCanRelaseMonVars(void) +{ + if (!AtLeastThreeUsableMons()) + { + sPSSData->field_216D = 1; + sPSSData->field_216C = 0; + return; + } + + if (sIsMonBeingMoved) + { + sPSSData->field_2108 = sPSSData->movingMon; + sPSSData->field_2170 = -1; + sPSSData->field_2171 = -1; + } + else + { + if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) + { + sPSSData->field_2108 = gPlayerParty[sBoxCursorPosition]; + sPSSData->field_2170 = TOTAL_BOXES_COUNT; + } + else + { + BoxMonAtToMon(StorageGetCurrentBox(), sBoxCursorPosition, &sPSSData->field_2108); + sPSSData->field_2170 = StorageGetCurrentBox(); + } + sPSSData->field_2171 = sBoxCursorPosition; + } + + sub_80CE350(sPSSData->field_2176); + sPSSData->field_2174 = GetMonData(&sPSSData->field_2108, MON_DATA_KNOWN_MOVES, sPSSData->field_2176); + if (sPSSData->field_2174 != 0) + { + sPSSData->field_216D = 0; + } + else + { + sPSSData->field_216D = 1; + sPSSData->field_216C = 1; + } + + sPSSData->field_2172 = 0; +} + +static bool32 AtLeastThreeUsableMons(void) +{ + s32 i, j, count; + + count = (sIsMonBeingMoved != FALSE); + for (j = 0; j < PARTY_SIZE; j++) + { + if (GetMonData(&gPlayerParty[j], MON_DATA_SANITY_HAS_SPECIES)) + count++; + } + + if (count >= 3) + return TRUE; + + for (i = 0; i < TOTAL_BOXES_COUNT; i++) + { + for (j = 0; j < IN_BOX_COUNT; j++) + { + if (CheckBoxMonSanityAt(i, j)) + { + if (++count >= 3) + return TRUE; + } + } + } + + return FALSE; +} + +static s8 RunCanReleaseMon(void) +{ + u16 i; + u16 knownMoves; + + if (sPSSData->field_216D) + return sPSSData->field_216C; + + switch (sPSSData->field_2172) + { + case 0: + for (i = 0; i < PARTY_SIZE; i++) + { + if (sPSSData->field_2170 != TOTAL_BOXES_COUNT || sPSSData->field_2171 != i) + { + knownMoves = GetMonData(gPlayerParty + i, MON_DATA_KNOWN_MOVES, sPSSData->field_2176); + sPSSData->field_2174 &= ~(knownMoves); + } + } + if (sPSSData->field_2174 == 0) + { + sPSSData->field_216D = 1; + sPSSData->field_216C = 1; + } + else + { + sPSSData->field_216E = 0; + sPSSData->field_216F = 0; + sPSSData->field_2172++; + } + break; + case 1: + for (i = 0; i < IN_BOX_COUNT; i++) + { + knownMoves = GetAndCopyBoxMonDataAt(sPSSData->field_216E, sPSSData->field_216F, MON_DATA_KNOWN_MOVES, sPSSData->field_2176); + if (knownMoves != 0 + && !(sPSSData->field_2170 == sPSSData->field_216E && sPSSData->field_2171 == sPSSData->field_216F)) + { + sPSSData->field_2174 &= ~(knownMoves); + if (sPSSData->field_2174 == 0) + { + sPSSData->field_216D = 1; + sPSSData->field_216C = 1; + break; + } + } + if (++sPSSData->field_216F >= IN_BOX_COUNT) + { + sPSSData->field_216F = 0; + if (++sPSSData->field_216E >= TOTAL_BOXES_COUNT) + { + sPSSData->field_216D = 1; + sPSSData->field_216C = 0; + } + } + } + break; + } + + return -1; +} + +static void sub_80CE760(void) +{ + if (sIsMonBeingMoved) + gUnknown_02039D14 = sPSSData->movingMon; +} + +static void sub_80CE790(void) +{ + if (sIsMonBeingMoved) + { + if (sMovingMonOrigBoxId == TOTAL_BOXES_COUNT) + sPSSData->movingMon = gUnknown_02039D14; + else + sPSSData->movingMon.box = gUnknown_02039D14.box; + } +} + +static void sub_80CE7E8(void) +{ + if (sIsMonBeingMoved) + { + sub_80CE760(); + sPSSData->field_218C.mon = &gUnknown_02039D14; + sPSSData->field_2187 = 0; + sPSSData->field_2186 = 0; + sPSSData->field_2188 = 0; + } + else if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) + { + sPSSData->field_218C.mon = gPlayerParty; + sPSSData->field_2187 = sBoxCursorPosition; + sPSSData->field_2186 = CountPartyMons() - 1; + sPSSData->field_2188 = 0; + } + else + { + sPSSData->field_218C.box = GetBoxedMonPtr(StorageGetCurrentBox(), 0); + sPSSData->field_2187 = sBoxCursorPosition; + sPSSData->field_2186 = IN_BOX_COUNT - 1; + sPSSData->field_2188 = 2; + } +} + +static void sub_80CE8E4(void) +{ + if (sIsMonBeingMoved) + sub_80CE790(); + else + sBoxCursorPosition = gUnknown_0203CF20; +} + +s16 CompactPartySlots(void) +{ + s16 retVal = -1; + u16 i, last; + + for (i = 0, last = 0; i < PARTY_SIZE; i++) + { + u16 species = GetMonData(gPlayerParty + i, MON_DATA_SPECIES); + if (species != SPECIES_NONE) + { + if (i != last) + gPlayerParty[last] = gPlayerParty[i]; + last++; + } + else if (retVal == -1) + { + retVal = i; + } + } + for (; last < PARTY_SIZE; last++) + ZeroMonData(gPlayerParty + last); + + return retVal; +} + +static void SetMonMarkings(u8 markings) +{ + sPSSData->cursorMonMarkings = markings; + if (sIsMonBeingMoved) + { + SetMonData(&sPSSData->movingMon, MON_DATA_MARKINGS, &markings); + } + else + { + if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) + SetMonData(gPlayerParty + sBoxCursorPosition, MON_DATA_MARKINGS, &markings); + if (sBoxCursorArea == CURSOR_AREA_IN_BOX) + SetCurrentBoxMonData(sBoxCursorPosition, MON_DATA_MARKINGS, &markings); + } +} + +static bool8 CanMovePartyMon(void) +{ + if (sBoxCursorArea == CURSOR_AREA_IN_PARTY && !sIsMonBeingMoved && CountPartyAliveNonEggMonsExcept(sBoxCursorPosition) == 0) + return TRUE; + else + return FALSE; +} + +static bool8 CanShiftMon(void) +{ + if (sIsMonBeingMoved) + { + if (sBoxCursorArea == CURSOR_AREA_IN_PARTY && CountPartyAliveNonEggMonsExcept(sBoxCursorPosition) == 0) + { + if (sPSSData->cursorMonIsEgg || GetMonData(&sPSSData->movingMon, MON_DATA_HP) == 0) + return FALSE; + } + return TRUE; + } + return FALSE; +} + +static bool8 IsMonBeingMoved(void) +{ + return sIsMonBeingMoved; +} + +static bool8 IsCursorOnBox(void) +{ + return (sBoxCursorArea == CURSOR_AREA_BOX); +} + +static bool8 IsCursorOnCloseBox(void) +{ + return (sBoxCursorArea == CURSOR_AREA_BUTTONS && sBoxCursorPosition == 1); +} + +static bool8 IsCursorInBox(void) +{ + return (sBoxCursorArea == CURSOR_AREA_IN_BOX); +} + +static void sub_80CEB40(void) +{ + sPSSData->setMosaic = (sIsMonBeingMoved == FALSE); + if (!sIsMonBeingMoved) + { + switch (sBoxCursorArea) + { + case CURSOR_AREA_IN_PARTY: + if (sBoxCursorPosition < PARTY_SIZE) + { + SetCursorMonData(&gPlayerParty[sBoxCursorPosition], MODE_PARTY); + break; + } + // fallthrough + case CURSOR_AREA_BUTTONS: + case CURSOR_AREA_BOX: + SetCursorMonData(NULL, MODE_2); + break; + case CURSOR_AREA_IN_BOX: + SetCursorMonData(GetBoxedMonPtr(StorageGetCurrentBox(), sBoxCursorPosition), MODE_BOX); + break; + } + } +} + +static void sub_80CEBDC(void) +{ + if (sIsMonBeingMoved) + SetCursorMonData(&gUnknown_02039D14, MODE_PARTY); + else + sub_80CEB40(); +} + +static void SetCursorMonData(void *pokemon, u8 mode) +{ + u8 *txtPtr; + u16 gender; + bool8 sanityIsBagEgg; + + sPSSData->cursorMonItem = 0; + gender = MON_MALE; + sanityIsBagEgg = FALSE; + if (mode == MODE_PARTY) + { + struct Pokemon *mon = (struct Pokemon *)pokemon; + + sPSSData->cursorMonSpecies = GetMonData(mon, MON_DATA_SPECIES2); + if (sPSSData->cursorMonSpecies != SPECIES_NONE) + { + sanityIsBagEgg = GetMonData(mon, MON_DATA_SANITY_IS_BAD_EGG); + if (sanityIsBagEgg) + sPSSData->cursorMonIsEgg = TRUE; + else + sPSSData->cursorMonIsEgg = GetMonData(mon, MON_DATA_IS_EGG); + + GetMonData(mon, MON_DATA_NICKNAME, sPSSData->cursorMonNick); + StringGetEnd10(sPSSData->cursorMonNick); + sPSSData->cursorMonLevel = GetMonData(mon, MON_DATA_LEVEL); + sPSSData->cursorMonMarkings = GetMonData(mon, MON_DATA_MARKINGS); + sPSSData->cursorMonPersonality = GetMonData(mon, MON_DATA_PERSONALITY); + sPSSData->cursorMonPalette = GetMonFrontSpritePal(mon); + gender = GetMonGender(mon); + sPSSData->cursorMonItem = GetMonData(mon, MON_DATA_HELD_ITEM); + } + } + else if (mode == MODE_BOX) + { + struct BoxPokemon *boxMon = (struct BoxPokemon *)pokemon; + + sPSSData->cursorMonSpecies = GetBoxMonData(pokemon, MON_DATA_SPECIES2); + if (sPSSData->cursorMonSpecies != SPECIES_NONE) + { + u32 otId = GetBoxMonData(boxMon, MON_DATA_OT_ID); + sanityIsBagEgg = GetBoxMonData(boxMon, MON_DATA_SANITY_IS_BAD_EGG); + if (sanityIsBagEgg) + sPSSData->cursorMonIsEgg = TRUE; + else + sPSSData->cursorMonIsEgg = GetBoxMonData(boxMon, MON_DATA_IS_EGG); + + + GetBoxMonData(boxMon, MON_DATA_NICKNAME, sPSSData->cursorMonNick); + StringGetEnd10(sPSSData->cursorMonNick); + sPSSData->cursorMonLevel = GetLevelFromBoxMonExp(boxMon); + sPSSData->cursorMonMarkings = GetBoxMonData(boxMon, MON_DATA_MARKINGS); + sPSSData->cursorMonPersonality = GetBoxMonData(boxMon, MON_DATA_PERSONALITY); + sPSSData->cursorMonPalette = GetFrontSpritePalFromSpeciesAndPersonality(sPSSData->cursorMonSpecies, otId, sPSSData->cursorMonPersonality); + gender = GetGenderFromSpeciesAndPersonality(sPSSData->cursorMonSpecies, sPSSData->cursorMonPersonality); + sPSSData->cursorMonItem = GetBoxMonData(boxMon, MON_DATA_HELD_ITEM); + } + } + else + { + sPSSData->cursorMonSpecies = SPECIES_NONE; + sPSSData->cursorMonItem = 0; + } + + if (sPSSData->cursorMonSpecies == SPECIES_NONE) + { + StringFill(sPSSData->cursorMonNick, CHAR_SPACE, 5); + StringFill(sPSSData->cursorMonNickText, CHAR_SPACE, 8); + StringFill(sPSSData->cursorMonSpeciesName, CHAR_SPACE, 8); + StringFill(sPSSData->cursorMonGenderLvlText, CHAR_SPACE, 8); + StringFill(sPSSData->cursorMonItemName, CHAR_SPACE, 8); + } + else if (sPSSData->cursorMonIsEgg) + { + if (sanityIsBagEgg) + StringCopyPadded(sPSSData->cursorMonNickText, sPSSData->cursorMonNick, CHAR_SPACE, 5); + else + StringCopyPadded(sPSSData->cursorMonNickText, gText_EggNickname, CHAR_SPACE, 8); + + StringFill(sPSSData->cursorMonSpeciesName, CHAR_SPACE, 8); + StringFill(sPSSData->cursorMonGenderLvlText, CHAR_SPACE, 8); + StringFill(sPSSData->cursorMonItemName, CHAR_SPACE, 8); + } + else + { + if (sPSSData->cursorMonSpecies == SPECIES_NIDORAN_F || sPSSData->cursorMonSpecies == SPECIES_NIDORAN_M) + gender = MON_GENDERLESS; + + StringCopyPadded(sPSSData->cursorMonNickText, sPSSData->cursorMonNick, CHAR_SPACE, 5); + + txtPtr = sPSSData->cursorMonSpeciesName; + *(txtPtr)++ = CHAR_SLASH; + StringCopyPadded(txtPtr, gSpeciesNames[sPSSData->cursorMonSpecies], CHAR_SPACE, 5); + + txtPtr = sPSSData->cursorMonGenderLvlText; + *(txtPtr)++ = EXT_CTRL_CODE_BEGIN; + *(txtPtr)++ = 4; + switch (gender) + { + case MON_MALE: + *(txtPtr)++ = 4; + *(txtPtr)++ = 1; + *(txtPtr)++ = 5; + *(txtPtr)++ = CHAR_MALE; + break; + case MON_FEMALE: + *(txtPtr)++ = 6; + *(txtPtr)++ = 1; + *(txtPtr)++ = 7; + *(txtPtr)++ = CHAR_FEMALE; + break; + default: + *(txtPtr)++ = 2; + *(txtPtr)++ = 1; + *(txtPtr)++ = 3; + *(txtPtr)++ = 0x77; + break; + } + + *(txtPtr++) = EXT_CTRL_CODE_BEGIN; + *(txtPtr++) = 4; + *(txtPtr++) = 2; + *(txtPtr++) = 1; + *(txtPtr++) = 3; + *(txtPtr++) = 0; + *(txtPtr++) = CHAR_SPECIAL_F9; + *(txtPtr++) = 5; + + txtPtr = ConvertIntToDecimalStringN(txtPtr, sPSSData->cursorMonLevel, STR_CONV_MODE_LEFT_ALIGN, 3); + txtPtr[0] = CHAR_SPACE; + txtPtr[1] = EOS; + + if (sPSSData->cursorMonItem != 0) + StringCopyPadded(sPSSData->cursorMonItemName, ItemId_GetName(sPSSData->cursorMonItem), CHAR_SPACE, 8); + else + StringFill(sPSSData->cursorMonItemName, CHAR_SPACE, 8); + } +} + +static u8 HandleInput_InBox(void) +{ + switch (sPSSData->inBoxMovingMode) + { + case 0: + default: + return InBoxInput_Normal(); + case 1: + return InBoxInput_GrabbingMultiple(); + case 2: + return InBoxInput_MovingMultiple(); + } +} + +// This group of four functions handling input simply CANNOT be matched. +// GF must have written them in a really weird way, a way not a sane person could dream to reproduce. +#ifdef NONMATCHING +static u8 InBoxInput_Normal(void) +{ + u8 retVal; + s8 cursorArea = sBoxCursorArea; + s8 cursorPosition = sBoxCursorPosition; + + sPSSData->field_CD2 = 0; + sPSSData->field_CD3 = 0; + sPSSData->field_CD7 = 0; + retVal = 0; + if (!(gMain.newAndRepeatedKeys & DPAD_UP)) + { + if (gMain.newAndRepeatedKeys & DPAD_DOWN) + { + retVal = TRUE; + cursorPosition += IN_BOX_ROWS; + if (cursorPosition >= IN_BOX_COUNT) + { + cursorArea = CURSOR_AREA_BUTTONS; + cursorPosition -= IN_BOX_COUNT; + cursorPosition /= 3; + sPSSData->field_CD2 = 1; + sPSSData->field_CD7 = 1; + } + } + else if (gMain.newAndRepeatedKeys & DPAD_LEFT) + { + retVal = TRUE; + if (sBoxCursorPosition % IN_BOX_ROWS != 0) + { + cursorPosition--; + } + else + { + sPSSData->field_CD3 = -1; + cursorPosition += (IN_BOX_ROWS - 1); + } + } + else if (gMain.newAndRepeatedKeys & DPAD_RIGHT) + { + retVal = TRUE; + if ((sBoxCursorPosition + 1) % IN_BOX_ROWS != 0) + { + cursorPosition++; + } + else + { + sPSSData->field_CD3 = 1; + cursorPosition -= (IN_BOX_ROWS - 1); + } + } + else if (gMain.newKeys & START_BUTTON) + { + retVal = TRUE; + cursorArea = CURSOR_AREA_BOX; + cursorPosition = 0; + } + else + { + if ((gMain.newKeys & A_BUTTON) && sub_80CFA5C()) + { + if (!sCanOnlyMove) + return 8; + + if (sPSSData->boxOption == BOX_OPTION_MOVE_MONS || sIsMonBeingMoved == TRUE) + { + switch (sub_80CFF98(0)) + { + case 1: + return 11; + case 2: + return 12; + case 3: + return 13; + case 4: + return 14; + case 5: + return 15; + case 12: + return 16; + case 13: + return 17; + case 15: + return 18; + } + } + else + { + sPSSData->inBoxMovingMode = 1; + return 20; + } + } + + if (gMain.newKeys & B_BUTTON) + return 19; + + if (gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR) + { + if (gMain.heldKeys & L_BUTTON) + return 10; + if (gMain.heldKeys & R_BUTTON) + return 9; + } + + if (gMain.newKeys & SELECT_BUTTON) + { + sub_80CFDC4(); + return 0; + } + retVal = FALSE; + } + } + else + { + retVal = TRUE; + if (sBoxCursorPosition >= IN_BOX_ROWS) + { + cursorPosition -= IN_BOX_ROWS; + } + else + { + cursorArea = CURSOR_AREA_BOX; + cursorPosition = 0; + } + } + + if (retVal) + sub_80CD894(cursorArea, cursorPosition); + + return retVal; +} +#else +NAKED +static u8 InBoxInput_Normal(void) +{ + asm_unified("\n\ + push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + ldr r0, =sBoxCursorArea\n\ + ldrb r0, [r0]\n\ + mov r8, r0\n\ + ldr r2, =sBoxCursorPosition\n\ + ldrb r4, [r2]\n\ + ldr r5, =sPSSData\n\ + ldr r0, [r5]\n\ + ldr r1, =0x00000cd2\n\ + mov r10, r1\n\ + add r0, r10\n\ + movs r1, 0\n\ + strb r1, [r0]\n\ + ldr r0, [r5]\n\ + ldr r7, =0x00000cd3\n\ + adds r0, r7\n\ + strb r1, [r0]\n\ + ldr r0, [r5]\n\ + ldr r3, =0x00000cd7\n\ + mov r9, r3\n\ + add r0, r9\n\ + strb r1, [r0]\n\ + ldr r6, =gMain\n\ + ldrh r1, [r6, 0x30]\n\ + movs r0, 0x40\n\ + ands r0, r1\n\ + adds r3, r2, 0\n\ + cmp r0, 0\n\ + beq _080CF14C\n\ + b _080CF33C\n\ +_080CF14C:\n\ + movs r0, 0x80\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF1A8\n\ + movs r6, 0x1\n\ + lsls r0, r4, 24\n\ + movs r1, 0xC0\n\ + lsls r1, 19\n\ + adds r0, r1\n\ + lsrs r4, r0, 24\n\ + asrs r0, 24\n\ + cmp r0, 0x1D\n\ + bgt _080CF168\n\ + b _080CF358\n\ +_080CF168:\n\ + movs r2, 0x3\n\ + mov r8, r2\n\ + subs r0, 0x1E\n\ + lsls r0, 24\n\ + asrs r0, 24\n\ + movs r1, 0x3\n\ + bl __divsi3\n\ + lsls r0, 24\n\ + lsrs r4, r0, 24\n\ + ldr r0, [r5]\n\ + add r0, r10\n\ + strb r6, [r0]\n\ + ldr r0, [r5]\n\ + add r0, r9\n\ + strb r6, [r0]\n\ + b _080CF358\n\ + .pool\n\ +_080CF1A8:\n\ + movs r0, 0x20\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF1DE\n\ + movs r6, 0x1\n\ + movs r0, 0\n\ + ldrsb r0, [r3, r0]\n\ + movs r1, 0x6\n\ + bl __modsi3\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + beq _080CF1CA\n\ + lsls r0, r4, 24\n\ + movs r3, 0xFF\n\ + lsls r3, 24\n\ + b _080CF34C\n\ +_080CF1CA:\n\ + ldr r0, [r5]\n\ + adds r0, r7\n\ + movs r1, 0xFF\n\ + strb r1, [r0]\n\ + lsls r0, r4, 24\n\ + movs r1, 0xA0\n\ + lsls r1, 19\n\ + adds r0, r1\n\ + lsrs r4, r0, 24\n\ + b _080CF358\n\ +_080CF1DE:\n\ + movs r0, 0x10\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF212\n\ + movs r6, 0x1\n\ + movs r0, 0\n\ + ldrsb r0, [r3, r0]\n\ + adds r0, 0x1\n\ + movs r1, 0x6\n\ + bl __modsi3\n\ + cmp r0, 0\n\ + beq _080CF204\n\ + lsls r0, r4, 24\n\ + movs r2, 0x80\n\ + lsls r2, 17\n\ + adds r0, r2\n\ + lsrs r4, r0, 24\n\ + b _080CF358\n\ +_080CF204:\n\ + ldr r0, [r5]\n\ + adds r0, r7\n\ + strb r6, [r0]\n\ + lsls r0, r4, 24\n\ + movs r3, 0xFB\n\ + lsls r3, 24\n\ + b _080CF34C\n\ +_080CF212:\n\ + ldrh r1, [r6, 0x2E]\n\ + movs r0, 0x8\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF220\n\ + movs r6, 0x1\n\ + b _080CF352\n\ +_080CF220:\n\ + movs r4, 0x1\n\ + movs r0, 0x1\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF2E4\n\ + bl sub_80CFA5C\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + beq _080CF2E4\n\ + ldr r0, =sCanOnlyMove\n\ + ldrb r0, [r0]\n\ + cmp r0, 0\n\ + bne _080CF244\n\ + movs r0, 0x8\n\ + b _080CF366\n\ + .pool\n\ +_080CF244:\n\ + ldr r1, [r5]\n\ + ldrb r0, [r1, 0x1]\n\ + cmp r0, 0x2\n\ + bne _080CF254\n\ + ldr r0, =sIsMonBeingMoved\n\ + ldrb r0, [r0]\n\ + cmp r0, 0x1\n\ + bne _080CF2D4\n\ +_080CF254:\n\ + movs r0, 0\n\ + bl sub_80CFF98\n\ + subs r0, 0x1\n\ + lsls r0, 24\n\ + asrs r0, 24\n\ + cmp r0, 0xE\n\ + bhi _080CF2E4\n\ + lsls r0, 2\n\ + ldr r1, =_080CF278\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + mov pc, r0\n\ + .pool\n\ + .align 2, 0\n\ +_080CF278:\n\ + .4byte _080CF2B4\n\ + .4byte _080CF2B8\n\ + .4byte _080CF2BC\n\ + .4byte _080CF2C0\n\ + .4byte _080CF2C4\n\ + .4byte _080CF2E4\n\ + .4byte _080CF2E4\n\ + .4byte _080CF2E4\n\ + .4byte _080CF2E4\n\ + .4byte _080CF2E4\n\ + .4byte _080CF2E4\n\ + .4byte _080CF2C8\n\ + .4byte _080CF2CC\n\ + .4byte _080CF2E4\n\ + .4byte _080CF2D0\n\ +_080CF2B4:\n\ + movs r0, 0xB\n\ + b _080CF366\n\ +_080CF2B8:\n\ + movs r0, 0xC\n\ + b _080CF366\n\ +_080CF2BC:\n\ + movs r0, 0xD\n\ + b _080CF366\n\ +_080CF2C0:\n\ + movs r0, 0xE\n\ + b _080CF366\n\ +_080CF2C4:\n\ + movs r0, 0xF\n\ + b _080CF366\n\ +_080CF2C8:\n\ + movs r0, 0x10\n\ + b _080CF366\n\ +_080CF2CC:\n\ + movs r0, 0x11\n\ + b _080CF366\n\ +_080CF2D0:\n\ + movs r0, 0x12\n\ + b _080CF366\n\ +_080CF2D4:\n\ + ldr r2, =0x000021ff\n\ + adds r0, r1, r2\n\ + strb r4, [r0]\n\ + movs r0, 0x14\n\ + b _080CF366\n\ + .pool\n\ +_080CF2E4:\n\ + ldr r2, =gMain\n\ + ldrh r1, [r2, 0x2E]\n\ + movs r0, 0x2\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF2F8\n\ + movs r0, 0x13\n\ + b _080CF366\n\ + .pool\n\ +_080CF2F8:\n\ + ldr r0, =gSaveBlock2Ptr\n\ + ldr r0, [r0]\n\ + ldrb r0, [r0, 0x13]\n\ + cmp r0, 0x1\n\ + bne _080CF326\n\ + ldrh r1, [r2, 0x2C]\n\ + movs r0, 0x80\n\ + lsls r0, 2\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF318\n\ + movs r0, 0xA\n\ + b _080CF366\n\ + .pool\n\ +_080CF318:\n\ + movs r0, 0x80\n\ + lsls r0, 1\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF326\n\ + movs r0, 0x9\n\ + b _080CF366\n\ +_080CF326:\n\ + ldrh r1, [r2, 0x2E]\n\ + movs r0, 0x4\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF338\n\ + bl sub_80CFDC4\n\ + movs r0, 0\n\ + b _080CF366\n\ +_080CF338:\n\ + movs r6, 0\n\ + b _080CF364\n\ +_080CF33C:\n\ + movs r6, 0x1\n\ + movs r0, 0\n\ + ldrsb r0, [r2, r0]\n\ + cmp r0, 0x5\n\ + ble _080CF352\n\ + lsls r0, r4, 24\n\ + movs r3, 0xFA\n\ + lsls r3, 24\n\ +_080CF34C:\n\ + adds r0, r3\n\ + lsrs r4, r0, 24\n\ + b _080CF358\n\ +_080CF352:\n\ + movs r0, 0x2\n\ + mov r8, r0\n\ + movs r4, 0\n\ +_080CF358:\n\ + cmp r6, 0\n\ + beq _080CF364\n\ + mov r0, r8\n\ + adds r1, r4, 0\n\ + bl sub_80CD894\n\ +_080CF364:\n\ + adds r0, r6, 0\n\ +_080CF366:\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r1}\n\ + bx r1\n\ + "); +} +#endif + +static u8 InBoxInput_GrabbingMultiple(void) +{ + if (gMain.heldKeys & A_BUTTON) + { + if (gMain.newAndRepeatedKeys & DPAD_UP) + { + if (sBoxCursorPosition / IN_BOX_ROWS != 0) + { + sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition - IN_BOX_ROWS); + return 21; + } + else + { + return 24; + } + } + else if (gMain.newAndRepeatedKeys & DPAD_DOWN) + { + if (sBoxCursorPosition + IN_BOX_ROWS < IN_BOX_COUNT) + { + sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition + IN_BOX_ROWS); + return 21; + } + else + { + return 24; + } + } + else if (gMain.newAndRepeatedKeys & DPAD_LEFT) + { + if (sBoxCursorPosition % IN_BOX_ROWS != 0) + { + sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition - 1); + return 21; + } + else + { + return 24; + } + } + else if (gMain.newAndRepeatedKeys & DPAD_RIGHT) + { + if ((sBoxCursorPosition + 1) % IN_BOX_ROWS != 0) + { + sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition + 1); + return 21; + } + else + { + return 24; + } + } + else + { + return 0; + } + } + else + { + if (sub_80D0BA4() == sBoxCursorPosition) + { + sPSSData->inBoxMovingMode = 0; + sPSSData->field_CB8->invisible = FALSE; + return 22; + } + else + { + sIsMonBeingMoved = (sPSSData->cursorMonSpecies != SPECIES_NONE); + sPSSData->inBoxMovingMode = 2; + sMovingMonOrigBoxId = StorageGetCurrentBox(); + return 23; + } + } +} + +static u8 InBoxInput_MovingMultiple(void) +{ + if (gMain.newAndRepeatedKeys & DPAD_UP) + { + if (sub_80D0580(0)) + { + sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition - IN_BOX_ROWS); + return 25; + } + else + { + return 24; + } + } + else if (gMain.newAndRepeatedKeys & DPAD_DOWN) + { + if (sub_80D0580(1)) + { + sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition + IN_BOX_ROWS); + return 25; + } + else + { + return 24; + } + } + else if (gMain.newAndRepeatedKeys & DPAD_LEFT) + { + if (sub_80D0580(2)) + { + sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition - 1); + return 25; + } + else + { + return 10; + } + } + else if (gMain.newAndRepeatedKeys & DPAD_RIGHT) + { + if (sub_80D0580(3)) + { + sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition + 1); + return 25; + } + else + { + return 9; + } + } + else if (gMain.newKeys & A_BUTTON) + { + if (sub_80D0BC0()) + { + sIsMonBeingMoved = FALSE; + sPSSData->inBoxMovingMode = 0; + return 26; + } + else + { + return 24; + } + } + else if (gMain.newKeys & B_BUTTON) + { + return 24; + } + else + { + if (gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR) + { + if (gMain.heldKeys & L_BUTTON) + return 10; + if (gMain.heldKeys & R_BUTTON) + return 9; + } + + return 0; + } +} + +#ifdef NONMATCHING +static u8 HandleInput_InParty(void) +{ + u8 retVal; + bool8 gotoBox; + s8 cursorArea = sBoxCursorArea; + s8 cursorPosition = sBoxCursorPosition; + + sPSSData->field_CD3 = 0; + sPSSData->field_CD2 = 0; + sPSSData->field_CD7 = 0; + gotoBox = FALSE; + retVal = 0; + + if (!(gMain.newAndRepeatedKeys & DPAD_UP)) + { + if (gMain.newAndRepeatedKeys & DPAD_DOWN) + { + if (++cursorPosition > PARTY_SIZE) + cursorPosition = 0; + if (cursorPosition != sBoxCursorPosition) + retVal = 1; + } + else if ((gMain.newAndRepeatedKeys & DPAD_LEFT) && sBoxCursorPosition != 0) + { + retVal = 1; + sPSSData->field_CD6 = sBoxCursorPosition; + cursorPosition = 0; + } + else if (gMain.newAndRepeatedKeys & DPAD_RIGHT) + { + if (sBoxCursorPosition == 0) + { + retVal = 1; + cursorPosition = sPSSData->field_CD6; + } + else + { + retVal = 6; + cursorArea = CURSOR_AREA_IN_BOX; + cursorPosition = 0; + } + } + else + { + if (gMain.newKeys & A_BUTTON) + { + if (sBoxCursorPosition == PARTY_SIZE) + { + if (sPSSData->boxOption == BOX_OPTION_DEPOSIT) + return 4; + + gotoBox = TRUE; + } + else if (sub_80CFA5C()) + { + if (!sCanOnlyMove) + return 8; + + switch (sub_80CFF98(0)) + { + case 1: + return 11; + case 2: + return 12; + case 3: + return 13; + case 4: + return 14; + case 5: + return 15; + case 12: + return 16; + case 13: + return 17; + case 15: + return 18; + } + } + } + + if (gMain.newKeys & B_BUTTON) + { + if (sPSSData->boxOption == BOX_OPTION_DEPOSIT) + return 19; + + gotoBox = TRUE; + } + + if (gotoBox) + { + retVal = 6; + cursorArea = CURSOR_AREA_IN_BOX; + cursorPosition = 0; + } + else if (gMain.newKeys & SELECT_BUTTON) + { + sub_80CFDC4(); + return 0; + } + } + } + else + { + if (--cursorPosition < 0) + cursorPosition = PARTY_SIZE; + if (cursorPosition != sBoxCursorPosition) + retVal = 1; + } + if (retVal != 0) + { + if (retVal != 6) + sub_80CD894(cursorArea, cursorPosition); + } + + return retVal; +} +#else +NAKED +static u8 HandleInput_InParty(void) +{ + asm_unified("\n\ + push {r4-r7,lr}\n\ + mov r7, r9\n\ + mov r6, r8\n\ + push {r6,r7}\n\ + ldr r0, =sBoxCursorArea\n\ + ldrb r0, [r0]\n\ + mov r9, r0\n\ + ldr r6, =sBoxCursorPosition\n\ + ldrb r4, [r6]\n\ + ldr r2, =sPSSData\n\ + ldr r0, [r2]\n\ + ldr r1, =0x00000cd3\n\ + adds r0, r1\n\ + movs r1, 0\n\ + strb r1, [r0]\n\ + ldr r0, [r2]\n\ + ldr r3, =0x00000cd2\n\ + adds r0, r3\n\ + strb r1, [r0]\n\ + ldr r0, [r2]\n\ + adds r3, 0x5\n\ + adds r0, r3\n\ + strb r1, [r0]\n\ + mov r8, r1\n\ + movs r7, 0\n\ + ldr r1, =gMain\n\ + ldrh r3, [r1, 0x30]\n\ + movs r0, 0x40\n\ + ands r0, r3\n\ + adds r5, r6, 0\n\ + mov r12, r1\n\ + cmp r0, 0\n\ + beq _080CF608\n\ + b _080CF7A8\n\ +_080CF608:\n\ + movs r0, 0x80\n\ + ands r0, r3\n\ + cmp r0, 0\n\ + beq _080CF64C\n\ + lsls r0, r4, 24\n\ + movs r1, 0x80\n\ + lsls r1, 17\n\ + adds r0, r1\n\ + lsrs r4, r0, 24\n\ + asrs r0, 24\n\ + cmp r0, 0x6\n\ + ble _080CF622\n\ + movs r4, 0\n\ +_080CF622:\n\ + lsls r0, r4, 24\n\ + asrs r0, 24\n\ + movs r1, 0\n\ + ldrsb r1, [r5, r1]\n\ + cmp r0, r1\n\ + bne _080CF630\n\ + b _080CF7C6\n\ +_080CF630:\n\ + movs r7, 0x1\n\ + b _080CF7CA\n\ + .pool\n\ +_080CF64C:\n\ + movs r0, 0x20\n\ + ands r0, r3\n\ + cmp r0, 0\n\ + beq _080CF670\n\ + ldrb r1, [r5]\n\ + movs r0, 0\n\ + ldrsb r0, [r5, r0]\n\ + cmp r0, 0\n\ + beq _080CF670\n\ + movs r7, 0x1\n\ + ldr r0, [r2]\n\ + ldr r2, =0x00000cd6\n\ + adds r0, r2\n\ + strb r1, [r0]\n\ + movs r4, 0\n\ + b _080CF7C6\n\ + .pool\n\ +_080CF670:\n\ + mov r3, r12\n\ + ldrh r1, [r3, 0x30]\n\ + movs r0, 0x10\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF69E\n\ + movs r0, 0\n\ + ldrsb r0, [r5, r0]\n\ + cmp r0, 0\n\ + bne _080CF694\n\ + movs r7, 0x1\n\ + ldr r0, [r2]\n\ + ldr r1, =0x00000cd6\n\ + adds r0, r1\n\ + ldrb r4, [r0]\n\ + b _080CF7C6\n\ + .pool\n\ +_080CF694:\n\ + movs r7, 0x6\n\ + movs r2, 0\n\ + mov r9, r2\n\ + movs r4, 0\n\ + b _080CF7C6\n\ +_080CF69E:\n\ + mov r3, r12\n\ + ldrh r1, [r3, 0x2E]\n\ + movs r0, 0x1\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF75C\n\ + movs r0, 0\n\ + ldrsb r0, [r5, r0]\n\ + cmp r0, 0x6\n\ + bne _080CF6C4\n\ + ldr r0, [r2]\n\ + ldrb r0, [r0, 0x1]\n\ + cmp r0, 0x1\n\ + bne _080CF6BE\n\ + movs r0, 0x4\n\ + b _080CF7D8\n\ +_080CF6BE:\n\ + movs r0, 0x1\n\ + mov r8, r0\n\ + b _080CF75C\n\ +_080CF6C4:\n\ + bl sub_80CFA5C\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + beq _080CF75C\n\ + ldr r0, =sCanOnlyMove\n\ + ldrb r0, [r0]\n\ + cmp r0, 0\n\ + bne _080CF6E0\n\ + movs r0, 0x8\n\ + b _080CF7D8\n\ + .pool\n\ +_080CF6E0:\n\ + movs r0, 0\n\ + bl sub_80CFF98\n\ + subs r0, 0x1\n\ + lsls r0, 24\n\ + asrs r0, 24\n\ + cmp r0, 0xE\n\ + bhi _080CF75C\n\ + lsls r0, 2\n\ + ldr r1, =_080CF700\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + mov pc, r0\n\ + .pool\n\ + .align 2, 0\n\ +_080CF700:\n\ + .4byte _080CF73C\n\ + .4byte _080CF740\n\ + .4byte _080CF744\n\ + .4byte _080CF748\n\ + .4byte _080CF74C\n\ + .4byte _080CF75C\n\ + .4byte _080CF75C\n\ + .4byte _080CF75C\n\ + .4byte _080CF75C\n\ + .4byte _080CF75C\n\ + .4byte _080CF75C\n\ + .4byte _080CF750\n\ + .4byte _080CF754\n\ + .4byte _080CF75C\n\ + .4byte _080CF758\n\ +_080CF73C:\n\ + movs r0, 0xB\n\ + b _080CF7D8\n\ +_080CF740:\n\ + movs r0, 0xC\n\ + b _080CF7D8\n\ +_080CF744:\n\ + movs r0, 0xD\n\ + b _080CF7D8\n\ +_080CF748:\n\ + movs r0, 0xE\n\ + b _080CF7D8\n\ +_080CF74C:\n\ + movs r0, 0xF\n\ + b _080CF7D8\n\ +_080CF750:\n\ + movs r0, 0x10\n\ + b _080CF7D8\n\ +_080CF754:\n\ + movs r0, 0x11\n\ + b _080CF7D8\n\ +_080CF758:\n\ + movs r0, 0x12\n\ + b _080CF7D8\n\ +_080CF75C:\n\ + ldr r2, =gMain\n\ + ldrh r1, [r2, 0x2E]\n\ + movs r0, 0x2\n\ + ands r0, r1\n\ + mov r12, r2\n\ + cmp r0, 0\n\ + beq _080CF784\n\ + ldr r0, =sPSSData\n\ + ldr r0, [r0]\n\ + ldrb r0, [r0, 0x1]\n\ + cmp r0, 0x1\n\ + bne _080CF780\n\ + movs r0, 0x13\n\ + b _080CF7D8\n\ + .pool\n\ +_080CF780:\n\ + movs r1, 0x1\n\ + mov r8, r1\n\ +_080CF784:\n\ + mov r2, r8\n\ + cmp r2, 0\n\ + beq _080CF794\n\ + movs r7, 0x6\n\ + movs r3, 0\n\ + mov r9, r3\n\ + movs r4, 0\n\ + b _080CF7C6\n\ +_080CF794:\n\ + mov r0, r12\n\ + ldrh r1, [r0, 0x2E]\n\ + movs r0, 0x4\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF7C6\n\ + bl sub_80CFDC4\n\ + movs r0, 0\n\ + b _080CF7D8\n\ +_080CF7A8:\n\ + lsls r0, r4, 24\n\ + movs r1, 0xFF\n\ + lsls r1, 24\n\ + adds r0, r1\n\ + lsrs r4, r0, 24\n\ + cmp r0, 0\n\ + bge _080CF7B8\n\ + movs r4, 0x6\n\ +_080CF7B8:\n\ + lsls r0, r4, 24\n\ + asrs r0, 24\n\ + movs r1, 0\n\ + ldrsb r1, [r6, r1]\n\ + cmp r0, r1\n\ + beq _080CF7C6\n\ + movs r7, 0x1\n\ +_080CF7C6:\n\ + cmp r7, 0\n\ + beq _080CF7D6\n\ +_080CF7CA:\n\ + cmp r7, 0x6\n\ + beq _080CF7D6\n\ + mov r0, r9\n\ + adds r1, r4, 0\n\ + bl sub_80CD894\n\ +_080CF7D6:\n\ + adds r0, r7, 0\n\ +_080CF7D8:\n\ + pop {r3,r4}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + pop {r4-r7}\n\ + pop {r1}\n\ + bx r1"); +} +#endif + +#ifdef NONMATCHING +static u8 HandleInput_OnBox(void) +{ + u8 retVal; + s8 cursorArea = sBoxCursorArea; + s8 cursorPosition = sBoxCursorPosition; + + sPSSData->field_CD3 = 0; + sPSSData->field_CD2 = 0; + sPSSData->field_CD7 = 0; + retVal = 0; + + if (!(gMain.newAndRepeatedKeys & DPAD_UP)) + { + if (gMain.newAndRepeatedKeys & DPAD_DOWN) + { + retVal = 1; + cursorArea = CURSOR_AREA_IN_BOX; + cursorPosition = 2; + } + else + { + if (gMain.heldKeys & DPAD_LEFT) + return 10; + if (gMain.heldKeys & DPAD_RIGHT) + return 9; + + if (gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR) + { + if (gMain.heldKeys & L_BUTTON) + return 10; + if (gMain.heldKeys & R_BUTTON) + return 9; + } + + if (gMain.newKeys & A_BUTTON) + { + sub_80CD1A8(FALSE); + AddBoxMenu(); + return 7; + } + + if (gMain.newKeys & B_BUTTON) + return 19; + + if (gMain.newKeys & SELECT_BUTTON) + { + sub_80CFDC4(); + return 0; + } + + retVal = 0; + } + } + else + { + retVal = 1; + cursorArea = CURSOR_AREA_BUTTONS; + cursorPosition = 0; + sPSSData->field_CD7 = 1; + } + + if (retVal) + { + if (cursorArea != CURSOR_AREA_BOX) + sub_80CD1A8(FALSE); + sub_80CD894(cursorArea, cursorPosition); + } + + return retVal; +} +#else +NAKED +static u8 HandleInput_OnBox(void) +{ + asm_unified("\n\ + push {r4-r6,lr}\n\ + ldr r3, =sPSSData\n\ + ldr r0, [r3]\n\ + ldr r1, =0x00000cd3\n\ + adds r0, r1\n\ + movs r1, 0\n\ + strb r1, [r0]\n\ + ldr r0, [r3]\n\ + ldr r2, =0x00000cd2\n\ + adds r0, r2\n\ + strb r1, [r0]\n\ + ldr r0, [r3]\n\ + ldr r5, =0x00000cd7\n\ + adds r0, r5\n\ + strb r1, [r0]\n\ + ldr r1, =gMain\n\ + ldrh r2, [r1, 0x30]\n\ + movs r0, 0x40\n\ + ands r0, r2\n\ + cmp r0, 0\n\ + bne _080CF8AA\n\ + movs r0, 0x80\n\ + ands r0, r2\n\ + cmp r0, 0\n\ + beq _080CF834\n\ + movs r4, 0x1\n\ + movs r1, 0\n\ + movs r6, 0x2\n\ + b _080CF8B6\n\ + .pool\n\ +_080CF834:\n\ + ldrh r2, [r1, 0x2C]\n\ + movs r0, 0x20\n\ + ands r0, r2\n\ + cmp r0, 0\n\ + bne _080CF85A\n\ + movs r0, 0x10\n\ + ands r0, r2\n\ + cmp r0, 0\n\ + bne _080CF86E\n\ + ldr r0, =gSaveBlock2Ptr\n\ + ldr r0, [r0]\n\ + ldrb r0, [r0, 0x13]\n\ + cmp r0, 0x1\n\ + bne _080CF872\n\ + movs r0, 0x80\n\ + lsls r0, 2\n\ + ands r0, r2\n\ + cmp r0, 0\n\ + beq _080CF864\n\ +_080CF85A:\n\ + movs r0, 0xA\n\ + b _080CF8D2\n\ + .pool\n\ +_080CF864:\n\ + movs r0, 0x80\n\ + lsls r0, 1\n\ + ands r0, r2\n\ + cmp r0, 0\n\ + beq _080CF872\n\ +_080CF86E:\n\ + movs r0, 0x9\n\ + b _080CF8D2\n\ +_080CF872:\n\ + ldrh r1, [r1, 0x2E]\n\ + movs r0, 0x1\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF88A\n\ + movs r0, 0\n\ + bl sub_80CD1A8\n\ + bl AddBoxMenu\n\ + movs r0, 0x7\n\ + b _080CF8D2\n\ +_080CF88A:\n\ + movs r0, 0x2\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF896\n\ + movs r0, 0x13\n\ + b _080CF8D2\n\ +_080CF896:\n\ + movs r0, 0x4\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF8A6\n\ + bl sub_80CFDC4\n\ + movs r0, 0\n\ + b _080CF8D2\n\ +_080CF8A6:\n\ + movs r4, 0\n\ + b _080CF8D0\n\ +_080CF8AA:\n\ + movs r4, 0x1\n\ + movs r1, 0x3\n\ + movs r6, 0\n\ + ldr r0, [r3]\n\ + adds r0, r5\n\ + strb r4, [r0]\n\ +_080CF8B6:\n\ + cmp r4, 0\n\ + beq _080CF8D0\n\ + lsls r5, r1, 24\n\ + cmp r1, 0x2\n\ + beq _080CF8C6\n\ + movs r0, 0\n\ + bl sub_80CD1A8\n\ +_080CF8C6:\n\ + lsrs r0, r5, 24\n\ + lsls r1, r6, 24\n\ + lsrs r1, 24\n\ + bl sub_80CD894\n\ +_080CF8D0:\n\ + adds r0, r4, 0\n\ +_080CF8D2:\n\ + pop {r4-r6}\n\ + pop {r1}\n\ + bx r1\n\ + "); +} +#endif + +#ifdef NONMATCHING +static u8 HandleInput_OnButtons(void) +{ + u8 retVal; + s8 cursorArea = sBoxCursorArea; + s8 cursorPosition = sBoxCursorPosition; + + sPSSData->field_CD3 = 0; + sPSSData->field_CD2 = 0; + sPSSData->field_CD7 = 0; + + if (!(gMain.newAndRepeatedKeys & DPAD_UP)) + { + if (gMain.newAndRepeatedKeys & (DPAD_DOWN | START_BUTTON)) + { + retVal = 1; + cursorArea = CURSOR_AREA_BOX; + cursorPosition = 0; + sPSSData->field_CD7 = 1; + } + else if (gMain.newAndRepeatedKeys & DPAD_LEFT) + { + retVal = 1; + if (--cursorPosition < 0) + { + cursorPosition = 1; + } + } + else if (gMain.newAndRepeatedKeys & DPAD_RIGHT) + { + retVal = 1; + if (++cursorPosition > 1) + { + cursorPosition = 0; + } + } + else if (gMain.newKeys & A_BUTTON) + { + return (cursorPosition == 0) ? 5 : 4; + } + else if (gMain.newKeys & B_BUTTON) + { + return 19; + } + else if (gMain.newKeys & SELECT_BUTTON) + { + sub_80CFDC4(); + return 0; + } + else + { + retVal = 0; + } + } + else + { + retVal = 1; + cursorArea = CURSOR_AREA_IN_BOX; + sPSSData->field_CD2 = -1; + cursorPosition = (sBoxCursorPosition == 0) ? IN_BOX_COUNT - 1 - 5 : IN_BOX_COUNT - 1; + sPSSData->field_CD7 = 1; + } + + if (retVal != 0) + { + sub_80CD894(cursorArea, cursorPosition); + } + + return retVal; +} +#else +NAKED +static u8 HandleInput_OnButtons(void) +{ + asm_unified("\n\ + push {r4-r7,lr}\n\ + mov r7, r8\n\ + push {r7}\n\ + ldr r0, =sBoxCursorArea\n\ + ldrb r0, [r0]\n\ + mov r8, r0\n\ + ldr r0, =sBoxCursorPosition\n\ + mov r12, r0\n\ + ldrb r2, [r0]\n\ + ldr r3, =sPSSData\n\ + ldr r0, [r3]\n\ + ldr r1, =0x00000cd3\n\ + adds r0, r1\n\ + movs r1, 0\n\ + strb r1, [r0]\n\ + ldr r0, [r3]\n\ + ldr r6, =0x00000cd2\n\ + adds r0, r6\n\ + strb r1, [r0]\n\ + ldr r0, [r3]\n\ + ldr r5, =0x00000cd7\n\ + adds r0, r5\n\ + strb r1, [r0]\n\ + ldr r7, =gMain\n\ + ldrh r1, [r7, 0x30]\n\ + movs r0, 0x40\n\ + ands r0, r1\n\ + adds r4, r3, 0\n\ + cmp r0, 0\n\ + bne _080CF9B2\n\ + movs r0, 0x88\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF944\n\ + movs r7, 0x1\n\ + movs r0, 0x2\n\ + mov r8, r0\n\ + movs r2, 0\n\ + ldr r0, [r4]\n\ + b _080CF9D0\n\ + .pool\n\ +_080CF944:\n\ + movs r0, 0x20\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF960\n\ + movs r7, 0x1\n\ + lsls r0, r2, 24\n\ + movs r1, 0xFF\n\ + lsls r1, 24\n\ + adds r0, r1\n\ + lsrs r2, r0, 24\n\ + cmp r0, 0\n\ + bge _080CF9D4\n\ + movs r2, 0x1\n\ + b _080CF9D4\n\ +_080CF960:\n\ + movs r0, 0x10\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF97E\n\ + movs r7, 0x1\n\ + lsls r0, r2, 24\n\ + movs r1, 0x80\n\ + lsls r1, 17\n\ + adds r0, r1\n\ + lsrs r2, r0, 24\n\ + asrs r0, 24\n\ + cmp r0, 0x1\n\ + ble _080CF9D4\n\ + movs r2, 0\n\ + b _080CF9D4\n\ +_080CF97E:\n\ + ldrh r1, [r7, 0x2E]\n\ + movs r0, 0x1\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF992\n\ + movs r0, 0x4\n\ + cmp r2, 0\n\ + bne _080CF9E2\n\ + movs r0, 0x5\n\ + b _080CF9E2\n\ +_080CF992:\n\ + movs r0, 0x2\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF99E\n\ + movs r0, 0x13\n\ + b _080CF9E2\n\ +_080CF99E:\n\ + movs r0, 0x4\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080CF9AE\n\ + bl sub_80CFDC4\n\ + movs r0, 0\n\ + b _080CF9E2\n\ +_080CF9AE:\n\ + movs r7, 0\n\ + b _080CF9E0\n\ +_080CF9B2:\n\ + movs r7, 0x1\n\ + movs r0, 0\n\ + mov r8, r0\n\ + ldr r0, [r3]\n\ + adds r0, r6\n\ + movs r1, 0xFF\n\ + strb r1, [r0]\n\ + mov r1, r12\n\ + movs r0, 0\n\ + ldrsb r0, [r1, r0]\n\ + movs r2, 0x1D\n\ + cmp r0, 0\n\ + bne _080CF9CE\n\ + movs r2, 0x18\n\ +_080CF9CE:\n\ + ldr r0, [r3]\n\ +_080CF9D0:\n\ + adds r0, r5\n\ + strb r7, [r0]\n\ +_080CF9D4:\n\ + cmp r7, 0\n\ + beq _080CF9E0\n\ + mov r0, r8\n\ + adds r1, r2, 0\n\ + bl sub_80CD894\n\ +_080CF9E0:\n\ + adds r0, r7, 0\n\ +_080CF9E2:\n\ + pop {r3}\n\ + mov r8, r3\n\ + pop {r4-r7}\n\ + pop {r1}\n\ + bx r1"); +} +#endif + +static u8 HandleInput(void) +{ + struct + { + u8 (*func)(void); + s8 area; + } + static const inputFuncs[] = + { + {HandleInput_InBox, CURSOR_AREA_IN_BOX}, + {HandleInput_InParty, CURSOR_AREA_IN_PARTY}, + {HandleInput_OnBox, CURSOR_AREA_BOX}, + {HandleInput_OnButtons, CURSOR_AREA_BUTTONS}, + {NULL, 0}, + }; + + u16 i = 0; + while (inputFuncs[i].func != NULL) + { + if (inputFuncs[i].area == sBoxCursorArea) + return inputFuncs[i].func(); + i++; + } + + return 0; +} + +static void AddBoxMenu(void) +{ + InitMenu(); + SetMenuText(9); + SetMenuText(10); + SetMenuText(11); + SetMenuText(0); +} + +static u8 sub_80CFA5C(void) +{ + InitMenu(); + if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + return sub_80CFA84(); + else + return sub_80CFB44(); +} + +static bool8 sub_80CFA84(void) +{ + u16 var0 = sub_80CD504(); + + switch (sPSSData->boxOption) + { + case BOX_OPTION_DEPOSIT: + if (var0) + SetMenuText(1); + else + return FALSE; + break; + case BOX_OPTION_WITHDRAW: + if (var0) + SetMenuText(2); + else + return FALSE; + break; + case BOX_OPTION_MOVE_MONS: + if (sIsMonBeingMoved) + { + if (var0) + SetMenuText(4); + else + SetMenuText(5); + } + else + { + if (var0) + SetMenuText(3); + else + return FALSE; + } + break; + case BOX_OPTION_MOVE_ITEMS: + default: + return FALSE; + } + + SetMenuText(6); + if (sPSSData->boxOption == BOX_OPTION_MOVE_MONS) + { + if (!sBoxCursorArea) + SetMenuText(2); + else + SetMenuText(1); + } + + SetMenuText(8); + SetMenuText(7); + SetMenuText(0); + return TRUE; +} + +static bool8 sub_80CFB44(void) +{ + if (sPSSData->cursorMonSpecies == SPECIES_EGG) + return FALSE; + + if (!IsActiveItemMoving()) + { + if (sPSSData->cursorMonItem == 0) + { + if (sPSSData->cursorMonSpecies == SPECIES_NONE) + return FALSE; + + SetMenuText(14); + } + else + { + if (!ItemIsMail(sPSSData->cursorMonItem)) + { + SetMenuText(12); + SetMenuText(16); + } + SetMenuText(17); + } + } + else + { + if (sPSSData->cursorMonItem == 0) + { + if (sPSSData->cursorMonSpecies == SPECIES_NONE) + return FALSE; + + SetMenuText(13); + } + else + { + if (ItemIsMail(sPSSData->cursorMonItem) == TRUE) + return FALSE; + + SetMenuText(15); + } + } + + SetMenuText(0); + return TRUE; +} + +static void sub_80CFBF4(struct Sprite *sprite) +{ + sprite->pos1.x = sPSSData->field_CB4->pos1.x; + sprite->pos1.y = sPSSData->field_CB4->pos1.y + 20; +} + +static void sub_80CFC14(void) +{ + u16 x, y; + u8 spriteId; + u8 priority, subpriority; + struct SpriteSheet spriteSheets[] = + { + {gHandCursorTiles, 0x800, 0}, + {gHandCursorShadowTiles, 0x80, 1}, + {} + }; + + struct SpritePalette spritePalettes[] = + { + {gHandCursorPalette, TAG_PAL_DAC7}, + {} + }; + + static const struct OamData sOamData_857BA0C = + { + .size = 2, + .priority = 1, + }; + static const struct OamData sOamData_857BA14 = + { + .size = 1, + .priority = 1, + }; + + static const union AnimCmd sSpriteAnim_857BA1C[] = + { + ANIMCMD_FRAME(0, 30), + ANIMCMD_FRAME(16, 30), + ANIMCMD_JUMP(0) + }; + static const union AnimCmd sSpriteAnim_857BA28[] = + { + ANIMCMD_FRAME(0, 5), + ANIMCMD_END + }; + static const union AnimCmd sSpriteAnim_857BA30[] = + { + ANIMCMD_FRAME(32, 5), + ANIMCMD_END + }; + static const union AnimCmd sSpriteAnim_857BA38[] = + { + ANIMCMD_FRAME(48, 5), + ANIMCMD_END + }; + + static const union AnimCmd *const sSpriteAnimTable_857BA40[] = + { + sSpriteAnim_857BA1C, + sSpriteAnim_857BA28, + sSpriteAnim_857BA30, + sSpriteAnim_857BA38 + }; + + static const struct SpriteTemplate gSpriteTemplate_857BA50 = + { + .tileTag = TAG_TILE_0, + .paletteTag = TAG_PAL_WAVEFORM, + .oam = &sOamData_857BA0C, + .anims = sSpriteAnimTable_857BA40, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, + }; + + static const struct SpriteTemplate gSpriteTemplate_857BA68 = + { + .tileTag = TAG_TILE_1, + .paletteTag = TAG_PAL_WAVEFORM, + .oam = &sOamData_857BA14, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80CFBF4, + }; + + LoadSpriteSheets(spriteSheets); + LoadSpritePalettes(spritePalettes); + sPSSData->field_CD8[0] = IndexOfSpritePaletteTag(TAG_PAL_WAVEFORM); + sPSSData->field_CD8[1] = IndexOfSpritePaletteTag(TAG_PAL_DAC7); + + sub_80CD444(sBoxCursorArea, sBoxCursorPosition, &x, &y); + spriteId = CreateSprite(&gSpriteTemplate_857BA50, x, y, 6); + if (spriteId != MAX_SPRITES) + { + sPSSData->field_CB4 = &gSprites[spriteId]; + sPSSData->field_CB4->oam.paletteNum = sPSSData->field_CD8[sCanOnlyMove]; + sPSSData->field_CB4->oam.priority = 1; + if (sIsMonBeingMoved) + StartSpriteAnim(sPSSData->field_CB4, 3); + } + else + { + sPSSData->field_CB4 = NULL; + } + + if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) + { + subpriority = 13; + priority = 1; + } + else + { + subpriority = 21; + priority = 2; + } + + spriteId = CreateSprite(&gSpriteTemplate_857BA68, 0, 0, subpriority); + if (spriteId != MAX_SPRITES) + { + sPSSData->field_CB8 = &gSprites[spriteId]; + sPSSData->field_CB8->oam.priority = priority; + if (sBoxCursorArea) + sPSSData->field_CB8->invisible = 1; + } + else + { + sPSSData->field_CB8 = NULL; + } +} + +static void sub_80CFDC4(void) +{ + sCanOnlyMove = !sCanOnlyMove; + sPSSData->field_CB4->oam.paletteNum = sPSSData->field_CD8[sCanOnlyMove]; +} + +static u8 GetBoxCursorPosition(void) +{ + return sBoxCursorPosition; +} + +static void sub_80CFE14(u8 *arg0, u8 *arg1) +{ + if (sBoxCursorArea == CURSOR_AREA_IN_BOX) + { + *arg0 = sBoxCursorPosition % IN_BOX_ROWS; + *arg1 = sBoxCursorPosition / IN_BOX_ROWS; + } + else + { + *arg0 = 0; + *arg1 = 0; + } +} + +static void sub_80CFE54(u8 animNum) +{ + StartSpriteAnim(sPSSData->field_CB4, animNum); +} + +static u8 sub_80CFE78(void) +{ + return sMovingMonOrigBoxId; +} + +static void sub_80CFE84(void) +{ + sPSSData->field_CB4->oam.priority = 1; +} + +static void sub_80CFEA8(void) +{ + if (sBoxCursorArea == CURSOR_AREA_IN_BOX) + sub_80D0E50(CURSOR_AREA_IN_BOX, sBoxCursorPosition); +} + +static void sub_80CFECC(void) +{ + if (sBoxCursorArea == CURSOR_AREA_IN_BOX) + sub_80D0D8C(CURSOR_AREA_IN_BOX, sBoxCursorPosition); +} + +static void InitMenu(void) +{ + sPSSData->menuItemsCount = 0; + sPSSData->menuWidth = 0; + sPSSData->menuWindow.bg = 0; + sPSSData->menuWindow.paletteNum = 15; + sPSSData->menuWindow.baseBlock = 92; +} + +static const u8 *const gUnknown_0857BA80[] = +{ + gPCText_Cancel, + gPCText_Store, + gPCText_Withdraw, + gPCText_Move, + gPCText_Shift, + gPCText_Place, + gPCText_Summary, + gPCText_Release, + gPCText_Mark, + gPCText_Jump, + gPCText_Wallpaper, + gPCText_Name, + gPCText_Take, + gPCText_Give, + gPCText_Give, + gPCText_Switch, + gPCText_Bag, + gPCText_Info, + gPCText_Scenery1, + gPCText_Scenery2, + gPCText_Scenery3, + gPCText_Etcetera, + gPCText_Friends, + gPCText_Forest, + gPCText_City, + gPCText_Desert, + gPCText_Savanna, + gPCText_Crag, + gPCText_Volcano, + gPCText_Snow, + gPCText_Cave, + gPCText_Beach, + gPCText_Seafloor, + gPCText_River, + gPCText_Sky, + gPCText_PolkaDot, + gPCText_Pokecenter, + gPCText_Machine, + gPCText_Simple, +}; + +static void SetMenuText(u8 textId) +{ + if (sPSSData->menuItemsCount < 7) + { + u8 len; + struct StorageMenu *menu = &sPSSData->menuItems[sPSSData->menuItemsCount]; + + menu->text = gUnknown_0857BA80[textId]; + menu->textId = textId; + len = StringLength(menu->text); + if (len > sPSSData->menuWidth) + sPSSData->menuWidth = len; + + sPSSData->menuItemsCount++; + } +} + +static s8 sub_80CFF98(u8 arg0) +{ + if (arg0 >= sPSSData->menuItemsCount) + return -1; + else + return sPSSData->menuItems[arg0].textId; +} + +static void AddMenu(void) +{ + sPSSData->menuWindow.width = sPSSData->menuWidth + 2; + sPSSData->menuWindow.height = 2 * sPSSData->menuItemsCount; + sPSSData->menuWindow.tilemapLeft = 29 - sPSSData->menuWindow.width; + sPSSData->menuWindow.tilemapTop = 15 - sPSSData->menuWindow.height; + sPSSData->field_CB0 = AddWindow(&sPSSData->menuWindow); + ClearWindowTilemap(sPSSData->field_CB0); + SetWindowBorderStyle(sPSSData->field_CB0, FALSE, 11, 14); + PrintMenuTable(sPSSData->field_CB0, sPSSData->menuItemsCount, (void*)sPSSData->menuItems); + InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sPSSData->field_CB0, sPSSData->menuItemsCount, 0); + schedule_bg_copy_tilemap_to_vram(0); + sPSSData->field_CAE = 0; +} + +static bool8 sub_80D00A8(void) +{ + return FALSE; +} + +static s16 sub_80D00AC(void) +{ + s32 textId = -2; + + if (!(gMain.newKeys & A_BUTTON)) + { + if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + textId = -1; + } + + if (gMain.newKeys & DPAD_UP) + { + PlaySE(SE_SELECT); + Menu_MoveCursor(-1); + } + else if (gMain.newKeys & DPAD_DOWN) + { + PlaySE(SE_SELECT); + Menu_MoveCursor(1); + } + } + else + { + textId = Menu_GetCursorPos(); + } + + if (textId != -2) + sub_80D013C(); + + if (textId >= 0) + textId = sPSSData->menuItems[textId].textId; + + #ifndef NONMATCHING + asm("":::"r4"); + #endif // NONMATCHING + return textId; +} + +static void sub_80D013C(void) +{ + sub_8198070(sPSSData->field_CB0, TRUE); + RemoveWindow(sPSSData->field_CB0); +} + +// The functions below handle moving and grabbing multiple mons at once. +// The icons are converted to background 0 which coordinates are changed while moving mons. +// There is also a bit of math involved in determining how many column/rows of mons to grab/move. + +static const struct WindowTemplate gUnknown_0857BB1C = +{ + .bg = 0, + .tilemapLeft = 10, + .tilemapTop = 3, + .width = 20, + .height = 18, + .paletteNum = 9, + .baseBlock = 0xA, +}; + +EWRAM_DATA static struct +{ + u8 field_0; + u8 state; + u8 fromRow; + u8 fromColumn; + u8 toRow; + u8 toColumn; + u8 field_6; + u8 field_7; + u8 minRow; + u8 minColumn; + u8 rowsTotal; + u8 columsTotal; + u16 bgX; + u16 bgY; + u16 field_10; + struct BoxPokemon boxMons[IN_BOX_COUNT]; +} +*sMoveMonsPtr = NULL; + +static bool8 sub_80D0164(void) +{ + sMoveMonsPtr = Alloc(sizeof(*sMoveMonsPtr)); + if (sMoveMonsPtr != NULL) + { + sPSSData->field_2200 = AddWindow8Bit(&gUnknown_0857BB1C); + if (sPSSData->field_2200 != 0xFF) + { + FillWindowPixelBuffer(sPSSData->field_2200, 0); + return TRUE; + } + } + + return FALSE; +} + +static void sub_80D01B8(void) +{ + if (sMoveMonsPtr != NULL) + Free(sMoveMonsPtr); +} + +static void sub_80D01D0(u8 arg0) +{ + sMoveMonsPtr->field_0 = arg0; + sMoveMonsPtr->state = 0; +} + +static bool8 sub_80D01E4(void) +{ + switch (sMoveMonsPtr->field_0) + { + case 0: + return sub_80D024C(); + case 1: + return sub_80D0344(); + case 2: + return sub_80D03B0(); + case 3: + return sub_80D0420(); + case 4: + return sub_80D04A0(); + case 5: + return sub_80D04C8(); + } + + return FALSE; +} + +static bool8 sub_80D024C(void) +{ + switch (sMoveMonsPtr->state) + { + case 0: + HideBg(0); + sub_80D304C(0x80); + sMoveMonsPtr->state++; + break; + case 1: + sub_80CFE14(&sMoveMonsPtr->fromRow, &sMoveMonsPtr->fromColumn); + sMoveMonsPtr->toRow = sMoveMonsPtr->fromRow; + sMoveMonsPtr->toColumn = sMoveMonsPtr->fromColumn; + ChangeBgX(0, -1024, 0); + ChangeBgY(0, -1024, 0); + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20); + FillWindowPixelBuffer8Bit(sPSSData->field_2200, 0); + sub_80D07B0(sMoveMonsPtr->fromRow, sMoveMonsPtr->fromColumn); + SetBgAttribute(0, 4, 1); + PutWindowTilemap(sPSSData->field_2200); + CopyWindowToVram8Bit(sPSSData->field_2200, 3); + BlendPalettes(0x3F00, 8, RGB_WHITE); + sub_80CFE54(2); + SetGpuRegBits(REG_OFFSET_BG0CNT, BGCNT_256COLOR); + sMoveMonsPtr->state++; + break; + case 2: + if (!IsDma3ManagerBusyWithBgCopy()) + { + ShowBg(0); + return FALSE; + } + break; + } + + return TRUE; +} + +static bool8 sub_80D0344(void) +{ + switch (sMoveMonsPtr->state) + { + case 0: + HideBg(0); + sMoveMonsPtr->state++; + break; + case 1: + sub_80D0B5C(); + sub_80CFE54(0); + sMoveMonsPtr->state++; + break; + case 2: + if (!IsDma3ManagerBusyWithBgCopy()) + { + sub_80CFE84(); + LoadPalette(stdpal_get(3), 0xD0, 0x20); + ShowBg(0); + return FALSE; + } + break; + } + + return TRUE; +} + +static bool8 sub_80D03B0(void) +{ + switch (sMoveMonsPtr->state) + { + case 0: + if (!sub_80CD554()) + { + sub_80CFE14(&sMoveMonsPtr->field_6, &sMoveMonsPtr->field_7); + sub_80D062C(); + sMoveMonsPtr->toRow = sMoveMonsPtr->field_6; + sMoveMonsPtr->toColumn = sMoveMonsPtr->field_7; + CopyWindowToVram8Bit(sPSSData->field_2200, 2); + sMoveMonsPtr->state++; + } + break; + case 1: + return IsDma3ManagerBusyWithBgCopy(); + } + + return TRUE; +} + +static bool8 sub_80D0420(void) +{ + u8 var1, var2; + + switch (sMoveMonsPtr->state) + { + case 0: + sub_80D08CC(); + sub_80D09A4(); + sub_80CDC64(FALSE); + sMoveMonsPtr->state++; + break; + case 1: + if (!DoMonPlaceChange()) + { + sub_80CFE54(3); + sub_80D0884(0, 256, 8); + sub_80CDC64(TRUE); + sMoveMonsPtr->state++; + } + break; + case 2: + var1 = sub_80D0894(); + var2 = DoMonPlaceChange(); + if (!var1 && !var2) + return FALSE; + break; + } + + return TRUE; +} + +static bool8 sub_80D04A0(void) +{ + u8 var1 = sub_80CD554(); + u8 var2 = sub_80D0894(); + + if (!var1 && !var2) + return FALSE; + else + return TRUE; +} + +static bool8 sub_80D04C8(void) +{ + switch (sMoveMonsPtr->state) + { + case 0: + sub_80D0AAC(); + sub_80D0884(0, -256, 8); + sub_80CDC64(FALSE); + sMoveMonsPtr->state++; + break; + case 1: + if (!DoMonPlaceChange() && !sub_80D0894()) + { + sub_80D0A1C(); + sub_80CFE54(2); + sub_80CDC64(TRUE); + HideBg(0); + sMoveMonsPtr->state++; + } + break; + case 2: + if (!DoMonPlaceChange()) + { + sub_80CFE54(0); + sub_80D0B5C(); + sMoveMonsPtr->state++; + } + break; + case 3: + if (!IsDma3ManagerBusyWithBgCopy()) + { + LoadPalette(stdpal_get(3), 0xD0, 0x20); + sub_80CFE84(); + ShowBg(0); + return FALSE; + } + break; + } + + return TRUE; +} + +static bool8 sub_80D0580(u8 arg0) +{ + switch (arg0) + { + case 0: + if (sMoveMonsPtr->minColumn == 0) + return FALSE; + sMoveMonsPtr->minColumn--; + sub_80D0884(0, 1024, 6); + break; + case 1: + if (sMoveMonsPtr->minColumn + sMoveMonsPtr->columsTotal >= 5) + return FALSE; + sMoveMonsPtr->minColumn++; + sub_80D0884(0, -1024, 6); + break; + case 2: + if (sMoveMonsPtr->minRow == 0) + return FALSE; + sMoveMonsPtr->minRow--; + sub_80D0884(1024, 0, 6); + break; + case 3: + if (sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal > 5) + return FALSE; + sMoveMonsPtr->minRow++; + sub_80D0884(-1024, 0, 6); + break; + } + + return TRUE; +} + +static void sub_80D062C(void) +{ + s16 var = (abs(sMoveMonsPtr->fromRow - sMoveMonsPtr->field_6)) - (abs(sMoveMonsPtr->fromRow - sMoveMonsPtr->toRow)); + s16 var2 = (abs(sMoveMonsPtr->fromColumn - sMoveMonsPtr->field_7)) - (abs(sMoveMonsPtr->fromColumn - sMoveMonsPtr->toColumn)); + + if (var > 0) + sub_80D06D0(sMoveMonsPtr->field_6, sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn); + + if (var < 0) + { + sub_80D0740(sMoveMonsPtr->toRow, sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn); + sub_80D06D0(sMoveMonsPtr->field_6, sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn); + } + + if (var2 > 0) + sub_80D0708(sMoveMonsPtr->field_7, sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow); + + if (var2 < 0) + { + sub_80D0778(sMoveMonsPtr->toColumn, sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow); + sub_80D0708(sMoveMonsPtr->field_7, sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow); + } +} + +static void sub_80D06D0(u8 arg0, u8 arg1, u8 arg2) +{ + u8 var1 = arg1; + + if (arg1 > arg2) + { + arg1 = arg2; + arg2 = var1; + } + + while (arg1 <= arg2) + sub_80D07B0(arg0, arg1++); +} + +static void sub_80D0708(u8 arg0, u8 arg1, u8 arg2) +{ + u8 var1 = arg1; + + if (arg1 > arg2) + { + arg1 = arg2; + arg2 = var1; + } + + while (arg1 <= arg2) + sub_80D07B0(arg1++, arg0); +} + +static void sub_80D0740(u8 arg0, u8 arg1, u8 arg2) +{ + u8 var1 = arg1; + + if (arg1 > arg2) + { + arg1 = arg2; + arg2 = var1; + } + + while (arg1 <= arg2) + sub_80D0834(arg0, arg1++); +} + +static void sub_80D0778(u8 arg0, u8 arg1, u8 arg2) +{ + u8 var1 = arg1; + + if (arg1 > arg2) + { + arg1 = arg2; + arg2 = var1; + } + + while (arg1 <= arg2) + sub_80D0834(arg1++, arg0); +} + +static void sub_80D07B0(u8 arg0, u8 arg1) +{ + u8 position = arg0 + (6 * arg1); + u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES2); + u32 personality = GetCurrentBoxMonData(position, MON_DATA_PERSONALITY); + + if (species != SPECIES_NONE) + { + const u8 *iconGfx = GetMonIconPtr(species, personality, 1); + u8 index = GetValidMonIconPalIndex(species) + 8; + + BlitBitmapRectToWindow4BitTo8Bit(sPSSData->field_2200, + iconGfx, + 0, + 0, + 32, + 32, + 24 * arg0, + 24 * arg1, + 32, + 32, + index); + } +} + +static void sub_80D0834(u8 arg0, u8 arg1) +{ + u8 position = arg0 + (6 * arg1); + u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES2); + + if (species != SPECIES_NONE) + { + FillWindowPixelRect8Bit(sPSSData->field_2200, + 0, + 24 * arg0, + 24 * arg1, + 32, + 32); + } +} + +static void sub_80D0884(u16 arg0, u16 arg1, u16 arg2) +{ + sMoveMonsPtr->bgX = arg0; + sMoveMonsPtr->bgY = arg1; + sMoveMonsPtr->field_10 = arg2; +} + +static u8 sub_80D0894(void) +{ + if (sMoveMonsPtr->field_10 != 0) + { + ChangeBgX(0, sMoveMonsPtr->bgX, 1); + ChangeBgY(0, sMoveMonsPtr->bgY, 1); + sMoveMonsPtr->field_10--; + } + + return sMoveMonsPtr->field_10; +} + +static void sub_80D08CC(void) +{ + s32 i, j, r8, r9; + s32 rowCount, columnCount; + u8 boxId; + u8 monArrayId; + + sMoveMonsPtr->minRow = min(sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow); + sMoveMonsPtr->minColumn = min(sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn); + sMoveMonsPtr->rowsTotal = abs(sMoveMonsPtr->fromRow - sMoveMonsPtr->toRow) + 1; + sMoveMonsPtr->columsTotal = abs(sMoveMonsPtr->fromColumn - sMoveMonsPtr->toColumn) + 1; + boxId = StorageGetCurrentBox(); + monArrayId = 0; + rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal; + columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columsTotal; + for (i = sMoveMonsPtr->minColumn; i < columnCount; i++) + { + u8 boxPosition = (IN_BOX_ROWS * i) + sMoveMonsPtr->minRow; + for (j = sMoveMonsPtr->minRow; j < rowCount; j++) + { + struct BoxPokemon *boxMon = GetBoxedMonPtr(boxId, boxPosition); + + sMoveMonsPtr->boxMons[monArrayId] = *boxMon; + monArrayId++; + boxPosition++; + } + } +} + +static void sub_80D09A4(void) +{ + s32 i, j; + s32 rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal; + s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columsTotal; + u8 boxId = StorageGetCurrentBox(); + + for (i = sMoveMonsPtr->minColumn; i < columnCount; i++) + { + u8 boxPosition = (IN_BOX_ROWS * i) + sMoveMonsPtr->minRow; + for (j = sMoveMonsPtr->minRow; j < rowCount; j++) + { + DestroyBoxMonIconAtPosition(boxPosition); + ZeroBoxMonAt(boxId, boxPosition); + boxPosition++; + } + } +} + +static void sub_80D0A1C(void) +{ + s32 i, j; + s32 rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal; + s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columsTotal; + u8 monArrayId = 0; + + for (i = sMoveMonsPtr->minColumn; i < columnCount; i++) + { + u8 boxPosition = (IN_BOX_ROWS * i) + sMoveMonsPtr->minRow; + for (j = sMoveMonsPtr->minRow; j < rowCount; j++) + { + if (GetBoxMonData(&sMoveMonsPtr->boxMons[monArrayId], MON_DATA_SANITY_HAS_SPECIES)) + sub_80CB140(boxPosition); + monArrayId++; + boxPosition++; + } + } +} + +static void sub_80D0AAC(void) +{ + s32 i, j; + s32 rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal; + s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columsTotal; + u8 boxId = StorageGetCurrentBox(); + u8 monArrayId = 0; + + for (i = sMoveMonsPtr->minColumn; i < columnCount; i++) + { + u8 boxPosition = (IN_BOX_ROWS * i) + sMoveMonsPtr->minRow; + for (j = sMoveMonsPtr->minRow; j < rowCount; j++) + { + if (GetBoxMonData(&sMoveMonsPtr->boxMons[monArrayId], MON_DATA_SANITY_HAS_SPECIES)) + SetBoxMonAt(boxId, boxPosition, &sMoveMonsPtr->boxMons[monArrayId]); + boxPosition++; + monArrayId++; + } + } +} + +static void sub_80D0B5C(void) +{ + ChangeBgX(0, 0, 0); + ChangeBgY(0, 0, 0); + SetBgAttribute(0, 4, 0); + ClearGpuRegBits(REG_OFFSET_BG0CNT, BGCNT_256COLOR); + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32); + CopyBgTilemapBufferToVram(0); +} + +static u8 sub_80D0BA4(void) +{ + return (IN_BOX_ROWS * sMoveMonsPtr->fromColumn) + sMoveMonsPtr->fromRow; +} + +static bool8 sub_80D0BC0(void) +{ + s32 i, j; + s32 rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal; + s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columsTotal; + u8 monArrayId = 0; + + for (i = sMoveMonsPtr->minColumn; i < columnCount; i++) + { + u8 boxPosition = (IN_BOX_ROWS * i) + sMoveMonsPtr->minRow; + for (j = sMoveMonsPtr->minRow; j < rowCount; j++) + { + if (GetBoxMonData(&sMoveMonsPtr->boxMons[monArrayId], MON_DATA_SANITY_HAS_SPECIES) + && GetCurrentBoxMonData(boxPosition, MON_DATA_SANITY_HAS_SPECIES)) + return FALSE; + + monArrayId++; + boxPosition++; + } + } + + return TRUE; +} + +static const u32 gUnknown_0857BB24[] = INCBIN_U32("graphics/pokemon_storage/unknown_frame.4bpp"); + +static const struct OamData sOamData_857BBA4 = +{ + .y = 0, + .affineMode = 1, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 2, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0 +}; + +static const union AffineAnimCmd sSpriteAffineAnim_857BBAC[] = +{ + AFFINEANIMCMD_FRAME(128, 128, 0, 0), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd sSpriteAffineAnim_857BBBC[] = +{ + AFFINEANIMCMD_FRAME(88, 88, 0, 0), + AFFINEANIMCMD_FRAME(5, 5, 0, 8), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd sSpriteAffineAnim_857BBD4[] = +{ + AFFINEANIMCMD_FRAME(128, 128, 0, 0), + AFFINEANIMCMD_FRAME(-5, -5, 0, 8), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd sSpriteAffineAnim_857BBEC[] = +{ + AFFINEANIMCMD_FRAME(128, 128, 0, 0), + AFFINEANIMCMD_FRAME(10, 10, 0, 12), + AFFINEANIMCMD_FRAME(256, 256, 0, 0), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd sSpriteAffineAnim_857BC0C[] = +{ + AFFINEANIMCMD_FRAME(256, 256, 0, 0), + AFFINEANIMCMD_FRAME(-10, -10, 0, 12), + AFFINEANIMCMD_FRAME(128, 128, 0, 0), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd sSpriteAffineAnim_857BC2C[] = +{ + AFFINEANIMCMD_FRAME(256, 256, 0, 0), + AFFINEANIMCMD_FRAME(-5, -5, 0, 16), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd sSpriteAffineAnim_857BC44[] = +{ + AFFINEANIMCMD_FRAME(256, 256, 0, 0), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd *const sSpriteAffineAnimTable_857BC44[] = +{ + sSpriteAffineAnim_857BBAC, + sSpriteAffineAnim_857BBBC, + sSpriteAffineAnim_857BBD4, + sSpriteAffineAnim_857BBEC, + sSpriteAffineAnim_857BC0C, + sSpriteAffineAnim_857BC2C, + sSpriteAffineAnim_857BC44 +}; + +static const struct SpriteTemplate gSpriteTemplate_857BC70 = +{ + .tileTag = TAG_TILE_7, + .paletteTag = TAG_PAL_DACB, + .oam = &sOamData_857BBA4, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSpriteAffineAnimTable_857BC44, + .callback = SpriteCallbackDummy, +}; + +static void sub_80D0C60(void) +{ + s32 i; + u8 spriteId; + struct CompressedSpriteSheet spriteSheet; + struct SpriteTemplate spriteTemplate; + + if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + { + spriteSheet.data = gUnknown_03000F78; + spriteSheet.size = 0x200; + spriteTemplate = gSpriteTemplate_857BC70; + + for (i = 0; i < 3; i++) + { + spriteSheet.tag = TAG_TILE_7 + i; + LoadCompressedSpriteSheet(&spriteSheet); + sPSSData->field_2204[i].tiles = GetSpriteTileStartByTag(spriteSheet.tag) * 32 + (void*)(OBJ_VRAM0); + sPSSData->field_2204[i].palIndex = AllocSpritePalette(TAG_PAL_DACB + i); + sPSSData->field_2204[i].palIndex *= 16; + sPSSData->field_2204[i].palIndex += 0x100; + spriteTemplate.tileTag = TAG_TILE_7 + i; + spriteTemplate.paletteTag = TAG_PAL_DACB + i; + spriteId = CreateSprite(&spriteTemplate, 0, 0, 11); + sPSSData->field_2204[i].sprite = &gSprites[spriteId]; + sPSSData->field_2204[i].sprite->invisible = TRUE; + sPSSData->field_2204[i].unk10 = 0; + } + } + sPSSData->movingItem = 0; +} + +// The functions below handle new features of MOVE_ITEMS box option. +static bool32 sub_80D1324(u8 cursorArea, u8 cursorPos); +static const u32 *GetItemIconPic(u16 itemId); +static const u32 *GetItemIconPalette(u16 itemId); +static u8 sub_80D12E8(void); +static void sub_80D140C(u8 id, u8 cursorArea, u8 cursorPos); +static void sub_80D1524(u8 id, const u32 *itemTiles, const u32 *itemPal); +static void sub_80D15D4(u8 id, u8 animNum); +static void sub_80D1740(u8 id, bool8 arg1); +static u8 sub_80D1370(u8 cursorArea, u8 cursorPos); +static void sub_80D1604(u8 id, u8 arg1, u8 arg2, u8 arg3); +static void sub_80D1AD8(struct Sprite *sprite); +static void sub_80D1A48(struct Sprite *sprite); +static void sub_80D1A74(struct Sprite *sprite); +static void sub_80D1B14(struct Sprite *sprite); +static void sub_80D1B94(struct Sprite *sprite); +static void sub_80D1CCC(struct Sprite *sprite); +static void sub_80D1C30(struct Sprite *sprite); + +static void sub_80D0D8C(u8 cursorArea, u8 cursorPos) +{ + u16 heldItem; + + if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + return; + if (sub_80D1324(cursorArea, cursorPos)) + return; + + switch (cursorArea) + { + case CURSOR_AREA_IN_BOX: + if (!GetCurrentBoxMonData(cursorPos, MON_DATA_SANITY_HAS_SPECIES)) + return; + heldItem = GetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM); + break; + case CURSOR_AREA_IN_PARTY: + if (cursorPos >= PARTY_SIZE || !GetMonData(&gPlayerParty[cursorPos], MON_DATA_SANITY_HAS_SPECIES)) + return; + heldItem = GetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM); + break; + default: + return; + } + + if (heldItem != 0) + { + const u32 *tiles = GetItemIconPic(heldItem); + const u32 *pal = GetItemIconPalette(heldItem); + u8 id = sub_80D12E8(); + + sub_80D140C(id, cursorArea, cursorPos); + sub_80D1524(id, tiles, pal); + sub_80D15D4(id, 1); + sub_80D1740(id, TRUE); + } +} + +static void sub_80D0E50(u8 cursorArea, u8 cursorPos) +{ + u8 id; + + if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + return; + + id = sub_80D1370(cursorArea, cursorPos); + sub_80D15D4(id, 2); + sub_80D1604(id, 0, cursorArea, cursorPos); +} + +static void Item_FromMonToMoving(u8 cursorArea, u8 cursorPos) +{ + u8 id; + u16 item; + + if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + return; + + id = sub_80D1370(cursorArea, cursorPos); + item = 0; + sub_80D15D4(id, 3); + sub_80D1604(id, 1, cursorArea, cursorPos); + sub_80D140C(id, 2, 0); + if (cursorArea == CURSOR_AREA_IN_BOX) + { + SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &item); + SetBoxMonIconObjMode(cursorPos, 1); + } + else + { + SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &item); + SetPartyMonIconObjMode(cursorPos, 1); + } + + sPSSData->movingItem = sPSSData->cursorMonItem; +} + +static void sub_80D0F38(u16 item) +{ + const u32 *tiles = GetItemIconPic(item); + const u32 *pal = GetItemIconPalette(item); + u8 id = sub_80D12E8(); + + sub_80D1524(id, tiles, pal); + sub_80D15D4(id, 6); + sub_80D1604(id, 1, 0, 0); + sub_80D140C(id, 2, 0); + sub_80D1740(id, TRUE); + sPSSData->movingItem = item; +} + +static void Item_SwitchMonsWithMoving(u8 cursorArea, u8 cursorPos) +{ + u8 id; + u16 item; + + if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + return; + + id = sub_80D1370(cursorArea, cursorPos); + sub_80D15D4(id, 3); + sub_80D1604(id, 3, 2, 0); + if (cursorArea == CURSOR_AREA_IN_BOX) + { + item = GetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM); + SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sPSSData->movingItem); + sPSSData->movingItem = item; + } + else + { + item = GetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM); + SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sPSSData->movingItem); + sPSSData->movingItem = item; + } + + id = sub_80D1370(2, 0); + sub_80D15D4(id, 4); + sub_80D1604(id, 4, cursorArea, cursorPos); +} + +static void Item_GiveMovingToMon(u8 cursorArea, u8 cursorPos) +{ + u8 id; + + if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + return; + + id = sub_80D1370(2, 0); + sub_80D15D4(id, 4); + sub_80D1604(id, 2, cursorArea, cursorPos); + if (cursorArea == CURSOR_AREA_IN_BOX) + { + SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sPSSData->movingItem); + SetBoxMonIconObjMode(cursorPos, 0); + } + else + { + SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sPSSData->movingItem); + SetPartyMonIconObjMode(cursorPos, 0); + } +} + +static void Item_TakeMons(u8 cursorArea, u8 cursorPos) +{ + u8 id; + u16 item; + + if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + return; + + item = 0; + id = sub_80D1370(cursorArea, cursorPos); + sub_80D15D4(id, 2); + sub_80D1604(id, 0, cursorArea, cursorPos); + if (cursorArea == CURSOR_AREA_IN_BOX) + { + SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &item); + SetBoxMonIconObjMode(cursorPos, 1); + } + else + { + SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &item); + SetPartyMonIconObjMode(cursorPos, 1); + } +} + +static void sub_80D1194(void) +{ + if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + { + u8 id = sub_80D1370(2, 0); + sub_80D15D4(id, 5); + sub_80D1604(id, 0, 2, 0); + } +} + +static void sub_80D11CC(void) +{ + s32 i; + + if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + return; + + for (i = 0; i < 3; i++) + { + if (sPSSData->field_2204[i].unk10 && sPSSData->field_2204[i].unk8 == 1) + sub_80D1604(i, 7, 2, 0); + } +} + +static bool8 sub_80D1218(void) +{ + s32 i; + + for (i = 0; i < 3; i++) + { + if (sPSSData->field_2204[i].unk10) + { + if (!sPSSData->field_2204[i].sprite->affineAnimEnded && sPSSData->field_2204[i].sprite->affineAnimBeginning) + return TRUE; + if (sPSSData->field_2204[i].sprite->callback != SpriteCallbackDummy && sPSSData->field_2204[i].sprite->callback != sub_80D1AD8) + return TRUE; + } + } + + return FALSE; +} + +static bool8 IsActiveItemMoving(void) +{ + s32 i; + + if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + { + for (i = 0; i < 3; i++) + { + if (sPSSData->field_2204[i].unk10 && sPSSData->field_2204[i].unk8 == 2) + return TRUE; + } + } + + return FALSE; +} + +static const u8 *GetMovingItemName(void) +{ + return ItemId_GetName(sPSSData->movingItem); +} + +static u16 GetMovingItem(void) +{ + return sPSSData->movingItem; +} + +static u8 sub_80D12E8(void) +{ + u8 i; + + for (i = 0; i < 3; i++) + { + if (sPSSData->field_2204[i].unk10 == 0) + { + sPSSData->field_2204[i].unk10 = 1; + return i; + } + } + + return 3; +} + +static bool32 sub_80D1324(u8 cursorArea, u8 cursorPos) +{ + s32 i; + + for (i = 0; i < 3; i++) + { + if (sPSSData->field_2204[i].unk10 + && sPSSData->field_2204[i].unk8 == cursorArea + && sPSSData->field_2204[i].unk9 == cursorPos) + return TRUE; + } + + return FALSE; +} + +static u8 sub_80D1370(u8 cursorArea, u8 cursorPos) +{ + u8 i; + + for (i = 0; i < 3; i++) + { + if (sPSSData->field_2204[i].unk10 + && sPSSData->field_2204[i].unk8 == cursorArea + && sPSSData->field_2204[i].unk9 == cursorPos) + return i; + } + + return 3; +} + +static u8 sub_80D13C4(struct Sprite *sprite) +{ + u8 i; + + for (i = 0; i < 3; i++) + { + if (sPSSData->field_2204[i].unk10 + && sPSSData->field_2204[i].sprite == sprite) + return i; + } + + return 3; +} + +static void sub_80D140C(u8 id, u8 cursorArea, u8 cursorPos) +{ + u8 row, column; + + if (id >= 3) + return; + + switch (cursorArea) + { + case CURSOR_AREA_IN_BOX: + row = cursorPos % IN_BOX_ROWS; + column = cursorPos / IN_BOX_ROWS; + sPSSData->field_2204[id].sprite->pos1.x = (24 * row) + 112; + sPSSData->field_2204[id].sprite->pos1.y = (24 * column) + 56; + sPSSData->field_2204[id].sprite->oam.priority = 2; + break; + case CURSOR_AREA_IN_PARTY: + if (cursorPos == 0) + { + sPSSData->field_2204[id].sprite->pos1.x = 116; + sPSSData->field_2204[id].sprite->pos1.y = 76; + } + else + { + sPSSData->field_2204[id].sprite->pos1.x = 164; + sPSSData->field_2204[id].sprite->pos1.y = 24 * (cursorPos - 1) + 28; + } + sPSSData->field_2204[id].sprite->oam.priority = 1; + break; + } + + sPSSData->field_2204[id].unk8 = cursorArea; + sPSSData->field_2204[id].unk9 = cursorPos; +} + +static void sub_80D1524(u8 id, const u32 *itemTiles, const u32 *itemPal) +{ + s32 i; + + if (id >= 3) + return; + + CpuFastFill(0, sPSSData->field_42C4, 0x200); + LZ77UnCompWram(itemTiles, sPSSData->field_22C4); + for (i = 0; i < 3; i++) + CpuFastCopy(sPSSData->field_22C4 + (i * 0x60), sPSSData->field_42C4 + (i * 0x80), 0x60); + + CpuFastCopy(sPSSData->field_42C4, sPSSData->field_2204[id].tiles, 0x200); + LZ77UnCompWram(itemPal, sPSSData->field_42C4); + LoadPalette(sPSSData->field_42C4, sPSSData->field_2204[id].palIndex, 0x20); +} + +static void sub_80D15D4(u8 id, u8 animNum) +{ + if (id >= 3) + return; + + StartSpriteAffineAnim(sPSSData->field_2204[id].sprite, animNum); +} + +static void sub_80D1604(u8 id, u8 arg1, u8 arg2, u8 arg3) +{ + if (id >= 3) + return; + + switch (arg1) + { + case 0: + sPSSData->field_2204[id].sprite->data[0] = id; + sPSSData->field_2204[id].sprite->callback = sub_80D1A48; + break; + case 1: + sPSSData->field_2204[id].sprite->data[0] = 0; + sPSSData->field_2204[id].sprite->callback = sub_80D1A74; + break; + case 2: + sPSSData->field_2204[id].sprite->data[0] = 0; + sPSSData->field_2204[id].sprite->data[6] = arg2; + sPSSData->field_2204[id].sprite->data[7] = arg3; + sPSSData->field_2204[id].sprite->callback = sub_80D1B14; + break; + case 3: + sPSSData->field_2204[id].sprite->data[0] = 0; + sPSSData->field_2204[id].sprite->callback = sub_80D1B94; + sPSSData->field_2204[id].sprite->data[6] = arg2; + sPSSData->field_2204[id].sprite->data[7] = arg3; + break; + case 4: + sPSSData->field_2204[id].sprite->data[0] = 0; + sPSSData->field_2204[id].sprite->data[6] = arg2; + sPSSData->field_2204[id].sprite->data[7] = arg3; + sPSSData->field_2204[id].sprite->callback = sub_80D1C30; + break; + case 7: + sPSSData->field_2204[id].sprite->callback = sub_80D1CCC; + break; + } +} + +static void sub_80D1740(u8 id, bool8 arg1) +{ + if (id >= 3) + return; + + sPSSData->field_2204[id].unk10 = arg1; + sPSSData->field_2204[id].sprite->invisible = (arg1 == FALSE); +} + +static const u32 *GetItemIconPic(u16 itemId) +{ + return GetItemIconPicOrPalette(itemId, 0); +} + +static const u32 *GetItemIconPalette(u16 itemId) +{ + return GetItemIconPicOrPalette(itemId, 1); +} + +static void PrintItemDescription(void) +{ + const u8 *description; + + if (IsActiveItemMoving()) + description = ItemId_GetDescription(sPSSData->movingItem); + else + description = ItemId_GetDescription(sPSSData->cursorMonItem); + + FillWindowPixelBuffer(2, 0x11); + AddTextPrinterParameterized5(2, 1, description, 4, 0, 0, NULL, 0, 1); +} + +static void sub_80D1818(void) +{ + sPSSData->field_2236 = 0x15; + LoadBgTiles(0, gUnknown_0857BB24, 0x80, 0x13A); + sub_80D19B4(0); +} + +static bool8 sub_80D184C(void) +{ + s32 i, var; + + if (sPSSData->field_2236 == 0) + return FALSE; + + sPSSData->field_2236--; + var = 0x15 - sPSSData->field_2236; + for (i = 0; i < var; i++) + { + WriteSequenceToBgTilemapBuffer(0, GetBgAttribute(0, 10) + 0x14 + sPSSData->field_2236 + i, i, 13, 1, 7, 15, 21); + } + + sub_80D19B4(var); + return (sPSSData->field_2236 != 0); +} + +static bool8 sub_80D18E4(void) +{ + s32 i, var; + + if (sPSSData->field_2236 == 0x16) + return FALSE; + + if (sPSSData->field_2236 == 0) + FillBgTilemapBufferRect(0, 0, 21, 12, 1, 9, 17); + + sPSSData->field_2236++; + var = 0x15 - sPSSData->field_2236; + for (i = 0; i < var; i++) + { + WriteSequenceToBgTilemapBuffer(0, GetBgAttribute(0, 10) + 0x14 + sPSSData->field_2236 + i, i, 13, 1, 7, 15, 21); + } + + if (var >= 0) + sub_80D19B4(var); + + FillBgTilemapBufferRect(0, 0, var + 1, 12, 1, 9, 0x11); + schedule_bg_copy_tilemap_to_vram(0); + return TRUE; +} + +static void sub_80D19B4(u32 arg0) +{ + if (arg0 != 0) + { + FillBgTilemapBufferRect(0, 0x13A, 0, 0xC, arg0, 1, 0xFu); + FillBgTilemapBufferRect(0, 0x93A, 0, 0x14, arg0, 1, 0xFu); + } + FillBgTilemapBufferRect(0, 0x13B, arg0, 0xD, 1, 7, 0xFu); + FillBgTilemapBufferRect(0, 0x13C, arg0, 0xC, 1, 1, 0xFu); + FillBgTilemapBufferRect(0, 0x13D, arg0, 0x14, 1, 1, 0xFu); + schedule_bg_copy_tilemap_to_vram(0); +} + +static void sub_80D1A48(struct Sprite *sprite) +{ + if (sprite->affineAnimEnded) + { + sub_80D1740(sprite->data[0], FALSE); + sprite->callback = SpriteCallbackDummy; + } +} + +static void sub_80D1A74(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->data[1] = sprite->pos1.x << 4; + sprite->data[2] = sprite->pos1.y << 4; + sprite->data[3] = 10; + sprite->data[4] = 21; + sprite->data[5] = 0; + sprite->data[0]++; + case 1: + sprite->data[1] -= sprite->data[3]; + sprite->data[2] -= sprite->data[4]; + sprite->pos1.x = sprite->data[1] >> 4; + sprite->pos1.y = sprite->data[2] >> 4; + if (++sprite->data[5] > 11) + sprite->callback = sub_80D1AD8; + break; + } +} + +static void sub_80D1AD8(struct Sprite *sprite) +{ + sprite->pos1.x = sPSSData->field_CB4->pos1.x + 4; + sprite->pos1.y = sPSSData->field_CB4->pos1.y + sPSSData->field_CB4->pos2.y + 8; + sprite->oam.priority = sPSSData->field_CB4->oam.priority; +} + +static void sub_80D1B14(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->data[1] = sprite->pos1.x << 4; + sprite->data[2] = sprite->pos1.y << 4; + sprite->data[3] = 10; + sprite->data[4] = 21; + sprite->data[5] = 0; + sprite->data[0]++; + case 1: + sprite->data[1] += sprite->data[3]; + sprite->data[2] += sprite->data[4]; + sprite->pos1.x = sprite->data[1] >> 4; + sprite->pos1.y = sprite->data[2] >> 4; + if (++sprite->data[5] > 11) + { + sub_80D140C(sub_80D13C4(sprite), sprite->data[6], sprite->data[7]); + sprite->callback = SpriteCallbackDummy; + } + break; + } +} + +static void sub_80D1B94(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->data[1] = sprite->pos1.x << 4; + sprite->data[2] = sprite->pos1.y << 4; + sprite->data[3] = 10; + sprite->data[4] = 21; + sprite->data[5] = 0; + sprite->data[0]++; + case 1: + sprite->data[1] -= sprite->data[3]; + sprite->data[2] -= sprite->data[4]; + sprite->pos1.x = sprite->data[1] >> 4; + sprite->pos1.y = sprite->data[2] >> 4; + sprite->pos2.x = gSineTable[sprite->data[5] * 8] >> 4; + if (++sprite->data[5] > 11) + { + sub_80D140C(sub_80D13C4(sprite), sprite->data[6], sprite->data[7]); + sprite->pos2.x = 0; + sprite->callback = sub_80D1AD8; + } + break; + } +} + +static void sub_80D1C30(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->data[1] = sprite->pos1.x << 4; + sprite->data[2] = sprite->pos1.y << 4; + sprite->data[3] = 10; + sprite->data[4] = 21; + sprite->data[5] = 0; + sprite->data[0]++; + case 1: + sprite->data[1] += sprite->data[3]; + sprite->data[2] += sprite->data[4]; + sprite->pos1.x = sprite->data[1] >> 4; + sprite->pos1.y = sprite->data[2] >> 4; + sprite->pos2.x = -(gSineTable[sprite->data[5] * 8] >> 4); + if (++sprite->data[5] > 11) + { + sub_80D140C(sub_80D13C4(sprite), sprite->data[6], sprite->data[7]); + sprite->callback = SpriteCallbackDummy; + sprite->pos2.x = 0; + } + break; + } +} + +static void sub_80D1CCC(struct Sprite *sprite) +{ + sprite->pos1.y -= 8; + if (sprite->pos1.y + sprite->pos2.y < -16) + { + sprite->callback = SpriteCallbackDummy; + sub_80D1740(sub_80D13C4(sprite), FALSE); + } +} + +void nullsub_pss(void) +{ + +} + +void nullsub_98(void) +{ + +} + +// Functions here are general utility functions. +u8 StorageGetCurrentBox(void) +{ + return gPokemonStoragePtr->currentBox; +} + +static void SetCurrentBox(u8 boxId) +{ + if (boxId < TOTAL_BOXES_COUNT) + gPokemonStoragePtr->currentBox = boxId; +} + +u32 GetBoxMonDataAt(u8 boxId, u8 boxPosition, s32 request) +{ + if (boxId < TOTAL_BOXES_COUNT && boxPosition < IN_BOX_COUNT) + return GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], request); + else + return 0; +} + +void SetBoxMonDataAt(u8 boxId, u8 boxPosition, s32 request, const void *value) +{ + if (boxId < TOTAL_BOXES_COUNT && boxPosition < IN_BOX_COUNT) + SetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], request, value); +} + +u32 GetCurrentBoxMonData(u8 boxPosition, s32 request) +{ + return GetBoxMonDataAt(gPokemonStoragePtr->currentBox, boxPosition, request); +} + +void SetCurrentBoxMonData(u8 boxPosition, s32 request, const void *value) +{ + SetBoxMonDataAt(gPokemonStoragePtr->currentBox, boxPosition, request, value); +} + +void GetBoxMonNickAt(u8 boxId, u8 boxPosition, u8 *dst) +{ + if (boxId < TOTAL_BOXES_COUNT && boxPosition < IN_BOX_COUNT) + GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_NICKNAME, dst); + else + *dst = EOS; +} + +u32 GetBoxMonLevelAt(u8 boxId, u8 boxPosition) +{ + u32 lvl; + + // BUG: Missed 'else' statement. + if (boxId < TOTAL_BOXES_COUNT && boxPosition < IN_BOX_COUNT && GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SANITY_HAS_SPECIES)) + lvl = GetLevelFromBoxMonExp(&gPokemonStoragePtr->boxes[boxId][boxPosition]); + // else + lvl = 0; + + return lvl; +} + +void SetBoxMonNickAt(u8 boxId, u8 boxPosition, const u8 *nick) +{ + if (boxId < TOTAL_BOXES_COUNT && boxPosition < IN_BOX_COUNT) + SetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_NICKNAME, nick); +} + +u32 GetAndCopyBoxMonDataAt(u8 boxId, u8 boxPosition, s32 request, void *dst) +{ + if (boxId < TOTAL_BOXES_COUNT && boxPosition < IN_BOX_COUNT) + return GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], request, dst); + else + return 0; +} + +void SetBoxMonAt(u8 boxId, u8 boxPosition, struct BoxPokemon *src) +{ + if (boxId < TOTAL_BOXES_COUNT && boxPosition < IN_BOX_COUNT) + gPokemonStoragePtr->boxes[boxId][boxPosition] = *src; +} + +void CopyBoxMonAt(u8 boxId, u8 boxPosition, struct BoxPokemon *dst) +{ + if (boxId < TOTAL_BOXES_COUNT && boxPosition < IN_BOX_COUNT) + *dst = gPokemonStoragePtr->boxes[boxId][boxPosition]; +} + +void CreateBoxMonAt(u8 boxId, u8 boxPosition, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 personality, u8 otIDType, u32 otID) +{ + if (boxId < TOTAL_BOXES_COUNT && boxPosition < IN_BOX_COUNT) + { + CreateBoxMon(&gPokemonStoragePtr->boxes[boxId][boxPosition], + species, + level, + fixedIV, + hasFixedPersonality, personality, + otIDType, otID); + } +} + +void ZeroBoxMonAt(u8 boxId, u8 boxPosition) +{ + if (boxId < TOTAL_BOXES_COUNT && boxPosition < IN_BOX_COUNT) + ZeroBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition]); +} + +void BoxMonAtToMon(u8 boxId, u8 boxPosition, struct Pokemon *dst) +{ + if (boxId < TOTAL_BOXES_COUNT && boxPosition < IN_BOX_COUNT) + BoxMonToMon(&gPokemonStoragePtr->boxes[boxId][boxPosition], dst); +} + +struct BoxPokemon *GetBoxedMonPtr(u8 boxId, u8 boxPosition) +{ + if (boxId < TOTAL_BOXES_COUNT && boxPosition < IN_BOX_COUNT) + return &gPokemonStoragePtr->boxes[boxId][boxPosition]; + else + return NULL; +} + +u8 *GetBoxNamePtr(u8 boxId) +{ + if (boxId < TOTAL_BOXES_COUNT) + return gPokemonStoragePtr->boxNames[boxId]; + else + return NULL; +} + +u8 GetBoxWallpaper(u8 boxId) +{ + if (boxId < TOTAL_BOXES_COUNT) + return gPokemonStoragePtr->boxWallpapers[boxId]; + else + return 0; +} + +void SetBoxWallpaper(u8 boxId, u8 wallpaperId) +{ + if (boxId < TOTAL_BOXES_COUNT && wallpaperId < WALLPAPER_COUNT) + gPokemonStoragePtr->boxWallpapers[boxId] = wallpaperId; +} + +s16 sub_80D214C(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 arg3) +{ + s16 i; + s16 adder = -1; + + if (arg3 < 2) + adder = 1; + + if (arg3 == 1 || arg3 == 3) + { + for (i = (s8)currIndex + adder; i >= 0 && i <= maxIndex; i += adder) + { + if (GetBoxMonData(&boxMons[i], MON_DATA_SPECIES) != SPECIES_NONE) + return i; + } + } + else + { + for (i = (s8)currIndex + adder; i >= 0 && i <= maxIndex; i += adder) + { + if (GetBoxMonData(&boxMons[i], MON_DATA_SPECIES) != SPECIES_NONE + && !GetBoxMonData(&boxMons[i], MON_DATA_IS_EGG)) + return i; + } + } + + return -1; +} + +bool8 CheckFreePokemonStorageSpace(void) +{ + s32 i, j; + + for (i = 0; i < TOTAL_BOXES_COUNT; i++) + { + for (j = 0; j < IN_BOX_COUNT; j++) + { + if (!GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_SANITY_HAS_SPECIES)) + return TRUE; + } + } + + return FALSE; +} + +bool32 CheckBoxMonSanityAt(u32 boxId, u32 boxPosition) +{ + if (boxId < TOTAL_BOXES_COUNT + && boxPosition < IN_BOX_COUNT + && GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SANITY_HAS_SPECIES) + && !GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SANITY_IS_EGG) + && !GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SANITY_IS_BAD_EGG)) + return TRUE; + else + return FALSE; +} + +u32 CountStorageNonEggMons(void) +{ + s32 i, j; + u32 count = 0; + + for (i = 0; i < TOTAL_BOXES_COUNT; i++) + { + for (j = 0; j < IN_BOX_COUNT; j++) + { + if (GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_SANITY_HAS_SPECIES) + && !GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_SANITY_IS_EGG)) + count++; + } + } + + return count; +} + +u32 CountAllStorageMons(void) +{ + s32 i, j; + u32 count = 0; + + for (i = 0; i < TOTAL_BOXES_COUNT; i++) + { + for (j = 0; j < IN_BOX_COUNT; j++) + { + if (GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_SANITY_HAS_SPECIES) + || GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_SANITY_IS_EGG)) + count++; + } + } + + return count; +} + +bool32 AnyStorageMonWithMove(u16 moveId) +{ + u16 moves[] = {moveId, MOVES_COUNT}; + s32 i, j; + + for (i = 0; i < TOTAL_BOXES_COUNT; i++) + { + for (j = 0; j < IN_BOX_COUNT; j++) + { + if (GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_SANITY_HAS_SPECIES) + && !GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_SANITY_IS_EGG) + && GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_KNOWN_MOVES, moves)) + return TRUE; + } + } + + return FALSE; +} + +void ResetWaldaWallpaper(void) +{ + gSaveBlock1Ptr->waldaPhrase.iconId = 0; + gSaveBlock1Ptr->waldaPhrase.patternId = 0; + gSaveBlock1Ptr->waldaPhrase.patternUnlocked = FALSE; + gSaveBlock1Ptr->waldaPhrase.colors[0] = RGB(21, 25, 30); + gSaveBlock1Ptr->waldaPhrase.colors[1] = RGB(6, 12, 24); + gSaveBlock1Ptr->waldaPhrase.text[0] = EOS; +} + +void SetWaldaWallpaperLockedOrUnlocked(bool32 unlocked) +{ + gSaveBlock1Ptr->waldaPhrase.patternUnlocked = unlocked; +} + +bool32 IsWaldaWallpaperUnlocked(void) +{ + return gSaveBlock1Ptr->waldaPhrase.patternUnlocked; +} + +u32 GetWaldaWallpaperPatternId(void) +{ + return gSaveBlock1Ptr->waldaPhrase.patternId; +} + +void SetWaldaWallpaperPatternId(u8 id) +{ + if (id < FRIENDS_WALLPAPERS_COUNT) + gSaveBlock1Ptr->waldaPhrase.patternId = id; +} + +u32 GetWaldaWallpaperIconId(void) +{ + return gSaveBlock1Ptr->waldaPhrase.iconId; +} + +void SetWaldaWallpaperIconId(u8 id) +{ + if (id < 30) + gSaveBlock1Ptr->waldaPhrase.iconId = id; +} + +u16 *GetWaldaWallpaperColorsPtr(void) +{ + return gSaveBlock1Ptr->waldaPhrase.colors; +} + +void SetWaldaWallpaperColors(u16 color1, u16 color2) +{ + gSaveBlock1Ptr->waldaPhrase.colors[0] = color1; + gSaveBlock1Ptr->waldaPhrase.colors[1] = color2; +} + +u8 *GetWaldaPhrasePtr(void) +{ + return gSaveBlock1Ptr->waldaPhrase.text; +} + +void SetWaldaPhrase(const u8 *src) +{ + StringCopy(gSaveBlock1Ptr->waldaPhrase.text, src); +} + +bool32 IsWaldaPhraseEmpty(void) +{ + return (gSaveBlock1Ptr->waldaPhrase.text[0] == EOS); +} + +// Not sure what the purpose of these functions is. +// They seem to only be called while PSS is initialized. + +EWRAM_DATA static struct UnkStruct_2039D84 *gUnknown_02039D84 = NULL; +EWRAM_DATA static u16 gUnknown_02039D88 = 0; + +static void sub_80D259C(u8 count) +{ + u16 i; + + gUnknown_02039D84 = Alloc(sizeof(*gUnknown_02039D84) * count); + gUnknown_02039D88 = (gUnknown_02039D84 == NULL) ? 0 : count; + for (i = 0; i < gUnknown_02039D88; i++) + { + gUnknown_02039D84[i].field_18 = NULL; + gUnknown_02039D84[i].field_2C = 0; + } +} + +static void sub_80D25F0(void) +{ + Free(gUnknown_02039D84); +} + +static void sub_80D2604(void) +{ + s32 i; + + for (i = 0; i < gUnknown_02039D88; i++) + { + if (gUnknown_02039D84[i].field_2C == 1) + sub_80D2918(i); + } +} + +struct +{ + u16 a; + u16 b; +} +static const sUnkVars[][4] = +{ + { + {0x0100, 0x0100}, + {0x0200, 0x0100}, + {0x0100, 0x0200}, + {0x0200, 0x0200}, + }, + { + {0x0080, 0x0080}, + {0x0100, 0x0100}, + {0x0200, 0x0200}, + {0x0400, 0x0400}, + }, +}; + +static void sub_80D2644(u8 id, u8 bg, const void *arg2, u16 arg3, u16 arg4) +{ + u16 attribute1, attribute2; + + if (id >= gUnknown_02039D88) + return; + + gUnknown_02039D84[id].field_18 = NULL; + gUnknown_02039D84[id].field_1C = arg2; + gUnknown_02039D84[id].field_2B = bg; + gUnknown_02039D84[id].field_24 = arg3; + gUnknown_02039D84[id].field_26 = arg4; + + attribute1 = GetBgAttribute(bg, 3); + attribute2 = GetBgAttribute(bg, 9); + gUnknown_02039D84[id].field_20 = sUnkVars[attribute2][attribute1].a; + gUnknown_02039D84[id].field_22 = sUnkVars[attribute2][attribute1].b; + if (attribute2 != 0) + gUnknown_02039D84[id].field_2A = 1; + else + gUnknown_02039D84[id].field_2A = 2; + + gUnknown_02039D84[id].field_28 = gUnknown_02039D84[id].field_2A * arg3; + gUnknown_02039D84[id].field_0[1].field_4 = arg3; + gUnknown_02039D84[id].field_0[1].field_6 = arg4; + gUnknown_02039D84[id].field_0[1].field_0 = 0; + gUnknown_02039D84[id].field_0[1].field_2 = 0; + gUnknown_02039D84[id].field_0[1].field_8 = 0; + gUnknown_02039D84[id].field_0[1].field_A = 0; + gUnknown_02039D84[id].field_0[0] = gUnknown_02039D84[id].field_0[1]; + gUnknown_02039D84[id].field_2C = 1; +} + +static void sub_80D2740(u8 id, const void *arg1) +{ + if (id >= gUnknown_02039D88) + return; + + gUnknown_02039D84[id].field_18 = arg1; + gUnknown_02039D84[id].field_2C = 1; +} + +static void sub_80D2770(u8 id, u16 arg1, u16 arg2) +{ + if (id >= gUnknown_02039D88) + return; + + gUnknown_02039D84[id].field_0[1].field_8 = arg1; + gUnknown_02039D84[id].field_0[1].field_A = arg2; + gUnknown_02039D84[id].field_2C = 1; +} + +static void sub_80D27AC(u8 id, u16 arg1, u16 arg2, u16 arg3, u16 arg4) +{ + if (id >= gUnknown_02039D88) + return; + + gUnknown_02039D84[id].field_0[1].field_0 = arg1; + gUnknown_02039D84[id].field_0[1].field_2 = arg2; + gUnknown_02039D84[id].field_0[1].field_4 = arg3; + gUnknown_02039D84[id].field_0[1].field_6 = arg4; + gUnknown_02039D84[id].field_2C = 1; +} + +static void sub_80D27F4(u8 id, u8 arg1, s8 arg2) +{ + if (id >= gUnknown_02039D88) + return; + + switch (arg1) + { + case 0: + gUnknown_02039D84[id].field_0[1].field_8 += arg2; + gUnknown_02039D84[id].field_0[1].field_4 -= arg2; + break; + case 1: + gUnknown_02039D84[id].field_0[1].field_0 += arg2; + gUnknown_02039D84[id].field_0[1].field_4 += arg2; + break; + case 2: + gUnknown_02039D84[id].field_0[1].field_A += arg2; + gUnknown_02039D84[id].field_0[1].field_6 -= arg2; + break; + case 3: + gUnknown_02039D84[id].field_0[1].field_2 -= arg2; + gUnknown_02039D84[id].field_0[1].field_6 += arg2; + break; + case 4: + gUnknown_02039D84[id].field_0[1].field_8 += arg2; + break; + case 5: + gUnknown_02039D84[id].field_0[1].field_A += arg2; + break; + } + + gUnknown_02039D84[id].field_2C = 1; +} + +static void sub_80D2918(u8 id) +{ + if (id >= gUnknown_02039D88) + return; + + if (gUnknown_02039D84[id].field_18 != NULL) + sub_80D2960(id); + + sub_80D29F8(id); + gUnknown_02039D84[id].field_0[0] = gUnknown_02039D84[id].field_0[1]; +} + +static void sub_80D2960(u8 id) +{ + s32 i; + u32 adder = gUnknown_02039D84[id].field_2A * gUnknown_02039D84[id].field_20; + const void *tiles = (gUnknown_02039D84[id].field_18 + (adder * gUnknown_02039D84[id].field_0[0].field_A)) + + (gUnknown_02039D84[id].field_2A * gUnknown_02039D84[id].field_0[0].field_8); + + for (i = 0; i < gUnknown_02039D84[id].field_0[0].field_6; i++) + { + CopyToBgTilemapBufferRect(gUnknown_02039D84[id].field_2B, + tiles, + gUnknown_02039D84[id].field_0[0].field_8, + gUnknown_02039D84[id].field_0[0].field_A + i, + gUnknown_02039D84[id].field_0[0].field_4, + 1); + tiles += adder; + } +} + +static void sub_80D29F8(u8 id) +{ + s32 i; + u32 adder = gUnknown_02039D84[id].field_2A * gUnknown_02039D84[id].field_24; + const void *tiles = (gUnknown_02039D84[id].field_1C + (adder * gUnknown_02039D84[id].field_0[1].field_2)) + + (gUnknown_02039D84[id].field_2A * gUnknown_02039D84[id].field_0[1].field_0); + + for (i = 0; i < gUnknown_02039D84[id].field_0[1].field_6; i++) + { + CopyToBgTilemapBufferRect(gUnknown_02039D84[id].field_2B, + tiles, + gUnknown_02039D84[id].field_0[1].field_8, + gUnknown_02039D84[id].field_0[1].field_A + i, + gUnknown_02039D84[id].field_0[1].field_4, + 1); + tiles += adder; + } +} + +EWRAM_DATA static struct UnkStruct_2000020 *gUnknown_02039D8C = NULL; + +static void sub_80D2A90(struct UnkStruct_2000020 *arg0, struct UnkStruct_2000028 *arg1, u32 arg2) +{ + gUnknown_02039D8C = arg0; + arg0->unk_00 = arg1; + arg0->unk_05 = arg2; + arg0->unk_04 = 0; +} + +static void sub_80D2AA4(void) +{ + u16 i; + + if (gUnknown_02039D8C->unk_04) + { + for (i = 0; i < gUnknown_02039D8C->unk_04; i++) + { + struct UnkStruct_2000028 *unkStruct = &gUnknown_02039D8C->unk_00[i]; + unkStruct->unk_0c(unkStruct); + } + + gUnknown_02039D8C->unk_04 = 0; + } +} + +static bool8 sub_80D2AEC(u8 *dest, u16 dLeft, u16 dTop, const u8 *src, u16 sLeft, u16 sTop, u16 width, u16 height, u16 unkArg) +{ + struct UnkStruct_2000028 *unkStruct; + + if (gUnknown_02039D8C->unk_04 >= gUnknown_02039D8C->unk_05) + return FALSE; + + unkStruct = &gUnknown_02039D8C->unk_00[gUnknown_02039D8C->unk_04++]; + unkStruct->unk_08 = width * 2; + unkStruct->unk_04 = dest + 2 * (dTop * 32 + dLeft); + unkStruct->unk_00 = src + 2 * (sTop * unkArg + sLeft); + unkStruct->newField = height; + unkStruct->unk_0a = unkArg; + unkStruct->unk_0c = sub_80D2B88; + return TRUE; +} + +static void sub_80D2B88(struct UnkStruct_2000028 *unkStruct) +{ + u16 i; + + for (i = 0; i < unkStruct->newField; i++) + { + CpuSet(unkStruct->unk_00, unkStruct->unk_04, (unkStruct->unk_08 / 2)); + unkStruct->unk_04 += 64; + unkStruct->unk_00 += (unkStruct->unk_0a * 2); + } +} + +static bool8 sub_80D2BC0(void *dest, u16 dLeft, u16 dTop, u16 width, u16 height) +{ + struct UnkStruct_2000028 *unkStruct; + + if (gUnknown_02039D8C->unk_04 >= gUnknown_02039D8C->unk_05) + return FALSE; + + unkStruct = &gUnknown_02039D8C->unk_00[gUnknown_02039D8C->unk_04++]; + unkStruct->unk_08 = width * 2; + unkStruct->unk_04 = dest + ((dTop * 32) + dLeft) * 2; + unkStruct->newField = height; + unkStruct->unk_0c = sub_80D2C1C; + return TRUE; +} + +static void sub_80D2C1C(struct UnkStruct_2000028 *unkStruct) +{ + u16 i; + + for (i = 0; i < unkStruct->newField; i++) + { + Dma3FillLarge_(0, unkStruct->unk_04, unkStruct->unk_08, 16); + unkStruct->unk_04 += 64; + } +} diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 4fb20c72b..e6714e2a8 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -5,6 +5,7 @@ #include "frontier_util.h" #include "battle_message.h" #include "battle_tent.h" +#include "battle_factory.h" #include "bg.h" #include "contest.h" #include "contest_effect.h" @@ -45,8 +46,6 @@ #include "constants/songs.h" #include "constants/species.h" -extern bool8 sub_81A6BF4(void); - static EWRAM_DATA struct UnkSummaryStruct { /*0x00*/ union { @@ -129,7 +128,6 @@ struct UnkStruct_61CC04 }; // forward declarations -bool8 sub_81B1250(void); static bool8 SummaryScreen_LoadGraphics(void); static void SummaryScreen_LoadingCB2(void); static void InitBGs(void); @@ -238,8 +236,6 @@ static void sub_81C4568(u8 a, u8 b); static u8 sub_81C45F4(struct Pokemon *a, s16 *b); static u8 sub_81C47B4(struct Pokemon *unused); static void sub_81C4844(struct Sprite *); -void SummaryScreen_SetUnknownTaskId(u8 a); -void SummaryScreen_DestroyUnknownTask(void); static void sub_81C48F0(void); static void CreateMonMarkingsSprite(struct Pokemon *mon); static void RemoveAndCreateMonMarkingsSprite(struct Pokemon *mon); @@ -1005,7 +1001,7 @@ void ShowPokemonSummaryScreen(u8 mode, void *mons, u8 monIndex, u8 maxMonIndex, pssData->maxMonIndex = maxMonIndex; pssData->callback = callback; - if (mode == PSS_MODE_UNK2) + if (mode == PSS_MODE_BOX) pssData->isBoxMon = TRUE; else pssData->isBoxMon = FALSE; @@ -1013,7 +1009,7 @@ void ShowPokemonSummaryScreen(u8 mode, void *mons, u8 monIndex, u8 maxMonIndex, switch (mode) { case PSS_MODE_NORMAL: - case PSS_MODE_UNK2: + case PSS_MODE_BOX: pssData->minPageIndex = 0; pssData->maxPageIndex = 3; break; @@ -1255,23 +1251,23 @@ static bool8 SummaryScreen_DecompressGraphics(void) pssData->unk40F0++; break; case 7: - LoadCompressedObjectPic(&sSpriteSheet_MoveTypes); + LoadCompressedSpriteSheet(&sSpriteSheet_MoveTypes); pssData->unk40F0++; break; case 8: - LoadCompressedObjectPic(&gUnknown_0861D074); + LoadCompressedSpriteSheet(&gUnknown_0861D074); pssData->unk40F0++; break; case 9: - LoadCompressedObjectPic(&gUnknown_0861D0F8); + LoadCompressedSpriteSheet(&gUnknown_0861D0F8); pssData->unk40F0++; break; case 10: - LoadCompressedObjectPalette(&gUnknown_0861D100); + LoadCompressedSpritePalette(&gUnknown_0861D100); pssData->unk40F0++; break; case 11: - LoadCompressedObjectPalette(&gUnknown_0861D07C); + LoadCompressedSpritePalette(&gUnknown_0861D07C); pssData->unk40F0++; break; case 12: @@ -1310,7 +1306,7 @@ static bool8 ExtractMonDataToSummaryStruct(struct Pokemon *a) sum->altAbility = GetMonData(a, MON_DATA_ALT_ABILITY); sum->item = GetMonData(a, MON_DATA_HELD_ITEM); sum->pid = GetMonData(a, MON_DATA_PERSONALITY); - sum->sanity = GetMonData(a, MON_DATA_SANITY_BIT1); + sum->sanity = GetMonData(a, MON_DATA_SANITY_IS_BAD_EGG); if (sum->sanity) sum->isEgg = TRUE; @@ -1327,7 +1323,7 @@ static bool8 ExtractMonDataToSummaryStruct(struct Pokemon *a) sum->ppBonuses = GetMonData(a, MON_DATA_PP_BONUSES); break; case 2: - if (pssData->monList.mons == gPlayerParty || pssData->mode == PSS_MODE_UNK2 || pssData->unk40EF == TRUE) + if (pssData->monList.mons == gPlayerParty || pssData->mode == PSS_MODE_BOX || pssData->unk40EF == TRUE) { sum->nature = GetNature(a); sum->currentHP = GetMonData(a, MON_DATA_HP); @@ -1500,7 +1496,7 @@ static void sub_81C0604(u8 taskId, s8 a) } r4_2 = sub_80D214C(pssData->monList.boxMons, pssData->curMonIndex, pssData->maxMonIndex, a); } - else if (sub_81B1250() == 1) + else if (IsMultiBattle() == TRUE) { r4_2 = sub_81C09B4(a); } @@ -2147,7 +2143,7 @@ static void sub_81C174C(u8 taskId) static bool8 sub_81C18A8(void) { - if (pssData->firstMoveIndex == MAX_MON_MOVES || pssData->newMove == MOVE_NONE || sub_81B6D14(pssData->summary.moves[pssData->firstMoveIndex]) != 1) + if (pssData->firstMoveIndex == MAX_MON_MOVES || pssData->newMove == MOVE_NONE || IsMoveHm(pssData->summary.moves[pssData->firstMoveIndex]) != 1) return TRUE; else return FALSE; @@ -3254,7 +3250,7 @@ static void PrintHeldItemName(void) const u8 *text; int offset; - if (pssData->summary.item == ITEM_ENIGMA_BERRY && sub_81B1250() == TRUE && (pssData->curMonIndex == 1 || pssData->curMonIndex == 4 || pssData->curMonIndex == 5)) + if (pssData->summary.item == ITEM_ENIGMA_BERRY && IsMultiBattle() == TRUE && (pssData->curMonIndex == 1 || pssData->curMonIndex == 4 || pssData->curMonIndex == 5)) { text = ItemId_GetName(ITEM_ENIGMA_BERRY); } @@ -3829,7 +3825,7 @@ static u8 sub_81C45F4(struct Pokemon *mon, s16 *a1) { if (gMonSpritesGfxPtr != NULL) { - if (pssData->monList.mons == gPlayerParty || pssData->mode == PSS_MODE_UNK2 || pssData->unk40EF == TRUE) + if (pssData->monList.mons == gPlayerParty || pssData->mode == PSS_MODE_BOX || pssData->unk40EF == TRUE) { HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid); } @@ -3840,7 +3836,7 @@ static u8 sub_81C45F4(struct Pokemon *mon, s16 *a1) } else { - if (pssData->monList.mons == gPlayerParty || pssData->mode == PSS_MODE_UNK2 || pssData->unk40EF == TRUE) + if (pssData->monList.mons == gPlayerParty || pssData->mode == PSS_MODE_BOX || pssData->unk40EF == TRUE) { HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], sub_806F4F8(0, 1), summary->species2, summary->pid); } @@ -3854,7 +3850,7 @@ static u8 sub_81C45F4(struct Pokemon *mon, s16 *a1) return -1; case 1: pal = GetMonSpritePalStructFromOtIdPersonality(summary->species2, summary->OTID, summary->pid); - LoadCompressedObjectPalette(pal); + LoadCompressedSpritePalette(pal); SetMultiuseSpriteTemplateToPokemon(pal->tag, 1); (*a1)++; return -1; diff --git a/src/post_battle_event_funcs.c b/src/post_battle_event_funcs.c index 934972b7c..fe5e1089e 100644 --- a/src/post_battle_event_funcs.c +++ b/src/post_battle_event_funcs.c @@ -50,8 +50,8 @@ int GameClear(void) ribbonCounts[i].partyIndex = i; ribbonCounts[i].count = 0; - if (GetMonData(mon, MON_DATA_SANITY_BIT2) - && !GetMonData(mon, MON_DATA_SANITY_BIT3) + if (GetMonData(mon, MON_DATA_SANITY_HAS_SPECIES) + && !GetMonData(mon, MON_DATA_SANITY_IS_EGG) && !GetMonData(mon, MON_DATA_CHAMPION_RIBBON)) { u8 val[1] = {TRUE}; diff --git a/src/psychic.c b/src/psychic.c index efd15f746..371c24ce8 100644 --- a/src/psychic.c +++ b/src/psychic.c @@ -1,18 +1,33 @@ #include "global.h" #include "battle_anim.h" +#include "gpu_regs.h" +#include "palette.h" +#include "sound.h" +#include "scanline_effect.h" +#include "trig.h" #include "constants/rgb.h" +#include "constants/songs.h" -extern void sub_80A77C8(struct Sprite *); -extern void sub_810F1EC(struct Sprite *); -extern void sub_810F1EC(struct Sprite *); -extern void sub_810F58C(struct Sprite *); -extern void TranslateAnimSpriteToTargetMonLocation(struct Sprite *); -extern void sub_810F634(struct Sprite *); -extern void sub_810F6B0(struct Sprite *); -extern void sub_810FBA8(struct Sprite *); -extern void sub_810FDF0(struct Sprite *); -extern void sub_80A77C8(struct Sprite *); -extern void sub_8110240(struct Sprite *); +void sub_810F1EC(struct Sprite *); +void sub_810F58C(struct Sprite *); +void sub_810F634(struct Sprite *); +void sub_810F6B0(struct Sprite *); +void sub_810FBA8(struct Sprite *); +void sub_810FDF0(struct Sprite *); +void sub_8110240(struct Sprite *); +static void sub_810F340(struct Sprite *); +static void sub_810F3C8(struct Sprite *); +static void sub_810F400(struct Sprite *); +static void sub_810F46C(struct Sprite *); +static void sub_810F524(struct Sprite *); +static void sub_810F740(struct Sprite *); +static void sub_810F774(struct Sprite *); +static void sub_810F810(u8); +static void sub_810F898(u8); +static void sub_810F9D4(u8); +static void sub_810FD3C(u8); +static void sub_810FF34(u8); +static void sub_8110134(u8); const union AffineAnimCmd gUnknown_0859652C[] = { @@ -403,3 +418,744 @@ const struct SpriteTemplate gUnknown_08596920 = .affineAnims = gUnknown_08596918, .callback = sub_8110240, }; + +void sub_810F1EC(struct Sprite *sprite) +{ + u8 isContest = IsContest(); + + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER || isContest) + { + sprite->oam.priority = 2; + sprite->subpriority = 200; + } + + if (!isContest) + { + u8 battlerCopy; + u8 battler = battlerCopy = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); + u8 rank = GetBattlerSpriteBGPriorityRank(battler); + int var0 = 1; + u8 toBG_2 = (rank ^ var0) != 0; + + if (IsBattlerSpriteVisible(battler)) + MoveBattlerSpriteToBG(battler, toBG_2, FALSE); + + battler = BATTLE_PARTNER(battlerCopy); + if (IsBattlerSpriteVisible(battler)) + MoveBattlerSpriteToBG(battler, toBG_2 ^ var0, FALSE); + } + + if (!isContest && IsDoubleBattle()) + { + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) + { + sprite->pos1.x = 72; + sprite->pos1.y = 80; + } + else + { + sprite->pos1.x = 176; + sprite->pos1.y = 40; + } + } + else + { + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + gBattleAnimArgs[0] = -gBattleAnimArgs[0]; + + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X) + gBattleAnimArgs[0]; + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y) + gBattleAnimArgs[1]; + } + + sprite->data[0] = 256 + IndexOfSpritePaletteTag(gBattleAnimArgs[2]) * 16; + + if (isContest) + { + sprite->pos1.y += 9; + sprite->callback = sub_810F3C8; + sprite->callback(sprite); + } + else + { + sprite->callback = sub_810F340; + } +} + +static void sub_810F340(struct Sprite *sprite) +{ + u8 battler = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); + if (!sprite->data[7]) + { + sprite->data[7] = 1; + return; + } + + if (IsBattlerSpriteVisible(battler)) + gSprites[gBattlerSpriteIds[battler]].invisible = 1; + + battler = BATTLE_PARTNER(battler); + if (IsBattlerSpriteVisible(battler)) + gSprites[gBattlerSpriteIds[battler]].invisible = 1; + + sprite->callback = sub_810F3C8; + sprite->callback(sprite); +} + +static void sub_810F3C8(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[3], 16 - sprite->data[3])); + if (sprite->data[3] == 13) + sprite->callback = sub_810F400; + else + sprite->data[3]++; +} + +static void sub_810F400(struct Sprite *sprite) +{ + u16 color; + u16 startOffset; + int i; + + if (++sprite->data[1] == 2) + { + sprite->data[1] = 0; + startOffset = sprite->data[0]; + color = gPlttBufferFaded[startOffset + 8]; + + for (i = 8; i > 0; i--) + gPlttBufferFaded[startOffset + i] = gPlttBufferFaded[startOffset + i - 1]; + + gPlttBufferFaded[startOffset + 1] = color; + + if (++sprite->data[2] == 16) + sprite->callback = sub_810F46C; + } +} + +static void sub_810F46C(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[3], 16 - sprite->data[3])); + + if (--sprite->data[3] == -1) + { + if (!IsContest()) + { + u8 battlerCopy; + u8 battler = battlerCopy = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); + + if (IsBattlerSpriteVisible(battler)) + gSprites[gBattlerSpriteIds[battler]].invisible = 0; + + battler = BATTLE_PARTNER(battlerCopy); + if (IsBattlerSpriteVisible(battler)) + gSprites[gBattlerSpriteIds[battler]].invisible = 0; + } + + sprite->invisible = 1; + sprite->callback = sub_810F524; + } +} + +static void sub_810F524(struct Sprite *sprite) +{ + if (!IsContest()) + { + u8 battlerCopy; + u8 battler = battlerCopy = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); + u8 rank = GetBattlerSpriteBGPriorityRank(battler); + int var0 = 1; + u8 toBG_2 = (rank ^ var0) != 0; + + if (IsBattlerSpriteVisible(battler)) + sub_80A477C(toBG_2); + + battler = battlerCopy ^ 2; + if (IsBattlerSpriteVisible(battler)) + sub_80A477C(toBG_2 ^ var0); + } + + sprite->callback = DestroyAnimSprite; +} + +void sub_810F58C(struct Sprite *sprite) +{ + if (sprite->data[0] == 0) + { + int arg3 = gBattleAnimArgs[3]; + bool8 respectMonPicOffsets = FALSE; + if (arg3 == 0) + respectMonPicOffsets = TRUE; + + if (!IsContest() && IsDoubleBattle()) + { + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) + { + sprite->pos1.x = 72 - gBattleAnimArgs[0]; + sprite->pos1.y = gBattleAnimArgs[1] + 80; + } + else + { + sprite->pos1.x = gBattleAnimArgs[0] + 176; + sprite->pos1.y = gBattleAnimArgs[1] + 40; + } + } + else + { + if (gBattleAnimArgs[2] == 0) + InitSpritePosToAnimAttacker(sprite, respectMonPicOffsets); + else + InitSpritePosToAnimTarget(sprite, respectMonPicOffsets); + } + + sprite->data[0]++; + } + else + { + if (sprite->animEnded || sprite->affineAnimEnded) + DestroySpriteAndMatrix(sprite); + } +} + +void sub_810F634(struct Sprite *sprite) +{ + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); + + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + { + StartSpriteAnim(sprite, 1); + sprite->pos1.x -= 40; + sprite->pos1.y += 10; + sprite->data[1] = -1; + } + else + { + sprite->pos1.x += 40; + sprite->pos1.y -= 10; + sprite->data[1] = 1; + } + + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); + sprite->callback = RunStoredCallbackWhenAnimEnds; +} + +void sub_810F6B0(struct Sprite *sprite) +{ + s16 x = sub_80A861C(gBattleAnimAttacker, 1) / 2; + s16 y = sub_80A861C(gBattleAnimAttacker, 0) / -2; + + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) + x = -x; + + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) + x; + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + y; + + if (sprite->pos1.y < 16) + sprite->pos1.y = 16; + + StoreSpriteCallbackInData6(sprite, sub_810F740); + sprite->callback = RunStoredCallbackWhenAnimEnds; +} + +static void sub_810F740(struct Sprite *sprite) +{ + sprite->oam.affineMode = 1; + sprite->affineAnims = gUnknown_08596740; + sprite->data[0] = 0; + InitSpriteAffineAnim(sprite); + sprite->callback = sub_810F774; +} + +static void sub_810F774(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + if (sprite->affineAnimEnded) + { + FreeOamMatrix(sprite->oam.matrixNum); + sprite->oam.affineMode = 0; + sprite->data[1] = 18; + sprite->data[0]++; + } + break; + case 1: + if (--sprite->data[1] == -1) + DestroyAnimSprite(sprite); + break; + } +} + +void sub_810F7D4(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); + task->data[0] = spriteId; + PrepareAffineAnimInTaskData(task, spriteId, gUnknown_0859675C); + task->func = sub_810F810; +} + +static void sub_810F810(u8 taskId) +{ + if (!RunAffineAnimFromTaskData(&gTasks[taskId])) + DestroyAnimVisualTask(taskId); +} + +void sub_810F83C(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); + task->data[0] = spriteId; + task->data[1] = 0; + task->data[2] = 0; + task->data[3] = GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER ? 4 : 8; + + PrepareAffineAnimInTaskData(task, task->data[0], gUnknown_0859677C); + task->func = sub_810F898; +} + +static void sub_810F898(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + switch (task->data[1]) + { + case 0: + RunAffineAnimFromTaskData(task); + if (++task->data[2] > 19) + task->data[1]++; + break; + case 1: + if (task->data[3] != 0) + { + gSprites[task->data[0]].pos2.y -= 8; + task->data[3]--; + } + else + { + gSprites[task->data[0]].invisible = 1; + gSprites[task->data[0]].pos1.x = 272; + ResetSpriteRotScale(task->data[0]); + DestroyAnimVisualTask(taskId); + } + break; + } +} + +void sub_810F940(u8 taskId) +{ + u16 var0, var1; + + struct Task *task = &gTasks[taskId]; + + task->data[3] = 16; + task->data[4] = 0; + task->data[13] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + task->data[14] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); + + var0 = sub_80A861C(gBattleAnimAttacker, 1) / 3; + var1 = sub_80A861C(gBattleAnimAttacker, 0) / 3; + task->data[12] = var0 > var1 ? var0 : var1; + + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(16, 0)); + + task->func = sub_810F9D4; +} + +static void sub_810F9D4(u8 taskId) +{ + u16 i; + u8 spriteId; + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + if (++task->data[1] > 8) + { + task->data[1] = 0; + spriteId = CreateSprite(&gUnknown_08596794, task->data[13], task->data[14], 0); + task->data[task->data[2] + 8] = spriteId; + if (spriteId != MAX_SPRITES) + { + switch (task->data[2]) + { + case 0: + gSprites[spriteId].pos2.x = task->data[12]; + gSprites[spriteId].pos2.y = -task->data[12]; + break; + case 1: + gSprites[spriteId].pos2.x = -task->data[12]; + gSprites[spriteId].pos2.y = task->data[12]; + break; + case 2: + gSprites[spriteId].pos2.x = task->data[12]; + gSprites[spriteId].pos2.y = task->data[12]; + break; + case 3: + gSprites[spriteId].pos2.x = -task->data[12]; + gSprites[spriteId].pos2.y = -task->data[12]; + break; + } + } + + if (++task->data[2] == 5) + task->data[0]++; + } + break; + case 1: + if (task->data[1] & 1) + task->data[3]--; + else + task->data[4]++; + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(task->data[3], task->data[4])); + if (++task->data[1] == 32) + { + for (i = 8; i < 13; i++) + { + if (task->data[i] != 64) + DestroySprite(&gSprites[task->data[i]]); + } + + task->data[0]++; + } + break; + case 2: + task->data[0]++; + break; + case 3: + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetGpuReg(REG_OFFSET_BLDCNT, 0); + DestroyAnimVisualTask(taskId); + break; + } +} + +static void sub_810FB60(struct Sprite *sprite) +{ + if (sprite->data[1] > sprite->data[0] - 10) + sprite->invisible = sprite->data[1] & 1; + + if (sprite->data[1] == sprite->data[0]) + DestroyAnimSprite(sprite); + + sprite->data[1]++; +} + +void sub_810FBA8(struct Sprite *sprite) +{ + if (gBattleAnimArgs[0] == 0) + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); + } + + sprite->data[0] = gBattleAnimArgs[1]; + sprite->callback = sub_810FB60; +} + +void sub_810FBF0(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + if (IsContest()) + { + if (gBattleAnimArgs[0] == 1) + { + task->data[10] = -10; + task->data[11] = sub_80A861C(gBattleAnimTarget, 5) - 8; + task->data[12] = sub_80A861C(gBattleAnimTarget, 2) + 8; + task->data[13] = sub_80A861C(gBattleAnimAttacker, 5) - 8; + task->data[14] = sub_80A861C(gBattleAnimAttacker, 2) + 8; + } + else + { + task->data[10] = 10; + task->data[11] = sub_80A861C(gBattleAnimAttacker, 4) + 8; + task->data[12] = sub_80A861C(gBattleAnimAttacker, 3) - 8; + task->data[13] = sub_80A861C(gBattleAnimTarget, 4) + 8; + task->data[14] = sub_80A861C(gBattleAnimTarget, 3) - 8; + } + } + else + { + if (gBattleAnimArgs[0] == 1) + { + task->data[10] = -10; + task->data[11] = sub_80A861C(gBattleAnimTarget, 4) + 8; + task->data[12] = sub_80A861C(gBattleAnimTarget, 2) + 8; + task->data[13] = sub_80A861C(gBattleAnimAttacker, 4) + 8; + task->data[14] = sub_80A861C(gBattleAnimAttacker, 2) + 8; + } + else + { + task->data[10] = 10; + task->data[11] = sub_80A861C(gBattleAnimAttacker, 5) - 8; + task->data[12] = sub_80A861C(gBattleAnimAttacker, 3) - 8; + task->data[13] = sub_80A861C(gBattleAnimTarget, 5) - 8; + task->data[14] = sub_80A861C(gBattleAnimTarget, 3) - 8; + } + } + + task->data[1] = 6; + task->func = sub_810FD3C; +} + +static void sub_810FD3C(u8 taskId) +{ + u8 spriteId; + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + if (++task->data[1] > 6) + { + task->data[1] = 0; + spriteId = CreateSprite(&gUnknown_08596864, task->data[11], task->data[12], 0); + if (spriteId != 64) + { + gSprites[spriteId].data[0] = 16; + gSprites[spriteId].data[2] = task->data[13]; + gSprites[spriteId].data[4] = task->data[14]; + gSprites[spriteId].data[5] = task->data[10]; + + InitAnimArcTranslation(&gSprites[spriteId]); + StartSpriteAffineAnim(&gSprites[spriteId], task->data[2] & 3); + } + + if (++task->data[2] == 12) + task->data[0]++; + } + break; + case 1: + if (++task->data[1] > 17) + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_810FDF0(struct Sprite *sprite) +{ + if (TranslateAnimArc(sprite)) + { + FreeOamMatrix(sprite->oam.matrixNum); + DestroySprite(sprite); + } +} + +void sub_810FE14(u8 taskId) +{ + s16 i; + u8 yOffset; + struct ScanlineEffectParams scanlineParams; + struct Task *task = &gTasks[taskId]; + + yOffset = GetBattlerYCoordWithElevation(gBattleAnimTarget); + task->data[14] = yOffset - 32; + + switch (gBattleAnimArgs[0]) + { + case 0: + task->data[11] = 2; + task->data[12] = 5; + task->data[13] = 64; + task->data[15] = yOffset + 32; + break; + case 1: + task->data[11] = 2; + task->data[12] = 5; + task->data[13] = 192; + task->data[15] = yOffset + 32; + break; + case 2: + task->data[11] = 4; + task->data[12] = 4; + task->data[13] = 0; + task->data[15] = yOffset + 32; + break; + } + + if (task->data[14] < 0) + task->data[14] = 0; + + if (GetBattlerSpriteBGPriorityRank(gBattleAnimTarget) == 1) + { + task->data[10] = gBattle_BG1_X; + scanlineParams.dmaDest = ®_BG1HOFS; + } + else + { + task->data[10] = gBattle_BG2_X; + scanlineParams.dmaDest = ®_BG2HOFS; + } + + i = task->data[14]; + while (i <= task->data[14] + 64) + { + gScanlineEffectRegBuffers[0][i] = task->data[10]; + gScanlineEffectRegBuffers[1][i] = task->data[10]; + i++; + } + + scanlineParams.dmaControl = SCANLINE_EFFECT_DMACNT_16BIT; + scanlineParams.initState = 1; + scanlineParams.unused9 = 0; + ScanlineEffect_SetParams(scanlineParams); + task->func = sub_810FF34; +} + +static void sub_810FF34(u8 taskId) +{ + s16 sineIndex, i; + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + sineIndex = task->data[13]; + i = task->data[14]; + while (i <= task->data[15]) + { + s16 var2 = (gSineTable[sineIndex] >> task->data[12]); + if (var2 > 0) + var2 += (task->data[1] & 3); + else if (var2 < 0) + var2 -= (task->data[1] & 3); + + gScanlineEffectRegBuffers[0][i] = task->data[10] + var2; + gScanlineEffectRegBuffers[1][i] = task->data[10] + var2; + sineIndex += task->data[11]; + i++; + } + + if (++task->data[1] > 23) + task->data[0]++; + break; + case 1: + gScanlineEffect.state = 3; + task->data[0]++; + break; + case 2: + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_8110034(u8 taskId) +{ + s16 spriteId; + s16 matrixNum; + struct Task *task = &gTasks[taskId]; + + matrixNum = AllocOamMatrix(); + if (matrixNum == 0xFF) + { + DestroyAnimVisualTask(taskId); + return; + } + + spriteId = CloneBattlerSpriteWithBlend(gBattleAnimArgs[0]); + if (spriteId < 0) + { + FreeOamMatrix(matrixNum); + DestroyAnimVisualTask(taskId); + return; + } + + gSprites[spriteId].callback = SpriteCallbackDummy; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_DOUBLE; + gSprites[spriteId].oam.matrixNum = matrixNum; + gSprites[spriteId].affineAnimPaused = 1; + gSprites[spriteId].subpriority++; + SetSpriteRotScale(spriteId, 256, 256, 0); + CalcCenterToCornerVec(&gSprites[spriteId], gSprites[spriteId].oam.shape, gSprites[spriteId].oam.size, gSprites[spriteId].oam.affineMode); + task->data[13] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + task->data[14] = matrixNum; + task->data[15] = spriteId; + task->func = sub_8110134; +} + +static void sub_8110134(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + task->data[1] += 4; + task->data[2] = 256 - (gSineTable[task->data[1]] >> 1); + SetSpriteRotScale(task->data[15], task->data[2], task->data[2], 0); + SetBattlerSpriteYOffsetFromOtherYScale(task->data[15], task->data[13]); + if (task->data[1] == 48) + task->data[0]++; + break; + case 1: + task->data[1] -= 4; + task->data[2] = 256 - (gSineTable[task->data[1]] >> 1);; + SetSpriteRotScale(task->data[15], task->data[2], task->data[2], 0); + SetBattlerSpriteYOffsetFromOtherYScale(task->data[15], task->data[13]); + if (task->data[1] == 0) + task->data[0]++; + break; + case 2: + obj_delete_but_dont_free_vram(&gSprites[task->data[15]]); + task->data[0]++; + break; + case 3: + FreeOamMatrix(task->data[14]); + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_8110240(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y); + + if (IsContest()) + sprite->pos1.y += 12; + + sprite->data[1] = 8; + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[1], 16 - sprite->data[1])); + sprite->data[0]++; + break; + case 1: + if (sprite->affineAnimEnded) + { + PlaySE12WithPanning(SE_W100, BattleAnimAdjustPanning(-64)); + ChangeSpriteAffineAnim(sprite, 1); + sprite->data[0]++; + } + break; + case 2: + if (sprite->data[2]++ > 1) + { + sprite->data[2] = 0; + sprite->data[1]--; + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[1], 16 - sprite->data[1])); + if (sprite->data[1] == 0) + { + sprite->data[0]++; + sprite->invisible = 1; + } + } + + sprite->data[3] += 0x380; + sprite->pos2.y -= sprite->data[3] >> 8; + sprite->data[3] &= 0xFF; + break; + case 3: + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + DestroyAnimSprite(sprite); + break; + } +} diff --git a/src/rayquaza_scene.c b/src/rayquaza_scene.c index b22e1db32..94d81e30f 100644 --- a/src/rayquaza_scene.c +++ b/src/rayquaza_scene.c @@ -1528,14 +1528,14 @@ static void sub_81D706C(void) LZDecompressWram(gRaySceneClouds1_Tilemap, sRayScene->tilemapBuffers[1]); LZDecompressWram(gRaySceneClouds3_Tilemap, sRayScene->tilemapBuffers[2]); LoadCompressedPalette(gRaySceneClouds_Pal, 0, 0x40); - LoadCompressedObjectPic(&sUnknown_0862A8C4); - LoadCompressedObjectPic(&sUnknown_0862A8F8); - LoadCompressedObjectPic(&sUnknown_0862A924); - LoadCompressedObjectPic(&sUnknown_0862A9D4); - LoadCompressedObjectPic(&sUnknown_0862AA14); - LoadCompressedObjectPic(&sUnknown_0862AA34); - LoadCompressedObjectPalette(&sUnknown_0862A8CC); - LoadCompressedObjectPalette(&sUnknown_0862A9DC); + LoadCompressedSpriteSheet(&sUnknown_0862A8C4); + LoadCompressedSpriteSheet(&sUnknown_0862A8F8); + LoadCompressedSpriteSheet(&sUnknown_0862A924); + LoadCompressedSpriteSheet(&sUnknown_0862A9D4); + LoadCompressedSpriteSheet(&sUnknown_0862AA14); + LoadCompressedSpriteSheet(&sUnknown_0862AA34); + LoadCompressedSpritePalette(&sUnknown_0862A8CC); + LoadCompressedSpritePalette(&sUnknown_0862A9DC); } static void Task_DuoFightAnim(u8 taskId) @@ -1943,8 +1943,8 @@ static void sub_81D7E9C(void) LZDecompressWram(gRaySceneOvercast_Tilemap, sRayScene->tilemapBuffers[1]); LZDecompressWram(gRaySceneRayquaza_Tilemap, sRayScene->tilemapBuffers[2]); LoadCompressedPalette(gRaySceneRayquaza_Pal, 0, 0x40); - LoadCompressedObjectPic(&sUnknown_0862AA90); - LoadCompressedObjectPalette(&sUnknown_0862AA98); + LoadCompressedSpriteSheet(&sUnknown_0862AA90); + LoadCompressedSpritePalette(&sUnknown_0862AA98); } static void Task_RayTakesFlightAnim(u8 taskId) @@ -2118,9 +2118,9 @@ static void sub_81D8358(void) LoadCompressedPalette(gRaySceneOvercast2_Pal, 0, 0x40); gPlttBufferUnfaded[0] = RGB_WHITE; gPlttBufferFaded[0] = RGB_WHITE; - LoadCompressedObjectPic(&sUnknown_0862AAFC); - LoadCompressedObjectPic(&sUnknown_0862AB04); - LoadCompressedObjectPalette(&sUnknown_0862AB0C); + LoadCompressedSpriteSheet(&sUnknown_0862AAFC); + LoadCompressedSpriteSheet(&sUnknown_0862AB04); + LoadCompressedSpritePalette(&sUnknown_0862AB0C); } static void sub_81D844C(void) @@ -2489,16 +2489,16 @@ static void sub_81D8CC4(void) LZDecompressWram(gRaySceneHushBg_Tilemap, sRayScene->tilemapBuffers[0]); LZDecompressWram(gRaySceneHushRing_Map, sRayScene->tilemapBuffers[2]); LoadCompressedPalette(gRaySceneHushBg_Pal, 0, 0x60); - LoadCompressedObjectPic(&sUnknown_0862AC28); - LoadCompressedObjectPic(&sUnknown_0862AC30); - LoadCompressedObjectPic(&sUnknown_0862AC38); - LoadCompressedObjectPic(&sUnknown_0862AC40); - LoadCompressedObjectPic(&sUnknown_0862AC48); - LoadCompressedObjectPic(&sUnknown_0862AC50); - LoadCompressedObjectPalette(&sUnknown_0862AC58); - LoadCompressedObjectPalette(&sUnknown_0862AC60); - LoadCompressedObjectPalette(&sUnknown_0862AC68); - LoadCompressedObjectPalette(&sUnknown_0862AC70); + LoadCompressedSpriteSheet(&sUnknown_0862AC28); + LoadCompressedSpriteSheet(&sUnknown_0862AC30); + LoadCompressedSpriteSheet(&sUnknown_0862AC38); + LoadCompressedSpriteSheet(&sUnknown_0862AC40); + LoadCompressedSpriteSheet(&sUnknown_0862AC48); + LoadCompressedSpriteSheet(&sUnknown_0862AC50); + LoadCompressedSpritePalette(&sUnknown_0862AC58); + LoadCompressedSpritePalette(&sUnknown_0862AC60); + LoadCompressedSpritePalette(&sUnknown_0862AC68); + LoadCompressedSpritePalette(&sUnknown_0862AC70); } static void Task_RayChasesAwayAnim(u8 taskId) diff --git a/src/record_mixing.c b/src/record_mixing.c index 6d5d49265..2b497c82b 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -23,7 +23,7 @@ #include "menu.h" #include "overworld.h" #include "field_screen_effect.h" -#include "fldeff_80F9BCC.h" +#include "fldeff_misc.h" #include "script.h" #include "event_data.h" #include "lilycove_lady.h" diff --git a/src/region_map.c b/src/region_map.c index d7b53d631..4caf3147a 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -11,7 +11,6 @@ #include "overworld.h" #include "constants/flags.h" #include "event_data.h" -#include "rom6.h" #include "secret_base.h" #include "string_util.h" #include "international_string_util.h" @@ -20,6 +19,8 @@ #include "constants/songs.h" #include "m4a.h" #include "field_effect.h" +#include "field_specials.h" +#include "fldeff.h" #include "region_map.h" #include "constants/region_map_sections.h" #include "heal_location.h" diff --git a/src/rock.c b/src/rock.c index d82fbf9c4..ebf477ec1 100644 --- a/src/rock.c +++ b/src/rock.c @@ -367,16 +367,16 @@ void sub_8110AB4(struct Sprite *sprite) sprite->data[3] = 0; sprite->data[4] = 0; - sprite->callback = TranslateAnimLinearSimple; + sprite->callback = AnimTranslateLinearSimple; StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); } void sub_8110B38(struct Sprite *sprite) { if (gBattleAnimArgs[6] == 0) - InitAnimSpritePos(sprite, 0); + InitSpritePosToAnimAttacker(sprite, 0); else - sub_80A6980(sprite, FALSE); + InitSpritePosToAnimTarget(sprite, FALSE); sprite->data[0] = gBattleAnimArgs[3]; sprite->data[1] = gBattleAnimArgs[2]; @@ -555,7 +555,7 @@ void AnimDirtParticleAcrossScreen(struct Sprite *sprite) void AnimRaiseSprite(struct Sprite *sprite) { StartSpriteAnim(sprite, gBattleAnimArgs[4]); - InitAnimSpritePos(sprite, 0); + InitSpritePosToAnimAttacker(sprite, 0); sprite->data[0] = gBattleAnimArgs[3]; sprite->data[2] = sprite->pos1.x; diff --git a/src/rom_8011DC0.c b/src/rom_8011DC0.c index deec55c9d..066f7695c 100644 --- a/src/rom_8011DC0.c +++ b/src/rom_8011DC0.c @@ -189,7 +189,6 @@ extern u16 gUnknown_02022C3C; extern u8 gUnknown_02022C20[]; extern u8 gFieldLinkPlayerCount; extern u8 gUnknown_03005DB4; -extern u8 gSelectedOrderFromParty[]; extern struct MailStruct gUnknown_020321C0[PARTY_SIZE]; extern u8 gUnknown_02032298[2]; diff --git a/src/rom_8034C54.c b/src/rom_8034C54.c index e175ecc64..cc875bd3f 100644 --- a/src/rom_8034C54.c +++ b/src/rom_8034C54.c @@ -3,6 +3,7 @@ #include "alloc.h" #include "decompress.h" #include "main.h" +#include "battle_main.h" struct UnkStruct2 { @@ -31,8 +32,6 @@ struct UnkStruct1 struct UnkStruct2 *array; }; -extern const struct SpriteTemplate gUnknown_0831AC88; - // this file's functions static u8 sub_8035518(u8 arg0);; static void sub_8034EFC(struct UnkStruct2 *arg0); @@ -133,7 +132,7 @@ bool32 sub_8034D14(u32 id, s32 arg1, const struct UnkStruct3 *arg2) compSpriteSheet = *(struct CompressedSpriteSheet*)(arg2->spriteSheet); compSpriteSheet.size = GetDecompressedDataSize(arg2->spriteSheet->data); - gUnknown_02022E10->array[id].tileStart = LoadCompressedObjectPic(&compSpriteSheet); + gUnknown_02022E10->array[id].tileStart = LoadCompressedSpriteSheet(&compSpriteSheet); } if (gUnknown_02022E10->array[id].tileStart == 0xFFFF) diff --git a/src/save.c b/src/save.c index 4ae516fc9..905f075fb 100644 --- a/src/save.c +++ b/src/save.c @@ -5,6 +5,7 @@ #include "decompress.h" #include "load_save.h" #include "overworld.h" +#include "pokemon_storage_system.h" #include "main.h" #include "constants/game_stat.h" diff --git a/src/scrcmd.c b/src/scrcmd.c index e699bfeab..ab3af019d 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1485,7 +1485,7 @@ bool8 ScrCmd_braillemessage(struct ScriptContext *ctx) StringExpandPlaceholders(gStringVar4, ptr + 6); - width = GetStringWidth(6, gStringVar4, -1) / 8; + width = GetStringWidth(6, gStringVar4, -1) / 8u; if (width > 0x1C) width = 0x1C; @@ -1713,8 +1713,7 @@ bool8 ScrCmd_checkpartymove(struct ScriptContext *ctx) u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL); if (!species) break; - // UB: GetMonData() arguments don't match function definition - if (!GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG) && pokemon_has_move(&gPlayerParty[i], moveId) == TRUE) + if (!GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG) && MonKnowsMove(&gPlayerParty[i], moveId) == TRUE) { gSpecialVar_Result = i; gSpecialVar_0x8004 = species; diff --git a/src/script_menu.c b/src/script_menu.c index 2aa546288..6f16b1a8a 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -1640,27 +1640,27 @@ static void sub_80E2A94(u8 multichoiceId) { case 77: FillWindowPixelBuffer(0, 0x11); - AddTextPrinterParameterized2(0, 1, gUnknown_0858BBAC[GetMenuCursorPos()], 0, NULL, 2, 1, 3); + AddTextPrinterParameterized2(0, 1, gUnknown_0858BBAC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 76: FillWindowPixelBuffer(0, 0x11); - AddTextPrinterParameterized2(0, 1, gUnknown_0858BB9C[GetMenuCursorPos()], 0, NULL, 2, 1, 3); + AddTextPrinterParameterized2(0, 1, gUnknown_0858BB9C[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 78: FillWindowPixelBuffer(0, 0x11); - AddTextPrinterParameterized2(0, 1, gUnknown_0858BBBC[GetMenuCursorPos()], 0, NULL, 2, 1, 3); + AddTextPrinterParameterized2(0, 1, gUnknown_0858BBBC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 79: FillWindowPixelBuffer(0, 0x11); - AddTextPrinterParameterized2(0, 1, gUnknown_0858BBCC[GetMenuCursorPos()], 0, NULL, 2, 1, 3); + AddTextPrinterParameterized2(0, 1, gUnknown_0858BBCC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 75: FillWindowPixelBuffer(0, 0x11); - AddTextPrinterParameterized2(0, 1, gUnknown_0858BBEC[GetMenuCursorPos()], 0, NULL, 2, 1, 3); + AddTextPrinterParameterized2(0, 1, gUnknown_0858BBEC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 74: FillWindowPixelBuffer(0, 0x11); - AddTextPrinterParameterized2(0, 1, gUnknown_0858BBE0[GetMenuCursorPos()], 0, NULL, 2, 1, 3); + AddTextPrinterParameterized2(0, 1, gUnknown_0858BBE0[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; } } diff --git a/src/script_pokemon_util_80F87D8.c b/src/script_pokemon_util_80F87D8.c index fc5a06024..2611c5c6d 100755 --- a/src/script_pokemon_util_80F87D8.c +++ b/src/script_pokemon_util_80F87D8.c @@ -36,8 +36,6 @@ extern const u16 gEventObjectPalette33[]; extern const u16 gEventObjectPalette34[]; extern const struct CompressedSpriteSheet gMonFrontPicTable[]; -extern u8 gSelectedOrderFromParty[]; - static const u8 gUnknown_0858D8EC[] = { 3, 4, 5, 14 }; static void sub_80F8EE8(u8 taskId); @@ -335,7 +333,7 @@ void ShowContestEntryMonPic(void) HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality); palette = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality); - LoadCompressedObjectPalette(palette); + LoadCompressedSpritePalette(palette); SetMultiuseSpriteTemplateToPokemon(species, 1); gMultiuseSpriteTemplate.paletteTag = palette->tag; spriteId = CreateSprite(&gMultiuseSpriteTemplate, (left + 1) * 8 + 32, (top * 8) + 40, 0); diff --git a/src/secret_base.c b/src/secret_base.c index 9b5685d8b..7e7b10a9a 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -16,12 +16,14 @@ #include "overworld.h" #include "fieldmap.h" #include "field_camera.h" +#include "field_specials.h" #include "field_player_avatar.h" #include "field_screen_effect.h" #include "field_weather.h" #include "event_object_movement.h" #include "field_effect.h" -#include "fldeff_80F9BCC.h" +#include "fldeff.h" +#include "fldeff_misc.h" #include "metatile_behavior.h" #include "map_name_popup.h" #include "string_util.h" @@ -32,7 +34,6 @@ #include "event_data.h" #include "battle.h" #include "battle_setup.h" -#include "rom6.h" #include "decoration.h" #include "link.h" #include "tv.h" @@ -188,7 +189,7 @@ void sub_80E8B6C(void) continue; } gSpecialVar_Result = TRUE; - VarSet(VAR_0x4054, i); + VarSet(VAR_CURRENT_SECRET_BASE, i); break; } } @@ -318,7 +319,7 @@ void sub_80E8E18(void) { gSaveBlock1Ptr->secretBases[0].trainerId[i] = gSaveBlock2Ptr->playerTrainerId[i]; } - VarSet(VAR_0x4054, 0); + VarSet(VAR_CURRENT_SECRET_BASE, 0); StringCopyN(gSaveBlock1Ptr->secretBases[0].trainerName, gSaveBlock2Ptr->playerName, sub_80E8DF4(gSaveBlock2Ptr->playerName)); gSaveBlock1Ptr->secretBases[0].gender = gSaveBlock2Ptr->playerGender; gSaveBlock1Ptr->secretBases[0].language = GAME_LANGUAGE; @@ -381,7 +382,7 @@ void sub_80E8FD0(u8 taskId) } break; case 1: - secretBaseRecordId = VarGet(VAR_0x4054); + secretBaseRecordId = VarGet(VAR_CURRENT_SECRET_BASE); if (gSaveBlock1Ptr->secretBases[secretBaseRecordId].sbr_field_10 < 255) { gSaveBlock1Ptr->secretBases[secretBaseRecordId].sbr_field_10 ++; @@ -477,7 +478,7 @@ void sub_80E9238(u8 flagIn) if (CurrentMapIsSecretBase()) { - curBaseId = VarGet(VAR_0x4054); + curBaseId = VarGet(VAR_CURRENT_SECRET_BASE); decorations = gSaveBlock1Ptr->secretBases[curBaseId].decorations; decorPos = gSaveBlock1Ptr->secretBases[curBaseId].decorationPos; for (x = 0; x < 16; x ++) @@ -520,7 +521,7 @@ void sub_80E933C(void) } else { - curBase = VarGet(VAR_0x4054); + curBase = VarGet(VAR_CURRENT_SECRET_BASE); roomDecor = gSaveBlock1Ptr->secretBases[curBase].decorations; roomDecorPos = gSaveBlock1Ptr->secretBases[curBase].decorationPos; nDecor = 16; @@ -556,7 +557,7 @@ void sub_80E933C(void) show_sprite(gSpecialVar_Result, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); sub_808EBA8(gSpecialVar_Result, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, gSpecialVar_0x8006, gSpecialVar_0x8007); sub_808F254(gSpecialVar_Result, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); - if (CurrentMapIsSecretBase() == TRUE && VarGet(VAR_0x4054) != 0) + if (CurrentMapIsSecretBase() == TRUE && VarGet(VAR_CURRENT_SECRET_BASE) != 0) { if (category == DECORCAT_DOLL) { @@ -592,7 +593,7 @@ void sub_80E9578(void) void sub_80E95D4(void) { - VarSet(VAR_OBJ_GFX_ID_F, gUnknown_0858D060[sub_80EA20C(VarGet(VAR_0x4054))]); + VarSet(VAR_OBJ_GFX_ID_F, gUnknown_0858D060[sub_80EA20C(VarGet(VAR_CURRENT_SECRET_BASE))]); } void sub_80E9608(const struct MapPosition *position, const struct MapEvents *events) @@ -679,7 +680,7 @@ u8 *sub_80E9780(u8 *dest, u8 secretBaseRecordId) u8 *GetSecretBaseMapName(u8 *dest) { - return sub_80E9780(dest, VarGet(VAR_0x4054)); + return sub_80E9780(dest, VarGet(VAR_CURRENT_SECRET_BASE)); } void sub_80E980C(void) @@ -687,7 +688,7 @@ void sub_80E980C(void) u8 secretBaseRecordId; const u8 *src; - secretBaseRecordId = VarGet(VAR_0x4054); + secretBaseRecordId = VarGet(VAR_CURRENT_SECRET_BASE); src = gSaveBlock1Ptr->secretBases[secretBaseRecordId].trainerName; *StringCopyN(gStringVar1, src, sub_80E8DF4(src)) = EOS; ConvertInternationalString(gStringVar1, gSaveBlock1Ptr->secretBases[secretBaseRecordId].language); @@ -827,7 +828,7 @@ u8 sub_80E9BA8(void) void sub_80E9BDC(void) { - if (sub_80E9878(VarGet(VAR_0x4054)) == TRUE) + if (sub_80E9878(VarGet(VAR_CURRENT_SECRET_BASE)) == TRUE) { gSpecialVar_Result = 1; } @@ -843,7 +844,7 @@ void sub_80E9BDC(void) void sub_80E9C2C(void) { - gSaveBlock1Ptr->secretBases[VarGet(VAR_0x4054)].sbr_field_1_6 ^= 1; + gSaveBlock1Ptr->secretBases[VarGet(VAR_CURRENT_SECRET_BASE)].sbr_field_1_6 ^= 1; FlagSet(0x10C); } @@ -1079,7 +1080,7 @@ void sub_80EA18C(u8 taskId) void task_pc_turn_off(u8 taskId) { - if (VarGet(VAR_0x4054) == 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) == 0) { ScriptContext1_SetupScript(gUnknown_0823B4E8); } @@ -1099,7 +1100,7 @@ const u8 *GetSecretBaseTrainerLoseText(void) { u8 param; - param = sub_80EA20C(VarGet(VAR_0x4054)); + param = sub_80EA20C(VarGet(VAR_CURRENT_SECRET_BASE)); if (param == 0) { return SecretBase_RedCave1_Text_274966; @@ -1148,7 +1149,7 @@ void sub_80EA2E4(void) void sub_80EA30C(void) { - gSaveBlock1Ptr->secretBases[VarGet(VAR_0x4054)].sbr_field_1_5 = gSpecialVar_Result; + gSaveBlock1Ptr->secretBases[VarGet(VAR_CURRENT_SECRET_BASE)].sbr_field_1_5 = gSpecialVar_Result; } void sub_80EA354(void) @@ -1156,7 +1157,7 @@ void sub_80EA354(void) u16 secretBaseRecordId; u8 i; - secretBaseRecordId = VarGet(VAR_0x4054); + secretBaseRecordId = VarGet(VAR_CURRENT_SECRET_BASE); if (!FlagGet(0x922)) { for (i = 0; i < 20; i ++) @@ -1181,7 +1182,7 @@ void sub_80EA3E4(u8 taskId) switch (data[1]) { case 0: - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { gUnknown_0203A01D = TRUE; } @@ -1254,7 +1255,7 @@ void sub_80EA3E4(u8 taskId) } else if (MetatileBehavior_IsSecretBaseBalloon(behavior) == TRUE) { - sub_80FA5E4(MapGridGetMetatileIdAt(x, y), x, y); + PopSecretBaseBalloon(MapGridGetMetatileIdAt(x, y), x, y); if (gUnknown_0203A01D == TRUE) { switch ((int)MapGridGetMetatileIdAt(x, y)) @@ -1276,7 +1277,7 @@ void sub_80EA3E4(u8 taskId) { VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) | 0x400); } - sub_80FA794(x, y); + ShatterSecretBaseBreakableDoor(x, y); } else if (MetatileBehavior_IsSecretBaseSoundMat(behavior) == TRUE){ if (gUnknown_0203A01D == TRUE) { @@ -1781,7 +1782,7 @@ void sub_80EB1AC(void) VarSet(VAR_0x40ED, 0); VarSet(VAR_0x40EE, 0); VarSet(VAR_0x40EF, 0); - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40F0, TRUE); } @@ -1809,7 +1810,7 @@ void sub_80EB218(void) void sub_80EB290(void) { - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) | 0x800); } @@ -1817,7 +1818,7 @@ void sub_80EB290(void) void sub_80EB2C8(void) { - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40EE, VarGet(VAR_0x40EE) | 0x400); } @@ -1825,7 +1826,7 @@ void sub_80EB2C8(void) void sub_80EB300(void) { - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40EE, VarGet(VAR_0x40EE) & ~0x3800); VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) & ~0x001); @@ -1835,7 +1836,7 @@ void sub_80EB300(void) void sub_80EB368(void) { - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40EE, VarGet(VAR_0x40EE) & ~0x3800); VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) & ~0x001); @@ -1845,7 +1846,7 @@ void sub_80EB368(void) void sub_80EB3D0(void) { - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40EE, VarGet(VAR_0x40EE) & ~0x3800); VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) & ~0x001); @@ -1855,7 +1856,7 @@ void sub_80EB3D0(void) void sub_80EB438(void) { - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40EE, VarGet(VAR_0x40EE) & ~0x3800); VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) & ~0x001); @@ -1886,7 +1887,7 @@ void sub_80EB498(void) case 0x332: case 0x333: case 0x334: - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40EE, VarGet(VAR_0x40EE) | 0x4000); } @@ -1904,7 +1905,7 @@ void sub_80EB56C(void) { case 0x28a: case 0x28b: - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40EE, VarGet(VAR_0x40EE) | 0x40); } @@ -1927,21 +1928,21 @@ void sub_80EB56C(void) case 0x2f9: case 0x2fa: case 0x2fb: - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40EE, VarGet(VAR_0x40EE) | 0x8); } break; case 0x22c: case 0x233: - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) | 0x40); } break; case 0x288: case 0x289: - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) | 0x100); } @@ -1949,7 +1950,7 @@ void sub_80EB56C(void) case 0x22d: case 0x22e: case 0x22f: - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) | 0x10); } @@ -1977,7 +1978,7 @@ void sub_80EB56C(void) case 0x2cd: case 0x2ce: case 0x2cf: - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) | 0x8); } @@ -2004,7 +2005,7 @@ void sub_80EB9E0(void) case 0x2be: case 0x2c3: case 0x2c6: - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) | 0x8); } @@ -2042,14 +2043,14 @@ void sub_80EBB28(void) case 0x2c4: case 0x2c5: case 0x2c7: - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) | 0x8); } break; case 0x280: case 0x281: - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) | 0x100); } @@ -2057,7 +2058,7 @@ void sub_80EBB28(void) case 0x225: case 0x226: case 0x227: - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) | 0x10); } @@ -2075,7 +2076,7 @@ void sub_80EBE7C(void) { case 0x28d: case 0x28e: - if (VarGet(VAR_0x4054) != 0) + if (VarGet(VAR_CURRENT_SECRET_BASE) != 0) { VarSet(VAR_0x40EF, VarGet(VAR_0x40EF) | 0x4); } diff --git a/src/smokescreen.c b/src/smokescreen.c index 9b37cd234..d9780bbb6 100644 --- a/src/smokescreen.c +++ b/src/smokescreen.c @@ -14,8 +14,8 @@ u8 sub_807521C(s16 x, s16 y, u8 a3) if (GetSpriteTileStartByTag(gUnknown_0831C620.tag) == 0xFFFF) { - LoadCompressedObjectPicUsingHeap(&gUnknown_0831C620); - LoadCompressedObjectPaletteUsingHeap(&gUnknown_0831C628); + LoadCompressedSpriteSheetUsingHeap(&gUnknown_0831C620); + LoadCompressedSpritePaletteUsingHeap(&gUnknown_0831C628); } mainSpriteId = CreateInvisibleSpriteWithCallback(sub_8075370); diff --git a/src/sound.c b/src/sound.c index ba3f659cc..c63183bdc 100644 --- a/src/sound.c +++ b/src/sound.c @@ -28,7 +28,6 @@ IWRAM_DATA static u16 sFanfareCounter; // iwram common bool8 gDisableMusic; -extern u32 gBattleTypeFlags; extern struct MusicPlayerInfo gMPlayInfo_BGM; extern struct MusicPlayerInfo gMPlayInfo_SE1; extern struct MusicPlayerInfo gMPlayInfo_SE2; @@ -37,8 +36,6 @@ extern struct ToneData gCryTable[]; extern struct ToneData gCryTable2[]; extern const struct Fanfare sFanfares[]; -extern u16 SpeciesToCryId(u16); - static void Task_Fanfare(u8 taskId); static void CreateFanfareTask(void); static void Task_DuckBGMForPokemonCry(u8 taskId); diff --git a/src/start_menu.c b/src/start_menu.c index 0e52f05fb..ad7b4b6cc 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -574,13 +574,13 @@ static bool8 HandleStartMenuInput(void) if (gMain.newKeys & DPAD_UP) { PlaySE(SE_SELECT); - sStartMenuCursorPos = MoveMenuCursor(-1); + sStartMenuCursorPos = Menu_MoveCursor(-1); } if (gMain.newKeys & DPAD_DOWN) { PlaySE(SE_SELECT); - sStartMenuCursorPos = MoveMenuCursor(1); + sStartMenuCursorPos = Menu_MoveCursor(1); } if (gMain.newKeys & A_BUTTON) diff --git a/src/starter_choose.c b/src/starter_choose.c index 46aac5590..afa3fabbf 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -412,8 +412,8 @@ void CB2_ChooseStarter(void) LoadPalette(GetOverworldTextboxPalettePtr(), 0xE0, 0x20); LoadPalette(gBirchBagGrassPal, 0, 0x40); - LoadCompressedObjectPic(&gUnknown_085B1ED8[0]); - LoadCompressedObjectPic(&gUnknown_085B1EE8[0]); + LoadCompressedSpriteSheet(&gUnknown_085B1ED8[0]); + LoadCompressedSpriteSheet(&gUnknown_085B1EE8[0]); LoadSpritePalettes(gUnknown_085B1EF8); BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0); diff --git a/src/text.c b/src/text.c index 07c15596e..a439d3ced 100644 --- a/src/text.c +++ b/src/text.c @@ -9,12 +9,12 @@ #include "window.h" #include "text.h" #include "blit.h" +#include "menu.h" #include "dynamic_placeholder_text_util.h" extern u8 GetKeypadIconWidth(u8 keypadIconId); extern u16 Font6Func(struct TextPrinter *textPrinter); extern u32 GetGlyphWidthFont6(u16 glyphId, bool32 isJapanese); -extern int GetPlayerTextSpeed(); EWRAM_DATA struct TextPrinter gTempTextPrinter = {0}; EWRAM_DATA struct TextPrinter gTextPrinters[NUM_TEXT_PRINTERS] = {0}; @@ -1858,7 +1858,7 @@ u32 (*GetFontWidthFunc(u8 glyphId))(u16, bool32) return NULL; } -u32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing) +s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing) { bool8 isJapanese; int minGlyphWidth; @@ -1868,7 +1868,7 @@ u32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing) u32 lineWidth; const u8 *bufferPointer; int glyphWidth; - u32 width; + s32 width; isJapanese = 0; minGlyphWidth = 0; @@ -2028,7 +2028,8 @@ u32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing) if (lineWidth > width) return lineWidth; - return width; + else + return width; } u8 RenderTextFont9(u8 *pixels, u8 fontId, u8 *str) diff --git a/src/title_screen.c b/src/title_screen.c index d60e3fc0b..c6e9aa26f 100644 --- a/src/title_screen.c +++ b/src/title_screen.c @@ -518,9 +518,9 @@ void CB2_InitTitleScreen(void) ResetSpriteData(); FreeAllSpritePalettes(); gReservedSpritePaletteCount = 9; - LoadCompressedObjectPic(&sSpriteSheet_EmeraldVersion[0]); - LoadCompressedObjectPic(&sSpriteSheet_PressStart[0]); - LoadCompressedObjectPic(&sPokemonLogoShineSpriteSheet[0]); + LoadCompressedSpriteSheet(&sSpriteSheet_EmeraldVersion[0]); + LoadCompressedSpriteSheet(&sSpriteSheet_PressStart[0]); + LoadCompressedSpriteSheet(&sPokemonLogoShineSpriteSheet[0]); LoadPalette(gTitleScreenEmeraldVersionPal, 0x100, 0x20); LoadSpritePalette(&sSpritePalette_PressStart[0]); gMain.state = 2; diff --git a/src/trade.c b/src/trade.c index f409e0206..c2e546847 100644 --- a/src/trade.c +++ b/src/trade.c @@ -425,7 +425,7 @@ void sub_80773D0(void) gMain.state++; break; case 8: - sub_81B5D30(); + LoadHeldItemIcons(); sub_81B5D4C(&gUnknown_0203229C->unk_36[0], gUnknown_0203229C->unk_28[0], 0); gMain.state++; break; @@ -611,7 +611,7 @@ void sub_8077B74(void) gMain.state++; break; case 8: - sub_81B5D30(); + LoadHeldItemIcons(); sub_81B5D4C(&gUnknown_0203229C->unk_36[0], gUnknown_0203229C->unk_28[0], 0); gMain.state++; break; @@ -3333,7 +3333,7 @@ bool32 sub_807A7BC(u16 a0, u8 a1) return FALSE; } -u32 sub_807A7E0(struct UnkLinkRfuStruct_02022B14Substruct a0, struct UnkLinkRfuStruct_02022B14Substruct a1, u16 a2, u16 a3, u8 a4, u16 a5, u8 a6) +int sub_807A7E0(struct UnkLinkRfuStruct_02022B14Substruct a0, struct UnkLinkRfuStruct_02022B14Substruct a1, u16 a2, u16 a3, u8 a4, u16 a5, u8 a6) { u8 r9 = a0.unk_01_0; u8 r2 = a0.unk_00_7; diff --git a/src/trainer_pokemon_sprites.c b/src/trainer_pokemon_sprites.c index f5354a1e8..5ddae218b 100644 --- a/src/trainer_pokemon_sprites.c +++ b/src/trainer_pokemon_sprites.c @@ -115,7 +115,7 @@ static void LoadPicPaletteByTagOrSlot(u16 species, u32 otId, u32 personality, u8 else { sCreatingSpriteTemplate.paletteTag = paletteTag; - LoadCompressedObjectPalette(GetMonSpritePalStructFromOtIdPersonality(species, otId, personality)); + LoadCompressedSpritePalette(GetMonSpritePalStructFromOtIdPersonality(species, otId, personality)); } } else @@ -128,7 +128,7 @@ static void LoadPicPaletteByTagOrSlot(u16 species, u32 otId, u32 personality, u8 else { sCreatingSpriteTemplate.paletteTag = paletteTag; - LoadCompressedObjectPalette(&gTrainerFrontPicPaletteTable[species]); + LoadCompressedSpritePalette(&gTrainerFrontPicPaletteTable[species]); } } } @@ -6,6 +6,8 @@ #include "event_data.h" #include "fieldmap.h" #include "field_camera.h" +#include "field_specials.h" +#include "fldeff.h" #include "strings.h" #include "string_util.h" #include "international_string_util.h" @@ -24,7 +26,6 @@ #include "event_scripts.h" #include "shop.h" #include "lilycove_lady.h" -#include "rom6.h" #include "pokedex.h" #include "event_object_movement.h" #include "text.h" @@ -2572,13 +2573,13 @@ void sub_80EEA70(void) show->secretBaseSecrets.flags = VarGet(0x40ee) + (VarGet(0x40ef) << 16); tv_store_id_3x(show); show->secretBaseSecrets.language = gGameLanguage; - if (show->secretBaseSecrets.language == LANGUAGE_JAPANESE || gSaveBlock1Ptr->secretBases[VarGet(VAR_0x4054)].language == LANGUAGE_JAPANESE) + if (show->secretBaseSecrets.language == LANGUAGE_JAPANESE || gSaveBlock1Ptr->secretBases[VarGet(VAR_CURRENT_SECRET_BASE)].language == LANGUAGE_JAPANESE) { show->secretBaseSecrets.baseOwnersNameLanguage = LANGUAGE_JAPANESE; } else { - show->secretBaseSecrets.baseOwnersNameLanguage = gSaveBlock1Ptr->secretBases[VarGet(VAR_0x4054)].language; + show->secretBaseSecrets.baseOwnersNameLanguage = gSaveBlock1Ptr->secretBases[VarGet(VAR_CURRENT_SECRET_BASE)].language; } } } @@ -3469,7 +3470,7 @@ void ChangeBoxPokemonNickname(void) void ChangeBoxPokemonNickname_CB(void) { - SetBoxMonNickFromAnyBox(gSpecialVar_MonBoxId, gSpecialVar_MonBoxPos, gStringVar2); + SetBoxMonNickAt(gSpecialVar_MonBoxId, gSpecialVar_MonBoxPos, gStringVar2); CB2_ReturnToFieldContinueScriptPlayMapMusic(); } diff --git a/src/unk_transition.c b/src/unk_transition.c index 18cee2544..7346e06ab 100644 --- a/src/unk_transition.c +++ b/src/unk_transition.c @@ -35,11 +35,13 @@ static bool8 sub_81DB290(struct Task *task); static bool8 sub_81DB328(struct Task *task); // const rom data -// TODO: move those from .s file to .c -extern const u32 gUnknown_0862AD54[]; -extern const u32 gUnknown_0862AF30[]; -extern const u32 gUnknown_0862B0DC[]; -extern const u16 gUnknown_0862B53C[]; +static const u32 gUnknown_0862AD54[] = INCBIN_U32("graphics/battle_transitions/frontier_transition.4bpp.lz"); +static const u32 gUnknown_0862AF30[] = INCBIN_U32("graphics/battle_transitions/frontier_transition.bin"); +static const u32 gUnknown_0862B0DC[] = INCBIN_U32("graphics/battle_transitions/frontier_transition_circles.4bpp.lz"); +static const u16 gUnknown_0862B53C[] = INCBIN_U16("graphics/battle_transitions/frontier_transition.gbapal"); + +// Unused Empty data. Feel free to delete. +static const u8 sFiller[0x1C0] = {0}; static const struct OamData sOamData_862B71C = { @@ -185,7 +187,7 @@ static void sub_81DA700(void) LZ77UnCompVram(gUnknown_0862AD54, dst2); LZ77UnCompVram(gUnknown_0862AF30, dst1); LoadPalette(gUnknown_0862B53C, 0xF0, 0x20); - LoadCompressedObjectPic(&sUnknown_0862B724); + LoadCompressedSpriteSheet(&sUnknown_0862B724); LoadSpritePalette(&sUnknown_0862B72C); } diff --git a/src/walda_phrase.c b/src/walda_phrase.c index ff2ee7399..83004777f 100644 --- a/src/walda_phrase.c +++ b/src/walda_phrase.c @@ -7,18 +7,11 @@ #include "text.h" #include "new_game.h" #include "overworld.h" +#include "pokemon_storage_system.h" +#include "field_screen_effect.h" extern const u8 gText_Peekaboo[]; -extern u8 *GetWaldaPhrasePtr(void); -extern bool32 IsWaldaPhraseEmpty(void); -extern void sub_80AF168(void); -extern void SetWaldaPhrase(const u8 *src); -extern void SetWaldaWallpaperPatternId(u8 patternId); -extern void SetWaldaWallpaperIconId(u8 iconId); -extern void SetWaldaWallpaperColors(u16 backgroundColor, u16 foregroundColor); -extern void SetWaldaWallpaperLockedOrUnlocked(bool32 unlocked); - // this file's functions static void CB2_HandleGivenWaldaPhrase(void); static u32 GetWaldaPhraseInputCase(u8 *inputPtr); diff --git a/src/wallclock.c b/src/wallclock.c index 5c8d920e7..58704c8a3 100644 --- a/src/wallclock.c +++ b/src/wallclock.c @@ -623,7 +623,7 @@ static void LoadWallClockGraphics(void) ResetSpriteData(); ResetPaletteFade(); FreeAllSpritePalettes(); - LoadCompressedObjectPic(&gUnknown_085B2208); + LoadCompressedSpriteSheet(&gUnknown_085B2208); LoadSpritePalettes(gUnknown_085B2218); } diff --git a/src/water.c b/src/water.c index 955526ccd..42ab1d67f 100644 --- a/src/water.c +++ b/src/water.c @@ -1,21 +1,60 @@ #include "global.h" +#include "battle.h" #include "battle_anim.h" +#include "gpu_regs.h" +#include "graphics.h" +#include "palette.h" +#include "random.h" +#include "scanline_effect.h" +#include "sprite.h" +#include "task.h" +#include "trig.h" +#include "util.h" +#include "constants/battle.h" #include "constants/rgb.h" extern void sub_810721C(struct Sprite *); +extern void sub_8107228(struct Sprite *); extern void sub_8107260(struct Sprite *); +extern void sub_8107380(struct Sprite *); +extern void sub_8107408(struct Sprite *); +extern void sub_8107430(struct Sprite *); extern void sub_810744C(struct Sprite *); +extern void sub_81074E4(struct Sprite *); extern void sub_81075EC(struct Sprite *); +extern void sub_8107674(struct Sprite *); extern void sub_8107730(struct Sprite *); +extern void sub_81077A4(struct Sprite *); extern void sub_81077C0(struct Sprite *); extern void sub_80A78AC(struct Sprite *); extern void sub_8107894(struct Sprite *); extern void sub_81078D0(struct Sprite *); +extern void sub_810790C(struct Sprite *); extern void sub_8108034(struct Sprite *); +extern void sub_8108098(struct Sprite *); extern void sub_810851C(struct Sprite *); +extern void sub_81087C0(struct Sprite *); +extern void sub_810886C(struct Sprite *); +extern void sub_8108B2C(struct Sprite *); +extern void sub_8108B94(struct Sprite *); extern void sub_8108BE0(struct Sprite *); +extern void sub_8108C08(struct Sprite *); extern void sub_8108C54(struct Sprite *); +extern void sub_8108CDC(struct Sprite *); extern void sub_80A8EE4(struct Sprite *); +void sub_810756C(u8); +void sub_81076F4(u8); +void sub_8107B84(u8); +void sub_8107CC4(u8); +void sub_8107D58(u8); +void sub_8108140(u8); +void sub_810862C(u8); +void sub_8108978(u8); +u8 sub_8108384(void); +void sub_8108408(struct Task*, u8); +void sub_810871C(struct Task*, u8); +void sub_8108AC0(struct Task*); +void sub_8108D54(struct Sprite*, int, int); extern const union AffineAnimCmd *const gUnknown_08593420[]; extern const union AffineAnimCmd *const gUnknown_08596208[]; @@ -440,3 +479,2149 @@ const struct SpriteTemplate gUnknown_08595328 = .affineAnims = gUnknown_085952F4, .callback = sub_80A8EE4, }; + +extern const struct SpriteTemplate gUnknown_08597388; + +void AnimTask_CreateRaindrops(u8 taskId) +{ + u8 x, y; + + if (gTasks[taskId].data[0] == 0) + { + gTasks[taskId].data[1] = gBattleAnimArgs[0]; + gTasks[taskId].data[2] = gBattleAnimArgs[1]; + gTasks[taskId].data[3] = gBattleAnimArgs[2]; + } + gTasks[taskId].data[0]++; + if (gTasks[taskId].data[0] % gTasks[taskId].data[2] == 1) + { + x = Random2() % 240; + y = Random2() % 80; + CreateSprite(&gUnknown_08595020, x, y, 4); + } + if (gTasks[taskId].data[0] == gTasks[taskId].data[3]) + DestroyAnimVisualTask(taskId); +} + +void sub_810721C(struct Sprite *sprite) +{ + sprite->callback = sub_8107228; +} + +void sub_8107228(struct Sprite *sprite) +{ + if (++sprite->data[0] <= 13) + { + sprite->pos2.x++; + sprite->pos2.y += 4; + } + if (sprite->animEnded) + DestroySprite(sprite); +} + +void sub_8107260(struct Sprite *sprite) +{ + u8 spriteId; + + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) - gBattleAnimArgs[0]; + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + gBattleAnimArgs[1]; + sprite->animPaused = TRUE; + } + else + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) + gBattleAnimArgs[0]; + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + gBattleAnimArgs[1]; + sprite->animPaused = TRUE; + } + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + gBattleAnimArgs[2] = -gBattleAnimArgs[2]; + sprite->data[0] = gBattleAnimArgs[6]; + sprite->data[1] = sprite->pos1.x; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[3] = sprite->pos1.y; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + InitAnimLinearTranslation(sprite); + spriteId = CreateInvisibleSpriteWithCallback(SpriteCallbackDummy); + sprite->data[5] = spriteId; + sprite->pos1.x -= Sin((u8)gBattleAnimArgs[4], gBattleAnimArgs[2]); + sprite->pos1.y -= Cos((u8)gBattleAnimArgs[4], gBattleAnimArgs[3]); + gSprites[spriteId].data[0] = gBattleAnimArgs[2]; + gSprites[spriteId].data[1] = gBattleAnimArgs[3]; + gSprites[spriteId].data[2] = gBattleAnimArgs[5]; + gSprites[spriteId].data[3] = (u8)gBattleAnimArgs[4] * 256; + gSprites[spriteId].data[4] = gBattleAnimArgs[6]; + sprite->callback = sub_8107380; + sprite->callback(sprite); +} + +void sub_8107380(struct Sprite *sprite) +{ + u8 otherSpriteId = sprite->data[5]; + u8 timer = gSprites[otherSpriteId].data[4]; + u16 trigIndex = gSprites[otherSpriteId].data[3]; + + sprite->data[0] = 1; + AnimTranslateLinear(sprite); + sprite->pos2.x += Sin(trigIndex >> 8, gSprites[otherSpriteId].data[0]); + sprite->pos2.y += Cos(trigIndex >> 8, gSprites[otherSpriteId].data[1]); + gSprites[otherSpriteId].data[3] = trigIndex + gSprites[otherSpriteId].data[2]; + if (--timer != 0) + { + gSprites[otherSpriteId].data[4] = timer; + } + else + { + sprite->callback = sub_8107408; + DestroySprite(&gSprites[otherSpriteId]); + } +} + +void sub_8107408(struct Sprite *sprite) +{ + sprite->animPaused = FALSE; + sprite->callback = RunStoredCallbackWhenAnimEnds; + StoreSpriteCallbackInData6(sprite, sub_8107430); +} + +void sub_8107430(struct Sprite *sprite) +{ + sprite->data[0] = 10; + sprite->callback = WaitAnimForDuration; + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); +} + +void sub_810744C(struct Sprite *sprite) +{ + s16 unkArg; + + InitSpritePosToAnimAttacker(sprite, TRUE); + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + unkArg = -gBattleAnimArgs[2]; + else + unkArg = gBattleAnimArgs[2]; + sprite->data[0] = gBattleAnimArgs[4]; + sprite->data[1] = sprite->pos1.x; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + unkArg; + sprite->data[3] = sprite->pos1.y; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; + InitAnimLinearTranslation(sprite); + sprite->callback = sub_81074E4; + sprite->affineAnimPaused = TRUE; + sprite->callback(sprite); +} + +void sub_81074E4(struct Sprite *sprite) +{ + if ((u16)gBattleAnimArgs[ARG_RET_ID] == 0xFFFF) + { + StartSpriteAnim(sprite, 1); + sprite->affineAnimPaused = FALSE; + } + if (AnimTranslateLinear(sprite)) + DestroyAnimSprite(sprite); +} + +void sub_8107528(u8 taskId) +{ + gTasks[taskId].data[0] = gBattleAnimArgs[0]; + gTasks[taskId].data[2] = IndexOfSpritePaletteTag(ANIM_TAG_RAINBOW_RINGS) * 16 + 256; + gTasks[taskId].func = sub_810756C; +} + +#ifdef NONMATCHING +void sub_810756C(u8 taskId) +{ + int i; + u16 palIndex; + u16 *palPtr1; + u16 *palPtr2; + u16 rgbBuffer; + + if (++gTasks[taskId].data[10] == 3) + { + gTasks[taskId].data[10] = 0; + palIndex = gTasks[taskId].data[2] + 1; + palPtr1 = &gPlttBufferFaded[palIndex]; + rgbBuffer = *palPtr1; + palPtr2 = &palPtr1[1]; + for (i = 0; i < 7; i++) + palPtr1[i] = palPtr2[i]; + gPlttBufferFaded[palIndex + 7] = rgbBuffer; + } + if (++gTasks[taskId].data[11] == gTasks[taskId].data[0]) + DestroyAnimVisualTask(taskId); +} +#else +NAKED +void sub_810756C(u8 taskId) +{ + asm_unified("push {r4-r7,lr}\n\ + lsls r0, 24\n\ + lsrs r4, r0, 24\n\ + ldr r1, =gTasks\n\ + lsls r0, r4, 2\n\ + adds r0, r4\n\ + lsls r0, 3\n\ + adds r2, r0, r1\n\ + ldrh r0, [r2, 0x1C]\n\ + adds r0, 0x1\n\ + strh r0, [r2, 0x1C]\n\ + lsls r0, 16\n\ + asrs r0, 16\n\ + mov r12, r1\n\ + cmp r0, 0x3\n\ + bne _081075BE\n\ + movs r0, 0\n\ + strh r0, [r2, 0x1C]\n\ + ldrh r0, [r2, 0xC]\n\ + adds r0, 0x1\n\ + lsls r0, 16\n\ + lsrs r5, r0, 16\n\ + ldr r1, =gPlttBufferFaded\n\ + lsls r0, r5, 1\n\ + adds r0, r1\n\ + ldrh r6, [r0]\n\ + adds r7, r1, 0\n\ + adds r3, r0, 0x2\n\ + movs r1, 0x6\n\ + adds r2, r0, 0\n\ +_081075A8:\n\ + ldrh r0, [r3]\n\ + strh r0, [r2]\n\ + adds r3, 0x2\n\ + adds r2, 0x2\n\ + subs r1, 0x1\n\ + cmp r1, 0\n\ + bge _081075A8\n\ + adds r0, r5, 0x7\n\ + lsls r0, 1\n\ + adds r0, r7\n\ + strh r6, [r0]\n\ +_081075BE:\n\ + lsls r0, r4, 2\n\ + adds r0, r4\n\ + lsls r0, 3\n\ + add r0, r12\n\ + ldrh r1, [r0, 0x1E]\n\ + adds r1, 0x1\n\ + strh r1, [r0, 0x1E]\n\ + lsls r1, 16\n\ + asrs r1, 16\n\ + movs r2, 0x8\n\ + ldrsh r0, [r0, r2]\n\ + cmp r1, r0\n\ + bne _081075DE\n\ + adds r0, r4, 0\n\ + bl DestroyAnimVisualTask\n\ +_081075DE:\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n"); +} +#endif + +void sub_81075EC(struct Sprite *sprite) +{ + u16 retArg; + + InitSpritePosToAnimAttacker(sprite, TRUE); + sprite->data[0] = 30; + sprite->data[1] = sprite->pos1.x; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[3] = sprite->pos1.y; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + InitAnimLinearTranslation(sprite); + sprite->data[5] = 0xD200 / sprite->data[0]; + sprite->data[7] = gBattleAnimArgs[3]; + retArg = gBattleAnimArgs[ARG_RET_ID]; + if (gBattleAnimArgs[ARG_RET_ID] > 127) + { + sprite->data[6] = (retArg - 127) * 256; + sprite->data[7] = -sprite->data[7]; + } + else + { + sprite->data[6] = retArg * 256; + } + sprite->callback = sub_8107674; + sprite->callback(sprite); +} + +void sub_8107674(struct Sprite *sprite) +{ + if (AnimTranslateLinear(sprite)) + DestroyAnimSprite(sprite); + sprite->pos2.y += Sin(sprite->data[6] >> 8, sprite->data[7]); + if ((sprite->data[6] + sprite->data[5]) >> 8 > 127) + { + sprite->data[6] = 0; + sprite->data[7] = -sprite->data[7]; + } + else + { + sprite->data[6] += sprite->data[5]; + } +} + +void sub_81076C8(u8 taskId) +{ + gTasks[taskId].data[0] = gBattleAnimArgs[0]; + gBattleAnimArgs[ARG_RET_ID] = 0; + gTasks[taskId].func = sub_81076F4; +} + +void sub_81076F4(u8 taskId) +{ + gBattleAnimArgs[ARG_RET_ID] = (gBattleAnimArgs[ARG_RET_ID] + 3) & 0xFF; + if (--gTasks[taskId].data[0] == 0) + DestroyAnimVisualTask(taskId); +} + +void sub_8107730(struct Sprite *sprite) +{ + u8 priority; + + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + sprite->pos2.y = -10; + priority = GetBattlerSpriteSubpriority(gBattleAnimAttacker); + if (!IsContest()) + { + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) + { + sprite->pos2.x = 10; + sprite->subpriority = priority + 2; + } + else + { + sprite->pos2.x = -10; + sprite->subpriority = priority - 2; + } + } + else + { + sprite->pos2.x = -10; + sprite->subpriority = priority + 2; + } + sprite->callback = sub_81077A4; +} + +void sub_81077A4(struct Sprite *sprite) +{ + if (sprite->affineAnimEnded) + DestroyAnimSprite(sprite); +} + +void sub_81077C0(struct Sprite *sprite) +{ + bool8 animType; + u8 coordType; + if (GetBattlerSide(gBattleAnimAttacker) == GetBattlerSide(gBattleAnimTarget)) + { + gBattleAnimArgs[0] *= -1; + if (GetBattlerPosition(gBattleAnimAttacker) == B_POSITION_PLAYER_LEFT || GetBattlerPosition(gBattleAnimAttacker) == B_POSITION_OPPONENT_LEFT) + gBattleAnimArgs[0] *= -1; + } + if ((gBattleAnimArgs[5] & 0xFF00) == 0) + animType = TRUE; + else + animType = FALSE; + if ((u8)gBattleAnimArgs[5] == 0) + coordType = 3; + else + coordType = 1; + InitSpritePosToAnimAttacker(sprite, animType); + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + gBattleAnimArgs[2] = -gBattleAnimArgs[2]; + sprite->data[0] = gBattleAnimArgs[4]; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[2]; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, coordType) + gBattleAnimArgs[3]; + sprite->callback = StartAnimLinearTranslation; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); +} + +void sub_8107894(struct Sprite *sprite) +{ + InitSpritePosToAnimTarget(sprite, TRUE); + sprite->data[0] = gBattleAnimArgs[4]; + sprite->data[2] = sprite->pos1.x + gBattleAnimArgs[2]; + sprite->data[4] = sprite->pos1.y + gBattleAnimArgs[4]; + sprite->callback = StartAnimLinearTranslation; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); +} + +void sub_81078D0(struct Sprite *sprite) +{ + if (gBattleAnimArgs[3]) + InitSpritePosToAnimTarget(sprite, TRUE); + else + InitSpritePosToAnimAttacker(sprite, TRUE); + sprite->data[7] = gBattleAnimArgs[2]; + sprite->callback = sub_810790C; +} + +void sub_810790C(struct Sprite *sprite) +{ + sprite->data[0] = (sprite->data[0] + 11) & 0xFF; + sprite->pos2.x = Sin(sprite->data[0], 4); + sprite->data[1] += 48; + sprite->pos2.y = -(sprite->data[1] >> 8); + if (--sprite->data[7] == -1) + DestroyAnimSprite(sprite); +} + +#ifdef NONMATCHING +void AnimTask_CreateSurfWave(u8 taskId) +{ + struct UnknownAnimStruct2 unk; + u8 taskId2; + + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG1 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + SetAnimBgAttribute(1, BG_ANIM_SCREEN_SIZE, 1); + sub_80A6B30(&unk); + if (!IsContest()) + { + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1); + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) + sub_80A6D48(unk.bgId, gUnknown_08D95E00); + else + sub_80A6D48(unk.bgId, gUnknown_08D960D0); + } + else + { + sub_80A6D60(&unk, gUnknown_08D963A4, 1); + } + sub_80A6CC0(unk.bgId, gBattleAnimBackgroundImage_Surf, unk.tilesOffset); + if (gBattleAnimArgs[0] == 0) + LoadCompressedPalette(gBattleAnimBackgroundPalette_Surf, unk.unk8 * 16, 32); + else + LoadCompressedPalette(gBattleAnimBackgroundImageMuddyWater_Pal, unk.unk8 * 16, 32); + taskId2 = CreateTask(sub_8107D58, gTasks[taskId].priority + 1); + gTasks[taskId].data[15] = taskId2; + gTasks[taskId2].data[0] = 0; + gTasks[taskId2].data[1] = 0x1000; + gTasks[taskId2].data[2] = 0x1000; + if (IsContest()) + { + gBattle_BG1_X = -80; + gBattle_BG1_Y = -48; + gTasks[taskId].data[0] = 2; + gTasks[taskId].data[1] = 1; + gTasks[taskId2].data[3] = 0; + } + else if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) + { + gBattle_BG1_X = -224; + gBattle_BG1_Y = 256; + gTasks[taskId].data[0] = 2; + gTasks[taskId].data[1] = -1; + gTasks[taskId2].data[3] = 1; + } + else + { + gBattle_BG1_X = 0; + gBattle_BG1_Y = -48; + gTasks[taskId].data[0] = -2; + gTasks[taskId].data[1] = 1; + gTasks[taskId2].data[3] = 0; + } + SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); + SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); + if (gTasks[taskId2].data[3] == 0) + { + gTasks[taskId2].data[4] = 48; + gTasks[taskId2].data[5] = 112; + } + else + { + gTasks[taskId2].data[4] = 0; + gTasks[taskId2].data[5] = 0; + } + gTasks[taskId].data[6] = 1; + gTasks[taskId].func = sub_8107B84; +} +#else +NAKED +void AnimTask_CreateSurfWave(u8 taskId) +{ + asm_unified("push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0x10\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r10, r0\n\ + ldr r1, =0x00003f42\n\ + movs r0, 0x50\n\ + bl SetGpuReg\n\ + movs r1, 0x80\n\ + lsls r1, 5\n\ + movs r0, 0x52\n\ + bl SetGpuReg\n\ + movs r0, 0x1\n\ + movs r1, 0x4\n\ + movs r2, 0x1\n\ + bl SetAnimBgAttribute\n\ + movs r0, 0x1\n\ + movs r1, 0\n\ + movs r2, 0x1\n\ + bl SetAnimBgAttribute\n\ + mov r0, sp\n\ + bl sub_80A6B30\n\ + bl IsContest\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + bne _081079E0\n\ + movs r0, 0x1\n\ + movs r1, 0x3\n\ + movs r2, 0x1\n\ + bl SetAnimBgAttribute\n\ + ldr r0, =gBattleAnimAttacker\n\ + ldrb r0, [r0]\n\ + bl GetBattlerSide\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + cmp r0, 0x1\n\ + bne _081079D0\n\ + mov r0, sp\n\ + ldrb r0, [r0, 0x9]\n\ + ldr r1, =gUnknown_08D95E00\n\ + bl sub_80A6D48\n\ + b _081079EA\n\ + .pool\n\ +_081079D0:\n\ + mov r0, sp\n\ + ldrb r0, [r0, 0x9]\n\ + ldr r1, =gUnknown_08D960D0\n\ + bl sub_80A6D48\n\ + b _081079EA\n\ + .pool\n\ +_081079E0:\n\ + ldr r1, =gUnknown_08D963A4\n\ + mov r0, sp\n\ + movs r2, 0x1\n\ + bl sub_80A6D60\n\ +_081079EA:\n\ + mov r0, sp\n\ + ldrb r0, [r0, 0x9]\n\ + ldr r1, =gBattleAnimBackgroundImage_Surf\n\ + mov r2, sp\n\ + ldrh r2, [r2, 0xA]\n\ + bl sub_80A6CC0\n\ + ldr r0, =gBattleAnimArgs\n\ + movs r1, 0\n\ + ldrsh r0, [r0, r1]\n\ + cmp r0, 0\n\ + bne _08107A24\n\ + ldr r0, =gBattleAnimBackgroundPalette_Surf\n\ + mov r1, sp\n\ + ldrb r1, [r1, 0x8]\n\ + lsls r1, 4\n\ + movs r2, 0x20\n\ + bl LoadCompressedPalette\n\ + b _08107A32\n\ + .pool\n\ +_08107A24:\n\ + ldr r0, =gBattleAnimBackgroundImageMuddyWater_Pal\n\ + mov r1, sp\n\ + ldrb r1, [r1, 0x8]\n\ + lsls r1, 4\n\ + movs r2, 0x20\n\ + bl LoadCompressedPalette\n\ +_08107A32:\n\ + ldr r0, =sub_8107D58\n\ + ldr r4, =gTasks\n\ + mov r2, r10\n\ + lsls r5, r2, 2\n\ + adds r1, r5, r2\n\ + lsls r1, 3\n\ + adds r6, r1, r4\n\ + ldrb r1, [r6, 0x7]\n\ + adds r1, 0x1\n\ + lsls r1, 24\n\ + lsrs r1, 24\n\ + bl CreateTask\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r8, r0\n\ + movs r0, 0\n\ + mov r9, r0\n\ + mov r1, r8\n\ + strh r1, [r6, 0x26]\n\ + mov r2, r8\n\ + lsls r0, r2, 2\n\ + add r0, r8\n\ + lsls r0, 3\n\ + adds r7, r0, r4\n\ + mov r0, r9\n\ + strh r0, [r7, 0x8]\n\ + movs r0, 0x80\n\ + lsls r0, 5\n\ + strh r0, [r7, 0xA]\n\ + strh r0, [r7, 0xC]\n\ + bl IsContest\n\ + lsls r0, 24\n\ + lsrs r4, r0, 24\n\ + cmp r4, 0\n\ + beq _08107AB4\n\ + ldr r1, =0x0000ffb0\n\ + adds r0, r1, 0\n\ + ldr r2, =gBattle_BG1_X\n\ + strh r0, [r2]\n\ + adds r1, 0x20\n\ + adds r0, r1, 0\n\ + ldr r2, =gBattle_BG1_Y\n\ + strh r0, [r2]\n\ + movs r0, 0x2\n\ + strh r0, [r6, 0x8]\n\ + movs r0, 0x1\n\ + strh r0, [r6, 0xA]\n\ + mov r0, r9\n\ + strh r0, [r7, 0xE]\n\ + b _08107B0E\n\ + .pool\n\ +_08107AB4:\n\ + ldr r0, =gBattleAnimAttacker\n\ + ldrb r0, [r0]\n\ + bl GetBattlerSide\n\ + lsls r0, 24\n\ + lsrs r1, r0, 24\n\ + cmp r1, 0x1\n\ + bne _08107AF8\n\ + ldr r2, =0x0000ff20\n\ + adds r0, r2, 0\n\ + ldr r2, =gBattle_BG1_X\n\ + strh r0, [r2]\n\ + movs r2, 0x80\n\ + lsls r2, 1\n\ + adds r0, r2, 0\n\ + ldr r2, =gBattle_BG1_Y\n\ + strh r0, [r2]\n\ + movs r0, 0x2\n\ + strh r0, [r6, 0x8]\n\ + ldr r0, =0x0000ffff\n\ + strh r0, [r6, 0xA]\n\ + strh r1, [r7, 0xE]\n\ + b _08107B0E\n\ + .pool\n\ +_08107AF8:\n\ + ldr r0, =gBattle_BG1_X\n\ + strh r4, [r0]\n\ + ldr r1, =0x0000ffd0\n\ + adds r0, r1, 0\n\ + ldr r2, =gBattle_BG1_Y\n\ + strh r0, [r2]\n\ + ldr r0, =0x0000fffe\n\ + strh r0, [r6, 0x8]\n\ + movs r0, 0x1\n\ + strh r0, [r6, 0xA]\n\ + strh r4, [r7, 0xE]\n\ +_08107B0E:\n\ + ldr r0, =gBattle_BG1_X\n\ + ldrh r1, [r0]\n\ + movs r0, 0x14\n\ + bl SetGpuReg\n\ + ldr r2, =gBattle_BG1_Y\n\ + ldrh r1, [r2]\n\ + movs r0, 0x16\n\ + bl SetGpuReg\n\ + ldr r1, =gTasks\n\ + mov r2, r8\n\ + lsls r0, r2, 2\n\ + add r0, r8\n\ + lsls r0, 3\n\ + adds r1, r0, r1\n\ + movs r2, 0xE\n\ + ldrsh r0, [r1, r2]\n\ + cmp r0, 0\n\ + bne _08107B54\n\ + movs r0, 0x30\n\ + strh r0, [r1, 0x10]\n\ + movs r0, 0x70\n\ + b _08107B58\n\ + .pool\n\ +_08107B54:\n\ + movs r0, 0\n\ + strh r0, [r1, 0x10]\n\ +_08107B58:\n\ + strh r0, [r1, 0x12]\n\ + ldr r1, =gTasks\n\ + mov r2, r10\n\ + adds r0, r5, r2\n\ + lsls r0, 3\n\ + adds r0, r1\n\ + movs r1, 0x1\n\ + strh r1, [r0, 0x14]\n\ + ldr r1, =sub_8107B84\n\ + str r1, [r0]\n\ + add sp, 0x10\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n"); +} +#endif + +#ifdef NONMATCHING +void sub_8107B84(u8 taskId) +{ + struct UnknownAnimStruct2 unk; + u8 i; + u16 rgbBuffer; + u16 *BGptrX = &gBattle_BG1_X; + u16 *BGptrY = &gBattle_BG1_Y; + s16 unkUse; + u32 palOffset; + u16 palNum; + + *BGptrX += gTasks[taskId].data[0]; + *BGptrY += gTasks[taskId].data[1]; + sub_80A6B30(&unk); + gTasks[taskId].data[2] += gTasks[taskId].data[1]; + if (++gTasks[taskId].data[5] == 4) + { + rgbBuffer = gPlttBufferFaded[unk.unk8 * 16 + 7]; + for (i = 6; i != 0; i--) + { + palNum = unk.unk8 * 16; + palOffset = 1 + i; + gPlttBufferFaded[palNum + palOffset] = gPlttBufferFaded[palNum + palOffset - 1]; + } + gPlttBufferFaded[unk.unk8 * 16 + 1] = rgbBuffer; + gTasks[taskId].data[5] = 0; + } + if (++gTasks[taskId].data[6] > 1) + { + gTasks[taskId].data[6] = 0; + unkUse = ++gTasks[taskId].data[3]; + if (unkUse <= 13) + { + gTasks[gTasks[taskId].data[15]].data[1] = unkUse | ((16 - unkUse) * 256); + gTasks[taskId].data[4]++; + } + if (gTasks[taskId].data[3] > 54) + { + unkUse = --gTasks[taskId].data[4]; + gTasks[gTasks[taskId].data[15]].data[1] = unkUse | ((16 - unkUse) * 256); + } + } + if (!(gTasks[gTasks[taskId].data[15]].data[1] & 0x1F)) + { + gTasks[taskId].data[0] = gTasks[gTasks[taskId].data[15]].data[1] & 0x1F; + gTasks[taskId].func = sub_8107CC4; + } +} +#else +NAKED +void sub_8107B84(u8 taskId) +{ + asm_unified("push {r4-r7,lr}\n\ + sub sp, 0x10\n\ + lsls r0, 24\n\ + lsrs r5, r0, 24\n\ + ldr r1, =gBattle_BG1_X\n\ + ldr r2, =gBattle_BG1_Y\n\ + ldr r0, =gTasks\n\ + lsls r4, r5, 2\n\ + adds r4, r5\n\ + lsls r4, 3\n\ + adds r4, r0\n\ + ldrh r0, [r4, 0x8]\n\ + ldrh r3, [r1]\n\ + adds r0, r3\n\ + strh r0, [r1]\n\ + ldrh r0, [r4, 0xA]\n\ + ldrh r1, [r2]\n\ + adds r0, r1\n\ + strh r0, [r2]\n\ + mov r0, sp\n\ + bl sub_80A6B30\n\ + ldrh r0, [r4, 0xA]\n\ + ldrh r3, [r4, 0xC]\n\ + adds r0, r3\n\ + strh r0, [r4, 0xC]\n\ + ldrh r0, [r4, 0x12]\n\ + adds r0, 0x1\n\ + strh r0, [r4, 0x12]\n\ + lsls r0, 16\n\ + asrs r0, 16\n\ + cmp r0, 0x4\n\ + bne _08107C18\n\ + ldr r1, =gPlttBufferFaded\n\ + mov r0, sp\n\ + ldrb r0, [r0, 0x8]\n\ + lsls r0, 4\n\ + adds r0, 0x7\n\ + lsls r0, 1\n\ + adds r0, r1\n\ + ldrh r6, [r0]\n\ + movs r2, 0x6\n\ + adds r7, r1, 0\n\ + adds r3, r7, 0\n\ + mov r4, sp\n\ +_08107BDE:\n\ + ldrb r0, [r4, 0x8]\n\ + lsls r0, 4\n\ + adds r1, r2, 0x1\n\ + adds r0, r1\n\ + lsls r1, r0, 1\n\ + adds r1, r3\n\ + subs r0, 0x1\n\ + lsls r0, 1\n\ + adds r0, r3\n\ + ldrh r0, [r0]\n\ + strh r0, [r1]\n\ + subs r0, r2, 0x1\n\ + lsls r0, 24\n\ + lsrs r2, r0, 24\n\ + cmp r2, 0\n\ + bne _08107BDE\n\ + mov r0, sp\n\ + ldrb r0, [r0, 0x8]\n\ + lsls r0, 4\n\ + adds r0, 0x1\n\ + lsls r0, 1\n\ + adds r0, r7\n\ + strh r6, [r0]\n\ + ldr r1, =gTasks\n\ + lsls r0, r5, 2\n\ + adds r0, r5\n\ + lsls r0, 3\n\ + adds r0, r1\n\ + strh r2, [r0, 0x12]\n\ +_08107C18:\n\ + ldr r1, =gTasks\n\ + lsls r2, r5, 2\n\ + adds r0, r2, r5\n\ + lsls r0, 3\n\ + adds r3, r0, r1\n\ + ldrh r0, [r3, 0x14]\n\ + adds r0, 0x1\n\ + strh r0, [r3, 0x14]\n\ + lsls r0, 16\n\ + asrs r0, 16\n\ + adds r4, r1, 0\n\ + adds r6, r2, 0\n\ + cmp r0, 0x1\n\ + ble _08107C86\n\ + movs r0, 0\n\ + strh r0, [r3, 0x14]\n\ + ldrh r0, [r3, 0xE]\n\ + adds r2, r0, 0x1\n\ + strh r2, [r3, 0xE]\n\ + lsls r0, r2, 16\n\ + asrs r0, 16\n\ + cmp r0, 0xD\n\ + bgt _08107C62\n\ + movs r1, 0x26\n\ + ldrsh r0, [r3, r1]\n\ + lsls r1, r0, 2\n\ + adds r1, r0\n\ + lsls r1, 3\n\ + adds r1, r4\n\ + movs r0, 0x10\n\ + subs r0, r2\n\ + lsls r0, 8\n\ + orrs r2, r0\n\ + strh r2, [r1, 0xA]\n\ + ldrh r0, [r3, 0x10]\n\ + adds r0, 0x1\n\ + strh r0, [r3, 0x10]\n\ +_08107C62:\n\ + movs r1, 0xE\n\ + ldrsh r0, [r3, r1]\n\ + cmp r0, 0x36\n\ + ble _08107C86\n\ + ldrh r2, [r3, 0x10]\n\ + subs r2, 0x1\n\ + strh r2, [r3, 0x10]\n\ + movs r1, 0x26\n\ + ldrsh r0, [r3, r1]\n\ + lsls r1, r0, 2\n\ + adds r1, r0\n\ + lsls r1, 3\n\ + adds r1, r4\n\ + movs r0, 0x10\n\ + subs r0, r2\n\ + lsls r0, 8\n\ + orrs r2, r0\n\ + strh r2, [r1, 0xA]\n\ +_08107C86:\n\ + adds r0, r6, r5\n\ + lsls r0, 3\n\ + adds r2, r0, r4\n\ + movs r3, 0x26\n\ + ldrsh r1, [r2, r3]\n\ + lsls r0, r1, 2\n\ + adds r0, r1\n\ + lsls r0, 3\n\ + adds r0, r4\n\ + ldrh r0, [r0, 0xA]\n\ + movs r3, 0x1F\n\ + ands r3, r0\n\ + cmp r3, 0\n\ + bne _08107CA8\n\ + strh r3, [r2, 0x8]\n\ + ldr r0, =sub_8107CC4\n\ + str r0, [r2]\n\ +_08107CA8:\n\ + add sp, 0x10\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n"); +} +#endif + +void sub_8107CC4(u8 taskId) +{ + u16 *BGptrX = &gBattle_BG1_X; + u16 *BGptrY = &gBattle_BG1_Y; + if (gTasks[taskId].data[0] == 0) + { + sub_80A6C68(1); + sub_80A6C68(2); + gTasks[taskId].data[0]++; + } + else + { + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0); + *BGptrX = 0; + *BGptrY = 0; + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 0)); + gTasks[gTasks[taskId].data[15]].data[15] = -1; + DestroyAnimVisualTask(taskId); + } +} + +#ifdef NONMATCHING +void sub_8107D58(u8 taskId) +{ + s16 i; + struct ScanlineEffectParams params; + struct Task *task = &gTasks[taskId]; + // u16 *scanlineBuffer; + + switch (task->data[0]) + { + case 0: + for (i = 0; i < task->data[4]; i++) + { + /* scanlineBuffer = &gScanlineEffectRegBuffers[0][i]; + *(u16 *)(&gScanlineEffect) = task->data[2]; + *scanlineBuffer = task->data[2] & -1; */ + gScanlineEffectRegBuffers[1][i] = task->data[2]; + gScanlineEffectRegBuffers[0][i] = (u16)((int)(task->data[2] & 0xFFFF)); + } + for (i = task->data[4]; i < task->data[5]; i++) + { + gScanlineEffectRegBuffers[1][i] = task->data[1]; + gScanlineEffectRegBuffers[0][i] = (u16)((int)(task->data[1] & 0xFFFF)); + } + for (i = task->data[5]; i < 160; i++) + { + gScanlineEffectRegBuffers[1][i] = task->data[2]; + gScanlineEffectRegBuffers[0][i] = (u16)((int)(task->data[2] & 0xFFFF)); + } + if (task->data[4] == 0) + { + gScanlineEffectRegBuffers[1][i] = task->data[1]; + gScanlineEffectRegBuffers[0][i] = task->data[1]; + } + else + { + gScanlineEffectRegBuffers[1][i] = task->data[2]; + gScanlineEffectRegBuffers[0][i] = task->data[2]; + } + params.dmaDest = (vu16 *)REG_ADDR_BLDALPHA; + params.dmaControl = SCANLINE_EFFECT_DMACNT_16BIT; + params.initState = 1; + params.unused9 = 0; + ScanlineEffect_SetParams(params); + task->data[0]++; + break; + case 1: + if (task->data[3] == 0) + { + if (--task->data[4] <= 0) + { + task->data[4] = 0; + task->data[0]++; + } + } + else if (++task->data[5] > 111) + { + task->data[0]++; + } + for (i = 0; i < task->data[4]; i++) + { + gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[2]; + } + for (i = task->data[4]; i < task->data[5]; i++) + { + gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[1]; + } + for (i = task->data[5]; i < 160; i++) + { + gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[2]; + } + break; + case 2: + for (i = 0; i < task->data[4]; i++) + { + gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[2]; + } + for (i = task->data[4]; i < task->data[5]; i++) + { + gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[1]; + } + for (i = task->data[5]; i < 160; i++) + { + gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[2]; + } + if (task->data[15] == -1) + { + ScanlineEffect_Stop(); + DestroyTask(taskId); + } + break; + } +} +#else +NAKED +void sub_8107D58(u8 taskId) +{ + asm_unified("push {r4-r7,lr}\n\ + sub sp, 0xC\n\ + lsls r0, 24\n\ + lsrs r7, r0, 24\n\ + lsls r0, r7, 2\n\ + adds r0, r7\n\ + lsls r0, 3\n\ + ldr r1, =gTasks\n\ + adds r4, r0, r1\n\ + movs r1, 0x8\n\ + ldrsh r0, [r4, r1]\n\ + cmp r0, 0x1\n\ + bne _08107D74\n\ + b _08107EAC\n\ +_08107D74:\n\ + cmp r0, 0x1\n\ + bgt _08107D84\n\ + cmp r0, 0\n\ + beq _08107D8C\n\ + b _08108022\n\ + .pool\n\ +_08107D84:\n\ + cmp r0, 0x2\n\ + bne _08107D8A\n\ + b _08107F78\n\ +_08107D8A:\n\ + b _08108022\n\ +_08107D8C:\n\ + movs r3, 0\n\ + movs r2, 0x10\n\ + ldrsh r0, [r4, r2]\n\ + ldr r1, =gScanlineEffectRegBuffers\n\ + mov r12, r1\n\ + cmp r3, r0\n\ + bge _08107DCA\n\ + mov r7, r12\n\ + movs r5, 0xF0\n\ + lsls r5, 3\n\ + add r5, r12\n\ + ldr r6, =0x0000ffff\n\ +_08107DA4:\n\ + lsls r2, r3, 16\n\ + asrs r2, 16\n\ + lsls r1, r2, 1\n\ + adds r3, r1, r7\n\ + adds r1, r5\n\ + ldrh r0, [r4, 0xC]\n\ + strh r0, [r1]\n\ + ldrh r1, [r4, 0xC]\n\ + adds r0, r6, 0\n\ + ands r0, r1\n\ + strh r0, [r3]\n\ + adds r2, 0x1\n\ + lsls r2, 16\n\ + lsrs r3, r2, 16\n\ + asrs r2, 16\n\ + movs r1, 0x10\n\ + ldrsh r0, [r4, r1]\n\ + cmp r2, r0\n\ + blt _08107DA4\n\ +_08107DCA:\n\ + ldrh r3, [r4, 0x10]\n\ + lsls r2, r3, 16\n\ + asrs r1, r2, 16\n\ + movs r3, 0x12\n\ + ldrsh r0, [r4, r3]\n\ + cmp r1, r0\n\ + bge _08107E04\n\ + ldr r5, =gScanlineEffectRegBuffers\n\ + movs r0, 0xF0\n\ + lsls r0, 3\n\ + adds r6, r5, r0\n\ + ldr r7, =0x0000ffff\n\ +_08107DE2:\n\ + asrs r2, 16\n\ + lsls r1, r2, 1\n\ + adds r3, r1, r5\n\ + adds r1, r6\n\ + ldrh r0, [r4, 0xA]\n\ + strh r0, [r1]\n\ + ldrh r1, [r4, 0xA]\n\ + adds r0, r7, 0\n\ + ands r0, r1\n\ + strh r0, [r3]\n\ + adds r2, 0x1\n\ + lsls r2, 16\n\ + asrs r1, r2, 16\n\ + movs r3, 0x12\n\ + ldrsh r0, [r4, r3]\n\ + cmp r1, r0\n\ + blt _08107DE2\n\ +_08107E04:\n\ + ldrh r3, [r4, 0x12]\n\ + lsls r2, r3, 16\n\ + asrs r0, r2, 16\n\ + cmp r0, 0x9F\n\ + bgt _08107E3A\n\ + ldr r5, =gScanlineEffectRegBuffers\n\ + movs r0, 0xF0\n\ + lsls r0, 3\n\ + adds r6, r5, r0\n\ + ldr r7, =0x0000ffff\n\ +_08107E18:\n\ + asrs r2, 16\n\ + lsls r1, r2, 1\n\ + adds r3, r1, r5\n\ + adds r1, r6\n\ + ldrh r0, [r4, 0xC]\n\ + strh r0, [r1]\n\ + ldrh r1, [r4, 0xC]\n\ + adds r0, r7, 0\n\ + ands r0, r1\n\ + strh r0, [r3]\n\ + adds r2, 0x1\n\ + lsls r2, 16\n\ + lsrs r3, r2, 16\n\ + lsls r2, r3, 16\n\ + asrs r0, r2, 16\n\ + cmp r0, 0x9F\n\ + ble _08107E18\n\ +_08107E3A:\n\ + movs r1, 0x10\n\ + ldrsh r0, [r4, r1]\n\ + cmp r0, 0\n\ + bne _08107E64\n\ + lsls r0, r3, 16\n\ + asrs r0, 15\n\ + mov r3, r12\n\ + adds r2, r0, r3\n\ + movs r1, 0xF0\n\ + lsls r1, 3\n\ + add r1, r12\n\ + adds r0, r1\n\ + ldrh r1, [r4, 0xA]\n\ + strh r1, [r0]\n\ + ldrh r0, [r4, 0xA]\n\ + b _08107E7A\n\ + .pool\n\ +_08107E64:\n\ + lsls r0, r3, 16\n\ + asrs r0, 15\n\ + mov r1, r12\n\ + adds r2, r0, r1\n\ + movs r1, 0xF0\n\ + lsls r1, 3\n\ + add r1, r12\n\ + adds r0, r1\n\ + ldrh r1, [r4, 0xC]\n\ + strh r1, [r0]\n\ + ldrh r0, [r4, 0xC]\n\ +_08107E7A:\n\ + strh r0, [r2]\n\ + ldr r0, =0x04000052\n\ + str r0, [sp]\n\ + ldr r0, =0xa2600001\n\ + str r0, [sp, 0x4]\n\ + mov r1, sp\n\ + movs r2, 0\n\ + movs r0, 0x1\n\ + strb r0, [r1, 0x8]\n\ + mov r0, sp\n\ + strb r2, [r0, 0x9]\n\ + ldr r0, [sp]\n\ + ldr r1, [sp, 0x4]\n\ + ldr r2, [sp, 0x8]\n\ + bl ScanlineEffect_SetParams\n\ + ldrh r0, [r4, 0x8]\n\ + adds r0, 0x1\n\ + strh r0, [r4, 0x8]\n\ + b _08108022\n\ + .pool\n\ +_08107EAC:\n\ + movs r2, 0xE\n\ + ldrsh r1, [r4, r2]\n\ + cmp r1, 0\n\ + bne _08107EC4\n\ + ldrh r0, [r4, 0x10]\n\ + subs r0, 0x1\n\ + strh r0, [r4, 0x10]\n\ + lsls r0, 16\n\ + cmp r0, 0\n\ + bgt _08107ED8\n\ + strh r1, [r4, 0x10]\n\ + b _08107ED2\n\ +_08107EC4:\n\ + ldrh r0, [r4, 0x12]\n\ + adds r0, 0x1\n\ + strh r0, [r4, 0x12]\n\ + lsls r0, 16\n\ + asrs r0, 16\n\ + cmp r0, 0x6F\n\ + ble _08107ED8\n\ +_08107ED2:\n\ + ldrh r0, [r4, 0x8]\n\ + adds r0, 0x1\n\ + strh r0, [r4, 0x8]\n\ +_08107ED8:\n\ + movs r3, 0\n\ + movs r1, 0x10\n\ + ldrsh r0, [r4, r1]\n\ + cmp r3, r0\n\ + bge _08107F0C\n\ + ldr r6, =gScanlineEffectRegBuffers\n\ + ldr r5, =gScanlineEffect\n\ +_08107EE6:\n\ + lsls r1, r3, 16\n\ + asrs r1, 16\n\ + lsls r3, r1, 1\n\ + ldrb r2, [r5, 0x14]\n\ + lsls r0, r2, 4\n\ + subs r0, r2\n\ + lsls r0, 7\n\ + adds r3, r0\n\ + adds r3, r6\n\ + ldrh r0, [r4, 0xC]\n\ + strh r0, [r3]\n\ + adds r1, 0x1\n\ + lsls r1, 16\n\ + lsrs r3, r1, 16\n\ + asrs r1, 16\n\ + movs r2, 0x10\n\ + ldrsh r0, [r4, r2]\n\ + cmp r1, r0\n\ + blt _08107EE6\n\ +_08107F0C:\n\ + ldrh r3, [r4, 0x10]\n\ + lsls r2, r3, 16\n\ + asrs r1, r2, 16\n\ + movs r3, 0x12\n\ + ldrsh r0, [r4, r3]\n\ + cmp r1, r0\n\ + bge _08107F40\n\ + ldr r6, =gScanlineEffectRegBuffers\n\ + ldr r5, =gScanlineEffect\n\ +_08107F1E:\n\ + asrs r3, r2, 16\n\ + lsls r2, r3, 1\n\ + ldrb r1, [r5, 0x14]\n\ + lsls r0, r1, 4\n\ + subs r0, r1\n\ + lsls r0, 7\n\ + adds r2, r0\n\ + adds r2, r6\n\ + ldrh r0, [r4, 0xA]\n\ + strh r0, [r2]\n\ + adds r3, 0x1\n\ + lsls r2, r3, 16\n\ + asrs r1, r2, 16\n\ + movs r3, 0x12\n\ + ldrsh r0, [r4, r3]\n\ + cmp r1, r0\n\ + blt _08107F1E\n\ +_08107F40:\n\ + ldrh r3, [r4, 0x12]\n\ + lsls r1, r3, 16\n\ + asrs r0, r1, 16\n\ + cmp r0, 0x9F\n\ + bgt _08108022\n\ + ldr r6, =gScanlineEffectRegBuffers\n\ + ldr r5, =gScanlineEffect\n\ +_08107F4E:\n\ + asrs r3, r1, 16\n\ + lsls r2, r3, 1\n\ + ldrb r1, [r5, 0x14]\n\ + lsls r0, r1, 4\n\ + subs r0, r1\n\ + lsls r0, 7\n\ + adds r2, r0\n\ + adds r2, r6\n\ + ldrh r0, [r4, 0xC]\n\ + strh r0, [r2]\n\ + adds r3, 0x1\n\ + lsls r1, r3, 16\n\ + asrs r0, r1, 16\n\ + cmp r0, 0x9F\n\ + ble _08107F4E\n\ + b _08108022\n\ + .pool\n\ +_08107F78:\n\ + movs r3, 0\n\ + movs r1, 0x10\n\ + ldrsh r0, [r4, r1]\n\ + cmp r3, r0\n\ + bge _08107FAC\n\ + ldr r6, =gScanlineEffectRegBuffers\n\ + ldr r5, =gScanlineEffect\n\ +_08107F86:\n\ + lsls r1, r3, 16\n\ + asrs r1, 16\n\ + lsls r3, r1, 1\n\ + ldrb r2, [r5, 0x14]\n\ + lsls r0, r2, 4\n\ + subs r0, r2\n\ + lsls r0, 7\n\ + adds r3, r0\n\ + adds r3, r6\n\ + ldrh r0, [r4, 0xC]\n\ + strh r0, [r3]\n\ + adds r1, 0x1\n\ + lsls r1, 16\n\ + lsrs r3, r1, 16\n\ + asrs r1, 16\n\ + movs r2, 0x10\n\ + ldrsh r0, [r4, r2]\n\ + cmp r1, r0\n\ + blt _08107F86\n\ +_08107FAC:\n\ + ldrh r3, [r4, 0x10]\n\ + lsls r2, r3, 16\n\ + asrs r1, r2, 16\n\ + movs r3, 0x12\n\ + ldrsh r0, [r4, r3]\n\ + cmp r1, r0\n\ + bge _08107FE0\n\ + ldr r6, =gScanlineEffectRegBuffers\n\ + ldr r5, =gScanlineEffect\n\ +_08107FBE:\n\ + asrs r3, r2, 16\n\ + lsls r2, r3, 1\n\ + ldrb r1, [r5, 0x14]\n\ + lsls r0, r1, 4\n\ + subs r0, r1\n\ + lsls r0, 7\n\ + adds r2, r0\n\ + adds r2, r6\n\ + ldrh r0, [r4, 0xA]\n\ + strh r0, [r2]\n\ + adds r3, 0x1\n\ + lsls r2, r3, 16\n\ + asrs r1, r2, 16\n\ + movs r3, 0x12\n\ + ldrsh r0, [r4, r3]\n\ + cmp r1, r0\n\ + blt _08107FBE\n\ +_08107FE0:\n\ + ldrh r3, [r4, 0x12]\n\ + lsls r1, r3, 16\n\ + asrs r0, r1, 16\n\ + cmp r0, 0x9F\n\ + bgt _0810800C\n\ + ldr r6, =gScanlineEffectRegBuffers\n\ + ldr r5, =gScanlineEffect\n\ +_08107FEE:\n\ + asrs r3, r1, 16\n\ + lsls r2, r3, 1\n\ + ldrb r1, [r5, 0x14]\n\ + lsls r0, r1, 4\n\ + subs r0, r1\n\ + lsls r0, 7\n\ + adds r2, r0\n\ + adds r2, r6\n\ + ldrh r0, [r4, 0xC]\n\ + strh r0, [r2]\n\ + adds r3, 0x1\n\ + lsls r1, r3, 16\n\ + asrs r0, r1, 16\n\ + cmp r0, 0x9F\n\ + ble _08107FEE\n\ +_0810800C:\n\ + movs r0, 0x26\n\ + ldrsh r1, [r4, r0]\n\ + movs r0, 0x1\n\ + negs r0, r0\n\ + cmp r1, r0\n\ + bne _08108022\n\ + bl ScanlineEffect_Stop\n\ + adds r0, r7, 0\n\ + bl DestroyTask\n\ +_08108022:\n\ + add sp, 0xC\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n"); +} +#endif + +void sub_8108034(struct Sprite *sprite) +{ + s16 randData; + s16 randData2; + + sprite->oam.tileNum += 8; + InitSpritePosToAnimTarget(sprite, TRUE); + randData = (Random2() & 0xFF) | 256; + randData2 = (Random2() & 0x1FF); + if (randData2 > 255) + randData2 = 256 - randData2; + sprite->data[1] = randData; + sprite->data[2] = randData2; + sprite->callback = sub_8108098; +} + +void sub_8108098(struct Sprite *sprite) +{ + sprite->data[3] += sprite->data[1]; + sprite->data[4] += sprite->data[2]; + if (sprite->data[1] & 1) + sprite->pos2.x = -(sprite->data[3] >> 8); + else + sprite->pos2.x = sprite->data[3] >> 8; + sprite->pos2.y = sprite->data[4] >> 8; + if (++sprite->data[0] == 21) + DestroyAnimSprite(sprite); +} + +void sub_81080E4(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + task->data[15] = GetAnimBattlerSpriteId(ANIM_ATTACKER); + task->data[5] = gSprites[task->data[15]].pos1.y; + task->data[1] = sub_8108384(); + PrepareBattlerSpriteForRotScale(task->data[15], ST_OAM_OBJ_NORMAL); + task->func = sub_8108140; +} + +void sub_8108140(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + sub_80A805C(task, task->data[15], 0x100, 0x100, 224, 0x200, 32); + task->data[0]++; + case 1: + if (++task->data[3] > 1) + { + task->data[3] = 0; + if (++task->data[4] & 1) + { + gSprites[task->data[15]].pos2.x = 3; + gSprites[task->data[15]].pos1.y++; + } + else + { + gSprites[task->data[15]].pos2.x = -3; + } + } + if (sub_80A80C8(task) == 0) + { + SetBattlerSpriteYOffsetFromYScale(task->data[15]); + gSprites[task->data[15]].pos2.x = 0; + task->data[3] = 0; + task->data[4] = 0; + task->data[0]++; + } + break; + case 2: + if (++task->data[3] > 4) + { + sub_80A805C(task, task->data[15], 224, 0x200, 384, 224, 8); + task->data[3] = 0; + task->data[0]++; + } + break; + case 3: + if (sub_80A80C8(task) == 0) + { + task->data[3] = 0; + task->data[4] = 0; + task->data[0]++; + } + break; + case 4: + sub_8108408(task, taskId); + task->data[0]++; + case 5: + if (++task->data[3] > 1) + { + task->data[3] = 0; + if (++task->data[4] & 1) + gSprites[task->data[15]].pos2.y += 2; + else + gSprites[task->data[15]].pos2.y -= 2; + if (task->data[4] == 10) + { + sub_80A805C(task, task->data[15], 384, 224, 0x100, 0x100, 8); + task->data[3] = 0; + task->data[4] = 0; + task->data[0]++; + } + } + break; + case 6: + gSprites[task->data[15]].pos1.y--; + if (sub_80A80C8(task) == 0) + { + ResetSpriteRotScale(task->data[15]); + gSprites[task->data[15]].pos1.y = task->data[5]; + task->data[4] = 0; + task->data[0]++; + } + break; + case 7: + if (task->data[2] == 0) + DestroyAnimVisualTask(taskId); + break; + } +} + +u8 sub_8108384(void) +{ + u8 i; + u16 hp; + u16 maxhp; + u16 partyIndex; + struct Pokemon *slot; + + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) + { + partyIndex = gBattlerPartyIndexes[gBattleAnimAttacker]; + slot = &gPlayerParty[partyIndex]; + maxhp = GetMonData(slot, MON_DATA_MAX_HP); + hp = GetMonData(slot, MON_DATA_HP); + maxhp /= 4; + } + else + { + partyIndex = gBattlerPartyIndexes[gBattleAnimAttacker]; + slot = &gEnemyParty[partyIndex]; + maxhp = GetMonData(slot, MON_DATA_MAX_HP); + hp = GetMonData(slot, MON_DATA_HP); + maxhp /= 4; + } + for (i = 0; i < 3; i++) + { + if (hp < maxhp * (i + 1)) + return i; + } + return 3; +} + +void sub_8108408(struct Task *task, u8 taskId) +{ + s16 i; + s16 attackerCoordX = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + s16 attackerCoordY = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + s16 trigIndex = 172; + u8 subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 1; + s16 increment = 4 - task->data[1]; + u8 spriteId; + + if (increment <= 0) + increment = 1; + for (i = 0; i < 20; i += increment) + { + spriteId = CreateSprite(&gUnknown_08595268, attackerCoordX, attackerCoordY, subpriority); + if (spriteId != MAX_SPRITES) + { + gSprites[spriteId].data[1] = i; + gSprites[spriteId].data[2] = attackerCoordX * 16; + gSprites[spriteId].data[3] = attackerCoordY * 16; + gSprites[spriteId].data[4] = Cos(trigIndex, 64); + gSprites[spriteId].data[5] = Sin(trigIndex, 64); + gSprites[spriteId].data[6] = taskId; + gSprites[spriteId].data[7] = 2; + if (task->data[2] & 1) + sub_810851C(&gSprites[spriteId]); + task->data[2]++; + } + trigIndex = (trigIndex + increment * 2); + trigIndex &= 0xFF; + } +} + +void sub_810851C(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->data[4] += (sprite->data[1] % 6) * 3; + sprite->data[5] += (sprite->data[1] % 3) * 3; + sprite->data[0]++; + case 1: + sprite->data[2] += sprite->data[4]; + sprite->data[3] += sprite->data[5]; + sprite->pos1.x = sprite->data[2] >> 4; + sprite->pos1.y = sprite->data[3] >> 4; + if (sprite->pos1.x < -8 || sprite->pos1.x > 248 || sprite->pos1.y < -8 || sprite->pos1.y > 120) + { + gTasks[sprite->data[6]].data[sprite->data[7]]--; + DestroySprite(sprite); + } + break; + } +} + +void sub_81085C8(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + task->data[1] = sub_8108384(); + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) + { + task->data[4] = 136; + task->data[6] = 40; + } + else + { + task->data[4] = 16; + task->data[6] = 80; + } + task->data[5] = 98; + task->data[7] = task->data[4] + 49; + task->data[12] = task->data[1] * 5 + 5; + task->func = sub_810862C; +} + +void sub_810862C(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + u8 taskId2; + + switch (task->data[0]) + { + case 0: + if (++task->data[2] > 2) + { + task->data[2] = 0; + sub_810871C(task, taskId); + } + if (task->data[10] != 0 && task->data[13] == 0) + { + gBattleAnimArgs[0] = 1; + gBattleAnimArgs[1] = 0; + gBattleAnimArgs[2] = 12; + taskId2 = CreateTask(sub_81152DC, 80); + if (taskId2 != 0xFF) + { + gTasks[taskId2].func(taskId2); + gAnimVisualTaskCount++; + } + gBattleAnimArgs[0] = 3; + taskId2 = CreateTask(sub_81152DC, 80); + if (taskId2 != 0xFF) + { + gTasks[taskId2].func(taskId2); + gAnimVisualTaskCount++; + } + task->data[13] = 1; + } + if (task->data[11] >= task->data[12]) + task->data[0]++; + break; + case 1: + if (task->data[9] == 0) + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_810871C(struct Task *task, u8 taskId) +{ + u16 yPosArg = ((gSineTable[task->data[8]] + 3) >> 4) + task->data[6]; + u8 spriteId = CreateSprite(&gUnknown_08595268, task->data[7], 0, 0); + + if (spriteId != MAX_SPRITES) + { + gSprites[spriteId].callback = sub_81087C0; + gSprites[spriteId].data[5] = yPosArg; + gSprites[spriteId].data[6] = taskId; + gSprites[spriteId].data[7] = 9; + task->data[9]++; + } + task->data[11]++; + task->data[8] = (task->data[8] + 39) & 0xFF; + task->data[7] = ((task->data[7] * 0x41c64e6d + 0x3039) % task->data[5]) + task->data[4]; +} + +void sub_81087C0(struct Sprite *sprite) +{ + if (sprite->data[0] == 0) + { + sprite->pos1.y += 8; + if (sprite->pos1.y >= sprite->data[5]) + { + gTasks[sprite->data[6]].data[10] = 1; + sprite->data[1] = CreateSprite(&gUnknown_08597388, sprite->pos1.x, sprite->pos1.y, 1); + if (sprite->data[1] != MAX_SPRITES) + { + StartSpriteAffineAnim(&gSprites[sprite->data[1]], 3); + gSprites[sprite->data[1]].data[6] = sprite->data[6]; + gSprites[sprite->data[1]].data[7] = sprite->data[7]; + gSprites[sprite->data[1]].callback = sub_810886C; + } + DestroySprite(sprite); + } + } +} + +void sub_810886C(struct Sprite *sprite) +{ + if (++sprite->data[1] > 1) + { + sprite->data[1] = 0; + sprite->invisible ^= 1; + if (++sprite->data[2] == 12) + { + gTasks[sprite->data[6]].data[sprite->data[7]]--; + FreeOamMatrix(sprite->oam.matrixNum); + DestroySprite(sprite); + } + } +} + +void sub_81088E4(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + task->data[3] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + task->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + task->data[7] = (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) ? 1 : -1; + if (IsContest()) + task->data[7] *= -1; + task->data[5] = task->data[3] + task->data[7] * 8; + task->data[6] = task->data[4] - task->data[7] * 8; + task->data[9] = -32; + task->data[1] = 0; + task->data[0] = 0; + task->func = sub_8108978; +} + +void sub_8108978(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + sub_8108AC0(task); + if (task->data[10] != 0) + task->data[0]++; + break; + case 1: + sub_8108AC0(task); + if (++task->data[1] > 16) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 2: + sub_8108AC0(task); + task->data[5] += task->data[7] * 6; + if (!(task->data[5] >= -16 && task->data[5] <= 256)) + { + if (++task->data[12] > 2) + { + task->data[13] = 1; + task->data[0] = 6; + task->data[1] = 0; + } + else + { + task->data[1] = 0; + task->data[0]++; + } + } + break; + case 3: + sub_8108AC0(task); + task->data[6] -= task->data[7] * 2; + if (++task->data[1] > 7) + task->data[0]++; + break; + case 4: + sub_8108AC0(task); + task->data[5] -= task->data[7] * 6; + if (!(task->data[5] >= -16 && task->data[5] <= 256)) + { + task->data[12]++; + task->data[1] = 0; + task->data[0]++; + } + break; + case 5: + sub_8108AC0(task); + task->data[6] -= task->data[7] * 2; + if (++task->data[1] > 7) + task->data[0] = 2; + break; + case 6: + if (task->data[8] == 0) + task->data[0]++; + break; + default: + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_8108AC0(struct Task *task) +{ + u8 spriteId; + + if (++task->data[2] > 1) + { + task->data[2] = 0; + spriteId = CreateSprite(&gUnknown_08595268, task->data[3], task->data[4], 10); + if (spriteId != MAX_SPRITES) + { + gSprites[spriteId].data[0] = 16; + gSprites[spriteId].data[2] = task->data[5]; + gSprites[spriteId].data[4] = task->data[6]; + gSprites[spriteId].data[5] = task->data[9]; + InitAnimArcTranslation(&gSprites[spriteId]); + gSprites[spriteId].callback = sub_8108B2C; + task->data[8]++; + } + } +} + +void sub_8108B2C(struct Sprite *sprite) +{ + if (TranslateAnimArc(sprite)) + { + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + sprite->data[0] = 6; + sprite->data[2] = (Random2() & 0x1F) - 16 + sprite->pos1.x; + sprite->data[4] = (Random2() & 0x1F) - 16 + sprite->pos1.y; + sprite->data[5] = ~(Random2() & 7); + InitAnimArcTranslation(sprite); + sprite->callback = sub_8108B94; + } +} + +void sub_8108B94(struct Sprite *sprite) +{ + u16 i; + + if (TranslateAnimArc(sprite)) + { + for (i = 0; i < NUM_TASKS; i++) + { + if (gTasks[i].func == sub_8108978) + { + gTasks[i].data[10] = 1; + gTasks[i].data[8]--; + DestroySprite(sprite); + } + } + } +} + +void sub_8108BE0(struct Sprite *sprite) +{ + sprite->pos1.x = gBattleAnimArgs[0]; + sprite->pos1.y = gBattleAnimArgs[1]; + sprite->data[0] = gBattleAnimArgs[2]; + sprite->data[1] = gBattleAnimArgs[3]; + sprite->data[2] = gBattleAnimArgs[4]; + sprite->data[3] = gBattleAnimArgs[5]; + sprite->callback = sub_8108C08; +} + +void sub_8108C08(struct Sprite *sprite) +{ + sprite->data[4] -= sprite->data[0]; + sprite->pos2.y = sprite->data[4] / 10; + sprite->data[5] = (sprite->data[5] + sprite->data[1]) & 0xFF; + sprite->pos2.x = Sin(sprite->data[5], sprite->data[2]); + if (--sprite->data[3] == 0) + DestroyAnimSprite(sprite); +} + +void sub_8108C54(struct Sprite *sprite) +{ + sprite->data[3] += sprite->data[1]; + sprite->data[4] += sprite->data[2]; + sprite->pos2.x = sprite->data[3] >> 7; + sprite->pos2.y = sprite->data[4] >> 7; + if (--sprite->data[0] == 0) + { + FreeSpriteOamMatrix(sprite); + DestroySprite(sprite); + } +} + +void sub_8108C94(struct Sprite *sprite) +{ + InitSpritePosToAnimAttacker(sprite, TRUE); + sprite->data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[3] = gBattleAnimArgs[2]; + sprite->data[4] = gBattleAnimArgs[3]; + sprite->callback = sub_8108CDC; +} + +void sub_8108CDC(struct Sprite *sprite) +{ + int xDiff = sprite->data[1] - sprite->pos1.x; + int yDiff = sprite->data[2] - sprite->pos1.y; + + sprite->pos2.x = (sprite->data[0] * xDiff) / sprite->data[3]; + sprite->pos2.y = (sprite->data[0] * yDiff) / sprite->data[3]; + if (++sprite->data[5] == sprite->data[4]) + { + sprite->data[5] = 0; + sub_8108D54(sprite, xDiff, yDiff); + } + if (sprite->data[3] == sprite->data[0]) + DestroyAnimSprite(sprite); + sprite->data[0]++; +} + +#ifdef NONMATCHING +void sub_8108D54(struct Sprite *sprite, int xDiff, int yDiff) +{ + s16 something = sprite->data[0] / 2; + s16 combinedX = sprite->pos1.x + sprite->pos2.x; + s16 combinedY = sprite->pos1.y + sprite->pos2.y; + s16 randomSomethingY = yDiff + (Random2() % 10) - 5; + s16 randomSomethingX = -xDiff + (Random2() % 10) - 5; + s16 i; + u8 spriteId; + + for (i = 0; i <= 0; i++) + { + spriteId = CreateSprite(&gUnknown_08595310, combinedX, combinedY + something, 130); + gSprites[spriteId].data[0] = 20; + gSprites[spriteId].data[1] = randomSomethingY; + gSprites[spriteId].subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 1; + if (randomSomethingX < 0) + gSprites[spriteId].data[2] = -randomSomethingX; + else + gSprites[spriteId].data[2] = randomSomethingX; + } + for (i = 0; i <= 0; i++) + { + spriteId = CreateSprite(&gUnknown_08595310, combinedX, combinedY - something, 130); + gSprites[spriteId].data[0] = 20; + gSprites[spriteId].data[1] = randomSomethingY; + gSprites[spriteId].subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 1; + if (randomSomethingX > 0) + gSprites[spriteId].data[2] = -randomSomethingX; + else + gSprites[spriteId].data[2] = randomSomethingX; + } +} +#else +NAKED +void sub_8108D54(struct Sprite *sprite, int xDiff, int yDiff) +{ + asm_unified("push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0x18\n\ + adds r4, r1, 0\n\ + adds r5, r2, 0\n\ + movs r2, 0x2E\n\ + ldrsh r1, [r0, r2]\n\ + lsrs r2, r1, 31\n\ + adds r1, r2\n\ + lsls r1, 15\n\ + lsrs r1, 16\n\ + str r1, [sp]\n\ + ldrh r1, [r0, 0x24]\n\ + ldrh r3, [r0, 0x20]\n\ + adds r1, r3\n\ + lsls r1, 16\n\ + lsrs r1, 16\n\ + mov r8, r1\n\ + ldrh r1, [r0, 0x26]\n\ + ldrh r0, [r0, 0x22]\n\ + adds r1, r0\n\ + lsls r1, 16\n\ + lsrs r1, 16\n\ + mov r10, r1\n\ + bl Random2\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + movs r1, 0xA\n\ + bl __umodsi3\n\ + adds r0, r5, r0\n\ + subs r0, 0x5\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + mov r9, r0\n\ + bl Random2\n\ + negs r4, r4\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + movs r1, 0xA\n\ + bl __umodsi3\n\ + adds r4, r0\n\ + subs r4, 0x5\n\ + lsls r4, 16\n\ + lsrs r7, r4, 16\n\ + movs r6, 0\n\ + mov r0, r8\n\ + lsls r0, 16\n\ + mov r8, r0\n\ + mov r1, r10\n\ + lsls r1, 16\n\ + str r1, [sp, 0xC]\n\ + ldr r2, [sp]\n\ + lsls r2, 16\n\ + str r2, [sp, 0x10]\n\ + asrs r1, 16\n\ + lsls r0, r7, 16\n\ + asrs r5, r0, 16\n\ + str r0, [sp, 0x14]\n\ + negs r3, r5\n\ + str r3, [sp, 0x4]\n\ + asrs r0, r2, 16\n\ + adds r1, r0\n\ + lsls r1, 16\n\ + mov r10, r1\n\ +_08108DE2:\n\ + ldr r0, =gUnknown_08595310\n\ + mov r2, r8\n\ + asrs r1, r2, 16\n\ + mov r3, r10\n\ + asrs r2, r3, 16\n\ + movs r3, 0x82\n\ + bl CreateSprite\n\ + lsls r0, 24\n\ + lsrs r2, r0, 24\n\ + ldr r1, =gSprites\n\ + lsls r0, r2, 4\n\ + adds r0, r2\n\ + lsls r0, 2\n\ + adds r4, r0, r1\n\ + movs r0, 0x14\n\ + strh r0, [r4, 0x2E]\n\ + mov r0, r9\n\ + strh r0, [r4, 0x30]\n\ + ldr r0, =gBattleAnimAttacker\n\ + ldrb r0, [r0]\n\ + bl GetBattlerSpriteSubpriority\n\ + subs r0, 0x1\n\ + adds r1, r4, 0\n\ + adds r1, 0x43\n\ + strb r0, [r1]\n\ + cmp r5, 0\n\ + bge _08108E30\n\ + mov r1, sp\n\ + ldrh r1, [r1, 0x4]\n\ + strh r1, [r4, 0x32]\n\ + b _08108E32\n\ + .pool\n\ +_08108E30:\n\ + strh r7, [r4, 0x32]\n\ +_08108E32:\n\ + lsls r0, r6, 16\n\ + movs r2, 0x80\n\ + lsls r2, 9\n\ + adds r0, r2\n\ + lsrs r6, r0, 16\n\ + cmp r0, 0\n\ + ble _08108DE2\n\ + movs r6, 0\n\ + ldr r3, [sp, 0xC]\n\ + asrs r1, r3, 16\n\ + ldr r0, [sp, 0x14]\n\ + asrs r5, r0, 16\n\ + negs r2, r5\n\ + str r2, [sp, 0x8]\n\ + ldr r3, [sp, 0x10]\n\ + asrs r0, r3, 16\n\ + subs r1, r0\n\ + lsls r1, 16\n\ + mov r10, r1\n\ +_08108E58:\n\ + ldr r0, =gUnknown_08595310\n\ + mov r2, r8\n\ + asrs r1, r2, 16\n\ + mov r3, r10\n\ + asrs r2, r3, 16\n\ + movs r3, 0x82\n\ + bl CreateSprite\n\ + lsls r0, 24\n\ + lsrs r2, r0, 24\n\ + ldr r1, =gSprites\n\ + lsls r0, r2, 4\n\ + adds r0, r2\n\ + lsls r0, 2\n\ + adds r4, r0, r1\n\ + movs r0, 0x14\n\ + strh r0, [r4, 0x2E]\n\ + mov r0, r9\n\ + strh r0, [r4, 0x30]\n\ + ldr r0, =gBattleAnimAttacker\n\ + ldrb r0, [r0]\n\ + bl GetBattlerSpriteSubpriority\n\ + subs r0, 0x1\n\ + adds r1, r4, 0\n\ + adds r1, 0x43\n\ + strb r0, [r1]\n\ + cmp r5, 0\n\ + ble _08108EA8\n\ + mov r1, sp\n\ + ldrh r1, [r1, 0x8]\n\ + strh r1, [r4, 0x32]\n\ + b _08108EAA\n\ + .pool\n\ +_08108EA8:\n\ + strh r7, [r4, 0x32]\n\ +_08108EAA:\n\ + lsls r0, r6, 16\n\ + movs r2, 0x80\n\ + lsls r2, 9\n\ + adds r0, r2\n\ + lsrs r6, r0, 16\n\ + cmp r0, 0\n\ + ble _08108E58\n\ + add sp, 0x18\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n"); +} +#endif diff --git a/src/wild_encounter.c b/src/wild_encounter.c index 3a8adaf15..2e6f1642a 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -40,4558 +40,7 @@ static bool8 IsAbilityAllowingEncounter(u8 level); EWRAM_DATA static u8 sWildEncountersDisabled = 0; EWRAM_DATA static u32 sFeebasRngValue = 0; -// const rom data -const struct WildPokemon gRoute101_LandMons[] = -{ - {2, 2, SPECIES_WURMPLE}, - {2, 2, SPECIES_POOCHYENA}, - {2, 2, SPECIES_WURMPLE}, - {3, 3, SPECIES_WURMPLE}, - {3, 3, SPECIES_POOCHYENA}, - {3, 3, SPECIES_POOCHYENA}, - {3, 3, SPECIES_WURMPLE}, - {3, 3, SPECIES_POOCHYENA}, - {2, 2, SPECIES_ZIGZAGOON}, - {2, 2, SPECIES_ZIGZAGOON}, - {3, 3, SPECIES_ZIGZAGOON}, - {3, 3, SPECIES_ZIGZAGOON}, -}; - -const struct WildPokemonInfo gRoute101_LandMonsInfo = {20, gRoute101_LandMons}; - -const struct WildPokemon gRoute102_LandMons[] = -{ - {3, 3, SPECIES_POOCHYENA}, - {3, 3, SPECIES_WURMPLE}, - {4, 4, SPECIES_POOCHYENA}, - {4, 4, SPECIES_WURMPLE}, - {3, 3, SPECIES_LOTAD}, - {4, 4, SPECIES_LOTAD}, - {3, 3, SPECIES_ZIGZAGOON}, - {3, 3, SPECIES_ZIGZAGOON}, - {4, 4, SPECIES_ZIGZAGOON}, - {4, 4, SPECIES_RALTS}, - {4, 4, SPECIES_ZIGZAGOON}, - {3, 3, SPECIES_SEEDOT}, -}; - -const struct WildPokemonInfo gRoute102_LandMonsInfo = {20, gRoute102_LandMons}; - -const struct WildPokemon gRoute102_WaterMons[] = -{ - {20, 30, SPECIES_MARILL}, - {10, 20, SPECIES_MARILL}, - {30, 35, SPECIES_MARILL}, - {5, 10, SPECIES_MARILL}, - {20, 30, SPECIES_GOLDEEN}, -}; - -const struct WildPokemonInfo gRoute102_WaterMonsInfo = {4, gRoute102_WaterMons}; - -const struct WildPokemon gRoute102_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_GOLDEEN}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_GOLDEEN}, - {10, 30, SPECIES_CORPHISH}, - {25, 30, SPECIES_CORPHISH}, - {30, 35, SPECIES_CORPHISH}, - {20, 25, SPECIES_CORPHISH}, - {35, 40, SPECIES_CORPHISH}, - {40, 45, SPECIES_CORPHISH}, -}; - -const struct WildPokemonInfo gRoute102_FishingMonsInfo = {30, gRoute102_FishingMons}; - -const struct WildPokemon gRoute103_LandMons[] = -{ - {2, 2, SPECIES_POOCHYENA}, - {3, 3, SPECIES_POOCHYENA}, - {3, 3, SPECIES_POOCHYENA}, - {4, 4, SPECIES_POOCHYENA}, - {2, 2, SPECIES_WINGULL}, - {3, 3, SPECIES_ZIGZAGOON}, - {3, 3, SPECIES_ZIGZAGOON}, - {4, 4, SPECIES_ZIGZAGOON}, - {3, 3, SPECIES_WINGULL}, - {3, 3, SPECIES_WINGULL}, - {2, 2, SPECIES_WINGULL}, - {4, 4, SPECIES_WINGULL}, -}; - -const struct WildPokemonInfo gRoute103_LandMonsInfo = {20, gRoute103_LandMons}; - -const struct WildPokemon gRoute103_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute103_WaterMonsInfo = {4, gRoute103_WaterMons}; - -const struct WildPokemon gRoute103_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_SHARPEDO}, - {30, 35, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute103_FishingMonsInfo = {30, gRoute103_FishingMons}; - -const struct WildPokemon gRoute104_LandMons[] = -{ - {4, 4, SPECIES_POOCHYENA}, - {4, 4, SPECIES_WURMPLE}, - {5, 5, SPECIES_POOCHYENA}, - {5, 5, SPECIES_MARILL}, - {4, 4, SPECIES_MARILL}, - {5, 5, SPECIES_POOCHYENA}, - {4, 4, SPECIES_TAILLOW}, - {5, 5, SPECIES_TAILLOW}, - {4, 4, SPECIES_WINGULL}, - {4, 4, SPECIES_WINGULL}, - {3, 3, SPECIES_WINGULL}, - {5, 5, SPECIES_WINGULL}, -}; - -const struct WildPokemonInfo gRoute104_LandMonsInfo = {20, gRoute104_LandMons}; - -const struct WildPokemon gRoute104_WaterMons[] = -{ - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute104_WaterMonsInfo = {4, gRoute104_WaterMons}; - -const struct WildPokemon gRoute104_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_MAGIKARP}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_MAGIKARP}, - {25, 30, SPECIES_MAGIKARP}, - {30, 35, SPECIES_MAGIKARP}, - {20, 25, SPECIES_MAGIKARP}, - {35, 40, SPECIES_MAGIKARP}, - {40, 45, SPECIES_MAGIKARP}, -}; - -const struct WildPokemonInfo gRoute104_FishingMonsInfo = {30, gRoute104_FishingMons}; - -const struct WildPokemon gRoute105_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute105_WaterMonsInfo = {4, gRoute105_WaterMons}; - -const struct WildPokemon gRoute105_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_WAILMER}, - {20, 25, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute105_FishingMonsInfo = {30, gRoute105_FishingMons}; - -const struct WildPokemon gRoute110_LandMons[] = -{ - {12, 12, SPECIES_POOCHYENA}, - {12, 12, SPECIES_ELECTRIKE}, - {12, 12, SPECIES_GULPIN}, - {13, 13, SPECIES_ELECTRIKE}, - {13, 13, SPECIES_MINUN}, - {13, 13, SPECIES_ODDISH}, - {13, 13, SPECIES_MINUN}, - {13, 13, SPECIES_GULPIN}, - {12, 12, SPECIES_WINGULL}, - {12, 12, SPECIES_WINGULL}, - {12, 12, SPECIES_PLUSLE}, - {13, 13, SPECIES_PLUSLE}, -}; - -const struct WildPokemonInfo gRoute110_LandMonsInfo = {20, gRoute110_LandMons}; - -const struct WildPokemon gRoute110_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute110_WaterMonsInfo = {4, gRoute110_WaterMons}; - -const struct WildPokemon gRoute110_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_WAILMER}, - {20, 25, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute110_FishingMonsInfo = {30, gRoute110_FishingMons}; - -const struct WildPokemon gRoute111_LandMons[] = -{ - {20, 20, SPECIES_SANDSHREW}, - {20, 20, SPECIES_TRAPINCH}, - {21, 21, SPECIES_SANDSHREW}, - {21, 21, SPECIES_TRAPINCH}, - {19, 19, SPECIES_BALTOY}, - {21, 21, SPECIES_BALTOY}, - {19, 19, SPECIES_SANDSHREW}, - {19, 19, SPECIES_TRAPINCH}, - {20, 20, SPECIES_BALTOY}, - {20, 20, SPECIES_CACNEA}, - {22, 22, SPECIES_CACNEA}, - {22, 22, SPECIES_CACNEA}, -}; - -const struct WildPokemonInfo gRoute111_LandMonsInfo = {10, gRoute111_LandMons}; - -const struct WildPokemon gRoute111_WaterMons[] = -{ - {20, 30, SPECIES_MARILL}, - {10, 20, SPECIES_MARILL}, - {30, 35, SPECIES_MARILL}, - {5, 10, SPECIES_MARILL}, - {20, 30, SPECIES_GOLDEEN}, -}; - -const struct WildPokemonInfo gRoute111_WaterMonsInfo = {4, gRoute111_WaterMons}; - -const struct WildPokemon gRoute111_RockSmashMons[] = -{ - {10, 15, SPECIES_GEODUDE}, - {5, 10, SPECIES_GEODUDE}, - {15, 20, SPECIES_GEODUDE}, - {15, 20, SPECIES_GEODUDE}, - {15, 20, SPECIES_GEODUDE}, -}; - -const struct WildPokemonInfo gRoute111_RockSmashMonsInfo = {20, gRoute111_RockSmashMons}; - -const struct WildPokemon gRoute111_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_GOLDEEN}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_GOLDEEN}, - {10, 30, SPECIES_BARBOACH}, - {25, 30, SPECIES_BARBOACH}, - {30, 35, SPECIES_BARBOACH}, - {20, 25, SPECIES_BARBOACH}, - {35, 40, SPECIES_BARBOACH}, - {40, 45, SPECIES_BARBOACH}, -}; - -const struct WildPokemonInfo gRoute111_FishingMonsInfo = {30, gRoute111_FishingMons}; - -const struct WildPokemon gRoute112_LandMons[] = -{ - {15, 15, SPECIES_NUMEL}, - {15, 15, SPECIES_NUMEL}, - {15, 15, SPECIES_MARILL}, - {14, 14, SPECIES_NUMEL}, - {14, 14, SPECIES_NUMEL}, - {14, 14, SPECIES_MARILL}, - {16, 16, SPECIES_NUMEL}, - {16, 16, SPECIES_MARILL}, - {16, 16, SPECIES_NUMEL}, - {16, 16, SPECIES_NUMEL}, - {16, 16, SPECIES_NUMEL}, - {16, 16, SPECIES_NUMEL}, -}; - -const struct WildPokemonInfo gRoute112_LandMonsInfo = {20, gRoute112_LandMons}; - -const struct WildPokemon gRoute113_LandMons[] = -{ - {15, 15, SPECIES_SPINDA}, - {15, 15, SPECIES_SPINDA}, - {15, 15, SPECIES_SLUGMA}, - {14, 14, SPECIES_SPINDA}, - {14, 14, SPECIES_SPINDA}, - {14, 14, SPECIES_SLUGMA}, - {16, 16, SPECIES_SPINDA}, - {16, 16, SPECIES_SLUGMA}, - {16, 16, SPECIES_SPINDA}, - {16, 16, SPECIES_SKARMORY}, - {16, 16, SPECIES_SPINDA}, - {16, 16, SPECIES_SKARMORY}, -}; - -const struct WildPokemonInfo gRoute113_LandMonsInfo = {20, gRoute113_LandMons}; - -const struct WildPokemon gRoute114_LandMons[] = -{ - {16, 16, SPECIES_SWABLU}, - {16, 16, SPECIES_LOTAD}, - {17, 17, SPECIES_SWABLU}, - {15, 15, SPECIES_SWABLU}, - {15, 15, SPECIES_LOTAD}, - {16, 16, SPECIES_LOMBRE}, - {16, 16, SPECIES_LOMBRE}, - {18, 18, SPECIES_LOMBRE}, - {17, 17, SPECIES_SEVIPER}, - {15, 15, SPECIES_SEVIPER}, - {17, 17, SPECIES_SEVIPER}, - {15, 15, SPECIES_NUZLEAF}, -}; - -const struct WildPokemonInfo gRoute114_LandMonsInfo = {20, gRoute114_LandMons}; - -const struct WildPokemon gRoute114_WaterMons[] = -{ - {20, 30, SPECIES_MARILL}, - {10, 20, SPECIES_MARILL}, - {30, 35, SPECIES_MARILL}, - {5, 10, SPECIES_MARILL}, - {20, 30, SPECIES_GOLDEEN}, -}; - -const struct WildPokemonInfo gRoute114_WaterMonsInfo = {4, gRoute114_WaterMons}; - -const struct WildPokemon gRoute114_RockSmashMons[] = -{ - {10, 15, SPECIES_GEODUDE}, - {5, 10, SPECIES_GEODUDE}, - {15, 20, SPECIES_GEODUDE}, - {15, 20, SPECIES_GEODUDE}, - {15, 20, SPECIES_GEODUDE}, -}; - -const struct WildPokemonInfo gRoute114_RockSmashMonsInfo = {20, gRoute114_RockSmashMons}; - -const struct WildPokemon gRoute114_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_GOLDEEN}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_GOLDEEN}, - {10, 30, SPECIES_BARBOACH}, - {25, 30, SPECIES_BARBOACH}, - {30, 35, SPECIES_BARBOACH}, - {20, 25, SPECIES_BARBOACH}, - {35, 40, SPECIES_BARBOACH}, - {40, 45, SPECIES_BARBOACH}, -}; - -const struct WildPokemonInfo gRoute114_FishingMonsInfo = {30, gRoute114_FishingMons}; - -const struct WildPokemon gRoute116_LandMons[] = -{ - {6, 6, SPECIES_POOCHYENA}, - {6, 6, SPECIES_WHISMUR}, - {6, 6, SPECIES_NINCADA}, - {7, 7, SPECIES_ABRA}, - {7, 7, SPECIES_NINCADA}, - {6, 6, SPECIES_TAILLOW}, - {7, 7, SPECIES_TAILLOW}, - {8, 8, SPECIES_TAILLOW}, - {7, 7, SPECIES_POOCHYENA}, - {8, 8, SPECIES_POOCHYENA}, - {7, 7, SPECIES_SKITTY}, - {8, 8, SPECIES_SKITTY}, -}; - -const struct WildPokemonInfo gRoute116_LandMonsInfo = {20, gRoute116_LandMons}; - -const struct WildPokemon gRoute117_LandMons[] = -{ - {13, 13, SPECIES_POOCHYENA}, - {13, 13, SPECIES_ODDISH}, - {14, 14, SPECIES_POOCHYENA}, - {14, 14, SPECIES_ODDISH}, - {13, 13, SPECIES_MARILL}, - {13, 13, SPECIES_ODDISH}, - {13, 13, SPECIES_ILLUMISE}, - {13, 13, SPECIES_ILLUMISE}, - {14, 14, SPECIES_ILLUMISE}, - {14, 14, SPECIES_ILLUMISE}, - {13, 13, SPECIES_VOLBEAT}, - {13, 13, SPECIES_SEEDOT}, -}; - -const struct WildPokemonInfo gRoute117_LandMonsInfo = {20, gRoute117_LandMons}; - -const struct WildPokemon gRoute117_WaterMons[] = -{ - {20, 30, SPECIES_MARILL}, - {10, 20, SPECIES_MARILL}, - {30, 35, SPECIES_MARILL}, - {5, 10, SPECIES_MARILL}, - {20, 30, SPECIES_GOLDEEN}, -}; - -const struct WildPokemonInfo gRoute117_WaterMonsInfo = {4, gRoute117_WaterMons}; - -const struct WildPokemon gRoute117_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_GOLDEEN}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_GOLDEEN}, - {10, 30, SPECIES_CORPHISH}, - {25, 30, SPECIES_CORPHISH}, - {30, 35, SPECIES_CORPHISH}, - {20, 25, SPECIES_CORPHISH}, - {35, 40, SPECIES_CORPHISH}, - {40, 45, SPECIES_CORPHISH}, -}; - -const struct WildPokemonInfo gRoute117_FishingMonsInfo = {30, gRoute117_FishingMons}; - -const struct WildPokemon gRoute118_LandMons[] = -{ - {24, 24, SPECIES_ZIGZAGOON}, - {24, 24, SPECIES_ELECTRIKE}, - {26, 26, SPECIES_ZIGZAGOON}, - {26, 26, SPECIES_ELECTRIKE}, - {26, 26, SPECIES_LINOONE}, - {26, 26, SPECIES_MANECTRIC}, - {25, 25, SPECIES_WINGULL}, - {25, 25, SPECIES_WINGULL}, - {26, 26, SPECIES_WINGULL}, - {26, 26, SPECIES_WINGULL}, - {27, 27, SPECIES_WINGULL}, - {25, 25, SPECIES_KECLEON}, -}; - -const struct WildPokemonInfo gRoute118_LandMonsInfo = {20, gRoute118_LandMons}; - -const struct WildPokemon gRoute118_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute118_WaterMonsInfo = {4, gRoute118_WaterMons}; - -const struct WildPokemon gRoute118_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_CARVANHA}, - {30, 35, SPECIES_SHARPEDO}, - {30, 35, SPECIES_CARVANHA}, - {20, 25, SPECIES_CARVANHA}, - {35, 40, SPECIES_CARVANHA}, - {40, 45, SPECIES_CARVANHA}, -}; - -const struct WildPokemonInfo gRoute118_FishingMonsInfo = {30, gRoute118_FishingMons}; - -const struct WildPokemon gRoute124_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute124_WaterMonsInfo = {4, gRoute124_WaterMons}; - -const struct WildPokemon gRoute124_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_SHARPEDO}, - {30, 35, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute124_FishingMonsInfo = {30, gRoute124_FishingMons}; - -const struct WildPokemon gPetalburgWoods_LandMons[] = -{ - {5, 5, SPECIES_POOCHYENA}, - {5, 5, SPECIES_WURMPLE}, - {5, 5, SPECIES_SHROOMISH}, - {6, 6, SPECIES_POOCHYENA}, - {5, 5, SPECIES_SILCOON}, - {5, 5, SPECIES_CASCOON}, - {6, 6, SPECIES_WURMPLE}, - {6, 6, SPECIES_SHROOMISH}, - {5, 5, SPECIES_TAILLOW}, - {5, 5, SPECIES_SLAKOTH}, - {6, 6, SPECIES_TAILLOW}, - {6, 6, SPECIES_SLAKOTH}, -}; - -const struct WildPokemonInfo gPetalburgWoods_LandMonsInfo = {20, gPetalburgWoods_LandMons}; - -const struct WildPokemon gRusturfTunnel_LandMons[] = -{ - {6, 6, SPECIES_WHISMUR}, - {7, 7, SPECIES_WHISMUR}, - {6, 6, SPECIES_WHISMUR}, - {6, 6, SPECIES_WHISMUR}, - {7, 7, SPECIES_WHISMUR}, - {7, 7, SPECIES_WHISMUR}, - {5, 5, SPECIES_WHISMUR}, - {8, 8, SPECIES_WHISMUR}, - {5, 5, SPECIES_WHISMUR}, - {8, 8, SPECIES_WHISMUR}, - {5, 5, SPECIES_WHISMUR}, - {8, 8, SPECIES_WHISMUR}, -}; - -const struct WildPokemonInfo gRusturfTunnel_LandMonsInfo = {10, gRusturfTunnel_LandMons}; - -const struct WildPokemon gGraniteCave_1F_LandMons[] = -{ - {7, 7, SPECIES_ZUBAT}, - {8, 8, SPECIES_MAKUHITA}, - {7, 7, SPECIES_MAKUHITA}, - {8, 8, SPECIES_ZUBAT}, - {9, 9, SPECIES_MAKUHITA}, - {8, 8, SPECIES_ABRA}, - {10, 10, SPECIES_MAKUHITA}, - {6, 6, SPECIES_MAKUHITA}, - {7, 7, SPECIES_GEODUDE}, - {8, 8, SPECIES_GEODUDE}, - {6, 6, SPECIES_GEODUDE}, - {9, 9, SPECIES_GEODUDE}, -}; - -const struct WildPokemonInfo gGraniteCave_1F_LandMonsInfo = {10, gGraniteCave_1F_LandMons}; - -const struct WildPokemon gGraniteCave_B1F_LandMons[] = -{ - {9, 9, SPECIES_ZUBAT}, - {10, 10, SPECIES_ARON}, - {9, 9, SPECIES_ARON}, - {11, 11, SPECIES_ARON}, - {10, 10, SPECIES_ZUBAT}, - {9, 9, SPECIES_ABRA}, - {10, 10, SPECIES_MAKUHITA}, - {11, 11, SPECIES_MAKUHITA}, - {10, 10, SPECIES_SABLEYE}, - {10, 10, SPECIES_SABLEYE}, - {9, 9, SPECIES_SABLEYE}, - {11, 11, SPECIES_SABLEYE}, -}; - -const struct WildPokemonInfo gGraniteCave_B1F_LandMonsInfo = {10, gGraniteCave_B1F_LandMons}; - -const struct WildPokemon gMtPyre_1F_LandMons[] = -{ - {27, 27, SPECIES_SHUPPET}, - {28, 28, SPECIES_SHUPPET}, - {26, 26, SPECIES_SHUPPET}, - {25, 25, SPECIES_SHUPPET}, - {29, 29, SPECIES_SHUPPET}, - {24, 24, SPECIES_SHUPPET}, - {23, 23, SPECIES_SHUPPET}, - {22, 22, SPECIES_SHUPPET}, - {29, 29, SPECIES_SHUPPET}, - {24, 24, SPECIES_SHUPPET}, - {29, 29, SPECIES_SHUPPET}, - {24, 24, SPECIES_SHUPPET}, -}; - -const struct WildPokemonInfo gMtPyre_1F_LandMonsInfo = {10, gMtPyre_1F_LandMons}; - -const struct WildPokemon gVictoryRoad_1F_LandMons[] = -{ - {40, 40, SPECIES_GOLBAT}, - {40, 40, SPECIES_HARIYAMA}, - {40, 40, SPECIES_LAIRON}, - {40, 40, SPECIES_LOUDRED}, - {36, 36, SPECIES_ZUBAT}, - {36, 36, SPECIES_MAKUHITA}, - {38, 38, SPECIES_GOLBAT}, - {38, 38, SPECIES_HARIYAMA}, - {36, 36, SPECIES_ARON}, - {36, 36, SPECIES_WHISMUR}, - {36, 36, SPECIES_ARON}, - {36, 36, SPECIES_WHISMUR}, -}; - -const struct WildPokemonInfo gVictoryRoad_1F_LandMonsInfo = {10, gVictoryRoad_1F_LandMons}; - -const struct WildPokemon gSafariZone_South_LandMons[] = -{ - {25, 25, SPECIES_ODDISH}, - {27, 27, SPECIES_ODDISH}, - {25, 25, SPECIES_GIRAFARIG}, - {27, 27, SPECIES_GIRAFARIG}, - {25, 25, SPECIES_NATU}, - {25, 25, SPECIES_DODUO}, - {25, 25, SPECIES_GLOOM}, - {27, 27, SPECIES_WOBBUFFET}, - {25, 25, SPECIES_PIKACHU}, - {27, 27, SPECIES_WOBBUFFET}, - {27, 27, SPECIES_PIKACHU}, - {29, 29, SPECIES_WOBBUFFET}, -}; - -const struct WildPokemonInfo gSafariZone_South_LandMonsInfo = {25, gSafariZone_South_LandMons}; - -const struct WildPokemon gUnderwater2_WaterMons[] = -{ - {20, 30, SPECIES_CLAMPERL}, - {20, 30, SPECIES_CHINCHOU}, - {30, 35, SPECIES_CLAMPERL}, - {30, 35, SPECIES_RELICANTH}, - {30, 35, SPECIES_RELICANTH}, -}; - -const struct WildPokemonInfo gUnderwater2_WaterMonsInfo = {4, gUnderwater2_WaterMons}; - -const struct WildPokemon gAbandonedShip_Rooms_B1F_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {5, 35, SPECIES_TENTACOOL}, - {5, 35, SPECIES_TENTACOOL}, - {5, 35, SPECIES_TENTACOOL}, - {30, 35, SPECIES_TENTACRUEL}, -}; - -const struct WildPokemonInfo gAbandonedShip_Rooms_B1F_WaterMonsInfo = {4, gAbandonedShip_Rooms_B1F_WaterMons}; - -const struct WildPokemon gAbandonedShip_Rooms_B1F_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_TENTACOOL}, - {25, 30, SPECIES_TENTACOOL}, - {30, 35, SPECIES_TENTACOOL}, - {30, 35, SPECIES_TENTACRUEL}, - {25, 30, SPECIES_TENTACRUEL}, - {20, 25, SPECIES_TENTACRUEL}, -}; - -const struct WildPokemonInfo gAbandonedShip_Rooms_B1F_FishingMonsInfo = {20, gAbandonedShip_Rooms_B1F_FishingMons}; - -const struct WildPokemon gGraniteCave_B2F_LandMons[] = -{ - {10, 10, SPECIES_ZUBAT}, - {11, 11, SPECIES_ARON}, - {10, 10, SPECIES_ARON}, - {11, 11, SPECIES_ZUBAT}, - {12, 12, SPECIES_ARON}, - {10, 10, SPECIES_ABRA}, - {10, 10, SPECIES_SABLEYE}, - {11, 11, SPECIES_SABLEYE}, - {12, 12, SPECIES_SABLEYE}, - {10, 10, SPECIES_SABLEYE}, - {12, 12, SPECIES_SABLEYE}, - {10, 10, SPECIES_SABLEYE}, -}; - -const struct WildPokemonInfo gGraniteCave_B2F_LandMonsInfo = {10, gGraniteCave_B2F_LandMons}; - -const struct WildPokemon gGraniteCave_B2F_RockSmashMons[] = -{ - {10, 15, SPECIES_GEODUDE}, - {10, 20, SPECIES_NOSEPASS}, - {5, 10, SPECIES_GEODUDE}, - {15, 20, SPECIES_GEODUDE}, - {15, 20, SPECIES_GEODUDE}, -}; - -const struct WildPokemonInfo gGraniteCave_B2F_RockSmashMonsInfo = {20, gGraniteCave_B2F_RockSmashMons}; - -const struct WildPokemon gFieryPath_LandMons[] = -{ - {15, 15, SPECIES_NUMEL}, - {15, 15, SPECIES_KOFFING}, - {16, 16, SPECIES_NUMEL}, - {15, 15, SPECIES_MACHOP}, - {15, 15, SPECIES_TORKOAL}, - {15, 15, SPECIES_SLUGMA}, - {16, 16, SPECIES_KOFFING}, - {16, 16, SPECIES_MACHOP}, - {14, 14, SPECIES_TORKOAL}, - {16, 16, SPECIES_TORKOAL}, - {14, 14, SPECIES_GRIMER}, - {14, 14, SPECIES_GRIMER}, -}; - -const struct WildPokemonInfo gFieryPath_LandMonsInfo = {10, gFieryPath_LandMons}; - -const struct WildPokemon gMeteorFalls_B1F_2R_LandMons[] = -{ - {33, 33, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {30, 30, SPECIES_BAGON}, - {35, 35, SPECIES_SOLROCK}, - {35, 35, SPECIES_BAGON}, - {37, 37, SPECIES_SOLROCK}, - {25, 25, SPECIES_BAGON}, - {39, 39, SPECIES_SOLROCK}, - {38, 38, SPECIES_GOLBAT}, - {40, 40, SPECIES_GOLBAT}, - {38, 38, SPECIES_GOLBAT}, - {40, 40, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gMeteorFalls_B1F_2R_LandMonsInfo = {10, gMeteorFalls_B1F_2R_LandMons}; - -const struct WildPokemon gMeteorFalls_B1F_2R_WaterMons[] = -{ - {30, 35, SPECIES_GOLBAT}, - {30, 35, SPECIES_GOLBAT}, - {25, 35, SPECIES_SOLROCK}, - {15, 25, SPECIES_SOLROCK}, - {5, 15, SPECIES_SOLROCK}, -}; - -const struct WildPokemonInfo gMeteorFalls_B1F_2R_WaterMonsInfo = {4, gMeteorFalls_B1F_2R_WaterMons}; - -const struct WildPokemon gMeteorFalls_B1F_2R_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_GOLDEEN}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_GOLDEEN}, - {10, 30, SPECIES_BARBOACH}, - {25, 30, SPECIES_BARBOACH}, - {30, 35, SPECIES_BARBOACH}, - {30, 35, SPECIES_WHISCASH}, - {35, 40, SPECIES_WHISCASH}, - {40, 45, SPECIES_WHISCASH}, -}; - -const struct WildPokemonInfo gMeteorFalls_B1F_2R_FishingMonsInfo = {30, gMeteorFalls_B1F_2R_FishingMons}; - -const struct WildPokemon gJaggedPass_LandMons[] = -{ - {21, 21, SPECIES_NUMEL}, - {21, 21, SPECIES_NUMEL}, - {21, 21, SPECIES_MACHOP}, - {20, 20, SPECIES_NUMEL}, - {20, 20, SPECIES_SPOINK}, - {20, 20, SPECIES_MACHOP}, - {21, 21, SPECIES_SPOINK}, - {22, 22, SPECIES_MACHOP}, - {22, 22, SPECIES_NUMEL}, - {22, 22, SPECIES_SPOINK}, - {22, 22, SPECIES_NUMEL}, - {22, 22, SPECIES_SPOINK}, -}; - -const struct WildPokemonInfo gJaggedPass_LandMonsInfo = {20, gJaggedPass_LandMons}; - -const struct WildPokemon gRoute106_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute106_WaterMonsInfo = {4, gRoute106_WaterMons}; - -const struct WildPokemon gRoute106_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_WAILMER}, - {20, 25, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute106_FishingMonsInfo = {30, gRoute106_FishingMons}; - -const struct WildPokemon gRoute107_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute107_WaterMonsInfo = {4, gRoute107_WaterMons}; - -const struct WildPokemon gRoute107_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_WAILMER}, - {20, 25, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute107_FishingMonsInfo = {30, gRoute107_FishingMons}; - -const struct WildPokemon gRoute108_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute108_WaterMonsInfo = {4, gRoute108_WaterMons}; - -const struct WildPokemon gRoute108_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_WAILMER}, - {20, 25, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute108_FishingMonsInfo = {30, gRoute108_FishingMons}; - -const struct WildPokemon gRoute109_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute109_WaterMonsInfo = {4, gRoute109_WaterMons}; - -const struct WildPokemon gRoute109_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_WAILMER}, - {20, 25, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute109_FishingMonsInfo = {30, gRoute109_FishingMons}; - -const struct WildPokemon gRoute115_LandMons[] = -{ - {23, 23, SPECIES_SWABLU}, - {23, 23, SPECIES_TAILLOW}, - {25, 25, SPECIES_SWABLU}, - {24, 24, SPECIES_TAILLOW}, - {25, 25, SPECIES_TAILLOW}, - {25, 25, SPECIES_SWELLOW}, - {24, 24, SPECIES_JIGGLYPUFF}, - {25, 25, SPECIES_JIGGLYPUFF}, - {24, 24, SPECIES_WINGULL}, - {24, 24, SPECIES_WINGULL}, - {26, 26, SPECIES_WINGULL}, - {25, 25, SPECIES_WINGULL}, -}; - -const struct WildPokemonInfo gRoute115_LandMonsInfo = {20, gRoute115_LandMons}; - -const struct WildPokemon gRoute115_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute115_WaterMonsInfo = {4, gRoute115_WaterMons}; - -const struct WildPokemon gRoute115_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_WAILMER}, - {20, 25, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute115_FishingMonsInfo = {30, gRoute115_FishingMons}; - -const struct WildPokemon gNewMauville_Inside_LandMons[] = -{ - {24, 24, SPECIES_VOLTORB}, - {24, 24, SPECIES_MAGNEMITE}, - {25, 25, SPECIES_VOLTORB}, - {25, 25, SPECIES_MAGNEMITE}, - {23, 23, SPECIES_VOLTORB}, - {23, 23, SPECIES_MAGNEMITE}, - {26, 26, SPECIES_VOLTORB}, - {26, 26, SPECIES_MAGNEMITE}, - {22, 22, SPECIES_VOLTORB}, - {22, 22, SPECIES_MAGNEMITE}, - {26, 26, SPECIES_ELECTRODE}, - {26, 26, SPECIES_MAGNETON}, -}; - -const struct WildPokemonInfo gNewMauville_Inside_LandMonsInfo = {10, gNewMauville_Inside_LandMons}; - -const struct WildPokemon gRoute119_LandMons[] = -{ - {25, 25, SPECIES_ZIGZAGOON}, - {25, 25, SPECIES_LINOONE}, - {27, 27, SPECIES_ZIGZAGOON}, - {25, 25, SPECIES_ODDISH}, - {27, 27, SPECIES_LINOONE}, - {26, 26, SPECIES_ODDISH}, - {27, 27, SPECIES_ODDISH}, - {24, 24, SPECIES_ODDISH}, - {25, 25, SPECIES_TROPIUS}, - {26, 26, SPECIES_TROPIUS}, - {27, 27, SPECIES_TROPIUS}, - {25, 25, SPECIES_KECLEON}, -}; - -const struct WildPokemonInfo gRoute119_LandMonsInfo = {15, gRoute119_LandMons}; - -const struct WildPokemon gRoute119_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute119_WaterMonsInfo = {4, gRoute119_WaterMons}; - -const struct WildPokemon gRoute119_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_CARVANHA}, - {25, 30, SPECIES_CARVANHA}, - {30, 35, SPECIES_CARVANHA}, - {20, 25, SPECIES_CARVANHA}, - {35, 40, SPECIES_CARVANHA}, - {40, 45, SPECIES_CARVANHA}, -}; - -const struct WildPokemonInfo gRoute119_FishingMonsInfo = {30, gRoute119_FishingMons}; - -const struct WildPokemon gRoute120_LandMons[] = -{ - {25, 25, SPECIES_POOCHYENA}, - {25, 25, SPECIES_MIGHTYENA}, - {27, 27, SPECIES_MIGHTYENA}, - {25, 25, SPECIES_ODDISH}, - {25, 25, SPECIES_MARILL}, - {26, 26, SPECIES_ODDISH}, - {27, 27, SPECIES_ODDISH}, - {27, 27, SPECIES_MARILL}, - {25, 25, SPECIES_ABSOL}, - {27, 27, SPECIES_ABSOL}, - {25, 25, SPECIES_KECLEON}, - {25, 25, SPECIES_SEEDOT}, -}; - -const struct WildPokemonInfo gRoute120_LandMonsInfo = {20, gRoute120_LandMons}; - -const struct WildPokemon gRoute120_WaterMons[] = -{ - {20, 30, SPECIES_MARILL}, - {10, 20, SPECIES_MARILL}, - {30, 35, SPECIES_MARILL}, - {5, 10, SPECIES_MARILL}, - {20, 30, SPECIES_GOLDEEN}, -}; - -const struct WildPokemonInfo gRoute120_WaterMonsInfo = {4, gRoute120_WaterMons}; - -const struct WildPokemon gRoute120_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_GOLDEEN}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_GOLDEEN}, - {10, 30, SPECIES_BARBOACH}, - {25, 30, SPECIES_BARBOACH}, - {30, 35, SPECIES_BARBOACH}, - {20, 25, SPECIES_BARBOACH}, - {35, 40, SPECIES_BARBOACH}, - {40, 45, SPECIES_BARBOACH}, -}; - -const struct WildPokemonInfo gRoute120_FishingMonsInfo = {30, gRoute120_FishingMons}; - -const struct WildPokemon gRoute121_LandMons[] = -{ - {26, 26, SPECIES_POOCHYENA}, - {26, 26, SPECIES_SHUPPET}, - {26, 26, SPECIES_MIGHTYENA}, - {28, 28, SPECIES_SHUPPET}, - {28, 28, SPECIES_MIGHTYENA}, - {26, 26, SPECIES_ODDISH}, - {28, 28, SPECIES_ODDISH}, - {28, 28, SPECIES_GLOOM}, - {26, 26, SPECIES_WINGULL}, - {27, 27, SPECIES_WINGULL}, - {28, 28, SPECIES_WINGULL}, - {25, 25, SPECIES_KECLEON}, -}; - -const struct WildPokemonInfo gRoute121_LandMonsInfo = {20, gRoute121_LandMons}; - -const struct WildPokemon gRoute121_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute121_WaterMonsInfo = {4, gRoute121_WaterMons}; - -const struct WildPokemon gRoute121_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_WAILMER}, - {20, 25, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute121_FishingMonsInfo = {30, gRoute121_FishingMons}; - -const struct WildPokemon gRoute122_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute122_WaterMonsInfo = {4, gRoute122_WaterMons}; - -const struct WildPokemon gRoute122_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_SHARPEDO}, - {30, 35, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute122_FishingMonsInfo = {30, gRoute122_FishingMons}; - -const struct WildPokemon gRoute123_LandMons[] = -{ - {26, 26, SPECIES_POOCHYENA}, - {26, 26, SPECIES_SHUPPET}, - {26, 26, SPECIES_MIGHTYENA}, - {28, 28, SPECIES_SHUPPET}, - {28, 28, SPECIES_MIGHTYENA}, - {26, 26, SPECIES_ODDISH}, - {28, 28, SPECIES_ODDISH}, - {28, 28, SPECIES_GLOOM}, - {26, 26, SPECIES_WINGULL}, - {27, 27, SPECIES_WINGULL}, - {28, 28, SPECIES_WINGULL}, - {25, 25, SPECIES_KECLEON}, -}; - -const struct WildPokemonInfo gRoute123_LandMonsInfo = {20, gRoute123_LandMons}; - -const struct WildPokemon gRoute123_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute123_WaterMonsInfo = {4, gRoute123_WaterMons}; - -const struct WildPokemon gRoute123_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_WAILMER}, - {20, 25, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute123_FishingMonsInfo = {30, gRoute123_FishingMons}; - -const struct WildPokemon gMtPyre_2F_LandMons[] = -{ - {27, 27, SPECIES_SHUPPET}, - {28, 28, SPECIES_SHUPPET}, - {26, 26, SPECIES_SHUPPET}, - {25, 25, SPECIES_SHUPPET}, - {29, 29, SPECIES_SHUPPET}, - {24, 24, SPECIES_SHUPPET}, - {23, 23, SPECIES_SHUPPET}, - {22, 22, SPECIES_SHUPPET}, - {29, 29, SPECIES_SHUPPET}, - {24, 24, SPECIES_SHUPPET}, - {29, 29, SPECIES_SHUPPET}, - {24, 24, SPECIES_SHUPPET}, -}; - -const struct WildPokemonInfo gMtPyre_2F_LandMonsInfo = {10, gMtPyre_2F_LandMons}; - -const struct WildPokemon gMtPyre_3F_LandMons[] = -{ - {27, 27, SPECIES_SHUPPET}, - {28, 28, SPECIES_SHUPPET}, - {26, 26, SPECIES_SHUPPET}, - {25, 25, SPECIES_SHUPPET}, - {29, 29, SPECIES_SHUPPET}, - {24, 24, SPECIES_SHUPPET}, - {23, 23, SPECIES_SHUPPET}, - {22, 22, SPECIES_SHUPPET}, - {29, 29, SPECIES_SHUPPET}, - {24, 24, SPECIES_SHUPPET}, - {29, 29, SPECIES_SHUPPET}, - {24, 24, SPECIES_SHUPPET}, -}; - -const struct WildPokemonInfo gMtPyre_3F_LandMonsInfo = {10, gMtPyre_3F_LandMons}; - -const struct WildPokemon gMtPyre_4F_LandMons[] = -{ - {27, 27, SPECIES_SHUPPET}, - {28, 28, SPECIES_SHUPPET}, - {26, 26, SPECIES_SHUPPET}, - {25, 25, SPECIES_SHUPPET}, - {29, 29, SPECIES_SHUPPET}, - {24, 24, SPECIES_SHUPPET}, - {23, 23, SPECIES_SHUPPET}, - {22, 22, SPECIES_SHUPPET}, - {27, 27, SPECIES_DUSKULL}, - {27, 27, SPECIES_DUSKULL}, - {25, 25, SPECIES_DUSKULL}, - {29, 29, SPECIES_DUSKULL}, -}; - -const struct WildPokemonInfo gMtPyre_4F_LandMonsInfo = {10, gMtPyre_4F_LandMons}; - -const struct WildPokemon gMtPyre_5F_LandMons[] = -{ - {27, 27, SPECIES_SHUPPET}, - {28, 28, SPECIES_SHUPPET}, - {26, 26, SPECIES_SHUPPET}, - {25, 25, SPECIES_SHUPPET}, - {29, 29, SPECIES_SHUPPET}, - {24, 24, SPECIES_SHUPPET}, - {23, 23, SPECIES_SHUPPET}, - {22, 22, SPECIES_SHUPPET}, - {27, 27, SPECIES_DUSKULL}, - {27, 27, SPECIES_DUSKULL}, - {25, 25, SPECIES_DUSKULL}, - {29, 29, SPECIES_DUSKULL}, -}; - -const struct WildPokemonInfo gMtPyre_5F_LandMonsInfo = {10, gMtPyre_5F_LandMons}; - -const struct WildPokemon gMtPyre_6F_LandMons[] = -{ - {27, 27, SPECIES_SHUPPET}, - {28, 28, SPECIES_SHUPPET}, - {26, 26, SPECIES_SHUPPET}, - {25, 25, SPECIES_SHUPPET}, - {29, 29, SPECIES_SHUPPET}, - {24, 24, SPECIES_SHUPPET}, - {23, 23, SPECIES_SHUPPET}, - {22, 22, SPECIES_SHUPPET}, - {27, 27, SPECIES_DUSKULL}, - {27, 27, SPECIES_DUSKULL}, - {25, 25, SPECIES_DUSKULL}, - {29, 29, SPECIES_DUSKULL}, -}; - -const struct WildPokemonInfo gMtPyre_6F_LandMonsInfo = {10, gMtPyre_6F_LandMons}; - -const struct WildPokemon gMtPyre_Exterior_LandMons[] = -{ - {27, 27, SPECIES_SHUPPET}, - {27, 27, SPECIES_SHUPPET}, - {28, 28, SPECIES_SHUPPET}, - {29, 29, SPECIES_SHUPPET}, - {29, 29, SPECIES_VULPIX}, - {27, 27, SPECIES_VULPIX}, - {29, 29, SPECIES_VULPIX}, - {25, 25, SPECIES_VULPIX}, - {27, 27, SPECIES_WINGULL}, - {27, 27, SPECIES_WINGULL}, - {26, 26, SPECIES_WINGULL}, - {28, 28, SPECIES_WINGULL}, -}; - -const struct WildPokemonInfo gMtPyre_Exterior_LandMonsInfo = {10, gMtPyre_Exterior_LandMons}; - -const struct WildPokemon gMtPyre_Summit_LandMons[] = -{ - {28, 28, SPECIES_SHUPPET}, - {29, 29, SPECIES_SHUPPET}, - {27, 27, SPECIES_SHUPPET}, - {26, 26, SPECIES_SHUPPET}, - {30, 30, SPECIES_SHUPPET}, - {25, 25, SPECIES_SHUPPET}, - {24, 24, SPECIES_SHUPPET}, - {28, 28, SPECIES_DUSKULL}, - {26, 26, SPECIES_DUSKULL}, - {30, 30, SPECIES_DUSKULL}, - {28, 28, SPECIES_CHIMECHO}, - {28, 28, SPECIES_CHIMECHO}, -}; - -const struct WildPokemonInfo gMtPyre_Summit_LandMonsInfo = {10, gMtPyre_Summit_LandMons}; - -const struct WildPokemon gGraniteCave_StevensRoom_LandMons[] = -{ - {7, 7, SPECIES_ZUBAT}, - {8, 8, SPECIES_MAKUHITA}, - {7, 7, SPECIES_MAKUHITA}, - {8, 8, SPECIES_ZUBAT}, - {9, 9, SPECIES_MAKUHITA}, - {8, 8, SPECIES_ABRA}, - {10, 10, SPECIES_MAKUHITA}, - {6, 6, SPECIES_MAKUHITA}, - {7, 7, SPECIES_ARON}, - {8, 8, SPECIES_ARON}, - {7, 7, SPECIES_ARON}, - {8, 8, SPECIES_ARON}, -}; - -const struct WildPokemonInfo gGraniteCave_StevensRoom_LandMonsInfo = {10, gGraniteCave_StevensRoom_LandMons}; - -const struct WildPokemon gRoute125_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute125_WaterMonsInfo = {4, gRoute125_WaterMons}; - -const struct WildPokemon gRoute125_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_SHARPEDO}, - {30, 35, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute125_FishingMonsInfo = {30, gRoute125_FishingMons}; - -const struct WildPokemon gRoute126_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute126_WaterMonsInfo = {4, gRoute126_WaterMons}; - -const struct WildPokemon gRoute126_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_SHARPEDO}, - {30, 35, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute126_FishingMonsInfo = {30, gRoute126_FishingMons}; - -const struct WildPokemon gRoute127_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute127_WaterMonsInfo = {4, gRoute127_WaterMons}; - -const struct WildPokemon gRoute127_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_SHARPEDO}, - {30, 35, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute127_FishingMonsInfo = {30, gRoute127_FishingMons}; - -const struct WildPokemon gRoute128_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute128_WaterMonsInfo = {4, gRoute128_WaterMons}; - -const struct WildPokemon gRoute128_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_LUVDISC}, - {10, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_LUVDISC}, - {30, 35, SPECIES_WAILMER}, - {30, 35, SPECIES_CORSOLA}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute128_FishingMonsInfo = {30, gRoute128_FishingMons}; - -const struct WildPokemon gRoute129_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_WAILORD}, -}; - -const struct WildPokemonInfo gRoute129_WaterMonsInfo = {4, gRoute129_WaterMons}; - -const struct WildPokemon gRoute129_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_SHARPEDO}, - {30, 35, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute129_FishingMonsInfo = {30, gRoute129_FishingMons}; - -const struct WildPokemon gRoute130_LandMons[] = -{ - {30, 30, SPECIES_WYNAUT}, - {35, 35, SPECIES_WYNAUT}, - {25, 25, SPECIES_WYNAUT}, - {40, 40, SPECIES_WYNAUT}, - {20, 20, SPECIES_WYNAUT}, - {45, 45, SPECIES_WYNAUT}, - {15, 15, SPECIES_WYNAUT}, - {50, 50, SPECIES_WYNAUT}, - {10, 10, SPECIES_WYNAUT}, - {5, 5, SPECIES_WYNAUT}, - {10, 10, SPECIES_WYNAUT}, - {5, 5, SPECIES_WYNAUT}, -}; - -const struct WildPokemonInfo gRoute130_LandMonsInfo = {20, gRoute130_LandMons}; - -const struct WildPokemon gRoute130_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute130_WaterMonsInfo = {4, gRoute130_WaterMons}; - -const struct WildPokemon gRoute130_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_SHARPEDO}, - {30, 35, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute130_FishingMonsInfo = {30, gRoute130_FishingMons}; - -const struct WildPokemon gRoute131_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute131_WaterMonsInfo = {4, gRoute131_WaterMons}; - -const struct WildPokemon gRoute131_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_SHARPEDO}, - {30, 35, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute131_FishingMonsInfo = {30, gRoute131_FishingMons}; - -const struct WildPokemon gRoute132_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute132_WaterMonsInfo = {4, gRoute132_WaterMons}; - -const struct WildPokemon gRoute132_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_SHARPEDO}, - {30, 35, SPECIES_WAILMER}, - {25, 30, SPECIES_HORSEA}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute132_FishingMonsInfo = {30, gRoute132_FishingMons}; - -const struct WildPokemon gRoute133_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute133_WaterMonsInfo = {4, gRoute133_WaterMons}; - -const struct WildPokemon gRoute133_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_SHARPEDO}, - {30, 35, SPECIES_WAILMER}, - {25, 30, SPECIES_HORSEA}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute133_FishingMonsInfo = {30, gRoute133_FishingMons}; - -const struct WildPokemon gRoute134_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gRoute134_WaterMonsInfo = {4, gRoute134_WaterMons}; - -const struct WildPokemon gRoute134_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_SHARPEDO}, - {30, 35, SPECIES_WAILMER}, - {25, 30, SPECIES_HORSEA}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gRoute134_FishingMonsInfo = {30, gRoute134_FishingMons}; - -const struct WildPokemon gAbandonedShip_HiddenFloorCorridors_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {5, 35, SPECIES_TENTACOOL}, - {5, 35, SPECIES_TENTACOOL}, - {5, 35, SPECIES_TENTACOOL}, - {30, 35, SPECIES_TENTACRUEL}, -}; - -const struct WildPokemonInfo gAbandonedShip_HiddenFloorCorridors_WaterMonsInfo = {4, gAbandonedShip_HiddenFloorCorridors_WaterMons}; - -const struct WildPokemon gAbandonedShip_HiddenFloorCorridors_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_TENTACOOL}, - {25, 30, SPECIES_TENTACOOL}, - {30, 35, SPECIES_TENTACOOL}, - {30, 35, SPECIES_TENTACRUEL}, - {25, 30, SPECIES_TENTACRUEL}, - {20, 25, SPECIES_TENTACRUEL}, -}; - -const struct WildPokemonInfo gAbandonedShip_HiddenFloorCorridors_FishingMonsInfo = {20, gAbandonedShip_HiddenFloorCorridors_FishingMons}; - -const struct WildPokemon gSeafloorCavern_Room1_LandMons[] = -{ - {30, 30, SPECIES_ZUBAT}, - {31, 31, SPECIES_ZUBAT}, - {32, 32, SPECIES_ZUBAT}, - {33, 33, SPECIES_ZUBAT}, - {28, 28, SPECIES_ZUBAT}, - {29, 29, SPECIES_ZUBAT}, - {34, 34, SPECIES_ZUBAT}, - {35, 35, SPECIES_ZUBAT}, - {34, 34, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {33, 33, SPECIES_GOLBAT}, - {36, 36, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gSeafloorCavern_Room1_LandMonsInfo = {4, gSeafloorCavern_Room1_LandMons}; - -const struct WildPokemon gSeafloorCavern_Room2_LandMons[] = -{ - {30, 30, SPECIES_ZUBAT}, - {31, 31, SPECIES_ZUBAT}, - {32, 32, SPECIES_ZUBAT}, - {33, 33, SPECIES_ZUBAT}, - {28, 28, SPECIES_ZUBAT}, - {29, 29, SPECIES_ZUBAT}, - {34, 34, SPECIES_ZUBAT}, - {35, 35, SPECIES_ZUBAT}, - {34, 34, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {33, 33, SPECIES_GOLBAT}, - {36, 36, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gSeafloorCavern_Room2_LandMonsInfo = {4, gSeafloorCavern_Room2_LandMons}; - -const struct WildPokemon gSeafloorCavern_Room3_LandMons[] = -{ - {30, 30, SPECIES_ZUBAT}, - {31, 31, SPECIES_ZUBAT}, - {32, 32, SPECIES_ZUBAT}, - {33, 33, SPECIES_ZUBAT}, - {28, 28, SPECIES_ZUBAT}, - {29, 29, SPECIES_ZUBAT}, - {34, 34, SPECIES_ZUBAT}, - {35, 35, SPECIES_ZUBAT}, - {34, 34, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {33, 33, SPECIES_GOLBAT}, - {36, 36, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gSeafloorCavern_Room3_LandMonsInfo = {4, gSeafloorCavern_Room3_LandMons}; - -const struct WildPokemon gSeafloorCavern_Room4_LandMons[] = -{ - {30, 30, SPECIES_ZUBAT}, - {31, 31, SPECIES_ZUBAT}, - {32, 32, SPECIES_ZUBAT}, - {33, 33, SPECIES_ZUBAT}, - {28, 28, SPECIES_ZUBAT}, - {29, 29, SPECIES_ZUBAT}, - {34, 34, SPECIES_ZUBAT}, - {35, 35, SPECIES_ZUBAT}, - {34, 34, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {33, 33, SPECIES_GOLBAT}, - {36, 36, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gSeafloorCavern_Room4_LandMonsInfo = {4, gSeafloorCavern_Room4_LandMons}; - -const struct WildPokemon gSeafloorCavern_Room5_LandMons[] = -{ - {30, 30, SPECIES_ZUBAT}, - {31, 31, SPECIES_ZUBAT}, - {32, 32, SPECIES_ZUBAT}, - {33, 33, SPECIES_ZUBAT}, - {28, 28, SPECIES_ZUBAT}, - {29, 29, SPECIES_ZUBAT}, - {34, 34, SPECIES_ZUBAT}, - {35, 35, SPECIES_ZUBAT}, - {34, 34, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {33, 33, SPECIES_GOLBAT}, - {36, 36, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gSeafloorCavern_Room5_LandMonsInfo = {4, gSeafloorCavern_Room5_LandMons}; - -const struct WildPokemon gSeafloorCavern_Room6_LandMons[] = -{ - {30, 30, SPECIES_ZUBAT}, - {31, 31, SPECIES_ZUBAT}, - {32, 32, SPECIES_ZUBAT}, - {33, 33, SPECIES_ZUBAT}, - {28, 28, SPECIES_ZUBAT}, - {29, 29, SPECIES_ZUBAT}, - {34, 34, SPECIES_ZUBAT}, - {35, 35, SPECIES_ZUBAT}, - {34, 34, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {33, 33, SPECIES_GOLBAT}, - {36, 36, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gSeafloorCavern_Room6_LandMonsInfo = {4, gSeafloorCavern_Room6_LandMons}; - -const struct WildPokemon gSeafloorCavern_Room6_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {5, 35, SPECIES_ZUBAT}, - {30, 35, SPECIES_ZUBAT}, - {30, 35, SPECIES_GOLBAT}, - {30, 35, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gSeafloorCavern_Room6_WaterMonsInfo = {4, gSeafloorCavern_Room6_WaterMons}; - -const struct WildPokemon gSeafloorCavern_Room6_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_WAILMER}, - {20, 25, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gSeafloorCavern_Room6_FishingMonsInfo = {10, gSeafloorCavern_Room6_FishingMons}; - -const struct WildPokemon gSeafloorCavern_Room7_LandMons[] = -{ - {30, 30, SPECIES_ZUBAT}, - {31, 31, SPECIES_ZUBAT}, - {32, 32, SPECIES_ZUBAT}, - {33, 33, SPECIES_ZUBAT}, - {28, 28, SPECIES_ZUBAT}, - {29, 29, SPECIES_ZUBAT}, - {34, 34, SPECIES_ZUBAT}, - {35, 35, SPECIES_ZUBAT}, - {34, 34, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {33, 33, SPECIES_GOLBAT}, - {36, 36, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gSeafloorCavern_Room7_LandMonsInfo = {4, gSeafloorCavern_Room7_LandMons}; - -const struct WildPokemon gSeafloorCavern_Room7_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {5, 35, SPECIES_ZUBAT}, - {30, 35, SPECIES_ZUBAT}, - {30, 35, SPECIES_GOLBAT}, - {30, 35, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gSeafloorCavern_Room7_WaterMonsInfo = {4, gSeafloorCavern_Room7_WaterMons}; - -const struct WildPokemon gSeafloorCavern_Room7_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_WAILMER}, - {20, 25, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gSeafloorCavern_Room7_FishingMonsInfo = {10, gSeafloorCavern_Room7_FishingMons}; - -const struct WildPokemon gSeafloorCavern_Room8_LandMons[] = -{ - {30, 30, SPECIES_ZUBAT}, - {31, 31, SPECIES_ZUBAT}, - {32, 32, SPECIES_ZUBAT}, - {33, 33, SPECIES_ZUBAT}, - {28, 28, SPECIES_ZUBAT}, - {29, 29, SPECIES_ZUBAT}, - {34, 34, SPECIES_ZUBAT}, - {35, 35, SPECIES_ZUBAT}, - {34, 34, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {33, 33, SPECIES_GOLBAT}, - {36, 36, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gSeafloorCavern_Room8_LandMonsInfo = {4, gSeafloorCavern_Room8_LandMons}; - -const struct WildPokemon gSeafloorCavern_Entrance_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {5, 35, SPECIES_ZUBAT}, - {30, 35, SPECIES_ZUBAT}, - {30, 35, SPECIES_GOLBAT}, - {30, 35, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gSeafloorCavern_Entrance_WaterMonsInfo = {4, gSeafloorCavern_Entrance_WaterMons}; - -const struct WildPokemon gSeafloorCavern_Entrance_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_WAILMER}, - {20, 25, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gSeafloorCavern_Entrance_FishingMonsInfo = {10, gSeafloorCavern_Entrance_FishingMons}; - -const struct WildPokemon gCaveOfOrigin_Entrance_LandMons[] = -{ - {30, 30, SPECIES_ZUBAT}, - {31, 31, SPECIES_ZUBAT}, - {32, 32, SPECIES_ZUBAT}, - {33, 33, SPECIES_ZUBAT}, - {28, 28, SPECIES_ZUBAT}, - {29, 29, SPECIES_ZUBAT}, - {34, 34, SPECIES_ZUBAT}, - {35, 35, SPECIES_ZUBAT}, - {34, 34, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {33, 33, SPECIES_GOLBAT}, - {36, 36, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gCaveOfOrigin_Entrance_LandMonsInfo = {4, gCaveOfOrigin_Entrance_LandMons}; - -const struct WildPokemon gCaveOfOrigin_1F_LandMons[] = -{ - {30, 30, SPECIES_ZUBAT}, - {31, 31, SPECIES_ZUBAT}, - {32, 32, SPECIES_ZUBAT}, - {30, 30, SPECIES_SABLEYE}, - {32, 32, SPECIES_SABLEYE}, - {34, 34, SPECIES_SABLEYE}, - {33, 33, SPECIES_ZUBAT}, - {34, 34, SPECIES_ZUBAT}, - {34, 34, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {33, 33, SPECIES_GOLBAT}, - {36, 36, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gCaveOfOrigin_1F_LandMonsInfo = {4, gCaveOfOrigin_1F_LandMons}; - -const struct WildPokemon gCaveOfOrigin_UnusedRubySapphireMap1_LandMons[] = -{ - {30, 30, SPECIES_ZUBAT}, - {31, 31, SPECIES_ZUBAT}, - {32, 32, SPECIES_ZUBAT}, - {30, 30, SPECIES_SABLEYE}, - {32, 32, SPECIES_SABLEYE}, - {34, 34, SPECIES_SABLEYE}, - {33, 33, SPECIES_ZUBAT}, - {34, 34, SPECIES_ZUBAT}, - {34, 34, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {33, 33, SPECIES_GOLBAT}, - {36, 36, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gCaveOfOrigin_UnusedRubySapphireMap1_LandMonsInfo = {4, gCaveOfOrigin_UnusedRubySapphireMap1_LandMons}; - -const struct WildPokemon gCaveOfOrigin_UnusedRubySapphireMap2_LandMons[] = -{ - {30, 30, SPECIES_ZUBAT}, - {31, 31, SPECIES_ZUBAT}, - {32, 32, SPECIES_ZUBAT}, - {30, 30, SPECIES_SABLEYE}, - {32, 32, SPECIES_SABLEYE}, - {34, 34, SPECIES_SABLEYE}, - {33, 33, SPECIES_ZUBAT}, - {34, 34, SPECIES_ZUBAT}, - {34, 34, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {33, 33, SPECIES_GOLBAT}, - {36, 36, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gCaveOfOrigin_UnusedRubySapphireMap2_LandMonsInfo = {4, gCaveOfOrigin_UnusedRubySapphireMap2_LandMons}; - -const struct WildPokemon gCaveOfOrigin_UnusedRubySapphireMap3_LandMons[] = -{ - {30, 30, SPECIES_ZUBAT}, - {31, 31, SPECIES_ZUBAT}, - {32, 32, SPECIES_ZUBAT}, - {30, 30, SPECIES_SABLEYE}, - {32, 32, SPECIES_SABLEYE}, - {34, 34, SPECIES_SABLEYE}, - {33, 33, SPECIES_ZUBAT}, - {34, 34, SPECIES_ZUBAT}, - {34, 34, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {33, 33, SPECIES_GOLBAT}, - {36, 36, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gCaveOfOrigin_UnusedRubySapphireMap3_LandMonsInfo = {4, gCaveOfOrigin_UnusedRubySapphireMap3_LandMons}; - -const struct WildPokemon gNewMauville_Entrance_LandMons[] = -{ - {24, 24, SPECIES_VOLTORB}, - {24, 24, SPECIES_MAGNEMITE}, - {25, 25, SPECIES_VOLTORB}, - {25, 25, SPECIES_MAGNEMITE}, - {23, 23, SPECIES_VOLTORB}, - {23, 23, SPECIES_MAGNEMITE}, - {26, 26, SPECIES_VOLTORB}, - {26, 26, SPECIES_MAGNEMITE}, - {22, 22, SPECIES_VOLTORB}, - {22, 22, SPECIES_MAGNEMITE}, - {22, 22, SPECIES_VOLTORB}, - {22, 22, SPECIES_MAGNEMITE}, -}; - -const struct WildPokemonInfo gNewMauville_Entrance_LandMonsInfo = {10, gNewMauville_Entrance_LandMons}; - -const struct WildPokemon gSafariZone_Southwest_LandMons[] = -{ - {25, 25, SPECIES_ODDISH}, - {27, 27, SPECIES_ODDISH}, - {25, 25, SPECIES_GIRAFARIG}, - {27, 27, SPECIES_GIRAFARIG}, - {25, 25, SPECIES_NATU}, - {27, 27, SPECIES_DODUO}, - {25, 25, SPECIES_GLOOM}, - {27, 27, SPECIES_WOBBUFFET}, - {25, 25, SPECIES_PIKACHU}, - {27, 27, SPECIES_WOBBUFFET}, - {27, 27, SPECIES_PIKACHU}, - {29, 29, SPECIES_WOBBUFFET}, -}; - -const struct WildPokemonInfo gSafariZone_Southwest_LandMonsInfo = {25, gSafariZone_Southwest_LandMons}; - -const struct WildPokemon gSafariZone_Southwest_WaterMons[] = -{ - {20, 30, SPECIES_PSYDUCK}, - {20, 30, SPECIES_PSYDUCK}, - {30, 35, SPECIES_PSYDUCK}, - {30, 35, SPECIES_PSYDUCK}, - {30, 35, SPECIES_PSYDUCK}, -}; - -const struct WildPokemonInfo gSafariZone_Southwest_WaterMonsInfo = {9, gSafariZone_Southwest_WaterMons}; - -const struct WildPokemon gSafariZone_Southwest_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_GOLDEEN}, - {10, 30, SPECIES_MAGIKARP}, - {10, 25, SPECIES_GOLDEEN}, - {10, 30, SPECIES_GOLDEEN}, - {25, 30, SPECIES_GOLDEEN}, - {30, 35, SPECIES_GOLDEEN}, - {30, 35, SPECIES_SEAKING}, - {35, 40, SPECIES_SEAKING}, - {25, 30, SPECIES_SEAKING}, -}; - -const struct WildPokemonInfo gSafariZone_Southwest_FishingMonsInfo = {35, gSafariZone_Southwest_FishingMons}; - -const struct WildPokemon gSafariZone_North_LandMons[] = -{ - {27, 27, SPECIES_PHANPY}, - {27, 27, SPECIES_ODDISH}, - {29, 29, SPECIES_PHANPY}, - {29, 29, SPECIES_ODDISH}, - {27, 27, SPECIES_NATU}, - {29, 29, SPECIES_GLOOM}, - {31, 31, SPECIES_GLOOM}, - {29, 29, SPECIES_NATU}, - {29, 29, SPECIES_XATU}, - {27, 27, SPECIES_HERACROSS}, - {31, 31, SPECIES_XATU}, - {29, 29, SPECIES_HERACROSS}, -}; - -const struct WildPokemonInfo gSafariZone_North_LandMonsInfo = {25, gSafariZone_North_LandMons}; - -const struct WildPokemon gSafariZone_North_RockSmashMons[] = -{ - {10, 15, SPECIES_GEODUDE}, - {5, 10, SPECIES_GEODUDE}, - {15, 20, SPECIES_GEODUDE}, - {20, 25, SPECIES_GEODUDE}, - {25, 30, SPECIES_GEODUDE}, -}; - -const struct WildPokemonInfo gSafariZone_North_RockSmashMonsInfo = {25, gSafariZone_North_RockSmashMons}; - -const struct WildPokemon gSafariZone_Northwest_LandMons[] = -{ - {27, 27, SPECIES_RHYHORN}, - {27, 27, SPECIES_ODDISH}, - {29, 29, SPECIES_RHYHORN}, - {29, 29, SPECIES_ODDISH}, - {27, 27, SPECIES_DODUO}, - {29, 29, SPECIES_GLOOM}, - {31, 31, SPECIES_GLOOM}, - {29, 29, SPECIES_DODUO}, - {29, 29, SPECIES_DODRIO}, - {27, 27, SPECIES_PINSIR}, - {31, 31, SPECIES_DODRIO}, - {29, 29, SPECIES_PINSIR}, -}; - -const struct WildPokemonInfo gSafariZone_Northwest_LandMonsInfo = {25, gSafariZone_Northwest_LandMons}; - -const struct WildPokemon gSafariZone_Northwest_WaterMons[] = -{ - {20, 30, SPECIES_PSYDUCK}, - {20, 30, SPECIES_PSYDUCK}, - {30, 35, SPECIES_PSYDUCK}, - {30, 35, SPECIES_GOLDUCK}, - {25, 40, SPECIES_GOLDUCK}, -}; - -const struct WildPokemonInfo gSafariZone_Northwest_WaterMonsInfo = {9, gSafariZone_Northwest_WaterMons}; - -const struct WildPokemon gSafariZone_Northwest_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_GOLDEEN}, - {10, 30, SPECIES_MAGIKARP}, - {10, 25, SPECIES_GOLDEEN}, - {10, 30, SPECIES_GOLDEEN}, - {25, 30, SPECIES_GOLDEEN}, - {30, 35, SPECIES_GOLDEEN}, - {30, 35, SPECIES_SEAKING}, - {35, 40, SPECIES_SEAKING}, - {25, 30, SPECIES_SEAKING}, -}; - -const struct WildPokemonInfo gSafariZone_Northwest_FishingMonsInfo = {35, gSafariZone_Northwest_FishingMons}; - -const struct WildPokemon gVictoryRoad_B1F_LandMons[] = -{ - {40, 40, SPECIES_GOLBAT}, - {40, 40, SPECIES_HARIYAMA}, - {40, 40, SPECIES_LAIRON}, - {40, 40, SPECIES_LAIRON}, - {38, 38, SPECIES_GOLBAT}, - {38, 38, SPECIES_HARIYAMA}, - {42, 42, SPECIES_GOLBAT}, - {42, 42, SPECIES_HARIYAMA}, - {42, 42, SPECIES_LAIRON}, - {38, 38, SPECIES_MAWILE}, - {42, 42, SPECIES_LAIRON}, - {38, 38, SPECIES_MAWILE}, -}; - -const struct WildPokemonInfo gVictoryRoad_B1F_LandMonsInfo = {10, gVictoryRoad_B1F_LandMons}; - -const struct WildPokemon gVictoryRoad_B1F_RockSmashMons[] = -{ - {30, 40, SPECIES_GRAVELER}, - {30, 40, SPECIES_GEODUDE}, - {35, 40, SPECIES_GRAVELER}, - {35, 40, SPECIES_GRAVELER}, - {35, 40, SPECIES_GRAVELER}, -}; - -const struct WildPokemonInfo gVictoryRoad_B1F_RockSmashMonsInfo = {20, gVictoryRoad_B1F_RockSmashMons}; - -const struct WildPokemon gVictoryRoad_B2F_LandMons[] = -{ - {40, 40, SPECIES_GOLBAT}, - {40, 40, SPECIES_SABLEYE}, - {40, 40, SPECIES_LAIRON}, - {40, 40, SPECIES_LAIRON}, - {42, 42, SPECIES_GOLBAT}, - {42, 42, SPECIES_SABLEYE}, - {44, 44, SPECIES_GOLBAT}, - {44, 44, SPECIES_SABLEYE}, - {42, 42, SPECIES_LAIRON}, - {42, 42, SPECIES_MAWILE}, - {44, 44, SPECIES_LAIRON}, - {44, 44, SPECIES_MAWILE}, -}; - -const struct WildPokemonInfo gVictoryRoad_B2F_LandMonsInfo = {10, gVictoryRoad_B2F_LandMons}; - -const struct WildPokemon gVictoryRoad_B2F_WaterMons[] = -{ - {30, 35, SPECIES_GOLBAT}, - {25, 30, SPECIES_GOLBAT}, - {35, 40, SPECIES_GOLBAT}, - {35, 40, SPECIES_GOLBAT}, - {35, 40, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gVictoryRoad_B2F_WaterMonsInfo = {4, gVictoryRoad_B2F_WaterMons}; - -const struct WildPokemon gVictoryRoad_B2F_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_GOLDEEN}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_GOLDEEN}, - {10, 30, SPECIES_BARBOACH}, - {25, 30, SPECIES_BARBOACH}, - {30, 35, SPECIES_BARBOACH}, - {30, 35, SPECIES_WHISCASH}, - {35, 40, SPECIES_WHISCASH}, - {40, 45, SPECIES_WHISCASH}, -}; - -const struct WildPokemonInfo gVictoryRoad_B2F_FishingMonsInfo = {30, gVictoryRoad_B2F_FishingMons}; - -const struct WildPokemon gMeteorFalls_1F_1R_LandMons[] = -{ - {16, 16, SPECIES_ZUBAT}, - {17, 17, SPECIES_ZUBAT}, - {18, 18, SPECIES_ZUBAT}, - {15, 15, SPECIES_ZUBAT}, - {14, 14, SPECIES_ZUBAT}, - {16, 16, SPECIES_SOLROCK}, - {18, 18, SPECIES_SOLROCK}, - {14, 14, SPECIES_SOLROCK}, - {19, 19, SPECIES_ZUBAT}, - {20, 20, SPECIES_ZUBAT}, - {19, 19, SPECIES_ZUBAT}, - {20, 20, SPECIES_ZUBAT}, -}; - -const struct WildPokemonInfo gMeteorFalls_1F_1R_LandMonsInfo = {10, gMeteorFalls_1F_1R_LandMons}; - -const struct WildPokemon gMeteorFalls_1F_1R_WaterMons[] = -{ - {5, 35, SPECIES_ZUBAT}, - {30, 35, SPECIES_ZUBAT}, - {25, 35, SPECIES_SOLROCK}, - {15, 25, SPECIES_SOLROCK}, - {5, 15, SPECIES_SOLROCK}, -}; - -const struct WildPokemonInfo gMeteorFalls_1F_1R_WaterMonsInfo = {4, gMeteorFalls_1F_1R_WaterMons}; - -const struct WildPokemon gMeteorFalls_1F_1R_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_GOLDEEN}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_GOLDEEN}, - {10, 30, SPECIES_BARBOACH}, - {25, 30, SPECIES_BARBOACH}, - {30, 35, SPECIES_BARBOACH}, - {20, 25, SPECIES_BARBOACH}, - {35, 40, SPECIES_BARBOACH}, - {40, 45, SPECIES_BARBOACH}, -}; - -const struct WildPokemonInfo gMeteorFalls_1F_1R_FishingMonsInfo = {30, gMeteorFalls_1F_1R_FishingMons}; - -const struct WildPokemon gMeteorFalls_1F_2R_LandMons[] = -{ - {33, 33, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {33, 33, SPECIES_GOLBAT}, - {35, 35, SPECIES_SOLROCK}, - {33, 33, SPECIES_SOLROCK}, - {37, 37, SPECIES_SOLROCK}, - {35, 35, SPECIES_GOLBAT}, - {39, 39, SPECIES_SOLROCK}, - {38, 38, SPECIES_GOLBAT}, - {40, 40, SPECIES_GOLBAT}, - {38, 38, SPECIES_GOLBAT}, - {40, 40, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gMeteorFalls_1F_2R_LandMonsInfo = {10, gMeteorFalls_1F_2R_LandMons}; - -const struct WildPokemon gMeteorFalls_1F_2R_WaterMons[] = -{ - {30, 35, SPECIES_GOLBAT}, - {30, 35, SPECIES_GOLBAT}, - {25, 35, SPECIES_SOLROCK}, - {15, 25, SPECIES_SOLROCK}, - {5, 15, SPECIES_SOLROCK}, -}; - -const struct WildPokemonInfo gMeteorFalls_1F_2R_WaterMonsInfo = {4, gMeteorFalls_1F_2R_WaterMons}; - -const struct WildPokemon gMeteorFalls_1F_2R_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_GOLDEEN}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_GOLDEEN}, - {10, 30, SPECIES_BARBOACH}, - {25, 30, SPECIES_BARBOACH}, - {30, 35, SPECIES_BARBOACH}, - {30, 35, SPECIES_WHISCASH}, - {35, 40, SPECIES_WHISCASH}, - {40, 45, SPECIES_WHISCASH}, -}; - -const struct WildPokemonInfo gMeteorFalls_1F_2R_FishingMonsInfo = {30, gMeteorFalls_1F_2R_FishingMons}; - -const struct WildPokemon gMeteorFalls_B1F_1R_LandMons[] = -{ - {33, 33, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {33, 33, SPECIES_GOLBAT}, - {35, 35, SPECIES_SOLROCK}, - {33, 33, SPECIES_SOLROCK}, - {37, 37, SPECIES_SOLROCK}, - {35, 35, SPECIES_GOLBAT}, - {39, 39, SPECIES_SOLROCK}, - {38, 38, SPECIES_GOLBAT}, - {40, 40, SPECIES_GOLBAT}, - {38, 38, SPECIES_GOLBAT}, - {40, 40, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gMeteorFalls_B1F_1R_LandMonsInfo = {10, gMeteorFalls_B1F_1R_LandMons}; - -const struct WildPokemon gMeteorFalls_B1F_1R_WaterMons[] = -{ - {30, 35, SPECIES_GOLBAT}, - {30, 35, SPECIES_GOLBAT}, - {25, 35, SPECIES_SOLROCK}, - {15, 25, SPECIES_SOLROCK}, - {5, 15, SPECIES_SOLROCK}, -}; - -const struct WildPokemonInfo gMeteorFalls_B1F_1R_WaterMonsInfo = {4, gMeteorFalls_B1F_1R_WaterMons}; - -const struct WildPokemon gMeteorFalls_B1F_1R_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_GOLDEEN}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_GOLDEEN}, - {10, 30, SPECIES_BARBOACH}, - {25, 30, SPECIES_BARBOACH}, - {30, 35, SPECIES_BARBOACH}, - {30, 35, SPECIES_WHISCASH}, - {35, 40, SPECIES_WHISCASH}, - {40, 45, SPECIES_WHISCASH}, -}; - -const struct WildPokemonInfo gMeteorFalls_B1F_1R_FishingMonsInfo = {30, gMeteorFalls_B1F_1R_FishingMons}; - -const struct WildPokemon gShoalCave_LowTideStairsRoom_LandMons[] = -{ - {26, 26, SPECIES_ZUBAT}, - {26, 26, SPECIES_SPHEAL}, - {28, 28, SPECIES_ZUBAT}, - {28, 28, SPECIES_SPHEAL}, - {30, 30, SPECIES_ZUBAT}, - {30, 30, SPECIES_SPHEAL}, - {32, 32, SPECIES_ZUBAT}, - {32, 32, SPECIES_SPHEAL}, - {32, 32, SPECIES_GOLBAT}, - {32, 32, SPECIES_SPHEAL}, - {32, 32, SPECIES_GOLBAT}, - {32, 32, SPECIES_SPHEAL}, -}; - -const struct WildPokemonInfo gShoalCave_LowTideStairsRoom_LandMonsInfo = {10, gShoalCave_LowTideStairsRoom_LandMons}; - -const struct WildPokemon gShoalCave_LowTideLowerRoom_LandMons[] = -{ - {26, 26, SPECIES_ZUBAT}, - {26, 26, SPECIES_SPHEAL}, - {28, 28, SPECIES_ZUBAT}, - {28, 28, SPECIES_SPHEAL}, - {30, 30, SPECIES_ZUBAT}, - {30, 30, SPECIES_SPHEAL}, - {32, 32, SPECIES_ZUBAT}, - {32, 32, SPECIES_SPHEAL}, - {32, 32, SPECIES_GOLBAT}, - {32, 32, SPECIES_SPHEAL}, - {32, 32, SPECIES_GOLBAT}, - {32, 32, SPECIES_SPHEAL}, -}; - -const struct WildPokemonInfo gShoalCave_LowTideLowerRoom_LandMonsInfo = {10, gShoalCave_LowTideLowerRoom_LandMons}; - -const struct WildPokemon gShoalCave_LowTideInnerRoom_LandMons[] = -{ - {26, 26, SPECIES_ZUBAT}, - {26, 26, SPECIES_SPHEAL}, - {28, 28, SPECIES_ZUBAT}, - {28, 28, SPECIES_SPHEAL}, - {30, 30, SPECIES_ZUBAT}, - {30, 30, SPECIES_SPHEAL}, - {32, 32, SPECIES_ZUBAT}, - {32, 32, SPECIES_SPHEAL}, - {32, 32, SPECIES_GOLBAT}, - {32, 32, SPECIES_SPHEAL}, - {32, 32, SPECIES_GOLBAT}, - {32, 32, SPECIES_SPHEAL}, -}; - -const struct WildPokemonInfo gShoalCave_LowTideInnerRoom_LandMonsInfo = {10, gShoalCave_LowTideInnerRoom_LandMons}; - -const struct WildPokemon gShoalCave_LowTideInnerRoom_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {5, 35, SPECIES_ZUBAT}, - {25, 30, SPECIES_SPHEAL}, - {25, 30, SPECIES_SPHEAL}, - {25, 35, SPECIES_SPHEAL}, -}; - -const struct WildPokemonInfo gShoalCave_LowTideInnerRoom_WaterMonsInfo = {4, gShoalCave_LowTideInnerRoom_WaterMons}; - -const struct WildPokemon gShoalCave_LowTideInnerRoom_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_WAILMER}, - {20, 25, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gShoalCave_LowTideInnerRoom_FishingMonsInfo = {10, gShoalCave_LowTideInnerRoom_FishingMons}; - -const struct WildPokemon gShoalCave_LowTideEntranceRoom_LandMons[] = -{ - {26, 26, SPECIES_ZUBAT}, - {26, 26, SPECIES_SPHEAL}, - {28, 28, SPECIES_ZUBAT}, - {28, 28, SPECIES_SPHEAL}, - {30, 30, SPECIES_ZUBAT}, - {30, 30, SPECIES_SPHEAL}, - {32, 32, SPECIES_ZUBAT}, - {32, 32, SPECIES_SPHEAL}, - {32, 32, SPECIES_GOLBAT}, - {32, 32, SPECIES_SPHEAL}, - {32, 32, SPECIES_GOLBAT}, - {32, 32, SPECIES_SPHEAL}, -}; - -const struct WildPokemonInfo gShoalCave_LowTideEntranceRoom_LandMonsInfo = {10, gShoalCave_LowTideEntranceRoom_LandMons}; - -const struct WildPokemon gShoalCave_LowTideEntranceRoom_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {5, 35, SPECIES_ZUBAT}, - {25, 30, SPECIES_SPHEAL}, - {25, 30, SPECIES_SPHEAL}, - {25, 35, SPECIES_SPHEAL}, -}; - -const struct WildPokemonInfo gShoalCave_LowTideEntranceRoom_WaterMonsInfo = {4, gShoalCave_LowTideEntranceRoom_WaterMons}; - -const struct WildPokemon gShoalCave_LowTideEntranceRoom_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_WAILMER}, - {20, 25, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gShoalCave_LowTideEntranceRoom_FishingMonsInfo = {10, gShoalCave_LowTideEntranceRoom_FishingMons}; - -const struct WildPokemon gLilycoveCity_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gLilycoveCity_WaterMonsInfo = {4, gLilycoveCity_WaterMons}; - -const struct WildPokemon gLilycoveCity_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_WAILMER}, - {25, 30, SPECIES_STARYU}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gLilycoveCity_FishingMonsInfo = {10, gLilycoveCity_FishingMons}; - -const struct WildPokemon gDewfordTown_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gDewfordTown_WaterMonsInfo = {4, gDewfordTown_WaterMons}; - -const struct WildPokemon gDewfordTown_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_WAILMER}, - {20, 25, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gDewfordTown_FishingMonsInfo = {10, gDewfordTown_FishingMons}; - -const struct WildPokemon gSlateportCity_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gSlateportCity_WaterMonsInfo = {4, gSlateportCity_WaterMons}; - -const struct WildPokemon gSlateportCity_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_WAILMER}, - {20, 25, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gSlateportCity_FishingMonsInfo = {10, gSlateportCity_FishingMons}; - -const struct WildPokemon gMossdeepCity_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gMossdeepCity_WaterMonsInfo = {4, gMossdeepCity_WaterMons}; - -const struct WildPokemon gMossdeepCity_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_SHARPEDO}, - {30, 35, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gMossdeepCity_FishingMonsInfo = {10, gMossdeepCity_FishingMons}; - -const struct WildPokemon gPacifidlogTown_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gPacifidlogTown_WaterMonsInfo = {4, gPacifidlogTown_WaterMons}; - -const struct WildPokemon gPacifidlogTown_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_SHARPEDO}, - {30, 35, SPECIES_WAILMER}, - {25, 30, SPECIES_WAILMER}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gPacifidlogTown_FishingMonsInfo = {10, gPacifidlogTown_FishingMons}; - -const struct WildPokemon gEverGrandeCity_WaterMons[] = -{ - {5, 35, SPECIES_TENTACOOL}, - {10, 30, SPECIES_WINGULL}, - {15, 25, SPECIES_WINGULL}, - {25, 30, SPECIES_PELIPPER}, - {25, 30, SPECIES_PELIPPER}, -}; - -const struct WildPokemonInfo gEverGrandeCity_WaterMonsInfo = {4, gEverGrandeCity_WaterMons}; - -const struct WildPokemon gEverGrandeCity_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_LUVDISC}, - {10, 30, SPECIES_WAILMER}, - {30, 35, SPECIES_LUVDISC}, - {30, 35, SPECIES_WAILMER}, - {30, 35, SPECIES_CORSOLA}, - {35, 40, SPECIES_WAILMER}, - {40, 45, SPECIES_WAILMER}, -}; - -const struct WildPokemonInfo gEverGrandeCity_FishingMonsInfo = {10, gEverGrandeCity_FishingMons}; - -const struct WildPokemon gPetalburgCity_WaterMons[] = -{ - {20, 30, SPECIES_MARILL}, - {10, 20, SPECIES_MARILL}, - {30, 35, SPECIES_MARILL}, - {5, 10, SPECIES_MARILL}, - {5, 10, SPECIES_MARILL}, -}; - -const struct WildPokemonInfo gPetalburgCity_WaterMonsInfo = {1, gPetalburgCity_WaterMons}; - -const struct WildPokemon gPetalburgCity_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_GOLDEEN}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_GOLDEEN}, - {10, 30, SPECIES_CORPHISH}, - {25, 30, SPECIES_CORPHISH}, - {30, 35, SPECIES_CORPHISH}, - {20, 25, SPECIES_CORPHISH}, - {35, 40, SPECIES_CORPHISH}, - {40, 45, SPECIES_CORPHISH}, -}; - -const struct WildPokemonInfo gPetalburgCity_FishingMonsInfo = {10, gPetalburgCity_FishingMons}; - -const struct WildPokemon gUnderwater1_WaterMons[] = -{ - {20, 30, SPECIES_CLAMPERL}, - {20, 30, SPECIES_CHINCHOU}, - {30, 35, SPECIES_CLAMPERL}, - {30, 35, SPECIES_RELICANTH}, - {30, 35, SPECIES_RELICANTH}, -}; - -const struct WildPokemonInfo gUnderwater1_WaterMonsInfo = {4, gUnderwater1_WaterMons}; - -const struct WildPokemon gShoalCave_LowTideIceRoom_LandMons[] = -{ - {26, 26, SPECIES_ZUBAT}, - {26, 26, SPECIES_SPHEAL}, - {28, 28, SPECIES_ZUBAT}, - {28, 28, SPECIES_SPHEAL}, - {30, 30, SPECIES_ZUBAT}, - {30, 30, SPECIES_SPHEAL}, - {26, 26, SPECIES_SNORUNT}, - {32, 32, SPECIES_SPHEAL}, - {30, 30, SPECIES_GOLBAT}, - {28, 28, SPECIES_SNORUNT}, - {32, 32, SPECIES_GOLBAT}, - {30, 30, SPECIES_SNORUNT}, -}; - -const struct WildPokemonInfo gShoalCave_LowTideIceRoom_LandMonsInfo = {10, gShoalCave_LowTideIceRoom_LandMons}; - -const struct WildPokemon gSkyPillar_1F_LandMons[] = -{ - {33, 33, SPECIES_SABLEYE}, - {34, 34, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {34, 34, SPECIES_SABLEYE}, - {36, 36, SPECIES_CLAYDOL}, - {37, 37, SPECIES_BANETTE}, - {38, 38, SPECIES_BANETTE}, - {36, 36, SPECIES_CLAYDOL}, - {37, 37, SPECIES_CLAYDOL}, - {38, 38, SPECIES_CLAYDOL}, - {37, 37, SPECIES_CLAYDOL}, - {38, 38, SPECIES_CLAYDOL}, -}; - -const struct WildPokemonInfo gSkyPillar_1F_LandMonsInfo = {10, gSkyPillar_1F_LandMons}; - -const struct WildPokemon gSootopolisCity_WaterMons[] = -{ - {5, 35, SPECIES_MAGIKARP}, - {10, 30, SPECIES_MAGIKARP}, - {15, 25, SPECIES_MAGIKARP}, - {25, 30, SPECIES_MAGIKARP}, - {25, 30, SPECIES_MAGIKARP}, -}; - -const struct WildPokemonInfo gSootopolisCity_WaterMonsInfo = {1, gSootopolisCity_WaterMons}; - -const struct WildPokemon gSootopolisCity_FishingMons[] = -{ - {5, 10, SPECIES_MAGIKARP}, - {5, 10, SPECIES_TENTACOOL}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_MAGIKARP}, - {10, 30, SPECIES_MAGIKARP}, - {30, 35, SPECIES_MAGIKARP}, - {30, 35, SPECIES_MAGIKARP}, - {35, 40, SPECIES_GYARADOS}, - {35, 45, SPECIES_GYARADOS}, - {5, 45, SPECIES_GYARADOS}, -}; - -const struct WildPokemonInfo gSootopolisCity_FishingMonsInfo = {10, gSootopolisCity_FishingMons}; - -const struct WildPokemon gSkyPillar_3F_LandMons[] = -{ - {33, 33, SPECIES_SABLEYE}, - {34, 34, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {34, 34, SPECIES_SABLEYE}, - {36, 36, SPECIES_CLAYDOL}, - {37, 37, SPECIES_BANETTE}, - {38, 38, SPECIES_BANETTE}, - {36, 36, SPECIES_CLAYDOL}, - {37, 37, SPECIES_CLAYDOL}, - {38, 38, SPECIES_CLAYDOL}, - {37, 37, SPECIES_CLAYDOL}, - {38, 38, SPECIES_CLAYDOL}, -}; - -const struct WildPokemonInfo gSkyPillar_3F_LandMonsInfo = {10, gSkyPillar_3F_LandMons}; - -const struct WildPokemon gSkyPillar_5F_LandMons[] = -{ - {33, 33, SPECIES_SABLEYE}, - {34, 34, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {34, 34, SPECIES_SABLEYE}, - {36, 36, SPECIES_CLAYDOL}, - {37, 37, SPECIES_BANETTE}, - {38, 38, SPECIES_BANETTE}, - {36, 36, SPECIES_CLAYDOL}, - {37, 37, SPECIES_CLAYDOL}, - {38, 38, SPECIES_ALTARIA}, - {39, 39, SPECIES_ALTARIA}, - {39, 39, SPECIES_ALTARIA}, -}; - -const struct WildPokemonInfo gSkyPillar_5F_LandMonsInfo = {10, gSkyPillar_5F_LandMons}; - -const struct WildPokemon gSafariZone_Southeast_LandMons[] = -{ - {33, 33, SPECIES_SUNKERN}, - {34, 34, SPECIES_MAREEP}, - {35, 35, SPECIES_SUNKERN}, - {36, 36, SPECIES_MAREEP}, - {34, 34, SPECIES_AIPOM}, - {33, 33, SPECIES_SPINARAK}, - {35, 35, SPECIES_HOOTHOOT}, - {34, 34, SPECIES_SNUBBULL}, - {36, 36, SPECIES_STANTLER}, - {37, 37, SPECIES_GLIGAR}, - {39, 39, SPECIES_STANTLER}, - {40, 40, SPECIES_GLIGAR}, -}; - -const struct WildPokemonInfo gSafariZone_Southeast_LandMonsInfo = {25, gSafariZone_Southeast_LandMons}; - -const struct WildPokemon gSafariZone_Southeast_WaterMons[] = -{ - {25, 30, SPECIES_WOOPER}, - {25, 30, SPECIES_MARILL}, - {25, 30, SPECIES_MARILL}, - {30, 35, SPECIES_MARILL}, - {35, 40, SPECIES_QUAGSIRE}, -}; - -const struct WildPokemonInfo gSafariZone_Southeast_WaterMonsInfo = {9, gSafariZone_Southeast_WaterMons}; - -const struct WildPokemon gSafariZone_Southeast_FishingMons[] = -{ - {25, 30, SPECIES_MAGIKARP}, - {25, 30, SPECIES_GOLDEEN}, - {25, 30, SPECIES_MAGIKARP}, - {25, 30, SPECIES_GOLDEEN}, - {30, 35, SPECIES_REMORAID}, - {25, 30, SPECIES_GOLDEEN}, - {25, 30, SPECIES_REMORAID}, - {30, 35, SPECIES_REMORAID}, - {30, 35, SPECIES_REMORAID}, - {35, 40, SPECIES_OCTILLERY}, -}; - -const struct WildPokemonInfo gSafariZone_Southeast_FishingMonsInfo = {35, gSafariZone_Southeast_FishingMons}; - -const struct WildPokemon gSafariZone_Northeast_LandMons[] = -{ - {33, 33, SPECIES_AIPOM}, - {34, 34, SPECIES_TEDDIURSA}, - {35, 35, SPECIES_AIPOM}, - {36, 36, SPECIES_TEDDIURSA}, - {34, 34, SPECIES_SUNKERN}, - {33, 33, SPECIES_LEDYBA}, - {35, 35, SPECIES_HOOTHOOT}, - {34, 34, SPECIES_PINECO}, - {36, 36, SPECIES_HOUNDOUR}, - {37, 37, SPECIES_MILTANK}, - {39, 39, SPECIES_HOUNDOUR}, - {40, 40, SPECIES_MILTANK}, -}; - -const struct WildPokemonInfo gSafariZone_Northeast_LandMonsInfo = {25, gSafariZone_Northeast_LandMons}; - -const struct WildPokemon gSafariZone_Northeast_RockSmashMons[] = -{ - {25, 30, SPECIES_SHUCKLE}, - {20, 25, SPECIES_SHUCKLE}, - {30, 35, SPECIES_SHUCKLE}, - {30, 35, SPECIES_SHUCKLE}, - {35, 40, SPECIES_SHUCKLE}, -}; - -const struct WildPokemonInfo gSafariZone_Northeast_RockSmashMonsInfo = {25, gSafariZone_Northeast_RockSmashMons}; - -const struct WildPokemon gMagmaHideout_1F_LandMons[] = -{ - {27, 27, SPECIES_GEODUDE}, - {28, 28, SPECIES_TORKOAL}, - {28, 28, SPECIES_GEODUDE}, - {30, 30, SPECIES_TORKOAL}, - {29, 29, SPECIES_GEODUDE}, - {30, 30, SPECIES_GEODUDE}, - {30, 30, SPECIES_GEODUDE}, - {30, 30, SPECIES_GRAVELER}, - {30, 30, SPECIES_GRAVELER}, - {31, 31, SPECIES_GRAVELER}, - {32, 32, SPECIES_GRAVELER}, - {33, 33, SPECIES_GRAVELER}, -}; - -const struct WildPokemonInfo gMagmaHideout_1F_LandMonsInfo = {10, gMagmaHideout_1F_LandMons}; - -const struct WildPokemon gMagmaHideout_2F_1R_LandMons[] = -{ - {27, 27, SPECIES_GEODUDE}, - {28, 28, SPECIES_TORKOAL}, - {28, 28, SPECIES_GEODUDE}, - {30, 30, SPECIES_TORKOAL}, - {29, 29, SPECIES_GEODUDE}, - {30, 30, SPECIES_GEODUDE}, - {30, 30, SPECIES_GEODUDE}, - {30, 30, SPECIES_GRAVELER}, - {30, 30, SPECIES_GRAVELER}, - {31, 31, SPECIES_GRAVELER}, - {32, 32, SPECIES_GRAVELER}, - {33, 33, SPECIES_GRAVELER}, -}; - -const struct WildPokemonInfo gMagmaHideout_2F_1R_LandMonsInfo = {10, gMagmaHideout_2F_1R_LandMons}; - -const struct WildPokemon gMagmaHideout_2F_2R_LandMons[] = -{ - {27, 27, SPECIES_GEODUDE}, - {28, 28, SPECIES_TORKOAL}, - {28, 28, SPECIES_GEODUDE}, - {30, 30, SPECIES_TORKOAL}, - {29, 29, SPECIES_GEODUDE}, - {30, 30, SPECIES_GEODUDE}, - {30, 30, SPECIES_GEODUDE}, - {30, 30, SPECIES_GRAVELER}, - {30, 30, SPECIES_GRAVELER}, - {31, 31, SPECIES_GRAVELER}, - {32, 32, SPECIES_GRAVELER}, - {33, 33, SPECIES_GRAVELER}, -}; - -const struct WildPokemonInfo gMagmaHideout_2F_2R_LandMonsInfo = {10, gMagmaHideout_2F_2R_LandMons}; - -const struct WildPokemon gMagmaHideout_3F_1R_LandMons[] = -{ - {27, 27, SPECIES_GEODUDE}, - {28, 28, SPECIES_TORKOAL}, - {28, 28, SPECIES_GEODUDE}, - {30, 30, SPECIES_TORKOAL}, - {29, 29, SPECIES_GEODUDE}, - {30, 30, SPECIES_GEODUDE}, - {30, 30, SPECIES_GEODUDE}, - {30, 30, SPECIES_GRAVELER}, - {30, 30, SPECIES_GRAVELER}, - {31, 31, SPECIES_GRAVELER}, - {32, 32, SPECIES_GRAVELER}, - {33, 33, SPECIES_GRAVELER}, -}; - -const struct WildPokemonInfo gMagmaHideout_3F_1R_LandMonsInfo = {10, gMagmaHideout_3F_1R_LandMons}; - -const struct WildPokemon gMagmaHideout_3F_2R_LandMons[] = -{ - {27, 27, SPECIES_GEODUDE}, - {28, 28, SPECIES_TORKOAL}, - {28, 28, SPECIES_GEODUDE}, - {30, 30, SPECIES_TORKOAL}, - {29, 29, SPECIES_GEODUDE}, - {30, 30, SPECIES_GEODUDE}, - {30, 30, SPECIES_GEODUDE}, - {30, 30, SPECIES_GRAVELER}, - {30, 30, SPECIES_GRAVELER}, - {31, 31, SPECIES_GRAVELER}, - {32, 32, SPECIES_GRAVELER}, - {33, 33, SPECIES_GRAVELER}, -}; - -const struct WildPokemonInfo gMagmaHideout_3F_2R_LandMonsInfo = {10, gMagmaHideout_3F_2R_LandMons}; - -const struct WildPokemon gMagmaHideout_4F_LandMons[] = -{ - {27, 27, SPECIES_GEODUDE}, - {28, 28, SPECIES_TORKOAL}, - {28, 28, SPECIES_GEODUDE}, - {30, 30, SPECIES_TORKOAL}, - {29, 29, SPECIES_GEODUDE}, - {30, 30, SPECIES_GEODUDE}, - {30, 30, SPECIES_GEODUDE}, - {30, 30, SPECIES_GRAVELER}, - {30, 30, SPECIES_GRAVELER}, - {31, 31, SPECIES_GRAVELER}, - {32, 32, SPECIES_GRAVELER}, - {33, 33, SPECIES_GRAVELER}, -}; - -const struct WildPokemonInfo gMagmaHideout_4F_LandMonsInfo = {10, gMagmaHideout_4F_LandMons}; - -const struct WildPokemon gMagmaHideout_3F_3R_LandMons[] = -{ - {27, 27, SPECIES_GEODUDE}, - {28, 28, SPECIES_TORKOAL}, - {28, 28, SPECIES_GEODUDE}, - {30, 30, SPECIES_TORKOAL}, - {29, 29, SPECIES_GEODUDE}, - {30, 30, SPECIES_GEODUDE}, - {30, 30, SPECIES_GEODUDE}, - {30, 30, SPECIES_GRAVELER}, - {30, 30, SPECIES_GRAVELER}, - {31, 31, SPECIES_GRAVELER}, - {32, 32, SPECIES_GRAVELER}, - {33, 33, SPECIES_GRAVELER}, -}; - -const struct WildPokemonInfo gMagmaHideout_3F_3R_LandMonsInfo = {10, gMagmaHideout_3F_3R_LandMons}; - -const struct WildPokemon gMagmaHideout_2F_3R_LandMons[] = -{ - {27, 27, SPECIES_GEODUDE}, - {28, 28, SPECIES_TORKOAL}, - {28, 28, SPECIES_GEODUDE}, - {30, 30, SPECIES_TORKOAL}, - {29, 29, SPECIES_GEODUDE}, - {30, 30, SPECIES_GEODUDE}, - {30, 30, SPECIES_GEODUDE}, - {30, 30, SPECIES_GRAVELER}, - {30, 30, SPECIES_GRAVELER}, - {31, 31, SPECIES_GRAVELER}, - {32, 32, SPECIES_GRAVELER}, - {33, 33, SPECIES_GRAVELER}, -}; - -const struct WildPokemonInfo gMagmaHideout_2F_3R_LandMonsInfo = {10, gMagmaHideout_2F_3R_LandMons}; - -const struct WildPokemon gMirageTower_1F_LandMons[] = -{ - {21, 21, SPECIES_SANDSHREW}, - {21, 21, SPECIES_TRAPINCH}, - {20, 20, SPECIES_SANDSHREW}, - {20, 20, SPECIES_TRAPINCH}, - {20, 20, SPECIES_SANDSHREW}, - {20, 20, SPECIES_TRAPINCH}, - {22, 22, SPECIES_SANDSHREW}, - {22, 22, SPECIES_TRAPINCH}, - {23, 23, SPECIES_SANDSHREW}, - {23, 23, SPECIES_TRAPINCH}, - {24, 24, SPECIES_SANDSHREW}, - {24, 24, SPECIES_TRAPINCH}, -}; - -const struct WildPokemonInfo gMirageTower_1F_LandMonsInfo = {10, gMirageTower_1F_LandMons}; - -const struct WildPokemon gMirageTower_2F_LandMons[] = -{ - {21, 21, SPECIES_SANDSHREW}, - {21, 21, SPECIES_TRAPINCH}, - {20, 20, SPECIES_SANDSHREW}, - {20, 20, SPECIES_TRAPINCH}, - {20, 20, SPECIES_SANDSHREW}, - {20, 20, SPECIES_TRAPINCH}, - {22, 22, SPECIES_SANDSHREW}, - {22, 22, SPECIES_TRAPINCH}, - {23, 23, SPECIES_SANDSHREW}, - {23, 23, SPECIES_TRAPINCH}, - {24, 24, SPECIES_SANDSHREW}, - {24, 24, SPECIES_TRAPINCH}, -}; - -const struct WildPokemonInfo gMirageTower_2F_LandMonsInfo = {10, gMirageTower_2F_LandMons}; - -const struct WildPokemon gMirageTower_3F_LandMons[] = -{ - {21, 21, SPECIES_SANDSHREW}, - {21, 21, SPECIES_TRAPINCH}, - {20, 20, SPECIES_SANDSHREW}, - {20, 20, SPECIES_TRAPINCH}, - {20, 20, SPECIES_SANDSHREW}, - {20, 20, SPECIES_TRAPINCH}, - {22, 22, SPECIES_SANDSHREW}, - {22, 22, SPECIES_TRAPINCH}, - {23, 23, SPECIES_SANDSHREW}, - {23, 23, SPECIES_TRAPINCH}, - {24, 24, SPECIES_SANDSHREW}, - {24, 24, SPECIES_TRAPINCH}, -}; - -const struct WildPokemonInfo gMirageTower_3F_LandMonsInfo = {10, gMirageTower_3F_LandMons}; - -const struct WildPokemon gMirageTower_4F_LandMons[] = -{ - {21, 21, SPECIES_SANDSHREW}, - {21, 21, SPECIES_TRAPINCH}, - {20, 20, SPECIES_SANDSHREW}, - {20, 20, SPECIES_TRAPINCH}, - {20, 20, SPECIES_SANDSHREW}, - {20, 20, SPECIES_TRAPINCH}, - {22, 22, SPECIES_SANDSHREW}, - {22, 22, SPECIES_TRAPINCH}, - {23, 23, SPECIES_SANDSHREW}, - {23, 23, SPECIES_TRAPINCH}, - {24, 24, SPECIES_SANDSHREW}, - {24, 24, SPECIES_TRAPINCH}, -}; - -const struct WildPokemonInfo gMirageTower_4F_LandMonsInfo = {10, gMirageTower_4F_LandMons}; - -const struct WildPokemon gDesertUnderpass_LandMons[] = -{ - {38, 38, SPECIES_DITTO}, - {35, 35, SPECIES_WHISMUR}, - {40, 40, SPECIES_DITTO}, - {40, 40, SPECIES_LOUDRED}, - {41, 41, SPECIES_DITTO}, - {36, 36, SPECIES_WHISMUR}, - {38, 38, SPECIES_LOUDRED}, - {42, 42, SPECIES_DITTO}, - {38, 38, SPECIES_WHISMUR}, - {43, 43, SPECIES_DITTO}, - {44, 44, SPECIES_LOUDRED}, - {45, 45, SPECIES_DITTO}, -}; - -const struct WildPokemonInfo gDesertUnderpass_LandMonsInfo = {10, gDesertUnderpass_LandMons}; - -const struct WildPokemon gArtisanCave_B1F_LandMons[] = -{ - {40, 40, SPECIES_SMEARGLE}, - {41, 41, SPECIES_SMEARGLE}, - {42, 42, SPECIES_SMEARGLE}, - {43, 43, SPECIES_SMEARGLE}, - {44, 44, SPECIES_SMEARGLE}, - {45, 45, SPECIES_SMEARGLE}, - {46, 46, SPECIES_SMEARGLE}, - {47, 47, SPECIES_SMEARGLE}, - {48, 48, SPECIES_SMEARGLE}, - {49, 49, SPECIES_SMEARGLE}, - {50, 50, SPECIES_SMEARGLE}, - {50, 50, SPECIES_SMEARGLE}, -}; - -const struct WildPokemonInfo gArtisanCave_B1F_LandMonsInfo = {10, gArtisanCave_B1F_LandMons}; - -const struct WildPokemon gArtisanCave_1F_LandMons[] = -{ - {40, 40, SPECIES_SMEARGLE}, - {41, 41, SPECIES_SMEARGLE}, - {42, 42, SPECIES_SMEARGLE}, - {43, 43, SPECIES_SMEARGLE}, - {44, 44, SPECIES_SMEARGLE}, - {45, 45, SPECIES_SMEARGLE}, - {46, 46, SPECIES_SMEARGLE}, - {47, 47, SPECIES_SMEARGLE}, - {48, 48, SPECIES_SMEARGLE}, - {49, 49, SPECIES_SMEARGLE}, - {50, 50, SPECIES_SMEARGLE}, - {50, 50, SPECIES_SMEARGLE}, -}; - -const struct WildPokemonInfo gArtisanCave_1F_LandMonsInfo = {10, gArtisanCave_1F_LandMons}; - -const struct WildPokemon gAlteringCave1_LandMons[] = -{ - {10, 10, SPECIES_ZUBAT}, - {12, 12, SPECIES_ZUBAT}, - {8, 8, SPECIES_ZUBAT}, - {14, 14, SPECIES_ZUBAT}, - {10, 10, SPECIES_ZUBAT}, - {12, 12, SPECIES_ZUBAT}, - {16, 16, SPECIES_ZUBAT}, - {6, 6, SPECIES_ZUBAT}, - {8, 8, SPECIES_ZUBAT}, - {14, 14, SPECIES_ZUBAT}, - {8, 8, SPECIES_ZUBAT}, - {14, 14, SPECIES_ZUBAT}, -}; - -const struct WildPokemonInfo gAlteringCave1_LandMonsInfo = {7, gAlteringCave1_LandMons}; - -const struct WildPokemon gAlteringCave2_LandMons[] = -{ - {7, 7, SPECIES_MAREEP}, - {9, 9, SPECIES_MAREEP}, - {5, 5, SPECIES_MAREEP}, - {11, 11, SPECIES_MAREEP}, - {7, 7, SPECIES_MAREEP}, - {9, 9, SPECIES_MAREEP}, - {13, 13, SPECIES_MAREEP}, - {3, 3, SPECIES_MAREEP}, - {5, 5, SPECIES_MAREEP}, - {11, 11, SPECIES_MAREEP}, - {5, 5, SPECIES_MAREEP}, - {11, 11, SPECIES_MAREEP}, -}; - -const struct WildPokemonInfo gAlteringCave2_LandMonsInfo = {7, gAlteringCave2_LandMons}; - -const struct WildPokemon gAlteringCave3_LandMons[] = -{ - {23, 23, SPECIES_PINECO}, - {25, 25, SPECIES_PINECO}, - {22, 22, SPECIES_PINECO}, - {27, 27, SPECIES_PINECO}, - {23, 23, SPECIES_PINECO}, - {25, 25, SPECIES_PINECO}, - {29, 29, SPECIES_PINECO}, - {19, 19, SPECIES_PINECO}, - {21, 21, SPECIES_PINECO}, - {27, 27, SPECIES_PINECO}, - {21, 21, SPECIES_PINECO}, - {27, 27, SPECIES_PINECO}, -}; - -const struct WildPokemonInfo gAlteringCave3_LandMonsInfo = {7, gAlteringCave3_LandMons}; - -const struct WildPokemon gAlteringCave4_LandMons[] = -{ - {16, 16, SPECIES_HOUNDOUR}, - {18, 18, SPECIES_HOUNDOUR}, - {14, 14, SPECIES_HOUNDOUR}, - {20, 20, SPECIES_HOUNDOUR}, - {16, 16, SPECIES_HOUNDOUR}, - {18, 18, SPECIES_HOUNDOUR}, - {22, 22, SPECIES_HOUNDOUR}, - {12, 12, SPECIES_HOUNDOUR}, - {14, 14, SPECIES_HOUNDOUR}, - {20, 20, SPECIES_HOUNDOUR}, - {14, 14, SPECIES_HOUNDOUR}, - {20, 20, SPECIES_HOUNDOUR}, -}; - -const struct WildPokemonInfo gAlteringCave4_LandMonsInfo = {7, gAlteringCave4_LandMons}; - -const struct WildPokemon gAlteringCave5_LandMons[] = -{ - {10, 10, SPECIES_TEDDIURSA}, - {12, 12, SPECIES_TEDDIURSA}, - {8, 8, SPECIES_TEDDIURSA}, - {14, 14, SPECIES_TEDDIURSA}, - {10, 10, SPECIES_TEDDIURSA}, - {12, 12, SPECIES_TEDDIURSA}, - {16, 16, SPECIES_TEDDIURSA}, - {6, 6, SPECIES_TEDDIURSA}, - {8, 8, SPECIES_TEDDIURSA}, - {14, 14, SPECIES_TEDDIURSA}, - {8, 8, SPECIES_TEDDIURSA}, - {14, 14, SPECIES_TEDDIURSA}, -}; - -const struct WildPokemonInfo gAlteringCave5_LandMonsInfo = {7, gAlteringCave5_LandMons}; - -const struct WildPokemon gAlteringCave6_LandMons[] = -{ - {22, 22, SPECIES_AIPOM}, - {24, 24, SPECIES_AIPOM}, - {20, 20, SPECIES_AIPOM}, - {26, 26, SPECIES_AIPOM}, - {22, 22, SPECIES_AIPOM}, - {24, 24, SPECIES_AIPOM}, - {28, 28, SPECIES_AIPOM}, - {18, 18, SPECIES_AIPOM}, - {20, 20, SPECIES_AIPOM}, - {26, 26, SPECIES_AIPOM}, - {20, 20, SPECIES_AIPOM}, - {26, 26, SPECIES_AIPOM}, -}; - -const struct WildPokemonInfo gAlteringCave6_LandMonsInfo = {7, gAlteringCave6_LandMons}; - -const struct WildPokemon gAlteringCave7_LandMons[] = -{ - {22, 22, SPECIES_SHUCKLE}, - {24, 24, SPECIES_SHUCKLE}, - {20, 20, SPECIES_SHUCKLE}, - {26, 26, SPECIES_SHUCKLE}, - {22, 22, SPECIES_SHUCKLE}, - {24, 24, SPECIES_SHUCKLE}, - {28, 28, SPECIES_SHUCKLE}, - {18, 18, SPECIES_SHUCKLE}, - {20, 20, SPECIES_SHUCKLE}, - {26, 26, SPECIES_SHUCKLE}, - {20, 20, SPECIES_SHUCKLE}, - {26, 26, SPECIES_SHUCKLE}, -}; - -const struct WildPokemonInfo gAlteringCave7_LandMonsInfo = {7, gAlteringCave7_LandMons}; - -const struct WildPokemon gAlteringCave8_LandMons[] = -{ - {22, 22, SPECIES_STANTLER}, - {24, 24, SPECIES_STANTLER}, - {20, 20, SPECIES_STANTLER}, - {26, 26, SPECIES_STANTLER}, - {22, 22, SPECIES_STANTLER}, - {24, 24, SPECIES_STANTLER}, - {28, 28, SPECIES_STANTLER}, - {18, 18, SPECIES_STANTLER}, - {20, 20, SPECIES_STANTLER}, - {26, 26, SPECIES_STANTLER}, - {20, 20, SPECIES_STANTLER}, - {26, 26, SPECIES_STANTLER}, -}; - -const struct WildPokemonInfo gAlteringCave8_LandMonsInfo = {7, gAlteringCave8_LandMons}; - -const struct WildPokemon gAlteringCave9_LandMons[] = -{ - {22, 22, SPECIES_SMEARGLE}, - {24, 24, SPECIES_SMEARGLE}, - {20, 20, SPECIES_SMEARGLE}, - {26, 26, SPECIES_SMEARGLE}, - {22, 22, SPECIES_SMEARGLE}, - {24, 24, SPECIES_SMEARGLE}, - {28, 28, SPECIES_SMEARGLE}, - {18, 18, SPECIES_SMEARGLE}, - {20, 20, SPECIES_SMEARGLE}, - {26, 26, SPECIES_SMEARGLE}, - {20, 20, SPECIES_SMEARGLE}, - {26, 26, SPECIES_SMEARGLE}, -}; - -const struct WildPokemonInfo gAlteringCave9_LandMonsInfo = {7, gAlteringCave9_LandMons}; - -const struct WildPokemon gMeteorFalls_StevensCave_LandMons[] = -{ - {33, 33, SPECIES_GOLBAT}, - {35, 35, SPECIES_GOLBAT}, - {33, 33, SPECIES_GOLBAT}, - {35, 35, SPECIES_SOLROCK}, - {33, 33, SPECIES_SOLROCK}, - {37, 37, SPECIES_SOLROCK}, - {35, 35, SPECIES_GOLBAT}, - {39, 39, SPECIES_SOLROCK}, - {38, 38, SPECIES_GOLBAT}, - {40, 40, SPECIES_GOLBAT}, - {38, 38, SPECIES_GOLBAT}, - {40, 40, SPECIES_GOLBAT}, -}; - -const struct WildPokemonInfo gMeteorFalls_StevensCave_LandMonsInfo = {10, gMeteorFalls_StevensCave_LandMons}; - -const struct WildPokemonHeader gWildMonHeaders[] = -{ - { - .mapGroup = MAP_GROUP(ROUTE101), - .mapNum = MAP_NUM(ROUTE101), - .landMonsInfo = &gRoute101_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ROUTE102), - .mapNum = MAP_NUM(ROUTE102), - .landMonsInfo = &gRoute102_LandMonsInfo, - .waterMonsInfo = &gRoute102_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute102_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE103), - .mapNum = MAP_NUM(ROUTE103), - .landMonsInfo = &gRoute103_LandMonsInfo, - .waterMonsInfo = &gRoute103_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute103_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE104), - .mapNum = MAP_NUM(ROUTE104), - .landMonsInfo = &gRoute104_LandMonsInfo, - .waterMonsInfo = &gRoute104_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute104_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE105), - .mapNum = MAP_NUM(ROUTE105), - .landMonsInfo = NULL, - .waterMonsInfo = &gRoute105_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute105_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE110), - .mapNum = MAP_NUM(ROUTE110), - .landMonsInfo = &gRoute110_LandMonsInfo, - .waterMonsInfo = &gRoute110_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute110_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE111), - .mapNum = MAP_NUM(ROUTE111), - .landMonsInfo = &gRoute111_LandMonsInfo, - .waterMonsInfo = &gRoute111_WaterMonsInfo, - .rockSmashMonsInfo = &gRoute111_RockSmashMonsInfo, - .fishingMonsInfo = &gRoute111_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE112), - .mapNum = MAP_NUM(ROUTE112), - .landMonsInfo = &gRoute112_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ROUTE113), - .mapNum = MAP_NUM(ROUTE113), - .landMonsInfo = &gRoute113_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ROUTE114), - .mapNum = MAP_NUM(ROUTE114), - .landMonsInfo = &gRoute114_LandMonsInfo, - .waterMonsInfo = &gRoute114_WaterMonsInfo, - .rockSmashMonsInfo = &gRoute114_RockSmashMonsInfo, - .fishingMonsInfo = &gRoute114_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE116), - .mapNum = MAP_NUM(ROUTE116), - .landMonsInfo = &gRoute116_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ROUTE117), - .mapNum = MAP_NUM(ROUTE117), - .landMonsInfo = &gRoute117_LandMonsInfo, - .waterMonsInfo = &gRoute117_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute117_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE118), - .mapNum = MAP_NUM(ROUTE118), - .landMonsInfo = &gRoute118_LandMonsInfo, - .waterMonsInfo = &gRoute118_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute118_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE124), - .mapNum = MAP_NUM(ROUTE124), - .landMonsInfo = NULL, - .waterMonsInfo = &gRoute124_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute124_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(PETALBURG_WOODS), - .mapNum = MAP_NUM(PETALBURG_WOODS), - .landMonsInfo = &gPetalburgWoods_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(RUSTURF_TUNNEL), - .mapNum = MAP_NUM(RUSTURF_TUNNEL), - .landMonsInfo = &gRusturfTunnel_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(GRANITE_CAVE_1F), - .mapNum = MAP_NUM(GRANITE_CAVE_1F), - .landMonsInfo = &gGraniteCave_1F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(GRANITE_CAVE_B1F), - .mapNum = MAP_NUM(GRANITE_CAVE_B1F), - .landMonsInfo = &gGraniteCave_B1F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MT_PYRE_1F), - .mapNum = MAP_NUM(MT_PYRE_1F), - .landMonsInfo = &gMtPyre_1F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(VICTORY_ROAD_1F), - .mapNum = MAP_NUM(VICTORY_ROAD_1F), - .landMonsInfo = &gVictoryRoad_1F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(SAFARI_ZONE_SOUTH), - .mapNum = MAP_NUM(SAFARI_ZONE_SOUTH), - .landMonsInfo = &gSafariZone_South_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(UNDERWATER2), - .mapNum = MAP_NUM(UNDERWATER2), - .landMonsInfo = NULL, - .waterMonsInfo = &gUnderwater2_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ABANDONED_SHIP_ROOMS_B1F), - .mapNum = MAP_NUM(ABANDONED_SHIP_ROOMS_B1F), - .landMonsInfo = NULL, - .waterMonsInfo = &gAbandonedShip_Rooms_B1F_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gAbandonedShip_Rooms_B1F_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(GRANITE_CAVE_B2F), - .mapNum = MAP_NUM(GRANITE_CAVE_B2F), - .landMonsInfo = &gGraniteCave_B2F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = &gGraniteCave_B2F_RockSmashMonsInfo, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(FIERY_PATH), - .mapNum = MAP_NUM(FIERY_PATH), - .landMonsInfo = &gFieryPath_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(METEOR_FALLS_B1F_2R), - .mapNum = MAP_NUM(METEOR_FALLS_B1F_2R), - .landMonsInfo = &gMeteorFalls_B1F_2R_LandMonsInfo, - .waterMonsInfo = &gMeteorFalls_B1F_2R_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gMeteorFalls_B1F_2R_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(JAGGED_PASS), - .mapNum = MAP_NUM(JAGGED_PASS), - .landMonsInfo = &gJaggedPass_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ROUTE106), - .mapNum = MAP_NUM(ROUTE106), - .landMonsInfo = NULL, - .waterMonsInfo = &gRoute106_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute106_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE107), - .mapNum = MAP_NUM(ROUTE107), - .landMonsInfo = NULL, - .waterMonsInfo = &gRoute107_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute107_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE108), - .mapNum = MAP_NUM(ROUTE108), - .landMonsInfo = NULL, - .waterMonsInfo = &gRoute108_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute108_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE109), - .mapNum = MAP_NUM(ROUTE109), - .landMonsInfo = NULL, - .waterMonsInfo = &gRoute109_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute109_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE115), - .mapNum = MAP_NUM(ROUTE115), - .landMonsInfo = &gRoute115_LandMonsInfo, - .waterMonsInfo = &gRoute115_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute115_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(NEW_MAUVILLE_INSIDE), - .mapNum = MAP_NUM(NEW_MAUVILLE_INSIDE), - .landMonsInfo = &gNewMauville_Inside_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ROUTE119), - .mapNum = MAP_NUM(ROUTE119), - .landMonsInfo = &gRoute119_LandMonsInfo, - .waterMonsInfo = &gRoute119_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute119_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE120), - .mapNum = MAP_NUM(ROUTE120), - .landMonsInfo = &gRoute120_LandMonsInfo, - .waterMonsInfo = &gRoute120_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute120_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE121), - .mapNum = MAP_NUM(ROUTE121), - .landMonsInfo = &gRoute121_LandMonsInfo, - .waterMonsInfo = &gRoute121_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute121_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE122), - .mapNum = MAP_NUM(ROUTE122), - .landMonsInfo = NULL, - .waterMonsInfo = &gRoute122_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute122_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE123), - .mapNum = MAP_NUM(ROUTE123), - .landMonsInfo = &gRoute123_LandMonsInfo, - .waterMonsInfo = &gRoute123_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute123_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(MT_PYRE_2F), - .mapNum = MAP_NUM(MT_PYRE_2F), - .landMonsInfo = &gMtPyre_2F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MT_PYRE_3F), - .mapNum = MAP_NUM(MT_PYRE_3F), - .landMonsInfo = &gMtPyre_3F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MT_PYRE_4F), - .mapNum = MAP_NUM(MT_PYRE_4F), - .landMonsInfo = &gMtPyre_4F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MT_PYRE_5F), - .mapNum = MAP_NUM(MT_PYRE_5F), - .landMonsInfo = &gMtPyre_5F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MT_PYRE_6F), - .mapNum = MAP_NUM(MT_PYRE_6F), - .landMonsInfo = &gMtPyre_6F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MT_PYRE_EXTERIOR), - .mapNum = MAP_NUM(MT_PYRE_EXTERIOR), - .landMonsInfo = &gMtPyre_Exterior_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MT_PYRE_SUMMIT), - .mapNum = MAP_NUM(MT_PYRE_SUMMIT), - .landMonsInfo = &gMtPyre_Summit_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(GRANITE_CAVE_STEVENS_ROOM), - .mapNum = MAP_NUM(GRANITE_CAVE_STEVENS_ROOM), - .landMonsInfo = &gGraniteCave_StevensRoom_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ROUTE125), - .mapNum = MAP_NUM(ROUTE125), - .landMonsInfo = NULL, - .waterMonsInfo = &gRoute125_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute125_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE126), - .mapNum = MAP_NUM(ROUTE126), - .landMonsInfo = NULL, - .waterMonsInfo = &gRoute126_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute126_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE127), - .mapNum = MAP_NUM(ROUTE127), - .landMonsInfo = NULL, - .waterMonsInfo = &gRoute127_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute127_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE128), - .mapNum = MAP_NUM(ROUTE128), - .landMonsInfo = NULL, - .waterMonsInfo = &gRoute128_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute128_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE129), - .mapNum = MAP_NUM(ROUTE129), - .landMonsInfo = NULL, - .waterMonsInfo = &gRoute129_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute129_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE130), - .mapNum = MAP_NUM(ROUTE130), - .landMonsInfo = &gRoute130_LandMonsInfo, - .waterMonsInfo = &gRoute130_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute130_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE131), - .mapNum = MAP_NUM(ROUTE131), - .landMonsInfo = NULL, - .waterMonsInfo = &gRoute131_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute131_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE132), - .mapNum = MAP_NUM(ROUTE132), - .landMonsInfo = NULL, - .waterMonsInfo = &gRoute132_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute132_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE133), - .mapNum = MAP_NUM(ROUTE133), - .landMonsInfo = NULL, - .waterMonsInfo = &gRoute133_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute133_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ROUTE134), - .mapNum = MAP_NUM(ROUTE134), - .landMonsInfo = NULL, - .waterMonsInfo = &gRoute134_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gRoute134_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(ABANDONED_SHIP_HIDDEN_FLOOR_CORRIDORS), - .mapNum = MAP_NUM(ABANDONED_SHIP_HIDDEN_FLOOR_CORRIDORS), - .landMonsInfo = NULL, - .waterMonsInfo = &gAbandonedShip_HiddenFloorCorridors_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gAbandonedShip_HiddenFloorCorridors_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(SEAFLOOR_CAVERN_ROOM1), - .mapNum = MAP_NUM(SEAFLOOR_CAVERN_ROOM1), - .landMonsInfo = &gSeafloorCavern_Room1_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(SEAFLOOR_CAVERN_ROOM2), - .mapNum = MAP_NUM(SEAFLOOR_CAVERN_ROOM2), - .landMonsInfo = &gSeafloorCavern_Room2_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(SEAFLOOR_CAVERN_ROOM3), - .mapNum = MAP_NUM(SEAFLOOR_CAVERN_ROOM3), - .landMonsInfo = &gSeafloorCavern_Room3_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(SEAFLOOR_CAVERN_ROOM4), - .mapNum = MAP_NUM(SEAFLOOR_CAVERN_ROOM4), - .landMonsInfo = &gSeafloorCavern_Room4_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(SEAFLOOR_CAVERN_ROOM5), - .mapNum = MAP_NUM(SEAFLOOR_CAVERN_ROOM5), - .landMonsInfo = &gSeafloorCavern_Room5_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(SEAFLOOR_CAVERN_ROOM6), - .mapNum = MAP_NUM(SEAFLOOR_CAVERN_ROOM6), - .landMonsInfo = &gSeafloorCavern_Room6_LandMonsInfo, - .waterMonsInfo = &gSeafloorCavern_Room6_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gSeafloorCavern_Room6_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(SEAFLOOR_CAVERN_ROOM7), - .mapNum = MAP_NUM(SEAFLOOR_CAVERN_ROOM7), - .landMonsInfo = &gSeafloorCavern_Room7_LandMonsInfo, - .waterMonsInfo = &gSeafloorCavern_Room7_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gSeafloorCavern_Room7_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(SEAFLOOR_CAVERN_ROOM8), - .mapNum = MAP_NUM(SEAFLOOR_CAVERN_ROOM8), - .landMonsInfo = &gSeafloorCavern_Room8_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(SEAFLOOR_CAVERN_ENTRANCE), - .mapNum = MAP_NUM(SEAFLOOR_CAVERN_ENTRANCE), - .landMonsInfo = NULL, - .waterMonsInfo = &gSeafloorCavern_Entrance_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gSeafloorCavern_Entrance_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(CAVE_OF_ORIGIN_ENTRANCE), - .mapNum = MAP_NUM(CAVE_OF_ORIGIN_ENTRANCE), - .landMonsInfo = &gCaveOfOrigin_Entrance_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(CAVE_OF_ORIGIN_1F), - .mapNum = MAP_NUM(CAVE_OF_ORIGIN_1F), - .landMonsInfo = &gCaveOfOrigin_1F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP1), - .mapNum = MAP_NUM(CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP1), - .landMonsInfo = &gCaveOfOrigin_UnusedRubySapphireMap1_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP2), - .mapNum = MAP_NUM(CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP2), - .landMonsInfo = &gCaveOfOrigin_UnusedRubySapphireMap2_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP3), - .mapNum = MAP_NUM(CAVE_OF_ORIGIN_UNUSED_RUBY_SAPPHIRE_MAP3), - .landMonsInfo = &gCaveOfOrigin_UnusedRubySapphireMap3_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(NEW_MAUVILLE_ENTRANCE), - .mapNum = MAP_NUM(NEW_MAUVILLE_ENTRANCE), - .landMonsInfo = &gNewMauville_Entrance_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(SAFARI_ZONE_SOUTHWEST), - .mapNum = MAP_NUM(SAFARI_ZONE_SOUTHWEST), - .landMonsInfo = &gSafariZone_Southwest_LandMonsInfo, - .waterMonsInfo = &gSafariZone_Southwest_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gSafariZone_Southwest_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(SAFARI_ZONE_NORTH), - .mapNum = MAP_NUM(SAFARI_ZONE_NORTH), - .landMonsInfo = &gSafariZone_North_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = &gSafariZone_North_RockSmashMonsInfo, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(SAFARI_ZONE_NORTHWEST), - .mapNum = MAP_NUM(SAFARI_ZONE_NORTHWEST), - .landMonsInfo = &gSafariZone_Northwest_LandMonsInfo, - .waterMonsInfo = &gSafariZone_Northwest_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gSafariZone_Northwest_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(VICTORY_ROAD_B1F), - .mapNum = MAP_NUM(VICTORY_ROAD_B1F), - .landMonsInfo = &gVictoryRoad_B1F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = &gVictoryRoad_B1F_RockSmashMonsInfo, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(VICTORY_ROAD_B2F), - .mapNum = MAP_NUM(VICTORY_ROAD_B2F), - .landMonsInfo = &gVictoryRoad_B2F_LandMonsInfo, - .waterMonsInfo = &gVictoryRoad_B2F_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gVictoryRoad_B2F_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(METEOR_FALLS_1F_1R), - .mapNum = MAP_NUM(METEOR_FALLS_1F_1R), - .landMonsInfo = &gMeteorFalls_1F_1R_LandMonsInfo, - .waterMonsInfo = &gMeteorFalls_1F_1R_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gMeteorFalls_1F_1R_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(METEOR_FALLS_1F_2R), - .mapNum = MAP_NUM(METEOR_FALLS_1F_2R), - .landMonsInfo = &gMeteorFalls_1F_2R_LandMonsInfo, - .waterMonsInfo = &gMeteorFalls_1F_2R_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gMeteorFalls_1F_2R_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(METEOR_FALLS_B1F_1R), - .mapNum = MAP_NUM(METEOR_FALLS_B1F_1R), - .landMonsInfo = &gMeteorFalls_B1F_1R_LandMonsInfo, - .waterMonsInfo = &gMeteorFalls_B1F_1R_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gMeteorFalls_B1F_1R_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(SHOAL_CAVE_LOW_TIDE_STAIRS_ROOM), - .mapNum = MAP_NUM(SHOAL_CAVE_LOW_TIDE_STAIRS_ROOM), - .landMonsInfo = &gShoalCave_LowTideStairsRoom_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(SHOAL_CAVE_LOW_TIDE_LOWER_ROOM), - .mapNum = MAP_NUM(SHOAL_CAVE_LOW_TIDE_LOWER_ROOM), - .landMonsInfo = &gShoalCave_LowTideLowerRoom_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(SHOAL_CAVE_LOW_TIDE_INNER_ROOM), - .mapNum = MAP_NUM(SHOAL_CAVE_LOW_TIDE_INNER_ROOM), - .landMonsInfo = &gShoalCave_LowTideInnerRoom_LandMonsInfo, - .waterMonsInfo = &gShoalCave_LowTideInnerRoom_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gShoalCave_LowTideInnerRoom_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(SHOAL_CAVE_LOW_TIDE_ENTRANCE_ROOM), - .mapNum = MAP_NUM(SHOAL_CAVE_LOW_TIDE_ENTRANCE_ROOM), - .landMonsInfo = &gShoalCave_LowTideEntranceRoom_LandMonsInfo, - .waterMonsInfo = &gShoalCave_LowTideEntranceRoom_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gShoalCave_LowTideEntranceRoom_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(LILYCOVE_CITY), - .mapNum = MAP_NUM(LILYCOVE_CITY), - .landMonsInfo = NULL, - .waterMonsInfo = &gLilycoveCity_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gLilycoveCity_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(DEWFORD_TOWN), - .mapNum = MAP_NUM(DEWFORD_TOWN), - .landMonsInfo = NULL, - .waterMonsInfo = &gDewfordTown_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gDewfordTown_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(SLATEPORT_CITY), - .mapNum = MAP_NUM(SLATEPORT_CITY), - .landMonsInfo = NULL, - .waterMonsInfo = &gSlateportCity_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gSlateportCity_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(MOSSDEEP_CITY), - .mapNum = MAP_NUM(MOSSDEEP_CITY), - .landMonsInfo = NULL, - .waterMonsInfo = &gMossdeepCity_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gMossdeepCity_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(PACIFIDLOG_TOWN), - .mapNum = MAP_NUM(PACIFIDLOG_TOWN), - .landMonsInfo = NULL, - .waterMonsInfo = &gPacifidlogTown_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gPacifidlogTown_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(EVER_GRANDE_CITY), - .mapNum = MAP_NUM(EVER_GRANDE_CITY), - .landMonsInfo = NULL, - .waterMonsInfo = &gEverGrandeCity_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gEverGrandeCity_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(PETALBURG_CITY), - .mapNum = MAP_NUM(PETALBURG_CITY), - .landMonsInfo = NULL, - .waterMonsInfo = &gPetalburgCity_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gPetalburgCity_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(UNDERWATER1), - .mapNum = MAP_NUM(UNDERWATER1), - .landMonsInfo = NULL, - .waterMonsInfo = &gUnderwater1_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(SHOAL_CAVE_LOW_TIDE_ICE_ROOM), - .mapNum = MAP_NUM(SHOAL_CAVE_LOW_TIDE_ICE_ROOM), - .landMonsInfo = &gShoalCave_LowTideIceRoom_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(SKY_PILLAR_1F), - .mapNum = MAP_NUM(SKY_PILLAR_1F), - .landMonsInfo = &gSkyPillar_1F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(SOOTOPOLIS_CITY), - .mapNum = MAP_NUM(SOOTOPOLIS_CITY), - .landMonsInfo = NULL, - .waterMonsInfo = &gSootopolisCity_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gSootopolisCity_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(SKY_PILLAR_3F), - .mapNum = MAP_NUM(SKY_PILLAR_3F), - .landMonsInfo = &gSkyPillar_3F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(SKY_PILLAR_5F), - .mapNum = MAP_NUM(SKY_PILLAR_5F), - .landMonsInfo = &gSkyPillar_5F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(SAFARI_ZONE_SOUTHEAST), - .mapNum = MAP_NUM(SAFARI_ZONE_SOUTHEAST), - .landMonsInfo = &gSafariZone_Southeast_LandMonsInfo, - .waterMonsInfo = &gSafariZone_Southeast_WaterMonsInfo, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = &gSafariZone_Southeast_FishingMonsInfo, - }, - { - .mapGroup = MAP_GROUP(SAFARI_ZONE_NORTHEAST), - .mapNum = MAP_NUM(SAFARI_ZONE_NORTHEAST), - .landMonsInfo = &gSafariZone_Northeast_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = &gSafariZone_Northeast_RockSmashMonsInfo, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MAGMA_HIDEOUT_1F), - .mapNum = MAP_NUM(MAGMA_HIDEOUT_1F), - .landMonsInfo = &gMagmaHideout_1F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MAGMA_HIDEOUT_2F_1R), - .mapNum = MAP_NUM(MAGMA_HIDEOUT_2F_1R), - .landMonsInfo = &gMagmaHideout_2F_1R_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MAGMA_HIDEOUT_2F_2R), - .mapNum = MAP_NUM(MAGMA_HIDEOUT_2F_2R), - .landMonsInfo = &gMagmaHideout_2F_2R_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MAGMA_HIDEOUT_3F_1R), - .mapNum = MAP_NUM(MAGMA_HIDEOUT_3F_1R), - .landMonsInfo = &gMagmaHideout_3F_1R_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MAGMA_HIDEOUT_3F_2R), - .mapNum = MAP_NUM(MAGMA_HIDEOUT_3F_2R), - .landMonsInfo = &gMagmaHideout_3F_2R_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MAGMA_HIDEOUT_4F), - .mapNum = MAP_NUM(MAGMA_HIDEOUT_4F), - .landMonsInfo = &gMagmaHideout_4F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MAGMA_HIDEOUT_3F_3R), - .mapNum = MAP_NUM(MAGMA_HIDEOUT_3F_3R), - .landMonsInfo = &gMagmaHideout_3F_3R_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MAGMA_HIDEOUT_2F_3R), - .mapNum = MAP_NUM(MAGMA_HIDEOUT_2F_3R), - .landMonsInfo = &gMagmaHideout_2F_3R_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MIRAGE_TOWER_1F), - .mapNum = MAP_NUM(MIRAGE_TOWER_1F), - .landMonsInfo = &gMirageTower_1F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MIRAGE_TOWER_2F), - .mapNum = MAP_NUM(MIRAGE_TOWER_2F), - .landMonsInfo = &gMirageTower_2F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MIRAGE_TOWER_3F), - .mapNum = MAP_NUM(MIRAGE_TOWER_3F), - .landMonsInfo = &gMirageTower_3F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(MIRAGE_TOWER_4F), - .mapNum = MAP_NUM(MIRAGE_TOWER_4F), - .landMonsInfo = &gMirageTower_4F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(DESERT_UNDERPASS), - .mapNum = MAP_NUM(DESERT_UNDERPASS), - .landMonsInfo = &gDesertUnderpass_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ARTISAN_CAVE_B1F), - .mapNum = MAP_NUM(ARTISAN_CAVE_B1F), - .landMonsInfo = &gArtisanCave_B1F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ARTISAN_CAVE_1F), - .mapNum = MAP_NUM(ARTISAN_CAVE_1F), - .landMonsInfo = &gArtisanCave_1F_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ALTERING_CAVE), - .mapNum = MAP_NUM(ALTERING_CAVE), - .landMonsInfo = &gAlteringCave1_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ALTERING_CAVE), - .mapNum = MAP_NUM(ALTERING_CAVE), - .landMonsInfo = &gAlteringCave2_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ALTERING_CAVE), - .mapNum = MAP_NUM(ALTERING_CAVE), - .landMonsInfo = &gAlteringCave3_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ALTERING_CAVE), - .mapNum = MAP_NUM(ALTERING_CAVE), - .landMonsInfo = &gAlteringCave4_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ALTERING_CAVE), - .mapNum = MAP_NUM(ALTERING_CAVE), - .landMonsInfo = &gAlteringCave5_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ALTERING_CAVE), - .mapNum = MAP_NUM(ALTERING_CAVE), - .landMonsInfo = &gAlteringCave6_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ALTERING_CAVE), - .mapNum = MAP_NUM(ALTERING_CAVE), - .landMonsInfo = &gAlteringCave7_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ALTERING_CAVE), - .mapNum = MAP_NUM(ALTERING_CAVE), - .landMonsInfo = &gAlteringCave8_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(ALTERING_CAVE), - .mapNum = MAP_NUM(ALTERING_CAVE), - .landMonsInfo = &gAlteringCave9_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(METEOR_FALLS_STEVENS_CAVE), - .mapNum = MAP_NUM(METEOR_FALLS_STEVENS_CAVE), - .landMonsInfo = &gMeteorFalls_StevensCave_LandMonsInfo, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = MAP_GROUP(UNDEFINED), - .mapNum = MAP_NUM(UNDEFINED), - .landMonsInfo = NULL, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, -}; - -const struct WildPokemon gBattlePyramidPlaceholders_1[] = -{ - {5, 5, SPECIES_BULBASAUR}, - {5, 5, SPECIES_BULBASAUR}, - {5, 5, SPECIES_BULBASAUR}, - {5, 5, SPECIES_BULBASAUR}, - {5, 5, SPECIES_IVYSAUR}, - {5, 5, SPECIES_IVYSAUR}, - {5, 5, SPECIES_VENUSAUR}, - {5, 5, SPECIES_VENUSAUR}, - {5, 5, SPECIES_VENUSAUR}, - {5, 5, SPECIES_CHARMANDER}, - {5, 5, SPECIES_VENUSAUR}, - {5, 5, SPECIES_CHARMANDER}, -}; - -const struct WildPokemonInfo gBattlePyramidPlaceholders_1Info = {4, gBattlePyramidPlaceholders_1}; - -const struct WildPokemon gBattlePyramidPlaceholders_2[] = -{ - {5, 5, SPECIES_IVYSAUR}, - {5, 5, SPECIES_IVYSAUR}, - {5, 5, SPECIES_IVYSAUR}, - {5, 5, SPECIES_IVYSAUR}, - {5, 5, SPECIES_VENUSAUR}, - {5, 5, SPECIES_VENUSAUR}, - {5, 5, SPECIES_CHARMANDER}, - {5, 5, SPECIES_CHARMANDER}, - {5, 5, SPECIES_CHARMANDER}, - {5, 5, SPECIES_CHARMELEON}, - {5, 5, SPECIES_CHARMELEON}, - {5, 5, SPECIES_CHARMANDER}, -}; - -const struct WildPokemonInfo gBattlePyramidPlaceholders_2Info = {4, gBattlePyramidPlaceholders_2}; - -const struct WildPokemon gBattlePyramidPlaceholders_3[] = -{ - {5, 5, SPECIES_VENUSAUR}, - {5, 5, SPECIES_VENUSAUR}, - {5, 5, SPECIES_VENUSAUR}, - {5, 5, SPECIES_VENUSAUR}, - {5, 5, SPECIES_CHARMANDER}, - {5, 5, SPECIES_CHARMANDER}, - {5, 5, SPECIES_CHARMELEON}, - {5, 5, SPECIES_CHARMELEON}, - {5, 5, SPECIES_CHARMELEON}, - {5, 5, SPECIES_CHARIZARD}, - {5, 5, SPECIES_CHARMELEON}, - {5, 5, SPECIES_CHARIZARD}, -}; - -const struct WildPokemonInfo gBattlePyramidPlaceholders_3Info = {4, gBattlePyramidPlaceholders_3}; - -const struct WildPokemon gBattlePyramidPlaceholders_4[] = -{ - {5, 5, SPECIES_CHARMANDER}, - {5, 5, SPECIES_CHARMANDER}, - {5, 5, SPECIES_CHARMANDER}, - {5, 5, SPECIES_CHARMANDER}, - {5, 5, SPECIES_CHARMELEON}, - {5, 5, SPECIES_CHARMELEON}, - {5, 5, SPECIES_CHARIZARD}, - {5, 5, SPECIES_CHARIZARD}, - {5, 5, SPECIES_CHARIZARD}, - {5, 5, SPECIES_SQUIRTLE}, - {5, 5, SPECIES_CHARIZARD}, - {5, 5, SPECIES_SQUIRTLE}, -}; - -const struct WildPokemonInfo gBattlePyramidPlaceholders_4Info = {4, gBattlePyramidPlaceholders_4}; - -const struct WildPokemon gBattlePyramidPlaceholders_5[] = -{ - {5, 5, SPECIES_CHARMELEON}, - {5, 5, SPECIES_CHARMELEON}, - {5, 5, SPECIES_CHARMELEON}, - {5, 5, SPECIES_CHARMELEON}, - {5, 5, SPECIES_CHARIZARD}, - {5, 5, SPECIES_CHARIZARD}, - {5, 5, SPECIES_SQUIRTLE}, - {5, 5, SPECIES_SQUIRTLE}, - {5, 5, SPECIES_SQUIRTLE}, - {5, 5, SPECIES_WARTORTLE}, - {5, 5, SPECIES_SQUIRTLE}, - {5, 5, SPECIES_WARTORTLE}, -}; - -const struct WildPokemonInfo gBattlePyramidPlaceholders_5Info = {4, gBattlePyramidPlaceholders_5}; - -const struct WildPokemon gBattlePyramidPlaceholders_6[] = -{ - {5, 5, SPECIES_CHARIZARD}, - {5, 5, SPECIES_CHARIZARD}, - {5, 5, SPECIES_CHARIZARD}, - {5, 5, SPECIES_CHARMELEON}, - {5, 5, SPECIES_SQUIRTLE}, - {5, 5, SPECIES_SQUIRTLE}, - {5, 5, SPECIES_WARTORTLE}, - {5, 5, SPECIES_WARTORTLE}, - {5, 5, SPECIES_WARTORTLE}, - {5, 5, SPECIES_WARTORTLE}, - {5, 5, SPECIES_WARTORTLE}, - {5, 5, SPECIES_WARTORTLE}, -}; - -const struct WildPokemonInfo gBattlePyramidPlaceholders_6Info = {4, gBattlePyramidPlaceholders_6}; - -const struct WildPokemon gBattlePyramidPlaceholders_7[] = -{ - {5, 5, SPECIES_WARTORTLE}, - {5, 5, SPECIES_WARTORTLE}, - {5, 5, SPECIES_SQUIRTLE}, - {5, 5, SPECIES_SQUIRTLE}, - {5, 5, SPECIES_SQUIRTLE}, - {5, 5, SPECIES_CHARIZARD}, - {5, 5, SPECIES_CHARIZARD}, - {5, 5, SPECIES_CHARIZARD}, - {5, 5, SPECIES_CHARMELEON}, - {5, 5, SPECIES_CHARMELEON}, - {5, 5, SPECIES_CHARMELEON}, - {5, 5, SPECIES_CHARMELEON}, -}; - -const struct WildPokemonInfo gBattlePyramidPlaceholders_7Info = {8, gBattlePyramidPlaceholders_7}; - -const struct WildPokemonHeader gBattlePyramidWildMonHeaders[] = -{ - { - .mapGroup = 0, - .mapNum = 1, - .landMonsInfo = &gBattlePyramidPlaceholders_1Info, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = 0, - .mapNum = 2, - .landMonsInfo = &gBattlePyramidPlaceholders_2Info, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = 0, - .mapNum = 3, - .landMonsInfo = &gBattlePyramidPlaceholders_3Info, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = 0, - .mapNum = 4, - .landMonsInfo = &gBattlePyramidPlaceholders_4Info, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = 0, - .mapNum = 5, - .landMonsInfo = &gBattlePyramidPlaceholders_5Info, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = 0, - .mapNum = 6, - .landMonsInfo = &gBattlePyramidPlaceholders_6Info, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = 0, - .mapNum = 7, - .landMonsInfo = &gBattlePyramidPlaceholders_7Info, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = 255, - .mapNum = 255, - .landMonsInfo = NULL, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, -}; - -const struct WildPokemon gBattlePikeMons_1[] = -{ - {5, 5, SPECIES_SEVIPER}, - {5, 5, SPECIES_MILOTIC}, - {5, 5, SPECIES_DUSCLOPS}, - {5, 5, SPECIES_DUSCLOPS}, - {5, 5, SPECIES_DUSCLOPS}, - {5, 5, SPECIES_DUSCLOPS}, - {5, 5, SPECIES_SEVIPER}, - {5, 5, SPECIES_MILOTIC}, - {5, 5, SPECIES_DUSCLOPS}, - {5, 5, SPECIES_DUSCLOPS}, - {5, 5, SPECIES_SEVIPER}, - {5, 5, SPECIES_MILOTIC}, -}; - -const struct WildPokemonInfo gBattlePikeMonsInfo_1 = {10, gBattlePikeMons_1}; - -const struct WildPokemon gBattlePikeMons_2[] = -{ - {5, 5, SPECIES_SEVIPER}, - {5, 5, SPECIES_MILOTIC}, - {5, 5, SPECIES_ELECTRODE}, - {5, 5, SPECIES_ELECTRODE}, - {5, 5, SPECIES_ELECTRODE}, - {5, 5, SPECIES_ELECTRODE}, - {5, 5, SPECIES_SEVIPER}, - {5, 5, SPECIES_MILOTIC}, - {5, 5, SPECIES_ELECTRODE}, - {5, 5, SPECIES_ELECTRODE}, - {5, 5, SPECIES_SEVIPER}, - {5, 5, SPECIES_MILOTIC}, -}; - -const struct WildPokemonInfo gBattlePikeMonsInfo_2 = {10, gBattlePikeMons_2}; - -const struct WildPokemon gBattlePikeMons_3[] = -{ - {5, 5, SPECIES_SEVIPER}, - {5, 5, SPECIES_MILOTIC}, - {5, 5, SPECIES_BRELOOM}, - {5, 5, SPECIES_BRELOOM}, - {5, 5, SPECIES_BRELOOM}, - {5, 5, SPECIES_BRELOOM}, - {5, 5, SPECIES_SEVIPER}, - {5, 5, SPECIES_MILOTIC}, - {5, 5, SPECIES_BRELOOM}, - {5, 5, SPECIES_BRELOOM}, - {5, 5, SPECIES_SEVIPER}, - {5, 5, SPECIES_MILOTIC}, -}; - -const struct WildPokemonInfo gBattlePikeMonsInfo_3 = {10, gBattlePikeMons_3}; - -const struct WildPokemon gBattlePikeMons_4[] = -{ - {5, 5, SPECIES_SEVIPER}, - {5, 5, SPECIES_MILOTIC}, - {5, 5, SPECIES_WOBBUFFET}, - {5, 5, SPECIES_WOBBUFFET}, - {5, 5, SPECIES_WOBBUFFET}, - {5, 5, SPECIES_WOBBUFFET}, - {5, 5, SPECIES_SEVIPER}, - {5, 5, SPECIES_MILOTIC}, - {5, 5, SPECIES_WOBBUFFET}, - {5, 5, SPECIES_WOBBUFFET}, - {5, 5, SPECIES_SEVIPER}, - {5, 5, SPECIES_MILOTIC}, -}; - -const struct WildPokemonInfo gBattlePikeMonsInfo_4 = {10, gBattlePikeMons_4}; - -const struct WildPokemonHeader gBattlePikeWildMonHeaders[] = -{ - { - .mapGroup = 0, - .mapNum = 1, - .landMonsInfo = &gBattlePikeMonsInfo_1, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = 0, - .mapNum = 2, - .landMonsInfo = &gBattlePikeMonsInfo_2, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = 0, - .mapNum = 3, - .landMonsInfo = &gBattlePikeMonsInfo_3, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = 0, - .mapNum = 4, - .landMonsInfo = &gBattlePikeMonsInfo_4, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, - { - .mapGroup = 255, - .mapNum = 255, - .landMonsInfo = NULL, - .waterMonsInfo = NULL, - .rockSmashMonsInfo = NULL, - .fishingMonsInfo = NULL, - }, -}; - -const struct WildPokemon gWildFeebasRoute119Data = {20, 25, SPECIES_FEEBAS}; - -const u16 gRoute119WaterTileData[] = -{ - 0, 0x2D, 0, - 0x2E, 0x5B, 0x83, - 0x5C, 0x8B, 0x12A, -}; +#include "data/wild_encounters.h" // code void DisableWildEncounters(bool8 disabled) @@ -4639,20 +88,12 @@ static bool8 CheckFeebas(void) x -= 7; y -= 7; -#ifdef NONMATCHING + if (y >= gRoute119WaterTileData[3 * 0 + 0] && y <= gRoute119WaterTileData[3 * 0 + 1]) + route119Section = 0; if (y >= gRoute119WaterTileData[3 * 1 + 0] && y <= gRoute119WaterTileData[3 * 1 + 1]) route119Section = 1; if (y >= gRoute119WaterTileData[3 * 2 + 0] && y <= gRoute119WaterTileData[3 * 2 + 1]) route119Section = 2; -#else - { - register const u16 *arr asm("r0"); - if (y >= (arr = gRoute119WaterTileData)[3 * 1 + 0] && y <= arr[3 * 1 + 1]) - route119Section = 1; - if (y >= arr[3 * 2 + 0] && y <= arr[3 * 2 + 1]) - route119Section = 2; - } -#endif if (Random() % 100 > 49) // 50% chance of encountering Feebas return FALSE; @@ -4802,7 +243,7 @@ static u8 ChooseWildMonLevel(const struct WildPokemon *wildPokemon) rand = Random() % range; // check ability for max level mon - if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_BIT3)) + if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) { u8 ability = GetMonAbility(&gPlayerParty[0]); if (ability == ABILITY_HUSTLE || ability == ABILITY_VITAL_SPIRIT || ability == ABILITY_PRESSURE) @@ -4883,7 +324,7 @@ static u8 PickWildMonNature(void) } } // check synchronize for a pokemon with the same ability - if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_BIT3) + if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG) && GetMonAbility(&gPlayerParty[0]) == ABILITY_SYNCHRONIZE && Random() % 2 == 0) { @@ -4911,7 +352,7 @@ static void CreateWildMon(u16 species, u8 level) } if (checkCuteCharm - && !GetMonData(&gPlayerParty[0], MON_DATA_SANITY_BIT3) + && !GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG) && GetMonAbility(&gPlayerParty[0]) == ABILITY_CUTE_CHARM && Random() % 3 != 0) { @@ -5029,7 +470,7 @@ static bool8 DoWildEncounterRateTest(u32 encounterRate, bool8 ignoreAbility) encounterRate = encounterRate * 80 / 100; ApplyFluteEncounterRateMod(&encounterRate); ApplyCleanseTagEncounterRateMod(&encounterRate); - if (!ignoreAbility && !GetMonData(&gPlayerParty[0], MON_DATA_SANITY_BIT3)) + if (!ignoreAbility && !GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) { u32 ability = GetMonAbility(&gPlayerParty[0]); @@ -5419,7 +860,7 @@ static bool8 IsAbilityAllowingEncounter(u8 level) { u8 ability; - if (GetMonData(&gPlayerParty[0], MON_DATA_SANITY_BIT3)) + if (GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) return TRUE; ability = GetMonAbility(&gPlayerParty[0]); @@ -5456,7 +897,7 @@ static bool8 TryGetRandomWildMonIndexByType(const struct WildPokemon *wildMon, u static bool8 TryGetAbilityInfluencedWildMonIndex(const struct WildPokemon *wildMon, u8 type, u8 ability, u8 *monIndex) { - if (GetMonData(&gPlayerParty[0], MON_DATA_SANITY_BIT3)) + if (GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) return FALSE; else if (GetMonAbility(&gPlayerParty[0]) != ability) return FALSE; diff --git a/src/window.c b/src/window.c index 4e1a38eff..aa1df3a12 100644 --- a/src/window.c +++ b/src/window.c @@ -276,16 +276,16 @@ void CopyWindowToVram(u8 windowId, u8 mode) switch (mode) { - case 1: - CopyBgTilemapBufferToVram(windowLocal.window.bg); - break; - case 2: - LoadBgTiles(windowLocal.window.bg, windowLocal.tileData, windowSize, windowLocal.window.baseBlock); - break; - case 3: - LoadBgTiles(windowLocal.window.bg, windowLocal.tileData, windowSize, windowLocal.window.baseBlock); - CopyBgTilemapBufferToVram(windowLocal.window.bg); - break; + case 1: + CopyBgTilemapBufferToVram(windowLocal.window.bg); + break; + case 2: + LoadBgTiles(windowLocal.window.bg, windowLocal.tileData, windowSize, windowLocal.window.baseBlock); + break; + case 3: + LoadBgTiles(windowLocal.window.bg, windowLocal.tileData, windowSize, windowLocal.window.baseBlock); + CopyBgTilemapBufferToVram(windowLocal.window.bg); + break; } } @@ -308,16 +308,16 @@ void CopyWindowRectToVram(u32 windowId, u32 mode, u32 x, u32 y, u32 w, u32 h) switch (mode) { - case 1: - CopyBgTilemapBufferToVram(windowLocal.window.bg); - break; - case 2: - LoadBgTiles(windowLocal.window.bg, windowLocal.tileData + (rectPos * 32), rectSize, windowLocal.window.baseBlock + rectPos); - break; - case 3: - LoadBgTiles(windowLocal.window.bg, windowLocal.tileData + (rectPos * 32), rectSize, windowLocal.window.baseBlock + rectPos); - CopyBgTilemapBufferToVram(windowLocal.window.bg); - break; + case 1: + CopyBgTilemapBufferToVram(windowLocal.window.bg); + break; + case 2: + LoadBgTiles(windowLocal.window.bg, windowLocal.tileData + (rectPos * 32), rectSize, windowLocal.window.baseBlock + rectPos); + break; + case 3: + LoadBgTiles(windowLocal.window.bg, windowLocal.tileData + (rectPos * 32), rectSize, windowLocal.window.baseBlock + rectPos); + CopyBgTilemapBufferToVram(windowLocal.window.bg); + break; } } } @@ -601,7 +601,7 @@ static void nullsub_9(void) } -u16 AddWindow8Bit(struct WindowTemplate *template) +u16 AddWindow8Bit(const struct WindowTemplate *template) { u16 windowId; u8* memAddress; @@ -669,12 +669,12 @@ void FillWindowPixelRect8Bit(u8 windowId, u8 fillValue, u16 x, u16 y, u16 width, FillBitmapRect8Bit(&pixelRect, x, y, width, height, fillValue); } -void BlitBitmapRectToWindow4BitTo8Bit(u8 windowId, u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 paletteNum) +void BlitBitmapRectToWindow4BitTo8Bit(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 paletteNum) { struct Bitmap sourceRect; struct Bitmap destRect; - sourceRect.pixels = (u8*)pixels; + sourceRect.pixels = (u8*) pixels; sourceRect.width = srcWidth; sourceRect.height = srcHeight; @@ -692,16 +692,16 @@ void CopyWindowToVram8Bit(u8 windowId, u8 mode) switch (mode) { - case 1: - CopyBgTilemapBufferToVram(sWindowPtr->window.bg); - break; - case 2: - LoadBgTiles(sWindowPtr->window.bg, sWindowPtr->tileData, sWindowSize, sWindowPtr->window.baseBlock); - break; - case 3: - LoadBgTiles(sWindowPtr->window.bg, sWindowPtr->tileData, sWindowSize, sWindowPtr->window.baseBlock); - CopyBgTilemapBufferToVram(sWindowPtr->window.bg); - break; + case 1: + CopyBgTilemapBufferToVram(sWindowPtr->window.bg); + break; + case 2: + LoadBgTiles(sWindowPtr->window.bg, sWindowPtr->tileData, sWindowSize, sWindowPtr->window.baseBlock); + break; + case 3: + LoadBgTiles(sWindowPtr->window.bg, sWindowPtr->tileData, sWindowSize, sWindowPtr->window.baseBlock); + CopyBgTilemapBufferToVram(sWindowPtr->window.bg); + break; } } |