Merge branch 'master' into pokeball-doc
This commit is contained in:
@@ -918,7 +918,7 @@ static void rfu_LMAN_REQ_callback(u16 reqCommandId, u16 reqResult)
|
||||
{
|
||||
lman.reserveDisconnectSlot_flag = 0;
|
||||
lman.acceptCount = 0;
|
||||
lman.acceptSlot_flag = 0;;
|
||||
lman.acceptSlot_flag = 0;
|
||||
lman.parent_child = MODE_NEUTRAL;
|
||||
rfu_LMAN_managerChangeAgbClockMaster();
|
||||
if (reqCommandId == ID_STOP_MODE_REQ)
|
||||
|
||||
+13
-13
@@ -41,7 +41,7 @@ u16 ReadFlashId(void)
|
||||
u8 (*readFlash1)(u8 *);
|
||||
|
||||
SetReadFlash1(readFlash1Buffer);
|
||||
readFlash1 = (u8 (*)(u8 *))((s32)readFlash1Buffer + 1);
|
||||
readFlash1 = (u8 (*)(u8 *))((uintptr_t)readFlash1Buffer + 1);
|
||||
|
||||
// Enter ID mode.
|
||||
FLASH_WRITE(0x5555, 0xAA);
|
||||
@@ -113,12 +113,12 @@ void SetReadFlash1(u16 *dest)
|
||||
u16 *src;
|
||||
u16 i;
|
||||
|
||||
PollFlashStatus = (u8 (*)(u8 *))((s32)dest + 1);
|
||||
PollFlashStatus = (u8 (*)(u8 *))((uintptr_t)dest + 1);
|
||||
|
||||
src = (u16 *)ReadFlash1;
|
||||
src = (u16 *)((s32)src ^ 1);
|
||||
src = (u16 *)((uintptr_t)src ^ 1);
|
||||
|
||||
i = ((s32)SetReadFlash1 - (s32)ReadFlash1) >> 1;
|
||||
i = ((uintptr_t)SetReadFlash1 - (uintptr_t)ReadFlash1) >> 1;
|
||||
|
||||
while (i != 0)
|
||||
{
|
||||
@@ -154,10 +154,10 @@ void ReadFlash(u16 sectorNum, u32 offset, u8 *dest, u32 size)
|
||||
}
|
||||
|
||||
funcSrc = (u16 *)ReadFlash_Core;
|
||||
funcSrc = (u16 *)((s32)funcSrc ^ 1);
|
||||
funcSrc = (u16 *)((uintptr_t)funcSrc ^ 1);
|
||||
funcDest = readFlash_Core_Buffer;
|
||||
|
||||
i = ((s32)ReadFlash - (s32)ReadFlash_Core) >> 1;
|
||||
i = ((uintptr_t)ReadFlash - (uintptr_t)ReadFlash_Core) >> 1;
|
||||
|
||||
while (i != 0)
|
||||
{
|
||||
@@ -165,7 +165,7 @@ void ReadFlash(u16 sectorNum, u32 offset, u8 *dest, u32 size)
|
||||
i--;
|
||||
}
|
||||
|
||||
readFlash_Core = (void (*)(vu8 *, u8 *, u32))((s32)readFlash_Core_Buffer + 1);
|
||||
readFlash_Core = (void (*)(vu8 *, u8 *, u32))((uintptr_t)readFlash_Core_Buffer + 1);
|
||||
|
||||
src = FLASH_BASE + (sectorNum << gFlash->sector.shift) + offset;
|
||||
|
||||
@@ -202,10 +202,10 @@ u32 VerifyFlashSector(u16 sectorNum, u8 *src)
|
||||
}
|
||||
|
||||
funcSrc = (u16 *)VerifyFlashSector_Core;
|
||||
funcSrc = (u16 *)((s32)funcSrc ^ 1);
|
||||
funcSrc = (u16 *)((uintptr_t)funcSrc ^ 1);
|
||||
funcDest = verifyFlashSector_Core_Buffer;
|
||||
|
||||
i = ((s32)VerifyFlashSector - (s32)VerifyFlashSector_Core) >> 1;
|
||||
i = (u16)(((uintptr_t)VerifyFlashSector - (uintptr_t)VerifyFlashSector_Core) >> 1);
|
||||
|
||||
while (i != 0)
|
||||
{
|
||||
@@ -213,7 +213,7 @@ u32 VerifyFlashSector(u16 sectorNum, u8 *src)
|
||||
i--;
|
||||
}
|
||||
|
||||
verifyFlashSector_Core = (u32 (*)(u8 *, u8 *, u32))((s32)verifyFlashSector_Core_Buffer + 1);
|
||||
verifyFlashSector_Core = (u32 (*)(u8 *, u8 *, u32))((uintptr_t)verifyFlashSector_Core_Buffer + 1);
|
||||
|
||||
tgt = FLASH_BASE + (sectorNum << gFlash->sector.shift);
|
||||
size = gFlash->sector.size;
|
||||
@@ -239,10 +239,10 @@ u32 VerifyFlashSectorNBytes(u16 sectorNum, u8 *src, u32 n)
|
||||
REG_WAITCNT = (REG_WAITCNT & ~WAITCNT_SRAM_MASK) | WAITCNT_SRAM_8;
|
||||
|
||||
funcSrc = (u16 *)VerifyFlashSector_Core;
|
||||
funcSrc = (u16 *)((s32)funcSrc ^ 1);
|
||||
funcSrc = (u16 *)((uintptr_t)funcSrc ^ 1);
|
||||
funcDest = verifyFlashSector_Core_Buffer;
|
||||
|
||||
i = ((s32)VerifyFlashSector - (s32)VerifyFlashSector_Core) >> 1;
|
||||
i = ((uintptr_t)VerifyFlashSector - (uintptr_t)VerifyFlashSector_Core) >> 1;
|
||||
|
||||
while (i != 0)
|
||||
{
|
||||
@@ -250,7 +250,7 @@ u32 VerifyFlashSectorNBytes(u16 sectorNum, u8 *src, u32 n)
|
||||
i--;
|
||||
}
|
||||
|
||||
verifyFlashSector_Core = (u32 (*)(u8 *, u8 *, u32))((s32)verifyFlashSector_Core_Buffer + 1);
|
||||
verifyFlashSector_Core = (u32 (*)(u8 *, u8 *, u32))((uintptr_t)verifyFlashSector_Core_Buffer + 1);
|
||||
|
||||
tgt = FLASH_BASE + (sectorNum << gFlash->sector.shift);
|
||||
|
||||
|
||||
@@ -314,8 +314,8 @@ static bool8 AreStatsRaised(void)
|
||||
|
||||
for (i = 0; i < NUM_BATTLE_STATS; i++)
|
||||
{
|
||||
if (gBattleMons[gActiveBattler].statStages[i] > 6)
|
||||
buffedStatsValue += gBattleMons[gActiveBattler].statStages[i] - 6;
|
||||
if (gBattleMons[gActiveBattler].statStages[i] > DEFAULT_STAT_STAGE)
|
||||
buffedStatsValue += gBattleMons[gActiveBattler].statStages[i] - DEFAULT_STAT_STAGE;
|
||||
}
|
||||
|
||||
return (buffedStatsValue > 3);
|
||||
|
||||
+4
-4
@@ -1849,8 +1849,8 @@ void LaunchBattleAnimation(const u8 *const animsTable[], u16 tableId, bool8 isMo
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < 4; i++)
|
||||
gAnimBattlerSpecies[i] = gContestResources->field_18->species;
|
||||
for (i = 0; i < CONTESTANT_COUNT; i++)
|
||||
gAnimBattlerSpecies[i] = gContestResources->moveAnim->species;
|
||||
}
|
||||
|
||||
if (!isMoveAnim)
|
||||
@@ -2311,7 +2311,7 @@ void MoveBattlerSpriteToBG(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible)
|
||||
battlerSpriteId = gBattlerSpriteIds[battlerId];
|
||||
|
||||
gBattle_BG1_X = -(gSprites[battlerSpriteId].pos1.x + gSprites[battlerSpriteId].pos2.x) + 0x20;
|
||||
if (IsContest() && IsSpeciesNotUnown(gContestResources->field_18->species))
|
||||
if (IsContest() && IsSpeciesNotUnown(gContestResources->moveAnim->species))
|
||||
gBattle_BG1_X--;
|
||||
|
||||
gBattle_BG1_Y = -(gSprites[battlerSpriteId].pos1.y + gSprites[battlerSpriteId].pos2.y) + 0x20;
|
||||
@@ -2369,7 +2369,7 @@ static void sub_80A46A0(void)
|
||||
struct BattleAnimBgData animBg;
|
||||
u16 *ptr;
|
||||
|
||||
if (IsSpeciesNotUnown(gContestResources->field_18->species))
|
||||
if (IsSpeciesNotUnown(gContestResources->moveAnim->species))
|
||||
{
|
||||
sub_80A6B30(&animBg);
|
||||
ptr = animBg.bgTilemap;
|
||||
|
||||
+13
-25
@@ -372,14 +372,11 @@ static void AnimTranslateStinger(struct Sprite *sprite)
|
||||
{
|
||||
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
|
||||
}
|
||||
else
|
||||
else if (GetBattlerSide(gBattleAnimAttacker))
|
||||
{
|
||||
if (GetBattlerSide(gBattleAnimAttacker))
|
||||
{
|
||||
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
|
||||
gBattleAnimArgs[1] = -gBattleAnimArgs[1];
|
||||
gBattleAnimArgs[3] = -gBattleAnimArgs[3];
|
||||
}
|
||||
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
|
||||
gBattleAnimArgs[1] = -gBattleAnimArgs[1];
|
||||
gBattleAnimArgs[3] = -gBattleAnimArgs[3];
|
||||
}
|
||||
|
||||
if (!IsContest() && GetBattlerSide(gBattleAnimAttacker) == GetBattlerSide(gBattleAnimTarget))
|
||||
@@ -387,13 +384,8 @@ static void AnimTranslateStinger(struct Sprite *sprite)
|
||||
if (GetBattlerPosition(gBattleAnimTarget) == B_POSITION_PLAYER_LEFT
|
||||
|| GetBattlerPosition(gBattleAnimTarget) == B_POSITION_OPPONENT_LEFT)
|
||||
{
|
||||
s16 temp1, temp2;
|
||||
|
||||
temp1 = gBattleAnimArgs[2];
|
||||
gBattleAnimArgs[2] = -temp1;
|
||||
|
||||
temp2 = gBattleAnimArgs[0];
|
||||
gBattleAnimArgs[0] = -temp2;
|
||||
gBattleAnimArgs[2] *= -1;
|
||||
gBattleAnimArgs[0] *= -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,28 +440,24 @@ static void AnimMissileArc_Step(struct Sprite *sprite)
|
||||
else
|
||||
{
|
||||
s16 tempData[8];
|
||||
u16 *data = sprite->data;
|
||||
u16 x1 = sprite->pos1.x;
|
||||
s16 x2 = sprite->pos2.x;
|
||||
u16 y1 = sprite->pos1.y;
|
||||
s16 y2 = sprite->pos2.y;
|
||||
s16 xpos, ypos;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
tempData[i] = data[i];
|
||||
tempData[i] = sprite->data[i];
|
||||
|
||||
x2 += x1;
|
||||
y2 += y1;
|
||||
xpos = sprite->pos1.x + sprite->pos2.x;
|
||||
ypos = sprite->pos1.y + sprite->pos2.y;
|
||||
|
||||
if (!TranslateAnimHorizontalArc(sprite))
|
||||
{
|
||||
u16 rotation = ArcTan2Neg(sprite->pos1.x + sprite->pos2.x - x2,
|
||||
sprite->pos1.y + sprite->pos2.y - y2);
|
||||
u16 rotation = ArcTan2Neg(sprite->pos1.x + sprite->pos2.x - xpos, //Isn't this zero lol
|
||||
sprite->pos1.y + sprite->pos2.y - ypos);
|
||||
rotation += 0xC000;
|
||||
TrySetSpriteRotScale(sprite, FALSE, 0x100, 0x100, rotation);
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
data[i] = tempData[i];
|
||||
sprite->data[i] = tempData[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -849,7 +849,7 @@ void AnimTask_MetallicShine(u8 taskId)
|
||||
|
||||
if (IsContest())
|
||||
{
|
||||
species = gContestResources->field_18->species;
|
||||
species = gContestResources->moveAnim->species;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+12
-11
@@ -3178,14 +3178,14 @@ static void AnimItemSteal_Step3(struct Sprite* sprite)
|
||||
|
||||
sprite->pos2.y = Sin(sprite->data[0] + 0x80, 30 - sprite->data[1] * 8);
|
||||
if (sprite->pos2.y == 0)
|
||||
PlaySE12WithPanning(SE_W145B, BattleAnimAdjustPanning(63));
|
||||
PlaySE12WithPanning(SE_M_BUBBLE2, BattleAnimAdjustPanning(63));
|
||||
|
||||
if (moveAlongLinearPath(sprite))
|
||||
{
|
||||
sprite->pos2.y = 0;
|
||||
sprite->data[0] = 0;
|
||||
sprite->callback = AnimItemSteal_Step2;
|
||||
PlaySE12WithPanning(SE_W145B, BattleAnimAdjustPanning(-64));
|
||||
PlaySE12WithPanning(SE_M_BUBBLE2, BattleAnimAdjustPanning(-64));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3967,24 +3967,25 @@ static void AnimProtect(struct Sprite* sprite)
|
||||
|
||||
static void AnimProtect_Step(struct Sprite *sprite)
|
||||
{
|
||||
int a;
|
||||
int i;
|
||||
int i, savedPal;
|
||||
sprite->data[5] += 96;
|
||||
sprite->pos2.x = -(sprite->data[5] >> 8);
|
||||
if (++sprite->data[1] > 1)
|
||||
{
|
||||
int id;
|
||||
sprite->data[1] = 0;
|
||||
a = gPlttBufferFaded[sprite->data[2] + 1];
|
||||
savedPal = gPlttBufferFaded[sprite->data[2] + 1];
|
||||
i = 0;
|
||||
do
|
||||
{
|
||||
gPlttBufferFaded[sprite->data[2] + ++i] = gPlttBufferFaded[sprite->data[2] + i + 1];
|
||||
id = sprite->data[2] + ++i;
|
||||
gPlttBufferFaded[id] = gPlttBufferFaded[id + 1];
|
||||
} while (i < 6);
|
||||
|
||||
gPlttBufferFaded[sprite->data[2] + 7] = a;
|
||||
gPlttBufferFaded[sprite->data[2] + 7] = savedPal;
|
||||
}
|
||||
|
||||
if (sprite->data[7] > 6 && sprite->data[0] >0 && ++sprite->data[6] > 1)
|
||||
if (sprite->data[7] > 6 && sprite->data[0] > 0 && ++sprite->data[6] > 1)
|
||||
{
|
||||
sprite->data[6] = 0;
|
||||
sprite->data[7] -= 1;
|
||||
@@ -4259,7 +4260,7 @@ static void AnimLockOnTarget_Step1(struct Sprite* sprite)
|
||||
sprite->callback = StartAnimLinearTranslation;
|
||||
StoreSpriteCallbackInData6(sprite, AnimLockOnTarget_Step2);
|
||||
sprite->data[5] += 0x100;
|
||||
PlaySE12WithPanning(SE_W199, BattleAnimAdjustPanning(63));
|
||||
PlaySE12WithPanning(SE_M_LOCK_ON, BattleAnimAdjustPanning(63));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -4345,7 +4346,7 @@ static void AnimLockOnTarget_Step4(struct Sprite* sprite)
|
||||
sprite->data[2]++;
|
||||
pal = sprite->oam.paletteNum;
|
||||
LoadPalette(&gPlttBufferUnfaded[0x108 + pal * 16], pal * 16 | 0x101, 4);
|
||||
PlaySE12WithPanning(SE_W043, BattleAnimAdjustPanning(63));
|
||||
PlaySE12WithPanning(SE_M_LEER, BattleAnimAdjustPanning(63));
|
||||
}
|
||||
else if (sprite->data[1] == 0)
|
||||
{
|
||||
@@ -4820,7 +4821,7 @@ static void AnimSharpenSphere_Step(struct Sprite* sprite)
|
||||
{
|
||||
sprite->data[4]++;
|
||||
if (!(sprite->data[4] & 1))
|
||||
PlaySE12WithPanning(SE_W207B, sprite->data[5]);
|
||||
PlaySE12WithPanning(SE_M_SWAGGER2, sprite->data[5]);
|
||||
}
|
||||
|
||||
sprite->data[0] = 0;
|
||||
|
||||
@@ -1632,7 +1632,7 @@ static void AirCutterProjectileStep1(u8 taskId)
|
||||
gTasks[taskId].data[gTasks[taskId].data[1] + 13] = spriteId;
|
||||
gTasks[taskId].data[0] = gTasks[taskId].data[3];
|
||||
gTasks[taskId].data[1]++;
|
||||
PlaySE12WithPanning(SE_W059B, BattleAnimAdjustPanning(-63));
|
||||
PlaySE12WithPanning(SE_M_BLIZZARD2, BattleAnimAdjustPanning(-63));
|
||||
if (gTasks[taskId].data[1] > 2)
|
||||
gTasks[taskId].func = AirCutterProjectileStep2;
|
||||
}
|
||||
@@ -1829,7 +1829,7 @@ static void AnimBulletSeed_Step1(struct Sprite *sprite)
|
||||
int i;
|
||||
u16 rand;
|
||||
s16* ptr;
|
||||
PlaySE12WithPanning(SE_W030, BattleAnimAdjustPanning(63));
|
||||
PlaySE12WithPanning(SE_M_HORN_ATTACK, BattleAnimAdjustPanning(63));
|
||||
sprite->pos1.x += sprite->pos2.x;
|
||||
sprite->pos1.y += sprite->pos2.y;
|
||||
sprite->pos2.y = 0;
|
||||
@@ -2502,7 +2502,7 @@ static void AnimPencil_Step(struct Sprite *sprite)
|
||||
sprite->pos1.y -= 1;
|
||||
sprite->data[2]++;
|
||||
if (sprite->data[2] % 10 == 0)
|
||||
PlaySE12WithPanning(SE_W166, sprite->data[6]);
|
||||
PlaySE12WithPanning(SE_M_SKETCH, sprite->data[6]);
|
||||
}
|
||||
sprite->data[4] += sprite->data[3];
|
||||
if (sprite->data[4] > 31)
|
||||
|
||||
+19
-19
@@ -1647,7 +1647,7 @@ static void AnimClappingHand_Step(struct Sprite *sprite)
|
||||
sprite->data[2]++;
|
||||
if (sprite->data[3] == 0)
|
||||
{
|
||||
PlaySE1WithPanning(SE_W227, BattleAnimAdjustPanning(-64));
|
||||
PlaySE1WithPanning(SE_M_ENCORE, BattleAnimAdjustPanning(-64));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1931,7 +1931,7 @@ static void TormentAttacker_Step(u8 taskId)
|
||||
|
||||
y = task->data[3] + task->data[5];
|
||||
spriteId = CreateSprite(&gThoughtBubbleSpriteTemplate, x, y, 6 - task->data[1]);
|
||||
PlaySE12WithPanning(SE_W118, BattleAnimAdjustPanning(-64));
|
||||
PlaySE12WithPanning(SE_M_METRONOME, BattleAnimAdjustPanning(-64));
|
||||
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
@@ -2297,7 +2297,7 @@ void AnimTask_TransformMon(u8 taskId)
|
||||
LoadBgTiles(1, animBg.bgTiles, 0x800, animBg.tilesOffset);
|
||||
if (IsContest())
|
||||
{
|
||||
if (IsSpeciesNotUnown(gContestResources->field_18->species) != IsSpeciesNotUnown(gContestResources->field_18->unk2))
|
||||
if (IsSpeciesNotUnown(gContestResources->moveAnim->species) != IsSpeciesNotUnown(gContestResources->moveAnim->targetSpecies))
|
||||
{
|
||||
bgTilemap = (u16 *)animBg.bgTilemap;
|
||||
for (i = 0; i < 8; i++)
|
||||
@@ -2319,7 +2319,7 @@ void AnimTask_TransformMon(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
if (IsSpeciesNotUnown(gContestResources->field_18->unk2))
|
||||
if (IsSpeciesNotUnown(gContestResources->moveAnim->targetSpecies))
|
||||
gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gUnknown_082FF6C0;
|
||||
else
|
||||
gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gUnknown_082FF694;
|
||||
@@ -2412,7 +2412,7 @@ void AnimTask_MorningSunLightBeam(u8 taskId)
|
||||
gTasks[taskId].data[11] = gBattle_BG1_Y;
|
||||
|
||||
gTasks[taskId].data[0]++;
|
||||
PlaySE12WithPanning(SE_W234, BattleAnimAdjustPanning(-64));
|
||||
PlaySE12WithPanning(SE_M_MORNING_SUN, BattleAnimAdjustPanning(-64));
|
||||
break;
|
||||
case 1:
|
||||
if (gTasks[taskId].data[4]++ > 0)
|
||||
@@ -2447,7 +2447,7 @@ void AnimTask_MorningSunLightBeam(u8 taskId)
|
||||
{
|
||||
gTasks[taskId].data[3] = 0;
|
||||
gTasks[taskId].data[0] = 1;
|
||||
PlaySE12WithPanning(SE_W234, BattleAnimAdjustPanning(-64));
|
||||
PlaySE12WithPanning(SE_M_MORNING_SUN, BattleAnimAdjustPanning(-64));
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
@@ -3196,10 +3196,10 @@ void AnimTask_RolePlaySilhouette(u8 taskId)
|
||||
GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
||||
if (IsContest())
|
||||
{
|
||||
isBackPic = 1;
|
||||
personality = gContestResources->field_18->unk10;
|
||||
otId = gContestResources->field_18->unkC;
|
||||
species = gContestResources->field_18->unk2;
|
||||
isBackPic = TRUE;
|
||||
personality = gContestResources->moveAnim->targetPersonality;
|
||||
otId = gContestResources->moveAnim->otId;
|
||||
species = gContestResources->moveAnim->targetSpecies;
|
||||
xOffset = 20;
|
||||
priority = GetBattlerSpriteBGPriority(gBattleAnimAttacker);
|
||||
}
|
||||
@@ -4769,7 +4769,7 @@ static void AnimTask_MonToSubstituteDoll(u8 taskId)
|
||||
|
||||
if (gSprites[spriteId].pos2.y == 0)
|
||||
{
|
||||
PlaySE12WithPanning(SE_W145B, BattleAnimAdjustPanning(-64));
|
||||
PlaySE12WithPanning(SE_M_BUBBLE2, BattleAnimAdjustPanning(-64));
|
||||
gTasks[taskId].data[10] -= 0x800;
|
||||
gTasks[taskId].data[0]++;
|
||||
}
|
||||
@@ -4791,7 +4791,7 @@ static void AnimTask_MonToSubstituteDoll(u8 taskId)
|
||||
|
||||
if (gSprites[spriteId].pos2.y == 0)
|
||||
{
|
||||
PlaySE12WithPanning(SE_W145B, BattleAnimAdjustPanning(-64));
|
||||
PlaySE12WithPanning(SE_M_BUBBLE2, BattleAnimAdjustPanning(-64));
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
break;
|
||||
@@ -4828,7 +4828,7 @@ static void AnimBlockX_Step(struct Sprite *sprite)
|
||||
sprite->pos2.y += 10;
|
||||
if (sprite->pos2.y >= 0)
|
||||
{
|
||||
PlaySE12WithPanning(SE_W166, BattleAnimAdjustPanning(63));
|
||||
PlaySE12WithPanning(SE_M_SKETCH, BattleAnimAdjustPanning(63));
|
||||
sprite->pos2.y = 0;
|
||||
sprite->data[0]++;
|
||||
}
|
||||
@@ -4838,7 +4838,7 @@ static void AnimBlockX_Step(struct Sprite *sprite)
|
||||
sprite->pos2.y = -(gSineTable[sprite->data[1]] >> 3);
|
||||
if (sprite->data[1] > 0x7F)
|
||||
{
|
||||
PlaySE12WithPanning(SE_W166, BattleAnimAdjustPanning(63));
|
||||
PlaySE12WithPanning(SE_M_SKETCH, BattleAnimAdjustPanning(63));
|
||||
sprite->data[1] = 0;
|
||||
sprite->pos2.y = 0;
|
||||
sprite->data[0]++;
|
||||
@@ -4857,7 +4857,7 @@ static void AnimBlockX_Step(struct Sprite *sprite)
|
||||
case 3:
|
||||
if (++sprite->data[1] > 8)
|
||||
{
|
||||
PlaySE12WithPanning(SE_W043, BattleAnimAdjustPanning(63));
|
||||
PlaySE12WithPanning(SE_M_LEER, BattleAnimAdjustPanning(63));
|
||||
sprite->data[1] = 0;
|
||||
sprite->data[0]++;
|
||||
}
|
||||
@@ -5031,9 +5031,9 @@ void AnimTask_SnatchOpposingMonMove(u8 taskId)
|
||||
case 1:
|
||||
if (IsContest())
|
||||
{
|
||||
personality = gContestResources->field_18->unk8;
|
||||
otId = gContestResources->field_18->unkC;
|
||||
species = gContestResources->field_18->species;
|
||||
personality = gContestResources->moveAnim->personality;
|
||||
otId = gContestResources->moveAnim->otId;
|
||||
species = gContestResources->moveAnim->species;
|
||||
subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker);
|
||||
isBackPic = 0;
|
||||
x = -32;
|
||||
@@ -5152,7 +5152,7 @@ static void sub_815FE80(struct Sprite *sprite)
|
||||
case 0:
|
||||
if (gBattleAnimArgs[7] == -1)
|
||||
{
|
||||
PlaySE12WithPanning(SE_W233, BattleAnimAdjustPanning(63));
|
||||
PlaySE12WithPanning(SE_M_VITAL_THROW, BattleAnimAdjustPanning(63));
|
||||
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + 16;
|
||||
sprite->data[0] = -32;
|
||||
sprite->data[7]++;
|
||||
|
||||
@@ -1242,7 +1242,7 @@ static bool8 sub_810B430(struct Task *task, u8 taskId)
|
||||
if (task->data[4] == 0 && task->data[5] > 0)
|
||||
{
|
||||
task->data[14] += task->data[15];
|
||||
PlaySE12WithPanning(SE_W085, task->data[14]);
|
||||
PlaySE12WithPanning(SE_M_THUNDERBOLT, task->data[14]);
|
||||
}
|
||||
|
||||
if ((task->data[5] < 0 && task->data[7] <= task->data[8])
|
||||
|
||||
@@ -1136,7 +1136,7 @@ static void AnimWillOWispOrb_Step(struct Sprite *sprite)
|
||||
|
||||
if ((initialData5 == 0 || initialData5 > 196) && newData5 > 0 && sprite->data[7] == 0)
|
||||
{
|
||||
PlaySE12WithPanning(SE_W172, gAnimCustomPanning);
|
||||
PlaySE12WithPanning(SE_M_FLAME_WHEEL, gAnimCustomPanning);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
+264
-286
@@ -380,21 +380,18 @@ static void AnimTask_AnimateGustTornadoPalette_Step(u8 taskId)
|
||||
{
|
||||
u8 data2;
|
||||
u16 temp;
|
||||
int i, base;
|
||||
|
||||
if (gTasks[taskId].data[10]++ == gTasks[taskId].data[1])
|
||||
{
|
||||
int i, base;
|
||||
gTasks[taskId].data[10] = 0;
|
||||
data2 = gTasks[taskId].data[2];
|
||||
temp = gPlttBufferFaded[16 * data2 + 0x108];
|
||||
i = 7;
|
||||
base = data2 * 16;
|
||||
|
||||
do
|
||||
{
|
||||
for (; i > 0; --i)
|
||||
gPlttBufferFaded[base + 0x101 + i] = gPlttBufferFaded[base + 0x100 + i];
|
||||
i--;
|
||||
} while (i > 0);
|
||||
|
||||
gPlttBufferFaded[base + 0x101] = temp;
|
||||
}
|
||||
@@ -536,17 +533,16 @@ static void AnimFlyBallAttack_Step(struct Sprite *sprite)
|
||||
|
||||
void DestroyAnimSpriteAfterTimer(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->data[0]-- <= 0)
|
||||
if (sprite->data[0]-- > 0)
|
||||
return;
|
||||
if (sprite->oam.affineMode & ST_OAM_AFFINE_ON_MASK)
|
||||
{
|
||||
if (sprite->oam.affineMode & ST_OAM_AFFINE_ON_MASK)
|
||||
{
|
||||
FreeOamMatrix(sprite->oam.matrixNum);
|
||||
sprite->oam.affineMode = ST_OAM_AFFINE_OFF;
|
||||
}
|
||||
|
||||
DestroySprite(sprite);
|
||||
gAnimVisualTaskCount--;
|
||||
FreeOamMatrix(sprite->oam.matrixNum);
|
||||
sprite->oam.affineMode = ST_OAM_AFFINE_OFF;
|
||||
}
|
||||
|
||||
DestroySprite(sprite);
|
||||
gAnimVisualTaskCount--;
|
||||
}
|
||||
|
||||
struct FeatherDanceData
|
||||
@@ -570,30 +566,27 @@ struct FeatherDanceData
|
||||
static void AnimFallingFeather(struct Sprite *sprite)
|
||||
{
|
||||
u8 battler, matrixNum, sinIndex;
|
||||
s16 spriteCoord, sinVal;
|
||||
s16 sinVal;
|
||||
|
||||
struct FeatherDanceData *data = (struct FeatherDanceData *)sprite->data;
|
||||
|
||||
if (gBattleAnimArgs[7] & 0x100)
|
||||
battler = gBattleAnimAttacker;
|
||||
else
|
||||
battler = gBattleAnimTarget;
|
||||
battler = (gBattleAnimArgs[7] & 0x100) ? gBattleAnimAttacker : gBattleAnimTarget;
|
||||
|
||||
if (GetBattlerSide(battler) == B_SIDE_PLAYER)
|
||||
gBattleAnimArgs[0] = -gBattleAnimArgs[0];
|
||||
|
||||
sprite->pos1.x = GetBattlerSpriteCoord(battler, BATTLER_COORD_ATTR_HEIGHT) + gBattleAnimArgs[0];
|
||||
spriteCoord = GetBattlerSpriteCoord(battler, BATTLER_COORD_ATTR_WIDTH);
|
||||
sprite->pos1.y = spriteCoord + gBattleAnimArgs[1];
|
||||
sinVal = GetBattlerSpriteCoord(battler, BATTLER_COORD_ATTR_WIDTH);
|
||||
sprite->pos1.y = sinVal + gBattleAnimArgs[1];
|
||||
|
||||
data->unk8 = sprite->pos1.y << 8;
|
||||
data->unkE_1 = spriteCoord + gBattleAnimArgs[6];
|
||||
data->unk8 = (u16)(sprite->pos1.y) << 8;
|
||||
data->unkE_1 = (u16)(sinVal + gBattleAnimArgs[6]);
|
||||
data->unk0_0c = 1;
|
||||
data->unk2 = gBattleAnimArgs[2] & 0xFF;
|
||||
data->unkA = (gBattleAnimArgs[2] >> 8) & 0xFF;
|
||||
data->unk2 = (u16)(gBattleAnimArgs[2] & 0xFF);
|
||||
data->unkA = (u16)((gBattleAnimArgs[2] >> 8) & 0xFF) ;
|
||||
data->unk4 = gBattleAnimArgs[3];
|
||||
data->unk6 = gBattleAnimArgs[4];
|
||||
*(u16*)(data->unkC) = gBattleAnimArgs[5];
|
||||
data->unk6 = (u16)gBattleAnimArgs[4];
|
||||
*(u16*)(data->unkC) = (u16)gBattleAnimArgs[5];
|
||||
|
||||
if (data->unk2 >= 64 && data->unk2 <= 191)
|
||||
{
|
||||
@@ -628,27 +621,16 @@ static void AnimFallingFeather(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
data->unk0_1 = data->unk2 >> 6;
|
||||
sprite->pos2.x = (gSineTable[data->unk2] * data->unkC[0]) >> 8;
|
||||
data->unk0_1 = data->unk2/64;
|
||||
sprite->pos2.x = (gSineTable[data->unk2] * (s32)data->unkC[0]) >> 8;
|
||||
matrixNum = sprite->oam.matrixNum;
|
||||
|
||||
sinIndex = (-sprite->pos2.x >> 1) + data->unkA;
|
||||
sinVal = gSineTable[sinIndex];
|
||||
|
||||
gOamMatrices[matrixNum].a = gOamMatrices[matrixNum].d = gSineTable[sinIndex + 64];
|
||||
// The comparison below is completely pointless. 'sprite' is sure to be a valid pointer and
|
||||
// both the 'if' and 'else' parts are exactly the same.
|
||||
// The only reason for this is making sure the compiler generates the exact ASM.
|
||||
if (sprite)
|
||||
{
|
||||
gOamMatrices[matrixNum].b = sinVal;
|
||||
gOamMatrices[matrixNum].c = -sinVal;
|
||||
}
|
||||
else
|
||||
{
|
||||
gOamMatrices[matrixNum].b = sinVal;
|
||||
gOamMatrices[matrixNum].c = -sinVal;
|
||||
}
|
||||
gOamMatrices[matrixNum].b = sinVal;
|
||||
gOamMatrices[matrixNum].c = -sinVal;
|
||||
|
||||
sprite->callback = sub_810E520;
|
||||
}
|
||||
@@ -665,242 +647,238 @@ static void sub_810E520(struct Sprite *sprite)
|
||||
data->unk0_0a = 0;
|
||||
data->unk1 = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
switch (data->unk2 / 64)
|
||||
{
|
||||
switch (data->unk2 / 64)
|
||||
case 0:
|
||||
if ((u8)data->unk0_1 == 1) // this must be cast to u8
|
||||
{
|
||||
case 0:
|
||||
if (data->unk0_1 << 24 >> 24 == 1) // the shifts have to be here
|
||||
{
|
||||
data->unk0_0d = 1;
|
||||
data->unk0_0a = 1;
|
||||
data->unk1 = 0;
|
||||
}
|
||||
else if (data->unk0_1 << 24 >> 24 == 3)
|
||||
{
|
||||
data->unk0_0b ^= 1;
|
||||
data->unk0_0a = 1;
|
||||
data->unk1 = 0;
|
||||
}
|
||||
else if (data->unk0_0d)
|
||||
{
|
||||
sprite->hFlip ^= 1;
|
||||
sprite->animNum = sprite->hFlip;
|
||||
sprite->animBeginning = TRUE;
|
||||
sprite->animEnded = FALSE;
|
||||
if (data->unk0_0c)
|
||||
{
|
||||
if (!IsContest())
|
||||
{
|
||||
if (!data->unkE_0)
|
||||
{
|
||||
sprite->oam.priority--;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->oam.priority++;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!data->unkE_0)
|
||||
{
|
||||
sprite->subpriority -= 12;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->subpriority += 12;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
data->unk0_0d = 0;
|
||||
data->unk2;
|
||||
}
|
||||
data->unk0_1 = 0;
|
||||
break;
|
||||
case 1:
|
||||
if (data->unk0_1 << 24 >> 24 == 0)
|
||||
{
|
||||
data->unk0_0d = 1;
|
||||
data->unk0_0a = 1;
|
||||
data->unk1 = 0;
|
||||
}
|
||||
else if (data->unk0_1 << 24 >> 24 == 2)
|
||||
{
|
||||
data->unk0_0a = 1;
|
||||
data->unk1 = 0;
|
||||
}
|
||||
else if (data->unk0_0d)
|
||||
{
|
||||
sprite->hFlip ^= 1;
|
||||
sprite->animNum = sprite->hFlip;
|
||||
sprite->animBeginning = TRUE;
|
||||
sprite->animEnded = FALSE;
|
||||
if (data->unk0_0c)
|
||||
{
|
||||
if (!IsContest())
|
||||
{
|
||||
if (!data->unkE_0)
|
||||
{
|
||||
sprite->oam.priority--;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->oam.priority++;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!data->unkE_0)
|
||||
{
|
||||
sprite->subpriority -= 12;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->subpriority += 12;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
data->unk0_0d = 0;
|
||||
}
|
||||
data->unk0_1 = 1;
|
||||
break;
|
||||
case 2:
|
||||
if (data->unk0_1 << 24 >> 24 == 3)
|
||||
{
|
||||
data->unk0_0d = 1;
|
||||
data->unk0_0a = 1;
|
||||
data->unk1 = 0;
|
||||
}
|
||||
else if (data->unk0_1 << 24 >> 24 == 1)
|
||||
{
|
||||
data->unk0_0a = 1;
|
||||
data->unk1 = 0;
|
||||
}
|
||||
else if (data->unk0_0d)
|
||||
{
|
||||
sprite->hFlip ^= 1;
|
||||
sprite->animNum = sprite->hFlip;
|
||||
sprite->animBeginning = TRUE;
|
||||
sprite->animEnded = FALSE;
|
||||
if (data->unk0_0c)
|
||||
{
|
||||
if (!IsContest())
|
||||
{
|
||||
if (!data->unkE_0)
|
||||
{
|
||||
sprite->oam.priority--;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->oam.priority++;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!data->unkE_0)
|
||||
{
|
||||
sprite->subpriority -= 12;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->subpriority += 12;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
data->unk0_0d = 0;
|
||||
}
|
||||
data->unk0_1 = 2;
|
||||
break;
|
||||
case 3:
|
||||
if (data->unk0_1 << 24 >> 24 == 2)
|
||||
{
|
||||
data->unk0_0d = 1;
|
||||
}
|
||||
else if (data->unk0_1 << 24 >> 24 == 0)
|
||||
{
|
||||
data->unk0_0b ^= 1;
|
||||
data->unk0_0a = 1;
|
||||
data->unk1 = 0;
|
||||
}
|
||||
else if (data->unk0_0d)
|
||||
{
|
||||
sprite->hFlip ^= 1;
|
||||
sprite->animNum = sprite->hFlip;
|
||||
sprite->animBeginning = TRUE;
|
||||
sprite->animEnded = FALSE;
|
||||
if (data->unk0_0c)
|
||||
{
|
||||
if (!IsContest())
|
||||
{
|
||||
if (!data->unkE_0)
|
||||
{
|
||||
sprite->oam.priority--;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->oam.priority++;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!data->unkE_0)
|
||||
{
|
||||
sprite->subpriority -= 12;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->subpriority += 12;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
data->unk0_0d = 0;
|
||||
}
|
||||
data->unk0_1 = 3;
|
||||
break;
|
||||
data->unk0_0d = 1;
|
||||
data->unk0_0a = 1;
|
||||
data->unk1 = 0;
|
||||
}
|
||||
#ifndef NONMATCHING
|
||||
asm("":::"r8");
|
||||
#endif
|
||||
sprite->pos2.x = (data->unkC[data->unk0_0b] * gSineTable[data->unk2]) >> 8;
|
||||
matrixNum = sprite->oam.matrixNum;
|
||||
|
||||
sinIndex = (-sprite->pos2.x >> 1) + data->unkA;
|
||||
sinVal = gSineTable[sinIndex];
|
||||
|
||||
gOamMatrices[matrixNum].a = gOamMatrices[matrixNum].d = gSineTable[sinIndex + 64];
|
||||
gOamMatrices[matrixNum].b = sinVal;
|
||||
gOamMatrices[matrixNum].c = -sinVal;
|
||||
|
||||
data->unk8 += data->unk6;
|
||||
sprite->pos1.y = data->unk8 >> 8;
|
||||
if (data->unk4 & 0x8000)
|
||||
data->unk2 = (data->unk2 - (data->unk4 & 0x7FFF)) & 0xFF;
|
||||
else
|
||||
data->unk2 = (data->unk2 + (data->unk4 & 0x7FFF)) & 0xFF;
|
||||
|
||||
if (sprite->pos1.y + sprite->pos2.y >= data->unkE_1)
|
||||
else if ((u8)data->unk0_1 == 3)
|
||||
{
|
||||
sprite->data[0] = 0;
|
||||
sprite->callback = DestroyAnimSpriteAfterTimer;
|
||||
data->unk0_0b ^= 1;
|
||||
data->unk0_0a = 1;
|
||||
data->unk1 = 0;
|
||||
}
|
||||
else if (data->unk0_0d)
|
||||
{
|
||||
sprite->hFlip ^= 1;
|
||||
sprite->animNum = sprite->hFlip;
|
||||
sprite->animBeginning = TRUE;
|
||||
sprite->animEnded = FALSE;
|
||||
if (data->unk0_0c)
|
||||
{
|
||||
if (!IsContest())
|
||||
{
|
||||
if (!data->unkE_0)
|
||||
{
|
||||
sprite->oam.priority--;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->oam.priority++;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!data->unkE_0)
|
||||
{
|
||||
sprite->subpriority -= 12;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->subpriority += 12;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
data->unk0_0d = 0;
|
||||
}
|
||||
data->unk0_1 = 0;
|
||||
break;
|
||||
case 1:
|
||||
if ((u8)data->unk0_1 == 0)
|
||||
{
|
||||
data->unk0_0d = 1;
|
||||
data->unk0_0a = 1;
|
||||
data->unk1 = 0;
|
||||
}
|
||||
else if ((u8)data->unk0_1 == 2)
|
||||
{
|
||||
data->unk0_0a = 1;
|
||||
data->unk1 = 0;
|
||||
}
|
||||
else if (data->unk0_0d)
|
||||
{
|
||||
sprite->hFlip ^= 1;
|
||||
sprite->animNum = sprite->hFlip;
|
||||
sprite->animBeginning = TRUE;
|
||||
sprite->animEnded = FALSE;
|
||||
if (data->unk0_0c)
|
||||
{
|
||||
if (!IsContest())
|
||||
{
|
||||
if (!data->unkE_0)
|
||||
{
|
||||
sprite->oam.priority--;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->oam.priority++;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!data->unkE_0)
|
||||
{
|
||||
sprite->subpriority -= 12;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->subpriority += 12;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
data->unk0_0d = 0;
|
||||
}
|
||||
data->unk0_1 = 1;
|
||||
break;
|
||||
case 2:
|
||||
if ((u8)data->unk0_1 == 3)
|
||||
{
|
||||
data->unk0_0d = 1;
|
||||
data->unk0_0a = 1;
|
||||
data->unk1 = 0;
|
||||
}
|
||||
else if ((u8)data->unk0_1 == 1)
|
||||
{
|
||||
data->unk0_0a = 1;
|
||||
data->unk1 = 0;
|
||||
}
|
||||
else if (data->unk0_0d)
|
||||
{
|
||||
sprite->hFlip ^= 1;
|
||||
sprite->animNum = sprite->hFlip;
|
||||
sprite->animBeginning = TRUE;
|
||||
sprite->animEnded = FALSE;
|
||||
if (data->unk0_0c)
|
||||
{
|
||||
if (!IsContest())
|
||||
{
|
||||
if (!data->unkE_0)
|
||||
{
|
||||
sprite->oam.priority--;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->oam.priority++;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!data->unkE_0)
|
||||
{
|
||||
sprite->subpriority -= 12;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->subpriority += 12;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
data->unk0_0d = 0;
|
||||
}
|
||||
data->unk0_1 = 2;
|
||||
break;
|
||||
case 3:
|
||||
if ((u8)data->unk0_1 == 2)
|
||||
{
|
||||
data->unk0_0d = 1;
|
||||
}
|
||||
else if ((u8)data->unk0_1 == 0)
|
||||
{
|
||||
data->unk0_0b ^= 1;
|
||||
data->unk0_0a = 1;
|
||||
data->unk1 = 0;
|
||||
}
|
||||
else if (data->unk0_0d)
|
||||
{
|
||||
sprite->hFlip ^= 1;
|
||||
sprite->animNum = sprite->hFlip;
|
||||
sprite->animBeginning = TRUE;
|
||||
sprite->animEnded = FALSE;
|
||||
if (data->unk0_0c)
|
||||
{
|
||||
if (!IsContest())
|
||||
{
|
||||
if (!data->unkE_0)
|
||||
{
|
||||
sprite->oam.priority--;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->oam.priority++;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!data->unkE_0)
|
||||
{
|
||||
sprite->subpriority -= 12;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->subpriority += 12;
|
||||
data->unkE_0 ^= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
data->unk0_0d = 0;
|
||||
}
|
||||
data->unk0_1 = 3;
|
||||
break;
|
||||
}
|
||||
|
||||
sprite->pos2.x = ((s32)(data->unkC[data->unk0_0b]) * gSineTable[data->unk2]) >> 8;
|
||||
matrixNum = sprite->oam.matrixNum;
|
||||
|
||||
sinIndex = ((-sprite->pos2.x >> 1) + data->unkA);
|
||||
sinVal = gSineTable[sinIndex];
|
||||
|
||||
gOamMatrices[matrixNum].a = gOamMatrices[matrixNum].d = gSineTable[sinIndex + 64];
|
||||
gOamMatrices[matrixNum].b = sinVal;
|
||||
gOamMatrices[matrixNum].c = -sinVal;
|
||||
|
||||
data->unk8 += data->unk6;
|
||||
sprite->pos1.y = (s16)(data->unk8 >> 8);
|
||||
if (data->unk4 & 0x8000)
|
||||
data->unk2 = (data->unk2 - (data->unk4 & 0x7FFF)) & 0xFF;
|
||||
else
|
||||
data->unk2 = (data->unk2 + (data->unk4 & 0x7FFF)) & 0xFF;
|
||||
|
||||
if (sprite->pos1.y + sprite->pos2.y >= data->unkE_1)
|
||||
{
|
||||
sprite->data[0] = 0;
|
||||
sprite->callback = DestroyAnimSpriteAfterTimer;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -944,20 +922,20 @@ static void sub_810EB40(struct Sprite *sprite)
|
||||
{
|
||||
sprite->pos2.x += sprite->data[1] >> 8;
|
||||
|
||||
if (++sprite->data[0] == 6)
|
||||
if (sprite->data[0]++ == 5)
|
||||
{
|
||||
sprite->data[0] = 0;
|
||||
sprite->pos2.x = 0;
|
||||
StartSpriteAnim(sprite, 0);
|
||||
}
|
||||
|
||||
if (--sprite->data[7] == -1)
|
||||
if (sprite->data[7]-- == 0)
|
||||
DestroyAnimSprite(sprite);
|
||||
}
|
||||
|
||||
void AnimTask_DrillPeckHitSplats(u8 task)
|
||||
{
|
||||
if (!(gTasks[task].data[0] % 32))
|
||||
if ((gTasks[task].data[0] % 32) == 0)
|
||||
{
|
||||
gAnimVisualTaskCount++;
|
||||
|
||||
@@ -1060,8 +1038,8 @@ static void AnimDiveBall_Step2(struct Sprite *sprite)
|
||||
|
||||
static void AnimDiveWaterSplash(struct Sprite *sprite)
|
||||
{
|
||||
u32 matrixNum;
|
||||
int t1, t2;
|
||||
u8 matrixNum;
|
||||
s32 t1, t2;
|
||||
|
||||
switch (sprite->data[0])
|
||||
{
|
||||
@@ -1083,7 +1061,7 @@ static void AnimDiveWaterSplash(struct Sprite *sprite)
|
||||
sprite->data[0]++;
|
||||
break;
|
||||
case 1:
|
||||
if (sprite->data[2] <= 11)
|
||||
if (sprite->data[2] < 12)
|
||||
sprite->data[1] -= 40;
|
||||
else
|
||||
sprite->data[1] += 40;
|
||||
@@ -1091,7 +1069,7 @@ static void AnimDiveWaterSplash(struct Sprite *sprite)
|
||||
sprite->data[2]++;
|
||||
|
||||
TrySetSpriteRotScale(sprite, 0, 256, sprite->data[1], 0);
|
||||
|
||||
|
||||
matrixNum = sprite->oam.matrixNum;
|
||||
|
||||
t1 = 15616;
|
||||
@@ -1115,8 +1093,8 @@ static void AnimDiveWaterSplash(struct Sprite *sprite)
|
||||
// Launches a water droplet away from the specified battler. Used by Astonish and Dive
|
||||
static void AnimSprayWaterDroplet(struct Sprite *sprite)
|
||||
{
|
||||
int v1 = 0x1ff & Random2();
|
||||
int v2 = 0x7f & Random2();
|
||||
const u16 v1 = Random2() & 0x1ff;
|
||||
const u16 v2 = Random2() & 0x07f;
|
||||
|
||||
if (v1 % 2)
|
||||
sprite->data[0] = 736 + v1;
|
||||
@@ -1160,13 +1138,13 @@ static void AnimSprayWaterDroplet_Step(struct Sprite *sprite)
|
||||
sprite->pos2.y -= sprite->data[1] >> 8;
|
||||
}
|
||||
|
||||
sprite->data[0] = sprite->data[0];
|
||||
sprite->data[0] -= 0; // Needed to Match
|
||||
sprite->data[1] -= 32;
|
||||
|
||||
if (sprite->data[0] < 0)
|
||||
sprite->data[0] = 0;
|
||||
|
||||
if (++sprite->data[3] == 31)
|
||||
if (sprite->data[3]++ == 30)
|
||||
DestroyAnimSprite(sprite);
|
||||
}
|
||||
|
||||
@@ -1212,7 +1190,7 @@ static void AnimSkyAttackBird(struct Sprite *sprite)
|
||||
sprite->data[7] = ((posy - sprite->pos1.y) << 4) / 12;
|
||||
|
||||
rotation = ArcTan2Neg(posx - sprite->pos1.x, posy - sprite->pos1.y);
|
||||
rotation += 49152;
|
||||
rotation -= 16384;
|
||||
|
||||
TrySetSpriteRotScale(sprite, 1, 0x100, 0x100, rotation);
|
||||
|
||||
@@ -1236,12 +1214,12 @@ void unref_sub_810F184(u8 taskId)
|
||||
{
|
||||
if (gBattleAnimArgs[0] == 0)
|
||||
{
|
||||
u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
||||
const u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
||||
gSprites[spriteId].invisible = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
||||
const u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
||||
gSprites[spriteId].invisible = FALSE;
|
||||
}
|
||||
DestroyAnimVisualTask(taskId);
|
||||
|
||||
@@ -252,7 +252,7 @@ static void AnimConfuseRayBallBounce_Step1(struct Sprite *sprite)
|
||||
return;
|
||||
if (r0 <= 0)
|
||||
return;
|
||||
PlaySE12WithPanning(SE_W109, gAnimCustomPanning);
|
||||
PlaySE12WithPanning(SE_M_CONFUSE_RAY, gAnimCustomPanning);
|
||||
}
|
||||
|
||||
static void AnimConfuseRayBallBounce_Step2(struct Sprite *sprite)
|
||||
@@ -271,7 +271,7 @@ static void AnimConfuseRayBallBounce_Step2(struct Sprite *sprite)
|
||||
if (r2 == 0 || r2 > 196)
|
||||
{
|
||||
if (r0 > 0)
|
||||
PlaySE(SE_W109);
|
||||
PlaySE(SE_M_CONFUSE_RAY);
|
||||
}
|
||||
|
||||
if (sprite->data[6] == 0)
|
||||
|
||||
+15
-15
@@ -141,10 +141,10 @@ u8 GetBattlerSpriteCoord(u8 battlerId, u8 coordType)
|
||||
default:
|
||||
if (IsContest())
|
||||
{
|
||||
if (gContestResources->field_18->unk4_0)
|
||||
species = gContestResources->field_18->unk2;
|
||||
if (gContestResources->moveAnim->hasTargetAnim)
|
||||
species = gContestResources->moveAnim->targetSpecies;
|
||||
else
|
||||
species = gContestResources->field_18->species;
|
||||
species = gContestResources->moveAnim->species;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -189,10 +189,10 @@ u8 GetBattlerYDelta(u8 battlerId, u16 species)
|
||||
{
|
||||
if (IsContest())
|
||||
{
|
||||
if (gContestResources->field_18->unk4_0)
|
||||
personality = gContestResources->field_18->unk10;
|
||||
if (gContestResources->moveAnim->hasTargetAnim)
|
||||
personality = gContestResources->moveAnim->targetPersonality;
|
||||
else
|
||||
personality = gContestResources->field_18->unk8;
|
||||
personality = gContestResources->moveAnim->personality;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -306,10 +306,10 @@ u8 GetBattlerSpriteCoord2(u8 battlerId, u8 coordType)
|
||||
{
|
||||
if (IsContest())
|
||||
{
|
||||
if (gContestResources->field_18->unk4_0)
|
||||
species = gContestResources->field_18->unk2;
|
||||
if (gContestResources->moveAnim->hasTargetAnim)
|
||||
species = gContestResources->moveAnim->targetSpecies;
|
||||
else
|
||||
species = gContestResources->field_18->species;
|
||||
species = gContestResources->moveAnim->species;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1851,7 +1851,7 @@ static u16 GetBattlerYDeltaFromSpriteId(u8 spriteId)
|
||||
{
|
||||
if (IsContest())
|
||||
{
|
||||
species = gContestResources->field_18->species;
|
||||
species = gContestResources->moveAnim->species;
|
||||
return gMonBackPicCoords[species].y_offset;
|
||||
}
|
||||
else
|
||||
@@ -2103,15 +2103,15 @@ s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 attr)
|
||||
|
||||
if (IsContest())
|
||||
{
|
||||
if (gContestResources->field_18->unk4_0)
|
||||
if (gContestResources->moveAnim->hasTargetAnim)
|
||||
{
|
||||
species = gContestResources->field_18->unk2;
|
||||
personality = gContestResources->field_18->unk10;
|
||||
species = gContestResources->moveAnim->targetSpecies;
|
||||
personality = gContestResources->moveAnim->targetPersonality;
|
||||
}
|
||||
else
|
||||
{
|
||||
species = gContestResources->field_18->species;
|
||||
personality = gContestResources->field_18->unk8;
|
||||
species = gContestResources->moveAnim->species;
|
||||
personality = gContestResources->moveAnim->personality;
|
||||
}
|
||||
if (species == SPECIES_UNOWN)
|
||||
{
|
||||
|
||||
+12
-12
@@ -816,7 +816,7 @@ static void AnimTask_ThrowBall_StandingTrainer_Step(u8 taskId)
|
||||
{
|
||||
if (gSprites[gBattlerSpriteIds[GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)]].animCmdIndex == 1)
|
||||
{
|
||||
PlaySE12WithPanning(SE_NAGERU, 0);
|
||||
PlaySE12WithPanning(SE_BALL_THROW, 0);
|
||||
gSprites[gTasks[taskId].tSpriteId].callback = SpriteCB_Ball_Throw;
|
||||
CreateTask(Task_PlayerThrow_Wait, 10);
|
||||
gTasks[taskId].func = AnimTask_ThrowBall_Step;
|
||||
@@ -935,7 +935,7 @@ static void SpriteCB_Ball_MonShrink_Step(struct Sprite *sprite)
|
||||
taskId = sprite->sTaskId;
|
||||
|
||||
if (++gTasks[taskId].sTimer == 11)
|
||||
PlaySE(SE_SUIKOMU);
|
||||
PlaySE(SE_BALL_TRADE);
|
||||
|
||||
switch (gTasks[taskId].tState)
|
||||
{
|
||||
@@ -1042,16 +1042,16 @@ static void SpriteCB_Ball_Bounce_Step(struct Sprite *sprite)
|
||||
switch (bounceCount)
|
||||
{
|
||||
case 1:
|
||||
PlaySE(SE_KON);
|
||||
PlaySE(SE_BALL_BOUNCE_1);
|
||||
break;
|
||||
case 2:
|
||||
PlaySE(SE_KON2);
|
||||
PlaySE(SE_BALL_BOUNCE_2);
|
||||
break;
|
||||
case 3:
|
||||
PlaySE(SE_KON3);
|
||||
PlaySE(SE_BALL_BOUNCE_3);
|
||||
break;
|
||||
default:
|
||||
PlaySE(SE_KON4);
|
||||
PlaySE(SE_BALL_BOUNCE_4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1111,7 +1111,7 @@ static void SpriteCB_Ball_Wobble(struct Sprite *sprite)
|
||||
StartSpriteAffineAnim(sprite, BALL_ROTATE_RIGHT);
|
||||
gBattleSpritesDataPtr->animationData->ballSubpx = 0;
|
||||
sprite->callback = SpriteCB_Ball_Wobble_Step;
|
||||
PlaySE(SE_BOWA);
|
||||
PlaySE(SE_BALL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1258,7 +1258,7 @@ static void SpriteCB_Ball_Wobble_Step(struct Sprite *sprite)
|
||||
else
|
||||
StartSpriteAffineAnim(sprite, BALL_ROTATE_RIGHT);
|
||||
|
||||
PlaySE(SE_BOWA);
|
||||
PlaySE(SE_BALL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1303,7 +1303,7 @@ static void SpriteCB_Ball_Capture_Step(struct Sprite *sprite)
|
||||
sprite->sTimer++;
|
||||
if (sprite->sTimer == 40)
|
||||
{
|
||||
PlaySE(SE_RG_GETTING);
|
||||
PlaySE(SE_RG_BALL_CLICK);
|
||||
BlendPalettes(0x10000 << sprite->oam.paletteNum, 6, RGB(0, 0, 0));
|
||||
MakeCaptureStars(sprite);
|
||||
}
|
||||
@@ -1316,7 +1316,7 @@ static void SpriteCB_Ball_Capture_Step(struct Sprite *sprite)
|
||||
gDoingBattleAnim = FALSE;
|
||||
UpdateOamPriorityInAllHealthboxes(1);
|
||||
m4aMPlayAllStop();
|
||||
PlaySE(MUS_RG_FAN6);
|
||||
PlaySE(MUS_RG_CAUGHT_INTRO);
|
||||
}
|
||||
else if (sprite->sTimer == 315)
|
||||
{
|
||||
@@ -1570,7 +1570,7 @@ u8 AnimateBallOpenParticles(u8 x, u8 y, u8 priority, u8 subpriority, u8 ballId)
|
||||
gTasks[taskId].data[3] = priority;
|
||||
gTasks[taskId].data[4] = subpriority;
|
||||
gTasks[taskId].data[15] = ballId;
|
||||
PlaySE(SE_BOWA2);
|
||||
PlaySE(SE_BALL_OPEN);
|
||||
|
||||
return taskId;
|
||||
}
|
||||
@@ -2309,7 +2309,7 @@ static void Task_ShinyStars(u8 taskId)
|
||||
else
|
||||
pan = 63;
|
||||
|
||||
PlaySE12WithPanning(SE_REAPOKE, pan);
|
||||
PlaySE12WithPanning(SE_SHINY, pan);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1101,7 +1101,7 @@ static void AnimTask_TransparentCloneGrowAndShrink_Step(u8 taskId)
|
||||
break;
|
||||
case 1:
|
||||
task->data[1] -= 4;
|
||||
task->data[2] = 256 - (gSineTable[task->data[1]] >> 1);;
|
||||
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)
|
||||
@@ -1137,7 +1137,7 @@ static void AnimPsychoBoost(struct Sprite *sprite)
|
||||
case 1:
|
||||
if (sprite->affineAnimEnded)
|
||||
{
|
||||
PlaySE12WithPanning(SE_W100, BattleAnimAdjustPanning(-64));
|
||||
PlaySE12WithPanning(SE_M_TELEPORT, BattleAnimAdjustPanning(-64));
|
||||
ChangeSpriteAffineAnim(sprite, 1);
|
||||
sprite->data[0]++;
|
||||
}
|
||||
|
||||
@@ -631,7 +631,7 @@ static void AnimTask_Rollout_Step(u8 taskId)
|
||||
task->data[0]++;
|
||||
}
|
||||
|
||||
PlaySE12WithPanning(SE_W029, task->data[13]);
|
||||
PlaySE12WithPanning(SE_M_HEADBUTT, task->data[13]);
|
||||
break;
|
||||
case 1:
|
||||
if (--task->data[11] == 0)
|
||||
@@ -661,7 +661,7 @@ static void AnimTask_Rollout_Step(u8 taskId)
|
||||
task->data[9] = 0;
|
||||
sub_8111214(task);
|
||||
task->data[13] += task->data[14];
|
||||
PlaySE12WithPanning(SE_W091, task->data[13]);
|
||||
PlaySE12WithPanning(SE_M_DIG, task->data[13]);
|
||||
}
|
||||
|
||||
if (--task->data[8] == 0)
|
||||
|
||||
@@ -134,7 +134,7 @@ void SoundTask_PlayCryHighPitch(u8 taskId)
|
||||
if (IsContest())
|
||||
{
|
||||
if (gBattleAnimArgs[0] == ANIM_ATTACKER)
|
||||
species = gContestResources->field_18->species;
|
||||
species = gContestResources->moveAnim->species;
|
||||
else
|
||||
DestroyAnimVisualTask(taskId); // UB: function should return upon destroying task.
|
||||
}
|
||||
@@ -180,7 +180,7 @@ void SoundTask_PlayDoubleCry(u8 taskId)
|
||||
if (IsContest())
|
||||
{
|
||||
if (gBattleAnimArgs[0] == ANIM_ATTACKER)
|
||||
species = gContestResources->field_18->species;
|
||||
species = gContestResources->moveAnim->species;
|
||||
else
|
||||
DestroyAnimVisualTask(taskId); // UB: function should return upon destroying task.
|
||||
}
|
||||
@@ -284,7 +284,7 @@ void SoundTask_PlayCryWithEcho(u8 taskId)
|
||||
pan = BattleAnimAdjustPanning(SOUND_PAN_ATTACKER);
|
||||
|
||||
if (IsContest())
|
||||
species = gContestResources->field_18->species;
|
||||
species = gContestResources->moveAnim->species;
|
||||
else
|
||||
species = gAnimBattlerSpecies[gBattleAnimAttacker];
|
||||
|
||||
|
||||
@@ -318,7 +318,7 @@ void AnimTask_DrawFallingWhiteLinesOnAttacker(u8 taskId)
|
||||
|
||||
if (IsContest())
|
||||
{
|
||||
species = gContestResources->field_18->species;
|
||||
species = gContestResources->moveAnim->species;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -440,7 +440,7 @@ static void sub_8116F04(u8 taskId)
|
||||
|
||||
if (IsContest())
|
||||
{
|
||||
sAnimStatsChangeData->species = gContestResources->field_18->species;
|
||||
sAnimStatsChangeData->species = gContestResources->moveAnim->species;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -535,9 +535,9 @@ static void sub_81170EC(u8 taskId)
|
||||
gTasks[taskId].func = sub_81172EC;
|
||||
|
||||
if (sAnimStatsChangeData->data[0] == 0)
|
||||
PlaySE12WithPanning(SE_W287, BattleAnimAdjustPanning2(-64));
|
||||
PlaySE12WithPanning(SE_M_STAT_INCREASE, BattleAnimAdjustPanning2(-64));
|
||||
else
|
||||
PlaySE12WithPanning(SE_W287B, BattleAnimAdjustPanning2(-64));
|
||||
PlaySE12WithPanning(SE_M_STAT_DECREASE, BattleAnimAdjustPanning2(-64));
|
||||
}
|
||||
|
||||
static void sub_81172EC(u8 taskId)
|
||||
@@ -569,7 +569,7 @@ static void sub_81172EC(u8 taskId)
|
||||
if (gTasks[taskId].data[12] == 0)
|
||||
{
|
||||
sub_80A477C(0);
|
||||
gTasks[taskId].data[15]++;;
|
||||
gTasks[taskId].data[15]++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -810,7 +810,7 @@ void sub_8117854(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5,
|
||||
|
||||
if (IsContest())
|
||||
{
|
||||
species = gContestResources->field_18->species;
|
||||
species = gContestResources->moveAnim->species;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+63
-617
@@ -52,7 +52,7 @@ static void CreateWaterSpoutLaunchDroplets(struct Task*, u8);
|
||||
static void CreateWaterSpoutRainDroplet(struct Task*, u8);
|
||||
static void AnimTask_WaterSport_Step(u8);
|
||||
static void CreateWaterSportDroplet(struct Task*);
|
||||
static void CreateWaterPulseRingBubbles(struct Sprite*, int, int);
|
||||
static void CreateWaterPulseRingBubbles(struct Sprite*, s32, s32);
|
||||
|
||||
// Both unused
|
||||
const u8 gUnknown_8593C80[] = INCBIN_U8("graphics/unknown/unknown_593C80.4bpp");
|
||||
@@ -794,21 +794,25 @@ static void AnimSmallBubblePair_Step(struct Sprite *sprite)
|
||||
sprite->pos2.x = Sin(sprite->data[0], 4);
|
||||
sprite->data[1] += 48;
|
||||
sprite->pos2.y = -(sprite->data[1] >> 8);
|
||||
if (--sprite->data[7] == -1)
|
||||
if (sprite->data[7]-- == 0)
|
||||
DestroyAnimSprite(sprite);
|
||||
}
|
||||
|
||||
#ifdef NONMATCHING
|
||||
void AnimTask_CreateSurfWave(u8 taskId)
|
||||
{
|
||||
struct BattleAnimBgData animBg;
|
||||
u8 taskId2;
|
||||
u16 *x, *y; //These pointers are needed to match
|
||||
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG1 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL);
|
||||
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16));
|
||||
x = &gBattle_BG1_X;
|
||||
y = &gBattle_BG1_Y;
|
||||
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL | BLDCNT_TGT1_BG1);
|
||||
SetGpuReg(REG_OFFSET_BLDALPHA, (16 << 8));
|
||||
SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1);
|
||||
SetAnimBgAttribute(1, BG_ANIM_SCREEN_SIZE, 1);
|
||||
sub_80A6B30(&animBg);
|
||||
|
||||
if (!IsContest())
|
||||
{
|
||||
SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1);
|
||||
@@ -833,30 +837,30 @@ void AnimTask_CreateSurfWave(u8 taskId)
|
||||
gTasks[taskId2].data[2] = 0x1000;
|
||||
if (IsContest())
|
||||
{
|
||||
gBattle_BG1_X = -80;
|
||||
gBattle_BG1_Y = -48;
|
||||
*x = -80;
|
||||
*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;
|
||||
*x = -224;
|
||||
*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;
|
||||
*x = 0;
|
||||
*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);
|
||||
SetGpuReg(REG_OFFSET_BG1HOFS, *x);
|
||||
SetGpuReg(REG_OFFSET_BG1VOFS, *y);
|
||||
if (gTasks[taskId2].data[3] == 0)
|
||||
{
|
||||
gTasks[taskId2].data[4] = 48;
|
||||
@@ -870,245 +874,16 @@ void AnimTask_CreateSurfWave(u8 taskId)
|
||||
gTasks[taskId].data[6] = 1;
|
||||
gTasks[taskId].func = AnimTask_CreateSurfWave_Step1;
|
||||
}
|
||||
#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, =gBattleAnimBgTilemap_SurfOpponent\n\
|
||||
bl AnimLoadCompressedBgTilemap\n\
|
||||
b _081079EA\n\
|
||||
.pool\n\
|
||||
_081079D0:\n\
|
||||
mov r0, sp\n\
|
||||
ldrb r0, [r0, 0x9]\n\
|
||||
ldr r1, =gBattleAnimBgTilemap_SurfPlayer\n\
|
||||
bl AnimLoadCompressedBgTilemap\n\
|
||||
b _081079EA\n\
|
||||
.pool\n\
|
||||
_081079E0:\n\
|
||||
ldr r1, =gBattleAnimBgTilemap_SurfContest\n\
|
||||
mov r0, sp\n\
|
||||
movs r2, 0x1\n\
|
||||
bl AnimLoadCompressedBgTilemapHandleContest\n\
|
||||
_081079EA:\n\
|
||||
mov r0, sp\n\
|
||||
ldrb r0, [r0, 0x9]\n\
|
||||
ldr r1, =gBattleAnimBgImage_Surf\n\
|
||||
mov r2, sp\n\
|
||||
ldrh r2, [r2, 0xA]\n\
|
||||
bl AnimLoadCompressedBgGfx\n\
|
||||
ldr r0, =gBattleAnimArgs\n\
|
||||
movs r1, 0\n\
|
||||
ldrsh r0, [r0, r1]\n\
|
||||
cmp r0, 0\n\
|
||||
bne _08107A24\n\
|
||||
ldr r0, =gBattleAnimBgPalette_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, =AnimTask_SurfWaveScanlineEffect\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, =AnimTask_CreateSurfWave_Step1\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
|
||||
static void AnimTask_CreateSurfWave_Step1(u8 taskId)
|
||||
{
|
||||
struct BattleAnimBgData animBg;
|
||||
u8 i;
|
||||
u16 rgbBuffer;
|
||||
u16 *BGptrX = &gBattle_BG1_X;
|
||||
u16 *BGptrY = &gBattle_BG1_Y;
|
||||
s16 unkUse;
|
||||
u32 palOffset;
|
||||
u16 palNum;
|
||||
u8 i;
|
||||
u16 *BGptrX, *BGptrY;
|
||||
struct BattleAnimBgData animBg;
|
||||
|
||||
BGptrX = &gBattle_BG1_X;
|
||||
BGptrY = &gBattle_BG1_Y;
|
||||
|
||||
*BGptrX += gTasks[taskId].data[0];
|
||||
*BGptrY += gTasks[taskId].data[1];
|
||||
@@ -1116,29 +891,26 @@ static void AnimTask_CreateSurfWave_Step1(u8 taskId)
|
||||
gTasks[taskId].data[2] += gTasks[taskId].data[1];
|
||||
if (++gTasks[taskId].data[5] == 4)
|
||||
{
|
||||
rgbBuffer = gPlttBufferFaded[animBg.paletteId * 16 + 7];
|
||||
for (i = 6; i != 0; i--)
|
||||
rgbBuffer = gPlttBufferFaded[16 * animBg.paletteId + 7];
|
||||
for (i = 6; i != 0; i--) // i > 0 generates the exact same code in this context
|
||||
{
|
||||
palNum = animBg.paletteId * 16;
|
||||
palOffset = 1 + i;
|
||||
gPlttBufferFaded[palNum + palOffset] = gPlttBufferFaded[palNum + palOffset - 1];
|
||||
gPlttBufferFaded[16 * animBg.paletteId + 1 + i] = gPlttBufferFaded[16 * animBg.paletteId + 1 + i - 1]; // 1 + i - 1 is needed to match for some bizarre reason
|
||||
}
|
||||
gPlttBufferFaded[animBg.paletteId * 16 + 1] = rgbBuffer;
|
||||
gPlttBufferFaded[16 * animBg.paletteId + 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)
|
||||
if (++gTasks[taskId].data[3] < 14)
|
||||
{
|
||||
gTasks[gTasks[taskId].data[15]].data[1] = unkUse | ((16 - unkUse) * 256);
|
||||
gTasks[gTasks[taskId].data[15]].data[1] = (s16)((gTasks[taskId].data[3]) | ((16 - gTasks[taskId].data[3]) << 8));
|
||||
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);
|
||||
gTasks[taskId].data[4]--;
|
||||
gTasks[gTasks[taskId].data[15]].data[1] = (s16)((gTasks[taskId].data[4]) | ((16 - gTasks[taskId].data[4]) << 8));
|
||||
}
|
||||
}
|
||||
if (!(gTasks[gTasks[taskId].data[15]].data[1] & 0x1F))
|
||||
@@ -1147,167 +919,7 @@ static void AnimTask_CreateSurfWave_Step1(u8 taskId)
|
||||
gTasks[taskId].func = AnimTask_CreateSurfWave_Step2;
|
||||
}
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
static void AnimTask_CreateSurfWave_Step1(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, =AnimTask_CreateSurfWave_Step2\n\
|
||||
str r0, [r2]\n\
|
||||
_08107CA8:\n\
|
||||
add sp, 0x10\n\
|
||||
pop {r4-r7}\n\
|
||||
pop {r0}\n\
|
||||
bx r0\n\
|
||||
.pool\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void AnimTask_CreateSurfWave_Step2(u8 taskId)
|
||||
{
|
||||
@@ -1931,216 +1543,50 @@ static void AnimWaterPulseRing_Step(struct Sprite *sprite)
|
||||
sprite->data[0]++;
|
||||
}
|
||||
|
||||
#ifdef NONMATCHING
|
||||
static void CreateWaterPulseRingBubbles(struct Sprite *sprite, int xDiff, int yDiff)
|
||||
static void CreateWaterPulseRingBubbles(struct Sprite *sprite, s32 xDiff, s32 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;
|
||||
s16 combinedX, combinedY;
|
||||
s16 i, something;
|
||||
s16 unusedVar = 1; //unusedVar is needed to match
|
||||
s16 somethingRandomX, somethingRandomY;
|
||||
u8 spriteId;
|
||||
|
||||
for (i = 0; i <= 0; i++)
|
||||
something = sprite->data[0] / 2;
|
||||
combinedX = sprite->pos1.x + sprite->pos2.x;
|
||||
combinedY = sprite->pos1.y + sprite->pos2.y;
|
||||
if (yDiff < 0)
|
||||
unusedVar *= -1; //Needed to Match
|
||||
somethingRandomY = yDiff + (Random2() % 10) - 5;
|
||||
somethingRandomX = -xDiff + (Random2() % 10) - 5;
|
||||
|
||||
for (i = 0; i < 1; i++)
|
||||
{
|
||||
spriteId = CreateSprite(&gWaterPulseRingBubbleSpriteTemplate, combinedX, combinedY + something, 130);
|
||||
gSprites[spriteId].data[0] = 20;
|
||||
gSprites[spriteId].data[1] = randomSomethingY;
|
||||
gSprites[spriteId].data[1] = somethingRandomY;
|
||||
gSprites[spriteId].subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 1;
|
||||
if (randomSomethingX < 0)
|
||||
gSprites[spriteId].data[2] = -randomSomethingX;
|
||||
if (somethingRandomX < 0)
|
||||
{
|
||||
gSprites[spriteId].data[2] = -somethingRandomX;
|
||||
}
|
||||
else
|
||||
gSprites[spriteId].data[2] = randomSomethingX;
|
||||
{
|
||||
gSprites[spriteId].data[2] = somethingRandomX;
|
||||
}
|
||||
}
|
||||
for (i = 0; i <= 0; i++)
|
||||
for (i = 0; i < 1; i++)
|
||||
{
|
||||
spriteId = CreateSprite(&gWaterPulseRingBubbleSpriteTemplate, combinedX, combinedY - something, 130);
|
||||
gSprites[spriteId].data[0] = 20;
|
||||
gSprites[spriteId].data[1] = randomSomethingY;
|
||||
gSprites[spriteId].data[1] = somethingRandomY;
|
||||
gSprites[spriteId].subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 1;
|
||||
if (randomSomethingX > 0)
|
||||
gSprites[spriteId].data[2] = -randomSomethingX;
|
||||
if (somethingRandomX > 0)
|
||||
{
|
||||
gSprites[spriteId].data[2] = -somethingRandomX;
|
||||
}
|
||||
else
|
||||
gSprites[spriteId].data[2] = randomSomethingX;
|
||||
{
|
||||
gSprites[spriteId].data[2] = somethingRandomX;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
static void CreateWaterPulseRingBubbles(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, =gWaterPulseRingBubbleSpriteTemplate\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, =gWaterPulseRingBubbleSpriteTemplate\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
|
||||
|
||||
+4
-4
@@ -563,7 +563,7 @@ u8 BattleArena_ShowJudgmentWindow(u8 *state)
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
PlaySE(SE_HANTEI1);
|
||||
PlaySE(SE_ARENA_TIMEUP1);
|
||||
ShowJudgmentSprite(80, 40, ARENA_CATEGORY_MIND, B_POSITION_PLAYER_LEFT);
|
||||
ShowJudgmentSprite(160, 40, ARENA_CATEGORY_MIND, B_POSITION_OPPONENT_LEFT);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgement);
|
||||
@@ -572,7 +572,7 @@ u8 BattleArena_ShowJudgmentWindow(u8 *state)
|
||||
ret = 1;
|
||||
break;
|
||||
case 5:
|
||||
PlaySE(SE_HANTEI1);
|
||||
PlaySE(SE_ARENA_TIMEUP1);
|
||||
ShowJudgmentSprite(80, 56, ARENA_CATEGORY_SKILL, B_POSITION_PLAYER_LEFT);
|
||||
ShowJudgmentSprite(160, 56, ARENA_CATEGORY_SKILL, B_POSITION_OPPONENT_LEFT);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgement);
|
||||
@@ -581,7 +581,7 @@ u8 BattleArena_ShowJudgmentWindow(u8 *state)
|
||||
ret = 1;
|
||||
break;
|
||||
case 6:
|
||||
PlaySE(SE_HANTEI1);
|
||||
PlaySE(SE_ARENA_TIMEUP1);
|
||||
ShowJudgmentSprite(80, 72, ARENA_CATEGORY_BODY, B_POSITION_PLAYER_LEFT);
|
||||
ShowJudgmentSprite(160, 72, ARENA_CATEGORY_BODY, B_POSITION_OPPONENT_LEFT);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgement);
|
||||
@@ -590,7 +590,7 @@ u8 BattleArena_ShowJudgmentWindow(u8 *state)
|
||||
ret = 1;
|
||||
break;
|
||||
case 7:
|
||||
PlaySE(SE_HANTEI2);
|
||||
PlaySE(SE_ARENA_TIMEUP2);
|
||||
if (gBattleTextBuff1[0] > gBattleTextBuff2[0])
|
||||
{
|
||||
ret = 2;
|
||||
|
||||
+1
-1
@@ -1105,7 +1105,7 @@ void InitLinkBattleVsScreen(u8 taskId)
|
||||
if (gTasks[taskId].data[5] != 0)
|
||||
DrawLinkBattleVsScreenOutcomeText();
|
||||
|
||||
PlaySE(SE_W231);
|
||||
PlaySE(SE_M_HARDEN);
|
||||
DestroyTask(taskId);
|
||||
gSprites[gBattleStruct->linkBattleVsSpriteId_V].invisible = FALSE;
|
||||
gSprites[gBattleStruct->linkBattleVsSpriteId_S].invisible = FALSE;
|
||||
|
||||
@@ -1357,7 +1357,7 @@ static void LinkOpponentHandleFaintAnimation(void)
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, SOUND_PAN_TARGET);
|
||||
PlaySE12WithPanning(SE_FAINT, SOUND_PAN_TARGET);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_FaintOpponentMon;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8064C14;
|
||||
}
|
||||
|
||||
@@ -1179,7 +1179,7 @@ static void LinkPartnerHandleFaintAnimation(void)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
|
||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, SOUND_PAN_ATTACKER);
|
||||
PlaySE12WithPanning(SE_FAINT, SOUND_PAN_ATTACKER);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[1] = 0;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 5;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_8039C00;
|
||||
|
||||
@@ -1394,7 +1394,7 @@ static void OpponentHandleFaintAnimation(void)
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, SOUND_PAN_TARGET);
|
||||
PlaySE12WithPanning(SE_FAINT, SOUND_PAN_TARGET);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_FaintOpponentMon;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_805FAC4;
|
||||
}
|
||||
|
||||
@@ -853,7 +853,7 @@ static void sub_80586F8(void)
|
||||
{
|
||||
if (gReceivedRemoteLinkPlayers == 0)
|
||||
{
|
||||
m4aSongNumStop(SE_HINSI);
|
||||
m4aSongNumStop(SE_LOW_HEALTH);
|
||||
gMain.inBattle = 0;
|
||||
gMain.callback1 = gPreBattleCallback1;
|
||||
SetMainCallback2(sub_8038D64);
|
||||
@@ -866,7 +866,7 @@ static void sub_80586F8(void)
|
||||
{
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
m4aSongNumStop(SE_HINSI);
|
||||
m4aSongNumStop(SE_LOW_HEALTH);
|
||||
gMain.inBattle = 0;
|
||||
gMain.callback1 = gPreBattleCallback1;
|
||||
SetMainCallback2(sub_8038D64);
|
||||
@@ -886,16 +886,16 @@ void sub_80587B0(void)
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
if (gWirelessCommType == 0)
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
else
|
||||
sub_800ADF8();
|
||||
SetLinkStandbyCallback();
|
||||
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_80586F8;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m4aSongNumStop(SE_HINSI);
|
||||
m4aSongNumStop(SE_LOW_HEALTH);
|
||||
gMain.inBattle = 0;
|
||||
gMain.callback1 = gPreBattleCallback1;
|
||||
SetMainCallback2(gMain.savedCallback);
|
||||
@@ -1468,8 +1468,7 @@ static void MoveSelectionDisplayPpNumber(void)
|
||||
SetPpNumbersPaletteInMoveSelection();
|
||||
moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]);
|
||||
txtPtr = ConvertIntToDecimalStringN(gDisplayedStringBattle, moveInfo->currentPp[gMoveSelectionCursor[gActiveBattler]], STR_CONV_MODE_RIGHT_ALIGN, 2);
|
||||
txtPtr[0] = CHAR_SLASH;
|
||||
txtPtr++;
|
||||
*(txtPtr)++ = CHAR_SLASH;
|
||||
ConvertIntToDecimalStringN(txtPtr, moveInfo->maxPp[gMoveSelectionCursor[gActiveBattler]], STR_CONV_MODE_RIGHT_ALIGN, 2);
|
||||
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, 9);
|
||||
@@ -1481,12 +1480,9 @@ static void MoveSelectionDisplayMoveType(void)
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]);
|
||||
|
||||
txtPtr = StringCopy(gDisplayedStringBattle, gText_MoveInterfaceType);
|
||||
txtPtr[0] = EXT_CTRL_CODE_BEGIN;
|
||||
txtPtr++;
|
||||
txtPtr[0] = 6;
|
||||
txtPtr++;
|
||||
txtPtr[0] = 1;
|
||||
txtPtr++;
|
||||
*(txtPtr)++ = EXT_CTRL_CODE_BEGIN;
|
||||
*(txtPtr)++ = EXT_CTRL_CODE_SIZE;
|
||||
*(txtPtr)++ = 1;
|
||||
|
||||
StringCopy(txtPtr, gTypeNames[gBattleMoves[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].type]);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, 10);
|
||||
@@ -2396,7 +2392,7 @@ static void PlayerHandleFaintAnimation(void)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
|
||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, SOUND_PAN_ATTACKER);
|
||||
PlaySE12WithPanning(SE_FAINT, SOUND_PAN_ATTACKER);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[1] = 0;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 5;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_8039C00;
|
||||
|
||||
@@ -1371,7 +1371,7 @@ static void PlayerPartnerHandleFaintAnimation(void)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
|
||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, SOUND_PAN_ATTACKER);
|
||||
PlaySE12WithPanning(SE_FAINT, SOUND_PAN_ATTACKER);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[1] = 0;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 5;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_8039C00;
|
||||
|
||||
@@ -1284,7 +1284,7 @@ static void RecordedOpponentHandleFaintAnimation(void)
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, SOUND_PAN_TARGET);
|
||||
PlaySE12WithPanning(SE_FAINT, SOUND_PAN_TARGET);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_FaintOpponentMon;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8186D58;
|
||||
}
|
||||
|
||||
@@ -1286,7 +1286,7 @@ static void RecordedPlayerHandleFaintAnimation(void)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
|
||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
||||
PlaySE12WithPanning(SE_POKE_DEAD, -64);
|
||||
PlaySE12WithPanning(SE_FAINT, -64);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[1] = 0;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 5;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_8039C00;
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
#include "international_string_util.h"
|
||||
#include "trainer_pokemon_sprites.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "script_pokemon_util_80F87D8.h"
|
||||
#include "script_pokemon_util.h"
|
||||
#include "graphics.h"
|
||||
#include "constants/battle_dome.h"
|
||||
#include "constants/frontier_util.h"
|
||||
|
||||
+13
-16
@@ -916,14 +916,14 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 notTransform
|
||||
if (IsContest())
|
||||
{
|
||||
position = 0;
|
||||
targetSpecies = gContestResources->field_18->unk2;
|
||||
personalityValue = gContestResources->field_18->unk8;
|
||||
otId = gContestResources->field_18->unkC;
|
||||
targetSpecies = gContestResources->moveAnim->targetSpecies;
|
||||
personalityValue = gContestResources->moveAnim->personality;
|
||||
otId = gContestResources->moveAnim->otId;
|
||||
|
||||
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[targetSpecies],
|
||||
gMonSpritesGfxPtr->sprites[0],
|
||||
targetSpecies,
|
||||
gContestResources->field_18->unk10);
|
||||
gContestResources->moveAnim->targetPersonality);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1014,15 +1014,12 @@ void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite)
|
||||
palOffset = (battlerId * 16) + 0x100;
|
||||
LoadCompressedPalette(gSubstituteDollPal, palOffset, 32);
|
||||
}
|
||||
else
|
||||
else if (!IsContest())
|
||||
{
|
||||
if (!IsContest())
|
||||
{
|
||||
if (GetBattlerSide(battlerId) != B_SIDE_PLAYER)
|
||||
BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlerPartyIndexes[battlerId]], battlerId);
|
||||
else
|
||||
BattleLoadPlayerMonSpriteGfx(&gPlayerParty[gBattlerPartyIndexes[battlerId]], battlerId);
|
||||
}
|
||||
if (GetBattlerSide(battlerId) != B_SIDE_PLAYER)
|
||||
BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlerPartyIndexes[battlerId]], battlerId);
|
||||
else
|
||||
BattleLoadPlayerMonSpriteGfx(&gPlayerParty[gBattlerPartyIndexes[battlerId]], battlerId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1058,7 +1055,7 @@ void HandleLowHpMusicChange(struct Pokemon *mon, u8 battlerId)
|
||||
if (!gBattleSpritesDataPtr->battlerData[battlerId].lowHpSong)
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->battlerData[battlerId ^ BIT_FLANK].lowHpSong)
|
||||
PlaySE(SE_HINSI);
|
||||
PlaySE(SE_LOW_HEALTH);
|
||||
gBattleSpritesDataPtr->battlerData[battlerId].lowHpSong = 1;
|
||||
}
|
||||
}
|
||||
@@ -1067,12 +1064,12 @@ void HandleLowHpMusicChange(struct Pokemon *mon, u8 battlerId)
|
||||
gBattleSpritesDataPtr->battlerData[battlerId].lowHpSong = 0;
|
||||
if (!IsDoubleBattle())
|
||||
{
|
||||
m4aSongNumStop(SE_HINSI);
|
||||
m4aSongNumStop(SE_LOW_HEALTH);
|
||||
return;
|
||||
}
|
||||
if (IsDoubleBattle() && !gBattleSpritesDataPtr->battlerData[battlerId ^ BIT_FLANK].lowHpSong)
|
||||
{
|
||||
m4aSongNumStop(SE_HINSI);
|
||||
m4aSongNumStop(SE_LOW_HEALTH);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1086,7 +1083,7 @@ void BattleStopLowHpSound(void)
|
||||
if (IsDoubleBattle())
|
||||
gBattleSpritesDataPtr->battlerData[playerBattler ^ BIT_FLANK].lowHpSong = 0;
|
||||
|
||||
m4aSongNumStop(SE_HINSI);
|
||||
m4aSongNumStop(SE_LOW_HEALTH);
|
||||
}
|
||||
|
||||
u8 GetMonHPBarLevel(struct Pokemon *mon)
|
||||
|
||||
@@ -1649,7 +1649,7 @@ u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo,
|
||||
gBattleSpritesDataPtr->animationData->field_9_x1C++;
|
||||
}
|
||||
|
||||
PlaySE12WithPanning(SE_TB_START, 0);
|
||||
PlaySE12WithPanning(SE_BALL_TRAY_ENTER, 0);
|
||||
return taskId;
|
||||
}
|
||||
|
||||
@@ -1852,9 +1852,9 @@ static void SpriteCB_StatusSummaryBallsOnBattleStart(struct Sprite *sprite)
|
||||
pan = SOUND_PAN_ATTACKER;
|
||||
|
||||
if (sprite->data[7] != 0)
|
||||
PlaySE2WithPanning(SE_TB_KARA, pan);
|
||||
PlaySE2WithPanning(SE_BALL_TRAY_EXIT, pan);
|
||||
else
|
||||
PlaySE1WithPanning(SE_TB_KON, pan);
|
||||
PlaySE1WithPanning(SE_BALL_TRAY_BALL, pan);
|
||||
|
||||
sprite->callback = SpriteCallbackDummy;
|
||||
}
|
||||
|
||||
+50
-59
@@ -1484,9 +1484,9 @@ static void CB2_PreInitMultiBattle(void)
|
||||
{
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
if (gWirelessCommType)
|
||||
sub_800ADF8();
|
||||
SetLinkStandbyCallback();
|
||||
else
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
@@ -1869,7 +1869,7 @@ static void FreeRestoreBattleData(void)
|
||||
gScanlineEffect.state = 3;
|
||||
gMain.inBattle = 0;
|
||||
ZeroEnemyPartyMons();
|
||||
m4aSongNumStop(SE_HINSI);
|
||||
m4aSongNumStop(SE_LOW_HEALTH);
|
||||
FreeMonSpritesGfx();
|
||||
FreeBattleSpritesData();
|
||||
FreeBattleResources();
|
||||
@@ -2114,7 +2114,7 @@ void sub_8038B74(struct Sprite *sprite)
|
||||
{
|
||||
StartSpriteAffineAnim(sprite, 1);
|
||||
sprite->callback = sub_8038B04;
|
||||
PlaySE(SE_BT_START);
|
||||
PlaySE(SE_MUGSHOT);
|
||||
}
|
||||
|
||||
static void sub_8038B94(u8 taskId)
|
||||
@@ -2368,7 +2368,7 @@ static void sub_8038F34(void)
|
||||
case 6:
|
||||
if (IsLinkTaskFinished() == TRUE)
|
||||
{
|
||||
sub_800ADF8();
|
||||
SetLinkStandbyCallback();
|
||||
BattlePutTextOnWindow(gText_LinkStandby3, 0);
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
@@ -2382,7 +2382,7 @@ static void sub_8038F34(void)
|
||||
break;
|
||||
case 8:
|
||||
if (!gWirelessCommType)
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
break;
|
||||
case 9:
|
||||
@@ -2556,7 +2556,7 @@ static void sub_803939C(void)
|
||||
HandleBattleWindow(0x18, 8, 0x1D, 0xD, WINDOW_CLEAR);
|
||||
if (gMain.field_439_x4)
|
||||
{
|
||||
sub_800ADF8();
|
||||
SetLinkStandbyCallback();
|
||||
BattlePutTextOnWindow(gText_LinkStandby3, 0);
|
||||
}
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
@@ -2566,7 +2566,7 @@ static void sub_803939C(void)
|
||||
if (--gBattleCommunication[1] == 0)
|
||||
{
|
||||
if (gMain.field_439_x4 && !gWirelessCommType)
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
break;
|
||||
@@ -2605,7 +2605,7 @@ static void sub_803939C(void)
|
||||
{
|
||||
if (gMain.field_439_x4)
|
||||
{
|
||||
sub_800ADF8();
|
||||
SetLinkStandbyCallback();
|
||||
BattlePutTextOnWindow(gText_LinkStandby3, 0);
|
||||
}
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
@@ -3135,7 +3135,7 @@ void SwitchInClearSetData(void)
|
||||
if (gBattleMoves[gCurrentMove].effect != EFFECT_BATON_PASS)
|
||||
{
|
||||
for (i = 0; i < NUM_BATTLE_STATS; i++)
|
||||
gBattleMons[gActiveBattler].statStages[i] = 6;
|
||||
gBattleMons[gActiveBattler].statStages[i] = DEFAULT_STAT_STAGE;
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
if ((gBattleMons[i].status2 & STATUS2_ESCAPE_PREVENTION) && gDisableStructs[i].battlerPreventingEscape == gActiveBattler)
|
||||
@@ -3244,7 +3244,7 @@ void FaintClearSetData(void)
|
||||
u8 *ptr;
|
||||
|
||||
for (i = 0; i < NUM_BATTLE_STATS; i++)
|
||||
gBattleMons[gActiveBattler].statStages[i] = 6;
|
||||
gBattleMons[gActiveBattler].statStages[i] = DEFAULT_STAT_STAGE;
|
||||
|
||||
gBattleMons[gActiveBattler].status2 = 0;
|
||||
gStatuses3[gActiveBattler] = 0;
|
||||
@@ -3398,7 +3398,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
|
||||
hpOnSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(gActiveBattler)];
|
||||
*hpOnSwitchout = gBattleMons[gActiveBattler].hp;
|
||||
for (i = 0; i < NUM_BATTLE_STATS; i++)
|
||||
gBattleMons[gActiveBattler].statStages[i] = 6;
|
||||
gBattleMons[gActiveBattler].statStages[i] = DEFAULT_STAT_STAGE;
|
||||
gBattleMons[gActiveBattler].status2 = 0;
|
||||
}
|
||||
|
||||
@@ -4851,40 +4851,38 @@ static void SetActionsAndBattlersTurnOrder(void)
|
||||
gBattleStruct->focusPunchBattlerId = 0;
|
||||
return;
|
||||
}
|
||||
else
|
||||
for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++)
|
||||
{
|
||||
for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++)
|
||||
if (gChosenActionByBattler[gActiveBattler] == B_ACTION_USE_ITEM || gChosenActionByBattler[gActiveBattler] == B_ACTION_SWITCH)
|
||||
{
|
||||
if (gChosenActionByBattler[gActiveBattler] == B_ACTION_USE_ITEM || gChosenActionByBattler[gActiveBattler] == B_ACTION_SWITCH)
|
||||
{
|
||||
gActionsByTurnOrder[turnOrderId] = gChosenActionByBattler[gActiveBattler];
|
||||
gBattlerByTurnOrder[turnOrderId] = gActiveBattler;
|
||||
turnOrderId++;
|
||||
}
|
||||
gActionsByTurnOrder[turnOrderId] = gChosenActionByBattler[gActiveBattler];
|
||||
gBattlerByTurnOrder[turnOrderId] = gActiveBattler;
|
||||
turnOrderId++;
|
||||
}
|
||||
for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++)
|
||||
}
|
||||
for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++)
|
||||
{
|
||||
if (gChosenActionByBattler[gActiveBattler] != B_ACTION_USE_ITEM && gChosenActionByBattler[gActiveBattler] != B_ACTION_SWITCH)
|
||||
{
|
||||
if (gChosenActionByBattler[gActiveBattler] != B_ACTION_USE_ITEM && gChosenActionByBattler[gActiveBattler] != B_ACTION_SWITCH)
|
||||
{
|
||||
gActionsByTurnOrder[turnOrderId] = gChosenActionByBattler[gActiveBattler];
|
||||
gBattlerByTurnOrder[turnOrderId] = gActiveBattler;
|
||||
turnOrderId++;
|
||||
}
|
||||
gActionsByTurnOrder[turnOrderId] = gChosenActionByBattler[gActiveBattler];
|
||||
gBattlerByTurnOrder[turnOrderId] = gActiveBattler;
|
||||
turnOrderId++;
|
||||
}
|
||||
for (i = 0; i < gBattlersCount - 1; i++)
|
||||
}
|
||||
for (i = 0; i < gBattlersCount - 1; i++)
|
||||
{
|
||||
for (j = i + 1; j < gBattlersCount; j++)
|
||||
{
|
||||
for (j = i + 1; j < gBattlersCount; j++)
|
||||
u8 battler1 = gBattlerByTurnOrder[i];
|
||||
u8 battler2 = gBattlerByTurnOrder[j];
|
||||
|
||||
if (gActionsByTurnOrder[i] != B_ACTION_USE_ITEM
|
||||
&& gActionsByTurnOrder[j] != B_ACTION_USE_ITEM
|
||||
&& gActionsByTurnOrder[i] != B_ACTION_SWITCH
|
||||
&& gActionsByTurnOrder[j] != B_ACTION_SWITCH)
|
||||
{
|
||||
u8 battler1 = gBattlerByTurnOrder[i];
|
||||
u8 battler2 = gBattlerByTurnOrder[j];
|
||||
if (gActionsByTurnOrder[i] != B_ACTION_USE_ITEM
|
||||
&& gActionsByTurnOrder[j] != B_ACTION_USE_ITEM
|
||||
&& gActionsByTurnOrder[i] != B_ACTION_SWITCH
|
||||
&& gActionsByTurnOrder[j] != B_ACTION_SWITCH)
|
||||
{
|
||||
if (GetWhoStrikesFirst(battler1, battler2, FALSE))
|
||||
SwapTurnOrder(i, j);
|
||||
}
|
||||
if (GetWhoStrikesFirst(battler1, battler2, FALSE))
|
||||
SwapTurnOrder(i, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4962,12 +4960,8 @@ static void CheckFocusPunch_ClearVarsBeforeTurnStarts(void)
|
||||
}
|
||||
|
||||
TryClearRageStatuses();
|
||||
gCurrentTurnActionNumber = 0;
|
||||
{
|
||||
// something stupid needed to match
|
||||
u8 zero;
|
||||
gCurrentActionFuncId = gActionsByTurnOrder[(zero = 0)];
|
||||
}
|
||||
gCurrentTurnActionNumber = 0; //See comment underneath
|
||||
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber]; //Should be gActionsByTurnOrder[(gCurrentTurnActionNumber = 0)], but that doesn't match
|
||||
gDynamicBasePower = 0;
|
||||
gBattleStruct->dynamicMoveType = 0;
|
||||
gBattleMainFunc = RunTurnActionsFunctions;
|
||||
@@ -4990,13 +4984,10 @@ static void RunTurnActionsFunctions(void)
|
||||
gHitMarker &= ~(HITMARKER_x100000);
|
||||
gBattleMainFunc = sEndTurnFuncsTable[gBattleOutcome & 0x7F];
|
||||
}
|
||||
else
|
||||
else if (gBattleStruct->savedTurnActionNumber != gCurrentTurnActionNumber) // action turn has been done, clear hitmarker bits for another battlerId
|
||||
{
|
||||
if (gBattleStruct->savedTurnActionNumber != gCurrentTurnActionNumber) // action turn has been done, clear hitmarker bits for another battlerId
|
||||
{
|
||||
gHitMarker &= ~(HITMARKER_NO_ATTACKSTRING);
|
||||
gHitMarker &= ~(HITMARKER_UNABLE_TO_USE_MOVE);
|
||||
}
|
||||
gHitMarker &= ~(HITMARKER_NO_ATTACKSTRING);
|
||||
gHitMarker &= ~(HITMARKER_UNABLE_TO_USE_MOVE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5019,9 +5010,9 @@ static void HandleEndTurn_BattleWon(void)
|
||||
gBattlescriptCurrInstr = BattleScript_FrontierTrainerBattleWon;
|
||||
|
||||
if (gTrainerBattleOpponent_A == TRAINER_FRONTIER_BRAIN)
|
||||
PlayBGM(MUS_KACHI3);
|
||||
PlayBGM(MUS_VICTORY_GYM_LEADER);
|
||||
else
|
||||
PlayBGM(MUS_KACHI1);
|
||||
PlayBGM(MUS_VICTORY_TRAINER);
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && !(gBattleTypeFlags & BATTLE_TYPE_LINK))
|
||||
{
|
||||
@@ -5032,7 +5023,7 @@ static void HandleEndTurn_BattleWon(void)
|
||||
{
|
||||
case TRAINER_CLASS_ELITE_FOUR:
|
||||
case TRAINER_CLASS_CHAMPION:
|
||||
PlayBGM(MUS_KACHI5);
|
||||
PlayBGM(MUS_VICTORY_LEAGUE);
|
||||
break;
|
||||
case TRAINER_CLASS_TEAM_AQUA:
|
||||
case TRAINER_CLASS_TEAM_MAGMA:
|
||||
@@ -5040,13 +5031,13 @@ static void HandleEndTurn_BattleWon(void)
|
||||
case TRAINER_CLASS_AQUA_LEADER:
|
||||
case TRAINER_CLASS_MAGMA_ADMIN:
|
||||
case TRAINER_CLASS_MAGMA_LEADER:
|
||||
PlayBGM(MUS_KACHI4);
|
||||
PlayBGM(MUS_VICTORY_AQUA_MAGMA);
|
||||
break;
|
||||
case TRAINER_CLASS_LEADER:
|
||||
PlayBGM(MUS_KACHI3);
|
||||
PlayBGM(MUS_VICTORY_GYM_LEADER);
|
||||
break;
|
||||
default:
|
||||
PlayBGM(MUS_KACHI1);
|
||||
PlayBGM(MUS_VICTORY_TRAINER);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -5279,7 +5270,7 @@ static void ReturnFromBattleToOverworld(void)
|
||||
SetRoamerInactive();
|
||||
}
|
||||
|
||||
m4aSongNumStop(SE_HINSI);
|
||||
m4aSongNumStop(SE_LOW_HEALTH);
|
||||
SetMainCallback2(gMain.savedCallback);
|
||||
}
|
||||
|
||||
@@ -5826,7 +5817,7 @@ static void HandleAction_GoNear(void)
|
||||
static void HandleAction_SafariZoneRun(void)
|
||||
{
|
||||
gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
|
||||
PlaySE(SE_NIGERU);
|
||||
PlaySE(SE_FLEE);
|
||||
gCurrentTurnActionNumber = gBattlersCount;
|
||||
gBattleOutcome = B_OUTCOME_RAN;
|
||||
}
|
||||
|
||||
+97
-56
@@ -19,12 +19,15 @@
|
||||
#include "text.h"
|
||||
#include "trainer_hill.h"
|
||||
#include "window.h"
|
||||
#include "constants/battle_dome.h"
|
||||
#include "constants/battle_string_ids.h"
|
||||
#include "constants/berry.h"
|
||||
#include "constants/frontier_util.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/moves.h"
|
||||
#include "constants/trainers.h"
|
||||
#include "constants/trainer_hill.h"
|
||||
#include "constants/weather.h"
|
||||
|
||||
struct BattleWindowText
|
||||
{
|
||||
@@ -312,23 +315,23 @@ static const u8 sText_StatsWontIncrease2[] = _("{B_ATK_NAME_WITH_PREFIX}'s stats
|
||||
static const u8 sText_StatsWontDecrease2[] = _("{B_DEF_NAME_WITH_PREFIX}'s stats won't\ngo any lower!");
|
||||
static const u8 sText_CriticalHit[] = _("A critical hit!");
|
||||
static const u8 sText_OneHitKO[] = _("It's a one-hit KO!");
|
||||
static const u8 sText_123Poof[] = _("{PAUSE 32}1, {PAUSE 15}2, and{PAUSE 15}… {PAUSE 15}… {PAUSE 15}… {PAUSE 15}{PLAY_SE SE_KON}Poof!\p");
|
||||
static const u8 sText_123Poof[] = _("{PAUSE 32}1, {PAUSE 15}2, and{PAUSE 15}… {PAUSE 15}… {PAUSE 15}… {PAUSE 15}{PLAY_SE SE_BALL_BOUNCE_1}Poof!\p");
|
||||
static const u8 sText_AndEllipsis[] = _("And…\p");
|
||||
static const u8 sText_HMMovesCantBeForgotten[] = _("HM moves can't be\nforgotten now.\p");
|
||||
static const u8 sText_NotVeryEffective[] = _("It's not very effective…");
|
||||
static const u8 sText_SuperEffective[] = _("It's super effective!");
|
||||
static const u8 sText_GotAwaySafely[] = _("{PLAY_SE SE_NIGERU}Got away safely!\p");
|
||||
static const u8 sText_PkmnFledUsingIts[] = _("{PLAY_SE SE_NIGERU}{B_ATK_NAME_WITH_PREFIX} fled\nusing its {B_LAST_ITEM}!\p");
|
||||
static const u8 sText_PkmnFledUsing[] = _("{PLAY_SE SE_NIGERU}{B_ATK_NAME_WITH_PREFIX} fled\nusing {B_ATK_ABILITY}!\p");
|
||||
static const u8 sText_WildPkmnFled[] = _("{PLAY_SE SE_NIGERU}Wild {B_BUFF1} fled!");
|
||||
static const u8 sText_GotAwaySafely[] = _("{PLAY_SE SE_FLEE}Got away safely!\p");
|
||||
static const u8 sText_PkmnFledUsingIts[] = _("{PLAY_SE SE_FLEE}{B_ATK_NAME_WITH_PREFIX} fled\nusing its {B_LAST_ITEM}!\p");
|
||||
static const u8 sText_PkmnFledUsing[] = _("{PLAY_SE SE_FLEE}{B_ATK_NAME_WITH_PREFIX} fled\nusing {B_ATK_ABILITY}!\p");
|
||||
static const u8 sText_WildPkmnFled[] = _("{PLAY_SE SE_FLEE}Wild {B_BUFF1} fled!");
|
||||
static const u8 sText_PlayerDefeatedLinkTrainer[] = _("Player defeated\n{B_LINK_OPPONENT1_NAME}!");
|
||||
static const u8 sText_TwoLinkTrainersDefeated[] = _("Player beat {B_LINK_OPPONENT1_NAME}\nand {B_LINK_OPPONENT2_NAME}!");
|
||||
static const u8 sText_PlayerLostAgainstLinkTrainer[] = _("Player lost against\n{B_LINK_OPPONENT1_NAME}!");
|
||||
static const u8 sText_PlayerLostToTwo[] = _("Player lost to {B_LINK_OPPONENT1_NAME}\nand {B_LINK_OPPONENT2_NAME}!");
|
||||
static const u8 sText_PlayerBattledToDrawLinkTrainer[] = _("Player battled to a draw against\n{B_LINK_OPPONENT1_NAME}!");
|
||||
static const u8 sText_PlayerBattledToDrawVsTwo[] = _("Player battled to a draw against\n{B_LINK_OPPONENT1_NAME} and {B_LINK_OPPONENT2_NAME}!");
|
||||
static const u8 sText_WildFled[] = _("{PLAY_SE SE_NIGERU}{B_LINK_OPPONENT1_NAME} fled!");
|
||||
static const u8 sText_TwoWildFled[] = _("{PLAY_SE SE_NIGERU}{B_LINK_OPPONENT1_NAME} and\n{B_LINK_OPPONENT2_NAME} fled!");
|
||||
static const u8 sText_WildFled[] = _("{PLAY_SE SE_FLEE}{B_LINK_OPPONENT1_NAME} fled!");
|
||||
static const u8 sText_TwoWildFled[] = _("{PLAY_SE SE_FLEE}{B_LINK_OPPONENT1_NAME} and\n{B_LINK_OPPONENT2_NAME} fled!");
|
||||
static const u8 sText_NoRunningFromTrainers[] = _("No! There's no running\nfrom a TRAINER battle!\p");
|
||||
static const u8 sText_CantEscape[] = _("Can't escape!\p");
|
||||
static const u8 sText_DontLeaveBirch[] = _("PROF. BIRCH: Don't leave me like this!\p");
|
||||
@@ -378,7 +381,7 @@ static const u8 sText_PkmnCuriousAboutX[] = _("{B_OPPONENT_MON1_NAME} is curious
|
||||
static const u8 sText_PkmnEnthralledByX[] = _("{B_OPPONENT_MON1_NAME} is enthralled by\nthe {B_BUFF1}!");
|
||||
static const u8 sText_PkmnIgnoredX[] = _("{B_OPPONENT_MON1_NAME} completely ignored\nthe {B_BUFF1}!");
|
||||
static const u8 sText_ThrewPokeblockAtPkmn[] = _("{B_PLAYER_NAME} threw a {POKEBLOCK}\nat the {B_OPPONENT_MON1_NAME}!");
|
||||
static const u8 sText_OutOfSafariBalls[] = _("{PLAY_SE SE_PINPON}ANNOUNCER: You're out of\nSAFARI BALLS! Game over!\p");
|
||||
static const u8 sText_OutOfSafariBalls[] = _("{PLAY_SE SE_DING_DONG}ANNOUNCER: You're out of\nSAFARI BALLS! Game over!\p");
|
||||
static const u8 sText_OpponentMon1Appeared[] = _("{B_OPPONENT_MON1_NAME} appeared!\p");
|
||||
static const u8 sText_WildPkmnAppeared[] = _("Wild {B_OPPONENT_MON1_NAME} appeared!\p");
|
||||
static const u8 sText_WildPkmnAppeared2[] = _("Wild {B_OPPONENT_MON1_NAME} appeared!\p");
|
||||
@@ -433,11 +436,16 @@ static const u8 sText_SpDef2[] = _("SP. DEF");
|
||||
static const u8 sText_Accuracy[] = _("accuracy");
|
||||
static const u8 sText_Evasiveness[] = _("evasiveness");
|
||||
|
||||
const u8 * const gStatNamesTable[] =
|
||||
const u8 * const gStatNamesTable[NUM_BATTLE_STATS] =
|
||||
{
|
||||
sText_HP2, sText_Attack2, sText_Defense2,
|
||||
sText_Speed, sText_SpAtk2, sText_SpDef2,
|
||||
sText_Accuracy, sText_Evasiveness
|
||||
[STAT_HP] = sText_HP2,
|
||||
[STAT_ATK] = sText_Attack2,
|
||||
[STAT_DEF] = sText_Defense2,
|
||||
[STAT_SPEED] = sText_Speed,
|
||||
[STAT_SPATK] = sText_SpAtk2,
|
||||
[STAT_SPDEF] = sText_SpDef2,
|
||||
[STAT_ACC] = sText_Accuracy,
|
||||
[STAT_EVASION] = sText_Evasiveness,
|
||||
};
|
||||
|
||||
static const u8 sText_PokeblockWasTooSpicy[] = _("was too spicy!");
|
||||
@@ -446,11 +454,13 @@ static const u8 sText_PokeblockWasTooSweet[] = _("was too sweet!");
|
||||
static const u8 sText_PokeblockWasTooBitter[] = _("was too bitter!");
|
||||
static const u8 sText_PokeblockWasTooSour[] = _("was too sour!");
|
||||
|
||||
const u8 * const gPokeblockWasTooXStringTable[] =
|
||||
const u8 * const gPokeblockWasTooXStringTable[FLAVOR_COUNT] =
|
||||
{
|
||||
sText_PokeblockWasTooSpicy, sText_PokeblockWasTooDry,
|
||||
sText_PokeblockWasTooSweet, sText_PokeblockWasTooBitter,
|
||||
sText_PokeblockWasTooSour
|
||||
[FLAVOR_SPICY] = sText_PokeblockWasTooSpicy,
|
||||
[FLAVOR_DRY] = sText_PokeblockWasTooDry,
|
||||
[FLAVOR_SWEET] = sText_PokeblockWasTooSweet,
|
||||
[FLAVOR_BITTER] = sText_PokeblockWasTooBitter,
|
||||
[FLAVOR_SOUR] = sText_PokeblockWasTooSour
|
||||
};
|
||||
|
||||
static const u8 sText_PlayerUsedItem[] = _("{B_PLAYER_NAME} used\n{B_LAST_ITEM}!");
|
||||
@@ -464,8 +474,8 @@ static const u8 sText_PkmnBrokeFree[] = _("Oh, no!\nThe POKéMON broke free!");
|
||||
static const u8 sText_ItAppearedCaught[] = _("Aww!\nIt appeared to be caught!");
|
||||
static const u8 sText_AarghAlmostHadIt[] = _("Aargh!\nAlmost had it!");
|
||||
static const u8 sText_ShootSoClose[] = _("Shoot!\nIt was so close, too!");
|
||||
static const u8 sText_GotchaPkmnCaught[] = _("Gotcha!\n{B_OPPONENT_MON1_NAME} was caught!{WAIT_SE}{PLAY_BGM MUS_KACHI22}\p");
|
||||
static const u8 sText_GotchaPkmnCaught2[] = _("Gotcha!\n{B_OPPONENT_MON1_NAME} was caught!{WAIT_SE}{PLAY_BGM MUS_KACHI22}{PAUSE 127}");
|
||||
static const u8 sText_GotchaPkmnCaught[] = _("Gotcha!\n{B_OPPONENT_MON1_NAME} was caught!{WAIT_SE}{PLAY_BGM MUS_CAUGHT}\p");
|
||||
static const u8 sText_GotchaPkmnCaught2[] = _("Gotcha!\n{B_OPPONENT_MON1_NAME} was caught!{WAIT_SE}{PLAY_BGM MUS_CAUGHT}{PAUSE 127}");
|
||||
static const u8 sText_GiveNicknameCaptured[] = _("Give a nickname to the\ncaptured {B_OPPONENT_MON1_NAME}?");
|
||||
static const u8 sText_PkmnSentToPC[] = _("{B_OPPONENT_MON1_NAME} was sent to\n{B_PC_CREATOR_NAME} PC.");
|
||||
static const u8 sText_Someones[] = _("someone's");
|
||||
@@ -979,16 +989,28 @@ const u16 gStatDownStringIds[] =
|
||||
STRINGID_PKMNSSTATCHANGED3, STRINGID_PKMNSSTATCHANGED4, STRINGID_STATSWONTDECREASE, STRINGID_EMPTYSTRING3
|
||||
};
|
||||
|
||||
// Index read from sTWOTURN_STRINGID
|
||||
const u16 gFirstTurnOfTwoStringIds[] =
|
||||
{
|
||||
STRINGID_PKMNWHIPPEDWHIRLWIND, STRINGID_PKMNTOOKSUNLIGHT, STRINGID_PKMNLOWEREDHEAD, STRINGID_PKMNISGLOWING,
|
||||
STRINGID_PKMNFLEWHIGH, STRINGID_PKMNDUGHOLE, STRINGID_PKMNHIDUNDERWATER, STRINGID_PKMNSPRANGUP
|
||||
STRINGID_PKMNWHIPPEDWHIRLWIND, // MOVE_RAZOR_WIND
|
||||
STRINGID_PKMNTOOKSUNLIGHT, // MOVE_SOLAR_BEAM
|
||||
STRINGID_PKMNLOWEREDHEAD, // MOVE_SKULL_BASH
|
||||
STRINGID_PKMNISGLOWING, // MOVE_SKY_ATTACK
|
||||
STRINGID_PKMNFLEWHIGH, // MOVE_FLY
|
||||
STRINGID_PKMNDUGHOLE, // MOVE_DIG
|
||||
STRINGID_PKMNHIDUNDERWATER, // MOVE_DIVE
|
||||
STRINGID_PKMNSPRANGUP // MOVE_BOUNCE
|
||||
};
|
||||
|
||||
// Index copied from move's index in gTrappingMoves
|
||||
const u16 gWrappedStringIds[] =
|
||||
{
|
||||
STRINGID_PKMNSQUEEZEDBYBIND, STRINGID_PKMNWRAPPEDBY, STRINGID_PKMNTRAPPEDINVORTEX,
|
||||
STRINGID_PKMNCLAMPED, STRINGID_PKMNTRAPPEDINVORTEX, STRINGID_PKMNTRAPPEDBYSANDTOMB
|
||||
STRINGID_PKMNSQUEEZEDBYBIND, // MOVE_BIND
|
||||
STRINGID_PKMNWRAPPEDBY, // MOVE_WRAP
|
||||
STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_FIRE_SPIN
|
||||
STRINGID_PKMNCLAMPED, // MOVE_CLAMP
|
||||
STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_WHIRLPOOL
|
||||
STRINGID_PKMNTRAPPEDBYSANDTOMB // MOVE_SAND_TOMB
|
||||
};
|
||||
|
||||
const u16 gMistUsedStringIds[] =
|
||||
@@ -1078,13 +1100,25 @@ const u16 gBallEscapeStringIds[] =
|
||||
STRINGID_PKMNBROKEFREE, STRINGID_ITAPPEAREDCAUGHT, STRINGID_AARGHALMOSTHADIT, STRINGID_SHOOTSOCLOSE
|
||||
};
|
||||
|
||||
const u16 gWeatherContinuesStringIds[] =
|
||||
// Overworld weathers that don't have an associated battle weather default to "It is raining."
|
||||
const u16 gWeatherStartsStringIds[] =
|
||||
{
|
||||
STRINGID_ITISRAINING, STRINGID_ITISRAINING, STRINGID_ITISRAINING,
|
||||
STRINGID_ITISRAINING, STRINGID_ITISRAINING, STRINGID_ITISRAINING,
|
||||
STRINGID_ITISRAINING, STRINGID_ITISRAINING, STRINGID_SANDSTORMISRAGING,
|
||||
STRINGID_ITISRAINING, STRINGID_ITISRAINING, STRINGID_ITISRAINING,
|
||||
STRINGID_SUNLIGHTSTRONG, STRINGID_ITISRAINING, STRINGID_ITISRAINING, STRINGID_ITISRAINING
|
||||
[WEATHER_NONE] = STRINGID_ITISRAINING,
|
||||
[WEATHER_SUNNY_CLOUDS] = STRINGID_ITISRAINING,
|
||||
[WEATHER_SUNNY] = STRINGID_ITISRAINING,
|
||||
[WEATHER_RAIN] = STRINGID_ITISRAINING,
|
||||
[WEATHER_SNOW] = STRINGID_ITISRAINING,
|
||||
[WEATHER_RAIN_THUNDERSTORM] = STRINGID_ITISRAINING,
|
||||
[WEATHER_FOG_HORIZONTAL] = STRINGID_ITISRAINING,
|
||||
[WEATHER_VOLCANIC_ASH] = STRINGID_ITISRAINING,
|
||||
[WEATHER_SANDSTORM] = STRINGID_SANDSTORMISRAGING,
|
||||
[WEATHER_FOG_DIAGONAL] = STRINGID_ITISRAINING,
|
||||
[WEATHER_UNDERWATER] = STRINGID_ITISRAINING,
|
||||
[WEATHER_SHADE] = STRINGID_ITISRAINING,
|
||||
[WEATHER_DROUGHT] = STRINGID_SUNLIGHTSTRONG,
|
||||
[WEATHER_DOWNPOUR] = STRINGID_ITISRAINING,
|
||||
[WEATHER_UNDERWATER_BUBBLES] = STRINGID_ITISRAINING,
|
||||
[WEATHER_ABNORMAL] = STRINGID_ITISRAINING
|
||||
};
|
||||
|
||||
const u16 gInobedientStringIds[] =
|
||||
@@ -1146,7 +1180,13 @@ const u16 gCaughtMonStringIds[] =
|
||||
|
||||
const u16 gTrappingMoves[] =
|
||||
{
|
||||
MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, 0xFFFF
|
||||
MOVE_BIND,
|
||||
MOVE_WRAP,
|
||||
MOVE_FIRE_SPIN,
|
||||
MOVE_CLAMP,
|
||||
MOVE_WHIRLPOOL,
|
||||
MOVE_SAND_TOMB,
|
||||
0xFFFF
|
||||
};
|
||||
|
||||
const u8 gText_PkmnIsEvolving[] = _("What?\n{STR_VAR_1} is evolving!");
|
||||
@@ -1207,26 +1247,27 @@ const u8 gText_Draw[] = _("{HIGHLIGHT TRANSPARENT}Draw");
|
||||
static const u8 sText_SpaceIs[] = _(" is");
|
||||
static const u8 sText_ApostropheS[] = _("'s");
|
||||
|
||||
static const u8 sATypeMove_Table[][17] =
|
||||
// For displaying names of invalid moves
|
||||
static const u8 sATypeMove_Table[][NUMBER_OF_MON_TYPES - 1] =
|
||||
{
|
||||
_("a NORMAL move"),
|
||||
_("a FIGHTING move"),
|
||||
_("a FLYING move"),
|
||||
_("a POISON move"),
|
||||
_("a GROUND move"),
|
||||
_("a ROCK move"),
|
||||
_("a BUG move"),
|
||||
_("a GHOST move"),
|
||||
_("a STEEL move"),
|
||||
_("a ??? move"),
|
||||
_("a FIRE move"),
|
||||
_("a WATER move"),
|
||||
_("a GRASS move"),
|
||||
_("an ELECTRIC move"),
|
||||
_("a PSYCHIC move"),
|
||||
_("an ICE move"),
|
||||
_("a DRAGON move"),
|
||||
_("a DARK move")
|
||||
[TYPE_NORMAL] = _("a NORMAL move"),
|
||||
[TYPE_FIGHTING] = _("a FIGHTING move"),
|
||||
[TYPE_FLYING] = _("a FLYING move"),
|
||||
[TYPE_POISON] = _("a POISON move"),
|
||||
[TYPE_GROUND] = _("a GROUND move"),
|
||||
[TYPE_ROCK] = _("a ROCK move"),
|
||||
[TYPE_BUG] = _("a BUG move"),
|
||||
[TYPE_GHOST] = _("a GHOST move"),
|
||||
[TYPE_STEEL] = _("a STEEL move"),
|
||||
[TYPE_MYSTERY] = _("a ??? move"),
|
||||
[TYPE_FIRE] = _("a FIRE move"),
|
||||
[TYPE_WATER] = _("a WATER move"),
|
||||
[TYPE_GRASS] = _("a GRASS move"),
|
||||
[TYPE_ELECTRIC] = _("an ELECTRIC move"),
|
||||
[TYPE_PSYCHIC] = _("a PSYCHIC move"),
|
||||
[TYPE_ICE] = _("an ICE move"),
|
||||
[TYPE_DRAGON] = _("a DRAGON move"),
|
||||
[TYPE_DARK] = _("a DARK move")
|
||||
};
|
||||
|
||||
const u8 gText_BattleTourney[] = _("BATTLE TOURNEY");
|
||||
@@ -1235,16 +1276,16 @@ static const u8 sText_Round2[] = _("Round 2");
|
||||
static const u8 sText_Semifinal[] = _("Semifinal");
|
||||
static const u8 sText_Final[] = _("Final");
|
||||
|
||||
const u8 *const gRoundsStringTable[] =
|
||||
const u8 *const gRoundsStringTable[DOME_ROUNDS_COUNT] =
|
||||
{
|
||||
sText_Round1,
|
||||
sText_Round2,
|
||||
sText_Semifinal,
|
||||
sText_Final
|
||||
[DOME_ROUND1] = sText_Round1,
|
||||
[DOME_ROUND2] = sText_Round2,
|
||||
[DOME_SEMIFINAL] = sText_Semifinal,
|
||||
[DOME_FINAL] = sText_Final
|
||||
};
|
||||
|
||||
const u8 gText_TheGreatNewHope[] = _("The great new hope!\p");
|
||||
const u8 gText_WillChampinshipDreamComeTrue[] = _("Will the championship dream come true?!\p");
|
||||
const u8 gText_WillChampionshipDreamComeTrue[] = _("Will the championship dream come true?!\p");
|
||||
const u8 gText_AFormerChampion[] = _("A former CHAMPION!\p");
|
||||
const u8 gText_ThePreviousChampion[] = _("The previous CHAMPION!\p");
|
||||
const u8 gText_TheUnbeatenChampion[] = _("The unbeaten CHAMPION!\p");
|
||||
@@ -1305,7 +1346,7 @@ static const u8 sText_QuestionForfeitMatch[] = _("Would you like to forfeit the
|
||||
static const u8 sText_ForfeitedMatch[] = _("{B_PLAYER_NAME} forfeited the match!");
|
||||
static const u8 sText_Trainer1WinText[] = _("{B_TRAINER1_WIN_TEXT}");
|
||||
static const u8 sText_Trainer2WinText[] = _("{B_TRAINER2_WIN_TEXT}");
|
||||
static const u8 sText_Trainer1Fled[] = _( "{PLAY_SE SE_NIGERU}{B_TRAINER1_CLASS} {B_TRAINER1_NAME} fled!");
|
||||
static const u8 sText_Trainer1Fled[] = _( "{PLAY_SE SE_FLEE}{B_TRAINER1_CLASS} {B_TRAINER1_NAME} fled!");
|
||||
static const u8 sText_PlayerLostAgainstTrainer1[] = _("Player lost against\n{B_TRAINER1_CLASS} {B_TRAINER1_NAME}!");
|
||||
static const u8 sText_PlayerBattledToDrawTrainer1[] = _("Player battled to a draw against\n{B_TRAINER1_CLASS} {B_TRAINER1_NAME}!");
|
||||
const u8 gText_RecordBattleToPass[] = _("Would you like to record your battle\non your FRONTIER PASS?");
|
||||
@@ -2715,7 +2756,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
||||
{
|
||||
dst[dstID] = EXT_CTRL_CODE_BEGIN;
|
||||
dstID++;
|
||||
dst[dstID] = 9;
|
||||
dst[dstID] = EXT_CTRL_CODE_PAUSE_UNTIL_PRESS;
|
||||
dstID++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -402,7 +402,7 @@ static void sub_81C501C(void)
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
@@ -424,7 +424,7 @@ static bool8 sub_81C5078(void)
|
||||
{
|
||||
case 0:
|
||||
SetVBlankHBlankCallbacksToNull();
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
gMain.state++;
|
||||
break;
|
||||
case 1:
|
||||
@@ -970,7 +970,7 @@ static void HandleMenuActionInput(u8 taskId)
|
||||
if (id > 0 && IsValidMenuAction(id - 2))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
sub_8199134(0, -1);
|
||||
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP);
|
||||
}
|
||||
}
|
||||
else if (gMain.newKeys & DPAD_DOWN)
|
||||
@@ -978,7 +978,7 @@ static void HandleMenuActionInput(u8 taskId)
|
||||
if (id < gPyramidBagResources->menuActionsCount - 2 && IsValidMenuAction(id + 2))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
sub_8199134(0, 1);
|
||||
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN);
|
||||
}
|
||||
}
|
||||
else if (gMain.newKeys & DPAD_LEFT || GetLRKeysPressed() == MENU_L_PRESSED)
|
||||
@@ -986,7 +986,7 @@ static void HandleMenuActionInput(u8 taskId)
|
||||
if (id & 1 && IsValidMenuAction(id - 1))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
sub_8199134(-1, 0);
|
||||
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE);
|
||||
}
|
||||
}
|
||||
else if (gMain.newKeys & DPAD_RIGHT || GetLRKeysPressed() == MENU_R_PRESSED)
|
||||
@@ -994,7 +994,7 @@ static void HandleMenuActionInput(u8 taskId)
|
||||
if (!(id & 1) && IsValidMenuAction(id + 1))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
sub_8199134(1, 0);
|
||||
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE);
|
||||
}
|
||||
}
|
||||
else if (gMain.newKeys & A_BUTTON)
|
||||
|
||||
@@ -494,7 +494,7 @@ static void CB2_ShowTrainerHillRecords(void)
|
||||
break;
|
||||
case 3:
|
||||
LoadTrainerHillRecordsWindowGfx(3);
|
||||
LoadPalette(stdpal_get(0), 0xF0, 0x20);
|
||||
LoadPalette(GetTextWindowPalette(0), 0xF0, 0x20);
|
||||
gMain.state++;
|
||||
break;
|
||||
case 4:
|
||||
|
||||
+46
-344
@@ -1128,13 +1128,13 @@ static void Cmd_accuracycheck(void)
|
||||
else
|
||||
{
|
||||
u8 acc = gBattleMons[gBattlerAttacker].statStages[STAT_ACC];
|
||||
buff = acc + 6 - gBattleMons[gBattlerTarget].statStages[STAT_EVASION];
|
||||
buff = acc + DEFAULT_STAT_STAGE - gBattleMons[gBattlerTarget].statStages[STAT_EVASION];
|
||||
}
|
||||
|
||||
if (buff < 0)
|
||||
buff = 0;
|
||||
if (buff > 0xC)
|
||||
buff = 0xC;
|
||||
if (buff < MIN_STAT_STAGE)
|
||||
buff = MIN_STAT_STAGE;
|
||||
if (buff > MAX_STAT_STAGE)
|
||||
buff = MAX_STAT_STAGE;
|
||||
|
||||
moveAcc = gBattleMoves[move].accuracy;
|
||||
// check Thunder on sunny weather
|
||||
@@ -1977,11 +1977,11 @@ static void Cmd_effectivenesssound(void)
|
||||
switch (gMoveResultFlags & (u8)(~(MOVE_RESULT_MISSED)))
|
||||
{
|
||||
case MOVE_RESULT_SUPER_EFFECTIVE:
|
||||
BtlController_EmitPlaySE(0, SE_KOUKA_H);
|
||||
BtlController_EmitPlaySE(0, SE_SUPER_EFFECTIVE);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
break;
|
||||
case MOVE_RESULT_NOT_VERY_EFFECTIVE:
|
||||
BtlController_EmitPlaySE(0, SE_KOUKA_L);
|
||||
BtlController_EmitPlaySE(0, SE_NOT_EFFECTIVE);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
break;
|
||||
case MOVE_RESULT_DOESNT_AFFECT_FOE:
|
||||
@@ -1994,17 +1994,17 @@ static void Cmd_effectivenesssound(void)
|
||||
default:
|
||||
if (gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE)
|
||||
{
|
||||
BtlController_EmitPlaySE(0, SE_KOUKA_H);
|
||||
BtlController_EmitPlaySE(0, SE_SUPER_EFFECTIVE);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
else if (gMoveResultFlags & MOVE_RESULT_NOT_VERY_EFFECTIVE)
|
||||
{
|
||||
BtlController_EmitPlaySE(0, SE_KOUKA_L);
|
||||
BtlController_EmitPlaySE(0, SE_NOT_EFFECTIVE);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
else if (!(gMoveResultFlags & (MOVE_RESULT_DOESNT_AFFECT_FOE | MOVE_RESULT_FAILED)))
|
||||
{
|
||||
BtlController_EmitPlaySE(0, SE_KOUKA_M);
|
||||
BtlController_EmitPlaySE(0, SE_EFFECTIVE);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
break;
|
||||
@@ -3320,7 +3320,7 @@ static void Cmd_getexp(void)
|
||||
if (!(gBattleTypeFlags & BATTLE_TYPE_TRAINER) && gBattleMons[0].hp && !gBattleStruct->wildVictorySong)
|
||||
{
|
||||
BattleStopLowHpSound();
|
||||
PlayBGM(MUS_KACHI2);
|
||||
PlayBGM(MUS_VICTORY_WILD);
|
||||
gBattleStruct->wildVictorySong++;
|
||||
}
|
||||
|
||||
@@ -3489,7 +3489,6 @@ static void Cmd_getexp(void)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NONMATCHING
|
||||
static void Cmd_unknown_24(void)
|
||||
{
|
||||
u16 HP_count = 0;
|
||||
@@ -3500,7 +3499,7 @@ static void Cmd_unknown_24(void)
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && gPartnerTrainerId == TRAINER_STEVEN_PARTNER)
|
||||
{
|
||||
for (i = 0; i < 3; i++)
|
||||
for (i = 0; i < MULTI_PARTY_SIZE; i++)
|
||||
{
|
||||
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) && !GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG))
|
||||
HP_count += GetMonData(&gPlayerParty[i], MON_DATA_HP);
|
||||
@@ -3521,7 +3520,9 @@ static void Cmd_unknown_24(void)
|
||||
if (HP_count == 0)
|
||||
gBattleOutcome |= B_OUTCOME_LOST;
|
||||
|
||||
for (HP_count = 0, i = 0; i < PARTY_SIZE; i++)
|
||||
HP_count = 0;
|
||||
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
if (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES) && !GetMonData(&gEnemyParty[i], MON_DATA_IS_EGG)
|
||||
&& (!(gBattleTypeFlags & BATTLE_TYPE_ARENA) || !(gBattleStruct->arenaLostOpponentMons & gBitTable[i])))
|
||||
@@ -3535,33 +3536,31 @@ static void Cmd_unknown_24(void)
|
||||
|
||||
if (gBattleOutcome == 0 && (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)))
|
||||
{
|
||||
s32 foundPlayer;
|
||||
s32 foundOpponent;
|
||||
|
||||
// Impossible to decompile loops.
|
||||
for (foundPlayer = 0, i = 0; i < gBattlersCount; i += 2)
|
||||
s32 foundPlayer = 0, foundOpponent;
|
||||
for (i = 0; i < gBattlersCount; i += 2)
|
||||
{
|
||||
if (HITMARKER_FAINTED2(i) & gHitMarker && !gSpecialStatuses[i].flag40)
|
||||
if ((gHitMarker & HITMARKER_FAINTED2(i)) && (!gSpecialStatuses[i].flag40))
|
||||
foundPlayer++;
|
||||
}
|
||||
|
||||
for (foundOpponent = 0, i = 1; i < gBattlersCount; i += 2)
|
||||
foundOpponent = 0;
|
||||
for (i = 1; i < gBattlersCount; i += 2)
|
||||
{
|
||||
if (HITMARKER_FAINTED2(i) & gHitMarker && !gSpecialStatuses[i].flag40)
|
||||
if ((gHitMarker & HITMARKER_FAINTED2(i)) && (!gSpecialStatuses[i].flag40))
|
||||
foundOpponent++;
|
||||
}
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
{
|
||||
if (foundOpponent + foundPlayer > 1)
|
||||
gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = (u8*) T2_READ_32(gBattlescriptCurrInstr + 1);
|
||||
else
|
||||
gBattlescriptCurrInstr += 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (foundOpponent != 0 && foundPlayer != 0)
|
||||
gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = (u8*) T2_READ_32(gBattlescriptCurrInstr + 1);
|
||||
else
|
||||
gBattlescriptCurrInstr += 5;
|
||||
}
|
||||
@@ -3571,301 +3570,6 @@ static void Cmd_unknown_24(void)
|
||||
gBattlescriptCurrInstr += 5;
|
||||
}
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
static void Cmd_unknown_24(void)
|
||||
{
|
||||
asm("\n\
|
||||
.syntax unified\n\
|
||||
push {r4-r7,lr}\n\
|
||||
mov r7, r8\n\
|
||||
push {r7}\n\
|
||||
movs r6, 0\n\
|
||||
ldr r0, =gBattleControllerExecFlags\n\
|
||||
ldr r0, [r0]\n\
|
||||
cmp r0, 0\n\
|
||||
beq _0804ACE2\n\
|
||||
b _0804AF22\n\
|
||||
_0804ACE2:\n\
|
||||
ldr r0, =gBattleTypeFlags\n\
|
||||
ldr r0, [r0]\n\
|
||||
movs r1, 0x80\n\
|
||||
lsls r1, 15\n\
|
||||
ands r0, r1\n\
|
||||
cmp r0, 0\n\
|
||||
beq _0804AD48\n\
|
||||
ldr r0, =gPartnerTrainerId\n\
|
||||
ldrh r1, [r0]\n\
|
||||
ldr r0, =0x00000c03\n\
|
||||
cmp r1, r0\n\
|
||||
bne _0804AD48\n\
|
||||
movs r5, 0\n\
|
||||
_0804ACFC:\n\
|
||||
movs r0, 0x64\n\
|
||||
adds r1, r5, 0\n\
|
||||
muls r1, r0\n\
|
||||
ldr r0, =gPlayerParty\n\
|
||||
adds r4, r1, r0\n\
|
||||
adds r0, r4, 0\n\
|
||||
movs r1, 0xB\n\
|
||||
bl GetMonData\n\
|
||||
cmp r0, 0\n\
|
||||
beq _0804AD2C\n\
|
||||
adds r0, r4, 0\n\
|
||||
movs r1, 0x2D\n\
|
||||
bl GetMonData\n\
|
||||
cmp r0, 0\n\
|
||||
bne _0804AD2C\n\
|
||||
adds r0, r4, 0\n\
|
||||
movs r1, 0x39\n\
|
||||
bl GetMonData\n\
|
||||
adds r0, r6, r0\n\
|
||||
lsls r0, 16\n\
|
||||
lsrs r6, r0, 16\n\
|
||||
_0804AD2C:\n\
|
||||
adds r5, 0x1\n\
|
||||
cmp r5, 0x2\n\
|
||||
ble _0804ACFC\n\
|
||||
b _0804ADA8\n\
|
||||
.pool\n\
|
||||
_0804AD48:\n\
|
||||
movs r5, 0\n\
|
||||
_0804AD4A:\n\
|
||||
movs r0, 0x64\n\
|
||||
adds r1, r5, 0\n\
|
||||
muls r1, r0\n\
|
||||
ldr r0, =gPlayerParty\n\
|
||||
adds r4, r1, r0\n\
|
||||
adds r0, r4, 0\n\
|
||||
movs r1, 0xB\n\
|
||||
bl GetMonData\n\
|
||||
cmp r0, 0\n\
|
||||
beq _0804ADA2\n\
|
||||
adds r0, r4, 0\n\
|
||||
movs r1, 0x2D\n\
|
||||
bl GetMonData\n\
|
||||
cmp r0, 0\n\
|
||||
bne _0804ADA2\n\
|
||||
ldr r0, =gBattleTypeFlags\n\
|
||||
ldr r0, [r0]\n\
|
||||
movs r1, 0x80\n\
|
||||
lsls r1, 11\n\
|
||||
ands r0, r1\n\
|
||||
cmp r0, 0\n\
|
||||
beq _0804AD94\n\
|
||||
ldr r0, =gBattleStruct\n\
|
||||
ldr r0, [r0]\n\
|
||||
movs r1, 0xA8\n\
|
||||
lsls r1, 2\n\
|
||||
adds r0, r1\n\
|
||||
ldrb r1, [r0]\n\
|
||||
ldr r2, =gBitTable\n\
|
||||
lsls r0, r5, 2\n\
|
||||
adds r0, r2\n\
|
||||
ldr r0, [r0]\n\
|
||||
ands r1, r0\n\
|
||||
cmp r1, 0\n\
|
||||
bne _0804ADA2\n\
|
||||
_0804AD94:\n\
|
||||
adds r0, r4, 0\n\
|
||||
movs r1, 0x39\n\
|
||||
bl GetMonData\n\
|
||||
adds r0, r6, r0\n\
|
||||
lsls r0, 16\n\
|
||||
lsrs r6, r0, 16\n\
|
||||
_0804ADA2:\n\
|
||||
adds r5, 0x1\n\
|
||||
cmp r5, 0x5\n\
|
||||
ble _0804AD4A\n\
|
||||
_0804ADA8:\n\
|
||||
cmp r6, 0\n\
|
||||
bne _0804ADB6\n\
|
||||
ldr r0, =gBattleOutcome\n\
|
||||
ldrb r1, [r0]\n\
|
||||
movs r2, 0x2\n\
|
||||
orrs r1, r2\n\
|
||||
strb r1, [r0]\n\
|
||||
_0804ADB6:\n\
|
||||
movs r6, 0\n\
|
||||
movs r5, 0\n\
|
||||
_0804ADBA:\n\
|
||||
movs r0, 0x64\n\
|
||||
adds r1, r5, 0\n\
|
||||
muls r1, r0\n\
|
||||
ldr r0, =gEnemyParty\n\
|
||||
adds r4, r1, r0\n\
|
||||
adds r0, r4, 0\n\
|
||||
movs r1, 0xB\n\
|
||||
bl GetMonData\n\
|
||||
cmp r0, 0\n\
|
||||
beq _0804AE10\n\
|
||||
adds r0, r4, 0\n\
|
||||
movs r1, 0x2D\n\
|
||||
bl GetMonData\n\
|
||||
cmp r0, 0\n\
|
||||
bne _0804AE10\n\
|
||||
ldr r0, =gBattleTypeFlags\n\
|
||||
ldr r0, [r0]\n\
|
||||
movs r1, 0x80\n\
|
||||
lsls r1, 11\n\
|
||||
ands r0, r1\n\
|
||||
cmp r0, 0\n\
|
||||
beq _0804AE02\n\
|
||||
ldr r0, =gBattleStruct\n\
|
||||
ldr r0, [r0]\n\
|
||||
ldr r1, =0x000002a1\n\
|
||||
adds r0, r1\n\
|
||||
ldrb r1, [r0]\n\
|
||||
ldr r2, =gBitTable\n\
|
||||
lsls r0, r5, 2\n\
|
||||
adds r0, r2\n\
|
||||
ldr r0, [r0]\n\
|
||||
ands r1, r0\n\
|
||||
cmp r1, 0\n\
|
||||
bne _0804AE10\n\
|
||||
_0804AE02:\n\
|
||||
adds r0, r4, 0\n\
|
||||
movs r1, 0x39\n\
|
||||
bl GetMonData\n\
|
||||
adds r0, r6, r0\n\
|
||||
lsls r0, 16\n\
|
||||
lsrs r6, r0, 16\n\
|
||||
_0804AE10:\n\
|
||||
adds r5, 0x1\n\
|
||||
cmp r5, 0x5\n\
|
||||
ble _0804ADBA\n\
|
||||
ldr r2, =gBattleOutcome\n\
|
||||
cmp r6, 0\n\
|
||||
bne _0804AE24\n\
|
||||
ldrb r0, [r2]\n\
|
||||
movs r1, 0x1\n\
|
||||
orrs r0, r1\n\
|
||||
strb r0, [r2]\n\
|
||||
_0804AE24:\n\
|
||||
ldrb r0, [r2]\n\
|
||||
cmp r0, 0\n\
|
||||
bne _0804AF1A\n\
|
||||
ldr r0, =gBattleTypeFlags\n\
|
||||
ldr r1, [r0]\n\
|
||||
ldr r2, =0x02000002\n\
|
||||
ands r1, r2\n\
|
||||
mov r8, r0\n\
|
||||
cmp r1, 0\n\
|
||||
beq _0804AF1A\n\
|
||||
movs r3, 0\n\
|
||||
movs r5, 0\n\
|
||||
ldr r0, =gBattlersCount\n\
|
||||
ldrb r1, [r0]\n\
|
||||
mov r12, r0\n\
|
||||
ldr r7, =gBattlescriptCurrInstr\n\
|
||||
cmp r3, r1\n\
|
||||
bge _0804AE70\n\
|
||||
ldr r0, =gHitMarker\n\
|
||||
movs r6, 0x80\n\
|
||||
lsls r6, 21\n\
|
||||
ldr r4, [r0]\n\
|
||||
adds r2, r1, 0\n\
|
||||
ldr r1, =gSpecialStatuses\n\
|
||||
_0804AE54:\n\
|
||||
adds r0, r6, 0\n\
|
||||
lsls r0, r5\n\
|
||||
ands r0, r4\n\
|
||||
cmp r0, 0\n\
|
||||
beq _0804AE68\n\
|
||||
ldrb r0, [r1]\n\
|
||||
lsls r0, 25\n\
|
||||
cmp r0, 0\n\
|
||||
blt _0804AE68\n\
|
||||
adds r3, 0x1\n\
|
||||
_0804AE68:\n\
|
||||
adds r1, 0x28\n\
|
||||
adds r5, 0x2\n\
|
||||
cmp r5, r2\n\
|
||||
blt _0804AE54\n\
|
||||
_0804AE70:\n\
|
||||
movs r2, 0\n\
|
||||
movs r5, 0x1\n\
|
||||
mov r4, r12\n\
|
||||
ldrb r1, [r4]\n\
|
||||
cmp r5, r1\n\
|
||||
bge _0804AEAA\n\
|
||||
ldr r0, =gHitMarker\n\
|
||||
movs r4, 0x80\n\
|
||||
lsls r4, 21\n\
|
||||
mov r12, r4\n\
|
||||
ldr r6, [r0]\n\
|
||||
ldr r0, =gSpecialStatuses\n\
|
||||
adds r4, r1, 0\n\
|
||||
adds r1, r0, 0\n\
|
||||
adds r1, 0x14\n\
|
||||
_0804AE8E:\n\
|
||||
mov r0, r12\n\
|
||||
lsls r0, r5\n\
|
||||
ands r0, r6\n\
|
||||
cmp r0, 0\n\
|
||||
beq _0804AEA2\n\
|
||||
ldrb r0, [r1]\n\
|
||||
lsls r0, 25\n\
|
||||
cmp r0, 0\n\
|
||||
blt _0804AEA2\n\
|
||||
adds r2, 0x1\n\
|
||||
_0804AEA2:\n\
|
||||
adds r1, 0x28\n\
|
||||
adds r5, 0x2\n\
|
||||
cmp r5, r4\n\
|
||||
blt _0804AE8E\n\
|
||||
_0804AEAA:\n\
|
||||
mov r1, r8\n\
|
||||
ldr r0, [r1]\n\
|
||||
movs r1, 0x40\n\
|
||||
ands r0, r1\n\
|
||||
cmp r0, 0\n\
|
||||
beq _0804AEF0\n\
|
||||
adds r0, r2, r3\n\
|
||||
cmp r0, 0x1\n\
|
||||
bgt _0804AEF8\n\
|
||||
b _0804AF12\n\
|
||||
.pool\n\
|
||||
_0804AEF0:\n\
|
||||
cmp r2, 0\n\
|
||||
beq _0804AF12\n\
|
||||
cmp r3, 0\n\
|
||||
beq _0804AF12\n\
|
||||
_0804AEF8:\n\
|
||||
ldr r2, [r7]\n\
|
||||
ldrb r1, [r2, 0x1]\n\
|
||||
ldrb r0, [r2, 0x2]\n\
|
||||
lsls r0, 8\n\
|
||||
adds r1, r0\n\
|
||||
ldrb r0, [r2, 0x3]\n\
|
||||
lsls r0, 16\n\
|
||||
adds r1, r0\n\
|
||||
ldrb r0, [r2, 0x4]\n\
|
||||
lsls r0, 24\n\
|
||||
adds r1, r0\n\
|
||||
str r1, [r7]\n\
|
||||
b _0804AF22\n\
|
||||
_0804AF12:\n\
|
||||
ldr r0, [r7]\n\
|
||||
adds r0, 0x5\n\
|
||||
str r0, [r7]\n\
|
||||
b _0804AF22\n\
|
||||
_0804AF1A:\n\
|
||||
ldr r1, =gBattlescriptCurrInstr\n\
|
||||
ldr r0, [r1]\n\
|
||||
adds r0, 0x5\n\
|
||||
str r0, [r1]\n\
|
||||
_0804AF22:\n\
|
||||
pop {r3}\n\
|
||||
mov r8, r3\n\
|
||||
pop {r4-r7}\n\
|
||||
pop {r0}\n\
|
||||
bx r0\n\
|
||||
.pool\n\
|
||||
.syntax divided");
|
||||
}
|
||||
|
||||
#endif // NONMATCHING
|
||||
|
||||
static void MoveValuesCleanUp(void)
|
||||
{
|
||||
@@ -4385,7 +4089,7 @@ static void Cmd_playstatchangeanimation(void)
|
||||
{
|
||||
if (gBattlescriptCurrInstr[3] & STAT_CHANGE_CANT_PREVENT)
|
||||
{
|
||||
if (gBattleMons[gActiveBattler].statStages[currStat] > 0)
|
||||
if (gBattleMons[gActiveBattler].statStages[currStat] > MIN_STAT_STAGE)
|
||||
{
|
||||
statAnimId = startingStatAnimId + currStat;
|
||||
changeableStatsCount++;
|
||||
@@ -4397,7 +4101,7 @@ static void Cmd_playstatchangeanimation(void)
|
||||
&& !(gBattleMons[gActiveBattler].ability == ABILITY_KEEN_EYE && currStat == STAT_ACC)
|
||||
&& !(gBattleMons[gActiveBattler].ability == ABILITY_HYPER_CUTTER && currStat == STAT_ATK))
|
||||
{
|
||||
if (gBattleMons[gActiveBattler].statStages[currStat] > 0)
|
||||
if (gBattleMons[gActiveBattler].statStages[currStat] > MIN_STAT_STAGE)
|
||||
{
|
||||
statAnimId = startingStatAnimId + currStat;
|
||||
changeableStatsCount++;
|
||||
@@ -4425,7 +4129,7 @@ static void Cmd_playstatchangeanimation(void)
|
||||
|
||||
while (statsToCheck != 0)
|
||||
{
|
||||
if (statsToCheck & 1 && gBattleMons[gActiveBattler].statStages[currStat] < 0xC)
|
||||
if (statsToCheck & 1 && gBattleMons[gActiveBattler].statStages[currStat] < MAX_STAT_STAGE)
|
||||
{
|
||||
statAnimId = startingStatAnimId + currStat;
|
||||
changeableStatsCount++;
|
||||
@@ -4495,7 +4199,7 @@ static void Cmd_moveend(void)
|
||||
&& gBattleMons[gBattlerTarget].hp != 0 && gBattlerAttacker != gBattlerTarget
|
||||
&& GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget)
|
||||
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && TARGET_TURN_DAMAGED
|
||||
&& gBattleMoves[gCurrentMove].power && gBattleMons[gBattlerTarget].statStages[STAT_ATK] <= 0xB)
|
||||
&& gBattleMoves[gCurrentMove].power && gBattleMons[gBattlerTarget].statStages[STAT_ATK] < MAX_STAT_STAGE)
|
||||
{
|
||||
gBattleMons[gBattlerTarget].statStages[STAT_ATK]++;
|
||||
BattleScriptPushCursor();
|
||||
@@ -5471,7 +5175,7 @@ static void Cmd_switchineffects(void)
|
||||
s32 i;
|
||||
|
||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
sub_803FA70(gActiveBattler);
|
||||
UpdateSentPokesToOpponentValue(gActiveBattler);
|
||||
|
||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
||||
gSpecialStatuses[gActiveBattler].flag40 = 0;
|
||||
@@ -5831,8 +5535,8 @@ static void Cmd_hitanimation(void)
|
||||
static u32 GetTrainerMoneyToGive(u16 trainerId)
|
||||
{
|
||||
u32 i = 0;
|
||||
u32 lastMonLevel = 0;
|
||||
u32 moneyReward = 0;
|
||||
u32 moneyReward;
|
||||
u8 lastMonLevel = 0;
|
||||
|
||||
if (trainerId == TRAINER_SECRET_BASE)
|
||||
{
|
||||
@@ -6340,15 +6044,13 @@ static void PutLevelAndGenderOnLvlUpBox(void)
|
||||
AddTextPrinter(&printerTemplate, 0xFF, NULL);
|
||||
|
||||
txtPtr = gStringVar4;
|
||||
gStringVar4[0] = CHAR_SPECIAL_F9;
|
||||
txtPtr++;
|
||||
txtPtr[0] = CHAR_LV_2;
|
||||
txtPtr++;
|
||||
*(txtPtr)++ = CHAR_EXTRA_SYMBOL;
|
||||
*(txtPtr)++ = CHAR_LV_2;
|
||||
|
||||
var = (u32)(txtPtr);
|
||||
txtPtr = ConvertIntToDecimalStringN(txtPtr, monLevel, STR_CONV_MODE_LEFT_ALIGN, 3);
|
||||
var = (u32)(txtPtr) - var;
|
||||
txtPtr = StringFill(txtPtr, 0x77, 4 - var);
|
||||
txtPtr = StringFill(txtPtr, CHAR_UNK_SPACER, 4 - var);
|
||||
|
||||
if (monGender != MON_GENDERLESS)
|
||||
{
|
||||
@@ -6726,7 +6428,7 @@ static void Cmd_various(void)
|
||||
gBattleOutcome = B_OUTCOME_MON_TELEPORTED;
|
||||
break;
|
||||
case VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC:
|
||||
BtlController_EmitPlayFanfareOrBGM(0, MUS_KACHI1, TRUE);
|
||||
BtlController_EmitPlayFanfareOrBGM(0, MUS_VICTORY_TRAINER, TRUE);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
break;
|
||||
}
|
||||
@@ -7288,7 +6990,7 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr)
|
||||
index++;
|
||||
gBattleTextBuff2[index] = B_BUFF_EOS;
|
||||
|
||||
if (gBattleMons[gActiveBattler].statStages[statId] == 0)
|
||||
if (gBattleMons[gActiveBattler].statStages[statId] == MIN_STAT_STAGE)
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 2;
|
||||
else
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler);
|
||||
@@ -7315,17 +7017,17 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr)
|
||||
index++;
|
||||
gBattleTextBuff2[index] = B_BUFF_EOS;
|
||||
|
||||
if (gBattleMons[gActiveBattler].statStages[statId] == 0xC)
|
||||
if (gBattleMons[gActiveBattler].statStages[statId] == MAX_STAT_STAGE)
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 2;
|
||||
else
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler);
|
||||
}
|
||||
|
||||
gBattleMons[gActiveBattler].statStages[statId] += statValue;
|
||||
if (gBattleMons[gActiveBattler].statStages[statId] < 0)
|
||||
gBattleMons[gActiveBattler].statStages[statId] = 0;
|
||||
if (gBattleMons[gActiveBattler].statStages[statId] > 0xC)
|
||||
gBattleMons[gActiveBattler].statStages[statId] = 0xC;
|
||||
if (gBattleMons[gActiveBattler].statStages[statId] < MIN_STAT_STAGE)
|
||||
gBattleMons[gActiveBattler].statStages[statId] = MIN_STAT_STAGE;
|
||||
if (gBattleMons[gActiveBattler].statStages[statId] > MAX_STAT_STAGE)
|
||||
gBattleMons[gActiveBattler].statStages[statId] = MAX_STAT_STAGE;
|
||||
|
||||
if (gBattleCommunication[MULTISTRING_CHOOSER] == 2 && flags & STAT_BUFF_ALLOW_PTR)
|
||||
gMoveResultFlags |= MOVE_RESULT_MISSED;
|
||||
@@ -7350,7 +7052,7 @@ static void Cmd_normalisebuffs(void) // haze
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
for (j = 0; j < NUM_BATTLE_STATS; j++)
|
||||
gBattleMons[i].statStages[j] = 6;
|
||||
gBattleMons[i].statStages[j] = DEFAULT_STAT_STAGE;
|
||||
}
|
||||
|
||||
gBattlescriptCurrInstr++;
|
||||
@@ -8750,7 +8452,7 @@ static void Cmd_rolloutdamagecalculation(void)
|
||||
static void Cmd_jumpifconfusedandstatmaxed(void)
|
||||
{
|
||||
if (gBattleMons[gBattlerTarget].status2 & STATUS2_CONFUSION
|
||||
&& gBattleMons[gBattlerTarget].statStages[gBattlescriptCurrInstr[1]] == 0xC)
|
||||
&& gBattleMons[gBattlerTarget].statStages[gBattlescriptCurrInstr[1]] == MAX_STAT_STAGE)
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2);
|
||||
else
|
||||
gBattlescriptCurrInstr += 6;
|
||||
@@ -8957,10 +8659,10 @@ static void Cmd_maxattackhalvehp(void) // belly drum
|
||||
if (!(gBattleMons[gBattlerAttacker].maxHP / 2))
|
||||
halfHp = 1;
|
||||
|
||||
if (gBattleMons[gBattlerAttacker].statStages[STAT_ATK] < 12
|
||||
if (gBattleMons[gBattlerAttacker].statStages[STAT_ATK] < MAX_STAT_STAGE
|
||||
&& gBattleMons[gBattlerAttacker].hp > halfHp)
|
||||
{
|
||||
gBattleMons[gBattlerAttacker].statStages[STAT_ATK] = 12;
|
||||
gBattleMons[gBattlerAttacker].statStages[STAT_ATK] = MAX_STAT_STAGE;
|
||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2;
|
||||
if (gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage = 1;
|
||||
@@ -9234,8 +8936,8 @@ static void Cmd_sethail(void)
|
||||
|
||||
static void Cmd_jumpifattackandspecialattackcannotfall(void) // memento
|
||||
{
|
||||
if (gBattleMons[gBattlerTarget].statStages[STAT_ATK] == 0
|
||||
&& gBattleMons[gBattlerTarget].statStages[STAT_SPATK] == 0
|
||||
if (gBattleMons[gBattlerTarget].statStages[STAT_ATK] == MIN_STAT_STAGE
|
||||
&& gBattleMons[gBattlerTarget].statStages[STAT_SPATK] == MIN_STAT_STAGE
|
||||
&& gBattleCommunication[6] != 1)
|
||||
{
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
|
||||
+23
-23
@@ -12,7 +12,7 @@
|
||||
#include "fieldmap.h"
|
||||
#include "random.h"
|
||||
#include "starter_choose.h"
|
||||
#include "script_pokemon_80F8.h"
|
||||
#include "script_pokemon_util.h"
|
||||
#include "palette.h"
|
||||
#include "window.h"
|
||||
#include "event_object_movement.h"
|
||||
@@ -518,22 +518,22 @@ void BattleSetup_StartLegendaryBattle(void)
|
||||
default:
|
||||
case SPECIES_GROUDON:
|
||||
gBattleTypeFlags |= BATTLE_TYPE_GROUDON;
|
||||
CreateBattleStartTask(B_TRANSITION_GROUDON, MUS_BATTLE34);
|
||||
CreateBattleStartTask(B_TRANSITION_GROUDON, MUS_VS_KYOGRE_GROUDON);
|
||||
break;
|
||||
case SPECIES_KYOGRE:
|
||||
gBattleTypeFlags |= BATTLE_TYPE_KYOGRE;
|
||||
CreateBattleStartTask(B_TRANSITION_KYOGRE, MUS_BATTLE34);
|
||||
CreateBattleStartTask(B_TRANSITION_KYOGRE, MUS_VS_KYOGRE_GROUDON);
|
||||
break;
|
||||
case SPECIES_RAYQUAZA:
|
||||
gBattleTypeFlags |= BATTLE_TYPE_RAYQUAZA;
|
||||
CreateBattleStartTask(B_TRANSITION_RAYQUAZA, MUS_VS_REKKU);
|
||||
CreateBattleStartTask(B_TRANSITION_RAYQUAZA, MUS_VS_RAYQUAZA);
|
||||
break;
|
||||
case SPECIES_DEOXYS:
|
||||
CreateBattleStartTask(B_TRANSITION_BLUR, MUS_RG_VS_DEO);
|
||||
CreateBattleStartTask(B_TRANSITION_BLUR, MUS_RG_VS_DEOXYS);
|
||||
break;
|
||||
case SPECIES_LUGIA:
|
||||
case SPECIES_HO_OH:
|
||||
CreateBattleStartTask(B_TRANSITION_BLUR, MUS_RG_VS_DEN);
|
||||
CreateBattleStartTask(B_TRANSITION_BLUR, MUS_RG_VS_LEGEND);
|
||||
break;
|
||||
case SPECIES_MEW:
|
||||
CreateBattleStartTask(B_TRANSITION_GRID_SQUARES, MUS_VS_MEW);
|
||||
@@ -553,9 +553,9 @@ void StartGroudonKyogreBattle(void)
|
||||
gBattleTypeFlags = BATTLE_TYPE_LEGENDARY | BATTLE_TYPE_KYOGRE_GROUDON;
|
||||
|
||||
if (gGameVersion == VERSION_RUBY)
|
||||
CreateBattleStartTask(B_TRANSITION_SHARDS, MUS_BATTLE34); // GROUDON
|
||||
CreateBattleStartTask(B_TRANSITION_SHARDS, MUS_VS_KYOGRE_GROUDON); // GROUDON
|
||||
else
|
||||
CreateBattleStartTask(B_TRANSITION_RIPPLE, MUS_BATTLE34); // KYOGRE
|
||||
CreateBattleStartTask(B_TRANSITION_RIPPLE, MUS_VS_KYOGRE_GROUDON); // KYOGRE
|
||||
|
||||
IncrementGameStat(GAME_STAT_TOTAL_BATTLES);
|
||||
IncrementGameStat(GAME_STAT_WILD_BATTLES);
|
||||
@@ -588,7 +588,7 @@ void StartRegiBattle(void)
|
||||
transitionId = B_TRANSITION_GRID_SQUARES;
|
||||
break;
|
||||
}
|
||||
CreateBattleStartTask(transitionId, MUS_BATTLE36);
|
||||
CreateBattleStartTask(transitionId, MUS_VS_REGI);
|
||||
|
||||
IncrementGameStat(GAME_STAT_TOTAL_BATTLES);
|
||||
IncrementGameStat(GAME_STAT_WILD_BATTLES);
|
||||
@@ -1454,46 +1454,46 @@ void SetUpTrainerEncounterMusic(void)
|
||||
switch (GetTrainerEncounterMusicId(trainerId))
|
||||
{
|
||||
case TRAINER_ENCOUNTER_MUSIC_MALE:
|
||||
music = MUS_BOYEYE;
|
||||
music = MUS_ENCOUNTER_MALE;
|
||||
break;
|
||||
case TRAINER_ENCOUNTER_MUSIC_FEMALE:
|
||||
music = MUS_GIRLEYE;
|
||||
music = MUS_ENCOUNTER_FEMALE;
|
||||
break;
|
||||
case TRAINER_ENCOUNTER_MUSIC_GIRL:
|
||||
music = MUS_SYOUJOEYE;
|
||||
music = MUS_ENCOUNTER_GIRL;
|
||||
break;
|
||||
case TRAINER_ENCOUNTER_MUSIC_INTENSE:
|
||||
music = MUS_HAGESHII;
|
||||
music = MUS_ENCOUNTER_INTENSE;
|
||||
break;
|
||||
case TRAINER_ENCOUNTER_MUSIC_COOL:
|
||||
music = MUS_KAKKOII;
|
||||
music = MUS_ENCOUNTER_COOL;
|
||||
break;
|
||||
case TRAINER_ENCOUNTER_MUSIC_AQUA:
|
||||
music = MUS_AQA_0;
|
||||
music = MUS_ENCOUNTER_AQUA;
|
||||
break;
|
||||
case TRAINER_ENCOUNTER_MUSIC_MAGMA:
|
||||
music = MUS_MGM0;
|
||||
music = MUS_ENCOUNTER_MAGMA;
|
||||
break;
|
||||
case TRAINER_ENCOUNTER_MUSIC_SWIMMER:
|
||||
music = MUS_SWIMEYE;
|
||||
music = MUS_ENCOUNTER_SWIMMER;
|
||||
break;
|
||||
case TRAINER_ENCOUNTER_MUSIC_TWINS:
|
||||
music = MUS_HUTAGO;
|
||||
music = MUS_ENCOUNTER_TWINS;
|
||||
break;
|
||||
case TRAINER_ENCOUNTER_MUSIC_ELITE_FOUR:
|
||||
music = MUS_SITENNOU;
|
||||
music = MUS_ENCOUNTER_ELITE_FOUR;
|
||||
break;
|
||||
case TRAINER_ENCOUNTER_MUSIC_HIKER:
|
||||
music = MUS_YAMA_EYE;
|
||||
music = MUS_ENCOUNTER_HIKER;
|
||||
break;
|
||||
case TRAINER_ENCOUNTER_MUSIC_INTERVIEWER:
|
||||
music = MUS_INTER_V;
|
||||
music = MUS_ENCOUNTER_INTERVIEWER;
|
||||
break;
|
||||
case TRAINER_ENCOUNTER_MUSIC_RICH:
|
||||
music = MUS_TEST;
|
||||
music = MUS_ENCOUNTER_RICH;
|
||||
break;
|
||||
default:
|
||||
music = MUS_AYASII;
|
||||
music = MUS_ENCOUNTER_SUSPICIOUS;
|
||||
}
|
||||
PlayNewMapMusic(music);
|
||||
}
|
||||
|
||||
+5
-1
@@ -355,7 +355,11 @@ static void GenerateOpponentMons(void)
|
||||
{
|
||||
u16 trainerId;
|
||||
s32 i, j, k;
|
||||
register const u16 *monSet asm("r9"); // Fix me. Compiler insists on moving that variable into stack.
|
||||
#ifndef NONMATCHING
|
||||
register const u16 *monSet asm("r9"); // Fix me. Compiler insists on moving that variable into stack.
|
||||
#else
|
||||
const u16 *monSet;
|
||||
#endif
|
||||
u16 species[FRONTIER_PARTY_SIZE];
|
||||
u16 heldItems[FRONTIER_PARTY_SIZE];
|
||||
s32 monId = 0;
|
||||
|
||||
+8
-4
@@ -1466,7 +1466,9 @@ u8 GetFrontierOpponentClass(u16 trainerId)
|
||||
else
|
||||
{
|
||||
trainerClass = gFacilityClassToTrainerClass[gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].facilityClass];
|
||||
asm("");
|
||||
#ifndef NONMATCHING
|
||||
asm("");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1478,7 +1480,9 @@ u8 GetFrontierOpponentClass(u16 trainerId)
|
||||
else
|
||||
{
|
||||
trainerClass = gFacilityClassToTrainerClass[gApprentices[gSaveBlock2Ptr->apprentices[trainerId - TRAINER_RECORD_MIXING_APPRENTICE].id].facilityClass];
|
||||
asm("");
|
||||
#ifndef NONMATCHING
|
||||
asm("");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2627,7 +2631,7 @@ static void LoadLinkMultiOpponentsData(void)
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
gSpecialVar_Result = 5;
|
||||
break;
|
||||
case 5:
|
||||
@@ -2644,7 +2648,7 @@ static void LoadLinkMultiOpponentsData(void)
|
||||
static void sub_8164DCC(void)
|
||||
{
|
||||
if (gWirelessCommType != 0)
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
}
|
||||
|
||||
static void SetMultiPartnerGfx(void)
|
||||
|
||||
+14
-18
@@ -749,7 +749,7 @@ static const union AffineAnimCmd *const sSpriteAffineAnimTable_Pokeball[] =
|
||||
static const struct SpriteTemplate sSpriteTemplate_Pokeball =
|
||||
{
|
||||
.tileTag = 0xFFFF,
|
||||
.paletteTag = 4105,
|
||||
.paletteTag = FLDEFF_PAL_TAG_POKEBALL,
|
||||
.oam = &gObjectEventBaseOam_32x32,
|
||||
.anims = sSpriteAnimTable_Pokeball,
|
||||
.images = sSpriteImage_Pokeball,
|
||||
@@ -798,7 +798,7 @@ static const union AnimCmd *const sSpriteAnimTable_UnusedBrendanLass[] =
|
||||
static const struct SpriteTemplate sSpriteTemplate_UnusedBrendan =
|
||||
{
|
||||
.tileTag = 0xFFFF,
|
||||
.paletteTag = 4106,
|
||||
.paletteTag = 0x100A,
|
||||
.oam = &sOam_UnusedBrendanLass,
|
||||
.anims = sSpriteAnimTable_UnusedBrendanLass,
|
||||
.images = sImageTable_UnusedBrendan,
|
||||
@@ -809,7 +809,7 @@ static const struct SpriteTemplate sSpriteTemplate_UnusedBrendan =
|
||||
static const struct SpriteTemplate sSpriteTemplate_UnusedLass =
|
||||
{
|
||||
.tileTag = 0xFFFF,
|
||||
.paletteTag = 4106,
|
||||
.paletteTag = 0x100A,
|
||||
.oam = &sOam_UnusedBrendanLass,
|
||||
.anims = sSpriteAnimTable_UnusedBrendanLass,
|
||||
.images = sImageTable_UnusedLass,
|
||||
@@ -817,12 +817,9 @@ static const struct SpriteTemplate sSpriteTemplate_UnusedLass =
|
||||
.callback = SpriteCb_TrainerPic
|
||||
};
|
||||
|
||||
static const u16 gFieldEffectObjectPalette10[] = INCBIN_U16("graphics/field_effects/palettes/10.gbapal");
|
||||
static const u16 sFieldEffectPal_Pokeball[] = INCBIN_U16("graphics/field_effects/palettes/pokeball.gbapal");
|
||||
|
||||
const struct SpritePalette gFieldEffectObjectPaletteInfo10 =
|
||||
{
|
||||
gFieldEffectObjectPalette10, 0x1009
|
||||
};
|
||||
const struct SpritePalette gSpritePalette_Pokeball = {sFieldEffectPal_Pokeball, FLDEFF_PAL_TAG_POKEBALL};
|
||||
|
||||
static const u16 sMugshotPal_Sidney[] = INCBIN_U16("graphics/battle_transitions/sidney_bg.gbapal");
|
||||
static const u16 sMugshotPal_Phoebe[] = INCBIN_U16("graphics/battle_transitions/phoebe_bg.gbapal");
|
||||
@@ -848,10 +845,7 @@ static const u16 *const sPlayerMugshotsPals[GENDER_COUNT] =
|
||||
};
|
||||
|
||||
static const u16 sUnusedTrainerPalette[] = INCBIN_U16("graphics/battle_transitions/unused_trainer.gbapal");
|
||||
static const struct SpritePalette sSpritePalette_UnusedTrainer =
|
||||
{
|
||||
sUnusedTrainerPalette, 0x100A
|
||||
};
|
||||
static const struct SpritePalette sSpritePalette_UnusedTrainer = {sUnusedTrainerPalette, 0x100A};
|
||||
|
||||
static const u16 sBigPokeball_Tilemap[] = INCBIN_U16("graphics/battle_transitions/big_pokeball_map.bin");
|
||||
static const u16 sMugshotsTilemap[] = INCBIN_U16("graphics/battle_transitions/elite_four_bg_map.bin");
|
||||
@@ -1323,7 +1317,7 @@ static bool8 Phase2_BigPokeball_Func1(struct Task *task)
|
||||
GetBg0TilesDst(&tilemap, &tileset);
|
||||
CpuFill16(0, tilemap, 0x800);
|
||||
CpuCopy16(sBigPokeball_Tileset, tileset, 0x580);
|
||||
LoadPalette(gFieldEffectObjectPalette10, 0xF0, 0x20);
|
||||
LoadPalette(sFieldEffectPal_Pokeball, 0xF0, 0x20);
|
||||
|
||||
task->tState++;
|
||||
return FALSE;
|
||||
@@ -1629,7 +1623,7 @@ static bool8 Phase2_PokeballsTrail_Func1(struct Task *task)
|
||||
GetBg0TilesDst(&tilemap, &tileset);
|
||||
CpuSet(sPokeballTrail_Tileset, tileset, 0x20);
|
||||
CpuFill32(0, tilemap, 0x800);
|
||||
LoadPalette(gFieldEffectObjectPalette10, 0xF0, 0x20);
|
||||
LoadPalette(sFieldEffectPal_Pokeball, 0xF0, 0x20);
|
||||
|
||||
task->tState++;
|
||||
return FALSE;
|
||||
@@ -2233,7 +2227,7 @@ static bool8 Phase2_Mugshot_Func4(struct Task *task)
|
||||
SetTrainerPicSlideTable(task->tPlayerSpriteId, 1);
|
||||
IncrementTrainerPicState(task->tOpponentSpriteId);
|
||||
|
||||
PlaySE(SE_BT_START);
|
||||
PlaySE(SE_MUGSHOT);
|
||||
|
||||
sTransitionStructPtr->VBlank_DMA++;
|
||||
return FALSE;
|
||||
@@ -2919,7 +2913,7 @@ static bool8 Phase2_RectangularSpiral_Func1(struct Task *task)
|
||||
CpuCopy16(sShrinkingBoxTileset, tileset, 0x20);
|
||||
CpuCopy16(sShrinkingBoxTileset + 0x70, tileset + 0x20, 0x20);
|
||||
CpuFill16(0xF000, tilemap, 0x800);
|
||||
LoadPalette(gFieldEffectObjectPalette10, 0xF0, 0x20);
|
||||
LoadPalette(sFieldEffectPal_Pokeball, 0xF0, 0x20);
|
||||
|
||||
task->tData3 = 1;
|
||||
task->tState++;
|
||||
@@ -3428,7 +3422,7 @@ static bool8 Phase2_GridSquares_Func1(struct Task *task)
|
||||
GetBg0TilesDst(&tilemap, &tileset);
|
||||
CpuSet(sShrinkingBoxTileset, tileset, 0x10);
|
||||
CpuFill16(0xF000, tilemap, 0x800);
|
||||
LoadPalette(gFieldEffectObjectPalette10, 0xF0, 0x20);
|
||||
LoadPalette(sFieldEffectPal_Pokeball, 0xF0, 0x20);
|
||||
|
||||
task->tState++;
|
||||
return FALSE;
|
||||
@@ -3980,7 +3974,9 @@ static bool8 Phase2_FrontierLogoWave_Func4(struct Task *task)
|
||||
for (i = 0; i < 160; i++, var6 += var8)
|
||||
{
|
||||
s16 index = var6 / 256;
|
||||
asm("");
|
||||
#ifndef NONMATCHING
|
||||
asm("");
|
||||
#endif
|
||||
gScanlineEffectRegBuffers[0][i] = sTransitionStructPtr->field_16 + Sin(index, amplitude);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1398,9 +1398,9 @@ static void TrySetBattleSeminarShow(void)
|
||||
return;
|
||||
else if (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT)
|
||||
return;
|
||||
else if (gBattleMons[gBattlerAttacker].statStages[STAT_ACC] <= 5)
|
||||
else if (gBattleMons[gBattlerAttacker].statStages[STAT_ACC] < DEFAULT_STAT_STAGE)
|
||||
return;
|
||||
else if (gBattleMons[gBattlerTarget].statStages[STAT_EVASION] > 6)
|
||||
else if (gBattleMons[gBattlerTarget].statStages[STAT_EVASION] > DEFAULT_STAT_STAGE)
|
||||
return;
|
||||
else if (gCurrentMove == MOVE_HIDDEN_POWER || gCurrentMove == MOVE_WEATHER_BALL)
|
||||
return;
|
||||
|
||||
+25
-19
@@ -259,7 +259,7 @@ void ResetSentPokesToOpponentValue(void)
|
||||
gSentPokesToOpponent[(i & BIT_FLANK) >> 1] = bits;
|
||||
}
|
||||
|
||||
void sub_803F9EC(u8 battler)
|
||||
void OpponentSwitchInResetSentPokesToOpponentValue(u8 battler)
|
||||
{
|
||||
s32 i = 0;
|
||||
u32 bits = 0;
|
||||
@@ -279,11 +279,11 @@ void sub_803F9EC(u8 battler)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_803FA70(u8 battler)
|
||||
void UpdateSentPokesToOpponentValue(u8 battler)
|
||||
{
|
||||
if (GetBattlerSide(battler) == B_SIDE_OPPONENT)
|
||||
{
|
||||
sub_803F9EC(battler);
|
||||
OpponentSwitchInResetSentPokesToOpponentValue(battler);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1250,7 +1250,7 @@ bool8 HandleFaintedMonActions(void)
|
||||
gBattleStruct->faintedActionsState = 3;
|
||||
break;
|
||||
case 2:
|
||||
sub_803F9EC(gBattlerFainted);
|
||||
OpponentSwitchInResetSentPokesToOpponentValue(gBattlerFainted);
|
||||
if (++gBattleStruct->faintedActionsBattlerId == gBattlersCount)
|
||||
gBattleStruct->faintedActionsState = 3;
|
||||
else
|
||||
@@ -1978,7 +1978,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
}
|
||||
break;
|
||||
case ABILITY_SPEED_BOOST:
|
||||
if (gBattleMons[battler].statStages[STAT_SPEED] < 0xC && gDisableStructs[battler].isFirstTurn != 2)
|
||||
if (gBattleMons[battler].statStages[STAT_SPEED] < MAX_STAT_STAGE && gDisableStructs[battler].isFirstTurn != 2)
|
||||
{
|
||||
gBattleMons[battler].statStages[STAT_SPEED]++;
|
||||
gBattleScripting.animArg1 = 0x11;
|
||||
@@ -2619,9 +2619,9 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
case HOLD_EFFECT_RESTORE_STATS:
|
||||
for (i = 0; i < NUM_BATTLE_STATS; i++)
|
||||
{
|
||||
if (gBattleMons[battlerId].statStages[i] < 6)
|
||||
if (gBattleMons[battlerId].statStages[i] < DEFAULT_STAT_STAGE)
|
||||
{
|
||||
gBattleMons[battlerId].statStages[i] = 6;
|
||||
gBattleMons[battlerId].statStages[i] = DEFAULT_STAT_STAGE;
|
||||
effect = ITEM_STATS_CHANGE;
|
||||
}
|
||||
}
|
||||
@@ -2690,9 +2690,9 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
case HOLD_EFFECT_RESTORE_STATS:
|
||||
for (i = 0; i < NUM_BATTLE_STATS; i++)
|
||||
{
|
||||
if (gBattleMons[battlerId].statStages[i] < 6)
|
||||
if (gBattleMons[battlerId].statStages[i] < DEFAULT_STAT_STAGE)
|
||||
{
|
||||
gBattleMons[battlerId].statStages[i] = 6;
|
||||
gBattleMons[battlerId].statStages[i] = DEFAULT_STAT_STAGE;
|
||||
effect = ITEM_STATS_CHANGE;
|
||||
}
|
||||
}
|
||||
@@ -2811,7 +2811,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
break;
|
||||
// copy/paste again, smh
|
||||
case HOLD_EFFECT_ATTACK_UP:
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / battlerHoldEffectParam && !moveTurn && gBattleMons[battlerId].statStages[STAT_ATK] < 0xC)
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / battlerHoldEffectParam
|
||||
&& !moveTurn && gBattleMons[battlerId].statStages[STAT_ATK] < MAX_STAT_STAGE)
|
||||
{
|
||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_ATK);
|
||||
PREPARE_STRING_BUFFER(gBattleTextBuff2, STRINGID_STATROSE);
|
||||
@@ -2825,7 +2826,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_DEFENSE_UP:
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / battlerHoldEffectParam && !moveTurn && gBattleMons[battlerId].statStages[STAT_DEF] < 0xC)
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / battlerHoldEffectParam && !moveTurn
|
||||
&& gBattleMons[battlerId].statStages[STAT_DEF] < MAX_STAT_STAGE)
|
||||
{
|
||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_DEF);
|
||||
|
||||
@@ -2838,7 +2840,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_SPEED_UP:
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / battlerHoldEffectParam && !moveTurn && gBattleMons[battlerId].statStages[STAT_SPEED] < 0xC)
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / battlerHoldEffectParam && !moveTurn
|
||||
&& gBattleMons[battlerId].statStages[STAT_SPEED] < MAX_STAT_STAGE)
|
||||
{
|
||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_SPEED);
|
||||
|
||||
@@ -2851,7 +2854,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_SP_ATTACK_UP:
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / battlerHoldEffectParam && !moveTurn && gBattleMons[battlerId].statStages[STAT_SPATK] < 0xC)
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / battlerHoldEffectParam && !moveTurn
|
||||
&& gBattleMons[battlerId].statStages[STAT_SPATK] < MAX_STAT_STAGE)
|
||||
{
|
||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_SPATK);
|
||||
|
||||
@@ -2864,7 +2868,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_SP_DEFENSE_UP:
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / battlerHoldEffectParam && !moveTurn && gBattleMons[battlerId].statStages[STAT_SPDEF] < 0xC)
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / battlerHoldEffectParam && !moveTurn
|
||||
&& gBattleMons[battlerId].statStages[STAT_SPDEF] < MAX_STAT_STAGE)
|
||||
{
|
||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_SPDEF);
|
||||
|
||||
@@ -2877,7 +2882,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_CRITICAL_UP:
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / battlerHoldEffectParam && !moveTurn && !(gBattleMons[battlerId].status2 & STATUS2_FOCUS_ENERGY))
|
||||
if (gBattleMons[battlerId].hp <= gBattleMons[battlerId].maxHP / battlerHoldEffectParam && !moveTurn
|
||||
&& !(gBattleMons[battlerId].status2 & STATUS2_FOCUS_ENERGY))
|
||||
{
|
||||
gBattleMons[battlerId].status2 |= STATUS2_FOCUS_ENERGY;
|
||||
BattleScriptExecute(BattleScript_BerryFocusEnergyEnd2);
|
||||
@@ -2889,7 +2895,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
{
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
if (gBattleMons[battlerId].statStages[STAT_ATK + i] < 0xC)
|
||||
if (gBattleMons[battlerId].statStages[STAT_ATK + i] < MAX_STAT_STAGE)
|
||||
break;
|
||||
}
|
||||
if (i != 5)
|
||||
@@ -2897,7 +2903,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
do
|
||||
{
|
||||
i = Random() % 5;
|
||||
} while (gBattleMons[battlerId].statStages[STAT_ATK + i] == 0xC);
|
||||
} while (gBattleMons[battlerId].statStages[STAT_ATK + i] == MAX_STAT_STAGE);
|
||||
|
||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, i + 1);
|
||||
|
||||
@@ -3166,9 +3172,9 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
case HOLD_EFFECT_RESTORE_STATS:
|
||||
for (i = 0; i < NUM_BATTLE_STATS; i++)
|
||||
{
|
||||
if (gBattleMons[battlerId].statStages[i] < 6)
|
||||
if (gBattleMons[battlerId].statStages[i] < DEFAULT_STAT_STAGE)
|
||||
{
|
||||
gBattleMons[battlerId].statStages[i] = 6;
|
||||
gBattleMons[battlerId].statStages[i] = DEFAULT_STAT_STAGE;
|
||||
effect = ITEM_STATS_CHANGE;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1331,7 +1331,7 @@ void ResetBerryTreeSparkleFlags(void)
|
||||
s16 bottom;
|
||||
int i;
|
||||
|
||||
GetCameraCoords(&cam_left, &cam_top);
|
||||
GetCameraCoords((u16*)&cam_left, (u16*)&cam_top);
|
||||
left = cam_left;
|
||||
top = cam_top + 3;
|
||||
right = cam_left + 14;
|
||||
|
||||
+24
-24
@@ -116,8 +116,8 @@ struct BerryBlenderData
|
||||
u16 field_116;
|
||||
u16 field_118;
|
||||
u16 field_11A;
|
||||
u16 bg_X;
|
||||
u16 bg_Y;
|
||||
s16 bg_X;
|
||||
s16 bg_Y;
|
||||
u8 field_120[3];
|
||||
u8 field_123;
|
||||
u16 scores[BLENDER_MAX_PLAYERS][BLENDER_SCORES_NO];
|
||||
@@ -1058,7 +1058,7 @@ static void sub_807FD08(struct Sprite* sprite)
|
||||
if (++sprite->data[5] > 3)
|
||||
DestroySprite(sprite);
|
||||
else
|
||||
PlaySE(SE_TB_KARA);
|
||||
PlaySE(SE_BALL_TRAY_EXIT);
|
||||
}
|
||||
sprite->pos1.x = sprite->data[1];
|
||||
sprite->pos1.y = sprite->data[2];
|
||||
@@ -1230,7 +1230,7 @@ static void sub_8080018(void)
|
||||
sBerryBlenderData->field_114 = 0;
|
||||
Blender_CopyBerryData(&sBerryBlenderData->blendedBerries[0], gSpecialVar_ItemId);
|
||||
memcpy(gBlockSendBuffer, &sBerryBlenderData->blendedBerries[0], sizeof(struct BlenderBerry));
|
||||
sub_800ADF8();
|
||||
SetLinkStandbyCallback();
|
||||
sBerryBlenderData->framesToWait = 0;
|
||||
break;
|
||||
case 9:
|
||||
@@ -1238,7 +1238,7 @@ static void sub_8080018(void)
|
||||
{
|
||||
ResetBlockReceivedFlags();
|
||||
if (GetMultiplayerId() == 0)
|
||||
sub_800A4D8(4);
|
||||
SendBlockRequest(4);
|
||||
sBerryBlenderData->mainState++;
|
||||
}
|
||||
break;
|
||||
@@ -1295,7 +1295,7 @@ static void sub_8080018(void)
|
||||
{
|
||||
sBerryBlenderData->mainState++;
|
||||
sub_8082CB4(&sBerryBlenderData->bgAffineSrc);
|
||||
PlaySE(SE_RU_HYUU);
|
||||
PlaySE(SE_FALL);
|
||||
ShowBg(2);
|
||||
}
|
||||
break;
|
||||
@@ -1310,7 +1310,7 @@ static void sub_8080018(void)
|
||||
sBerryBlenderData->field_11A = 0x100;
|
||||
sBerryBlenderData->arrowPos = sUnknown_083399DC[sUnknown_083399E4[sBerryBlenderData->playersNo - 2]];
|
||||
sBerryBlenderData->framesToWait = 0;
|
||||
PlaySE(SE_TRACK_DOOR);
|
||||
PlaySE(SE_TRUCK_DOOR);
|
||||
sub_808074C();
|
||||
Blender_PrintPlayerNames();
|
||||
}
|
||||
@@ -1332,7 +1332,7 @@ static void sub_8080018(void)
|
||||
sBerryBlenderData->mainState++;
|
||||
break;
|
||||
case 19:
|
||||
sub_800ADF8();
|
||||
SetLinkStandbyCallback();
|
||||
sBerryBlenderData->mainState++;
|
||||
break;
|
||||
case 20:
|
||||
@@ -1582,7 +1582,7 @@ static void sub_80808D4(void)
|
||||
case 13:
|
||||
sBerryBlenderData->mainState++;
|
||||
sub_808074C();
|
||||
PlaySE(SE_RU_HYUU);
|
||||
PlaySE(SE_FALL);
|
||||
sub_8082CB4(&sBerryBlenderData->bgAffineSrc);
|
||||
ShowBg(2);
|
||||
break;
|
||||
@@ -1597,7 +1597,7 @@ static void sub_80808D4(void)
|
||||
sBerryBlenderData->arrowPos = sUnknown_083399DC[sUnknown_083399E4[sBerryBlenderData->playersNo - 2]];
|
||||
SetGpuRegBits(REG_OFFSET_BG2CNT, 2);
|
||||
sBerryBlenderData->framesToWait = 0;
|
||||
PlaySE(SE_TRACK_DOOR);
|
||||
PlaySE(SE_TRUCK_DOOR);
|
||||
Blender_PrintPlayerNames();
|
||||
}
|
||||
sub_8082CB4(&sBerryBlenderData->bgAffineSrc);
|
||||
@@ -1648,7 +1648,7 @@ static void sub_80808D4(void)
|
||||
sBerryBlenderData->field_154 = GetCurrentMapMusic();
|
||||
|
||||
PlayBGM(MUS_CYCLING);
|
||||
PlaySE(SE_MOTER);
|
||||
PlaySE(SE_BERRY_BLENDER);
|
||||
Blender_ControlHitPitch();
|
||||
break;
|
||||
}
|
||||
@@ -1873,17 +1873,17 @@ static void sub_8081288(u16 a0, u8 a1)
|
||||
{
|
||||
StartSpriteAnim(&gSprites[spriteId], 2);
|
||||
gSprites[spriteId].callback = sub_8082F9C;
|
||||
PlaySE(SE_RU_GASHIN);
|
||||
PlaySE(SE_ICE_STAIRS);
|
||||
}
|
||||
else if (a0 == 0x5432)
|
||||
{
|
||||
StartSpriteAnim(&gSprites[spriteId], 0);
|
||||
PlaySE(SE_SEIKAI);
|
||||
PlaySE(SE_SUCCESS);
|
||||
}
|
||||
else if (a0 == 0x2345)
|
||||
{
|
||||
StartSpriteAnim(&gSprites[spriteId], 1);
|
||||
PlaySE(SE_HAZURE);
|
||||
PlaySE(SE_FAILURE);
|
||||
}
|
||||
sub_8082E84();
|
||||
}
|
||||
@@ -2587,7 +2587,7 @@ static bool8 LinkPlayAgainHandleSaving(void)
|
||||
switch (sBerryBlenderData->field_1A0)
|
||||
{
|
||||
case 0:
|
||||
sub_800ADF8();
|
||||
SetLinkStandbyCallback();
|
||||
sBerryBlenderData->field_1A0 = 1;
|
||||
sBerryBlenderData->framesToWait = 0;
|
||||
break;
|
||||
@@ -2606,7 +2606,7 @@ static bool8 LinkPlayAgainHandleSaving(void)
|
||||
case 3:
|
||||
if (++sBerryBlenderData->framesToWait == 10)
|
||||
{
|
||||
sub_800ADF8();
|
||||
SetLinkStandbyCallback();
|
||||
sBerryBlenderData->field_1A0++;
|
||||
}
|
||||
break;
|
||||
@@ -2682,7 +2682,7 @@ static void CB2_HandlePlayerLinkPlayAgainChoice(void)
|
||||
break;
|
||||
case 5:
|
||||
Blender_PrintText(&sBerryBlenderData->textState, gText_SavingDontTurnOff2, 0);
|
||||
sub_800ADF8();
|
||||
SetLinkStandbyCallback();
|
||||
sBerryBlenderData->gameEndState++;
|
||||
break;
|
||||
case 6:
|
||||
@@ -2702,7 +2702,7 @@ static void CB2_HandlePlayerLinkPlayAgainChoice(void)
|
||||
break;
|
||||
case 8:
|
||||
sBerryBlenderData->gameEndState++;
|
||||
sub_800ADF8();
|
||||
SetLinkStandbyCallback();
|
||||
break;
|
||||
case 9:
|
||||
if (IsLinkTaskFinished())
|
||||
@@ -2732,7 +2732,7 @@ static void CB2_HandlePlayerLinkPlayAgainChoice(void)
|
||||
case 11:
|
||||
if (++sBerryBlenderData->framesToWait > 30)
|
||||
{
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
sBerryBlenderData->gameEndState++;
|
||||
}
|
||||
break;
|
||||
@@ -3025,7 +3025,7 @@ static void sub_8083010(struct Sprite* sprite)
|
||||
{
|
||||
sprite->data[1] = 88;
|
||||
sprite->data[0]++;
|
||||
PlaySE(SE_KON);
|
||||
PlaySE(SE_BALL_BOUNCE_1);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
@@ -3166,13 +3166,13 @@ static void sub_80832E8(s16* a0)
|
||||
|
||||
static void sub_808330C(void)
|
||||
{
|
||||
sub_80832E8(&sBerryBlenderData->bg_X);
|
||||
sub_80832E8(&sBerryBlenderData->bg_Y);
|
||||
sub_80832E8((s16 *)&sBerryBlenderData->bg_X);
|
||||
sub_80832E8((s16 *)&sBerryBlenderData->bg_Y);
|
||||
}
|
||||
|
||||
static void sub_8083334(s16* a0, u16 a1)
|
||||
{
|
||||
s32 var;
|
||||
u8 var;
|
||||
|
||||
if (a1 < 10)
|
||||
var = 16;
|
||||
@@ -3567,7 +3567,7 @@ static void sub_8083F3C(u8 taskId)
|
||||
{
|
||||
if (gTasks[taskId].data[0] == 0)
|
||||
{
|
||||
PlayFanfare(MUS_FANFA1);
|
||||
PlayFanfare(MUS_LEVEL_UP);
|
||||
gTasks[taskId].data[0]++;
|
||||
}
|
||||
if (IsFanfareTaskInactive())
|
||||
|
||||
+26
-26
@@ -825,7 +825,7 @@ u32 sub_8020C0C(MainCallback callback)
|
||||
if (callback == CB2_ReturnToField)
|
||||
{
|
||||
gTextFlags.autoScroll = TRUE;
|
||||
PlayNewMapMusic(MUS_POKECEN);
|
||||
PlayNewMapMusic(MUS_POKE_CENTER);
|
||||
SetMainCallback1(CB1_Overworld);
|
||||
}
|
||||
|
||||
@@ -1076,7 +1076,7 @@ int sub_802104C(void)
|
||||
return 0;
|
||||
|
||||
InitStandardTextBoxWindows();
|
||||
sub_8197200();
|
||||
InitTextBoxGfxAndPrinters();
|
||||
sub_8022588(var0);
|
||||
sub_8022600(var0);
|
||||
gPaletteFade.bufferTransferDisabled = TRUE;
|
||||
@@ -1125,7 +1125,7 @@ int sub_802130C(void)
|
||||
switch (var0->unkC)
|
||||
{
|
||||
case 0:
|
||||
sub_8010434();
|
||||
Rfu_SetLinkStandbyCallback();
|
||||
break;
|
||||
case 1:
|
||||
if (!IsLinkTaskFinished())
|
||||
@@ -1344,9 +1344,9 @@ void sub_80216E0(struct BerryCrushGame *arg0, struct BerryCrushGame_138 *arg1)
|
||||
else
|
||||
{
|
||||
if (sp4 == 1)
|
||||
PlaySE(SE_TOY_DANGO);
|
||||
PlaySE(SE_MUD_BALL);
|
||||
else
|
||||
PlaySE(SE_TOY_KABE);
|
||||
PlaySE(SE_BREAKABLE_DOOR);
|
||||
|
||||
arg0->unk25_2 = 1;
|
||||
}
|
||||
@@ -2027,7 +2027,7 @@ static u32 sub_8022CB0(struct BerryCrushGame *r4, u8 *r5)
|
||||
r4->unkC = 3;
|
||||
return 0;
|
||||
case 1:
|
||||
sub_8010434();
|
||||
Rfu_SetLinkStandbyCallback();
|
||||
++r4->unkC;
|
||||
return 0;
|
||||
case 2:
|
||||
@@ -2110,12 +2110,12 @@ static u32 sub_8022E5C(struct BerryCrushGame *r4, __attribute__((unused)) u8 *r1
|
||||
switch (r4->unkC)
|
||||
{
|
||||
case 0:
|
||||
sub_8010434();
|
||||
Rfu_SetLinkStandbyCallback();
|
||||
break;
|
||||
case 1:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
PlayNewMapMusic(MUS_RG_SLOT);
|
||||
PlayNewMapMusic(MUS_RG_GAME_CORNER);
|
||||
sub_8022BEC(7, 1, NULL);
|
||||
r4->unk12 = 3;
|
||||
r4->unkC = 0;
|
||||
@@ -2167,7 +2167,7 @@ static u32 sub_8022F1C(struct BerryCrushGame *r5, u8 *r2)
|
||||
sub_8022BEC(3, 1, NULL);
|
||||
return 0;
|
||||
case 1:
|
||||
sub_8010434();
|
||||
Rfu_SetLinkStandbyCallback();
|
||||
break;
|
||||
case 2:
|
||||
if (!IsLinkTaskFinished())
|
||||
@@ -2213,7 +2213,7 @@ static u32 sub_8023070(struct BerryCrushGame *r4, __attribute__((unused)) u8 *r
|
||||
{
|
||||
case 0:
|
||||
sub_80214A8(r4, &r4->unk138);
|
||||
sub_8010434();
|
||||
Rfu_SetLinkStandbyCallback();
|
||||
break;
|
||||
case 1:
|
||||
if (!IsLinkTaskFinished())
|
||||
@@ -2226,14 +2226,14 @@ static u32 sub_8023070(struct BerryCrushGame *r4, __attribute__((unused)) u8 *r
|
||||
case 2:
|
||||
r4->unk138.unk38[r4->unk138.unk0]->callback = sub_8021608;
|
||||
r4->unk138.unk38[r4->unk138.unk0]->affineAnimPaused = FALSE;
|
||||
PlaySE(SE_NAGERU);
|
||||
PlaySE(SE_BALL_THROW);
|
||||
break;
|
||||
case 3:
|
||||
if (r4->unk138.unk38[r4->unk138.unk0]->callback == sub_8021608)
|
||||
return 0;
|
||||
r4->unk138.unk38[r4->unk138.unk0] = NULL;
|
||||
++r4->unk138.unk0;
|
||||
sub_8010434();
|
||||
Rfu_SetLinkStandbyCallback();
|
||||
break;
|
||||
case 4:
|
||||
if (!IsLinkTaskFinished())
|
||||
@@ -2247,12 +2247,12 @@ static u32 sub_8023070(struct BerryCrushGame *r4, __attribute__((unused)) u8 *r
|
||||
break;
|
||||
case 5:
|
||||
sub_80216A8(r4, &r4->unk138);
|
||||
sub_8010434();
|
||||
Rfu_SetLinkStandbyCallback();
|
||||
break;
|
||||
case 6:
|
||||
if (!IsLinkTaskFinished())
|
||||
return 0;
|
||||
PlaySE(SE_RU_HYUU);
|
||||
PlaySE(SE_FALL);
|
||||
sub_8022BEC(11, 1, NULL);
|
||||
r4->unk12 = 5;
|
||||
r4->unkC = 0;
|
||||
@@ -2274,7 +2274,7 @@ static u32 sub_80231B8(struct BerryCrushGame *r4, __attribute__((unused)) u8 *r
|
||||
r4->unk138.unk1 = 4;
|
||||
r4->unk138.unk0 = 0;
|
||||
r4->unk138.unk2 = gUnknown_082F326C[r4->unk138.unk1][0];
|
||||
PlaySE(SE_W070);
|
||||
PlaySE(SE_M_STRENGTH);
|
||||
break;
|
||||
case 1:
|
||||
r4->unk2C = gUnknown_082F326C[r4->unk138.unk1][r4->unk138.unk0];
|
||||
@@ -2295,7 +2295,7 @@ static u32 sub_80231B8(struct BerryCrushGame *r4, __attribute__((unused)) u8 *r
|
||||
SetGpuReg(REG_OFFSET_BG0VOFS, 0);
|
||||
SetGpuReg(REG_OFFSET_BG2VOFS, 0);
|
||||
SetGpuReg(REG_OFFSET_BG3VOFS, 0);
|
||||
sub_8010434();
|
||||
Rfu_SetLinkStandbyCallback();
|
||||
break;
|
||||
case 3:
|
||||
if (!IsLinkTaskFinished())
|
||||
@@ -2323,7 +2323,7 @@ static u32 sub_80232EC(struct BerryCrushGame *r4, __attribute__((unused)) u8 *r
|
||||
return 0;
|
||||
// fallthrough
|
||||
case 0:
|
||||
sub_8010434();
|
||||
Rfu_SetLinkStandbyCallback();
|
||||
break;
|
||||
case 3:
|
||||
if (!IsLinkTaskFinished())
|
||||
@@ -2667,7 +2667,7 @@ static u32 sub_8023A30(struct BerryCrushGame *r4, __attribute__((unused)) u8 *r1
|
||||
{
|
||||
case 0:
|
||||
r4->unk12 = 8;
|
||||
PlaySE(SE_W070);
|
||||
PlaySE(SE_M_STRENGTH);
|
||||
BlendPalettes(0xFFFFFFFF, 8, RGB(31, 31, 0));
|
||||
r4->unk138.unk0 = 2;
|
||||
break;
|
||||
@@ -2703,7 +2703,7 @@ static u32 sub_8023A30(struct BerryCrushGame *r4, __attribute__((unused)) u8 *r1
|
||||
case 4:
|
||||
if (!sub_80218D4(r4, &r4->unk138))
|
||||
return 0;
|
||||
sub_8010434();
|
||||
Rfu_SetLinkStandbyCallback();
|
||||
r4->unk10 = 0;
|
||||
break;
|
||||
case 5:
|
||||
@@ -2724,7 +2724,7 @@ static u32 sub_8023BC0(struct BerryCrushGame *r5, u8 *r6)
|
||||
{
|
||||
case 0:
|
||||
r5->unk12 = 9;
|
||||
PlaySE(SE_HAZURE);
|
||||
PlaySE(SE_FAILURE);
|
||||
BlendPalettes(0xFFFFFFFF, 8, RGB(31, 0, 0));
|
||||
r5->unk138.unk0 = 4;
|
||||
break;
|
||||
@@ -2737,7 +2737,7 @@ static u32 sub_8023BC0(struct BerryCrushGame *r5, u8 *r6)
|
||||
case 2:
|
||||
if (!sub_80218D4(r5, &r5->unk138))
|
||||
return 0;
|
||||
sub_8010434();
|
||||
Rfu_SetLinkStandbyCallback();
|
||||
r5->unk10 = 0;
|
||||
SetGpuReg(REG_OFFSET_BG0VOFS, 0);
|
||||
SetGpuReg(REG_OFFSET_BG2VOFS, 0);
|
||||
@@ -3005,7 +3005,7 @@ static u32 sub_8024134(struct BerryCrushGame *r5, u8 *r4)
|
||||
r5->unkC = 0;
|
||||
return 0;
|
||||
case 1:
|
||||
sub_8010434();
|
||||
Rfu_SetLinkStandbyCallback();
|
||||
break;
|
||||
case 2:
|
||||
if (!IsLinkTaskFinished())
|
||||
@@ -3084,7 +3084,7 @@ static u32 sub_80242E0(struct BerryCrushGame *r4, __attribute__((unused)) u8 *r1
|
||||
switch (r4->unkC)
|
||||
{
|
||||
case 0:
|
||||
sub_8010434();
|
||||
Rfu_SetLinkStandbyCallback();
|
||||
break;
|
||||
case 1:
|
||||
if (!IsLinkTaskFinished())
|
||||
@@ -3184,12 +3184,12 @@ static u32 sub_8024508(struct BerryCrushGame *r5, __attribute__((unused)) u8 *r1
|
||||
switch (r5->unkC)
|
||||
{
|
||||
case 0:
|
||||
sub_8010434();
|
||||
Rfu_SetLinkStandbyCallback();
|
||||
break;
|
||||
case 1:
|
||||
if (!IsLinkTaskFinished())
|
||||
return 0;
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
break;
|
||||
case 2:
|
||||
if (gReceivedRemoteLinkPlayers != 0)
|
||||
@@ -3271,7 +3271,7 @@ static void BerryCrush_SetPaletteFadeParams(u8 *params, bool8 communicateAfter,
|
||||
|
||||
void sub_8024644(u8 *r0, u32 r1, u32 r2, u32 r3, u32 r5)
|
||||
{
|
||||
u8 sp[4];
|
||||
u8 sp[2];
|
||||
|
||||
0[(u16 *)sp] = r3;
|
||||
r0[0] = r1;
|
||||
|
||||
@@ -186,7 +186,7 @@ static void CB2_BerryTagScreen(void)
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ static bool8 InitBerryTagScreen(void)
|
||||
case 0:
|
||||
SetVBlankHBlankCallbacksToNull();
|
||||
ResetVramOamAndBgCntRegs();
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
gMain.state++;
|
||||
break;
|
||||
case 1:
|
||||
|
||||
+5
-5
@@ -659,7 +659,7 @@ static void AcroBikeTransition_SideJump(u8 direction)
|
||||
}
|
||||
}
|
||||
playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
PlaySE(SE_JITE_PYOKO);
|
||||
PlaySE(SE_BIKE_HOP);
|
||||
playerObjEvent->facingDirectionLocked = 1;
|
||||
PlayerSetAnimId(GetJumpMovementAction(direction), 2);
|
||||
}
|
||||
@@ -835,7 +835,7 @@ static void Bike_UpdateDirTimerHistory(u8 dir)
|
||||
|
||||
gPlayerAvatar.directionHistory = (gPlayerAvatar.directionHistory << 4) | (dir & 0xF);
|
||||
|
||||
for (i = 7; i != 0; i--)
|
||||
for (i = ARRAY_COUNT(gPlayerAvatar.dirTimerHistory) - 1; i != 0; i--)
|
||||
gPlayerAvatar.dirTimerHistory[i] = gPlayerAvatar.dirTimerHistory[i - 1];
|
||||
gPlayerAvatar.dirTimerHistory[0] = 1;
|
||||
}
|
||||
@@ -846,7 +846,7 @@ static void Bike_UpdateABStartSelectHistory(u8 input)
|
||||
|
||||
gPlayerAvatar.abStartSelectHistory = (gPlayerAvatar.abStartSelectHistory << 4) | (input & 0xF);
|
||||
|
||||
for (i = 7; i != 0; i--)
|
||||
for (i = ARRAY_COUNT(gPlayerAvatar.abStartSelectTimerHistory) - 1; i != 0; i--)
|
||||
gPlayerAvatar.abStartSelectTimerHistory[i] = gPlayerAvatar.abStartSelectTimerHistory[i - 1];
|
||||
gPlayerAvatar.abStartSelectTimerHistory[0] = 1;
|
||||
}
|
||||
@@ -1000,10 +1000,10 @@ void BikeClearState(int newDirHistory, int newAbStartHistory)
|
||||
gPlayerAvatar.directionHistory = newDirHistory;
|
||||
gPlayerAvatar.abStartSelectHistory = newAbStartHistory;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
for (i = 0; i < ARRAY_COUNT(gPlayerAvatar.dirTimerHistory); i++)
|
||||
gPlayerAvatar.dirTimerHistory[i] = 0;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
for (i = 0; i < ARRAY_COUNT(gPlayerAvatar.abStartSelectTimerHistory); i++)
|
||||
gPlayerAvatar.abStartSelectTimerHistory[i] = 0;
|
||||
}
|
||||
|
||||
|
||||
+25
-25
@@ -86,14 +86,14 @@ bool8 ShouldDoBrailleDigEffect(void)
|
||||
|
||||
void DoBrailleDigEffect(void)
|
||||
{
|
||||
MapGridSetMetatileIdAt(16, 8, METATILE_ID(Cave, SealedChamberEntrance_TopLeft));
|
||||
MapGridSetMetatileIdAt(17, 8, METATILE_ID(Cave, SealedChamberEntrance_TopMid));
|
||||
MapGridSetMetatileIdAt(18, 8, METATILE_ID(Cave, SealedChamberEntrance_TopRight));
|
||||
MapGridSetMetatileIdAt(16, 9, METATILE_ID(Cave, SealedChamberEntrance_BottomLeft) | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(17, 9, METATILE_ID(Cave, SealedChamberEntrance_BottomMid));
|
||||
MapGridSetMetatileIdAt(18, 9, METATILE_ID(Cave, SealedChamberEntrance_BottomRight) | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(16, 8, METATILE_Cave_SealedChamberEntrance_TopLeft);
|
||||
MapGridSetMetatileIdAt(17, 8, METATILE_Cave_SealedChamberEntrance_TopMid);
|
||||
MapGridSetMetatileIdAt(18, 8, METATILE_Cave_SealedChamberEntrance_TopRight);
|
||||
MapGridSetMetatileIdAt(16, 9, METATILE_Cave_SealedChamberEntrance_BottomLeft | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(17, 9, METATILE_Cave_SealedChamberEntrance_BottomMid);
|
||||
MapGridSetMetatileIdAt(18, 9, METATILE_Cave_SealedChamberEntrance_BottomRight | METATILE_COLLISION_MASK);
|
||||
DrawWholeMapView();
|
||||
PlaySE(SE_BAN);
|
||||
PlaySE(SE_BANG);
|
||||
FlagSet(FLAG_SYS_BRAILLE_DIG);
|
||||
ScriptContext2_Disable();
|
||||
}
|
||||
@@ -140,7 +140,7 @@ void DoBrailleRegirockEffect(void)
|
||||
MapGridSetMetatileIdAt(15, 27, 563);
|
||||
MapGridSetMetatileIdAt(16, 27, 3636);
|
||||
DrawWholeMapView();
|
||||
PlaySE(SE_BAN);
|
||||
PlaySE(SE_BANG);
|
||||
FlagSet(FLAG_SYS_REGIROCK_PUZZLE_COMPLETED);
|
||||
ScriptContext2_Disable();
|
||||
}
|
||||
@@ -164,7 +164,7 @@ void DoBrailleRegisteelEffect(void)
|
||||
|
||||
bool8 FldEff_UseFlyAncientTomb(void)
|
||||
{
|
||||
u8 taskId = oei_task_add();
|
||||
u8 taskId = CreateFieldMoveTask();
|
||||
|
||||
gTasks[taskId].data[8] = (u32)UseRegisteelHm_Callback >> 16;
|
||||
gTasks[taskId].data[9] = (u32)UseRegisteelHm_Callback;
|
||||
@@ -186,7 +186,7 @@ void UseFlyAncientTomb_Finish(void)
|
||||
MapGridSetMetatileIdAt(15, 27, 563);
|
||||
MapGridSetMetatileIdAt(16, 27, 3636);
|
||||
DrawWholeMapView();
|
||||
PlaySE(SE_BAN);
|
||||
PlaySE(SE_BANG);
|
||||
FlagSet(FLAG_SYS_REGISTEEL_PUZZLE_COMPLETED);
|
||||
ScriptContext2_Disable();
|
||||
}
|
||||
@@ -279,14 +279,14 @@ void UseRegirockHm_Callback(void)
|
||||
|
||||
void DoBrailleRegirockEffect(void)
|
||||
{
|
||||
MapGridSetMetatileIdAt(14, 26, METATILE_ID(Cave, SealedChamberEntrance_TopLeft));
|
||||
MapGridSetMetatileIdAt(15, 26, METATILE_ID(Cave, SealedChamberEntrance_TopMid));
|
||||
MapGridSetMetatileIdAt(16, 26, METATILE_ID(Cave, SealedChamberEntrance_TopRight));
|
||||
MapGridSetMetatileIdAt(14, 27, METATILE_ID(Cave, SealedChamberEntrance_BottomLeft) | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(15, 27, METATILE_ID(Cave, SealedChamberEntrance_BottomMid));
|
||||
MapGridSetMetatileIdAt(16, 27, METATILE_ID(Cave, SealedChamberEntrance_BottomRight) | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(14, 26, METATILE_Cave_SealedChamberEntrance_TopLeft);
|
||||
MapGridSetMetatileIdAt(15, 26, METATILE_Cave_SealedChamberEntrance_TopMid);
|
||||
MapGridSetMetatileIdAt(16, 26, METATILE_Cave_SealedChamberEntrance_TopRight);
|
||||
MapGridSetMetatileIdAt(14, 27, METATILE_Cave_SealedChamberEntrance_BottomLeft | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(15, 27, METATILE_Cave_SealedChamberEntrance_BottomMid);
|
||||
MapGridSetMetatileIdAt(16, 27, METATILE_Cave_SealedChamberEntrance_BottomRight | METATILE_COLLISION_MASK);
|
||||
DrawWholeMapView();
|
||||
PlaySE(SE_BAN);
|
||||
PlaySE(SE_BANG);
|
||||
FlagSet(FLAG_SYS_REGIROCK_PUZZLE_COMPLETED);
|
||||
ScriptContext2_Disable();
|
||||
}
|
||||
@@ -318,14 +318,14 @@ void UseRegisteelHm_Callback(void)
|
||||
|
||||
void DoBrailleRegisteelEffect(void)
|
||||
{
|
||||
MapGridSetMetatileIdAt(14, 26, METATILE_ID(Cave, SealedChamberEntrance_TopLeft));
|
||||
MapGridSetMetatileIdAt(15, 26, METATILE_ID(Cave, SealedChamberEntrance_TopMid));
|
||||
MapGridSetMetatileIdAt(16, 26, METATILE_ID(Cave, SealedChamberEntrance_TopRight));
|
||||
MapGridSetMetatileIdAt(14, 27, METATILE_ID(Cave, SealedChamberEntrance_BottomLeft) | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(15, 27, METATILE_ID(Cave, SealedChamberEntrance_BottomMid));
|
||||
MapGridSetMetatileIdAt(16, 27, METATILE_ID(Cave, SealedChamberEntrance_BottomRight) | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(14, 26, METATILE_Cave_SealedChamberEntrance_TopLeft);
|
||||
MapGridSetMetatileIdAt(15, 26, METATILE_Cave_SealedChamberEntrance_TopMid);
|
||||
MapGridSetMetatileIdAt(16, 26, METATILE_Cave_SealedChamberEntrance_TopRight);
|
||||
MapGridSetMetatileIdAt(14, 27, METATILE_Cave_SealedChamberEntrance_BottomLeft | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(15, 27, METATILE_Cave_SealedChamberEntrance_BottomMid);
|
||||
MapGridSetMetatileIdAt(16, 27, METATILE_Cave_SealedChamberEntrance_BottomRight | METATILE_COLLISION_MASK);
|
||||
DrawWholeMapView();
|
||||
PlaySE(SE_BAN);
|
||||
PlaySE(SE_BANG);
|
||||
FlagSet(FLAG_SYS_REGISTEEL_PUZZLE_COMPLETED);
|
||||
ScriptContext2_Disable();
|
||||
}
|
||||
@@ -410,7 +410,7 @@ bool32 BrailleWait_CheckButtonPress(void)
|
||||
// this used to be FldEff_UseFlyAncientTomb . why did GF merge the 2 functions?
|
||||
bool8 FldEff_UsePuzzleEffect(void)
|
||||
{
|
||||
u8 taskId = oei_task_add();
|
||||
u8 taskId = CreateFieldMoveTask();
|
||||
|
||||
if (sBraillePuzzleCallbackFlag == REGISTEEL_PUZZLE)
|
||||
{
|
||||
|
||||
+1
-1
@@ -343,7 +343,7 @@ static void CableCarMainCallback_Setup(void)
|
||||
break;
|
||||
case 8:
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 3, 16, 0, RGB(0, 0, 0));
|
||||
FadeInNewBGM(MUS_ROPEWAY, 1);
|
||||
FadeInNewBGM(MUS_CABLE_CAR, 1);
|
||||
sub_8150B6C(1);
|
||||
gMain.state++;
|
||||
break;
|
||||
|
||||
+19
-19
@@ -20,7 +20,7 @@
|
||||
#include "union_room.h"
|
||||
#include "mevent2.h"
|
||||
#include "script.h"
|
||||
#include "script_pokemon_util_80F87D8.h"
|
||||
#include "script_pokemon_util.h"
|
||||
#include "sound.h"
|
||||
#include "start_menu.h"
|
||||
#include "string_util.h"
|
||||
@@ -203,7 +203,7 @@ static void sub_80B2600(u8 taskId)
|
||||
gTasks[taskId].data[0]++;
|
||||
if (gTasks[taskId].data[0] == 10)
|
||||
{
|
||||
sub_800A4D8(2);
|
||||
SendBlockRequest(2);
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
}
|
||||
@@ -357,7 +357,7 @@ static void Task_LinkupExchangeDataWithLeader(u8 taskId)
|
||||
if (gSpecialVar_Result == LINKUP_DIFF_SELECTIONS
|
||||
|| gSpecialVar_Result == LINKUP_WRONG_NUM_PLAYERS)
|
||||
{
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
HideFieldMessageBox();
|
||||
gTasks[taskId].func = Task_StopLinkup;
|
||||
}
|
||||
@@ -392,7 +392,7 @@ static void Task_LinkupCheckStatusAfterConfirm(u8 taskId)
|
||||
{
|
||||
if (!Link_AnyPartnersPlayingRubyOrSapphire())
|
||||
{
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
HideFieldMessageBox();
|
||||
gTasks[taskId].func = Task_StopLinkup;
|
||||
}
|
||||
@@ -405,7 +405,7 @@ static void Task_LinkupCheckStatusAfterConfirm(u8 taskId)
|
||||
}
|
||||
else if (gSpecialVar_Result == LINKUP_DIFF_SELECTIONS)
|
||||
{
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
HideFieldMessageBox();
|
||||
gTasks[taskId].func = Task_StopLinkup;
|
||||
}
|
||||
@@ -426,7 +426,7 @@ static void Task_LinkupCheckStatusAfterConfirm(u8 taskId)
|
||||
card->monSpecies[0] = GetMonData(&gPlayerParty[gSelectedOrderFromParty[0] - 1], MON_DATA_SPECIES, NULL);
|
||||
card->monSpecies[1] = GetMonData(&gPlayerParty[gSelectedOrderFromParty[1] - 1], MON_DATA_SPECIES, NULL);
|
||||
gTasks[taskId].func = Task_LinkupAwaitTrainerCardData;
|
||||
sub_800A4D8(2);
|
||||
SendBlockRequest(2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -481,7 +481,7 @@ static void FinishLinkup(u16 *linkupStatus, u32 taskId)
|
||||
{
|
||||
// Unsuccessful battle tower linkup
|
||||
*linkupStatus = LINKUP_FAILED_BATTLE_TOWER;
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
gTasks[taskId].func = Task_StopLinkup;
|
||||
}
|
||||
else
|
||||
@@ -503,7 +503,7 @@ static void FinishLinkup(u16 *linkupStatus, u32 taskId)
|
||||
else
|
||||
{
|
||||
// Unsuccessful linkup
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
gTasks[taskId].func = Task_StopLinkup;
|
||||
}
|
||||
}
|
||||
@@ -686,7 +686,7 @@ static void Task_ValidateMixingGameLanguage(u8 taskId)
|
||||
if (mixingForeignGames)
|
||||
{
|
||||
gSpecialVar_Result = LINKUP_FOREIGN_GAME;
|
||||
sub_800AD10();
|
||||
SetCloseLinkCallbackHandleJP();
|
||||
gTasks[taskId].tState = 1;
|
||||
return;
|
||||
}
|
||||
@@ -856,7 +856,7 @@ static void Task_StartWiredCableClubBattle(u8 taskId)
|
||||
task->tState++;
|
||||
break;
|
||||
case 3:
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
task->tState++;
|
||||
break;
|
||||
case 4:
|
||||
@@ -865,9 +865,9 @@ static void Task_StartWiredCableClubBattle(u8 taskId)
|
||||
break;
|
||||
case 5:
|
||||
if (gLinkPlayers[0].trainerId & 1)
|
||||
PlayMapChosenOrBattleBGM(MUS_BATTLE32);
|
||||
PlayMapChosenOrBattleBGM(MUS_VS_GYM_LEADER);
|
||||
else
|
||||
PlayMapChosenOrBattleBGM(MUS_BATTLE20);
|
||||
PlayMapChosenOrBattleBGM(MUS_VS_TRAINER);
|
||||
|
||||
SetLinkBattleTypeFlags(gSpecialVar_0x8004);
|
||||
CleanupOverworldWindowsAndTilemaps();
|
||||
@@ -919,7 +919,7 @@ static void Task_StartWirelessCableClubBattle(u8 taskId)
|
||||
tState = 5;
|
||||
break;
|
||||
case 5:
|
||||
sub_800ADF8();
|
||||
SetLinkStandbyCallback();
|
||||
tState = 6;
|
||||
break;
|
||||
case 6:
|
||||
@@ -930,9 +930,9 @@ static void Task_StartWirelessCableClubBattle(u8 taskId)
|
||||
break;
|
||||
case 7:
|
||||
if (gLinkPlayers[0].trainerId & 1)
|
||||
PlayMapChosenOrBattleBGM(MUS_BATTLE32);
|
||||
PlayMapChosenOrBattleBGM(MUS_VS_GYM_LEADER);
|
||||
else
|
||||
PlayMapChosenOrBattleBGM(MUS_BATTLE20);
|
||||
PlayMapChosenOrBattleBGM(MUS_VS_TRAINER);
|
||||
|
||||
gLinkPlayers[0].linkType = LINKTYPE_BATTLE;
|
||||
SetLinkBattleTypeFlags(gSpecialVar_0x8004);
|
||||
@@ -974,7 +974,7 @@ static void CB2_ReturnFromUnionRoomBattle(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
gMain.state = 1;
|
||||
}
|
||||
break;
|
||||
@@ -1113,7 +1113,7 @@ static void Task_StartWiredTrade(u8 taskId)
|
||||
gSelectedTradeMonPositions[TRADE_PLAYER] = 0;
|
||||
gSelectedTradeMonPositions[TRADE_PARTNER] = 0;
|
||||
m4aMPlayAllStop();
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
task->tState++;
|
||||
break;
|
||||
case 3:
|
||||
@@ -1146,7 +1146,7 @@ static void Task_StartWirelessTrade(u8 taskId)
|
||||
gSelectedTradeMonPositions[TRADE_PLAYER] = 0;
|
||||
gSelectedTradeMonPositions[TRADE_PARTNER] = 0;
|
||||
m4aMPlayAllStop();
|
||||
sub_800ADF8();
|
||||
SetLinkStandbyCallback();
|
||||
tState++;
|
||||
break;
|
||||
case 3:
|
||||
@@ -1264,7 +1264,7 @@ static void sub_80B3AAC(u8 taskId)
|
||||
// Unused
|
||||
static void sub_80B3AD0(u8 taskId)
|
||||
{
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
gTasks[taskId].func = sub_80B3AAC;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ void PrintCoinsString(u32 coinAmount)
|
||||
{
|
||||
u32 xAlign;
|
||||
|
||||
ConvertIntToDecimalStringN(gStringVar1, coinAmount, STR_CONV_MODE_RIGHT_ALIGN, 4);
|
||||
ConvertIntToDecimalStringN(gStringVar1, coinAmount, STR_CONV_MODE_RIGHT_ALIGN, MAX_COIN_DIGITS);
|
||||
StringExpandPlaceholders(gStringVar4, gText_Coins);
|
||||
|
||||
xAlign = GetStringRightAlignXOffset(1, gStringVar4, 0x40);
|
||||
|
||||
+1829
-1584
File diff suppressed because it is too large
Load Diff
+431
-412
File diff suppressed because it is too large
Load Diff
+241
-238
File diff suppressed because it is too large
Load Diff
+172
-157
@@ -8,10 +8,18 @@
|
||||
#include "task.h"
|
||||
#include "contest_link.h"
|
||||
|
||||
static void sub_80FC5C0(u8);
|
||||
static void sub_80FC5DC(u8);
|
||||
static void Task_LinkContest_StartInitFlags(u8);
|
||||
static void Task_LinkContest_InitFlags(u8);
|
||||
|
||||
bool32 sub_80FC4F4(void *src, u16 size)
|
||||
#define tState data[0]
|
||||
#define tDelayTimer data[1]
|
||||
#define tCategories(i) data[(i) + 1]
|
||||
#define tLeaderIds(i) data[(i) + 5]
|
||||
#define tCategory data[9]
|
||||
#define tTimer data[11]
|
||||
#define tStandbyState data[12]
|
||||
|
||||
bool32 LinkContest_SendBlock(void *src, u16 size)
|
||||
{
|
||||
memcpy(gDecompressionBuffer, src, size);
|
||||
if (SendBlock(bitmask_all_link_players_but_self(), gDecompressionBuffer, size))
|
||||
@@ -20,21 +28,21 @@ bool32 sub_80FC4F4(void *src, u16 size)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_80FC530(u8 arg0)
|
||||
bool8 LinkContest_GetBlockReceived(u8 flag)
|
||||
{
|
||||
u8 mask = (1 << arg0);
|
||||
u8 mask = (1 << flag);
|
||||
if (!(GetBlockReceivedStatus() & mask))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
ResetBlockReceivedFlag(arg0);
|
||||
ResetBlockReceivedFlag(flag);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
bool8 sub_80FC55C(void)
|
||||
bool8 LinkContest_GetBlockReceivedFromAllPlayers(void)
|
||||
{
|
||||
if (GetBlockReceivedStatus() == GetLinkPlayerCountAsBitFlags())
|
||||
{
|
||||
@@ -47,23 +55,23 @@ bool8 sub_80FC55C(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80FC580(u8 taskId)
|
||||
void Task_LinkContest_Init(u8 taskId)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
for (i = 0; i < CONTESTANT_COUNT; i++)
|
||||
gBlockRecvBuffer[i][0] = 0xFF;
|
||||
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].func = sub_80FC5C0;
|
||||
gTasks[taskId].tState = 0;
|
||||
gTasks[taskId].func = Task_LinkContest_StartInitFlags;
|
||||
}
|
||||
|
||||
static void sub_80FC5C0(u8 taskId)
|
||||
static void Task_LinkContest_StartInitFlags(u8 taskId)
|
||||
{
|
||||
gTasks[taskId].func = sub_80FC5DC;
|
||||
gTasks[taskId].func = Task_LinkContest_InitFlags;
|
||||
}
|
||||
|
||||
static void sub_80FC5DC(u8 taskId)
|
||||
static void Task_LinkContest_InitFlags(u8 taskId)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -76,6 +84,7 @@ static void sub_80FC5DC(u8 taskId)
|
||||
if (gWirelessCommType == 1)
|
||||
gLinkContestFlags = LINK_CONTEST_FLAG_IS_LINK | LINK_CONTEST_FLAG_IS_WIRELESS;
|
||||
|
||||
// Get number of players using Emerald/FRLG
|
||||
for (i = 0; i < gNumLinkContestPlayers && (u32)(gLinkPlayers[i].version & 0xFF) - 1 > VERSION_RUBY - 1; i++)
|
||||
;
|
||||
|
||||
@@ -85,22 +94,23 @@ static void sub_80FC5DC(u8 taskId)
|
||||
SwitchTaskToFollowupFunc(taskId);
|
||||
}
|
||||
|
||||
bool32 sub_80FC670(s16 *arg0)
|
||||
bool32 LinkContest_TryLinkStandby(s16 *state)
|
||||
{
|
||||
// Skip standby for RS cabled links
|
||||
if (gLinkContestFlags & LINK_CONTEST_FLAG_HAS_RS_PLAYER)
|
||||
return TRUE;
|
||||
|
||||
switch (*arg0)
|
||||
switch (*state)
|
||||
{
|
||||
case 0:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
sub_800ADF8();
|
||||
(*arg0)++;
|
||||
SetLinkStandbyCallback();
|
||||
(*state)++;
|
||||
}
|
||||
return FALSE;
|
||||
case 1:
|
||||
(*arg0)++;
|
||||
(*state)++;
|
||||
return FALSE;
|
||||
default:
|
||||
if (IsLinkTaskFinished() != TRUE)
|
||||
@@ -110,438 +120,443 @@ bool32 sub_80FC670(s16 *arg0)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80FC6BC(u8 taskId)
|
||||
void Task_LinkContest_CommunicateMonsRS(u8 taskId)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!sub_80FC670(&gTasks[taskId].data[12]))
|
||||
if (!LinkContest_TryLinkStandby(&gTasks[taskId].tStandbyState))
|
||||
return;
|
||||
|
||||
switch (gTasks[taskId].data[0])
|
||||
switch (gTasks[taskId].tState)
|
||||
{
|
||||
case 0:
|
||||
// Send players mon
|
||||
if (GetMultiplayerId() == 0)
|
||||
{
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
memcpy(gBlockSendBuffer, &gContestMons[gContestPlayerMonIndex], sizeof(struct ContestPokemon));
|
||||
gTasks[taskId].data[0] = 10;
|
||||
gTasks[taskId].tState = 10;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(gBlockSendBuffer, &gContestMons[gContestPlayerMonIndex], sizeof(struct ContestPokemon));
|
||||
gTasks[taskId].data[0] = 1;
|
||||
gTasks[taskId].tState = 1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sub_80FC55C())
|
||||
// Wait for other players data
|
||||
if (LinkContest_GetBlockReceivedFromAllPlayers())
|
||||
{
|
||||
for (i = 0; i < gNumLinkContestPlayers; i++)
|
||||
{
|
||||
memcpy(&gContestMons[i], gBlockRecvBuffer[i], sizeof(struct ContestPokemon));
|
||||
sub_80DFA08(&gContestMons[i], gLinkPlayers[i].language);
|
||||
StripPlayerAndMonNamesForLinkContest(&gContestMons[i], gLinkPlayers[i].language);
|
||||
}
|
||||
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
if (++gTasks[taskId].data[11] > 300)
|
||||
// Only if leader. Request other players data
|
||||
if (++gTasks[taskId].tTimer > 300)
|
||||
{
|
||||
sub_800A4D8(2);
|
||||
gTasks[taskId].data[0] = 1;
|
||||
SendBlockRequest(2);
|
||||
gTasks[taskId].tState = 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].data[11] = 0;
|
||||
gTasks[taskId].data[12] = 0;
|
||||
gTasks[taskId].tState = 0;
|
||||
gTasks[taskId].tTimer = 0;
|
||||
gTasks[taskId].tStandbyState = 0;
|
||||
SwitchTaskToFollowupFunc(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80FC804(u8 taskId)
|
||||
void Task_LinkContest_CommunicateRngRS(u8 taskId)
|
||||
{
|
||||
switch (gTasks[taskId].data[0])
|
||||
switch (gTasks[taskId].tState)
|
||||
{
|
||||
case 0:
|
||||
if (GetMultiplayerId() == 0)
|
||||
{
|
||||
if (IsLinkTaskFinished() && sub_80FC4F4(&gRngValue, sizeof(gRngValue)) == TRUE)
|
||||
gTasks[taskId].data[0]++;
|
||||
if (IsLinkTaskFinished() && LinkContest_SendBlock(&gRngValue, sizeof(gRngValue)) == TRUE)
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sub_80FC530(0))
|
||||
if (LinkContest_GetBlockReceived(0))
|
||||
{
|
||||
memcpy(&gRngValue, gBlockRecvBuffer[0], sizeof(gRngValue));
|
||||
memcpy(&gContestRngValue, gBlockRecvBuffer[0], sizeof(gContestRngValue));
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].tState = 0;
|
||||
SwitchTaskToFollowupFunc(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80FC894(u8 taskId)
|
||||
void Task_LinkContest_CommunicateCategoryRS(u8 taskId)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!sub_80FC670(&gTasks[taskId].data[12]))
|
||||
if (!LinkContest_TryLinkStandby(&gTasks[taskId].tStandbyState))
|
||||
return;
|
||||
|
||||
switch (gTasks[taskId].data[0])
|
||||
switch (gTasks[taskId].tState)
|
||||
{
|
||||
case 0:
|
||||
gBlockSendBuffer[0] = gTasks[taskId].data[9];
|
||||
gBlockSendBuffer[0] = gTasks[taskId].tCategory;
|
||||
if (GetMultiplayerId() == 0)
|
||||
{
|
||||
if (IsLinkTaskFinished())
|
||||
gTasks[taskId].data[0] = 10;
|
||||
gTasks[taskId].tState = 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sub_80FC55C())
|
||||
if (LinkContest_GetBlockReceivedFromAllPlayers())
|
||||
{
|
||||
for (i = 0; i < gNumLinkContestPlayers; i++)
|
||||
gTasks[taskId].data[i + 1] = gBlockRecvBuffer[i][0];
|
||||
gTasks[taskId].tCategories(i) = gBlockRecvBuffer[i][0];
|
||||
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
if (++gTasks[taskId].data[11] > 10)
|
||||
if (++gTasks[taskId].tTimer > 10)
|
||||
{
|
||||
sub_800A4D8(2);
|
||||
gTasks[taskId].data[0] = 1;
|
||||
SendBlockRequest(2);
|
||||
gTasks[taskId].tState = 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].data[11] = 0;
|
||||
gTasks[taskId].data[12] = 0;
|
||||
gTasks[taskId].tState = 0;
|
||||
gTasks[taskId].tTimer = 0;
|
||||
gTasks[taskId].tStandbyState = 0;
|
||||
SwitchTaskToFollowupFunc(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80FC998(u8 taskId)
|
||||
void Task_LinkContest_CommunicateMonIdxs(u8 taskId)
|
||||
{
|
||||
switch (gTasks[taskId].data[0])
|
||||
switch (gTasks[taskId].tState)
|
||||
{
|
||||
case 0:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
if (sub_80FC4F4(&gContestPlayerMonIndex, sizeof(gContestPlayerMonIndex)) == TRUE)
|
||||
gTasks[taskId].data[0]++;
|
||||
if (LinkContest_SendBlock(&gContestPlayerMonIndex, sizeof(gContestPlayerMonIndex)) == TRUE)
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sub_80FC55C())
|
||||
gTasks[taskId].data[0]++;
|
||||
if (LinkContest_GetBlockReceivedFromAllPlayers())
|
||||
gTasks[taskId].tState++;
|
||||
break;
|
||||
default:
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].tState = 0;
|
||||
SwitchTaskToFollowupFunc(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80FC9F8(u8 taskId)
|
||||
void Task_LinkContest_CommunicateMoveSelections(u8 taskId)
|
||||
{
|
||||
int i;
|
||||
|
||||
switch (gTasks[taskId].data[0])
|
||||
switch (gTasks[taskId].tState)
|
||||
{
|
||||
case 0:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
if (sub_80FC4F4(&eContestantStatus[gContestPlayerMonIndex].currMove, sizeof(eContestantStatus[gContestPlayerMonIndex].currMove)) == TRUE)
|
||||
gTasks[taskId].data[0]++;
|
||||
// Send player's move selection
|
||||
if (LinkContest_SendBlock(&eContestantStatus[gContestPlayerMonIndex].currMove, sizeof(eContestantStatus[gContestPlayerMonIndex].currMove)) == TRUE)
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sub_80FC55C())
|
||||
if (LinkContest_GetBlockReceivedFromAllPlayers())
|
||||
{
|
||||
// Receive partners' move selections
|
||||
for (i = 0; i < gNumLinkContestPlayers; i++)
|
||||
eContestantStatus[i].currMove = gBlockRecvBuffer[i][0];
|
||||
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].tState = 0;
|
||||
SwitchTaskToFollowupFunc(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80FCACC(u8 taskId)
|
||||
void Task_LinkContest_CommunicateFinalStandings(u8 taskId)
|
||||
{
|
||||
switch (gTasks[taskId].data[0])
|
||||
switch (gTasks[taskId].tState)
|
||||
{
|
||||
case 0:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
if (sub_80FC4F4(gContestMonTotalPoints, sizeof(gContestMonTotalPoints)) == 1)
|
||||
gTasks[taskId].data[0]++;
|
||||
if (LinkContest_SendBlock(gContestMonTotalPoints, sizeof(gContestMonTotalPoints)) == 1)
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sub_80FC55C())
|
||||
if (LinkContest_GetBlockReceivedFromAllPlayers())
|
||||
{
|
||||
memcpy(gContestMonTotalPoints, gBlockRecvBuffer[gUnknown_02039F2B], sizeof(gContestMonTotalPoints));
|
||||
gTasks[taskId].data[0]++;
|
||||
memcpy(gContestMonTotalPoints, gBlockRecvBuffer[gContestLinkLeaderIndex], sizeof(gContestMonTotalPoints));
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case 5:
|
||||
case 8:
|
||||
case 11:
|
||||
if (gTasks[taskId].data[1]++ > 10)
|
||||
if (gTasks[taskId].tDelayTimer++ > 10)
|
||||
{
|
||||
gTasks[taskId].data[1] = 0;
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tDelayTimer = 0;
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
if (sub_80FC4F4(gUnknown_02039F10, sizeof(gUnknown_02039F10)) == 1)
|
||||
gTasks[taskId].data[0]++;
|
||||
if (LinkContest_SendBlock(gContestMonAppealPointTotals, sizeof(gContestMonAppealPointTotals)) == 1)
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (sub_80FC55C())
|
||||
if (LinkContest_GetBlockReceivedFromAllPlayers())
|
||||
{
|
||||
memcpy(gUnknown_02039F10, gBlockRecvBuffer[gUnknown_02039F2B], sizeof(gUnknown_02039F10));
|
||||
gTasks[taskId].data[0]++;
|
||||
memcpy(gContestMonAppealPointTotals, gBlockRecvBuffer[gContestLinkLeaderIndex], sizeof(gContestMonAppealPointTotals));
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
if (sub_80FC4F4(gContestMonRound2Points, sizeof(gContestMonRound2Points)) == 1)
|
||||
gTasks[taskId].data[0]++;
|
||||
if (LinkContest_SendBlock(gContestMonRound2Points, sizeof(gContestMonRound2Points)) == 1)
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (sub_80FC55C())
|
||||
if (LinkContest_GetBlockReceivedFromAllPlayers())
|
||||
{
|
||||
memcpy(gContestMonRound2Points, gBlockRecvBuffer[gUnknown_02039F2B], sizeof(gContestMonRound2Points));
|
||||
gTasks[taskId].data[0]++;
|
||||
memcpy(gContestMonRound2Points, gBlockRecvBuffer[gContestLinkLeaderIndex], sizeof(gContestMonRound2Points));
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
if (sub_80FC4F4(gContestFinalStandings, sizeof(gContestFinalStandings)) == 1)
|
||||
gTasks[taskId].data[0]++;
|
||||
if (LinkContest_SendBlock(gContestFinalStandings, sizeof(gContestFinalStandings)) == 1)
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
if (sub_80FC55C())
|
||||
if (LinkContest_GetBlockReceivedFromAllPlayers())
|
||||
{
|
||||
memcpy(gContestFinalStandings, gBlockRecvBuffer[gUnknown_02039F2B], sizeof(gContestFinalStandings));
|
||||
gTasks[taskId].data[0]++;
|
||||
memcpy(gContestFinalStandings, gBlockRecvBuffer[gContestLinkLeaderIndex], sizeof(gContestFinalStandings));
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].tState = 0;
|
||||
SwitchTaskToFollowupFunc(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80FCC88(u8 taskId)
|
||||
void Task_LinkContest_CommunicateAppealsState(u8 taskId)
|
||||
{
|
||||
switch (gTasks[taskId].data[0])
|
||||
switch (gTasks[taskId].tState)
|
||||
{
|
||||
case 0:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
if (sub_80FC4F4(eContestantStatus, 4 * sizeof(struct ContestantStatus)) == 1)
|
||||
gTasks[taskId].data[0]++;
|
||||
if (LinkContest_SendBlock(eContestantStatus, CONTESTANT_COUNT * sizeof(struct ContestantStatus)) == 1)
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sub_80FC55C())
|
||||
if (LinkContest_GetBlockReceivedFromAllPlayers())
|
||||
{
|
||||
memcpy(eContestantStatus, gBlockRecvBuffer[gUnknown_02039F2B], 4 * sizeof(struct ContestantStatus));
|
||||
gTasks[taskId].data[0]++;
|
||||
memcpy(eContestantStatus, gBlockRecvBuffer[gContestLinkLeaderIndex], CONTESTANT_COUNT * sizeof(struct ContestantStatus));
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case 5:
|
||||
case 8:
|
||||
case 11:
|
||||
if (gTasks[taskId].data[1]++ > 10)
|
||||
if (gTasks[taskId].tDelayTimer++ > 10)
|
||||
{
|
||||
gTasks[taskId].data[1] = 0;
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tDelayTimer = 0;
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
if (sub_80FC4F4(gContestResources->field_8, sizeof(struct UnknownContestStruct7)) == 1)
|
||||
gTasks[taskId].data[0]++;
|
||||
if (LinkContest_SendBlock(gContestResources->appealResults, sizeof(struct ContestAppealMoveResults)) == 1)
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (sub_80FC55C())
|
||||
if (LinkContest_GetBlockReceivedFromAllPlayers())
|
||||
{
|
||||
memcpy(gContestResources->field_8, gBlockRecvBuffer[gUnknown_02039F2B], sizeof(struct UnknownContestStruct7));
|
||||
gTasks[taskId].data[0]++;
|
||||
memcpy(gContestResources->appealResults, gBlockRecvBuffer[gContestLinkLeaderIndex], sizeof(struct ContestAppealMoveResults));
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
if (sub_80FC4F4(gContestResources->field_10, sizeof(struct UnknownContestStruct5)) == 1)
|
||||
gTasks[taskId].data[0]++;
|
||||
if (LinkContest_SendBlock(gContestResources->excitement, sizeof(struct ContestExcitement)) == 1)
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (sub_80FC55C())
|
||||
if (LinkContest_GetBlockReceivedFromAllPlayers())
|
||||
{
|
||||
memcpy(gContestResources->field_10, gBlockRecvBuffer[gUnknown_02039F2B], sizeof(struct UnknownContestStruct5));
|
||||
gTasks[taskId].data[0]++;
|
||||
memcpy(gContestResources->excitement, gBlockRecvBuffer[gContestLinkLeaderIndex], sizeof(struct ContestExcitement));
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
if (sub_80FC4F4(gContestantTurnOrder, sizeof(gContestantTurnOrder)) == 1)
|
||||
gTasks[taskId].data[0]++;
|
||||
if (LinkContest_SendBlock(gContestantTurnOrder, sizeof(gContestantTurnOrder)) == 1)
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
if (sub_80FC55C())
|
||||
if (LinkContest_GetBlockReceivedFromAllPlayers())
|
||||
{
|
||||
memcpy(gContestantTurnOrder, gBlockRecvBuffer[gUnknown_02039F2B], sizeof(gContestantTurnOrder));
|
||||
gTasks[taskId].data[0]++;
|
||||
memcpy(gContestantTurnOrder, gBlockRecvBuffer[gContestLinkLeaderIndex], sizeof(gContestantTurnOrder));
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].tState = 0;
|
||||
SwitchTaskToFollowupFunc(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80FCE48(u8 taskId)
|
||||
void Task_LinkContest_CommunicateLeaderIdsRS(u8 taskId)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!sub_80FC670(&gTasks[taskId].data[12]))
|
||||
if (!LinkContest_TryLinkStandby(&gTasks[taskId].tStandbyState))
|
||||
return;
|
||||
|
||||
switch (gTasks[taskId].data[0])
|
||||
switch (gTasks[taskId].tState)
|
||||
{
|
||||
case 0:
|
||||
gBlockSendBuffer[0] = 0x6E;
|
||||
if (GetMultiplayerId() == 0)
|
||||
{
|
||||
if (IsLinkTaskFinished())
|
||||
gTasks[taskId].data[0] = 10;
|
||||
gTasks[taskId].tState = 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sub_80FC55C())
|
||||
if (LinkContest_GetBlockReceivedFromAllPlayers())
|
||||
{
|
||||
for (i = 0; i < 4; i++)
|
||||
gTasks[taskId].data[i + 5] = gBlockRecvBuffer[i][0];
|
||||
for (i = 0; i < CONTESTANT_COUNT; i++)
|
||||
gTasks[taskId].tLeaderIds(i) = gBlockRecvBuffer[i][0];
|
||||
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
if (++gTasks[taskId].data[11] > 10)
|
||||
if (++gTasks[taskId].tTimer > 10)
|
||||
{
|
||||
sub_800A4D8(2);
|
||||
gTasks[taskId].data[0] = 1;
|
||||
SendBlockRequest(2);
|
||||
gTasks[taskId].tState = 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].data[11] = 0;
|
||||
gTasks[taskId].data[12] = 0;
|
||||
gTasks[taskId].tState = 0;
|
||||
gTasks[taskId].tTimer = 0;
|
||||
gTasks[taskId].tStandbyState = 0;
|
||||
SwitchTaskToFollowupFunc(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80FCF40(u8 taskId)
|
||||
void Task_LinkContest_CommunicateRound1Points(u8 taskId)
|
||||
{
|
||||
if (!sub_80FC670(&gTasks[taskId].data[12]))
|
||||
if (!LinkContest_TryLinkStandby(&gTasks[taskId].tStandbyState))
|
||||
return;
|
||||
|
||||
switch (gTasks[taskId].data[0])
|
||||
switch (gTasks[taskId].tState)
|
||||
{
|
||||
case 0:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
if (sub_80FC4F4(gContestMonConditions, sizeof(gContestMonConditions)) == 1)
|
||||
gTasks[taskId].data[0]++;
|
||||
if (LinkContest_SendBlock(gContestMonRound1Points, sizeof(gContestMonRound1Points)) == 1)
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sub_80FC55C())
|
||||
if (LinkContest_GetBlockReceivedFromAllPlayers())
|
||||
{
|
||||
memcpy(gContestMonConditions, gBlockRecvBuffer[gUnknown_02039F2B], sizeof(gContestMonConditions));
|
||||
gTasks[taskId].data[0]++;
|
||||
memcpy(gContestMonRound1Points, gBlockRecvBuffer[gContestLinkLeaderIndex], sizeof(gContestMonRound1Points));
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].data[12] = 0;
|
||||
gTasks[taskId].tState = 0;
|
||||
gTasks[taskId].tStandbyState = 0;
|
||||
SwitchTaskToFollowupFunc(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80FCFD0(u8 taskId)
|
||||
void Task_LinkContest_CommunicateTurnOrder(u8 taskId)
|
||||
{
|
||||
if (!sub_80FC670(&gTasks[taskId].data[12]))
|
||||
if (!LinkContest_TryLinkStandby(&gTasks[taskId].tStandbyState))
|
||||
return;
|
||||
|
||||
switch (gTasks[taskId].data[0])
|
||||
switch (gTasks[taskId].tState)
|
||||
{
|
||||
case 0:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
if (sub_80FC4F4(gContestantTurnOrder, sizeof(gContestantTurnOrder)) == 1)
|
||||
gTasks[taskId].data[0]++;
|
||||
if (LinkContest_SendBlock(gContestantTurnOrder, sizeof(gContestantTurnOrder)) == 1)
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sub_80FC55C())
|
||||
if (LinkContest_GetBlockReceivedFromAllPlayers())
|
||||
{
|
||||
memcpy(gContestantTurnOrder, gBlockRecvBuffer[gUnknown_02039F2B], sizeof(gContestantTurnOrder));
|
||||
gTasks[taskId].data[0]++;
|
||||
memcpy(gContestantTurnOrder, gBlockRecvBuffer[gContestLinkLeaderIndex], sizeof(gContestantTurnOrder));
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].data[12] = 0;
|
||||
gTasks[taskId].tState = 0;
|
||||
gTasks[taskId].tStandbyState = 0;
|
||||
SwitchTaskToFollowupFunc(taskId);
|
||||
break;
|
||||
}
|
||||
|
||||
+105
-92
@@ -1,148 +1,158 @@
|
||||
#include "global.h"
|
||||
#include "contest.h"
|
||||
#include "contest_link.h"
|
||||
#include "event_data.h"
|
||||
#include "link.h"
|
||||
#include "random.h"
|
||||
#include "task.h"
|
||||
|
||||
static void sub_81D9F14(u8);
|
||||
static void sub_81D9F30(u8);
|
||||
static void sub_81D9F4C(u8);
|
||||
static void sub_81D9F68(u8);
|
||||
static void sub_81DA10C(u8);
|
||||
static void sub_81DA138(u8);
|
||||
static void sub_81DA160(u8);
|
||||
static void sub_81DA244(u8);
|
||||
static void sub_81DA2E8(u8);
|
||||
static void sub_81DA3B8(u8);
|
||||
static void sub_81DA488(u8);
|
||||
/*
|
||||
The functions in this file handle preliminary communication
|
||||
for Emerald-only link contests. If the link contest has an RS
|
||||
player linked, none of these functions are used.
|
||||
|
||||
void sub_81D9DE4(u8 taskId)
|
||||
The equivalent functions for RS-linked contests are spread
|
||||
between contest_link.c and contest_util.c, and are suffixed RS
|
||||
instead of Em
|
||||
*/
|
||||
|
||||
static void Task_LinkContest_CommunicateMonsEm(u8);
|
||||
static void Task_LinkContest_StartCommunicateRngEm(u8);
|
||||
static void Task_LinkContest_CommunicateRngEm(u8);
|
||||
static void Task_LinkContest_StartCommunicateLeaderIdsEm(u8);
|
||||
static void Task_LinkContest_CommunicateLeaderIdsEm(u8);
|
||||
static void Task_LinkContest_StartCommunicateCategoryEm(u8);
|
||||
static void Task_LinkContest_CommunicateCategoryEm(u8);
|
||||
static void Task_LinkContest_SetUpContestEm(u8);
|
||||
static void Task_LinkContest_CommunicateAIMonsEm(u8);
|
||||
static void Task_LinkContest_CalculateRound1Em(u8);
|
||||
static void Task_LinkContest_CalculateTurnOrderEm(u8);
|
||||
|
||||
#define tCategory data[9]
|
||||
|
||||
void Task_LinkContest_StartCommunicationEm(u8 taskId)
|
||||
{
|
||||
int gameCleared;
|
||||
|
||||
switch (gTasks[taskId].data[9])
|
||||
switch (gTasks[taskId].tCategory)
|
||||
{
|
||||
case 0:
|
||||
case CONTEST_CATEGORY_COOL:
|
||||
gHighestRibbonRank = GetMonData(&gPlayerParty[gContestMonPartyIndex], MON_DATA_COOL_RIBBON);
|
||||
break;
|
||||
case 1:
|
||||
case CONTEST_CATEGORY_BEAUTY:
|
||||
gHighestRibbonRank = GetMonData(&gPlayerParty[gContestMonPartyIndex], MON_DATA_BEAUTY_RIBBON);
|
||||
break;
|
||||
case 2:
|
||||
case CONTEST_CATEGORY_CUTE:
|
||||
gHighestRibbonRank = GetMonData(&gPlayerParty[gContestMonPartyIndex], MON_DATA_CUTE_RIBBON);
|
||||
break;
|
||||
case 3:
|
||||
case CONTEST_CATEGORY_SMART:
|
||||
gHighestRibbonRank = GetMonData(&gPlayerParty[gContestMonPartyIndex], MON_DATA_SMART_RIBBON);
|
||||
break;
|
||||
case 4:
|
||||
case CONTEST_CATEGORY_TOUGH:
|
||||
default:
|
||||
gHighestRibbonRank = GetMonData(&gPlayerParty[gContestMonPartyIndex], MON_DATA_TOUGH_RIBBON);
|
||||
break;
|
||||
}
|
||||
|
||||
gContestMons[gContestPlayerMonIndex].unk2C[0] = gHighestRibbonRank;
|
||||
gContestMons[gContestPlayerMonIndex].highestRank = gHighestRibbonRank;
|
||||
gameCleared = FlagGet(FLAG_SYS_GAME_CLEAR) > 0;
|
||||
gContestMons[gContestPlayerMonIndex].unk2C[1] = gameCleared;
|
||||
SetTaskFuncWithFollowupFunc(taskId, sub_81DA160, sub_81D9F14);
|
||||
gContestMons[gContestPlayerMonIndex].gameCleared = gameCleared;
|
||||
SetTaskFuncWithFollowupFunc(taskId, Task_LinkContest_CommunicateMonsEm, Task_LinkContest_StartCommunicateRngEm);
|
||||
}
|
||||
|
||||
static void sub_81D9F14(u8 taskId)
|
||||
static void Task_LinkContest_StartCommunicateRngEm(u8 taskId)
|
||||
{
|
||||
SetTaskFuncWithFollowupFunc(taskId, sub_81DA244, sub_81D9F30);
|
||||
SetTaskFuncWithFollowupFunc(taskId, Task_LinkContest_CommunicateRngEm, Task_LinkContest_StartCommunicateLeaderIdsEm);
|
||||
}
|
||||
|
||||
static void sub_81D9F30(u8 taskId)
|
||||
static void Task_LinkContest_StartCommunicateLeaderIdsEm(u8 taskId)
|
||||
{
|
||||
SetTaskFuncWithFollowupFunc(taskId, sub_81DA2E8, sub_81D9F4C);
|
||||
SetTaskFuncWithFollowupFunc(taskId, Task_LinkContest_CommunicateLeaderIdsEm, Task_LinkContest_StartCommunicateCategoryEm);
|
||||
}
|
||||
|
||||
static void sub_81D9F4C(u8 taskId)
|
||||
static void Task_LinkContest_StartCommunicateCategoryEm(u8 taskId)
|
||||
{
|
||||
SetTaskFuncWithFollowupFunc(taskId, sub_81DA3B8, sub_81D9F68);
|
||||
SetTaskFuncWithFollowupFunc(taskId, Task_LinkContest_CommunicateCategoryEm, Task_LinkContest_SetUpContestEm);
|
||||
}
|
||||
|
||||
static void sub_81D9F68(u8 taskId)
|
||||
static void Task_LinkContest_SetUpContestEm(u8 taskId)
|
||||
{
|
||||
u8 i;
|
||||
u8 rank;
|
||||
int gameCleared;
|
||||
u8 data1[4];
|
||||
u8 data2[4];
|
||||
u8 categories[CONTESTANT_COUNT];
|
||||
u8 leaderIds[CONTESTANT_COUNT];
|
||||
|
||||
memset(data1, 0, sizeof(data1));
|
||||
memset(data2, 0, sizeof(data2));
|
||||
memset(categories, 0, sizeof(categories));
|
||||
memset(leaderIds, 0, sizeof(leaderIds));
|
||||
|
||||
for (i = 0; i < gNumLinkContestPlayers; i++)
|
||||
data1[i] = gTasks[taskId].data[i + 1];
|
||||
categories[i] = gTasks[taskId].data[i + 1];
|
||||
|
||||
i = 0;
|
||||
if (i < gNumLinkContestPlayers)
|
||||
{
|
||||
while (++i < gNumLinkContestPlayers)
|
||||
{
|
||||
if (data1[0] != data1[i])
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Ensure all players are doing the same category
|
||||
for (i = 0; i < gNumLinkContestPlayers && categories[0] == categories[i]; i++)
|
||||
;
|
||||
|
||||
if (i == gNumLinkContestPlayers)
|
||||
gSpecialVar_0x8004 = 0;
|
||||
gSpecialVar_0x8004 = FALSE; // Category choices the same
|
||||
else
|
||||
gSpecialVar_0x8004 = 1;
|
||||
gSpecialVar_0x8004 = TRUE; // Category choices differ
|
||||
|
||||
for (i = 0; i < gNumLinkContestPlayers; i++)
|
||||
data2[i] = gTasks[taskId].data[i + 5];
|
||||
leaderIds[i] = gTasks[taskId].data[i + 5];
|
||||
|
||||
if (gNumLinkContestPlayers != 4 && GetMultiplayerId() == 0)
|
||||
// If < 4 players and player is leader, set AI contestants based on rank and game clear
|
||||
if (gNumLinkContestPlayers != CONTESTANT_COUNT && GetMultiplayerId() == 0)
|
||||
{
|
||||
rank = gContestMons[0].unk2C[0];
|
||||
rank = gContestMons[0].highestRank;
|
||||
for (i = 1; i < gNumLinkContestPlayers; i++)
|
||||
{
|
||||
if (rank < gContestMons[i].unk2C[0])
|
||||
rank = gContestMons[i].unk2C[0];
|
||||
if (rank < gContestMons[i].highestRank)
|
||||
rank = gContestMons[i].highestRank;
|
||||
}
|
||||
|
||||
if (rank)
|
||||
rank--;
|
||||
|
||||
gameCleared = 1;
|
||||
gameCleared = TRUE;
|
||||
for (i = 0; i < gNumLinkContestPlayers; i++)
|
||||
{
|
||||
if (!gContestMons[i].unk2C[1])
|
||||
if (!gContestMons[i].gameCleared)
|
||||
{
|
||||
gameCleared = 0;
|
||||
gameCleared = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sub_80DACBC(data1[0], rank, gameCleared);
|
||||
SetLinkAIContestants(categories[0], rank, gameCleared);
|
||||
}
|
||||
|
||||
gUnknown_02039F2B = sub_80F86E0(data2);
|
||||
if (gNumLinkContestPlayers < 4)
|
||||
SetTaskFuncWithFollowupFunc(taskId, sub_81DA488, sub_81DA10C);
|
||||
// Assign link leader. After initial communication all players will read data only from them
|
||||
gContestLinkLeaderIndex = LinkContest_GetLeaderIndex(leaderIds);
|
||||
|
||||
if (gNumLinkContestPlayers < CONTESTANT_COUNT)
|
||||
SetTaskFuncWithFollowupFunc(taskId, Task_LinkContest_CommunicateAIMonsEm, Task_LinkContest_CalculateRound1Em);
|
||||
else
|
||||
gTasks[taskId].func = sub_81DA10C;
|
||||
gTasks[taskId].func = Task_LinkContest_CalculateRound1Em;
|
||||
}
|
||||
|
||||
static void sub_81DA10C(u8 taskId)
|
||||
static void Task_LinkContest_CalculateRound1Em(u8 taskId)
|
||||
{
|
||||
sub_80DB09C(gSpecialVar_ContestCategory);
|
||||
SetTaskFuncWithFollowupFunc(taskId, sub_80FCF40, sub_81DA138);
|
||||
CalculateRound1Points(gSpecialVar_ContestCategory);
|
||||
SetTaskFuncWithFollowupFunc(taskId, Task_LinkContest_CommunicateRound1Points, Task_LinkContest_CalculateTurnOrderEm);
|
||||
}
|
||||
|
||||
static void sub_81DA138(u8 taskId)
|
||||
static void Task_LinkContest_CalculateTurnOrderEm(u8 taskId)
|
||||
{
|
||||
SortContestants(FALSE);
|
||||
SetTaskFuncWithFollowupFunc(taskId, sub_80FCFD0, sub_80F8714);
|
||||
SetTaskFuncWithFollowupFunc(taskId, Task_LinkContest_CommunicateTurnOrder, Task_LinkContest_FinalizeConnection);
|
||||
}
|
||||
|
||||
static void sub_81DA160(u8 taskId)
|
||||
static void Task_LinkContest_CommunicateMonsEm(u8 taskId)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!sub_80FC670(&gTasks[taskId].data[12]))
|
||||
if (!LinkContest_TryLinkStandby(&gTasks[taskId].data[12]))
|
||||
return;
|
||||
|
||||
switch (gTasks[taskId].data[0])
|
||||
@@ -155,17 +165,17 @@ static void sub_81DA160(u8 taskId)
|
||||
case 0:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
if (sub_80FC4F4(&gContestMons[gContestPlayerMonIndex], sizeof(struct ContestPokemon)) == 1)
|
||||
if (LinkContest_SendBlock(&gContestMons[gContestPlayerMonIndex], sizeof(struct ContestPokemon)) == 1)
|
||||
gTasks[taskId].data[0]++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sub_80FC55C())
|
||||
if (LinkContest_GetBlockReceivedFromAllPlayers())
|
||||
{
|
||||
for (i = 0; i < gNumLinkContestPlayers; i++)
|
||||
{
|
||||
memcpy(&gContestMons[i], gBlockRecvBuffer[i], sizeof(struct ContestPokemon));
|
||||
sub_80DFA08(&gContestMons[i], gLinkPlayers[i].language);
|
||||
StripPlayerAndMonNamesForLinkContest(&gContestMons[i], gLinkPlayers[i].language);
|
||||
}
|
||||
|
||||
gTasks[taskId].data[0]++;
|
||||
@@ -174,9 +184,9 @@ static void sub_81DA160(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_81DA244(u8 taskId)
|
||||
static void Task_LinkContest_CommunicateRngEm(u8 taskId)
|
||||
{
|
||||
if (!sub_80FC670(&gTasks[taskId].data[12]))
|
||||
if (!LinkContest_TryLinkStandby(&gTasks[taskId].data[12]))
|
||||
return;
|
||||
|
||||
switch (gTasks[taskId].data[0])
|
||||
@@ -189,19 +199,22 @@ static void sub_81DA244(u8 taskId)
|
||||
case 0:
|
||||
if (GetMultiplayerId() == 0)
|
||||
{
|
||||
// Only the leader sends the RNG seed
|
||||
if (!IsLinkTaskFinished())
|
||||
return;
|
||||
|
||||
if (sub_80FC4F4(&gRngValue, sizeof(gRngValue)) == 1)
|
||||
if (LinkContest_SendBlock(&gRngValue, sizeof(gRngValue)) == 1)
|
||||
gTasks[taskId].data[0]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Other link members skip to waiting
|
||||
gTasks[taskId].data[0]++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sub_80FC530(0))
|
||||
// Wait to receive RNG data
|
||||
if (LinkContest_GetBlockReceived(0))
|
||||
{
|
||||
memcpy(&gRngValue, gBlockRecvBuffer[0], sizeof(gRngValue));
|
||||
memcpy(&gContestRngValue, gBlockRecvBuffer[0], sizeof(gContestRngValue));
|
||||
@@ -211,13 +224,13 @@ static void sub_81DA244(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_81DA2E8(u8 taskId)
|
||||
static void Task_LinkContest_CommunicateLeaderIdsEm(u8 taskId)
|
||||
{
|
||||
int i;
|
||||
u16 data[4];
|
||||
u16 var0;
|
||||
u16 data[CONTESTANT_COUNT];
|
||||
u16 leaderId;
|
||||
|
||||
if (!sub_80FC670(&gTasks[taskId].data[12]))
|
||||
if (!LinkContest_TryLinkStandby(&gTasks[taskId].data[12]))
|
||||
return;
|
||||
|
||||
switch (gTasks[taskId].data[0])
|
||||
@@ -230,13 +243,13 @@ static void sub_81DA2E8(u8 taskId)
|
||||
case 0:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
var0 = 0x6E;
|
||||
if (sub_80FC4F4(&var0, sizeof(var0)) == 1)
|
||||
leaderId = 0x6E;
|
||||
if (LinkContest_SendBlock(&leaderId, sizeof(leaderId)) == 1)
|
||||
gTasks[taskId].data[0]++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sub_80FC55C())
|
||||
if (LinkContest_GetBlockReceivedFromAllPlayers())
|
||||
{
|
||||
for (i = 0; i < gNumLinkContestPlayers; i++)
|
||||
{
|
||||
@@ -250,13 +263,13 @@ static void sub_81DA2E8(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_81DA3B8(u8 taskId)
|
||||
static void Task_LinkContest_CommunicateCategoryEm(u8 taskId)
|
||||
{
|
||||
int i;
|
||||
u16 data[4];
|
||||
u16 var0;
|
||||
u16 data[CONTESTANT_COUNT];
|
||||
u16 category;
|
||||
|
||||
if (!sub_80FC670(&gTasks[taskId].data[12]))
|
||||
if (!LinkContest_TryLinkStandby(&gTasks[taskId].data[12]))
|
||||
return;
|
||||
|
||||
switch (gTasks[taskId].data[0])
|
||||
@@ -269,13 +282,13 @@ static void sub_81DA3B8(u8 taskId)
|
||||
case 0:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
var0 = gTasks[taskId].data[9];
|
||||
if (sub_80FC4F4(&var0, sizeof(var0)) == 1)
|
||||
category = gTasks[taskId].tCategory;
|
||||
if (LinkContest_SendBlock(&category, sizeof(category)) == 1)
|
||||
gTasks[taskId].data[0]++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sub_80FC55C())
|
||||
if (LinkContest_GetBlockReceivedFromAllPlayers())
|
||||
{
|
||||
for (i = 0; i < gNumLinkContestPlayers; i++)
|
||||
{
|
||||
@@ -289,11 +302,11 @@ static void sub_81DA3B8(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_81DA488(u8 taskId)
|
||||
static void Task_LinkContest_CommunicateAIMonsEm(u8 taskId)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!sub_80FC670(&gTasks[taskId].data[12]))
|
||||
if (!LinkContest_TryLinkStandby(&gTasks[taskId].data[12]))
|
||||
return;
|
||||
|
||||
switch (gTasks[taskId].data[0])
|
||||
@@ -309,7 +322,7 @@ static void sub_81DA488(u8 taskId)
|
||||
if (!IsLinkTaskFinished())
|
||||
return;
|
||||
|
||||
if (sub_80FC4F4(&gContestMons[gNumLinkContestPlayers], (4 - gNumLinkContestPlayers) * sizeof(struct ContestPokemon)) == 1)
|
||||
if (LinkContest_SendBlock(&gContestMons[gNumLinkContestPlayers], (CONTESTANT_COUNT - gNumLinkContestPlayers) * sizeof(struct ContestPokemon)) == 1)
|
||||
gTasks[taskId].data[0]++;
|
||||
}
|
||||
else
|
||||
@@ -318,11 +331,11 @@ static void sub_81DA488(u8 taskId)
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sub_80FC530(0))
|
||||
if (LinkContest_GetBlockReceived(0))
|
||||
{
|
||||
memcpy(&gContestMons[gNumLinkContestPlayers], gBlockRecvBuffer[0], (4 - gNumLinkContestPlayers) * sizeof(struct ContestPokemon));
|
||||
for (i = gNumLinkContestPlayers; i < 4; i++)
|
||||
sub_80DFA08(&gContestMons[i], gLinkPlayers[0].language);
|
||||
memcpy(&gContestMons[gNumLinkContestPlayers], gBlockRecvBuffer[0], (CONTESTANT_COUNT - gNumLinkContestPlayers) * sizeof(struct ContestPokemon));
|
||||
for (i = gNumLinkContestPlayers; i < CONTESTANT_COUNT; i++)
|
||||
StripPlayerAndMonNamesForLinkContest(&gContestMons[i], gLinkPlayers[0].language);
|
||||
|
||||
gTasks[taskId].data[0]++;
|
||||
}
|
||||
|
||||
+5
-111
@@ -384,8 +384,6 @@ static void InitContestMonPixels(u16 species, u8 whichSprite)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NONMATCHING
|
||||
// functionally equivalent.
|
||||
static void _InitContestMonPixels(u8 *spriteGfx, u16 *palette, u16 (*destPixels)[64][64])
|
||||
{
|
||||
u16 tileY, tileX, pixelY, pixelX;
|
||||
@@ -399,125 +397,21 @@ static void _InitContestMonPixels(u8 *spriteGfx, u16 *palette, u16 (*destPixels)
|
||||
{
|
||||
for (pixelX = 0; pixelX < 8; pixelX++)
|
||||
{
|
||||
int offset = 32 * (8 * tileY + tileX) + (pixelY * 4 + pixelX / 2);
|
||||
colorIndex = spriteGfx[offset];
|
||||
colorIndex = spriteGfx[((tileY * 8) + tileX) * 32 + (pixelY << 2) + (pixelX >> 1)];
|
||||
if (pixelX & 1)
|
||||
colorIndex >>= 4;
|
||||
else
|
||||
colorIndex &= 0xF;
|
||||
colorIndex &= 0xF; // %=16 works here too. Both match
|
||||
|
||||
if (colorIndex == 0) // transparent pixel
|
||||
(*destPixels)[8 * tileY + pixelY][tileX * 8 + pixelX] = 0x8000;
|
||||
if (colorIndex == 0) // transparent pixel
|
||||
(*destPixels)[tileY * 8 + pixelY][tileX * 8 + pixelX] = 0x8000;
|
||||
else
|
||||
(*destPixels)[8 * tileY + pixelY][tileX * 8 + pixelX] = palette[colorIndex];
|
||||
(*destPixels)[tileY * 8 + pixelY][tileX * 8 + pixelX] = palette[colorIndex];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
static void _InitContestMonPixels(u8 *spriteGfx, u16 *palette, u16 (*destPixels)[64][64])
|
||||
{
|
||||
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, 0xC\n\
|
||||
mov r10, r0\n\
|
||||
mov r9, r1\n\
|
||||
str r2, [sp]\n\
|
||||
movs r0, 0\n\
|
||||
_08130394:\n\
|
||||
movs r3, 0\n\
|
||||
adds r1, r0, 0x1\n\
|
||||
str r1, [sp, 0x4]\n\
|
||||
lsls r0, 3\n\
|
||||
str r0, [sp, 0x8]\n\
|
||||
_0813039E:\n\
|
||||
movs r1, 0\n\
|
||||
adds r2, r3, 0x1\n\
|
||||
mov r8, r2\n\
|
||||
ldr r7, [sp, 0x8]\n\
|
||||
adds r0, r7, r3\n\
|
||||
lsls r0, 5\n\
|
||||
mov r12, r0\n\
|
||||
lsls r4, r3, 3\n\
|
||||
_081303AE:\n\
|
||||
movs r3, 0\n\
|
||||
lsls r0, r1, 2\n\
|
||||
adds r6, r1, 0x1\n\
|
||||
mov r2, r12\n\
|
||||
adds r5, r2, r0\n\
|
||||
ldr r7, [sp, 0x8]\n\
|
||||
adds r0, r7, r1\n\
|
||||
lsls r0, 7\n\
|
||||
ldr r1, [sp]\n\
|
||||
adds r2, r0, r1\n\
|
||||
_081303C2:\n\
|
||||
lsrs r0, r3, 1\n\
|
||||
adds r0, r5, r0\n\
|
||||
add r0, r10\n\
|
||||
ldrb r1, [r0]\n\
|
||||
movs r0, 0x1\n\
|
||||
ands r0, r3\n\
|
||||
cmp r0, 0\n\
|
||||
beq _081303D6\n\
|
||||
lsrs r1, 4\n\
|
||||
b _081303DA\n\
|
||||
_081303D6:\n\
|
||||
movs r0, 0xF\n\
|
||||
ands r1, r0\n\
|
||||
_081303DA:\n\
|
||||
cmp r1, 0\n\
|
||||
bne _081303EC\n\
|
||||
adds r0, r4, r3\n\
|
||||
lsls r0, 1\n\
|
||||
adds r0, r2\n\
|
||||
movs r7, 0x80\n\
|
||||
lsls r7, 8\n\
|
||||
adds r1, r7, 0\n\
|
||||
b _081303F8\n\
|
||||
_081303EC:\n\
|
||||
adds r0, r4, r3\n\
|
||||
lsls r0, 1\n\
|
||||
adds r0, r2\n\
|
||||
lsls r1, 1\n\
|
||||
add r1, r9\n\
|
||||
ldrh r1, [r1]\n\
|
||||
_081303F8:\n\
|
||||
strh r1, [r0]\n\
|
||||
adds r0, r3, 0x1\n\
|
||||
lsls r0, 16\n\
|
||||
lsrs r3, r0, 16\n\
|
||||
cmp r3, 0x7\n\
|
||||
bls _081303C2\n\
|
||||
lsls r0, r6, 16\n\
|
||||
lsrs r1, r0, 16\n\
|
||||
cmp r1, 0x7\n\
|
||||
bls _081303AE\n\
|
||||
mov r1, r8\n\
|
||||
lsls r0, r1, 16\n\
|
||||
lsrs r3, r0, 16\n\
|
||||
cmp r3, 0x7\n\
|
||||
bls _0813039E\n\
|
||||
ldr r2, [sp, 0x4]\n\
|
||||
lsls r0, r2, 16\n\
|
||||
lsrs r0, 16\n\
|
||||
cmp r0, 0x7\n\
|
||||
bls _08130394\n\
|
||||
add sp, 0xC\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");
|
||||
}
|
||||
#endif
|
||||
|
||||
#define VRAM_PICTURE_DATA(x, y) (((u16 *)(BG_SCREEN_ADDR(12)))[(y) * 32 + (x)])
|
||||
|
||||
|
||||
+558
-72
@@ -6,10 +6,12 @@
|
||||
#include "contest.h"
|
||||
#include "contest_util.h"
|
||||
#include "contest_link.h"
|
||||
#include "contest_painting.h"
|
||||
#include "data.h"
|
||||
#include "decompress.h"
|
||||
#include "dma3.h"
|
||||
#include "event_data.h"
|
||||
#include "event_object_movement.h"
|
||||
#include "field_specials.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "graphics.h"
|
||||
@@ -27,6 +29,7 @@
|
||||
#include "save.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "script.h"
|
||||
#include "script_menu.h"
|
||||
#include "sound.h"
|
||||
#include "string_util.h"
|
||||
#include "strings.h"
|
||||
@@ -36,6 +39,7 @@
|
||||
#include "tv.h"
|
||||
#include "util.h"
|
||||
#include "window.h"
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/field_specials.h"
|
||||
#include "constants/game_stat.h"
|
||||
#include "constants/rgb.h"
|
||||
@@ -117,8 +121,8 @@ static void CB2_ShowContestResults(void);
|
||||
static void VBlankCB_ShowContestResults(void);
|
||||
static void Task_SlideContestResultsBg(u8);
|
||||
static void Task_WaitForLinkPartnersBeforeResults(u8);
|
||||
static void sub_80F5F14(u8);
|
||||
static void sub_80F5F30(u8);
|
||||
static void Task_CommunicateMonIdxsForResults(u8);
|
||||
static void Task_WaitForLinkPartnerMonIdxs(u8);
|
||||
static void Task_AnnouncePreliminaryResults(u8);
|
||||
static void Task_FlashStarsAndHearts(u8);
|
||||
static void Task_ShowPreliminaryResults(u8);
|
||||
@@ -150,15 +154,22 @@ static void Task_CreateConfetti(u8);
|
||||
static void SpriteCB_TextBoxSlideIn(struct Sprite *);
|
||||
static void SpriteCB_TextBoxSlideOut(struct Sprite *);
|
||||
static void SpriteCB_EndTextBoxSlideIn(struct Sprite *);
|
||||
static void sub_80F8508(u8);
|
||||
static void sub_80F8568(u8);
|
||||
static void sub_80F8584(u8);
|
||||
static void sub_80F85A0(u8);
|
||||
static void sub_80F85BC(u8);
|
||||
static void sub_80F86B8(u8);
|
||||
static void sub_80F878C(u8);
|
||||
static void sub_80F87B4(u8);
|
||||
static void Task_StartCommunication(u8);
|
||||
static void Task_StartCommunicateRngRS(u8);
|
||||
static void Task_StartCommunicateLeaderIdsRS(u8);
|
||||
static void Task_StartCommunicateCategoryRS(u8);
|
||||
static void Task_LinkContest_SetUpContestRS(u8);
|
||||
static void Task_LinkContest_CalculateTurnOrderRS(u8);
|
||||
static void Task_LinkContest_Disconnect(u8);
|
||||
static void Task_LinkContest_WaitDisconnect(u8);
|
||||
static void SpriteCB_Confetti(struct Sprite *sprite);
|
||||
static void Task_ShowContestEntryMonPic(u8 taskId);
|
||||
static void Task_LinkContestWaitForConnection(u8 taskId);
|
||||
|
||||
extern const u16 gObjectEventPalette8[];
|
||||
extern const u16 gObjectEventPalette17[];
|
||||
extern const u16 gObjectEventPalette33[];
|
||||
extern const u16 gObjectEventPalette34[];
|
||||
|
||||
static const u16 sUnknown_0858D6B0[] = INCBIN_U16("graphics/unknown/unknown_58D6B0.gbapal");
|
||||
static const u8 sUnknown_0858D6D0[] = INCBIN_U8("graphics/unknown/unknown_58D6D0.4bpp");
|
||||
@@ -522,7 +533,7 @@ static void CB2_StartShowContestResults(void)
|
||||
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS)
|
||||
gPaletteFade.bufferTransferDisabled = TRUE;
|
||||
else
|
||||
PlayBGM(MUS_CON_K);
|
||||
PlayBGM(MUS_CONTEST_RESULTS);
|
||||
|
||||
SetVBlankCallback(VBlankCB_ShowContestResults);
|
||||
}
|
||||
@@ -601,14 +612,14 @@ static void Task_ShowContestResults(u8 taskId)
|
||||
case 2:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
sub_800ADF8();
|
||||
SetLinkStandbyCallback();
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
return;
|
||||
case 3:
|
||||
if (IsLinkTaskFinished() == TRUE)
|
||||
{
|
||||
PlayBGM(MUS_CON_K);
|
||||
PlayBGM(MUS_CONTEST_RESULTS);
|
||||
gPaletteFade.bufferTransferDisabled = FALSE;
|
||||
gTasks[taskId].tState++;
|
||||
break;
|
||||
@@ -645,17 +656,17 @@ static void Task_WaitForLinkPartnersBeforeResults(u8 taskId)
|
||||
{
|
||||
if (gReceivedRemoteLinkPlayers)
|
||||
{
|
||||
CreateTask(sub_80F5F14, 0);
|
||||
CreateTask(Task_CommunicateMonIdxsForResults, 0);
|
||||
gTasks[taskId].func = TaskDummy;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80F5F14(u8 taskId)
|
||||
static void Task_CommunicateMonIdxsForResults(u8 taskId)
|
||||
{
|
||||
SetTaskFuncWithFollowupFunc(taskId, sub_80FC998, sub_80F5F30);
|
||||
SetTaskFuncWithFollowupFunc(taskId, Task_LinkContest_CommunicateMonIdxs, Task_WaitForLinkPartnerMonIdxs);
|
||||
}
|
||||
|
||||
static void sub_80F5F30(u8 taskId)
|
||||
static void Task_WaitForLinkPartnerMonIdxs(u8 taskId)
|
||||
{
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
@@ -974,7 +985,7 @@ static void Task_TryDisconnectLinkPartners(u8 taskId)
|
||||
if (!gTasks[taskId].data[10])
|
||||
{
|
||||
ShowLinkResultsTextBox(gText_CommunicationStandby);
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
gTasks[taskId].func = Task_WaitForLinkPartnersDisconnect;
|
||||
}
|
||||
}
|
||||
@@ -1717,7 +1728,7 @@ static void LoadContestResultsTilemaps(void)
|
||||
// Represented on results board as stars
|
||||
static u8 GetNumPreliminaryPoints(u8 monIndex, bool8 capPoints)
|
||||
{
|
||||
u32 condition = gContestMonConditions[monIndex] << 16;
|
||||
u32 condition = gContestMonRound1Points[monIndex] << 16;
|
||||
u32 numStars = condition / 0x3F;
|
||||
|
||||
if (numStars & 0xFFFF)
|
||||
@@ -1785,7 +1796,7 @@ static void Task_DrawFinalStandingNumber(u8 taskId)
|
||||
WriteSequenceToBgTilemapBuffer(2, firstTileNum + 0x10, 1, gTasks[taskId].tMonIndex * 3 + 6, 2, 1, 17, 1);
|
||||
sContestResults->data->numStandingsPrinted++;
|
||||
DestroyTask(taskId);
|
||||
PlaySE(SE_JYUNI);
|
||||
PlaySE(SE_CONTEST_PLACE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1965,7 +1976,7 @@ static void CalculateContestantsResultData(void)
|
||||
|
||||
for (i = 0; i < CONTESTANT_COUNT; i++)
|
||||
{
|
||||
relativePoints = (gContestMonConditions[i] * 1000) / abs(highestPoints);
|
||||
relativePoints = (gContestMonRound1Points[i] * 1000) / abs(highestPoints);
|
||||
if (relativePoints % 10 > 4)
|
||||
relativePoints += 10;
|
||||
(*sContestResults->monResults)[i].relativePreliminaryPoints = relativePoints / 10;
|
||||
@@ -2205,8 +2216,8 @@ void TryEnterContestMon(void)
|
||||
// Nonzero eligibility can still be non-eligibile, if mon is fainted or egg
|
||||
if (eligibility)
|
||||
{
|
||||
sub_80DAB8C(gSpecialVar_ContestCategory, gSpecialVar_ContestRank);
|
||||
sub_80DB09C(gSpecialVar_ContestCategory);
|
||||
SetContestants(gSpecialVar_ContestCategory, gSpecialVar_ContestRank);
|
||||
CalculateRound1Points(gSpecialVar_ContestCategory);
|
||||
}
|
||||
|
||||
gSpecialVar_Result = eligibility;
|
||||
@@ -2323,7 +2334,7 @@ void GetContestMonConditionRanking(void)
|
||||
|
||||
for (i = 0, rank = 0; i < CONTESTANT_COUNT; i++)
|
||||
{
|
||||
if (gContestMonConditions[gSpecialVar_0x8006] < gContestMonConditions[i])
|
||||
if (gContestMonRound1Points[gSpecialVar_0x8006] < gContestMonRound1Points[i])
|
||||
rank++;
|
||||
}
|
||||
|
||||
@@ -2332,7 +2343,7 @@ void GetContestMonConditionRanking(void)
|
||||
|
||||
void GetContestMonCondition(void)
|
||||
{
|
||||
gSpecialVar_0x8004 = gContestMonConditions[gSpecialVar_0x8006];
|
||||
gSpecialVar_0x8004 = gContestMonRound1Points[gSpecialVar_0x8006];
|
||||
}
|
||||
|
||||
void GetContestWinnerId(void)
|
||||
@@ -2404,107 +2415,106 @@ void GetContestPlayerId(void)
|
||||
gSpecialVar_0x8004 = gContestPlayerMonIndex;
|
||||
}
|
||||
|
||||
void ContestLinkTransfer(u8 taskId)
|
||||
void ContestLinkTransfer(u8 category)
|
||||
{
|
||||
u8 newTaskId;
|
||||
ScriptContext2_Enable();
|
||||
newTaskId = CreateTask(sub_80FC580, 0);
|
||||
SetTaskFuncWithFollowupFunc(newTaskId, sub_80FC580, sub_80F8508);
|
||||
gTasks[newTaskId].data[9] = taskId;
|
||||
newTaskId = CreateTask(Task_LinkContest_Init, 0);
|
||||
SetTaskFuncWithFollowupFunc(newTaskId, Task_LinkContest_Init, Task_StartCommunication);
|
||||
gTasks[newTaskId].data[9] = category;
|
||||
}
|
||||
|
||||
static void sub_80F8508(u8 taskId)
|
||||
static void Task_StartCommunication(u8 taskId)
|
||||
{
|
||||
if (gLinkContestFlags & LINK_CONTEST_FLAG_HAS_RS_PLAYER)
|
||||
{
|
||||
sub_80DA8C8(gContestMonPartyIndex);
|
||||
SetTaskFuncWithFollowupFunc(taskId, sub_80FC6BC, sub_80F8568);
|
||||
CreateContestMonFromParty(gContestMonPartyIndex);
|
||||
SetTaskFuncWithFollowupFunc(taskId, Task_LinkContest_CommunicateMonsRS, Task_StartCommunicateRngRS);
|
||||
}
|
||||
else
|
||||
{
|
||||
sub_80DA8C8(gContestMonPartyIndex);
|
||||
gTasks[taskId].func = sub_81D9DE4;
|
||||
CreateContestMonFromParty(gContestMonPartyIndex);
|
||||
gTasks[taskId].func = Task_LinkContest_StartCommunicationEm;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80F8568(u8 taskId)
|
||||
static void Task_StartCommunicateRngRS(u8 taskId)
|
||||
{
|
||||
SetTaskFuncWithFollowupFunc(taskId, sub_80FC804, sub_80F8584);
|
||||
SetTaskFuncWithFollowupFunc(taskId, Task_LinkContest_CommunicateRngRS, Task_StartCommunicateLeaderIdsRS);
|
||||
}
|
||||
|
||||
static void sub_80F8584(u8 taskId)
|
||||
static void Task_StartCommunicateLeaderIdsRS(u8 taskId)
|
||||
{
|
||||
SetTaskFuncWithFollowupFunc(taskId, sub_80FCE48, sub_80F85A0);
|
||||
SetTaskFuncWithFollowupFunc(taskId, Task_LinkContest_CommunicateLeaderIdsRS, Task_StartCommunicateCategoryRS);
|
||||
}
|
||||
|
||||
static void sub_80F85A0(u8 taskId)
|
||||
static void Task_StartCommunicateCategoryRS(u8 taskId)
|
||||
{
|
||||
SetTaskFuncWithFollowupFunc(taskId, sub_80FC894, sub_80F85BC);
|
||||
SetTaskFuncWithFollowupFunc(taskId, Task_LinkContest_CommunicateCategoryRS, Task_LinkContest_SetUpContestRS);
|
||||
}
|
||||
|
||||
static void sub_80F85BC(u8 taskId)
|
||||
static void Task_LinkContest_SetUpContestRS(u8 taskId)
|
||||
{
|
||||
u8 i;
|
||||
u8 sp0[4];
|
||||
u8 sp4[4];
|
||||
u8 categories[CONTESTANT_COUNT];
|
||||
u8 leaderIds[CONTESTANT_COUNT];
|
||||
|
||||
memset(sp0, 0, sizeof(sp0));
|
||||
memset(sp4, 0, sizeof(sp4));
|
||||
memset(categories, 0, sizeof(categories));
|
||||
memset(leaderIds, 0, sizeof(leaderIds));
|
||||
|
||||
for (i = 0; i < gNumLinkContestPlayers; i++)
|
||||
sp0[i] = gTasks[taskId].data[i + 1];
|
||||
categories[i] = gTasks[taskId].data[i + 1];
|
||||
|
||||
for (i = 0; i < gNumLinkContestPlayers;)
|
||||
{
|
||||
i++;
|
||||
if (i >= gNumLinkContestPlayers || sp0[0] != sp0[i])
|
||||
break;
|
||||
}
|
||||
// Ensure all players are doing the same category
|
||||
for (i = 0; i < gNumLinkContestPlayers && categories[0] == categories[i]; i++)
|
||||
;
|
||||
|
||||
if (i == gNumLinkContestPlayers)
|
||||
gSpecialVar_0x8004 = 0;
|
||||
gSpecialVar_0x8004 = FALSE; // Category choices the same
|
||||
else
|
||||
gSpecialVar_0x8004 = 1;
|
||||
gSpecialVar_0x8004 = TRUE; // Category choices differ
|
||||
|
||||
for (i = 0; i < gNumLinkContestPlayers; i++)
|
||||
sp4[i] = gTasks[taskId].data[i + 5];
|
||||
leaderIds[i] = gTasks[taskId].data[i + 5];
|
||||
|
||||
gUnknown_02039F2B = sub_80F86E0(sp4);
|
||||
sub_80DB09C(gSpecialVar_ContestCategory);
|
||||
SetTaskFuncWithFollowupFunc(taskId, sub_80FCF40, sub_80F86B8);
|
||||
gContestLinkLeaderIndex = LinkContest_GetLeaderIndex(leaderIds);
|
||||
CalculateRound1Points(gSpecialVar_ContestCategory);
|
||||
SetTaskFuncWithFollowupFunc(taskId, Task_LinkContest_CommunicateRound1Points, Task_LinkContest_CalculateTurnOrderRS);
|
||||
}
|
||||
|
||||
static void sub_80F86B8(u8 taskId)
|
||||
static void Task_LinkContest_CalculateTurnOrderRS(u8 taskId)
|
||||
{
|
||||
SortContestants(FALSE);
|
||||
SetTaskFuncWithFollowupFunc(taskId, sub_80FCFD0, sub_80F8714);
|
||||
SetTaskFuncWithFollowupFunc(taskId, Task_LinkContest_CommunicateTurnOrder, Task_LinkContest_FinalizeConnection);
|
||||
}
|
||||
|
||||
u8 sub_80F86E0(u8 *arg0)
|
||||
u8 LinkContest_GetLeaderIndex(u8 *ids)
|
||||
{
|
||||
int i;
|
||||
u8 result = 0;
|
||||
u8 leaderIdx = 0;
|
||||
|
||||
for (i = 1; i < gNumLinkContestPlayers; i++)
|
||||
{
|
||||
if (arg0[result] < arg0[i])
|
||||
result = i;
|
||||
if (ids[leaderIdx] < ids[i])
|
||||
leaderIdx = i;
|
||||
}
|
||||
|
||||
return result;
|
||||
return leaderIdx;
|
||||
}
|
||||
|
||||
void sub_80F8714(u8 taskId)
|
||||
void Task_LinkContest_FinalizeConnection(u8 taskId)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (gSpecialVar_0x8004 == 1)
|
||||
if (gSpecialVar_0x8004 == TRUE)
|
||||
{
|
||||
// Link partner data doesn't agree, disconnect
|
||||
if (IsLinkTaskFinished())
|
||||
gTasks[taskId].func = sub_80F878C;
|
||||
gTasks[taskId].func = Task_LinkContest_Disconnect;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Succesfully connected
|
||||
for (i = 0; i < CONTESTANT_COUNT; i++)
|
||||
StringGetEnd10(gContestMons[i].nickname);
|
||||
|
||||
@@ -2515,13 +2525,13 @@ void sub_80F8714(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80F878C(u8 taskId)
|
||||
static void Task_LinkContest_Disconnect(u8 taskId)
|
||||
{
|
||||
sub_800AC34();
|
||||
gTasks[taskId].func = sub_80F87B4;
|
||||
SetCloseLinkCallback();
|
||||
gTasks[taskId].func = Task_LinkContest_WaitDisconnect;
|
||||
}
|
||||
|
||||
static void sub_80F87B4(u8 taskId)
|
||||
static void Task_LinkContest_WaitDisconnect(u8 taskId)
|
||||
{
|
||||
if (!gReceivedRemoteLinkPlayers)
|
||||
{
|
||||
@@ -2530,3 +2540,479 @@ static void sub_80F87B4(u8 taskId)
|
||||
EnableBothScriptContexts();
|
||||
}
|
||||
}
|
||||
|
||||
void SetContestTrainerGfxIds(void)
|
||||
{
|
||||
gSaveBlock1Ptr->vars[VAR_OBJ_GFX_ID_0 - VARS_START] = gContestMons[0].trainerGfxId;
|
||||
gSaveBlock1Ptr->vars[VAR_OBJ_GFX_ID_1 - VARS_START] = gContestMons[1].trainerGfxId;
|
||||
gSaveBlock1Ptr->vars[VAR_OBJ_GFX_ID_2 - VARS_START] = gContestMons[2].trainerGfxId;
|
||||
}
|
||||
|
||||
// Unused
|
||||
void sub_80F8814(void)
|
||||
{
|
||||
u16 var1;
|
||||
u8 var0 = gSpecialVar_0x8005;
|
||||
switch (var0)
|
||||
{
|
||||
case 0:
|
||||
var1 = 3;
|
||||
break;
|
||||
case 1:
|
||||
var1 = 4;
|
||||
break;
|
||||
case 2:
|
||||
var1 = 5;
|
||||
break;
|
||||
default:
|
||||
var1 = 100;
|
||||
break;
|
||||
}
|
||||
|
||||
gSpecialVar_0x8004 = var1;
|
||||
}
|
||||
|
||||
void BufferContestTrainerAndMonNames(void)
|
||||
{
|
||||
BufferContestantTrainerName();
|
||||
BufferContestantMonNickname();
|
||||
BufferContestantMonSpecies();
|
||||
}
|
||||
|
||||
// Unused
|
||||
void DoesContestCategoryHaveWinner(void)
|
||||
{
|
||||
int contestWinner;
|
||||
switch (gSpecialVar_ContestCategory)
|
||||
{
|
||||
case CONTEST_CATEGORY_COOL:
|
||||
contestWinner = 8;
|
||||
break;
|
||||
case CONTEST_CATEGORY_BEAUTY:
|
||||
contestWinner = 9;
|
||||
break;
|
||||
case CONTEST_CATEGORY_CUTE:
|
||||
contestWinner = 10;
|
||||
break;
|
||||
case CONTEST_CATEGORY_SMART:
|
||||
contestWinner = 11;
|
||||
break;
|
||||
case CONTEST_CATEGORY_TOUGH:
|
||||
default:
|
||||
contestWinner = 12;
|
||||
break;
|
||||
}
|
||||
|
||||
if (gSaveBlock1Ptr->contestWinners[contestWinner].species == SPECIES_NONE)
|
||||
gSpecialVar_0x8004 = FALSE;
|
||||
else
|
||||
gSpecialVar_0x8004 = TRUE;
|
||||
}
|
||||
|
||||
void SaveMuseumContestPainting(void)
|
||||
{
|
||||
sub_80DEDA8(0xFF);
|
||||
}
|
||||
|
||||
void ShouldReadyContestArtist(void)
|
||||
{
|
||||
if (gContestFinalStandings[gContestPlayerMonIndex] == 0
|
||||
&& gSpecialVar_ContestRank == CONTEST_RANK_MASTER
|
||||
&& gContestMonTotalPoints[gContestPlayerMonIndex] >= 800)
|
||||
{
|
||||
gSpecialVar_0x8004 = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
gSpecialVar_0x8004 = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
u8 CountPlayerContestPaintings(void)
|
||||
{
|
||||
int i;
|
||||
u8 count = 0;
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
if (gSaveBlock1Ptr->contestWinners[8 + i].species)
|
||||
count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
// Unused
|
||||
void sub_80F8970(void)
|
||||
{
|
||||
s16 conditions[CONTESTANT_COUNT];
|
||||
int i, j;
|
||||
s16 condition;
|
||||
s8 var0;
|
||||
u8 var2;
|
||||
u8 r8;
|
||||
u8 r7;
|
||||
|
||||
for (i = 0; i < CONTESTANT_COUNT; i++)
|
||||
conditions[i] = gContestMonRound1Points[i];
|
||||
|
||||
for (i = 0; i < CONTESTANT_COUNT - 1; i++)
|
||||
{
|
||||
for (j = CONTESTANT_COUNT - 1; j > i; j--)
|
||||
{
|
||||
if (conditions[j - 1] < conditions[j])
|
||||
{
|
||||
int temp;
|
||||
SWAP(conditions[j], conditions[j - 1], temp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
condition = conditions[gSpecialVar_0x8006];
|
||||
var0 = 0;
|
||||
r8 = 0;
|
||||
for (i = 0; i < CONTESTANT_COUNT; i++)
|
||||
{
|
||||
if (conditions[i] == condition)
|
||||
{
|
||||
var0++;
|
||||
if (i == gSpecialVar_0x8006)
|
||||
r8 = var0;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < CONTESTANT_COUNT; i++)
|
||||
{
|
||||
if (conditions[i] == condition)
|
||||
break;
|
||||
}
|
||||
|
||||
r7 = i;
|
||||
var2 = r8;
|
||||
for (i = 0; i < CONTESTANT_COUNT; i++)
|
||||
{
|
||||
if (condition == gContestMonRound1Points[i])
|
||||
{
|
||||
if (var2 == 1)
|
||||
break;
|
||||
var2--;
|
||||
}
|
||||
}
|
||||
|
||||
StringCopy(gStringVar1, gContestMons[i].nickname);
|
||||
StringCopy(gStringVar2, gContestMons[i].trainerName);
|
||||
sub_81DB5AC(gStringVar2);
|
||||
|
||||
if (var0 == 1)
|
||||
gSpecialVar_0x8006 = r7;
|
||||
else if (r8 == var0)
|
||||
gSpecialVar_0x8006 = r7;
|
||||
else
|
||||
gSpecialVar_0x8006 = r7 + 4;
|
||||
}
|
||||
|
||||
static void ExitContestWinnerPainting(void)
|
||||
{
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);
|
||||
}
|
||||
|
||||
void ShowContestWinnerPainting(void)
|
||||
{
|
||||
SetMainCallback2(CB2_ContestPainting);
|
||||
gMain.savedCallback = ExitContestWinnerPainting;
|
||||
}
|
||||
|
||||
void SetLinkContestPlayerGfx(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK)
|
||||
{
|
||||
for (i = 0; i < gNumLinkContestPlayers; i++)
|
||||
{
|
||||
int version = (u8)gLinkPlayers[i].version;
|
||||
if (version == VERSION_RUBY || version == VERSION_SAPPHIRE)
|
||||
{
|
||||
if (gLinkPlayers[i].gender == MALE)
|
||||
gContestMons[i].trainerGfxId = OBJ_EVENT_GFX_LINK_RS_BRENDAN;
|
||||
else
|
||||
gContestMons[i].trainerGfxId = OBJ_EVENT_GFX_LINK_RS_MAY;
|
||||
}
|
||||
}
|
||||
|
||||
VarSet(VAR_OBJ_GFX_ID_0, gContestMons[0].trainerGfxId);
|
||||
VarSet(VAR_OBJ_GFX_ID_1, gContestMons[1].trainerGfxId);
|
||||
VarSet(VAR_OBJ_GFX_ID_2, gContestMons[2].trainerGfxId);
|
||||
VarSet(VAR_OBJ_GFX_ID_3, gContestMons[3].trainerGfxId);
|
||||
}
|
||||
}
|
||||
|
||||
void LoadLinkContestPlayerPalettes(void)
|
||||
{
|
||||
int i;
|
||||
u8 objectEventId;
|
||||
int version;
|
||||
struct Sprite *sprite;
|
||||
static const u8 sContestantLocalIds[CONTESTANT_COUNT] = { 3, 4, 5, 14 };
|
||||
|
||||
gReservedSpritePaletteCount = 12;
|
||||
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK)
|
||||
{
|
||||
for (i = 0; i < gNumLinkContestPlayers; i++)
|
||||
{
|
||||
objectEventId = GetObjectEventIdByLocalIdAndMap(sContestantLocalIds[i], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
|
||||
sprite = &gSprites[gObjectEvents[objectEventId].spriteId];
|
||||
sprite->oam.paletteNum = 6 + i;
|
||||
version = (u8)gLinkPlayers[i].version;
|
||||
if (version == VERSION_RUBY || version == VERSION_SAPPHIRE)
|
||||
{
|
||||
if (gLinkPlayers[i].gender == MALE)
|
||||
LoadPalette(gObjectEventPalette33, 0x160 + i * 0x10, 0x20);
|
||||
else
|
||||
LoadPalette(gObjectEventPalette34, 0x160 + i * 0x10, 0x20);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gLinkPlayers[i].gender == MALE)
|
||||
LoadPalette(gObjectEventPalette8, 0x160 + i * 0x10, 0x20);
|
||||
else
|
||||
LoadPalette(gObjectEventPalette17, 0x160 + i * 0x10, 0x20);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool8 GiveMonArtistRibbon(void)
|
||||
{
|
||||
u8 hasArtistRibbon;
|
||||
|
||||
hasArtistRibbon = GetMonData(&gPlayerParty[gContestMonPartyIndex], MON_DATA_ARTIST_RIBBON);
|
||||
if (!hasArtistRibbon
|
||||
&& gContestFinalStandings[gContestPlayerMonIndex] == 0
|
||||
&& gSpecialVar_ContestRank == CONTEST_RANK_MASTER
|
||||
&& gContestMonTotalPoints[gContestPlayerMonIndex] >= 800)
|
||||
{
|
||||
hasArtistRibbon = 1;
|
||||
SetMonData(&gPlayerParty[gContestMonPartyIndex], MON_DATA_ARTIST_RIBBON, &hasArtistRibbon);
|
||||
if (GetRibbonCount(&gPlayerParty[gContestMonPartyIndex]) > NUM_CUTIES_RIBBONS)
|
||||
TryPutSpotTheCutiesOnAir(&gPlayerParty[gContestMonPartyIndex], MON_DATA_ARTIST_RIBBON);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
bool8 IsContestDebugActive(void)
|
||||
{
|
||||
return FALSE; // gUnknown_0203856C in pokeruby
|
||||
}
|
||||
|
||||
void ShowContestEntryMonPic(void)
|
||||
{
|
||||
const struct CompressedSpritePalette *palette;
|
||||
u32 personality, otId;
|
||||
u16 species;
|
||||
u8 spriteId;
|
||||
u8 taskId;
|
||||
u8 left, top;
|
||||
|
||||
if (FindTaskIdByFunc(Task_ShowContestEntryMonPic) == 0xFF)
|
||||
{
|
||||
AllocateMonSpritesGfx();
|
||||
left = 10;
|
||||
top = 3;
|
||||
species = gContestMons[gSpecialVar_0x8006].species;
|
||||
personality = gContestMons[gSpecialVar_0x8006].personality;
|
||||
otId = gContestMons[gSpecialVar_0x8006].otId;
|
||||
taskId = CreateTask(Task_ShowContestEntryMonPic, 0x50);
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].data[1] = species;
|
||||
if (gSpecialVar_0x8006 == gContestPlayerMonIndex)
|
||||
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality);
|
||||
else
|
||||
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality);
|
||||
|
||||
palette = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality);
|
||||
LoadCompressedSpritePalette(palette);
|
||||
SetMultiuseSpriteTemplateToPokemon(species, 1);
|
||||
gMultiuseSpriteTemplate.paletteTag = palette->tag;
|
||||
spriteId = CreateSprite(&gMultiuseSpriteTemplate, (left + 1) * 8 + 32, (top * 8) + 40, 0);
|
||||
|
||||
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK)
|
||||
{
|
||||
if (!(gLinkContestFlags & LINK_CONTEST_FLAG_HAS_RS_PLAYER))
|
||||
DoMonFrontSpriteAnimation(&gSprites[spriteId], species, FALSE, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
DoMonFrontSpriteAnimation(&gSprites[spriteId], species, FALSE, 0);
|
||||
}
|
||||
|
||||
gTasks[taskId].data[2] = spriteId;
|
||||
gTasks[taskId].data[3] = left;
|
||||
gTasks[taskId].data[4] = top;
|
||||
gSprites[spriteId].callback = SpriteCallbackDummy;
|
||||
gSprites[spriteId].oam.priority = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void HideContestEntryMonPic(void)
|
||||
{
|
||||
u8 taskId = FindTaskIdByFunc(Task_ShowContestEntryMonPic);
|
||||
if (taskId != 0xFF)
|
||||
{
|
||||
gTasks[taskId].data[0]++;
|
||||
FreeMonSpritesGfx();
|
||||
}
|
||||
}
|
||||
|
||||
static void Task_ShowContestEntryMonPic(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
struct Sprite *sprite;
|
||||
|
||||
switch(task->data[0])
|
||||
{
|
||||
case 0:
|
||||
task->data[0]++;
|
||||
break;
|
||||
case 1:
|
||||
task->data[5] = CreateWindowFromRect(10, 3, 8, 8);
|
||||
SetStandardWindowBorderStyle(task->data[5], 1);
|
||||
task->data[0]++;
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
case 3:
|
||||
sprite = &gSprites[task->data[2]];
|
||||
FreeSpritePaletteByTag(GetSpritePaletteTagByPaletteNum(sprite->oam.paletteNum));
|
||||
|
||||
if(sprite->oam.affineMode)
|
||||
FreeOamMatrix(sprite->oam.matrixNum);
|
||||
|
||||
DestroySprite(sprite);
|
||||
task->data[0]++;
|
||||
break;
|
||||
case 4:
|
||||
ClearToTransparentAndRemoveWindow(gTasks[taskId].data[5]);
|
||||
DestroyTask(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void GetContestMultiplayerId(void)
|
||||
{
|
||||
if ((gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK)
|
||||
&& gNumLinkContestPlayers == CONTESTANT_COUNT
|
||||
&& !(gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS))
|
||||
gSpecialVar_Result = GetMultiplayerId();
|
||||
else
|
||||
gSpecialVar_Result = MAX_LINK_PLAYERS;
|
||||
}
|
||||
|
||||
void GenerateContestRand(void)
|
||||
{
|
||||
u16 random;
|
||||
u16 *result;
|
||||
|
||||
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK)
|
||||
{
|
||||
gContestRngValue = ISO_RANDOMIZE1(gContestRngValue);
|
||||
random = gContestRngValue >> 16;
|
||||
result = &gSpecialVar_Result;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = &gSpecialVar_Result;
|
||||
random = Random();
|
||||
}
|
||||
*result = random % *result;
|
||||
}
|
||||
|
||||
u16 GetContestRand(void)
|
||||
{
|
||||
gContestRngValue = ISO_RANDOMIZE1(gContestRngValue);
|
||||
return gContestRngValue >> 16;
|
||||
}
|
||||
|
||||
bool8 LinkContestWaitForConnection(void)
|
||||
{
|
||||
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS)
|
||||
{
|
||||
CreateTask(Task_LinkContestWaitForConnection, 5);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static void Task_LinkContestWaitForConnection(u8 taskId)
|
||||
{
|
||||
switch (gTasks[taskId].data[0])
|
||||
{
|
||||
case 0:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SetLinkStandbyCallback();
|
||||
gTasks[taskId].data[0]++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
gTasks[taskId].data[0]++;
|
||||
break;
|
||||
default:
|
||||
if (IsLinkTaskFinished() == 1)
|
||||
{
|
||||
EnableBothScriptContexts();
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void LinkContestTryShowWirelessIndicator(void)
|
||||
{
|
||||
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS)
|
||||
{
|
||||
if (gReceivedRemoteLinkPlayers)
|
||||
{
|
||||
LoadWirelessStatusIndicatorSpriteGfx();
|
||||
CreateWirelessStatusIndicatorSprite(8, 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LinkContestTryHideWirelessIndicator(void)
|
||||
{
|
||||
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS)
|
||||
{
|
||||
if (gReceivedRemoteLinkPlayers)
|
||||
DestroyWirelessStatusIndicatorSprite();
|
||||
}
|
||||
}
|
||||
|
||||
bool8 IsContestWithRSPlayer(void)
|
||||
{
|
||||
if (gLinkContestFlags & LINK_CONTEST_FLAG_HAS_RS_PLAYER)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void ClearLinkContestFlags(void)
|
||||
{
|
||||
gLinkContestFlags = 0;
|
||||
}
|
||||
|
||||
bool8 IsWirelessContest(void)
|
||||
{
|
||||
if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1239,7 +1239,7 @@ void CB2_StartCreditsSequence(void)
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK);
|
||||
EnableInterrupts(INTR_FLAG_VBLANK);
|
||||
SetVBlankCallback(CreditsVBlankCallback);
|
||||
m4aSongNumStart(MUS_THANKFOR);
|
||||
m4aSongNumStart(MUS_CREDITS);
|
||||
SetMainCallback2(CB2_RunCreditsSequence);
|
||||
gUnknown_0203BCE5 = 0;
|
||||
sCreditsData = AllocZeroed(sizeof(struct CreditsData));
|
||||
|
||||
+48
-48
@@ -2838,289 +2838,289 @@ const struct ContestEffect gContestEffects[] =
|
||||
{
|
||||
[CONTEST_EFFECT_HIGHLY_APPEALING] =
|
||||
{
|
||||
.effectType = 0,
|
||||
.effectType = CONTEST_EFFECT_TYPE_APPEAL,
|
||||
.appeal = 40,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_USER_MORE_EASILY_STARTLED] =
|
||||
{
|
||||
.effectType = 0,
|
||||
.effectType = CONTEST_EFFECT_TYPE_APPEAL,
|
||||
.appeal = 60,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES] =
|
||||
{
|
||||
.effectType = 0,
|
||||
.effectType = CONTEST_EFFECT_TYPE_APPEAL,
|
||||
.appeal = 80,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_REPETITION_NOT_BORING] =
|
||||
{
|
||||
.effectType = 0,
|
||||
.effectType = CONTEST_EFFECT_TYPE_APPEAL,
|
||||
.appeal = 30,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_AVOID_STARTLE_ONCE] =
|
||||
{
|
||||
.effectType = 1,
|
||||
.effectType = CONTEST_EFFECT_TYPE_AVOID_STARTLE,
|
||||
.appeal = 20,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_AVOID_STARTLE] =
|
||||
{
|
||||
.effectType = 1,
|
||||
.effectType = CONTEST_EFFECT_TYPE_AVOID_STARTLE,
|
||||
.appeal = 10,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_AVOID_STARTLE_SLIGHTLY] =
|
||||
{
|
||||
.effectType = 1,
|
||||
.effectType = CONTEST_EFFECT_TYPE_AVOID_STARTLE,
|
||||
.appeal = 30,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_USER_LESS_EASILY_STARTLED] =
|
||||
{
|
||||
.effectType = 1,
|
||||
.effectType = CONTEST_EFFECT_TYPE_AVOID_STARTLE,
|
||||
.appeal = 30,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_STARTLE_FRONT_MON] =
|
||||
{
|
||||
.effectType = 2,
|
||||
.effectType = CONTEST_EFFECT_TYPE_STARTLE_MON,
|
||||
.appeal = 30,
|
||||
.jam = 20,
|
||||
},
|
||||
[CONTEST_EFFECT_SLIGHTLY_STARTLE_PREV_MONS] =
|
||||
{
|
||||
.effectType = 3,
|
||||
.effectType = CONTEST_EFFECT_TYPE_STARTLE_MONS,
|
||||
.appeal = 30,
|
||||
.jam = 10,
|
||||
},
|
||||
[CONTEST_EFFECT_STARTLE_PREV_MON] =
|
||||
{
|
||||
.effectType = 2,
|
||||
.effectType = CONTEST_EFFECT_TYPE_STARTLE_MON,
|
||||
.appeal = 20,
|
||||
.jam = 30,
|
||||
},
|
||||
[CONTEST_EFFECT_STARTLE_PREV_MONS] =
|
||||
{
|
||||
.effectType = 3,
|
||||
.effectType = CONTEST_EFFECT_TYPE_STARTLE_MONS,
|
||||
.appeal = 20,
|
||||
.jam = 20,
|
||||
},
|
||||
[CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON] =
|
||||
{
|
||||
.effectType = 2,
|
||||
.effectType = CONTEST_EFFECT_TYPE_STARTLE_MON,
|
||||
.appeal = 10,
|
||||
.jam = 40,
|
||||
},
|
||||
[CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS] =
|
||||
{
|
||||
.effectType = 3,
|
||||
.effectType = CONTEST_EFFECT_TYPE_STARTLE_MONS,
|
||||
.appeal = 10,
|
||||
.jam = 30,
|
||||
},
|
||||
[CONTEST_EFFECT_STARTLE_PREV_MON_2] =
|
||||
{
|
||||
.effectType = 2,
|
||||
.effectType = CONTEST_EFFECT_TYPE_STARTLE_MON,
|
||||
.appeal = 30,
|
||||
.jam = 20,
|
||||
},
|
||||
[CONTEST_EFFECT_STARTLE_PREV_MONS_2] =
|
||||
{
|
||||
.effectType = 3,
|
||||
.effectType = CONTEST_EFFECT_TYPE_STARTLE_MONS,
|
||||
.appeal = 30,
|
||||
.jam = 10,
|
||||
},
|
||||
[CONTEST_EFFECT_SHIFT_JUDGE_ATTENTION] =
|
||||
{
|
||||
.effectType = 4,
|
||||
.effectType = CONTEST_EFFECT_TYPE_WORSEN,
|
||||
.appeal = 30,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION] =
|
||||
{
|
||||
.effectType = 3,
|
||||
.effectType = CONTEST_EFFECT_TYPE_STARTLE_MONS,
|
||||
.appeal = 20,
|
||||
.jam = 10,
|
||||
},
|
||||
[CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN] =
|
||||
{
|
||||
.effectType = 3,
|
||||
.effectType = CONTEST_EFFECT_TYPE_STARTLE_MONS,
|
||||
.appeal = 40,
|
||||
.jam = 40,
|
||||
},
|
||||
[CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL] =
|
||||
{
|
||||
.effectType = 3,
|
||||
.effectType = CONTEST_EFFECT_TYPE_STARTLE_MONS,
|
||||
.appeal = 20,
|
||||
.jam = 10,
|
||||
},
|
||||
[CONTEST_EFFECT_STARTLE_MONS_COOL_APPEAL] =
|
||||
{
|
||||
.effectType = 3,
|
||||
.effectType = CONTEST_EFFECT_TYPE_STARTLE_MONS,
|
||||
.appeal = 20,
|
||||
.jam = 10,
|
||||
},
|
||||
[CONTEST_EFFECT_STARTLE_MONS_BEAUTY_APPEAL] =
|
||||
{
|
||||
.effectType = 3,
|
||||
.effectType = CONTEST_EFFECT_TYPE_STARTLE_MONS,
|
||||
.appeal = 20,
|
||||
.jam = 10,
|
||||
},
|
||||
[CONTEST_EFFECT_STARTLE_MONS_CUTE_APPEAL] =
|
||||
{
|
||||
.effectType = 3,
|
||||
.effectType = CONTEST_EFFECT_TYPE_STARTLE_MONS,
|
||||
.appeal = 20,
|
||||
.jam = 10,
|
||||
},
|
||||
[CONTEST_EFFECT_STARTLE_MONS_SMART_APPEAL] =
|
||||
{
|
||||
.effectType = 3,
|
||||
.effectType = CONTEST_EFFECT_TYPE_STARTLE_MONS,
|
||||
.appeal = 20,
|
||||
.jam = 10,
|
||||
},
|
||||
[CONTEST_EFFECT_STARTLE_MONS_TOUGH_APPEAL] =
|
||||
{
|
||||
.effectType = 3,
|
||||
.effectType = CONTEST_EFFECT_TYPE_STARTLE_MONS,
|
||||
.appeal = 20,
|
||||
.jam = 10,
|
||||
},
|
||||
[CONTEST_EFFECT_MAKE_FOLLOWING_MON_NERVOUS] =
|
||||
{
|
||||
.effectType = 4,
|
||||
.effectType = CONTEST_EFFECT_TYPE_WORSEN,
|
||||
.appeal = 20,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS] =
|
||||
{
|
||||
.effectType = 4,
|
||||
.effectType = CONTEST_EFFECT_TYPE_WORSEN,
|
||||
.appeal = 20,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS] =
|
||||
{
|
||||
.effectType = 4,
|
||||
.effectType = CONTEST_EFFECT_TYPE_WORSEN,
|
||||
.appeal = 30,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_BADLY_STARTLES_MONS_IN_GOOD_CONDITION] =
|
||||
{
|
||||
.effectType = 3,
|
||||
.effectType = CONTEST_EFFECT_TYPE_STARTLE_MONS,
|
||||
.appeal = 30,
|
||||
.jam = 10,
|
||||
},
|
||||
[CONTEST_EFFECT_BETTER_IF_FIRST] =
|
||||
{
|
||||
.effectType = 5,
|
||||
.effectType = CONTEST_EFFECT_TYPE_SPECIAL_APPEAL,
|
||||
.appeal = 20,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_BETTER_IF_LAST] =
|
||||
{
|
||||
.effectType = 5,
|
||||
.effectType = CONTEST_EFFECT_TYPE_SPECIAL_APPEAL,
|
||||
.appeal = 20,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONES] =
|
||||
{
|
||||
.effectType = 5,
|
||||
.effectType = CONTEST_EFFECT_TYPE_SPECIAL_APPEAL,
|
||||
.appeal = 10,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONE] =
|
||||
{
|
||||
.effectType = 5,
|
||||
.effectType = CONTEST_EFFECT_TYPE_SPECIAL_APPEAL,
|
||||
.appeal = 10,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_BETTER_WHEN_LATER] =
|
||||
{
|
||||
.effectType = 5,
|
||||
.effectType = CONTEST_EFFECT_TYPE_SPECIAL_APPEAL,
|
||||
.appeal = 10,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING] =
|
||||
{
|
||||
.effectType = 5,
|
||||
.effectType = CONTEST_EFFECT_TYPE_SPECIAL_APPEAL,
|
||||
.appeal = 10,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_BETTER_IF_SAME_TYPE] =
|
||||
{
|
||||
.effectType = 5,
|
||||
.effectType = CONTEST_EFFECT_TYPE_SPECIAL_APPEAL,
|
||||
.appeal = 20,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_BETTER_IF_DIFF_TYPE] =
|
||||
{
|
||||
.effectType = 5,
|
||||
.effectType = CONTEST_EFFECT_TYPE_SPECIAL_APPEAL,
|
||||
.appeal = 20,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL] =
|
||||
{
|
||||
.effectType = 5,
|
||||
.effectType = CONTEST_EFFECT_TYPE_SPECIAL_APPEAL,
|
||||
.appeal = 30,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS] =
|
||||
{
|
||||
.effectType = 5,
|
||||
.effectType = CONTEST_EFFECT_TYPE_SPECIAL_APPEAL,
|
||||
.appeal = 10,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_BETTER_WITH_GOOD_CONDITION] =
|
||||
{
|
||||
.effectType = 5,
|
||||
.effectType = CONTEST_EFFECT_TYPE_SPECIAL_APPEAL,
|
||||
.appeal = 10,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_NEXT_APPEAL_EARLIER] =
|
||||
{
|
||||
.effectType = 6,
|
||||
.effectType = CONTEST_EFFECT_TYPE_TURN_ORDER,
|
||||
.appeal = 30,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_NEXT_APPEAL_LATER] =
|
||||
{
|
||||
.effectType = 6,
|
||||
.effectType = CONTEST_EFFECT_TYPE_TURN_ORDER,
|
||||
.appeal = 30,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_MAKE_SCRAMBLING_TURN_ORDER_EASIER] =
|
||||
{
|
||||
.effectType = 6,
|
||||
.effectType = CONTEST_EFFECT_TYPE_TURN_ORDER,
|
||||
.appeal = 30,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER] =
|
||||
{
|
||||
.effectType = 6,
|
||||
.effectType = CONTEST_EFFECT_TYPE_TURN_ORDER,
|
||||
.appeal = 30,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_EXCITE_AUDIENCE_IN_ANY_CONTEST] =
|
||||
{
|
||||
.effectType = 5,
|
||||
.effectType = CONTEST_EFFECT_TYPE_SPECIAL_APPEAL,
|
||||
.appeal = 10,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS] =
|
||||
{
|
||||
.effectType = 3,
|
||||
.effectType = CONTEST_EFFECT_TYPE_STARTLE_MONS,
|
||||
.appeal = 20,
|
||||
.jam = 10,
|
||||
},
|
||||
[CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED] =
|
||||
{
|
||||
.effectType = 5,
|
||||
.effectType = CONTEST_EFFECT_TYPE_SPECIAL_APPEAL,
|
||||
.appeal = 10,
|
||||
.jam = 0,
|
||||
},
|
||||
[CONTEST_EFFECT_DONT_EXCITE_AUDIENCE] =
|
||||
{
|
||||
.effectType = 4,
|
||||
.effectType = CONTEST_EFFECT_TYPE_WORSEN,
|
||||
.appeal = 30,
|
||||
.jam = 0,
|
||||
},
|
||||
|
||||
+134
-193
File diff suppressed because it is too large
Load Diff
@@ -8,70 +8,70 @@ const struct SpriteTemplate gFieldEffectObjectTemplate_Ash;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_SurfBlob;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Arrow;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_GroundImpactDust;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_BikeHopTallGrass;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpTallGrass;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_SandFootprints;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_BikeHopBigSplash;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpBigSplash;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Splash;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_BikeHopSmallSplash;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpSmallSplash;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_LongGrass;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown16;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown17;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown18;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown19;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown20;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown21;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_BerryTreeGrowthSparkle;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpLongGrass;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_UnusedGrass;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_UnusedGrass2;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_UnusedSand;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_WaterSurfacing;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_ReflectionDistortion;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Sparkle;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_DeepSandFootprints;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_TreeDisguise;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_MountainDisguise;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Bird;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_BikeTireTracks;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_SandDisguisePlaceholder;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown29;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_SandPile;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_ShortGrass;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_HotSpringsWater;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpOutOfAsh;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_LavaridgeGymWarp;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_AshPuff;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_AshLaunch;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Bubbles;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Unknown35;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_SmallSparkle;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Rayquaza;
|
||||
|
||||
const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[] = {
|
||||
&gFieldEffectObjectTemplate_ShadowSmall,
|
||||
&gFieldEffectObjectTemplate_ShadowMedium,
|
||||
&gFieldEffectObjectTemplate_ShadowLarge,
|
||||
&gFieldEffectObjectTemplate_ShadowExtraLarge,
|
||||
&gFieldEffectObjectTemplate_TallGrass,
|
||||
&gFieldEffectObjectTemplate_Ripple,
|
||||
&gFieldEffectObjectTemplate_Ash,
|
||||
&gFieldEffectObjectTemplate_SurfBlob,
|
||||
&gFieldEffectObjectTemplate_Arrow,
|
||||
&gFieldEffectObjectTemplate_GroundImpactDust,
|
||||
&gFieldEffectObjectTemplate_BikeHopTallGrass,
|
||||
&gFieldEffectObjectTemplate_SandFootprints,
|
||||
&gFieldEffectObjectTemplate_BikeHopBigSplash,
|
||||
&gFieldEffectObjectTemplate_Splash,
|
||||
&gFieldEffectObjectTemplate_BikeHopSmallSplash,
|
||||
&gFieldEffectObjectTemplate_LongGrass,
|
||||
&gFieldEffectObjectTemplate_Unknown16,
|
||||
&gFieldEffectObjectTemplate_Unknown17,
|
||||
&gFieldEffectObjectTemplate_Unknown18,
|
||||
&gFieldEffectObjectTemplate_Unknown19,
|
||||
&gFieldEffectObjectTemplate_Unknown20,
|
||||
&gFieldEffectObjectTemplate_Unknown21,
|
||||
&gFieldEffectObjectTemplate_BerryTreeGrowthSparkle,
|
||||
&gFieldEffectObjectTemplate_DeepSandFootprints,
|
||||
&gFieldEffectObjectTemplate_TreeDisguise,
|
||||
&gFieldEffectObjectTemplate_MountainDisguise,
|
||||
&gFieldEffectObjectTemplate_Bird,
|
||||
&gFieldEffectObjectTemplate_BikeTireTracks,
|
||||
&gFieldEffectObjectTemplate_SandDisguisePlaceholder,
|
||||
&gFieldEffectObjectTemplate_Unknown29,
|
||||
&gFieldEffectObjectTemplate_ShortGrass,
|
||||
&gFieldEffectObjectTemplate_HotSpringsWater,
|
||||
&gFieldEffectObjectTemplate_JumpOutOfAsh,
|
||||
&gFieldEffectObjectTemplate_LavaridgeGymWarp,
|
||||
&gFieldEffectObjectTemplate_Bubbles,
|
||||
&gFieldEffectObjectTemplate_Unknown35,
|
||||
&gFieldEffectObjectTemplate_Rayquaza,
|
||||
[FLDEFFOBJ_SHADOW_S] = &gFieldEffectObjectTemplate_ShadowSmall,
|
||||
[FLDEFFOBJ_SHADOW_M] = &gFieldEffectObjectTemplate_ShadowMedium,
|
||||
[FLDEFFOBJ_SHADOW_L] = &gFieldEffectObjectTemplate_ShadowLarge,
|
||||
[FLDEFFOBJ_SHADOW_XL] = &gFieldEffectObjectTemplate_ShadowExtraLarge,
|
||||
[FLDEFFOBJ_TALL_GRASS] = &gFieldEffectObjectTemplate_TallGrass,
|
||||
[FLDEFFOBJ_RIPPLE] = &gFieldEffectObjectTemplate_Ripple,
|
||||
[FLDEFFOBJ_ASH] = &gFieldEffectObjectTemplate_Ash,
|
||||
[FLDEFFOBJ_SURF_BLOB] = &gFieldEffectObjectTemplate_SurfBlob,
|
||||
[FLDEFFOBJ_ARROW] = &gFieldEffectObjectTemplate_Arrow,
|
||||
[FLDEFFOBJ_GROUND_IMPACT_DUST] = &gFieldEffectObjectTemplate_GroundImpactDust,
|
||||
[FLDEFFOBJ_JUMP_TALL_GRASS] = &gFieldEffectObjectTemplate_JumpTallGrass,
|
||||
[FLDEFFOBJ_SAND_FOOTPRINTS] = &gFieldEffectObjectTemplate_SandFootprints,
|
||||
[FLDEFFOBJ_JUMP_BIG_SPLASH] = &gFieldEffectObjectTemplate_JumpBigSplash,
|
||||
[FLDEFFOBJ_SPLASH] = &gFieldEffectObjectTemplate_Splash,
|
||||
[FLDEFFOBJ_JUMP_SMALL_SPLASH] = &gFieldEffectObjectTemplate_JumpSmallSplash,
|
||||
[FLDEFFOBJ_LONG_GRASS] = &gFieldEffectObjectTemplate_LongGrass,
|
||||
[FLDEFFOBJ_JUMP_LONG_GRASS] = &gFieldEffectObjectTemplate_JumpLongGrass,
|
||||
[FLDEFFOBJ_UNUSED_GRASS] = &gFieldEffectObjectTemplate_UnusedGrass,
|
||||
[FLDEFFOBJ_UNUSED_GRASS_2] = &gFieldEffectObjectTemplate_UnusedGrass2,
|
||||
[FLDEFFOBJ_UNUSED_SAND] = &gFieldEffectObjectTemplate_UnusedSand,
|
||||
[FLDEFFOBJ_WATER_SURFACING] = &gFieldEffectObjectTemplate_WaterSurfacing,
|
||||
[FLDEFFOBJ_REFLECTION_DISTORTION] = &gFieldEffectObjectTemplate_ReflectionDistortion,
|
||||
[FLDEFFOBJ_SPARKLE] = &gFieldEffectObjectTemplate_Sparkle,
|
||||
[FLDEFFOBJ_DEEP_SAND_FOOTPRINTS] = &gFieldEffectObjectTemplate_DeepSandFootprints,
|
||||
[FLDEFFOBJ_TREE_DISGUISE] = &gFieldEffectObjectTemplate_TreeDisguise,
|
||||
[FLDEFFOBJ_MOUNTAIN_DISGUISE] = &gFieldEffectObjectTemplate_MountainDisguise,
|
||||
[FLDEFFOBJ_BIRD] = &gFieldEffectObjectTemplate_Bird,
|
||||
[FLDEFFOBJ_BIKE_TIRE_TRACKS] = &gFieldEffectObjectTemplate_BikeTireTracks,
|
||||
[FLDEFFOBJ_SAND_DISGUISE] = &gFieldEffectObjectTemplate_SandDisguisePlaceholder,
|
||||
[FLDEFFOBJ_SAND_PILE] = &gFieldEffectObjectTemplate_SandPile,
|
||||
[FLDEFFOBJ_SHORT_GRASS] = &gFieldEffectObjectTemplate_ShortGrass,
|
||||
[FLDEFFOBJ_HOT_SPRINGS_WATER] = &gFieldEffectObjectTemplate_HotSpringsWater,
|
||||
[FLDEFFOBJ_ASH_PUFF] = &gFieldEffectObjectTemplate_AshPuff,
|
||||
[FLDEFFOBJ_ASH_LAUNCH] = &gFieldEffectObjectTemplate_AshLaunch,
|
||||
[FLDEFFOBJ_BUBBLES] = &gFieldEffectObjectTemplate_Bubbles,
|
||||
[FLDEFFOBJ_SMALL_SPARKLE] = &gFieldEffectObjectTemplate_SmallSparkle,
|
||||
[FLDEFFOBJ_RAYQUAZA] = &gFieldEffectObjectTemplate_Rayquaza,
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2698,7 +2698,8 @@ const u8 gMonIcon_Deoxys[] = INCBIN_U8("graphics/pokemon/deoxys/icon.4bpp");
|
||||
const u8 gMonIcon_DeoxysSpeed[] = INCBIN_U8("graphics/pokemon/deoxys/icon_speed.4bpp");
|
||||
const u8 gMonIcon_DeoxysSpeedWide[] = INCBIN_U8("graphics/unused/deoxys_speed_icon_wide.4bpp");
|
||||
|
||||
asm(".space 0x6800");
|
||||
// Probably the leftover space from the other Deoxys forms
|
||||
static const u8 sEmpty[0x6800] = {0};
|
||||
|
||||
const u16 gUnknown_D437F8[] = INCBIN_U16("graphics/unknown/unknown_D437F8.bin");
|
||||
|
||||
|
||||
@@ -2,21 +2,15 @@ const u16 gSlotMachineMenu_Pal[] = INCBIN_U16("graphics/slot_machine/menu.gbapal
|
||||
const u32 gSlotMachineMenu_Gfx[] = INCBIN_U32("graphics/slot_machine/menu.4bpp.lz");
|
||||
const u16 gSlotMachineMenu_Tilemap[] = INCBIN_U16("graphics/slot_machine/menu.bin");
|
||||
|
||||
const u16 gUnknown_08DCEC70[] = INCBIN_U16("graphics/slot_machine/slots_layout.bin");
|
||||
const u16 gSlotMachineInfoBox_Tilemap[] = INCBIN_U16("graphics/slot_machine/info_box.bin");
|
||||
|
||||
const u16 gUnknown_08DCF170[] = INCBIN_U16("graphics/slot_machine/reel_symbols/1.gbapal");
|
||||
|
||||
const u16 gUnknown_08DCF190[] = INCBIN_U16("graphics/slot_machine/reel_pikachu.gbapal");
|
||||
|
||||
const u16 gUnknown_08DCF1B0[] = INCBIN_U16("graphics/slot_machine/shadow.gbapal");
|
||||
|
||||
const u16 gSlotMachineReelTime_Pal[] = INCBIN_U16("graphics/slot_machine/reel_time.gbapal");
|
||||
|
||||
const u16 gUnknown_08DCF1F0[] = INCBIN_U16("graphics/slot_machine/smoke.gbapal"); // also duck and pika aura
|
||||
|
||||
const u16 gUnknown_08DCF210[] = INCBIN_U16("graphics/slot_machine/reel_time_explosion/0.gbapal");
|
||||
|
||||
const u16 gUnknown_08DCF230[] = INCBIN_U16("graphics/slot_machine/spr6.gbapal");
|
||||
const u16 gSlotMachineReelSymbols_Pal[] = INCBIN_U16("graphics/slot_machine/reel_symbols/1.gbapal");
|
||||
const u16 gSlotMachineReelTimePikachu_Pal[] = INCBIN_U16("graphics/slot_machine/reel_time_pikachu.gbapal");
|
||||
const u16 gSlotMachineReelTimeMisc_Pal[] = INCBIN_U16("graphics/slot_machine/shadow.gbapal");
|
||||
const u16 gSlotMachineReelTimeMachine_Pal[] = INCBIN_U16("graphics/slot_machine/reel_time_machine.gbapal");
|
||||
const u16 gSlotMachineMisc_Pal[] = INCBIN_U16("graphics/slot_machine/smoke.gbapal");
|
||||
const u16 gSlotMachineReelTimeExplosion_Pal[] = INCBIN_U16("graphics/slot_machine/reel_time_explosion/0.gbapal");
|
||||
const u16 gSlotMachineDigitalDisplay_Pal[] = INCBIN_U16("graphics/slot_machine/digital_display.gbapal");
|
||||
|
||||
const u8 gSlotMachineReelSymbol1Tiles[] = INCBIN_U8("graphics/slot_machine/reel_symbols/1.4bpp");
|
||||
const u8 gSlotMachineReelSymbol2Tiles[] = INCBIN_U8("graphics/slot_machine/reel_symbols/2.4bpp");
|
||||
@@ -26,7 +20,7 @@ const u8 gSlotMachineReelSymbol5Tiles[] = INCBIN_U8("graphics/slot_machine/reel_
|
||||
const u8 gSlotMachineReelSymbol6Tiles[] = INCBIN_U8("graphics/slot_machine/reel_symbols/6.4bpp");
|
||||
const u8 gSlotMachineReelSymbol7Tiles[] = INCBIN_U8("graphics/slot_machine/reel_symbols/7.4bpp");
|
||||
|
||||
const u32 gSlotMachineReelTime_Gfx[] = INCBIN_U32("graphics/slot_machine/reel_time.4bpp.lz");
|
||||
const u32 gSlotMachineDigitalDisplay_Gfx[] = INCBIN_U32("graphics/slot_machine/digital_display.4bpp.lz");
|
||||
|
||||
const u8 gSlotMachineNumber0Tiles[] = INCBIN_U8("graphics/slot_machine/numbers/0.4bpp");
|
||||
const u8 gSlotMachineNumber1Tiles[] = INCBIN_U8("graphics/slot_machine/numbers/1.4bpp");
|
||||
@@ -39,7 +33,7 @@ const u8 gSlotMachineNumber7Tiles[] = INCBIN_U8("graphics/slot_machine/numbers/7
|
||||
const u8 gSlotMachineNumber8Tiles[] = INCBIN_U8("graphics/slot_machine/numbers/8.4bpp");
|
||||
const u8 gSlotMachineNumber9Tiles[] = INCBIN_U8("graphics/slot_machine/numbers/9.4bpp");
|
||||
|
||||
const u8 gSlotMachineReelTimeBolt[] = INCBIN_U8("graphics/slot_machine/bolt.4bpp");
|
||||
const u8 gSlotMachinePikaPowerBolt[] = INCBIN_U8("graphics/slot_machine/bolt.4bpp");
|
||||
const u8 gSlotMachineReelTimeDuck[] = INCBIN_U8("graphics/slot_machine/duck.4bpp");
|
||||
const u8 gSlotMachineReelTimeSmoke[] = INCBIN_U8("graphics/slot_machine/smoke.4bpp");
|
||||
|
||||
@@ -50,8 +44,8 @@ const u8 gSlotMachineReelTimeNumber3[] = INCBIN_U8("graphics/slot_machine/reel_t
|
||||
const u8 gSlotMachineReelTimeNumber4[] = INCBIN_U8("graphics/slot_machine/reel_time_numbers/4.4bpp");
|
||||
const u8 gSlotMachineReelTimeNumber5[] = INCBIN_U8("graphics/slot_machine/reel_time_numbers/5.4bpp");
|
||||
|
||||
const u8 gSlotMachineReelTimeLargeBolt0[] = INCBIN_U8("graphics/slot_machine/large_bolt/0.4bpp");
|
||||
const u8 gSlotMachineReelTimeLargeBolt1[] = INCBIN_U8("graphics/slot_machine/large_bolt/1.4bpp");
|
||||
const u8 gSlotMachineReelTimeBolt0[] = INCBIN_U8("graphics/slot_machine/large_bolt/0.4bpp");
|
||||
const u8 gSlotMachineReelTimeBolt1[] = INCBIN_U8("graphics/slot_machine/large_bolt/1.4bpp");
|
||||
|
||||
const u8 gSlotMachineReelTimeExplosion0[] = INCBIN_U8("graphics/slot_machine/reel_time_explosion/0.4bpp");
|
||||
const u8 gSlotMachineReelTimeExplosion1[] = INCBIN_U8("graphics/slot_machine/reel_time_explosion/1.4bpp");
|
||||
@@ -59,5 +53,5 @@ const u8 gSlotMachineReelTimeExplosion1[] = INCBIN_U8("graphics/slot_machine/ree
|
||||
const u8 gSlotMachineReelTimeShadow[] = INCBIN_U8("graphics/slot_machine/shadow.4bpp");
|
||||
const u8 gSlotMachineReelTimePikaAura[] = INCBIN_U8("graphics/slot_machine/pika_aura.4bpp");
|
||||
|
||||
const u8 gUnknown_08DD19F8[] = INCBIN_U8("graphics/unknown/unknown_DD19F8.bin");
|
||||
const u8 gUnknown_08DD1A18[] = INCBIN_U8("graphics/unknown/unknown_DD1A18.4bpp");
|
||||
const u8 gSlotMachineReelBackground_Tilemap[] = INCBIN_U8("graphics/slot_machine/reel_background.bin");
|
||||
const u8 gSlotMachineReelTimeNumberGap_Gfx[] = INCBIN_U8("graphics/slot_machine/reel_time_number_gap.4bpp");
|
||||
|
||||
+3
-3
@@ -3426,7 +3426,7 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_KEY_ITEMS,
|
||||
.type = 2,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_Rod,
|
||||
.secondaryId = 0,
|
||||
.secondaryId = OLD_ROD,
|
||||
},
|
||||
|
||||
[ITEM_GOOD_ROD] =
|
||||
@@ -3440,7 +3440,7 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_KEY_ITEMS,
|
||||
.type = 2,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_Rod,
|
||||
.secondaryId = 1,
|
||||
.secondaryId = GOOD_ROD,
|
||||
},
|
||||
|
||||
[ITEM_SUPER_ROD] =
|
||||
@@ -3454,7 +3454,7 @@ const struct Item gItems[] =
|
||||
.pocket = POCKET_KEY_ITEMS,
|
||||
.type = 2,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_Rod,
|
||||
.secondaryId = 2,
|
||||
.secondaryId = SUPER_ROD,
|
||||
},
|
||||
|
||||
[ITEM_SS_TICKET] =
|
||||
|
||||
@@ -252,7 +252,7 @@ const u32 gObjectEventPic_CableCar[] = INCBIN_U32("graphics/object_events/pics/m
|
||||
const u16 gObjectEventPalette20[] = INCBIN_U16("graphics/object_events/palettes/20.gbapal");
|
||||
const u32 gObjectEventPic_SSTidal[] = INCBIN_U32("graphics/object_events/pics/misc/ss_tidal.4bpp");
|
||||
const u16 gObjectEventPalette21[] = INCBIN_U16("graphics/object_events/palettes/21.gbapal");
|
||||
const u32 gFieldEffectObjectPic_BerryTreeGrowthSparkle[] = INCBIN_U32("graphics/field_effects/pics/berry_tree_growth_sparkle.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Sparkle[] = INCBIN_U32("graphics/field_effects/pics/sparkle.4bpp");
|
||||
const u32 gObjectEventPic_BerryTreeDirtPile[] = INCBIN_U32("graphics/object_events/pics/berry_trees/dirt_pile.4bpp");
|
||||
const u32 gObjectEventPic_BerryTreeSprout[] = INCBIN_U32("graphics/object_events/pics/berry_trees/sprout.4bpp");
|
||||
const u32 gObjectEventPic_PechaBerryTree[] = INCBIN_U32("graphics/object_events/pics/berry_trees/pecha.4bpp");
|
||||
@@ -293,43 +293,43 @@ const u32 gFieldEffectObjectPic_ShadowSmall[] = INCBIN_U32("graphics/field_effec
|
||||
const u32 gFieldEffectObjectPic_ShadowMedium[] = INCBIN_U32("graphics/field_effects/pics/shadow_medium.4bpp");
|
||||
const u32 gFieldEffectObjectPic_ShadowLarge[] = INCBIN_U32("graphics/field_effects/pics/shadow_large.4bpp");
|
||||
const u32 gFieldEffectObjectPic_ShadowExtraLarge[] = INCBIN_U32("graphics/field_effects/pics/shadow_extra_large.4bpp");
|
||||
const u32 filler_8368A08[0x48] = {};
|
||||
static const u32 sFiller[0x48] = {};
|
||||
const u8 gFieldEffectPic_CutGrass[] = INCBIN_U8("graphics/field_effects/pics/cut_grass.4bpp");
|
||||
const u32 gFieldEffectPic_CutGrass_Copy[] = INCBIN_U32("graphics/field_effects/pics/cut_grass.4bpp");
|
||||
const u16 gFieldEffectObjectPalette6[] = INCBIN_U16("graphics/field_effects/palettes/06.gbapal");
|
||||
const u16 gFieldEffectPal_CutGrass[] = INCBIN_U16("graphics/field_effects/palettes/cut_grass.gbapal");
|
||||
const u32 gFieldEffectObjectPic_Ripple[] = INCBIN_U32("graphics/field_effects/pics/ripple.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Ash[] = INCBIN_U32("graphics/field_effects/pics/ash.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Arrow[] = INCBIN_U32("graphics/field_effects/pics/arrow.4bpp");
|
||||
const u16 gFieldEffectObjectPalette0[] = INCBIN_U16("graphics/field_effects/palettes/00.gbapal");
|
||||
const u16 gFieldEffectObjectPalette1[] = INCBIN_U16("graphics/field_effects/palettes/01.gbapal");
|
||||
const u16 gFieldEffectObjectPalette0[] = INCBIN_U16("graphics/field_effects/palettes/general_0.gbapal");
|
||||
const u16 gFieldEffectObjectPalette1[] = INCBIN_U16("graphics/field_effects/palettes/general_1.gbapal");
|
||||
const u32 gFieldEffectObjectPic_GroundImpactDust[] = INCBIN_U32("graphics/field_effects/pics/ground_impact_dust.4bpp");
|
||||
const u32 gFieldEffectObjectPic_BikeHopTallGrass[] = INCBIN_U32("graphics/field_effects/pics/bike_hop_tall_grass.4bpp");
|
||||
const u32 gUnusedGrass[] = INCBIN_U32("graphics/field_effects/pics/unused_grass.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Unknown16[] = INCBIN_U32("graphics/field_effects/pics/unknown_16.4bpp");
|
||||
const u32 gFieldEffectObjectPic_JumpTallGrass[] = INCBIN_U32("graphics/field_effects/pics/jump_tall_grass.4bpp");
|
||||
const u32 gUnusedGrass3[] = INCBIN_U32("graphics/field_effects/pics/unused_grass_3.4bpp");
|
||||
const u32 gFieldEffectObjectPic_JumpLongGrass[] = INCBIN_U32("graphics/field_effects/pics/unknown_16.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Unknown17[] = INCBIN_U32("graphics/field_effects/pics/unknown_17.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Unknown18[] = INCBIN_U32("graphics/field_effects/pics/unknown_18.4bpp");
|
||||
const u32 gFieldEffectObjectPic_UnusedGrass2[] = INCBIN_U32("graphics/field_effects/pics/unused_grass_2.4bpp");
|
||||
const u32 gFieldEffectObjectPic_LongGrass[] = INCBIN_U32("graphics/field_effects/pics/long_grass.4bpp");
|
||||
const u32 gFieldEffectObjectPic_TallGrass[] = INCBIN_U32("graphics/field_effects/pics/tall_grass.4bpp");
|
||||
const u32 gFieldEffectObjectPic_ShortGrass[] = INCBIN_U32("graphics/field_effects/pics/short_grass.4bpp");
|
||||
const u32 gFieldEffectObjectPic_SandFootprints[] = INCBIN_U32("graphics/field_effects/pics/sand_footprints.4bpp");
|
||||
const u32 gFieldEffectObjectPic_DeepSandFootprints[] = INCBIN_U32("graphics/field_effects/pics/deep_sand_footprints.4bpp");
|
||||
const u32 gFieldEffectObjectPic_BikeTireTracks[] = INCBIN_U32("graphics/field_effects/pics/bike_tire_tracks.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Unknown19[] = INCBIN_U32("graphics/field_effects/pics/unknown_19.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Unknown29[] = INCBIN_U32("graphics/field_effects/pics/unknown_29.4bpp");
|
||||
const u32 gFieldEffectObjectPic_BikeHopBigSplash[] = INCBIN_U32("graphics/field_effects/pics/bike_hop_big_splash.4bpp");
|
||||
const u32 gFieldEffectObjectPic_UnusedSand[] = INCBIN_U32("graphics/field_effects/pics/unused_sand.4bpp");
|
||||
const u32 gFieldEffectObjectPic_SandPile[] = INCBIN_U32("graphics/field_effects/pics/sand_pile.4bpp");
|
||||
const u32 gFieldEffectObjectPic_JumpBigSplash[] = INCBIN_U32("graphics/field_effects/pics/jump_big_splash.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Splash[] = INCBIN_U32("graphics/field_effects/pics/splash.4bpp");
|
||||
const u32 gFieldEffectObjectPic_BikeHopSmallSplash[] = INCBIN_U32("graphics/field_effects/pics/bike_hop_small_splash.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Unknown20[] = INCBIN_U32("graphics/field_effects/pics/unknown_20.4bpp");
|
||||
const u32 gFieldEffectObjectPic_JumpSmallSplash[] = INCBIN_U32("graphics/field_effects/pics/jump_small_splash.4bpp");
|
||||
const u32 gFieldEffectObjectPic_WaterSurfacing[] = INCBIN_U32("graphics/field_effects/pics/water_surfacing.4bpp");
|
||||
const u32 gFieldEffectObjectPic_TreeDisguise[] = INCBIN_U32("graphics/field_effects/pics/tree_disguise.4bpp");
|
||||
const u32 gFieldEffectObjectPic_MountainDisguise[] = INCBIN_U32("graphics/field_effects/pics/mountain_disguise.4bpp");
|
||||
const u32 gFieldEffectObjectPic_SandDisguisePlaceholder[] = INCBIN_U32("graphics/field_effects/pics/sand_disguise_placeholder.4bpp");
|
||||
const u32 gFieldEffectObjectPic_HotSpringsWater[] = INCBIN_U32("graphics/field_effects/pics/hot_springs_water.4bpp");
|
||||
const u16 gFieldEffectObjectPalette2[] = INCBIN_U16("graphics/field_effects/palettes/02.gbapal");
|
||||
const u32 gFieldEffectObjectPic_JumpOutOfAsh[] = INCBIN_U32("graphics/field_effects/pics/jump_out_of_ash.4bpp");
|
||||
const u32 gFieldEffectObjectPic_LavaridgeGymWarp[] = INCBIN_U32("graphics/field_effects/pics/lavaridge_gym_warp.4bpp");
|
||||
const u16 gFieldEffectPal_Ash[] = INCBIN_U16("graphics/field_effects/palettes/ash.gbapal");
|
||||
const u32 gFieldEffectObjectPic_AshPuff[] = INCBIN_U32("graphics/field_effects/pics/ash_puff.4bpp");
|
||||
const u32 gFieldEffectObjectPic_AshLaunch[] = INCBIN_U32("graphics/field_effects/pics/ash_launch.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Bubbles[] = INCBIN_U32("graphics/field_effects/pics/bubbles.4bpp");
|
||||
const u32 gFieldEffectObjectPic_Unknown35[] = INCBIN_U32("graphics/field_effects/pics/unknown_35.4bpp");
|
||||
const u16 gFieldEffectObjectPalette3[] = INCBIN_U16("graphics/field_effects/palettes/03.gbapal");
|
||||
const u32 gFieldEffectObjectPic_SmallSparkle[] = INCBIN_U32("graphics/field_effects/pics/small_sparkle.4bpp");
|
||||
const u16 gFieldEffectPal_SmallSparkle[] = INCBIN_U16("graphics/field_effects/palettes/small_sparkle.gbapal");
|
||||
const u32 gFieldEffectObjectPic_Bird[] = INCBIN_U32("graphics/field_effects/pics/bird.4bpp");
|
||||
const u32 gObjectEventPic_Juan[] = INCBIN_U32("graphics/object_events/pics/people/gym_leaders/juan.4bpp");
|
||||
const u32 gObjectEventPic_Scott[] = INCBIN_U32("graphics/object_events/pics/people/scott.4bpp");
|
||||
|
||||
@@ -222,7 +222,7 @@ static const u8 *const sAwaitingResponseTexts[] = {
|
||||
ALIGNED(4) const u8 sText_ShowTrainerCard[] = _("The other TRAINER showed\nyou their TRAINER CARD.\pWould you like to show your\nTRAINER CARD?");
|
||||
ALIGNED(4) const u8 sText_BattleChallenge[] = _("The other TRAINER challenges you\nto battle.\pWill you accept the battle\nchallenge?");
|
||||
ALIGNED(4) const u8 sText_ChatInvitation[] = _("The other TRAINER invites you\nto chat.\pWill you accept the chat\ninvitation?");
|
||||
ALIGNED(4) const u8 sText_OfferToTradeMon[] = _("There is an offer to trade your\nregistered Lv. {SPECIAL_F7 0x00} {SPECIAL_F7 0x01}\pin exchange for a\nLv. {SPECIAL_F7 0x02} {SPECIAL_F7 0x03}.\pWill you accept this trade\noffer?");
|
||||
ALIGNED(4) const u8 sText_OfferToTradeMon[] = _("There is an offer to trade your\nregistered Lv. {DYNAMIC 0} {DYNAMIC 1}\pin exchange for a\nLv. {DYNAMIC 2} {DYNAMIC 3}.\pWill you accept this trade\noffer?");
|
||||
ALIGNED(4) const u8 sText_OfferToTradeEgg[] = _("There is an offer to trade your\nregistered EGG.\lWill you accept this trade offer?");
|
||||
ALIGNED(4) const u8 sText_ChatDropped[] = _("The chat has been dropped.\p");
|
||||
ALIGNED(4) const u8 sText_OfferDeclined1[] = _("You declined the offer.\p");
|
||||
@@ -567,17 +567,17 @@ static const u8 *const sCardColorTexts[] = {
|
||||
sText_ItsGoldCard
|
||||
};
|
||||
|
||||
ALIGNED(4) const u8 sText_TrainerCardInfoPage1[] = _("This is {SPECIAL_F7 0x00} {SPECIAL_F7 0x01}'s\nTRAINER CARD…\l{SPECIAL_F7 0x02}\pPOKéDEX: {SPECIAL_F7 0x03}\nTIME: {SPECIAL_F7 0x04}:{SPECIAL_F7 0x05}\p");
|
||||
ALIGNED(4) const u8 sText_TrainerCardInfoPage2[] = _("BATTLES: WINS: {SPECIAL_F7 0x00} LOSSES: {SPECIAL_F7 0x02}\nTRADES: {SPECIAL_F7 0x03}\p“{SPECIAL_F7 0x04} {SPECIAL_F7 0x05}\n{SPECIAL_F7 0x06} {SPECIAL_F7 0x07}”\p");
|
||||
ALIGNED(4) const u8 sText_GladToMeetYouMale[] = _("{SPECIAL_F7 0x01}: Glad to have met you!{PAUSE 60}");
|
||||
ALIGNED(4) const u8 sText_GladToMeetYouFemale[] = _("{SPECIAL_F7 0x01}: Glad to meet you!{PAUSE 60}");
|
||||
ALIGNED(4) const u8 sText_TrainerCardInfoPage1[] = _("This is {DYNAMIC 0} {DYNAMIC 1}'s\nTRAINER CARD…\l{DYNAMIC 2}\pPOKéDEX: {DYNAMIC 3}\nTIME: {DYNAMIC 4}:{DYNAMIC 5}\p");
|
||||
ALIGNED(4) const u8 sText_TrainerCardInfoPage2[] = _("BATTLES: WINS: {DYNAMIC 0} LOSSES: {DYNAMIC 2}\nTRADES: {DYNAMIC 3}\p“{DYNAMIC 4} {DYNAMIC 5}\n{DYNAMIC 6} {DYNAMIC 7}”\p");
|
||||
ALIGNED(4) const u8 sText_GladToMeetYouMale[] = _("{DYNAMIC 1}: Glad to have met you!{PAUSE 60}");
|
||||
ALIGNED(4) const u8 sText_GladToMeetYouFemale[] = _("{DYNAMIC 1}: Glad to meet you!{PAUSE 60}");
|
||||
|
||||
const u8 *const sGladToMeetYouTexts[GENDER_COUNT] = {
|
||||
sText_GladToMeetYouMale,
|
||||
sText_GladToMeetYouFemale
|
||||
};
|
||||
|
||||
ALIGNED(4) const u8 sText_FinishedCheckingPlayersTrainerCard[] = _("Finished checking {SPECIAL_F7 0x01}'s\nTRAINER CARD.{PAUSE 60}");
|
||||
ALIGNED(4) const u8 sText_FinishedCheckingPlayersTrainerCard[] = _("Finished checking {DYNAMIC 1}'s\nTRAINER CARD.{PAUSE 60}");
|
||||
|
||||
static const u8 *const sLinkGroupActivityNameTexts[] = {
|
||||
[ACTIVITY_NONE] = sText_EmptyString,
|
||||
|
||||
+1
-1
@@ -1623,7 +1623,7 @@ static void AttemptPlaceDecoration_(u8 taskId)
|
||||
}
|
||||
else
|
||||
{
|
||||
PlaySE(SE_HAZURE);
|
||||
PlaySE(SE_FAILURE);
|
||||
StringExpandPlaceholders(gStringVar4, gText_CantBePlacedHere);
|
||||
DisplayItemMessageOnField(taskId, gStringVar4, CantPlaceDecorationPrompt);
|
||||
}
|
||||
|
||||
+3
-1
@@ -225,7 +225,9 @@ void TrendyPhraseIsOld(void)
|
||||
|
||||
if (gSaveBlock1Ptr->easyChatPairs[0].unk0_0 - gSaveBlock1Ptr->easyChatPairs[1].unk0_0 < 2)
|
||||
{
|
||||
asm("":::"r2"); //Force the compiler to store address of gSaveBlock1 in r3 instead of r2
|
||||
#ifndef NONMATCHING
|
||||
asm("":::"r2"); //Force the compiler to store address of gSaveBlock1 in r3 instead of r2
|
||||
#endif
|
||||
if (!gSaveBlock1Ptr->easyChatPairs[0].unk1_6 && gSaveBlock1Ptr->easyChatPairs[1].unk1_6)
|
||||
result = 1;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ struct DigitPrinterAlloc
|
||||
};
|
||||
|
||||
// this file's functions
|
||||
static u8 GetFirstOamId(u8 oamCount);;
|
||||
static u8 GetFirstOamId(u8 oamCount);
|
||||
static void CopyWorkToOam(struct DigitPrinter *objWork);
|
||||
static void DrawNumObjsLeadingZeros(struct DigitPrinter *objWork, s32 num, bool32 sign);
|
||||
static void DrawNumObjsMinusInFront(struct DigitPrinter *objWork, s32 num, bool32 sign);
|
||||
|
||||
+25
-25
@@ -467,7 +467,7 @@ void StartDodrioBerryPicking(u16 a0, void (*callback)(void))
|
||||
sub_80273F0();
|
||||
sub_8026B5C(gUnknown_02022C98->unk24, &gUnknown_02022C98->unk44, &gUnknown_02022C98->unk48);
|
||||
StopMapMusic();
|
||||
PlayNewMapMusic(MUS_RG_KINOMIKUI);
|
||||
PlayNewMapMusic(MUS_RG_BERRY_PICK);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -558,7 +558,7 @@ static void sub_8024BC8(u8 taskId)
|
||||
case 2:
|
||||
if (!sub_802A770())
|
||||
{
|
||||
sub_8010434();
|
||||
Rfu_SetLinkStandbyCallback();
|
||||
gUnknown_02022C98->unk0C++;
|
||||
}
|
||||
break;
|
||||
@@ -671,7 +671,7 @@ static void sub_8024E38(void)
|
||||
gUnknown_02022C98->unk10++;
|
||||
break;
|
||||
case 1:
|
||||
sub_8010434();
|
||||
Rfu_SetLinkStandbyCallback();
|
||||
gUnknown_02022C98->unk10++;
|
||||
break;
|
||||
case 2:
|
||||
@@ -690,7 +690,7 @@ static void sub_8024E38(void)
|
||||
case 4:
|
||||
if (++gUnknown_02022C98->unk30 > 5)
|
||||
{
|
||||
sub_8010434();
|
||||
Rfu_SetLinkStandbyCallback();
|
||||
gUnknown_02022C98->unk10++;
|
||||
}
|
||||
break;
|
||||
@@ -877,7 +877,7 @@ static void sub_8025198(void)
|
||||
if (WaitFanfare(TRUE))
|
||||
{
|
||||
sub_8026240(6);
|
||||
FadeOutAndPlayNewMapMusic(MUS_RG_WIN_YASEI, 4);
|
||||
FadeOutAndPlayNewMapMusic(MUS_RG_VICTORY_WILD, 4);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -916,7 +916,7 @@ static void sub_8025230(void)
|
||||
if (WaitFanfare(TRUE)) {
|
||||
gUnknown_02022C98->unk114 = gUnknown_02022C98->unk4A[gUnknown_02022C98->multiplayerId][5];
|
||||
sub_8026240(6);
|
||||
FadeOutAndPlayNewMapMusic(MUS_RG_WIN_YASEI, 4);
|
||||
FadeOutAndPlayNewMapMusic(MUS_RG_VICTORY_WILD, 4);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1081,7 +1081,7 @@ static void sub_8025644(void)
|
||||
switch (gUnknown_02022C98->unk10)
|
||||
{
|
||||
case 0:
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
sub_80292E0(7);
|
||||
gUnknown_02022C98->unk10++;
|
||||
break;
|
||||
@@ -1174,7 +1174,7 @@ static void sub_8025758(void)
|
||||
gUnknown_02022C98->unk10++;
|
||||
break;
|
||||
case 4:
|
||||
PlayNewMapMusic(MUS_RG_KINOMIKUI);
|
||||
PlayNewMapMusic(MUS_RG_BERRY_PICK);
|
||||
sub_8028E4C();
|
||||
gUnknown_02022C98->unk10++;
|
||||
break;
|
||||
@@ -1458,8 +1458,8 @@ static void sub_8025F48(void)
|
||||
{
|
||||
if (gUnknown_02022C98->unk144 == 0)
|
||||
{
|
||||
m4aSongNumStop(SE_SEIKAI);
|
||||
PlaySE(SE_SEIKAI);
|
||||
m4aSongNumStop(SE_SUCCESS);
|
||||
PlaySE(SE_SUCCESS);
|
||||
gUnknown_02022C98->unk144 = 1;
|
||||
}
|
||||
}
|
||||
@@ -1480,7 +1480,7 @@ static void sub_8025F48(void)
|
||||
}
|
||||
else if (gUnknown_02022C98->unk154 == 1)
|
||||
{
|
||||
PlayFanfareByFanfareNum(11); // MUS_ME_ZANNEN
|
||||
PlayFanfareByFanfareNum(11); // MUS_TOO_BAD
|
||||
gUnknown_02022C98->unk154 = 2;
|
||||
}
|
||||
}
|
||||
@@ -1501,8 +1501,8 @@ static void sub_8026044(void)
|
||||
{
|
||||
if (gUnknown_02022C98->unk144 == 0)
|
||||
{
|
||||
m4aSongNumStop(SE_SEIKAI);
|
||||
PlaySE(SE_SEIKAI);
|
||||
m4aSongNumStop(SE_SUCCESS);
|
||||
PlaySE(SE_SUCCESS);
|
||||
gUnknown_02022C98->unk144 = 1;
|
||||
}
|
||||
}
|
||||
@@ -1522,7 +1522,7 @@ static void sub_8026044(void)
|
||||
{
|
||||
if (gUnknown_02022C98->unk148[r4] == 0)
|
||||
{
|
||||
PlaySE(SE_FUUSEN1 + ptr->unk0[r4]);
|
||||
PlaySE(SE_BALLOON_RED + ptr->unk0[r4]);
|
||||
gUnknown_02022C98->unk148[r4] = 1;
|
||||
}
|
||||
}
|
||||
@@ -1538,7 +1538,7 @@ static void sub_8026044(void)
|
||||
}
|
||||
else if (gUnknown_02022C98->unk154 == 1)
|
||||
{
|
||||
PlayFanfareByFanfareNum(11); // MUS_ME_ZANNEN
|
||||
PlayFanfareByFanfareNum(11); // MUS_TOO_BAD
|
||||
gUnknown_02022C98->unk154 = 2;
|
||||
}
|
||||
}
|
||||
@@ -1792,7 +1792,7 @@ static void sub_802671C(void)
|
||||
if (gUnknown_02022C98->unk148[i] == 0)
|
||||
{
|
||||
gUnknown_02022C98->unk148[i] = 1;
|
||||
PlaySE(SE_FUUSEN1 + ptr->unk32CC.unk14.unk0[i]);
|
||||
PlaySE(SE_BALLOON_RED + ptr->unk32CC.unk14.unk0[i]);
|
||||
}
|
||||
if (gUnknown_02022C98->unk40 < 10 || r10 == 1)
|
||||
{
|
||||
@@ -2359,19 +2359,19 @@ static void sub_8027554(void)
|
||||
{
|
||||
gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk0 = 2;
|
||||
gUnknown_02022C98->unkB0[gUnknown_02022C98->multiplayerId] = 6;
|
||||
PlaySE(SE_W204);
|
||||
PlaySE(SE_M_CHARM);
|
||||
}
|
||||
else if (gMain.newKeys & DPAD_LEFT)
|
||||
{
|
||||
gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk0 = 3;
|
||||
gUnknown_02022C98->unkB0[gUnknown_02022C98->multiplayerId] = 6;
|
||||
PlaySE(SE_W204);
|
||||
PlaySE(SE_M_CHARM);
|
||||
}
|
||||
else if (gMain.newKeys & DPAD_RIGHT)
|
||||
{
|
||||
gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk0 = 1;
|
||||
gUnknown_02022C98->unkB0[gUnknown_02022C98->multiplayerId] = 6;
|
||||
PlaySE(SE_W204);
|
||||
PlaySE(SE_M_CHARM);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3450,7 +3450,7 @@ static u32 sub_80285AC(struct Sprite *sprite)
|
||||
u8 mod = (++sprite->data[1] / 13) % 4;
|
||||
|
||||
if (sprite->data[1] % 13 == 0 && mod != 0)
|
||||
PlaySE(SE_W204);
|
||||
PlaySE(SE_M_CHARM);
|
||||
if (sprite->data[1] >= 104)
|
||||
{
|
||||
sprite->data[0] = 0;
|
||||
@@ -3567,7 +3567,7 @@ static bool32 sub_8028828(void)
|
||||
continue;
|
||||
gUnknown_02022CF4->unkC[i] = 1;
|
||||
gUnknown_02022CF4->unk16[i] = -16;
|
||||
PlaySE(SE_TK_KASYA);
|
||||
PlaySE(SE_CLICK);
|
||||
}
|
||||
sprite->pos1.y += gUnknown_02022CF4->unk16[i];
|
||||
}
|
||||
@@ -4320,7 +4320,7 @@ static void sub_802988C(void)
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
PlayNewMapMusic(MUS_FANFA1);
|
||||
PlayNewMapMusic(MUS_LEVEL_UP);
|
||||
FillWindowPixelBuffer(gUnknown_02022CF8->unk3008[0], PIXEL_FILL(1));
|
||||
FillWindowPixelBuffer(gUnknown_02022CF8->unk3008[1], PIXEL_FILL(1));
|
||||
strWidth = GetStringWidth(1, gText_AnnouncingPrizes, -1);
|
||||
@@ -4354,7 +4354,7 @@ static void sub_802988C(void)
|
||||
PutWindowTilemap(gUnknown_02022CF8->unk3008[1]);
|
||||
}
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
FadeOutAndFadeInNewMapMusic(MUS_RG_WIN_YASEI, 20, 10);
|
||||
FadeOutAndFadeInNewMapMusic(MUS_RG_VICTORY_WILD, 20, 10);
|
||||
gUnknown_02022CF8->state++;
|
||||
break;
|
||||
case 11:
|
||||
@@ -4629,7 +4629,7 @@ static void sub_802A7A8(void)
|
||||
ChangeBgX(3, 0, 0);
|
||||
ChangeBgY(3, 0, 0);
|
||||
InitStandardTextBoxWindows();
|
||||
sub_8197200();
|
||||
InitTextBoxGfxAndPrinters();
|
||||
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
|
||||
SetBgTilemapBuffer(3, gUnknown_02022CF8->tilemapBuffers[0]);
|
||||
SetBgTilemapBuffer(1, gUnknown_02022CF8->tilemapBuffers[1]);
|
||||
@@ -4657,7 +4657,7 @@ static bool32 sub_802A8E8(void)
|
||||
return FALSE;
|
||||
break;
|
||||
case 5:
|
||||
LoadPalette(stdpal_get(3), 0xD0, 0x20);
|
||||
LoadPalette(GetTextWindowPalette(3), 0xD0, 0x20);
|
||||
break;
|
||||
default:
|
||||
gUnknown_02022CF8->unk3018 = 0;
|
||||
|
||||
@@ -32,7 +32,7 @@ u8 *DynamicPlaceholderTextUtil_ExpandPlaceholders(u8 *dest, const u8 *src)
|
||||
{
|
||||
while (*src != EOS)
|
||||
{
|
||||
if (*src != CHAR_SPECIAL_F7)
|
||||
if (*src != CHAR_DYNAMIC)
|
||||
{
|
||||
*dest++ = *src++;
|
||||
}
|
||||
|
||||
+11
-11
@@ -2023,7 +2023,7 @@ static int sub_811B368(void)
|
||||
{
|
||||
if (sEasyChatScreen->type == EASY_CHAT_TYPE_BARD_SONG)
|
||||
{
|
||||
PlaySE(SE_HAZURE);
|
||||
PlaySE(SE_FAILURE);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
@@ -2038,7 +2038,7 @@ static int sub_811B394(void)
|
||||
u16 easyChatWord = sub_811F578(sub_811B940());
|
||||
if (sub_811BF88(easyChatWord))
|
||||
{
|
||||
PlaySE(SE_HAZURE);
|
||||
PlaySE(SE_FAILURE);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
@@ -2537,7 +2537,7 @@ u8 sub_811BBBC(void)
|
||||
return sEasyChatScreen->unk_0c;
|
||||
}
|
||||
|
||||
void sub_811BBC8(u8 *arg0, u8 *arg1)
|
||||
static void sub_811BBC8(s8 *arg0, s8 *arg1)
|
||||
{
|
||||
*arg0 = sEasyChatScreen->unk_10;
|
||||
*arg1 = sEasyChatScreen->unk_11;
|
||||
@@ -4529,18 +4529,18 @@ static void sub_811E30C(void)
|
||||
x = var0 * 13;
|
||||
x = x * 8 + 28;
|
||||
y = var1 * 16 + 96;
|
||||
sub_811E34C(x, y);
|
||||
sub_811E34C((u8)x, (u8)y);
|
||||
}
|
||||
|
||||
static void sub_811E34C(u8 x, u8 y)
|
||||
{
|
||||
if (sUnknown_0203A11C->unk2E4)
|
||||
{
|
||||
sUnknown_0203A11C->unk2E4->pos1.x = x;
|
||||
sUnknown_0203A11C->unk2E4->pos1.y = y;
|
||||
sUnknown_0203A11C->unk2E4->pos2.x = 0;
|
||||
sUnknown_0203A11C->unk2E4->data[0] = 0;
|
||||
}
|
||||
if (!sUnknown_0203A11C->unk2E4)
|
||||
return;
|
||||
|
||||
sUnknown_0203A11C->unk2E4->pos1.x = (s16)x;
|
||||
sUnknown_0203A11C->unk2E4->pos1.y = (s16)y;
|
||||
sUnknown_0203A11C->unk2E4->pos2.x = 0;
|
||||
sUnknown_0203A11C->unk2E4->data[0] = 0;
|
||||
}
|
||||
|
||||
static void sub_811E380(void)
|
||||
|
||||
+9
-9
@@ -578,10 +578,10 @@ static void Task_EggHatchPlayBGM(u8 taskID)
|
||||
PlayRainStoppingSoundEffect();
|
||||
}
|
||||
if (gTasks[taskID].data[0] == 1)
|
||||
PlayBGM(MUS_ME_SHINKA);
|
||||
PlayBGM(MUS_EVOLUTION_INTRO);
|
||||
if (gTasks[taskID].data[0] > 60)
|
||||
{
|
||||
PlayBGM(MUS_SHINKA);
|
||||
PlayBGM(MUS_EVOLUTION);
|
||||
DestroyTask(taskID);
|
||||
// UB: task is destroyed, yet the value is incremented
|
||||
}
|
||||
@@ -637,7 +637,7 @@ static void CB2_EggHatch_1(void)
|
||||
GetMonNickname2(&gPlayerParty[sEggHatchData->eggPartyID], gStringVar1);
|
||||
StringExpandPlaceholders(gStringVar4, gText_HatchedFromEgg);
|
||||
EggHatchPrintMessage(sEggHatchData->windowId, gStringVar4, 0, 3, 0xFF);
|
||||
PlayFanfare(MUS_FANFA5);
|
||||
PlayFanfare(MUS_EVOLVED);
|
||||
sEggHatchData->CB2_state++;
|
||||
PutWindowTilemap(sEggHatchData->windowId);
|
||||
CopyWindowToVram(sEggHatchData->windowId, 3);
|
||||
@@ -672,7 +672,7 @@ static void CB2_EggHatch_1(void)
|
||||
species = GetMonData(&gPlayerParty[sEggHatchData->eggPartyID], MON_DATA_SPECIES);
|
||||
gender = GetMonGender(&gPlayerParty[sEggHatchData->eggPartyID]);
|
||||
personality = GetMonData(&gPlayerParty[sEggHatchData->eggPartyID], MON_DATA_PERSONALITY, 0);
|
||||
DoNamingScreen(3, gStringVar3, species, gender, personality, EggHatchSetMonNickname);
|
||||
DoNamingScreen(NAMING_SCREEN_NICKNAME, gStringVar3, species, gender, personality, EggHatchSetMonNickname);
|
||||
break;
|
||||
case 1:
|
||||
case -1:
|
||||
@@ -716,7 +716,7 @@ static void SpriteCB_Egg_0(struct Sprite* sprite)
|
||||
sprite->pos2.x = Sin(sprite->data[1], 1);
|
||||
if (sprite->data[0] == 15)
|
||||
{
|
||||
PlaySE(SE_BOWA);
|
||||
PlaySE(SE_BALL);
|
||||
StartSpriteAnim(sprite, 1);
|
||||
CreateRandomEggShardSprite();
|
||||
}
|
||||
@@ -739,7 +739,7 @@ static void SpriteCB_Egg_1(struct Sprite* sprite)
|
||||
sprite->pos2.x = Sin(sprite->data[1], 2);
|
||||
if (sprite->data[0] == 15)
|
||||
{
|
||||
PlaySE(SE_BOWA);
|
||||
PlaySE(SE_BALL);
|
||||
StartSpriteAnim(sprite, 2);
|
||||
}
|
||||
}
|
||||
@@ -766,13 +766,13 @@ static void SpriteCB_Egg_2(struct Sprite* sprite)
|
||||
sprite->pos2.x = Sin(sprite->data[1], 2);
|
||||
if (sprite->data[0] == 15)
|
||||
{
|
||||
PlaySE(SE_BOWA);
|
||||
PlaySE(SE_BALL);
|
||||
StartSpriteAnim(sprite, 2);
|
||||
CreateRandomEggShardSprite();
|
||||
CreateRandomEggShardSprite();
|
||||
}
|
||||
if (sprite->data[0] == 30)
|
||||
PlaySE(SE_BOWA);
|
||||
PlaySE(SE_BALL);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -799,7 +799,7 @@ static void SpriteCB_Egg_4(struct Sprite* sprite)
|
||||
sprite->data[0]++;
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
PlaySE(SE_TAMAGO);
|
||||
PlaySE(SE_EGG_HATCH);
|
||||
sprite->invisible = TRUE;
|
||||
sprite->callback = SpriteCB_Egg_5;
|
||||
sprite->data[0] = 0;
|
||||
|
||||
@@ -153,7 +153,7 @@ static u32 sub_81D4EE4(u8 *arg0, u16 *arg1)
|
||||
case 2:
|
||||
if (GetLinkPlayerCount_2() == 2)
|
||||
{
|
||||
PlaySE(SE_PINPON);
|
||||
PlaySE(SE_DING_DONG);
|
||||
CheckShouldAdvanceLinkState();
|
||||
*arg1 = 0;
|
||||
*arg0 = 3;
|
||||
@@ -192,7 +192,7 @@ static u32 sub_81D4EE4(u8 *arg0, u16 *arg1)
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
sub_800ABF4(0);
|
||||
SetCloseLinkCallbackAndType(0);
|
||||
*arg0 = 5;
|
||||
break;
|
||||
case 5:
|
||||
@@ -403,7 +403,7 @@ static void sub_81D5084(u8 taskId)
|
||||
break;
|
||||
case 15:
|
||||
data->unkE = EReader_IsReceivedDataValid((struct EReaderTrainerHillSet *)gDecompressionBuffer);
|
||||
sub_800ABF4(data->unkE);
|
||||
SetCloseLinkCallbackAndType(data->unkE);
|
||||
data->unk8 = 16;
|
||||
break;
|
||||
case 16:
|
||||
@@ -431,7 +431,7 @@ static void sub_81D5084(u8 taskId)
|
||||
if (sub_81D5064(&data->unk0, 120))
|
||||
{
|
||||
AddTextPrinterToWindow1(gJPText_NewTrainerHasComeToHoenn);
|
||||
PlayFanfare(MUS_FANFA4);
|
||||
PlayFanfare(MUS_OBTAIN_ITEM);
|
||||
data->unk8 = 19;
|
||||
}
|
||||
break;
|
||||
|
||||
+96
-121
@@ -130,6 +130,9 @@ static struct ObjectEventTemplate *FindObjectEventTemplateByLocalId(u8 localId,
|
||||
static void ClearObjectEventMovement(struct ObjectEvent *, struct Sprite *);
|
||||
static void ObjectEventSetSingleMovement(struct ObjectEvent *, struct Sprite *, u8);
|
||||
static void oamt_npc_ministep_reset(struct Sprite *, u8, u8);
|
||||
static void UpdateObjectEventSpriteSubpriorityAndVisibility(struct Sprite *);
|
||||
static void InitSpriteForFigure8Anim(struct Sprite *sprite);
|
||||
static bool8 AnimateSpriteInFigure8(struct Sprite *sprite);
|
||||
static void UpdateObjectEventSprite(struct Sprite *);
|
||||
|
||||
const u8 gReflectionEffectPaletteMap[] = {1, 1, 6, 7, 8, 9, 6, 7, 8, 9, 11, 11, 0, 0, 0, 0};
|
||||
@@ -1122,13 +1125,13 @@ void ResetObjectEvents(void)
|
||||
|
||||
static void CreateReflectionEffectSprites(void)
|
||||
{
|
||||
u8 spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[21], 0, 0, 31);
|
||||
u8 spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_REFLECTION_DISTORTION], 0, 0, 31);
|
||||
gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL;
|
||||
InitSpriteAffineAnim(&gSprites[spriteId]);
|
||||
StartSpriteAffineAnim(&gSprites[spriteId], 0);
|
||||
gSprites[spriteId].invisible = TRUE;
|
||||
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[21], 0, 0, 31);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_REFLECTION_DISTORTION], 0, 0, 31);
|
||||
gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL;
|
||||
InitSpriteAffineAnim(&gSprites[spriteId]);
|
||||
StartSpriteAffineAnim(&gSprites[spriteId], 1);
|
||||
@@ -1220,7 +1223,6 @@ static u8 InitObjectEventStateFromTemplate(struct ObjectEventTemplate *template,
|
||||
objectEvent->movementType = template->movementType;
|
||||
objectEvent->localId = template->localId;
|
||||
objectEvent->mapNum = mapNum;
|
||||
objectEvent++; objectEvent--;
|
||||
objectEvent->mapGroup = mapGroup;
|
||||
objectEvent->initialCoords.x = x;
|
||||
objectEvent->initialCoords.y = y;
|
||||
@@ -1233,13 +1235,11 @@ static u8 InitObjectEventStateFromTemplate(struct ObjectEventTemplate *template,
|
||||
objectEvent->range.as_nybbles.x = template->movementRangeX;
|
||||
objectEvent->range.as_nybbles.y = template->movementRangeY;
|
||||
objectEvent->trainerType = template->trainerType;
|
||||
objectEvent->mapNum = mapNum; //redundant, but needed to match
|
||||
objectEvent->trainerRange_berryTreeId = template->trainerRange_berryTreeId;
|
||||
objectEvent->previousMovementDirection = gInitialMovementTypeFacingDirections[template->movementType];
|
||||
SetObjectEventDirection(objectEvent, objectEvent->previousMovementDirection);
|
||||
SetObjectEventDynamicGraphicsId(objectEvent);
|
||||
#ifndef NONMATCHING
|
||||
asm("":::"r5", "r6");
|
||||
#endif
|
||||
if (gRangedMovementTypes[objectEvent->movementType])
|
||||
{
|
||||
if (objectEvent->range.as_nybbles.x == 0)
|
||||
@@ -1949,7 +1949,7 @@ void sub_808E7E4(u8 localId, u8 mapNum, u8 mapGroup)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_808E82C(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y)
|
||||
void SetObjectEventSpritePosByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y)
|
||||
{
|
||||
u8 objectEventId;
|
||||
struct Sprite *sprite;
|
||||
@@ -2340,7 +2340,13 @@ const u8 *GetObjectEventScriptPointerByObjectEventId(u8 objectEventId)
|
||||
|
||||
static u16 GetObjectEventFlagIdByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup)
|
||||
{
|
||||
return GetObjectEventTemplateByLocalIdAndMap(localId, mapNum, mapGroup)->flagId;
|
||||
struct ObjectEventTemplate *obj = GetObjectEventTemplateByLocalIdAndMap(localId, mapNum, mapGroup);
|
||||
#ifdef UBFIX
|
||||
// BUG: The function may return NULL, and attempting to read from NULL may freeze the game using modern compilers.
|
||||
if (obj == NULL)
|
||||
return 0;
|
||||
#endif // UBFIX
|
||||
return obj->flagId;
|
||||
}
|
||||
|
||||
static u16 GetObjectEventFlagIdByObjectEventId(u8 objectEventId)
|
||||
@@ -6868,15 +6874,15 @@ bool8 MovementAction_UnusedAcroActionRight_Step0(struct ObjectEvent *objectEvent
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_8095AF0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
|
||||
void InitFigure8Anim(struct ObjectEvent *objectEvent, struct Sprite *sprite)
|
||||
{
|
||||
sub_8097750(sprite);
|
||||
InitSpriteForFigure8Anim(sprite);
|
||||
sprite->animPaused = FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_8095B0C(struct ObjectEvent *objectEvent, struct Sprite *sprite)
|
||||
bool8 DoFigure8Anim(struct ObjectEvent *objectEvent, struct Sprite *sprite)
|
||||
{
|
||||
if (sub_8097758(sprite))
|
||||
if (AnimateSpriteInFigure8(sprite))
|
||||
{
|
||||
ShiftStillObjectEventCoords(objectEvent);
|
||||
objectEvent->triggerGroundEffectsOnStop = TRUE;
|
||||
@@ -6888,14 +6894,14 @@ bool8 sub_8095B0C(struct ObjectEvent *objectEvent, struct Sprite *sprite)
|
||||
|
||||
bool8 MovementAction_Figure8_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
|
||||
{
|
||||
sub_8095AF0(objectEvent, sprite);
|
||||
InitFigure8Anim(objectEvent, sprite);
|
||||
sprite->data[2] = 1;
|
||||
return MovementAction_Figure8_Step1(objectEvent, sprite);
|
||||
}
|
||||
|
||||
bool8 MovementAction_Figure8_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite)
|
||||
{
|
||||
if (sub_8095B0C(objectEvent, sprite))
|
||||
if (DoFigure8Anim(objectEvent, sprite))
|
||||
{
|
||||
sprite->data[2] = 2;
|
||||
return TRUE;
|
||||
@@ -8098,26 +8104,26 @@ void GroundEffect_Seaweed(struct ObjectEvent *objEvent, struct Sprite *sprite)
|
||||
}
|
||||
|
||||
static void (*const sGroundEffectFuncs[])(struct ObjectEvent *objEvent, struct Sprite *sprite) = {
|
||||
GroundEffect_SpawnOnTallGrass,
|
||||
GroundEffect_StepOnTallGrass,
|
||||
GroundEffect_SpawnOnLongGrass,
|
||||
GroundEffect_StepOnLongGrass,
|
||||
GroundEffect_WaterReflection,
|
||||
GroundEffect_IceReflection,
|
||||
GroundEffect_FlowingWater,
|
||||
GroundEffect_SandTracks,
|
||||
GroundEffect_DeepSandTracks,
|
||||
GroundEffect_Ripple,
|
||||
GroundEffect_StepOnPuddle,
|
||||
GroundEffect_SandHeap,
|
||||
GroundEffect_JumpOnTallGrass,
|
||||
GroundEffect_JumpOnLongGrass,
|
||||
GroundEffect_JumpOnShallowWater,
|
||||
GroundEffect_JumpOnWater,
|
||||
GroundEffect_JumpLandingDust,
|
||||
GroundEffect_ShortGrass,
|
||||
GroundEffect_HotSprings,
|
||||
GroundEffect_Seaweed
|
||||
GroundEffect_SpawnOnTallGrass, // GROUND_EFFECT_FLAG_TALL_GRASS_ON_SPAWN
|
||||
GroundEffect_StepOnTallGrass, // GROUND_EFFECT_FLAG_TALL_GRASS_ON_MOVE
|
||||
GroundEffect_SpawnOnLongGrass, // GROUND_EFFECT_FLAG_LONG_GRASS_ON_SPAWN
|
||||
GroundEffect_StepOnLongGrass, // GROUND_EFFECT_FLAG_LONG_GRASS_ON_MOVE
|
||||
GroundEffect_WaterReflection, // GROUND_EFFECT_FLAG_ICE_REFLECTION
|
||||
GroundEffect_IceReflection, // GROUND_EFFECT_FLAG_REFLECTION
|
||||
GroundEffect_FlowingWater, // GROUND_EFFECT_FLAG_SHALLOW_FLOWING_WATER
|
||||
GroundEffect_SandTracks, // GROUND_EFFECT_FLAG_SAND
|
||||
GroundEffect_DeepSandTracks, // GROUND_EFFECT_FLAG_DEEP_SAND
|
||||
GroundEffect_Ripple, // GROUND_EFFECT_FLAG_RIPPLES
|
||||
GroundEffect_StepOnPuddle, // GROUND_EFFECT_FLAG_PUDDLE
|
||||
GroundEffect_SandHeap, // GROUND_EFFECT_FLAG_SAND_PILE
|
||||
GroundEffect_JumpOnTallGrass, // GROUND_EFFECT_FLAG_LAND_IN_TALL_GRASS
|
||||
GroundEffect_JumpOnLongGrass, // GROUND_EFFECT_FLAG_LAND_IN_LONG_GRASS
|
||||
GroundEffect_JumpOnShallowWater, // GROUND_EFFECT_FLAG_LAND_IN_SHALLOW_WATER
|
||||
GroundEffect_JumpOnWater, // GROUND_EFFECT_FLAG_LAND_IN_DEEP_WATER
|
||||
GroundEffect_JumpLandingDust, // GROUND_EFFECT_FLAG_LAND_ON_NORMAL_GROUND
|
||||
GroundEffect_ShortGrass, // GROUND_EFFECT_FLAG_SHORT_GRASS
|
||||
GroundEffect_HotSprings, // GROUND_EFFECT_FLAG_HOT_SPRINGS
|
||||
GroundEffect_Seaweed // GROUND_EFFECT_FLAG_SEAWEED
|
||||
};
|
||||
|
||||
static void DoFlaggedGroundEffects(struct ObjectEvent *objEvent, struct Sprite *sprite, u32 flags)
|
||||
@@ -8210,15 +8216,13 @@ bool8 FreezeObjectEvent(struct ObjectEvent *objectEvent)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
objectEvent->frozen = 1;
|
||||
objectEvent->spriteAnimPausedBackup = gSprites[objectEvent->spriteId].animPaused;
|
||||
objectEvent->spriteAffineAnimPausedBackup = gSprites[objectEvent->spriteId].affineAnimPaused;
|
||||
gSprites[objectEvent->spriteId].animPaused = 1;
|
||||
gSprites[objectEvent->spriteId].affineAnimPaused = 1;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
objectEvent->frozen = 1;
|
||||
objectEvent->spriteAnimPausedBackup = gSprites[objectEvent->spriteId].animPaused;
|
||||
objectEvent->spriteAffineAnimPausedBackup = gSprites[objectEvent->spriteId].affineAnimPaused;
|
||||
gSprites[objectEvent->spriteId].animPaused = 1;
|
||||
gSprites[objectEvent->spriteId].affineAnimPaused = 1;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void FreezeObjectEvents(void)
|
||||
@@ -8391,11 +8395,11 @@ bool8 sub_80976EC(struct Sprite *sprite)
|
||||
|
||||
if (sprite->data[5] > 15)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static const s8 gUnknown_0850E772[] = {
|
||||
static const s8 sFigure8XOffsets[FIGURE_8_LENGTH] = {
|
||||
1, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 1, 2, 2, 1, 2,
|
||||
2, 1, 2, 2, 1, 2, 1, 1,
|
||||
@@ -8407,7 +8411,7 @@ static const s8 gUnknown_0850E772[] = {
|
||||
0, 1, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
static const s8 gUnknown_0850E7BA[] = {
|
||||
static const s8 sFigure8YOffsets[FIGURE_8_LENGTH] = {
|
||||
0, 0, 1, 0, 0, 1, 0, 0,
|
||||
1, 0, 1, 1, 0, 1, 1, 0,
|
||||
1, 1, 0, 1, 1, 0, 1, 1,
|
||||
@@ -8419,68 +8423,68 @@ static const s8 gUnknown_0850E7BA[] = {
|
||||
-1, -1, -1, -1, -1, -1, -1, -2,
|
||||
};
|
||||
|
||||
s16 sub_8097728(s16 a1)
|
||||
s16 GetFigure8YOffset(s16 idx)
|
||||
{
|
||||
return gUnknown_0850E7BA[a1];
|
||||
return sFigure8YOffsets[idx];
|
||||
}
|
||||
|
||||
s16 sub_809773C(s16 a1)
|
||||
s16 GetFigure8XOffset(s16 idx)
|
||||
{
|
||||
return gUnknown_0850E772[a1];
|
||||
return sFigure8XOffsets[idx];
|
||||
}
|
||||
|
||||
void sub_8097750(struct Sprite *sprite)
|
||||
static void InitSpriteForFigure8Anim(struct Sprite *sprite)
|
||||
{
|
||||
sprite->data[6] = 0;
|
||||
sprite->data[7] = 0;
|
||||
}
|
||||
|
||||
bool8 sub_8097758(struct Sprite *sprite)
|
||||
static bool8 AnimateSpriteInFigure8(struct Sprite *sprite)
|
||||
{
|
||||
bool8 result = FALSE;
|
||||
bool8 finished = FALSE;
|
||||
|
||||
switch(sprite->data[7])
|
||||
{
|
||||
case 0:
|
||||
sprite->pos2.x += sub_809773C(sprite->data[6]);
|
||||
sprite->pos2.y += sub_8097728(sprite->data[6]);
|
||||
break;
|
||||
case 1:
|
||||
sprite->pos2.x -= sub_809773C(0x47 - sprite->data[6]);
|
||||
sprite->pos2.y += sub_8097728(0x47 - sprite->data[6]);
|
||||
break;
|
||||
case 2:
|
||||
sprite->pos2.x -= sub_809773C(sprite->data[6]);
|
||||
sprite->pos2.y += sub_8097728(sprite->data[6]);
|
||||
break;
|
||||
case 3:
|
||||
sprite->pos2.x += sub_809773C(0x47 - sprite->data[6]);
|
||||
sprite->pos2.y += sub_8097728(0x47 - sprite->data[6]);
|
||||
break;
|
||||
case 0:
|
||||
sprite->pos2.x += GetFigure8XOffset(sprite->data[6]);
|
||||
sprite->pos2.y += GetFigure8YOffset(sprite->data[6]);
|
||||
break;
|
||||
case 1:
|
||||
sprite->pos2.x -= GetFigure8XOffset((FIGURE_8_LENGTH - 1) - sprite->data[6]);
|
||||
sprite->pos2.y += GetFigure8YOffset((FIGURE_8_LENGTH - 1) - sprite->data[6]);
|
||||
break;
|
||||
case 2:
|
||||
sprite->pos2.x -= GetFigure8XOffset(sprite->data[6]);
|
||||
sprite->pos2.y += GetFigure8YOffset(sprite->data[6]);
|
||||
break;
|
||||
case 3:
|
||||
sprite->pos2.x += GetFigure8XOffset((FIGURE_8_LENGTH - 1) - sprite->data[6]);
|
||||
sprite->pos2.y += GetFigure8YOffset((FIGURE_8_LENGTH - 1) - sprite->data[6]);
|
||||
break;
|
||||
}
|
||||
if(++sprite->data[6] == 0x48)
|
||||
if (++sprite->data[6] == FIGURE_8_LENGTH)
|
||||
{
|
||||
sprite->data[6] = 0;
|
||||
sprite->data[7]++;
|
||||
}
|
||||
if(sprite->data[7] == 0x4)
|
||||
if (sprite->data[7] == 4)
|
||||
{
|
||||
sprite->pos2.y = 0;
|
||||
sprite->pos2.x = 0;
|
||||
result = TRUE;
|
||||
finished = TRUE;
|
||||
}
|
||||
return result;
|
||||
return finished;
|
||||
}
|
||||
|
||||
static const s8 gUnknown_0850E802[] = {
|
||||
static const s8 gUnknown_0850E802[16] = {
|
||||
-4, -6, -8, -10, -11, -12, -12, -12, -11, -10, -9, -8, -6, -4, 0, 0
|
||||
};
|
||||
|
||||
static const s8 gUnknown_0850E812[] = {
|
||||
static const s8 gUnknown_0850E812[16] = {
|
||||
0, -2, -3, -4, -5, -6, -6, -6, -5, -5, -4, -3, -2, 0, 0, 0
|
||||
};
|
||||
|
||||
static const s8 gUnknown_0850E822[] = {
|
||||
static const s8 gUnknown_0850E822[16] = {
|
||||
-2, -4, -6, -8, -9, -10, -10, -10, -9, -8, -6, -5, -3, -2, 0, 0
|
||||
};
|
||||
|
||||
@@ -8503,23 +8507,11 @@ void sub_809783C(struct Sprite *sprite, u8 a2, u8 a3, u8 a4)
|
||||
sprite->data[6] = 0;
|
||||
}
|
||||
|
||||
static const s16 gUnknown_0850E840[] = {
|
||||
16, 16, 32,
|
||||
};
|
||||
|
||||
static const u8 gUnknown_0850E846[] = {
|
||||
0, 0, 1,
|
||||
};
|
||||
|
||||
u8 sub_809785C(struct Sprite *sprite)
|
||||
{
|
||||
s16 v5[3];
|
||||
u8 v6[3];
|
||||
u8 v2;
|
||||
|
||||
memcpy(v5, gUnknown_0850E840, 6); // TODO: get rid of memcpy
|
||||
memcpy(v6, gUnknown_0850E846, 3);
|
||||
v2 = 0;
|
||||
s16 v5[] = {16, 16, 32};
|
||||
u8 v6[] = {0, 0, 1};
|
||||
u8 v2 = 0;
|
||||
|
||||
if (sprite->data[4])
|
||||
Step1(sprite, sprite->data[3]);
|
||||
@@ -8540,23 +8532,11 @@ u8 sub_809785C(struct Sprite *sprite)
|
||||
return v2;
|
||||
}
|
||||
|
||||
static const s16 gUnknown_0850E84A[] = {
|
||||
32, 32, 64,
|
||||
};
|
||||
|
||||
static const u8 gUnknown_0850E850[] = {
|
||||
1, 1, 2,
|
||||
};
|
||||
|
||||
u8 sub_80978E4(struct Sprite *sprite)
|
||||
{
|
||||
s16 v5[3];
|
||||
u8 v6[3];
|
||||
u8 v2;
|
||||
|
||||
memcpy(v5, gUnknown_0850E84A, 6);
|
||||
memcpy(v6, gUnknown_0850E850, 3);
|
||||
v2 = 0;
|
||||
s16 v5[] = {32, 32, 64};
|
||||
u8 v6[] = {1, 1, 2};
|
||||
u8 v2 = 0;
|
||||
|
||||
if (sprite->data[4] && !(sprite->data[6] & 1))
|
||||
Step1(sprite, sprite->data[3]);
|
||||
@@ -8584,12 +8564,9 @@ static void SetMovementDelay(struct Sprite *sprite, s16 timer)
|
||||
|
||||
static bool8 WaitForMovementDelay(struct Sprite *sprite)
|
||||
{
|
||||
sprite->data[3]--;
|
||||
|
||||
if (sprite->data[3] == 0)
|
||||
if (--sprite->data[3] == 0)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void SetAndStartSpriteAnim(struct Sprite *sprite, u8 animNum, u8 animCmdIndex)
|
||||
@@ -8603,8 +8580,7 @@ bool8 SpriteAnimEnded(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->animEnded)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void UpdateObjectEventSpriteVisibility(struct Sprite *sprite, bool8 invisible)
|
||||
@@ -8783,14 +8759,14 @@ static void UpdateObjectEventSpritePosition(struct Sprite *sprite)
|
||||
{
|
||||
switch(sprite->tAnimNum)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case UNION_ROOM_SPAWN_IN:
|
||||
MoveUnionRoomObjectDown(sprite);
|
||||
break;
|
||||
case UNION_ROOM_SPAWN_OUT:
|
||||
MoveUnionRoomObjectUp(sprite);
|
||||
break;
|
||||
case 0:
|
||||
break;
|
||||
default:
|
||||
sprite->tAnimNum = 0;
|
||||
break;
|
||||
@@ -8871,8 +8847,7 @@ u8 MovementAction_StoreAndLockAnim_Step0(struct ObjectEvent *objectEvent, struct
|
||||
}
|
||||
else
|
||||
{
|
||||
u8 i;
|
||||
u8 firstFreeSlot;
|
||||
u8 i, firstFreeSlot;
|
||||
bool32 found;
|
||||
for (firstFreeSlot = 16, found = FALSE, i = 0; i < 16; i++)
|
||||
{
|
||||
@@ -8950,7 +8925,7 @@ void CreateLevitateMovementTask(struct ObjectEvent *objectEvent)
|
||||
u8 taskId = CreateTask(ApplyLevitateMovement, 0xFF);
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
StoreWordInTwoHalfwords(&task->data[0], (u32)objectEvent);
|
||||
StoreWordInTwoHalfwords((u16 *)&task->data[0], (u32)objectEvent);
|
||||
objectEvent->warpArrowSpriteId = taskId;
|
||||
task->data[3] = 0xFFFF;
|
||||
}
|
||||
@@ -8961,7 +8936,7 @@ static void ApplyLevitateMovement(u8 taskId)
|
||||
struct Sprite *sprite;
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
LoadWordFromTwoHalfwords(&task->data[0], (u32 *)&objectEvent); // load the map object pointer.
|
||||
LoadWordFromTwoHalfwords((u16 *)&task->data[0], (u32 *)&objectEvent); // load the map object pointer.
|
||||
sprite = &gSprites[objectEvent->spriteId];
|
||||
|
||||
if(!(task->data[2] & 0x3))
|
||||
@@ -8978,7 +8953,7 @@ void DestroyExtraMovementTask(u8 taskId)
|
||||
struct ObjectEvent *objectEvent;
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
LoadWordFromTwoHalfwords(&task->data[0], (u32 *)&objectEvent); // unused objectEvent
|
||||
LoadWordFromTwoHalfwords((u16 *)&task->data[0], (u32 *)&objectEvent); // unused objectEvent
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
|
||||
@@ -271,7 +271,7 @@ static void EvoTask_BeginPreSet1_FadeAndPlaySE(u8 taskID)
|
||||
gTasks[taskID].tFrameCounter = 0;
|
||||
BeginNormalPaletteFade(3 << gTasks[taskID].data[1], 0xA, 0, 0x10, RGB_WHITE);
|
||||
gTasks[taskID].func = EvoTask_CreatePreEvoSparkleSet1;
|
||||
PlaySE(SE_W025);
|
||||
PlaySE(SE_M_MEGA_KICK);
|
||||
}
|
||||
|
||||
static void EvoTask_CreatePreEvoSparkleSet1(u8 taskID)
|
||||
@@ -311,7 +311,7 @@ static void EvoTask_BeginPreSparklesSet2(u8 taskID)
|
||||
SetEvoSparklesMatrices();
|
||||
gTasks[taskID].tFrameCounter = 0;
|
||||
gTasks[taskID].func = EvoTask_CreatePreEvoSparklesSet2;
|
||||
PlaySE(SE_W062B);
|
||||
PlaySE(SE_M_BUBBLE_BEAM2);
|
||||
}
|
||||
|
||||
static void EvoTask_CreatePreEvoSparklesSet2(u8 taskID)
|
||||
@@ -345,7 +345,7 @@ static void EvoTask_BeginPostSparklesSet1(u8 taskID)
|
||||
SetEvoSparklesMatrices();
|
||||
gTasks[taskID].tFrameCounter = 0;
|
||||
gTasks[taskID].func = EvoTask_CreatePostEvoSparklesSet1;
|
||||
PlaySE(SE_REAPOKE);
|
||||
PlaySE(SE_SHINY);
|
||||
}
|
||||
|
||||
static void EvoTask_CreatePostEvoSparklesSet1(u8 taskID)
|
||||
@@ -389,7 +389,7 @@ static void EvoTask_BeginPostSparklesSet2_AndFlash(u8 taskID)
|
||||
CpuSet(&gPlttBufferFaded[0x20], &gPlttBufferUnfaded[0x20], 0x30);
|
||||
BeginNormalPaletteFade(0xFFF9041C, 0, 0, 0x10, RGB_WHITE); // was 0xFFF9001C in R/S
|
||||
gTasks[taskID].func = EvoTask_CreatePostEvoSparklesSet2_AndFlash;
|
||||
PlaySE(SE_W080);
|
||||
PlaySE(SE_M_PETAL_DANCE);
|
||||
}
|
||||
|
||||
static void EvoTask_CreatePostEvoSparklesSet2_AndFlash(u8 taskID)
|
||||
@@ -437,7 +437,7 @@ static void EvoTask_BeginPostSparklesSet2_AndFlash_Trade(u8 taskID)
|
||||
CpuSet(&gPlttBufferFaded[0x20], &gPlttBufferUnfaded[0x20], 0x30);
|
||||
BeginNormalPaletteFade(0xFFF90400, 0, 0, 0x10, RGB_WHITE); // was 0xFFFF0001 in R/S
|
||||
gTasks[taskID].func = EvoTask_CreatePostEvoSparklesSet2_AndFlash_Trade;
|
||||
PlaySE(SE_W080);
|
||||
PlaySE(SE_M_PETAL_DANCE);
|
||||
}
|
||||
|
||||
static void EvoTask_CreatePostEvoSparklesSet2_AndFlash_Trade(u8 taskID)
|
||||
|
||||
+10
-10
@@ -630,14 +630,14 @@ static void Task_EvolutionScene(u8 taskID)
|
||||
case 3:
|
||||
if (EvoScene_IsMonAnimFinished(sEvoStructPtr->preEvoSpriteID)) // wait for animation, play tu du SE
|
||||
{
|
||||
PlaySE(MUS_ME_SHINKA);
|
||||
PlaySE(MUS_EVOLUTION_INTRO);
|
||||
gTasks[taskID].tState++;
|
||||
}
|
||||
break;
|
||||
case 4: // play evolution music and fade screen black
|
||||
if (!IsSEPlaying())
|
||||
{
|
||||
PlayNewMapMusic(MUS_SHINKA);
|
||||
PlayNewMapMusic(MUS_EVOLUTION);
|
||||
gTasks[taskID].tState++;
|
||||
BeginNormalPaletteFade(0x1C, 4, 0, 0x10, RGB_BLACK);
|
||||
}
|
||||
@@ -713,7 +713,7 @@ static void Task_EvolutionScene(u8 taskID)
|
||||
{
|
||||
StringExpandPlaceholders(gStringVar4, gText_CongratsPkmnEvolved);
|
||||
BattlePutTextOnWindow(gStringVar4, 0);
|
||||
PlayBGM(MUS_FANFA5);
|
||||
PlayBGM(MUS_EVOLVED);
|
||||
gTasks[taskID].tState++;
|
||||
SetMonData(mon, MON_DATA_SPECIES, (void*)(&gTasks[taskID].tPostEvoSpecies));
|
||||
CalculateMonStats(mon);
|
||||
@@ -808,7 +808,7 @@ static void Task_EvolutionScene(u8 taskID)
|
||||
if (!IsTextPrinterActive(0) && !IsSEPlaying())
|
||||
{
|
||||
BufferMoveToLearnIntoBattleTextBuff2();
|
||||
PlayFanfare(MUS_FANFA1);
|
||||
PlayFanfare(MUS_LEVEL_UP);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_PKMNLEARNEDMOVE - BATTLESTRINGS_ID_ADDER]);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
|
||||
gTasks[taskID].tLearnsFirstMove = 0x40; // re-used as a counter
|
||||
@@ -998,15 +998,15 @@ static void Task_TradeEvolutionScene(u8 taskID)
|
||||
case 2:
|
||||
if (IsCryFinished())
|
||||
{
|
||||
m4aSongNumStop(MUS_SHINKA);
|
||||
PlaySE(MUS_ME_SHINKA);
|
||||
m4aSongNumStop(MUS_EVOLUTION);
|
||||
PlaySE(MUS_EVOLUTION_INTRO);
|
||||
gTasks[taskID].tState++;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (!IsSEPlaying())
|
||||
{
|
||||
PlayBGM(MUS_SHINKA);
|
||||
PlayBGM(MUS_EVOLUTION);
|
||||
gTasks[taskID].tState++;
|
||||
BeginNormalPaletteFade(0x1C, 4, 0, 0x10, RGB_BLACK);
|
||||
}
|
||||
@@ -1076,7 +1076,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
|
||||
{
|
||||
StringExpandPlaceholders(gStringVar4, gText_CongratsPkmnEvolved);
|
||||
DrawTextOnTradeWindow(0, gStringVar4, 1);
|
||||
PlayFanfare(MUS_FANFA5);
|
||||
PlayFanfare(MUS_EVOLVED);
|
||||
gTasks[taskID].tState++;
|
||||
SetMonData(mon, MON_DATA_SPECIES, (&gTasks[taskID].tPostEvoSpecies));
|
||||
CalculateMonStats(mon);
|
||||
@@ -1109,7 +1109,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayBGM(MUS_SHINKA);
|
||||
PlayBGM(MUS_EVOLUTION);
|
||||
DrawTextOnTradeWindow(0, gText_CommunicationStandby5, 1);
|
||||
gTasks[taskID].tState++;
|
||||
}
|
||||
@@ -1153,7 +1153,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
|
||||
if (!IsTextPrinterActive(0) && !IsSEPlaying())
|
||||
{
|
||||
BufferMoveToLearnIntoBattleTextBuff2();
|
||||
PlayFanfare(MUS_FANFA1);
|
||||
PlayFanfare(MUS_LEVEL_UP);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_PKMNLEARNEDMOVE - BATTLESTRINGS_ID_ADDER]);
|
||||
DrawTextOnTradeWindow(0, gDisplayedStringBattle, 1);
|
||||
gTasks[taskID].tLearnsFirstMove = 0x40; // re-used as a counter
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "metatile_behavior.h"
|
||||
#include "sprite.h"
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/field_effects.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/metatile_behaviors.h"
|
||||
|
||||
@@ -23,7 +24,7 @@ static s16 sPlayerToMewDeltaX;
|
||||
static s16 sPlayerToMewDeltaY;
|
||||
static u8 sMewDirectionCandidates[4];
|
||||
|
||||
extern const struct SpritePalette gFieldEffectObjectPaletteInfo1;
|
||||
extern const struct SpritePalette gSpritePalette_GeneralFieldEffect1;
|
||||
extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[];
|
||||
|
||||
static const s16 sFarawayIslandRockCoords[4][2] =
|
||||
@@ -392,13 +393,13 @@ void SetMewAboveGrass(void)
|
||||
if (gSpecialVar_Facing != DIR_NORTH)
|
||||
gSprites[mew->spriteId].subpriority = 1;
|
||||
|
||||
LoadSpritePalette(&gFieldEffectObjectPaletteInfo1);
|
||||
UpdateSpritePaletteWithWeather(IndexOfSpritePaletteTag(gFieldEffectObjectPaletteInfo1.tag));
|
||||
LoadSpritePalette(&gSpritePalette_GeneralFieldEffect1);
|
||||
UpdateSpritePaletteWithWeather(IndexOfSpritePaletteTag(gSpritePalette_GeneralFieldEffect1.tag));
|
||||
|
||||
x = mew->currentCoords.x;
|
||||
y = mew->currentCoords.y;
|
||||
SetSpritePosToOffsetMapCoords(&x, &y, 8, 8);
|
||||
sGrassSpriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[15], x, y, gSprites[mew->spriteId].subpriority - 1);
|
||||
sGrassSpriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_LONG_GRASS], x, y, gSprites[mew->spriteId].subpriority - 1);
|
||||
if (sGrassSpriteId != MAX_SPRITES)
|
||||
{
|
||||
struct Sprite *sprite = &gSprites[sGrassSpriteId];
|
||||
|
||||
+20
-20
@@ -39,7 +39,7 @@ static void CameraPanningCB_PanAhead(void);
|
||||
static struct FieldCameraOffset sFieldCameraOffset;
|
||||
static s16 sHorizontalCameraPan;
|
||||
static s16 sVerticalCameraPan;
|
||||
static u8 gUnknown_03000E2C;
|
||||
static bool8 gUnknown_03000E2C;
|
||||
static void (*sFieldCameraPanningCallback)(void);
|
||||
|
||||
struct CameraObject gFieldCamera;
|
||||
@@ -47,7 +47,7 @@ u16 gTotalCameraPixelOffsetY;
|
||||
u16 gTotalCameraPixelOffsetX;
|
||||
|
||||
// text
|
||||
static void move_tilemap_camera_to_upper_left_corner_(struct FieldCameraOffset *cameraOffset)
|
||||
static void ResetCameraOffset(struct FieldCameraOffset *cameraOffset)
|
||||
{
|
||||
cameraOffset->xTileOffset = 0;
|
||||
cameraOffset->yTileOffset = 0;
|
||||
@@ -56,23 +56,23 @@ static void move_tilemap_camera_to_upper_left_corner_(struct FieldCameraOffset *
|
||||
cameraOffset->copyBGToVRAM = TRUE;
|
||||
}
|
||||
|
||||
static void tilemap_move_something(struct FieldCameraOffset *cameraOffset, u32 b, u32 c)
|
||||
static void AddCameraTileOffset(struct FieldCameraOffset *cameraOffset, u32 xOffset, u32 yOffset)
|
||||
{
|
||||
cameraOffset->xTileOffset += b;
|
||||
cameraOffset->xTileOffset += xOffset;
|
||||
cameraOffset->xTileOffset %= 32;
|
||||
cameraOffset->yTileOffset += c;
|
||||
cameraOffset->yTileOffset += yOffset;
|
||||
cameraOffset->yTileOffset %= 32;
|
||||
}
|
||||
|
||||
static void coords8_add(struct FieldCameraOffset *cameraOffset, u32 b, u32 c)
|
||||
static void AddCameraPixelOffset(struct FieldCameraOffset *cameraOffset, u32 xOffset, u32 yOffset)
|
||||
{
|
||||
cameraOffset->xPixelOffset += b;
|
||||
cameraOffset->yPixelOffset += c;
|
||||
cameraOffset->xPixelOffset += xOffset;
|
||||
cameraOffset->yPixelOffset += yOffset;
|
||||
}
|
||||
|
||||
void move_tilemap_camera_to_upper_left_corner(void)
|
||||
void ResetFieldCamera(void)
|
||||
{
|
||||
move_tilemap_camera_to_upper_left_corner_(&sFieldCameraOffset);
|
||||
ResetCameraOffset(&sFieldCameraOffset);
|
||||
}
|
||||
|
||||
void FieldUpdateBgTilemapScroll(void)
|
||||
@@ -89,10 +89,10 @@ void FieldUpdateBgTilemapScroll(void)
|
||||
SetGpuReg(REG_OFFSET_BG3VOFS, r4);
|
||||
}
|
||||
|
||||
void sub_8089C08(s16 *a, s16 *b)
|
||||
void sub_8089C08(s16 *x, s16 *y)
|
||||
{
|
||||
*a = sFieldCameraOffset.xPixelOffset + sHorizontalCameraPan;
|
||||
*b = sFieldCameraOffset.yPixelOffset + sVerticalCameraPan + 8;
|
||||
*x = sFieldCameraOffset.xPixelOffset + sHorizontalCameraPan;
|
||||
*y = sFieldCameraOffset.yPixelOffset + sVerticalCameraPan + 8;
|
||||
}
|
||||
|
||||
void DrawWholeMapView(void)
|
||||
@@ -418,11 +418,11 @@ void CameraUpdate(void)
|
||||
UpdateObjectEventsForCameraUpdate(deltaX, deltaY);
|
||||
RotatingGatePuzzleCameraUpdate(deltaX, deltaY);
|
||||
ResetBerryTreeSparkleFlags();
|
||||
tilemap_move_something(&sFieldCameraOffset, deltaX * 2, deltaY * 2);
|
||||
AddCameraTileOffset(&sFieldCameraOffset, deltaX * 2, deltaY * 2);
|
||||
RedrawMapSlicesForCameraUpdate(&sFieldCameraOffset, deltaX * 2, deltaY * 2);
|
||||
}
|
||||
|
||||
coords8_add(&sFieldCameraOffset, movementSpeedX, movementSpeedY);
|
||||
AddCameraPixelOffset(&sFieldCameraOffset, movementSpeedX, movementSpeedY);
|
||||
gTotalCameraPixelOffsetX -= movementSpeedX;
|
||||
gTotalCameraPixelOffsetY -= movementSpeedY;
|
||||
}
|
||||
@@ -436,9 +436,9 @@ void MoveCameraAndRedrawMap(int deltaX, int deltaY) //unused
|
||||
gTotalCameraPixelOffsetY -= deltaY * 16;
|
||||
}
|
||||
|
||||
void SetCameraPanningCallback(void (*a)(void))
|
||||
void SetCameraPanningCallback(void (*callback)(void))
|
||||
{
|
||||
sFieldCameraPanningCallback = a;
|
||||
sFieldCameraPanningCallback = callback;
|
||||
}
|
||||
|
||||
void SetCameraPanning(s16 a, s16 b)
|
||||
@@ -450,7 +450,7 @@ void SetCameraPanning(s16 a, s16 b)
|
||||
void InstallCameraPanAheadCallback(void)
|
||||
{
|
||||
sFieldCameraPanningCallback = CameraPanningCB_PanAhead;
|
||||
gUnknown_03000E2C = 0;
|
||||
gUnknown_03000E2C = FALSE;
|
||||
sHorizontalCameraPan = 0;
|
||||
sVerticalCameraPan = 32;
|
||||
}
|
||||
@@ -478,12 +478,12 @@ static void CameraPanningCB_PanAhead(void)
|
||||
if (gPlayerAvatar.tileTransitionState == T_TILE_TRANSITION)
|
||||
{
|
||||
gUnknown_03000E2C ^= 1;
|
||||
if (gUnknown_03000E2C == 0)
|
||||
if (gUnknown_03000E2C == FALSE)
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
gUnknown_03000E2C = 0;
|
||||
gUnknown_03000E2C = FALSE;
|
||||
}
|
||||
|
||||
var = GetPlayerMovementDirection();
|
||||
|
||||
@@ -545,7 +545,7 @@ static bool8 TryStartStepCountScript(u16 metatileBehavior)
|
||||
UpdateHappinessStepCounter();
|
||||
UpdateFarawayIslandStepCounter();
|
||||
|
||||
if (!(gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_6) && !MetatileBehavior_IsForcedMovementTile(metatileBehavior))
|
||||
if (!(gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_FORCED_MOVE) && !MetatileBehavior_IsForcedMovementTile(metatileBehavior))
|
||||
{
|
||||
if (UpdatePoisonStepCounter() == TRUE)
|
||||
{
|
||||
@@ -725,7 +725,7 @@ static bool8 TryStartWarpEventScript(struct MapPosition *position, u16 metatileB
|
||||
}
|
||||
if (MetatileBehavior_IsAquaHideoutWarp(metatileBehavior) == TRUE)
|
||||
{
|
||||
DoTeleportWarp();
|
||||
DoTeleportTileWarp();
|
||||
return TRUE;
|
||||
}
|
||||
if (MetatileBehavior_IsWarpOrBridge(metatileBehavior) == TRUE)
|
||||
@@ -938,7 +938,7 @@ static struct BgEvent *GetBackgroundEventAtPosition(struct MapHeader *mapHeader,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool8 dive_warp(struct MapPosition *position, u16 metatileBehavior)
|
||||
bool8 TryDoDiveWarp(struct MapPosition *position, u16 metatileBehavior)
|
||||
{
|
||||
if (gMapHeader.mapType == MAP_TYPE_UNDERWATER && !MetatileBehavior_IsUnableToEmerge(metatileBehavior))
|
||||
{
|
||||
@@ -946,7 +946,7 @@ bool8 dive_warp(struct MapPosition *position, u16 metatileBehavior)
|
||||
{
|
||||
StoreInitialPlayerAvatarState();
|
||||
DoDiveWarp();
|
||||
PlaySE(SE_W291);
|
||||
PlaySE(SE_M_DIVE);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -956,7 +956,7 @@ bool8 dive_warp(struct MapPosition *position, u16 metatileBehavior)
|
||||
{
|
||||
StoreInitialPlayerAvatarState();
|
||||
DoDiveWarp();
|
||||
PlaySE(SE_W291);
|
||||
PlaySE(SE_M_DIVE);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -526,9 +526,9 @@ u32 GetDoorSoundEffect(u32 x, u32 y)
|
||||
if (sound == DOOR_SOUND_NORMAL)
|
||||
return SE_DOOR;
|
||||
else if (sound == DOOR_SOUND_SLIDING)
|
||||
return SE_JIDO_DOA;
|
||||
return SE_SLIDING_DOOR;
|
||||
else if (sound == DOOR_SOUND_ARENA)
|
||||
return SE_TU_SAA;
|
||||
return SE_REPEL;
|
||||
else
|
||||
return SE_DOOR;
|
||||
}
|
||||
|
||||
+1339
-1177
File diff suppressed because it is too large
Load Diff
+150
-131
@@ -166,7 +166,7 @@ u8 CreateWarpArrowSprite(void)
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[8], 0, 0, 0x52);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_ARROW], 0, 0, 0x52);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@@ -202,11 +202,11 @@ void ShowWarpArrowSprite(u8 spriteId, u8 direction, s16 x, s16 y)
|
||||
}
|
||||
}
|
||||
|
||||
const u8 gShadowEffectTemplateIds[] = {
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3
|
||||
static const u8 sShadowEffectTemplateIds[] = {
|
||||
FLDEFFOBJ_SHADOW_S,
|
||||
FLDEFFOBJ_SHADOW_M,
|
||||
FLDEFFOBJ_SHADOW_L,
|
||||
FLDEFFOBJ_SHADOW_XL
|
||||
};
|
||||
|
||||
const u16 gShadowVerticalOffsets[] = {
|
||||
@@ -224,7 +224,7 @@ u32 FldEff_Shadow(void)
|
||||
|
||||
objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
graphicsInfo = GetObjectEventGraphicsInfo(gObjectEvents[objectEventId].graphicsId);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[gShadowEffectTemplateIds[graphicsInfo->shadowSize]], 0, 0, 0x94);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[sShadowEffectTemplateIds[graphicsInfo->shadowSize]], 0, 0, 0x94);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
gSprites[spriteId].coordOffsetEnabled = TRUE;
|
||||
@@ -275,7 +275,7 @@ u32 FldEff_TallGrass(void)
|
||||
x = gFieldEffectArguments[0];
|
||||
y = gFieldEffectArguments[1];
|
||||
SetSpritePosToOffsetMapCoords(&x, &y, 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[4], x, y, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_TALL_GRASS], x, y, 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@@ -341,14 +341,14 @@ u32 FldEff_JumpTallGrass(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 12);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[10], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_JUMP_TALL_GRASS], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
sprite->coordOffsetEnabled = TRUE;
|
||||
sprite->oam.priority = gFieldEffectArguments[3];
|
||||
sprite->data[0] = gFieldEffectArguments[2];
|
||||
sprite->data[1] = 12;
|
||||
sprite->data[1] = FLDEFF_JUMP_TALL_GRASS;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -381,7 +381,7 @@ u32 FldEff_LongGrass(void)
|
||||
x = gFieldEffectArguments[0];
|
||||
y = gFieldEffectArguments[1];
|
||||
SetSpritePosToOffsetMapCoords(&x, &y, 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[15], x, y, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_LONG_GRASS], x, y, 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@@ -444,14 +444,14 @@ u32 FldEff_JumpLongGrass(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[16], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_JUMP_LONG_GRASS], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
sprite->coordOffsetEnabled = TRUE;
|
||||
sprite->oam.priority = gFieldEffectArguments[3];
|
||||
sprite->data[0] = gFieldEffectArguments[2];
|
||||
sprite->data[1] = 18;
|
||||
sprite->data[1] = FLDEFF_JUMP_LONG_GRASS;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -465,7 +465,7 @@ u32 FldEff_ShortGrass(void)
|
||||
|
||||
objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
objectEvent = &gObjectEvents[objectEventId];
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[30], 0, 0, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SHORT_GRASS], 0, 0, 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &(gSprites[spriteId]);
|
||||
@@ -522,7 +522,7 @@ u32 FldEff_SandFootprints(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[11], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SAND_FOOTPRINTS], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@@ -540,7 +540,7 @@ u32 FldEff_DeepSandFootprints(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[23], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_DEEP_SAND_FOOTPRINTS], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@@ -558,7 +558,7 @@ u32 FldEff_BikeTireTracks(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[27], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_BIKE_TIRE_TRACKS], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@@ -611,7 +611,7 @@ u32 FldEff_Splash(void)
|
||||
|
||||
objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
objectEvent = &gObjectEvents[objectEventId];
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[13], 0, 0, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SPLASH], 0, 0, 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
graphicsInfo = GetObjectEventGraphicsInfo(objectEvent->graphicsId);
|
||||
@@ -623,7 +623,7 @@ u32 FldEff_Splash(void)
|
||||
sprite->data[1] = gFieldEffectArguments[1];
|
||||
sprite->data[2] = gFieldEffectArguments[2];
|
||||
sprite->pos2.y = (graphicsInfo->height >> 1) - 4;
|
||||
PlaySE(SE_MIZU);
|
||||
PlaySE(SE_PUDDLE);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -650,7 +650,7 @@ u32 FldEff_JumpSmallSplash(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 12);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[14], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_JUMP_SMALL_SPLASH], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@@ -668,7 +668,7 @@ u32 FldEff_JumpBigSplash(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[12], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_JUMP_BIG_SPLASH], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@@ -690,7 +690,7 @@ u32 FldEff_FeetInFlowingWater(void)
|
||||
|
||||
objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
objectEvent = &gObjectEvents[objectEventId];
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[13], 0, 0, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SPLASH], 0, 0, 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
graphicsInfo = GetObjectEventGraphicsInfo(objectEvent->graphicsId);
|
||||
@@ -733,7 +733,7 @@ static void UpdateFeetInFlowingWaterFieldEffect(struct Sprite *sprite)
|
||||
sprite->data[4] = objectEvent->currentCoords.y;
|
||||
if (!sprite->invisible)
|
||||
{
|
||||
PlaySE(SE_MIZU);
|
||||
PlaySE(SE_PUDDLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -744,7 +744,7 @@ u32 FldEff_Ripple(void)
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[5], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_RIPPLE], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@@ -764,7 +764,7 @@ u32 FldEff_HotSpringsWater(void)
|
||||
|
||||
objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
objectEvent = &gObjectEvents[objectEventId];
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[31], 0, 0, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_HOT_SPRINGS_WATER], 0, 0, 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@@ -800,70 +800,70 @@ void UpdateHotSpringsWaterFieldEffect(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
u32 FldEff_Unknown19(void)
|
||||
u32 FldEff_UnusedGrass(void)
|
||||
{
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[17], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_UNUSED_GRASS], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
sprite->coordOffsetEnabled = TRUE;
|
||||
sprite->oam.priority = gFieldEffectArguments[3];
|
||||
sprite->data[0] = FLDEFF_UNKNOWN_19;
|
||||
sprite->data[0] = FLDEFF_UNUSED_GRASS;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 FldEff_Unknown20(void)
|
||||
u32 FldEff_UnusedGrass2(void)
|
||||
{
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[18], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_UNUSED_GRASS_2], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
sprite->coordOffsetEnabled = TRUE;
|
||||
sprite->oam.priority = gFieldEffectArguments[3];
|
||||
sprite->data[0] = FLDEFF_UNKNOWN_20;
|
||||
sprite->data[0] = FLDEFF_UNUSED_GRASS_2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 FldEff_Unknown21(void)
|
||||
u32 FldEff_UnusedSand(void)
|
||||
{
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[19], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_UNUSED_SAND], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
sprite->coordOffsetEnabled = TRUE;
|
||||
sprite->oam.priority = gFieldEffectArguments[3];
|
||||
sprite->data[0] = FLDEFF_UNKNOWN_21;
|
||||
sprite->data[0] = FLDEFF_UNUSED_SAND;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 FldEff_Unknown22(void)
|
||||
u32 FldEff_WaterSurfacing(void)
|
||||
{
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[20], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_WATER_SURFACING], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
sprite->coordOffsetEnabled = TRUE;
|
||||
sprite->oam.priority = gFieldEffectArguments[3];
|
||||
sprite->data[0] = FLDEFF_UNKNOWN_22;
|
||||
sprite->data[0] = FLDEFF_WATER_SURFACING;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -889,7 +889,7 @@ u32 FldEff_Ash(void)
|
||||
x = gFieldEffectArguments[0];
|
||||
y = gFieldEffectArguments[1];
|
||||
SetSpritePosToOffsetMapCoords(&x, &y, 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[6], x, y, gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_ASH], x, y, gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@@ -945,7 +945,7 @@ u32 FldEff_SurfBlob(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[7], gFieldEffectArguments[0], gFieldEffectArguments[1], 0x96);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SURF_BLOB], gFieldEffectArguments[0], gFieldEffectArguments[1], 0x96);
|
||||
if (spriteId !=MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@@ -960,33 +960,34 @@ u32 FldEff_SurfBlob(void)
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
void sub_81555AC(u8 spriteId, u8 value)
|
||||
// States for bobbing up and down while surfing
|
||||
void SetSurfBobState(u8 spriteId, u8 value)
|
||||
{
|
||||
gSprites[spriteId].data[0] = (gSprites[spriteId].data[0] & ~0xF) | (value & 0xF);
|
||||
}
|
||||
|
||||
void sub_81555D8(u8 spriteId, u8 value)
|
||||
void SetSurfBobWhileFlyingOutState(u8 spriteId, u8 value)
|
||||
{
|
||||
gSprites[spriteId].data[0] = (gSprites[spriteId].data[0] & ~0xF0) | ((value & 0xF) << 4);
|
||||
}
|
||||
|
||||
void sub_8155604(u8 spriteId, u8 value, s16 data1)
|
||||
void SetSurfBobWhileFishingState(u8 spriteId, u8 value, s16 data1)
|
||||
{
|
||||
gSprites[spriteId].data[0] = (gSprites[spriteId].data[0] & ~0xF00) | ((value & 0xF) << 8);
|
||||
gSprites[spriteId].data[1] = data1;
|
||||
}
|
||||
|
||||
static u8 sub_8155638(struct Sprite *sprite)
|
||||
static u8 GetSurfBobState(struct Sprite *sprite)
|
||||
{
|
||||
return sprite->data[0] & 0xF;
|
||||
}
|
||||
|
||||
static u8 sub_8155640(struct Sprite *sprite)
|
||||
static u8 GetSurfBobWhileFlyingOutState(struct Sprite *sprite)
|
||||
{
|
||||
return (sprite->data[0] & 0xF0) >> 4;
|
||||
}
|
||||
|
||||
static u8 sub_815564C(struct Sprite *sprite)
|
||||
static u8 GetSurfBobWhileFishingState(struct Sprite *sprite)
|
||||
{
|
||||
return (sprite->data[0] & 0xF00) >> 8;
|
||||
}
|
||||
@@ -1018,7 +1019,7 @@ static void SynchroniseSurfAnim(struct ObjectEvent *objectEvent, struct Sprite *
|
||||
[DIR_NORTHEAST] = 1,
|
||||
};
|
||||
|
||||
if (sub_8155640(sprite) == 0)
|
||||
if (GetSurfBobWhileFlyingOutState(sprite) == 0)
|
||||
StartSpriteAnimIfDifferent(sprite, surfBlobDirectionAnims[objectEvent->movementDirection]);
|
||||
}
|
||||
|
||||
@@ -1049,8 +1050,8 @@ void sub_81556E8(struct ObjectEvent *objectEvent, struct Sprite *sprite)
|
||||
static void CreateBobbingEffect(struct ObjectEvent *objectEvent, struct Sprite *linkedSprite, struct Sprite *sprite)
|
||||
{
|
||||
u16 unk_085CDC6A[] = {3, 7};
|
||||
u8 v0 = sub_8155638(sprite);
|
||||
if (v0 != 0)
|
||||
u8 bobState = GetSurfBobState(sprite);
|
||||
if (bobState != 0)
|
||||
{
|
||||
if (((u16)(++ sprite->data[4]) & unk_085CDC6A[sprite->data[5]]) == 0)
|
||||
{
|
||||
@@ -1060,9 +1061,9 @@ static void CreateBobbingEffect(struct ObjectEvent *objectEvent, struct Sprite *
|
||||
{
|
||||
sprite->data[3] = -sprite->data[3];
|
||||
}
|
||||
if (v0 != 2)
|
||||
if (bobState != 2)
|
||||
{
|
||||
if (sub_815564C(sprite) == 0)
|
||||
if (GetSurfBobWhileFishingState(sprite) == 0)
|
||||
linkedSprite->pos2.y = sprite->pos2.y;
|
||||
else
|
||||
linkedSprite->pos2.y = sprite->data[1] + sprite->pos2.y;
|
||||
@@ -1107,14 +1108,14 @@ u32 FldEff_Dust(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 12);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[9], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_GROUND_IMPACT_DUST], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
sprite->coordOffsetEnabled = TRUE;
|
||||
sprite->oam.priority = gFieldEffectArguments[3];
|
||||
sprite->data[0] = gFieldEffectArguments[2];
|
||||
sprite->data[1] = 10;
|
||||
sprite->data[1] = FLDEFF_DUST;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1129,7 +1130,7 @@ u32 FldEff_SandPile(void)
|
||||
|
||||
objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
objectEvent = &gObjectEvents[objectEventId];
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[29], 0, 0, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SAND_PILE], 0, 0, 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
graphicsInfo = GetObjectEventGraphicsInfo(objectEvent->graphicsId);
|
||||
@@ -1183,7 +1184,7 @@ u32 FldEff_Bubbles(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[34], gFieldEffectArguments[0], gFieldEffectArguments[1], 0x52);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_BUBBLES], gFieldEffectArguments[0], gFieldEffectArguments[1], 0x52);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@@ -1211,7 +1212,7 @@ u32 FldEff_BerryTreeGrowthSparkle(void)
|
||||
struct Sprite *sprite;
|
||||
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 4);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[22], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SPARKLE], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@@ -1225,20 +1226,20 @@ u32 FldEff_BerryTreeGrowthSparkle(void)
|
||||
|
||||
u32 ShowTreeDisguiseFieldEffect(void)
|
||||
{
|
||||
return ShowDisguiseFieldEffect(FLDEFF_TREE_DISGUISE, 24, 4);
|
||||
return ShowDisguiseFieldEffect(FLDEFF_TREE_DISGUISE, FLDEFFOBJ_TREE_DISGUISE, 4);
|
||||
}
|
||||
|
||||
u32 ShowMountainDisguiseFieldEffect(void)
|
||||
{
|
||||
return ShowDisguiseFieldEffect(FLDEFF_MOUNTAIN_DISGUISE, 25, 3);
|
||||
return ShowDisguiseFieldEffect(FLDEFF_MOUNTAIN_DISGUISE, FLDEFFOBJ_MOUNTAIN_DISGUISE, 3);
|
||||
}
|
||||
|
||||
u32 ShowSandDisguiseFieldEffect(void)
|
||||
{
|
||||
return ShowDisguiseFieldEffect(FLDEFF_SAND_DISGUISE, 28, 2);
|
||||
return ShowDisguiseFieldEffect(FLDEFF_SAND_DISGUISE, FLDEFFOBJ_SAND_DISGUISE, 2);
|
||||
}
|
||||
|
||||
static u32 ShowDisguiseFieldEffect(u8 fldEff, u8 templateIdx, u8 paletteNum)
|
||||
static u32 ShowDisguiseFieldEffect(u8 fldEff, u8 fldEffObj, u8 paletteNum)
|
||||
{
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
@@ -1248,7 +1249,7 @@ static u32 ShowDisguiseFieldEffect(u8 fldEff, u8 templateIdx, u8 paletteNum)
|
||||
FieldEffectActiveListRemove(fldEff);
|
||||
return MAX_SPRITES;
|
||||
}
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[templateIdx], 0, 0, 0);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[fldEffObj], 0, 0, 0);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
sprite = &gSprites[spriteId];
|
||||
@@ -1331,7 +1332,7 @@ u32 FldEff_Sparkle(void)
|
||||
gFieldEffectArguments[0] += 7;
|
||||
gFieldEffectArguments[1] += 7;
|
||||
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[35], gFieldEffectArguments[0], gFieldEffectArguments[1], 0x52);
|
||||
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SMALL_SPARKLE], gFieldEffectArguments[0], gFieldEffectArguments[1], 0x52);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
gSprites[spriteId].oam.priority = gFieldEffectArguments[2];
|
||||
@@ -1358,61 +1359,72 @@ void UpdateSparkleFieldEffect(struct Sprite *sprite)
|
||||
FieldEffectStop(sprite, FLDEFF_SPARKLE);
|
||||
}
|
||||
|
||||
void sub_8155EA0(struct Sprite *sprite)
|
||||
#define sTimer data[0]
|
||||
#define sState data[2]
|
||||
#define sStartY data[4]
|
||||
#define sCounter data[5]
|
||||
#define sAnimCounter data[6]
|
||||
#define sAnimState data[7]
|
||||
|
||||
// Same as InitSpriteForFigure8Anim
|
||||
static void InitRayquazaForFigure8Anim(struct Sprite *sprite)
|
||||
{
|
||||
sprite->data[6] = 0;
|
||||
sprite->data[7] = 0;
|
||||
sprite->sAnimCounter = 0;
|
||||
sprite->sAnimState = 0;
|
||||
}
|
||||
|
||||
bool8 sub_8155EA8(struct Sprite *sprite)
|
||||
// Only different from AnimateSpriteInFigure8 by the addition of SetGpuReg to move the spotlight
|
||||
static bool8 AnimateRayquazaInFigure8(struct Sprite *sprite)
|
||||
{
|
||||
bool8 returnBool = FALSE;
|
||||
bool8 finished = FALSE;
|
||||
|
||||
switch (sprite->data[7])
|
||||
switch (sprite->sAnimState)
|
||||
{
|
||||
case 0:
|
||||
sprite->pos2.x += sub_809773C(sprite->data[6]);
|
||||
sprite->pos2.y += sub_8097728(sprite->data[6]);
|
||||
break;
|
||||
case 1:
|
||||
sprite->pos2.x -= sub_809773C(0x47 - sprite->data[6]);
|
||||
sprite->pos2.y += sub_8097728(0x47 - sprite->data[6]);
|
||||
break;
|
||||
case 2:
|
||||
sprite->pos2.x -= sub_809773C(sprite->data[6]);
|
||||
sprite->pos2.y += sub_8097728(sprite->data[6]);
|
||||
break;
|
||||
case 3:
|
||||
sprite->pos2.x += sub_809773C(0x47 - sprite->data[6]);
|
||||
sprite->pos2.y += sub_8097728(0x47 - sprite->data[6]);
|
||||
break;
|
||||
case 0:
|
||||
sprite->pos2.x += GetFigure8XOffset(sprite->sAnimCounter);
|
||||
sprite->pos2.y += GetFigure8YOffset(sprite->sAnimCounter);
|
||||
break;
|
||||
case 1:
|
||||
sprite->pos2.x -= GetFigure8XOffset((FIGURE_8_LENGTH - 1) - sprite->sAnimCounter);
|
||||
sprite->pos2.y += GetFigure8YOffset((FIGURE_8_LENGTH - 1) - sprite->sAnimCounter);
|
||||
break;
|
||||
case 2:
|
||||
sprite->pos2.x -= GetFigure8XOffset(sprite->sAnimCounter);
|
||||
sprite->pos2.y += GetFigure8YOffset(sprite->sAnimCounter);
|
||||
break;
|
||||
case 3:
|
||||
sprite->pos2.x += GetFigure8XOffset((FIGURE_8_LENGTH - 1) - sprite->sAnimCounter);
|
||||
sprite->pos2.y += GetFigure8YOffset((FIGURE_8_LENGTH - 1) - sprite->sAnimCounter);
|
||||
break;
|
||||
}
|
||||
|
||||
// Update spotlight to sweep left and right with Rayquaza
|
||||
SetGpuReg(REG_OFFSET_BG0HOFS, -sprite->pos2.x);
|
||||
if (++sprite->data[6] == 72)
|
||||
|
||||
if (++sprite->sAnimCounter == FIGURE_8_LENGTH)
|
||||
{
|
||||
sprite->data[6] = 0;
|
||||
sprite->data[7]++;
|
||||
sprite->sAnimCounter = 0;
|
||||
sprite->sAnimState++;
|
||||
}
|
||||
if (sprite->data[7] == 4)
|
||||
if (sprite->sAnimState == 4)
|
||||
{
|
||||
sprite->pos2.y = 0;
|
||||
sprite->pos2.x = 0;
|
||||
returnBool = TRUE;
|
||||
finished = TRUE;
|
||||
}
|
||||
|
||||
return returnBool;
|
||||
return finished;
|
||||
}
|
||||
|
||||
void sub_8155F80(struct Sprite *sprite)
|
||||
void UpdateRayquazaSpotlightEffect(struct Sprite *sprite)
|
||||
{
|
||||
u8 i, j;
|
||||
|
||||
switch (sprite->data[2])
|
||||
switch (sprite->sState)
|
||||
{
|
||||
case 0:
|
||||
SetGpuReg(REG_OFFSET_BG0VOFS, 0x78 - (sprite->data[0] / 3));
|
||||
if (sprite->data[0] == 0x60)
|
||||
SetGpuReg(REG_OFFSET_BG0VOFS, DISPLAY_WIDTH / 2 - (sprite->sTimer / 3));
|
||||
if (sprite->sTimer == 96)
|
||||
{
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
@@ -1422,42 +1434,42 @@ void sub_8155F80(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sprite->data[0] > 0x137)
|
||||
if (sprite->sTimer > 311)
|
||||
{
|
||||
sprite->data[2] = 1;
|
||||
sprite->data[0] = 0;
|
||||
sprite->sState = 1;
|
||||
sprite->sTimer = 0;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
sprite->pos1.y = (gSineTable[sprite->data[0] / 3] >> 2) + sprite->data[4];
|
||||
if (sprite->data[0] == 0xBD)
|
||||
sprite->pos1.y = (gSineTable[sprite->sTimer / 3] >> 2) + sprite->sStartY;
|
||||
if (sprite->sTimer == 189)
|
||||
{
|
||||
sprite->data[2] = 2;
|
||||
sprite->data[5] = 0;
|
||||
sprite->data[0] = 0;
|
||||
sprite->sState = 2;
|
||||
sprite->sCounter = 0;
|
||||
sprite->sTimer = 0;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (sprite->data[0] == 0x3C)
|
||||
if (sprite->sTimer == 60)
|
||||
{
|
||||
sprite->data[5]++;
|
||||
sprite->data[0] = 0;
|
||||
sprite->sCounter++;
|
||||
sprite->sTimer = 0;
|
||||
}
|
||||
if (sprite->data[5] == 7)
|
||||
if (sprite->sCounter == 7)
|
||||
{
|
||||
sprite->data[5] = 0;
|
||||
sprite->data[2] = 3;
|
||||
sprite->sCounter = 0;
|
||||
sprite->sState = 3;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (sprite->pos2.y == 0)
|
||||
{
|
||||
sprite->data[0] = 0;
|
||||
sprite->data[2]++;
|
||||
sprite->sTimer = 0;
|
||||
sprite->sState++;
|
||||
}
|
||||
if (sprite->data[0] == 5)
|
||||
if (sprite->sTimer == 5)
|
||||
{
|
||||
sprite->data[0] = 0;
|
||||
sprite->sTimer = 0;
|
||||
if (sprite->pos2.y > 0)
|
||||
sprite->pos2.y--;
|
||||
else
|
||||
@@ -1465,38 +1477,38 @@ void sub_8155F80(struct Sprite *sprite)
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (sprite->data[0] == 0x3C)
|
||||
if (sprite->sTimer == 60)
|
||||
{
|
||||
sprite->data[2] = 5;
|
||||
sprite->data[0] = 0;
|
||||
sprite->data[5] = 0;
|
||||
sprite->sState = 5;
|
||||
sprite->sTimer = 0;
|
||||
sprite->sCounter = 0;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
sub_8155EA0(sprite);
|
||||
sprite->data[2] = 6;
|
||||
sprite->data[0] = 0;
|
||||
InitRayquazaForFigure8Anim(sprite);
|
||||
sprite->sState = 6;
|
||||
sprite->sTimer = 0;
|
||||
break;
|
||||
case 6:
|
||||
if (sub_8155EA8(sprite))
|
||||
if (AnimateRayquazaInFigure8(sprite))
|
||||
{
|
||||
sprite->data[0] = 0;
|
||||
if (++sprite->data[5] <= 2)
|
||||
sprite->sTimer = 0;
|
||||
if (++sprite->sCounter <= 2)
|
||||
{
|
||||
sub_8155EA0(sprite);
|
||||
InitRayquazaForFigure8Anim(sprite);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->data[5] = 0;
|
||||
sprite->data[2] = 7;
|
||||
sprite->sCounter = 0;
|
||||
sprite->sState = 7;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (sprite->data[0] == 0x1E)
|
||||
if (sprite->sTimer == 30)
|
||||
{
|
||||
sprite->data[2] = 8;
|
||||
sprite->data[0] = 0;
|
||||
sprite->sState = 8;
|
||||
sprite->sTimer = 0;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
@@ -1508,11 +1520,11 @@ void sub_8155F80(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
SetGpuReg(REG_OFFSET_BG0VOFS, 0);
|
||||
FieldEffectStop(sprite, FLDEFF_RAYQUAZA);
|
||||
FieldEffectStop(sprite, FLDEFF_RAYQUAZA_SPOTLIGHT);
|
||||
break;
|
||||
}
|
||||
|
||||
if (sprite->data[2] == 1)
|
||||
if (sprite->sState == 1)
|
||||
{
|
||||
if ((sprite->data[1] & 7) == 0)
|
||||
sprite->pos2.y += sprite->data[3];
|
||||
@@ -1521,10 +1533,17 @@ void sub_8155F80(struct Sprite *sprite)
|
||||
sprite->data[1]++;
|
||||
}
|
||||
|
||||
sprite->data[0]++;
|
||||
sprite->sTimer++;
|
||||
}
|
||||
|
||||
void sub_8156194(struct Sprite *sprite)
|
||||
#undef sTimer
|
||||
#undef sState
|
||||
#undef sStartY
|
||||
#undef sCounter
|
||||
#undef sAnimCounter
|
||||
#undef sAnimState
|
||||
|
||||
void UpdateJumpImpactEffect(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->animEnded)
|
||||
{
|
||||
|
||||
+116
-116
@@ -25,6 +25,7 @@
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/event_object_movement.h"
|
||||
#include "constants/field_effects.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/moves.h"
|
||||
#include "constants/songs.h"
|
||||
@@ -100,9 +101,9 @@ static void sub_808C280(struct ObjectEvent *);
|
||||
|
||||
static void StartStrengthAnim(u8, u8);
|
||||
static void Task_PushBoulder(u8 taskId);
|
||||
static u8 PushBoulder_Start(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject);
|
||||
static u8 PushBoulder_Move(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject);
|
||||
static u8 PushBoulder_End(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject);
|
||||
static bool8 PushBoulder_Start(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject);
|
||||
static bool8 PushBoulder_Move(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject);
|
||||
static bool8 PushBoulder_End(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject);
|
||||
|
||||
static void DoPlayerMatJump(void);
|
||||
static void DoPlayerAvatarSecretBaseMatJump(u8 taskId);
|
||||
@@ -120,22 +121,22 @@ static void Task_StopSurfingInit(u8 taskId);
|
||||
static void Task_WaitStopSurfing(u8 taskId);
|
||||
|
||||
static void Task_Fishing(u8 taskId);
|
||||
static u8 Fishing1(struct Task *task);
|
||||
static u8 Fishing2(struct Task *task);
|
||||
static u8 Fishing3(struct Task *task);
|
||||
static u8 Fishing4(struct Task *task);
|
||||
static u8 Fishing5(struct Task *task);
|
||||
static u8 Fishing6(struct Task *task);
|
||||
static u8 Fishing7(struct Task *task);
|
||||
static u8 Fishing8(struct Task *task);
|
||||
static u8 Fishing9(struct Task *task);
|
||||
static u8 Fishing10(struct Task *task);
|
||||
static u8 Fishing11(struct Task *task);
|
||||
static u8 Fishing12(struct Task *task);
|
||||
static u8 Fishing13(struct Task *task);
|
||||
static u8 Fishing14(struct Task *task);
|
||||
static u8 Fishing15(struct Task *task);
|
||||
static u8 Fishing16(struct Task *task);
|
||||
static u8 Fishing_Init(struct Task *task);
|
||||
static u8 Fishing_GetRodOut(struct Task *task);
|
||||
static u8 Fishing_WaitBeforeDots(struct Task *task);
|
||||
static u8 Fishing_InitDots(struct Task *task);
|
||||
static u8 Fishing_ShowDots(struct Task *task);
|
||||
static u8 Fishing_CheckForBite(struct Task *task);
|
||||
static u8 Fishing_GotBite(struct Task *task);
|
||||
static u8 Fishing_WaitForA(struct Task *task);
|
||||
static u8 Fishing_CheckMoreDots(struct Task *task);
|
||||
static u8 Fishing_MonOnHook(struct Task *task);
|
||||
static u8 Fishing_StartEncounter(struct Task *task);
|
||||
static u8 Fishing_NotEvenNibble(struct Task *task);
|
||||
static u8 Fishing_GotAway(struct Task *task);
|
||||
static u8 Fishing_NoMon(struct Task *task);
|
||||
static u8 Fishing_PutRodAway(struct Task *task);
|
||||
static u8 Fishing_EndNoMon(struct Task *task);
|
||||
static void AlignFishingAnimationFrames(void);
|
||||
|
||||
static u8 sub_808D38C(struct ObjectEvent *object, s16 *a1);
|
||||
@@ -319,7 +320,7 @@ static u8 ObjectEventCB2_NoMovement2(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void player_step(u8 direction, u16 newKeys, u16 heldKeys)
|
||||
void PlayerStep(u8 direction, u16 newKeys, u16 heldKeys)
|
||||
{
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
@@ -378,9 +379,9 @@ static bool8 TryInterruptObjectEventSpecialAnim(struct ObjectEvent *playerObjEve
|
||||
|
||||
static void npc_clear_strange_bits(struct ObjectEvent *objEvent)
|
||||
{
|
||||
objEvent->inanimate = 0;
|
||||
objEvent->disableAnim = 0;
|
||||
objEvent->facingDirectionLocked = 0;
|
||||
objEvent->inanimate = FALSE;
|
||||
objEvent->disableAnim = FALSE;
|
||||
objEvent->facingDirectionLocked = FALSE;
|
||||
gPlayerAvatar.flags &= ~PLAYER_AVATAR_FLAG_DASH;
|
||||
}
|
||||
|
||||
@@ -423,14 +424,14 @@ static u8 GetForcedMovementByMetatileBehavior(void)
|
||||
|
||||
static bool8 ForcedMovement_None(void)
|
||||
{
|
||||
if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_6)
|
||||
if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_FORCED_MOVE)
|
||||
{
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
playerObjEvent->facingDirectionLocked = 0;
|
||||
playerObjEvent->enableAnim = 1;
|
||||
playerObjEvent->facingDirectionLocked = FALSE;
|
||||
playerObjEvent->enableAnim = TRUE;
|
||||
SetObjectEventDirection(playerObjEvent, playerObjEvent->facingDirection);
|
||||
gPlayerAvatar.flags &= ~PLAYER_AVATAR_FLAG_6;
|
||||
gPlayerAvatar.flags &= ~PLAYER_AVATAR_FLAG_FORCED_MOVE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@@ -440,7 +441,7 @@ static u8 DoForcedMovement(u8 direction, void (*b)(u8))
|
||||
struct PlayerAvatar *playerAvatar = &gPlayerAvatar;
|
||||
u8 collision = CheckForPlayerAvatarCollision(direction);
|
||||
|
||||
playerAvatar->flags |= PLAYER_AVATAR_FLAG_6;
|
||||
playerAvatar->flags |= PLAYER_AVATAR_FLAG_FORCED_MOVE;
|
||||
if (collision)
|
||||
{
|
||||
ForcedMovement_None();
|
||||
@@ -452,7 +453,7 @@ static u8 DoForcedMovement(u8 direction, void (*b)(u8))
|
||||
{
|
||||
if (collision == COLLISION_LEDGE_JUMP)
|
||||
PlayerJumpLedge(direction);
|
||||
playerAvatar->flags |= PLAYER_AVATAR_FLAG_6;
|
||||
playerAvatar->flags |= PLAYER_AVATAR_FLAG_FORCED_MOVE;
|
||||
playerAvatar->runningState = MOVING;
|
||||
return 1;
|
||||
}
|
||||
@@ -469,7 +470,7 @@ static u8 DoForcedMovementInCurrentDirection(void (*a)(u8))
|
||||
{
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
playerObjEvent->disableAnim = 1;
|
||||
playerObjEvent->disableAnim = TRUE;
|
||||
return DoForcedMovement(playerObjEvent->movementDirection, a);
|
||||
}
|
||||
|
||||
@@ -518,12 +519,12 @@ static bool8 ForcedMovement_PushedEastByCurrent(void)
|
||||
return DoForcedMovement(DIR_EAST, PlayerRideWaterCurrent);
|
||||
}
|
||||
|
||||
u8 ForcedMovement_Slide(u8 direction, void (*b)(u8))
|
||||
static u8 ForcedMovement_Slide(u8 direction, void (*b)(u8))
|
||||
{
|
||||
struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
playerObjEvent->disableAnim = 1;
|
||||
playerObjEvent->facingDirectionLocked = 1;
|
||||
playerObjEvent->disableAnim = TRUE;
|
||||
playerObjEvent->facingDirectionLocked = TRUE;
|
||||
return DoForcedMovement(direction, b);
|
||||
}
|
||||
|
||||
@@ -566,8 +567,8 @@ static bool8 ForcedMovement_MuddySlope(void)
|
||||
if (playerObjEvent->movementDirection != DIR_NORTH || GetPlayerSpeed() <= 3)
|
||||
{
|
||||
Bike_UpdateBikeCounterSpeed(0);
|
||||
playerObjEvent->facingDirectionLocked = 1;
|
||||
return DoForcedMovement(1, PlayerGoSpeed2);
|
||||
playerObjEvent->facingDirectionLocked = TRUE;
|
||||
return DoForcedMovement(DIR_SOUTH, PlayerGoSpeed2);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -868,7 +869,7 @@ static void PlayerAvatarTransition_Surfing(struct ObjectEvent *objEvent)
|
||||
gFieldEffectArguments[2] = gPlayerAvatar.objectEventId;
|
||||
spriteId = FieldEffectStart(FLDEFF_SURF_BLOB);
|
||||
objEvent->fieldEffectSpriteId = spriteId;
|
||||
sub_81555AC(spriteId, 1);
|
||||
SetSurfBobState(spriteId, 1);
|
||||
}
|
||||
|
||||
static void PlayerAvatarTransition_Underwater(struct ObjectEvent *objEvent)
|
||||
@@ -884,7 +885,7 @@ static void PlayerAvatarTransition_ReturnToField(struct ObjectEvent *objEvent)
|
||||
gPlayerAvatar.flags |= PLAYER_AVATAR_FLAG_5;
|
||||
}
|
||||
|
||||
void sub_808B578(void)
|
||||
void UpdatePlayerAvatarTransitionState(void)
|
||||
{
|
||||
gPlayerAvatar.tileTransitionState = T_NOT_MOVING;
|
||||
if (PlayerIsAnimActive())
|
||||
@@ -1020,7 +1021,7 @@ void PlayerTurnInPlace(u8 direction)
|
||||
|
||||
void PlayerJumpLedge(u8 direction)
|
||||
{
|
||||
PlaySE(SE_DANSA);
|
||||
PlaySE(SE_LEDGE);
|
||||
PlayerSetAnimId(GetJump2MovementAction(direction), 8);
|
||||
}
|
||||
|
||||
@@ -1054,28 +1055,28 @@ void PlayerEndWheelie(u8 direction)
|
||||
// wheelie hopping standing
|
||||
void PlayerStandingHoppingWheelie(u8 a)
|
||||
{
|
||||
PlaySE(SE_JITE_PYOKO);
|
||||
PlaySE(SE_BIKE_HOP);
|
||||
PlayerSetAnimId(GetAcroWheelieHopFaceDirectionMovementAction(a), 1);
|
||||
}
|
||||
|
||||
// wheelie hopping moving
|
||||
void PlayerMovingHoppingWheelie(u8 a)
|
||||
{
|
||||
PlaySE(SE_JITE_PYOKO);
|
||||
PlaySE(SE_BIKE_HOP);
|
||||
PlayerSetAnimId(GetAcroWheelieHopDirectionMovementAction(a), 2);
|
||||
}
|
||||
|
||||
// wheelie hopping ledge
|
||||
void PlayerLedgeHoppingWheelie(u8 a)
|
||||
{
|
||||
PlaySE(SE_JITE_PYOKO);
|
||||
PlaySE(SE_BIKE_HOP);
|
||||
PlayerSetAnimId(GetAcroWheelieJumpDirectionMovementAction(a), 8);
|
||||
}
|
||||
|
||||
// acro turn jump
|
||||
void PlayerAcroTurnJump(u8 direction)
|
||||
{
|
||||
PlaySE(SE_JITE_PYOKO);
|
||||
PlaySE(SE_BIKE_HOP);
|
||||
PlayerSetAnimId(GetJumpInPlaceTurnAroundMovementAction(direction), 1);
|
||||
}
|
||||
|
||||
@@ -1327,7 +1328,7 @@ void ClearPlayerAvatarInfo(void)
|
||||
|
||||
void SetPlayerAvatarStateMask(u8 flags)
|
||||
{
|
||||
gPlayerAvatar.flags &= (PLAYER_AVATAR_FLAG_DASH | PLAYER_AVATAR_FLAG_6 | PLAYER_AVATAR_FLAG_5);
|
||||
gPlayerAvatar.flags &= (PLAYER_AVATAR_FLAG_DASH | PLAYER_AVATAR_FLAG_FORCED_MOVE | PLAYER_AVATAR_FLAG_5);
|
||||
gPlayerAvatar.flags |= flags;
|
||||
}
|
||||
|
||||
@@ -1403,13 +1404,13 @@ void SetPlayerInvisibility(bool8 invisible)
|
||||
gSprites[gObjectEvents[gPlayerAvatar.objectEventId].fieldEffectSpriteId].invisible = invisible;
|
||||
}
|
||||
|
||||
void sub_808C114(void)
|
||||
void SetPlayerAvatarFieldMove(void)
|
||||
{
|
||||
ObjectEventSetGraphicsId(&gObjectEvents[gPlayerAvatar.objectEventId], GetPlayerAvatarGraphicsIdByStateId(PLAYER_AVATAR_STATE_FIELD_MOVE));
|
||||
StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], 0);
|
||||
}
|
||||
|
||||
void sub_808C15C(u8 direction)
|
||||
static void SetPlayerAvatarFishing(u8 direction)
|
||||
{
|
||||
ObjectEventSetGraphicsId(&gObjectEvents[gPlayerAvatar.objectEventId], GetPlayerAvatarGraphicsIdByStateId(PLAYER_AVATAR_STATE_FISHING));
|
||||
StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], GetFishingDirectionAnimNum(direction));
|
||||
@@ -1422,7 +1423,7 @@ void PlayerUseAcroBikeOnBumpySlope(u8 direction)
|
||||
SeekSpriteAnim(&gSprites[gPlayerAvatar.spriteId], 1);
|
||||
}
|
||||
|
||||
void sub_808C228(u8 direction)
|
||||
void SetPlayerAvatarWatering(u8 direction)
|
||||
{
|
||||
ObjectEventSetGraphicsId(&gObjectEvents[gPlayerAvatar.objectEventId], GetPlayerAvatarGraphicsIdByStateId(PLAYER_AVATAR_STATE_WATERING));
|
||||
StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], GetFaceDirectionAnimNum(direction));
|
||||
@@ -1500,7 +1501,7 @@ static bool8 PushBoulder_Move(struct Task *task, struct ObjectEvent *playerObjec
|
||||
gFieldEffectArguments[2] = strengthObject->previousElevation;
|
||||
gFieldEffectArguments[3] = gSprites[strengthObject->spriteId].oam.priority;
|
||||
FieldEffectStart(FLDEFF_DUST);
|
||||
PlaySE(SE_W070);
|
||||
PlaySE(SE_M_STRENGTH);
|
||||
task->data[0]++;
|
||||
}
|
||||
return FALSE;
|
||||
@@ -1539,7 +1540,7 @@ static u8 PlayerAvatar_DoSecretBaseMatJump(struct Task *task, struct ObjectEvent
|
||||
gPlayerAvatar.preventStep = TRUE;
|
||||
if (ObjectEventClearHeldMovementIfFinished(objectEvent))
|
||||
{
|
||||
PlaySE(SE_DANSA);
|
||||
PlaySE(SE_LEDGE);
|
||||
ObjectEventSetHeldMovement(objectEvent, GetJumpInPlaceMovementAction(objectEvent->facingDirection));
|
||||
task->data[1]++;
|
||||
if (task->data[1] > 1)
|
||||
@@ -1573,7 +1574,7 @@ static bool8 PlayerAvatar_SecretBaseMatSpinStep0(struct Task *task, struct Objec
|
||||
task->data[1] = objectEvent->movementDirection;
|
||||
gPlayerAvatar.preventStep = TRUE;
|
||||
ScriptContext2_Enable();
|
||||
PlaySE(SE_TK_WARPIN);
|
||||
PlaySE(SE_WARP_IN);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1649,7 +1650,7 @@ static void Task_StopSurfingInit(u8 taskId)
|
||||
if (!ObjectEventClearHeldMovementIfFinished(playerObjEvent))
|
||||
return;
|
||||
}
|
||||
sub_81555AC(playerObjEvent->fieldEffectSpriteId, 2);
|
||||
SetSurfBobState(playerObjEvent->fieldEffectSpriteId, 2);
|
||||
ObjectEventSetHeldMovement(playerObjEvent, GetJumpSpecialMovementAction((u8)gTasks[taskId].data[0]));
|
||||
gTasks[taskId].func = Task_WaitStopSurfing;
|
||||
}
|
||||
@@ -1669,26 +1670,6 @@ static void Task_WaitStopSurfing(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
static bool8 (*const sFishingStateFuncs[])(struct Task *) =
|
||||
{
|
||||
Fishing1,
|
||||
Fishing2,
|
||||
Fishing3,
|
||||
Fishing4,
|
||||
Fishing5,
|
||||
Fishing6,
|
||||
Fishing7,
|
||||
Fishing8,
|
||||
Fishing9,
|
||||
Fishing10,
|
||||
Fishing11,
|
||||
Fishing12,
|
||||
Fishing13,
|
||||
Fishing14,
|
||||
Fishing15,
|
||||
Fishing16,
|
||||
};
|
||||
|
||||
#define tStep data[0]
|
||||
#define tFrameCounter data[1]
|
||||
#define tNumDots data[2]
|
||||
@@ -1698,6 +1679,7 @@ static bool8 (*const sFishingStateFuncs[])(struct Task *) =
|
||||
#define tPlayerGfxId data[14]
|
||||
#define tFishingRod data[15]
|
||||
|
||||
// Some states are jumped to directly, labeled below
|
||||
#define FISHING_START_ROUND 3
|
||||
#define FISHING_GOT_BITE 6
|
||||
#define FISHING_ON_HOOK 9
|
||||
@@ -1705,6 +1687,26 @@ static bool8 (*const sFishingStateFuncs[])(struct Task *) =
|
||||
#define FISHING_GOT_AWAY 12
|
||||
#define FISHING_SHOW_RESULT 13
|
||||
|
||||
static bool8 (*const sFishingStateFuncs[])(struct Task *) =
|
||||
{
|
||||
Fishing_Init,
|
||||
Fishing_GetRodOut,
|
||||
Fishing_WaitBeforeDots,
|
||||
Fishing_InitDots, // FISHING_START_ROUND
|
||||
Fishing_ShowDots,
|
||||
Fishing_CheckForBite,
|
||||
Fishing_GotBite, // FISHING_GOT_BITE
|
||||
Fishing_WaitForA,
|
||||
Fishing_CheckMoreDots,
|
||||
Fishing_MonOnHook, // FISHING_ON_HOOK
|
||||
Fishing_StartEncounter,
|
||||
Fishing_NotEvenNibble, // FISHING_NO_BITE
|
||||
Fishing_GotAway, // FISHING_GOT_AWAY
|
||||
Fishing_NoMon, // FISHING_SHOW_RESULT
|
||||
Fishing_PutRodAway,
|
||||
Fishing_EndNoMon,
|
||||
};
|
||||
|
||||
void StartFishing(u8 rod)
|
||||
{
|
||||
u8 taskId = CreateTask(Task_Fishing, 0xFF);
|
||||
@@ -1719,7 +1721,7 @@ static void Task_Fishing(u8 taskId)
|
||||
;
|
||||
}
|
||||
|
||||
static bool8 Fishing1(struct Task *task)
|
||||
static bool8 Fishing_Init(struct Task *task)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
gPlayerAvatar.preventStep = TRUE;
|
||||
@@ -1727,24 +1729,32 @@ static bool8 Fishing1(struct Task *task)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool8 Fishing2(struct Task *task)
|
||||
static bool8 Fishing_GetRodOut(struct Task *task)
|
||||
{
|
||||
struct ObjectEvent *playerObjEvent;
|
||||
const s16 arr1[] = {1, 1, 1};
|
||||
const s16 arr2[] = {1, 3, 6};
|
||||
const s16 minRounds1[] = {
|
||||
[OLD_ROD] = 1,
|
||||
[GOOD_ROD] = 1,
|
||||
[SUPER_ROD] = 1
|
||||
};
|
||||
const s16 minRounds2[] = {
|
||||
[OLD_ROD] = 1,
|
||||
[GOOD_ROD] = 3,
|
||||
[SUPER_ROD] = 6
|
||||
};
|
||||
|
||||
task->tRoundsPlayed = 0;
|
||||
task->tMinRoundsRequired = arr1[task->tFishingRod] + (Random() % arr2[task->tFishingRod]);
|
||||
task->tMinRoundsRequired = minRounds1[task->tFishingRod] + (Random() % minRounds2[task->tFishingRod]);
|
||||
task->tPlayerGfxId = gObjectEvents[gPlayerAvatar.objectEventId].graphicsId;
|
||||
playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
ObjectEventClearHeldMovementIfActive(playerObjEvent);
|
||||
playerObjEvent->enableAnim = 1;
|
||||
sub_808C15C(playerObjEvent->facingDirection);
|
||||
playerObjEvent->enableAnim = TRUE;
|
||||
SetPlayerAvatarFishing(playerObjEvent->facingDirection);
|
||||
task->tStep++;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool8 Fishing3(struct Task *task)
|
||||
static bool8 Fishing_WaitBeforeDots(struct Task *task)
|
||||
{
|
||||
AlignFishingAnimationFrames();
|
||||
|
||||
@@ -1755,7 +1765,7 @@ static bool8 Fishing3(struct Task *task)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool8 Fishing4(struct Task *task)
|
||||
static bool8 Fishing_InitDots(struct Task *task)
|
||||
{
|
||||
u32 randVal;
|
||||
|
||||
@@ -1773,8 +1783,7 @@ static bool8 Fishing4(struct Task *task)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Play a round of the dot game
|
||||
static bool8 Fishing5(struct Task *task)
|
||||
static bool8 Fishing_ShowDots(struct Task *task)
|
||||
{
|
||||
const u8 dot[] = _("·");
|
||||
|
||||
@@ -1809,8 +1818,7 @@ static bool8 Fishing5(struct Task *task)
|
||||
}
|
||||
}
|
||||
|
||||
// Determine if fish bites
|
||||
static bool8 Fishing6(struct Task *task)
|
||||
static bool8 Fishing_CheckForBite(struct Task *task)
|
||||
{
|
||||
bool8 bite;
|
||||
|
||||
@@ -1830,34 +1838,25 @@ static bool8 Fishing6(struct Task *task)
|
||||
if (ability == ABILITY_SUCTION_CUPS || ability == ABILITY_STICKY_HOLD)
|
||||
{
|
||||
if (Random() % 100 > 14)
|
||||
{
|
||||
bite = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!bite)
|
||||
{
|
||||
if (Random() & 1)
|
||||
{
|
||||
task->tStep = FISHING_NO_BITE;
|
||||
}
|
||||
else
|
||||
{
|
||||
bite = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (bite == TRUE)
|
||||
{
|
||||
StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], GetFishingBiteDirectionAnimNum(GetPlayerFacingDirection()));
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Oh! A Bite!
|
||||
static bool8 Fishing7(struct Task *task)
|
||||
static bool8 Fishing_GotBite(struct Task *task)
|
||||
{
|
||||
AlignFishingAnimationFrames();
|
||||
AddTextPrinterParameterized(0, 1, gText_OhABite, 0, 17, 0, NULL);
|
||||
@@ -1867,9 +1866,13 @@ static bool8 Fishing7(struct Task *task)
|
||||
}
|
||||
|
||||
// We have a bite. Now, wait for the player to press A, or the timer to expire.
|
||||
static bool8 Fishing8(struct Task *task)
|
||||
static bool8 Fishing_WaitForA(struct Task *task)
|
||||
{
|
||||
const s16 reelTimeouts[3] = {36, 33, 30};
|
||||
const s16 reelTimeouts[3] = {
|
||||
[OLD_ROD] = 36,
|
||||
[GOOD_ROD] = 33,
|
||||
[SUPER_ROD] = 30
|
||||
};
|
||||
|
||||
AlignFishingAnimationFrames();
|
||||
task->tFrameCounter++;
|
||||
@@ -1881,13 +1884,13 @@ static bool8 Fishing8(struct Task *task)
|
||||
}
|
||||
|
||||
// Determine if we're going to play the dot game again
|
||||
static bool8 Fishing9(struct Task *task)
|
||||
static bool8 Fishing_CheckMoreDots(struct Task *task)
|
||||
{
|
||||
const s16 arr[][2] =
|
||||
const s16 moreDotsChance[][2] =
|
||||
{
|
||||
{0, 0},
|
||||
{40, 10},
|
||||
{70, 30}
|
||||
[OLD_ROD] = {0, 0},
|
||||
[GOOD_ROD] = {40, 10},
|
||||
[SUPER_ROD] = {70, 30}
|
||||
};
|
||||
|
||||
AlignFishingAnimationFrames();
|
||||
@@ -1901,13 +1904,13 @@ static bool8 Fishing9(struct Task *task)
|
||||
// probability of having to play another round
|
||||
s16 probability = Random() % 100;
|
||||
|
||||
if (arr[task->tFishingRod][task->tRoundsPlayed] > probability)
|
||||
if (moreDotsChance[task->tFishingRod][task->tRoundsPlayed] > probability)
|
||||
task->tStep = FISHING_START_ROUND;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool8 Fishing10(struct Task *task)
|
||||
static bool8 Fishing_MonOnHook(struct Task *task)
|
||||
{
|
||||
AlignFishingAnimationFrames();
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
@@ -1917,7 +1920,7 @@ static bool8 Fishing10(struct Task *task)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool8 Fishing11(struct Task *task)
|
||||
static bool8 Fishing_StartEncounter(struct Task *task)
|
||||
{
|
||||
if (task->tFrameCounter == 0)
|
||||
AlignFishingAnimationFrames();
|
||||
@@ -1933,7 +1936,7 @@ static bool8 Fishing11(struct Task *task)
|
||||
ObjectEventSetGraphicsId(playerObjEvent, task->tPlayerGfxId);
|
||||
ObjectEventTurn(playerObjEvent, playerObjEvent->movementDirection);
|
||||
if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING)
|
||||
sub_8155604(gObjectEvents[gPlayerAvatar.objectEventId].fieldEffectSpriteId, 0, 0);
|
||||
SetSurfBobWhileFishingState(gObjectEvents[gPlayerAvatar.objectEventId].fieldEffectSpriteId, 0, 0);
|
||||
gSprites[gPlayerAvatar.spriteId].pos2.x = 0;
|
||||
gSprites[gPlayerAvatar.spriteId].pos2.y = 0;
|
||||
ClearDialogWindowAndFrame(0, TRUE);
|
||||
@@ -1947,14 +1950,13 @@ static bool8 Fishing11(struct Task *task)
|
||||
gPlayerAvatar.preventStep = FALSE;
|
||||
ScriptContext2_Disable();
|
||||
FishingWildEncounter(task->tFishingRod);
|
||||
sub_80ED950(1);
|
||||
RecordFishingAttemptForTV(TRUE);
|
||||
DestroyTask(FindTaskIdByFunc(Task_Fishing));
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Not even a nibble
|
||||
static bool8 Fishing12(struct Task *task)
|
||||
static bool8 Fishing_NotEvenNibble(struct Task *task)
|
||||
{
|
||||
AlignFishingAnimationFrames();
|
||||
StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], GetFishingNoCatchDirectionAnimNum(GetPlayerFacingDirection()));
|
||||
@@ -1964,8 +1966,7 @@ static bool8 Fishing12(struct Task *task)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// It got away
|
||||
static bool8 Fishing13(struct Task *task)
|
||||
static bool8 Fishing_GotAway(struct Task *task)
|
||||
{
|
||||
AlignFishingAnimationFrames();
|
||||
StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], GetFishingNoCatchDirectionAnimNum(GetPlayerFacingDirection()));
|
||||
@@ -1975,15 +1976,14 @@ static bool8 Fishing13(struct Task *task)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Wait one second
|
||||
static bool8 Fishing14(struct Task *task)
|
||||
static bool8 Fishing_NoMon(struct Task *task)
|
||||
{
|
||||
AlignFishingAnimationFrames();
|
||||
task->tStep++;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool8 Fishing15(struct Task *task)
|
||||
static bool8 Fishing_PutRodAway(struct Task *task)
|
||||
{
|
||||
AlignFishingAnimationFrames();
|
||||
if (gSprites[gPlayerAvatar.spriteId].animEnded)
|
||||
@@ -1993,7 +1993,7 @@ static bool8 Fishing15(struct Task *task)
|
||||
ObjectEventSetGraphicsId(playerObjEvent, task->tPlayerGfxId);
|
||||
ObjectEventTurn(playerObjEvent, playerObjEvent->movementDirection);
|
||||
if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING)
|
||||
sub_8155604(gObjectEvents[gPlayerAvatar.objectEventId].fieldEffectSpriteId, 0, 0);
|
||||
SetSurfBobWhileFishingState(gObjectEvents[gPlayerAvatar.objectEventId].fieldEffectSpriteId, 0, 0);
|
||||
gSprites[gPlayerAvatar.spriteId].pos2.x = 0;
|
||||
gSprites[gPlayerAvatar.spriteId].pos2.y = 0;
|
||||
task->tStep++;
|
||||
@@ -2001,7 +2001,7 @@ static bool8 Fishing15(struct Task *task)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool8 Fishing16(struct Task *task)
|
||||
static bool8 Fishing_EndNoMon(struct Task *task)
|
||||
{
|
||||
RunTextPrinters();
|
||||
if (!IsTextPrinterActive(0))
|
||||
@@ -2010,7 +2010,7 @@ static bool8 Fishing16(struct Task *task)
|
||||
ScriptContext2_Disable();
|
||||
UnfreezeObjectEvents();
|
||||
ClearDialogWindowAndFrame(0, TRUE);
|
||||
sub_80ED950(0);
|
||||
RecordFishingAttemptForTV(FALSE);
|
||||
DestroyTask(FindTaskIdByFunc(Task_Fishing));
|
||||
}
|
||||
return FALSE;
|
||||
@@ -2052,7 +2052,7 @@ static void AlignFishingAnimationFrames(void)
|
||||
if (animType == 10 || animType == 11)
|
||||
playerSprite->pos2.y = 8;
|
||||
if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING)
|
||||
sub_8155604(gObjectEvents[gPlayerAvatar.objectEventId].fieldEffectSpriteId, 1, playerSprite->pos2.y);
|
||||
SetSurfBobWhileFishingState(gObjectEvents[gPlayerAvatar.objectEventId].fieldEffectSpriteId, 1, playerSprite->pos2.y);
|
||||
}
|
||||
|
||||
void sub_808D074(u8 a0)
|
||||
|
||||
@@ -116,7 +116,7 @@ static void MCB2_InitRegionMapRegisters(void)
|
||||
InitWindows(sFieldRegionMapWindowTemplates);
|
||||
DeactivateAllTextPrinters();
|
||||
LoadUserWindowBorderGfx(0, 0x27, 0xd0);
|
||||
clear_scheduled_bg_copies_to_vram();
|
||||
ClearScheduledBgCopiesToVram();
|
||||
SetMainCallback2(MCB2_FieldUpdateRegionMap);
|
||||
SetVBlankCallback(VBCB_FieldUpdateRegionMap);
|
||||
}
|
||||
@@ -134,7 +134,7 @@ static void MCB2_FieldUpdateRegionMap(void)
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
UpdatePaletteFade();
|
||||
do_scheduled_bg_tilemap_copies_to_vram();
|
||||
DoScheduledBgTilemapCopiesToVram();
|
||||
}
|
||||
|
||||
static void FieldUpdateRegionMap(void)
|
||||
|
||||
+40
-38
@@ -12,6 +12,7 @@
|
||||
#include "field_special_scene.h"
|
||||
#include "field_weather.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "io_reg.h"
|
||||
#include "link.h"
|
||||
#include "link_rfu.h"
|
||||
#include "load_save.h"
|
||||
@@ -34,18 +35,14 @@
|
||||
#include "trainer_hill.h"
|
||||
#include "fldeff.h"
|
||||
|
||||
extern const u16 gOrbEffectBackgroundLayerFlags[];
|
||||
|
||||
// This file's functions.
|
||||
static void sub_8080B9C(u8);
|
||||
static void Task_ExitNonAnimDoor(u8);
|
||||
static void Task_ExitNonDoor(u8);
|
||||
static void task0A_fade_n_map_maybe(u8);
|
||||
static void sub_808115C(u8);
|
||||
static void Task_DoContestHallWarp(u8);
|
||||
static void FillPalBufferWhite(void);
|
||||
static void Task_ExitDoor(u8);
|
||||
static bool32 WaitForWeatherFadeIn(void);
|
||||
static void task0A_mpl_807E31C(u8 taskId);
|
||||
static void Task_TeleportTileWarpExit(u8 taskId);
|
||||
static void Task_WarpAndLoadMap(u8 taskId);
|
||||
static void Task_DoDoorWarp(u8 taskId);
|
||||
static void Task_EnableScriptAfterMusicFade(u8 taskId);
|
||||
@@ -197,7 +194,7 @@ static void Task_ReturnToFieldWirelessLink(u8 taskId)
|
||||
switch (task->data[0])
|
||||
{
|
||||
case 0:
|
||||
sub_800ADF8();
|
||||
SetLinkStandbyCallback();
|
||||
task->data[0]++;
|
||||
break;
|
||||
case 1:
|
||||
@@ -230,7 +227,7 @@ void Task_ReturnToFieldRecordMixing(u8 taskId)
|
||||
switch (task->data[0])
|
||||
{
|
||||
case 0:
|
||||
sub_800ADF8();
|
||||
SetLinkStandbyCallback();
|
||||
task->data[0]++;
|
||||
break;
|
||||
case 1:
|
||||
@@ -291,19 +288,19 @@ void FieldCB_WarpExitFadeFromWhite(void)
|
||||
|
||||
void FieldCB_WarpExitFadeFromBlack(void)
|
||||
{
|
||||
if (!sub_81D6534()) // sub_81D6534 always returns false
|
||||
if (!OnTrainerHillEReaderChallengeFloor()) // always false
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
FadeInFromBlack();
|
||||
SetUpWarpExitTask();
|
||||
ScriptContext2_Enable();
|
||||
}
|
||||
|
||||
static void FieldCB_TeleportWarpExit(void)
|
||||
static void FieldCB_TeleportTileWarpExit(void)
|
||||
{
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
WarpFadeInScreen();
|
||||
PlaySE(SE_TK_WARPOUT);
|
||||
CreateTask(task0A_mpl_807E31C, 10);
|
||||
PlaySE(SE_WARP_OUT);
|
||||
CreateTask(Task_TeleportTileWarpExit, 10);
|
||||
ScriptContext2_Enable();
|
||||
}
|
||||
|
||||
@@ -311,10 +308,10 @@ static void FieldCB_MossdeepGymWarpExit(void)
|
||||
{
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
WarpFadeInScreen();
|
||||
PlaySE(SE_TK_WARPOUT);
|
||||
PlaySE(SE_WARP_OUT);
|
||||
CreateTask(Task_ExitNonDoor, 10);
|
||||
ScriptContext2_Enable();
|
||||
sub_8085540(0xE);
|
||||
SetObjectEventLoadFlag((~SKIP_OBJECT_EVENT_LOAD) & 0xF);
|
||||
}
|
||||
|
||||
static void Task_ExitDoor(u8 taskId)
|
||||
@@ -490,7 +487,7 @@ void DoWarp(void)
|
||||
TryFadeOutOldMapMusic();
|
||||
WarpFadeOutScreen();
|
||||
PlayRainStoppingSoundEffect();
|
||||
PlaySE(SE_KAIDAN);
|
||||
PlaySE(SE_EXIT);
|
||||
gFieldCallback = FieldCB_DefaultWarpExit;
|
||||
CreateTask(Task_WarpAndLoadMap, 10);
|
||||
}
|
||||
@@ -546,24 +543,25 @@ void DoLavaridgeGym1FWarp(void)
|
||||
StartLavaridgeGym1FWarp(10);
|
||||
}
|
||||
|
||||
void DoTeleportWarp(void)
|
||||
// Warp from a teleporting tile, e.g. in Aqua Hideout (For the move Teleport see FldEff_TeleportWarpOut)
|
||||
void DoTeleportTileWarp(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
TryFadeOutOldMapMusic();
|
||||
WarpFadeOutScreen();
|
||||
PlaySE(SE_TK_WARPIN);
|
||||
PlaySE(SE_WARP_IN);
|
||||
CreateTask(Task_WarpAndLoadMap, 10);
|
||||
gFieldCallback = FieldCB_TeleportWarpExit;
|
||||
gFieldCallback = FieldCB_TeleportTileWarpExit;
|
||||
}
|
||||
|
||||
void DoMossdeepGymWarp(void)
|
||||
{
|
||||
sub_8085540(1);
|
||||
SetObjectEventLoadFlag(SKIP_OBJECT_EVENT_LOAD);
|
||||
ScriptContext2_Enable();
|
||||
SaveObjectEvents();
|
||||
TryFadeOutOldMapMusic();
|
||||
WarpFadeOutScreen();
|
||||
PlaySE(SE_TK_WARPIN);
|
||||
PlaySE(SE_WARP_IN);
|
||||
CreateTask(Task_WarpAndLoadMap, 10);
|
||||
gFieldCallback = FieldCB_MossdeepGymWarpExit;
|
||||
}
|
||||
@@ -576,19 +574,21 @@ void DoPortholeWarp(void)
|
||||
gFieldCallback = FieldCB_ShowPortholeView;
|
||||
}
|
||||
|
||||
static void sub_80AF8E0(u8 taskId)
|
||||
#define tState data[0]
|
||||
|
||||
static void Task_DoCableClubWarp(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
switch (task->data[0])
|
||||
switch (task->tState)
|
||||
{
|
||||
case 0:
|
||||
ScriptContext2_Enable();
|
||||
task->data[0]++;
|
||||
task->tState++;
|
||||
break;
|
||||
case 1:
|
||||
if (!PaletteFadeActive() && BGMusicStopped())
|
||||
task->data[0]++;
|
||||
task->tState++;
|
||||
break;
|
||||
case 2:
|
||||
WarpIntoMap();
|
||||
@@ -598,13 +598,15 @@ static void sub_80AF8E0(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
#undef tState
|
||||
|
||||
void DoCableClubWarp(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
TryFadeOutOldMapMusic();
|
||||
WarpFadeOutScreen();
|
||||
PlaySE(SE_KAIDAN);
|
||||
CreateTask(sub_80AF8E0, 10);
|
||||
PlaySE(SE_EXIT);
|
||||
CreateTask(Task_DoCableClubWarp, 10);
|
||||
}
|
||||
|
||||
static void Task_ReturnToWorldFromLinkRoom(u8 taskId)
|
||||
@@ -617,13 +619,13 @@ static void Task_ReturnToWorldFromLinkRoom(u8 taskId)
|
||||
ClearLinkCallback_2();
|
||||
FadeScreen(FADE_TO_BLACK, 0);
|
||||
TryFadeOutOldMapMusic();
|
||||
PlaySE(SE_KAIDAN);
|
||||
PlaySE(SE_EXIT);
|
||||
data[0]++;
|
||||
break;
|
||||
case 1:
|
||||
if (!PaletteFadeActive() && BGMusicStopped())
|
||||
{
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
data[0]++;
|
||||
}
|
||||
break;
|
||||
@@ -727,7 +729,7 @@ static void Task_DoDoorWarp(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
static void task0A_fade_n_map_maybe(u8 taskId)
|
||||
static void Task_DoContestHallWarp(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
@@ -746,7 +748,7 @@ static void task0A_fade_n_map_maybe(u8 taskId)
|
||||
break;
|
||||
case 2:
|
||||
WarpIntoMap();
|
||||
SetMainCallback2(sub_8086024);
|
||||
SetMainCallback2(CB2_ReturnToFieldContestHall);
|
||||
DestroyTask(taskId);
|
||||
break;
|
||||
}
|
||||
@@ -758,9 +760,9 @@ void DoContestHallWarp(void)
|
||||
TryFadeOutOldMapMusic();
|
||||
WarpFadeOutScreen();
|
||||
PlayRainStoppingSoundEffect();
|
||||
PlaySE(SE_KAIDAN);
|
||||
PlaySE(SE_EXIT);
|
||||
gFieldCallback = FieldCB_WarpExitFadeFromBlack;
|
||||
CreateTask(task0A_fade_n_map_maybe, 10);
|
||||
CreateTask(Task_DoContestHallWarp, 10);
|
||||
}
|
||||
|
||||
static void SetFlashScanlineEffectWindowBoundary(u16 *dest, u32 y, s32 left, s32 right)
|
||||
@@ -976,7 +978,7 @@ void AnimateFlash(u8 flashLevel)
|
||||
u8 value = 0;
|
||||
if (!flashLevel)
|
||||
value = 1;
|
||||
sub_80AFFDC(120, 80, sFlashLevelPixelRadii[curFlashLevel], sFlashLevelPixelRadii[flashLevel], value, 1);
|
||||
sub_80AFFDC(DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sFlashLevelPixelRadii[curFlashLevel], sFlashLevelPixelRadii[flashLevel], value, 1);
|
||||
sub_80AFFB8();
|
||||
ScriptContext2_Enable();
|
||||
}
|
||||
@@ -985,18 +987,18 @@ void WriteFlashScanlineEffectBuffer(u8 flashLevel)
|
||||
{
|
||||
if (flashLevel)
|
||||
{
|
||||
SetFlashScanlineEffectWindowBoundaries(&gScanlineEffectRegBuffers[0][0], 120, 80, sFlashLevelPixelRadii[flashLevel]);
|
||||
SetFlashScanlineEffectWindowBoundaries(&gScanlineEffectRegBuffers[0][0], DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sFlashLevelPixelRadii[flashLevel]);
|
||||
CpuFastSet(&gScanlineEffectRegBuffers[0], &gScanlineEffectRegBuffers[1], 480);
|
||||
}
|
||||
}
|
||||
|
||||
void WriteBattlePyramidViewScanlineEffectBuffer(void)
|
||||
{
|
||||
SetFlashScanlineEffectWindowBoundaries(&gScanlineEffectRegBuffers[0][0], 120, 80, gSaveBlock2Ptr->frontier.pyramidLightRadius);
|
||||
SetFlashScanlineEffectWindowBoundaries(&gScanlineEffectRegBuffers[0][0], DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, gSaveBlock2Ptr->frontier.pyramidLightRadius);
|
||||
CpuFastSet(&gScanlineEffectRegBuffers[0], &gScanlineEffectRegBuffers[1], 480);
|
||||
}
|
||||
|
||||
static void task0A_mpl_807E31C(u8 taskId)
|
||||
static void Task_TeleportTileWarpExit(u8 taskId)
|
||||
{
|
||||
switch (gTasks[taskId].data[0])
|
||||
{
|
||||
@@ -1026,7 +1028,7 @@ static void sub_80B01BC(u8 taskId)
|
||||
case 0:
|
||||
FreezeObjectEvents();
|
||||
ScriptContext2_Enable();
|
||||
PlaySE(SE_TK_WARPIN);
|
||||
PlaySE(SE_WARP_IN);
|
||||
sub_808D1C8();
|
||||
task->data[0]++;
|
||||
break;
|
||||
@@ -1053,7 +1055,7 @@ void sub_80B0244(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
CreateTask(Task_WarpAndLoadMap, 10);
|
||||
gFieldCallback = FieldCB_TeleportWarpExit;
|
||||
gFieldCallback = FieldCB_TeleportTileWarpExit;
|
||||
}
|
||||
|
||||
void sub_80B0268(void)
|
||||
|
||||
+22
-22
@@ -73,11 +73,11 @@ void Task_Truck1(u8 taskId)
|
||||
s16 box1, box2, box3;
|
||||
|
||||
box1 = GetTruckBoxMovement(data[0] + 30) * 4; // top box.
|
||||
sub_808E82C(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, box1 + 3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, box1 + 3);
|
||||
box2 = GetTruckBoxMovement(data[0]) * 2; // bottom left box.
|
||||
sub_808E82C(2, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, box2 - 3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(2, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, box2 - 3);
|
||||
box3 = GetTruckBoxMovement(data[0]) * 4; // bottom right box.
|
||||
sub_808E82C(3, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, box3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(3, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, box3);
|
||||
|
||||
if (++data[0] == SECONDS(500)) // this will never run
|
||||
data[0] = 0; // reset the timer if it gets stuck.
|
||||
@@ -116,11 +116,11 @@ void Task_Truck2(u8 taskId)
|
||||
cameraYpan = GetTruckCameraBobbingY(data[2]);
|
||||
SetCameraPanning(cameraXpan, cameraYpan);
|
||||
box1 = GetTruckBoxMovement(data[2] + 30) * 4;
|
||||
sub_808E82C(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, box1 + 3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, box1 + 3);
|
||||
box2 = GetTruckBoxMovement(data[2]) * 2;
|
||||
sub_808E82C(2, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, box2 - 3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(2, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, box2 - 3);
|
||||
box3 = GetTruckBoxMovement(data[2]) * 4;
|
||||
sub_808E82C(3, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, box3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(3, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, box3);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,9 +147,9 @@ static void Task_Truck3(u8 taskId)
|
||||
cameraXpan = gTruckCamera_HorizontalTable[data[1]];
|
||||
cameraYpan = 0;
|
||||
SetCameraPanning(cameraXpan, 0);
|
||||
sub_808E82C(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, cameraYpan + 3);
|
||||
sub_808E82C(2, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, cameraYpan - 3);
|
||||
sub_808E82C(3, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, cameraYpan);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, cameraYpan + 3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(2, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, cameraYpan - 3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(3, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, cameraYpan);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ void Task_HandleTruckSequence(u8 taskId)
|
||||
data[1] = 0; // reset the timer.
|
||||
data[2] = CreateTask(Task_Truck1, 0xA);
|
||||
data[0] = 1; // run the next case.
|
||||
PlaySE(SE_TRACK_MOVE);
|
||||
PlaySE(SE_TRUCK_MOVE);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
@@ -191,7 +191,7 @@ void Task_HandleTruckSequence(u8 taskId)
|
||||
DestroyTask(data[2]);
|
||||
data[3] = CreateTask(Task_Truck2, 0xA);
|
||||
data[0] = 3;
|
||||
PlaySE(SE_TRACK_STOP);
|
||||
PlaySE(SE_TRUCK_STOP);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
@@ -206,7 +206,7 @@ void Task_HandleTruckSequence(u8 taskId)
|
||||
data[1]++;
|
||||
if (data[1] == 90)
|
||||
{
|
||||
PlaySE(SE_TRACK_HAIKI);
|
||||
PlaySE(SE_TRUCK_UNLOAD);
|
||||
data[1] = 0;
|
||||
data[0] = 5;
|
||||
}
|
||||
@@ -215,11 +215,11 @@ void Task_HandleTruckSequence(u8 taskId)
|
||||
data[1]++;
|
||||
if (data[1] == 120)
|
||||
{
|
||||
MapGridSetMetatileIdAt(11, 8, METATILE_ID(InsideOfTruck, ExitLight_Top));
|
||||
MapGridSetMetatileIdAt(11, 9, METATILE_ID(InsideOfTruck, ExitLight_Mid));
|
||||
MapGridSetMetatileIdAt(11, 10, METATILE_ID(InsideOfTruck, ExitLight_Bottom));
|
||||
MapGridSetMetatileIdAt(11, 8, METATILE_InsideOfTruck_ExitLight_Top);
|
||||
MapGridSetMetatileIdAt(11, 9, METATILE_InsideOfTruck_ExitLight_Mid);
|
||||
MapGridSetMetatileIdAt(11, 10, METATILE_InsideOfTruck_ExitLight_Bottom);
|
||||
DrawWholeMapView();
|
||||
PlaySE(SE_TRACK_DOOR);
|
||||
PlaySE(SE_TRUCK_DOOR);
|
||||
DestroyTask(taskId);
|
||||
ScriptContext2_Disable();
|
||||
}
|
||||
@@ -229,9 +229,9 @@ void Task_HandleTruckSequence(u8 taskId)
|
||||
|
||||
void ExecuteTruckSequence(void)
|
||||
{
|
||||
MapGridSetMetatileIdAt(11, 8, METATILE_ID(InsideOfTruck, DoorClosedFloor_Top));
|
||||
MapGridSetMetatileIdAt(11, 9, METATILE_ID(InsideOfTruck, DoorClosedFloor_Mid));
|
||||
MapGridSetMetatileIdAt(11, 10, METATILE_ID(InsideOfTruck, DoorClosedFloor_Bottom));
|
||||
MapGridSetMetatileIdAt(11, 8, METATILE_InsideOfTruck_DoorClosedFloor_Top);
|
||||
MapGridSetMetatileIdAt(11, 9, METATILE_InsideOfTruck_DoorClosedFloor_Mid);
|
||||
MapGridSetMetatileIdAt(11, 10, METATILE_InsideOfTruck_DoorClosedFloor_Bottom);
|
||||
DrawWholeMapView();
|
||||
ScriptContext2_Enable();
|
||||
CpuFastFill(0, gPlttBufferFaded, 0x400);
|
||||
@@ -242,9 +242,9 @@ void EndTruckSequence(u8 taskId)
|
||||
{
|
||||
if (!FuncIsActiveTask(Task_HandleTruckSequence))
|
||||
{
|
||||
sub_808E82C(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3, 3);
|
||||
sub_808E82C(2, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 0, -3);
|
||||
sub_808E82C(3, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3, 0);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3, 3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(2, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 0, -3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(3, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+128
-128
@@ -655,9 +655,9 @@ void MauvilleGymPressSwitch(void)
|
||||
for (i = 0; i < ARRAY_COUNT(sMauvilleGymSwitchCoords); i++)
|
||||
{
|
||||
if (i == gSpecialVar_0x8004)
|
||||
MapGridSetMetatileIdAt(sMauvilleGymSwitchCoords[i].x, sMauvilleGymSwitchCoords[i].y, METATILE_ID(MauvilleGym, PressedSwitch));
|
||||
MapGridSetMetatileIdAt(sMauvilleGymSwitchCoords[i].x, sMauvilleGymSwitchCoords[i].y, METATILE_MauvilleGym_PressedSwitch);
|
||||
else
|
||||
MapGridSetMetatileIdAt(sMauvilleGymSwitchCoords[i].x, sMauvilleGymSwitchCoords[i].y, METATILE_ID(MauvilleGym, RaisedSwitch));
|
||||
MapGridSetMetatileIdAt(sMauvilleGymSwitchCoords[i].x, sMauvilleGymSwitchCoords[i].y, METATILE_MauvilleGym_RaisedSwitch);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -672,83 +672,83 @@ void MauvilleGymSetDefaultBarriers(void)
|
||||
{
|
||||
switch (MapGridGetMetatileIdAt(x, y))
|
||||
{
|
||||
case METATILE_ID(MauvilleGym, GreenBeamH1_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, GreenBeamH1_Off));
|
||||
case METATILE_MauvilleGym_GreenBeamH1_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_GreenBeamH1_Off);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, GreenBeamH2_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, GreenBeamH2_Off));
|
||||
case METATILE_MauvilleGym_GreenBeamH2_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_GreenBeamH2_Off);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, GreenBeamH3_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, GreenBeamH3_Off));
|
||||
case METATILE_MauvilleGym_GreenBeamH3_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_GreenBeamH3_Off);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, GreenBeamH4_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, GreenBeamH4_Off));
|
||||
case METATILE_MauvilleGym_GreenBeamH4_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_GreenBeamH4_Off);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, GreenBeamH1_Off):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, GreenBeamH1_On));
|
||||
case METATILE_MauvilleGym_GreenBeamH1_Off:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_GreenBeamH1_On);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, GreenBeamH2_Off):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, GreenBeamH2_On));
|
||||
case METATILE_MauvilleGym_GreenBeamH2_Off:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_GreenBeamH2_On);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, GreenBeamH3_Off):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, GreenBeamH3_On) | METATILE_COLLISION_MASK);
|
||||
case METATILE_MauvilleGym_GreenBeamH3_Off:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_GreenBeamH3_On | METATILE_COLLISION_MASK);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, GreenBeamH4_Off):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, GreenBeamH4_On) | METATILE_COLLISION_MASK);
|
||||
case METATILE_MauvilleGym_GreenBeamH4_Off:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_GreenBeamH4_On | METATILE_COLLISION_MASK);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, RedBeamH1_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, RedBeamH1_Off));
|
||||
case METATILE_MauvilleGym_RedBeamH1_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_RedBeamH1_Off);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, RedBeamH2_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, RedBeamH2_Off));
|
||||
case METATILE_MauvilleGym_RedBeamH2_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_RedBeamH2_Off);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, RedBeamH3_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, RedBeamH3_Off));
|
||||
case METATILE_MauvilleGym_RedBeamH3_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_RedBeamH3_Off);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, RedBeamH4_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, RedBeamH4_Off));
|
||||
case METATILE_MauvilleGym_RedBeamH4_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_RedBeamH4_Off);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, RedBeamH1_Off):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, RedBeamH1_On));
|
||||
case METATILE_MauvilleGym_RedBeamH1_Off:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_RedBeamH1_On);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, RedBeamH2_Off):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, RedBeamH2_On));
|
||||
case METATILE_MauvilleGym_RedBeamH2_Off:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_RedBeamH2_On);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, RedBeamH3_Off):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, RedBeamH3_On) | METATILE_COLLISION_MASK);
|
||||
case METATILE_MauvilleGym_RedBeamH3_Off:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_RedBeamH3_On | METATILE_COLLISION_MASK);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, RedBeamH4_Off):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, RedBeamH4_On) | METATILE_COLLISION_MASK);
|
||||
case METATILE_MauvilleGym_RedBeamH4_Off:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_RedBeamH4_On | METATILE_COLLISION_MASK);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, GreenBeamV1_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, PoleBottom_On) | METATILE_COLLISION_MASK);
|
||||
case METATILE_MauvilleGym_GreenBeamV1_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_PoleBottom_On | METATILE_COLLISION_MASK);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, GreenBeamV2_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, FloorTile));
|
||||
case METATILE_MauvilleGym_GreenBeamV2_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_FloorTile);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, RedBeamV1_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, PoleBottom_Off) | METATILE_COLLISION_MASK);
|
||||
case METATILE_MauvilleGym_RedBeamV1_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_PoleBottom_Off | METATILE_COLLISION_MASK);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, RedBeamV2_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, FloorTile));
|
||||
case METATILE_MauvilleGym_RedBeamV2_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_FloorTile);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, PoleBottom_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, GreenBeamV1_On) | METATILE_COLLISION_MASK);
|
||||
case METATILE_MauvilleGym_PoleBottom_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_GreenBeamV1_On | METATILE_COLLISION_MASK);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, FloorTile):
|
||||
if (MapGridGetMetatileIdAt(x, y - 1) == METATILE_ID(MauvilleGym, GreenBeamV1_On))
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, GreenBeamV2_On) | METATILE_COLLISION_MASK);
|
||||
case METATILE_MauvilleGym_FloorTile:
|
||||
if (MapGridGetMetatileIdAt(x, y - 1) == METATILE_MauvilleGym_GreenBeamV1_On)
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_GreenBeamV2_On | METATILE_COLLISION_MASK);
|
||||
else
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, RedBeamV2_On) | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_RedBeamV2_On | METATILE_COLLISION_MASK);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, PoleBottom_Off):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, RedBeamV1_On) | METATILE_COLLISION_MASK);
|
||||
case METATILE_MauvilleGym_PoleBottom_Off:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_RedBeamV1_On | METATILE_COLLISION_MASK);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, PoleTop_Off):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, PoleTop_On) | METATILE_COLLISION_MASK);
|
||||
case METATILE_MauvilleGym_PoleTop_Off:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_PoleTop_On | METATILE_COLLISION_MASK);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, PoleTop_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, PoleTop_Off));
|
||||
case METATILE_MauvilleGym_PoleTop_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_PoleTop_Off);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -762,7 +762,7 @@ void MauvilleGymDeactivatePuzzle(void)
|
||||
const struct UCoords8 *switchCoords = sMauvilleGymSwitchCoords;
|
||||
for (i = ARRAY_COUNT(sMauvilleGymSwitchCoords) - 1; i >= 0; i--)
|
||||
{
|
||||
MapGridSetMetatileIdAt(switchCoords->x, switchCoords->y, METATILE_ID(MauvilleGym, PressedSwitch));
|
||||
MapGridSetMetatileIdAt(switchCoords->x, switchCoords->y, METATILE_MauvilleGym_PressedSwitch);
|
||||
switchCoords++;
|
||||
}
|
||||
for (y = 12; y < 24; y++)
|
||||
@@ -771,42 +771,42 @@ void MauvilleGymDeactivatePuzzle(void)
|
||||
{
|
||||
switch (MapGridGetMetatileIdAt(x, y))
|
||||
{
|
||||
case METATILE_ID(MauvilleGym, GreenBeamH1_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, GreenBeamH1_Off));
|
||||
case METATILE_MauvilleGym_GreenBeamH1_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_GreenBeamH1_Off);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, GreenBeamH2_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, GreenBeamH2_Off));
|
||||
case METATILE_MauvilleGym_GreenBeamH2_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_GreenBeamH2_Off);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, GreenBeamH3_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, GreenBeamH3_Off));
|
||||
case METATILE_MauvilleGym_GreenBeamH3_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_GreenBeamH3_Off);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, GreenBeamH4_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, GreenBeamH4_Off));
|
||||
case METATILE_MauvilleGym_GreenBeamH4_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_GreenBeamH4_Off);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, RedBeamH1_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, RedBeamH1_Off));
|
||||
case METATILE_MauvilleGym_RedBeamH1_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_RedBeamH1_Off);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, RedBeamH2_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, RedBeamH2_Off));
|
||||
case METATILE_MauvilleGym_RedBeamH2_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_RedBeamH2_Off);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, RedBeamH3_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, RedBeamH3_Off));
|
||||
case METATILE_MauvilleGym_RedBeamH3_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_RedBeamH3_Off);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, RedBeamH4_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, RedBeamH4_Off));
|
||||
case METATILE_MauvilleGym_RedBeamH4_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_RedBeamH4_Off);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, GreenBeamV1_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, PoleBottom_On) | METATILE_COLLISION_MASK);
|
||||
case METATILE_MauvilleGym_GreenBeamV1_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_PoleBottom_On | METATILE_COLLISION_MASK);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, RedBeamV1_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, PoleBottom_Off) | METATILE_COLLISION_MASK);
|
||||
case METATILE_MauvilleGym_RedBeamV1_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_PoleBottom_Off | METATILE_COLLISION_MASK);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, GreenBeamV2_On):
|
||||
case METATILE_ID(MauvilleGym, RedBeamV2_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, FloorTile));
|
||||
case METATILE_MauvilleGym_GreenBeamV2_On:
|
||||
case METATILE_MauvilleGym_RedBeamV2_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_FloorTile);
|
||||
break;
|
||||
case METATILE_ID(MauvilleGym, PoleTop_On):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(MauvilleGym, PoleTop_Off));
|
||||
case METATILE_MauvilleGym_PoleTop_On:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_MauvilleGym_PoleTop_Off);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -816,18 +816,18 @@ void MauvilleGymDeactivatePuzzle(void)
|
||||
static const bool8 sSlidingDoorNextFrameDelay[] = {0, 1, 1, 1, 1};
|
||||
|
||||
static const u16 sPetalburgGymSlidingDoorMetatiles[] = {
|
||||
METATILE_ID(PetalburgGym, SlidingDoor_Frame0),
|
||||
METATILE_ID(PetalburgGym, SlidingDoor_Frame1),
|
||||
METATILE_ID(PetalburgGym, SlidingDoor_Frame2),
|
||||
METATILE_ID(PetalburgGym, SlidingDoor_Frame3),
|
||||
METATILE_ID(PetalburgGym, SlidingDoor_Frame4),
|
||||
METATILE_PetalburgGym_SlidingDoor_Frame0,
|
||||
METATILE_PetalburgGym_SlidingDoor_Frame1,
|
||||
METATILE_PetalburgGym_SlidingDoor_Frame2,
|
||||
METATILE_PetalburgGym_SlidingDoor_Frame3,
|
||||
METATILE_PetalburgGym_SlidingDoor_Frame4,
|
||||
};
|
||||
|
||||
void PetalburgGymSlideOpenRoomDoors(void)
|
||||
{
|
||||
sSlidingDoorNextFrameCounter = 0;
|
||||
sSlidingDoorFrame = 0;
|
||||
PlaySE(SE_KI_GASYAN);
|
||||
PlaySE(SE_UNLOCK);
|
||||
CreateTask(Task_PetalburgGymSlideOpenRoomDoors, 8);
|
||||
}
|
||||
|
||||
@@ -1095,30 +1095,30 @@ static void PCTurnOnEffect_1(s16 isPcTurnedOn, s8 dx, s8 dy)
|
||||
{
|
||||
if (gSpecialVar_0x8004 == PC_LOCATION_OTHER)
|
||||
{
|
||||
tileId = METATILE_ID(Building, PC_Off);
|
||||
tileId = METATILE_Building_PC_Off;
|
||||
}
|
||||
else if (gSpecialVar_0x8004 == PC_LOCATION_BRENDANS_HOUSE)
|
||||
{
|
||||
tileId = METATILE_ID(BrendansMaysHouse, BrendanPC_Off);
|
||||
tileId = METATILE_BrendansMaysHouse_BrendanPC_Off;
|
||||
}
|
||||
else if (gSpecialVar_0x8004 == PC_LOCATION_MAYS_HOUSE)
|
||||
{
|
||||
tileId = METATILE_ID(BrendansMaysHouse, MayPC_Off);
|
||||
tileId = METATILE_BrendansMaysHouse_MayPC_Off;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gSpecialVar_0x8004 == PC_LOCATION_OTHER)
|
||||
{
|
||||
tileId = METATILE_ID(Building, PC_On);
|
||||
tileId = METATILE_Building_PC_On;
|
||||
}
|
||||
else if (gSpecialVar_0x8004 == PC_LOCATION_BRENDANS_HOUSE)
|
||||
{
|
||||
tileId = METATILE_ID(BrendansMaysHouse, BrendanPC_On);
|
||||
tileId = METATILE_BrendansMaysHouse_BrendanPC_On;
|
||||
}
|
||||
else if (gSpecialVar_0x8004 == PC_LOCATION_MAYS_HOUSE)
|
||||
{
|
||||
tileId = METATILE_ID(BrendansMaysHouse, MayPC_On);
|
||||
tileId = METATILE_BrendansMaysHouse_MayPC_On;
|
||||
}
|
||||
}
|
||||
MapGridSetMetatileIdAt(gSaveBlock1Ptr->pos.x + dx + 7, gSaveBlock1Ptr->pos.y + dy + 7, tileId | METATILE_COLLISION_MASK);
|
||||
@@ -1152,15 +1152,15 @@ static void PCTurnOffEffect(void)
|
||||
}
|
||||
if (gSpecialVar_0x8004 == 0)
|
||||
{
|
||||
tileId = METATILE_ID(Building, PC_Off);
|
||||
tileId = METATILE_Building_PC_Off;
|
||||
}
|
||||
else if (gSpecialVar_0x8004 == 1)
|
||||
{
|
||||
tileId = METATILE_ID(BrendansMaysHouse, BrendanPC_Off);
|
||||
tileId = METATILE_BrendansMaysHouse_BrendanPC_Off;
|
||||
}
|
||||
else if (gSpecialVar_0x8004 == 2)
|
||||
{
|
||||
tileId = METATILE_ID(BrendansMaysHouse, MayPC_Off);
|
||||
tileId = METATILE_BrendansMaysHouse_MayPC_Off;
|
||||
}
|
||||
MapGridSetMetatileIdAt(gSaveBlock1Ptr->pos.x + dx + 7, gSaveBlock1Ptr->pos.y + dy + 7, tileId | METATILE_COLLISION_MASK);
|
||||
DrawWholeMapView();
|
||||
@@ -1195,13 +1195,13 @@ static void LotteryCornerComputerEffect(struct Task *task)
|
||||
task->data[3] = 0;
|
||||
if (task->data[4] != 0)
|
||||
{
|
||||
MapGridSetMetatileIdAt(18, 8, METATILE_ID(Shop, Laptop1_Normal) | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(18, 9, METATILE_ID(Shop, Laptop2_Normal) | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(18, 8, METATILE_Shop_Laptop1_Normal | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(18, 9, METATILE_Shop_Laptop2_Normal | METATILE_COLLISION_MASK);
|
||||
}
|
||||
else
|
||||
{
|
||||
MapGridSetMetatileIdAt(18, 8, METATILE_ID(Shop, Laptop1_Flash) | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(18, 9, METATILE_ID(Shop, Laptop2_Flash) | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(18, 8, METATILE_Shop_Laptop1_Flash | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(18, 9, METATILE_Shop_Laptop2_Flash | METATILE_COLLISION_MASK);
|
||||
}
|
||||
DrawWholeMapView();
|
||||
task->data[4] ^= 1;
|
||||
@@ -1215,8 +1215,8 @@ static void LotteryCornerComputerEffect(struct Task *task)
|
||||
|
||||
void EndLotteryCornerComputerEffect(void)
|
||||
{
|
||||
MapGridSetMetatileIdAt(18, 8, METATILE_ID(Shop, Laptop1_Normal) | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(18, 9, METATILE_ID(Shop, Laptop2_Normal) | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(18, 8, METATILE_Shop_Laptop1_Normal | METATILE_COLLISION_MASK);
|
||||
MapGridSetMetatileIdAt(18, 9, METATILE_Shop_Laptop2_Normal | METATILE_COLLISION_MASK);
|
||||
DrawWholeMapView();
|
||||
}
|
||||
|
||||
@@ -1509,7 +1509,7 @@ void ShakeCamera(void)
|
||||
gTasks[taskId].delay = gSpecialVar_0x8007;
|
||||
gTasks[taskId].verticalPan = gSpecialVar_0x8004;
|
||||
SetCameraPanningCallback(NULL);
|
||||
PlaySE(SE_W070);
|
||||
PlaySE(SE_M_STRENGTH);
|
||||
}
|
||||
|
||||
static void Task_ShakeCamera(u8 taskId)
|
||||
@@ -1750,38 +1750,38 @@ const u8 *const gDeptStoreFloorNames[] =
|
||||
static const u16 sElevatorWindowTiles_Ascending[][3] =
|
||||
{
|
||||
{
|
||||
METATILE_ID(BattleFrontier, Elevator_Top0),
|
||||
METATILE_ID(BattleFrontier, Elevator_Top1),
|
||||
METATILE_ID(BattleFrontier, Elevator_Top2)
|
||||
METATILE_BattleFrontier_Elevator_Top0,
|
||||
METATILE_BattleFrontier_Elevator_Top1,
|
||||
METATILE_BattleFrontier_Elevator_Top2
|
||||
},
|
||||
{
|
||||
METATILE_ID(BattleFrontier, Elevator_Mid0),
|
||||
METATILE_ID(BattleFrontier, Elevator_Mid1),
|
||||
METATILE_ID(BattleFrontier, Elevator_Mid2)
|
||||
METATILE_BattleFrontier_Elevator_Mid0,
|
||||
METATILE_BattleFrontier_Elevator_Mid1,
|
||||
METATILE_BattleFrontier_Elevator_Mid2
|
||||
},
|
||||
{
|
||||
METATILE_ID(BattleFrontier, Elevator_Bottom0),
|
||||
METATILE_ID(BattleFrontier, Elevator_Bottom1),
|
||||
METATILE_ID(BattleFrontier, Elevator_Bottom2)
|
||||
METATILE_BattleFrontier_Elevator_Bottom0,
|
||||
METATILE_BattleFrontier_Elevator_Bottom1,
|
||||
METATILE_BattleFrontier_Elevator_Bottom2
|
||||
},
|
||||
};
|
||||
|
||||
static const u16 sElevatorWindowTiles_Descending[][3] =
|
||||
{
|
||||
{
|
||||
METATILE_ID(BattleFrontier, Elevator_Top0),
|
||||
METATILE_ID(BattleFrontier, Elevator_Top2),
|
||||
METATILE_ID(BattleFrontier, Elevator_Top1)
|
||||
METATILE_BattleFrontier_Elevator_Top0,
|
||||
METATILE_BattleFrontier_Elevator_Top2,
|
||||
METATILE_BattleFrontier_Elevator_Top1
|
||||
},
|
||||
{
|
||||
METATILE_ID(BattleFrontier, Elevator_Mid0),
|
||||
METATILE_ID(BattleFrontier, Elevator_Mid2),
|
||||
METATILE_ID(BattleFrontier, Elevator_Mid1)
|
||||
METATILE_BattleFrontier_Elevator_Mid0,
|
||||
METATILE_BattleFrontier_Elevator_Mid2,
|
||||
METATILE_BattleFrontier_Elevator_Mid1
|
||||
},
|
||||
{
|
||||
METATILE_ID(BattleFrontier, Elevator_Bottom0),
|
||||
METATILE_ID(BattleFrontier, Elevator_Bottom2),
|
||||
METATILE_ID(BattleFrontier, Elevator_Bottom1)
|
||||
METATILE_BattleFrontier_Elevator_Bottom0,
|
||||
METATILE_BattleFrontier_Elevator_Bottom2,
|
||||
METATILE_BattleFrontier_Elevator_Bottom1
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1880,7 +1880,7 @@ void MoveElevator(void)
|
||||
|
||||
SetCameraPanningCallback(NULL);
|
||||
MoveElevatorWindowLights(floorDelta, data[6]);
|
||||
PlaySE(SE_ELEBETA);
|
||||
PlaySE(SE_ELEVATOR);
|
||||
}
|
||||
|
||||
static void Task_MoveElevator(u8 taskId)
|
||||
@@ -1897,7 +1897,7 @@ static void Task_MoveElevator(u8 taskId)
|
||||
// arrived at floor
|
||||
if (data[2] == data[5])
|
||||
{
|
||||
PlaySE(SE_PINPON);
|
||||
PlaySE(SE_DING_DONG);
|
||||
DestroyTask(taskId);
|
||||
EnableBothScriptContexts();
|
||||
InstallCameraPanAheadCallback();
|
||||
@@ -3438,9 +3438,9 @@ static void ChangeDeoxysRockLevel(u8 rockLevel)
|
||||
TryGetObjectEventIdByLocalIdAndMap(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objectEventId);
|
||||
|
||||
if (rockLevel == 0)
|
||||
PlaySE(SE_W109);
|
||||
PlaySE(SE_M_CONFUSE_RAY);
|
||||
else
|
||||
PlaySE(SE_RG_DEOMOV);
|
||||
PlaySE(SE_RG_DEOXYS_MOVE);
|
||||
|
||||
CreateTask(WaitForDeoxysRockMovement, 8);
|
||||
gFieldEffectArguments[0] = 1;
|
||||
@@ -3864,7 +3864,7 @@ static void Task_LinkRetireStatusWithBattleTowerPartner(u8 taskId)
|
||||
case 7:
|
||||
if (IsLinkTaskFinished() == 1)
|
||||
{
|
||||
sub_800ADF8();
|
||||
SetLinkStandbyCallback();
|
||||
gTasks[taskId].data[0]++;
|
||||
}
|
||||
break;
|
||||
@@ -3877,7 +3877,7 @@ static void Task_LinkRetireStatusWithBattleTowerPartner(u8 taskId)
|
||||
case 9:
|
||||
if (gWirelessCommType == 0)
|
||||
{
|
||||
sub_800AC34();
|
||||
SetCloseLinkCallback();
|
||||
}
|
||||
gBattleTypeFlags = sBattleTowerMultiBattleTypeFlags;
|
||||
EnableBothScriptContexts();
|
||||
@@ -3904,7 +3904,7 @@ void Script_DoRayquazaScene(void)
|
||||
void LoopWingFlapSE(void)
|
||||
{
|
||||
CreateTask(Task_LoopWingFlapSE, 8);
|
||||
PlaySE(SE_W017);
|
||||
PlaySE(SE_M_WING_ATTACK);
|
||||
}
|
||||
|
||||
static void Task_LoopWingFlapSE(u8 taskId)
|
||||
@@ -3916,7 +3916,7 @@ static void Task_LoopWingFlapSE(u8 taskId)
|
||||
{
|
||||
playCount++;
|
||||
delay = 0;
|
||||
PlaySE(SE_W017);
|
||||
PlaySE(SE_M_WING_ATTACK);
|
||||
}
|
||||
|
||||
if (playCount == gSpecialVar_0x8004 - 1)
|
||||
|
||||
+35
-35
@@ -51,26 +51,26 @@ static const TaskFunc sPerStepCallbacks[] =
|
||||
// they are in pairs but declared as 1D array
|
||||
static const struct PacifidlogMetatileOffsets sHalfSubmergedBridgeMetatileOffsets[] =
|
||||
{
|
||||
{ 0, 0, METATILE_ID(Pacifidlog, HalfSubmergedLogs_Vertical0)}, {0, 1, METATILE_ID(Pacifidlog, HalfSubmergedLogs_Vertical1)},
|
||||
{ 0, -1, METATILE_ID(Pacifidlog, HalfSubmergedLogs_Vertical0)}, {0, 0, METATILE_ID(Pacifidlog, HalfSubmergedLogs_Vertical1)},
|
||||
{ 0, 0, METATILE_ID(Pacifidlog, HalfSubmergedLogs_Horizontal0)}, {1, 0, METATILE_ID(Pacifidlog, HalfSubmergedLogs_Horizontal1)},
|
||||
{-1, 0, METATILE_ID(Pacifidlog, HalfSubmergedLogs_Horizontal0)}, {0, 0, METATILE_ID(Pacifidlog, HalfSubmergedLogs_Horizontal1)}
|
||||
{ 0, 0, METATILE_Pacifidlog_HalfSubmergedLogs_Vertical0}, {0, 1, METATILE_Pacifidlog_HalfSubmergedLogs_Vertical1},
|
||||
{ 0, -1, METATILE_Pacifidlog_HalfSubmergedLogs_Vertical0}, {0, 0, METATILE_Pacifidlog_HalfSubmergedLogs_Vertical1},
|
||||
{ 0, 0, METATILE_Pacifidlog_HalfSubmergedLogs_Horizontal0}, {1, 0, METATILE_Pacifidlog_HalfSubmergedLogs_Horizontal1},
|
||||
{-1, 0, METATILE_Pacifidlog_HalfSubmergedLogs_Horizontal0}, {0, 0, METATILE_Pacifidlog_HalfSubmergedLogs_Horizontal1}
|
||||
};
|
||||
|
||||
static const struct PacifidlogMetatileOffsets sFullySubmergedBridgeMetatileOffsets[] =
|
||||
{
|
||||
{ 0, 0, METATILE_ID(Pacifidlog, SubmergedLogs_Vertical0)}, {0, 1, METATILE_ID(Pacifidlog, SubmergedLogs_Vertical1)},
|
||||
{ 0, -1, METATILE_ID(Pacifidlog, SubmergedLogs_Vertical0)}, {0, 0, METATILE_ID(Pacifidlog, SubmergedLogs_Vertical1)},
|
||||
{ 0, 0, METATILE_ID(Pacifidlog, SubmergedLogs_Horizontal0)}, {1, 0, METATILE_ID(Pacifidlog, SubmergedLogs_Horizontal1)},
|
||||
{-1, 0, METATILE_ID(Pacifidlog, SubmergedLogs_Horizontal0)}, {0, 0, METATILE_ID(Pacifidlog, SubmergedLogs_Horizontal1)}
|
||||
{ 0, 0, METATILE_Pacifidlog_SubmergedLogs_Vertical0}, {0, 1, METATILE_Pacifidlog_SubmergedLogs_Vertical1},
|
||||
{ 0, -1, METATILE_Pacifidlog_SubmergedLogs_Vertical0}, {0, 0, METATILE_Pacifidlog_SubmergedLogs_Vertical1},
|
||||
{ 0, 0, METATILE_Pacifidlog_SubmergedLogs_Horizontal0}, {1, 0, METATILE_Pacifidlog_SubmergedLogs_Horizontal1},
|
||||
{-1, 0, METATILE_Pacifidlog_SubmergedLogs_Horizontal0}, {0, 0, METATILE_Pacifidlog_SubmergedLogs_Horizontal1}
|
||||
};
|
||||
|
||||
static const struct PacifidlogMetatileOffsets sFloatingBridgeMetatileOffsets[] =
|
||||
{
|
||||
{ 0, 0, METATILE_ID(Pacifidlog, FloatingLogs_Vertical0)}, {0, 1, METATILE_ID(Pacifidlog, FloatingLogs_Vertical1)},
|
||||
{ 0, -1, METATILE_ID(Pacifidlog, FloatingLogs_Vertical0)}, {0, 0, METATILE_ID(Pacifidlog, FloatingLogs_Vertical1)},
|
||||
{ 0, 0, METATILE_ID(Pacifidlog, FloatingLogs_Horizontal0)}, {1, 0, METATILE_ID(Pacifidlog, FloatingLogs_Horizontal1)},
|
||||
{-1, 0, METATILE_ID(Pacifidlog, FloatingLogs_Horizontal0)}, {0, 0, METATILE_ID(Pacifidlog, FloatingLogs_Horizontal1)}
|
||||
{ 0, 0, METATILE_Pacifidlog_FloatingLogs_Vertical0}, {0, 1, METATILE_Pacifidlog_FloatingLogs_Vertical1},
|
||||
{ 0, -1, METATILE_Pacifidlog_FloatingLogs_Vertical0}, {0, 0, METATILE_Pacifidlog_FloatingLogs_Vertical1},
|
||||
{ 0, 0, METATILE_Pacifidlog_FloatingLogs_Horizontal0}, {1, 0, METATILE_Pacifidlog_FloatingLogs_Horizontal1},
|
||||
{-1, 0, METATILE_Pacifidlog_FloatingLogs_Horizontal0}, {0, 0, METATILE_Pacifidlog_FloatingLogs_Horizontal1}
|
||||
};
|
||||
|
||||
// Each element corresponds to a y coordinate row in the sootopolis gym 1F map.
|
||||
@@ -105,10 +105,10 @@ static const u16 sSootopolisGymIceRowVars[] =
|
||||
};
|
||||
|
||||
static const u16 sMuddySlopeMetatiles[] = {
|
||||
METATILE_ID(General, MuddySlope_Frame0),
|
||||
METATILE_ID(General, MuddySlope_Frame3),
|
||||
METATILE_ID(General, MuddySlope_Frame2),
|
||||
METATILE_ID(General, MuddySlope_Frame1)
|
||||
METATILE_General_MuddySlope_Frame0,
|
||||
METATILE_General_MuddySlope_Frame3,
|
||||
METATILE_General_MuddySlope_Frame2,
|
||||
METATILE_General_MuddySlope_Frame1
|
||||
};
|
||||
|
||||
static void Task_RunPerStepCallback(u8 taskId)
|
||||
@@ -357,7 +357,7 @@ static void PacifidlogBridgePerStepCallback(u8 taskId)
|
||||
data[2] = x;
|
||||
data[3] = y;
|
||||
if (MetatileBehavior_IsPacifidlogLog(MapGridGetMetatileBehaviorAt(x, y)))
|
||||
PlaySE(SE_MIZU);
|
||||
PlaySE(SE_PUDDLE);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
@@ -380,11 +380,11 @@ static void SetLoweredForetreeBridgeMetatile(s16 x, s16 y)
|
||||
{
|
||||
switch (MapGridGetMetatileIdAt(x, y))
|
||||
{
|
||||
case METATILE_ID(Fortree, BridgeOverGrass_Raised):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(Fortree, BridgeOverGrass_Lowered));
|
||||
case METATILE_Fortree_BridgeOverGrass_Raised:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_Fortree_BridgeOverGrass_Lowered);
|
||||
break;
|
||||
case METATILE_ID(Fortree, BridgeOverTrees_Raised):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(Fortree, BridgeOverTrees_Lowered));
|
||||
case METATILE_Fortree_BridgeOverTrees_Raised:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_Fortree_BridgeOverTrees_Lowered);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -397,11 +397,11 @@ static void SetNormalFortreeBridgeMetatile(s16 x, s16 y)
|
||||
{
|
||||
switch (MapGridGetMetatileIdAt(x, y))
|
||||
{
|
||||
case METATILE_ID(Fortree, BridgeOverGrass_Lowered):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(Fortree, BridgeOverGrass_Raised));
|
||||
case METATILE_Fortree_BridgeOverGrass_Lowered:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_Fortree_BridgeOverGrass_Raised);
|
||||
break;
|
||||
case METATILE_ID(Fortree, BridgeOverTrees_Lowered):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(Fortree, BridgeOverTrees_Raised));
|
||||
case METATILE_Fortree_BridgeOverTrees_Lowered:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_Fortree_BridgeOverTrees_Raised);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -443,7 +443,7 @@ static void FortreeBridgePerStepCallback(u8 taskId)
|
||||
flag = 1;
|
||||
|
||||
if (flag && (isFortreeBridgeCur == 1 || isFortreeBridgePrev == 1))
|
||||
PlaySE(SE_HASHI);
|
||||
PlaySE(SE_BRIDGE_WALK);
|
||||
|
||||
if (isFortreeBridgePrev)
|
||||
{
|
||||
@@ -529,7 +529,7 @@ void SetSootopolisGymCrackedIceMetatiles(void)
|
||||
for (y = 0; y < height; y++)
|
||||
{
|
||||
if (IsIcePuzzleCoordVisited(x, y) == TRUE)
|
||||
MapGridSetMetatileIdAt(x + 7, y + 7, METATILE_ID(SootopolisGym, Ice_Cracked));
|
||||
MapGridSetMetatileIdAt(x + 7, y + 7, METATILE_SootopolisGym_Ice_Cracked);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -583,8 +583,8 @@ static void SootopolisGymIcePerStepCallback(u8 taskId)
|
||||
{
|
||||
x = data[4];
|
||||
y = data[5];
|
||||
PlaySE(SE_RU_BARI);
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(SootopolisGym, Ice_Cracked));
|
||||
PlaySE(SE_ICE_CRACK);
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_SootopolisGym_Ice_Cracked);
|
||||
CurrentMapDrawMetatileAt(x, y);
|
||||
MarkIcePuzzleCoordVisited(x - 7, y - 7);
|
||||
data[1] = 1;
|
||||
@@ -599,8 +599,8 @@ static void SootopolisGymIcePerStepCallback(u8 taskId)
|
||||
{
|
||||
x = data[4];
|
||||
y = data[5];
|
||||
PlaySE(SE_RU_GASYAN);
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(SootopolisGym, Ice_Broken));
|
||||
PlaySE(SE_ICE_BREAK);
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_SootopolisGym_Ice_Broken);
|
||||
CurrentMapDrawMetatileAt(x, y);
|
||||
data[1] = 1;
|
||||
}
|
||||
@@ -620,10 +620,10 @@ static void AshGrassPerStepCallback(u8 taskId)
|
||||
data[2] = y;
|
||||
if (MetatileBehavior_IsAshGrass(MapGridGetMetatileBehaviorAt(x, y)))
|
||||
{
|
||||
if (MapGridGetMetatileIdAt(x, y) == METATILE_ID(Fallarbor, AshGrass))
|
||||
StartAshFieldEffect(x, y, METATILE_ID(Fallarbor, NormalGrass), 4);
|
||||
if (MapGridGetMetatileIdAt(x, y) == METATILE_Fallarbor_AshGrass)
|
||||
StartAshFieldEffect(x, y, METATILE_Fallarbor_NormalGrass, 4);
|
||||
else
|
||||
StartAshFieldEffect(x, y, METATILE_ID(Lavaridge, NormalGrass), 4);
|
||||
StartAshFieldEffect(x, y, METATILE_Lavaridge_NormalGrass, 4);
|
||||
|
||||
if (CheckBagHasItem(ITEM_SOOT_SACK, 1))
|
||||
{
|
||||
@@ -692,7 +692,7 @@ static void SetMuddySlopeMetatile(s16 *data, s16 x, s16 y)
|
||||
|
||||
MapGridSetMetatileIdAt(x, y, tile);
|
||||
CurrentMapDrawMetatileAt(x, y);
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(General, MuddySlope_Frame0));
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_General_MuddySlope_Frame0);
|
||||
}
|
||||
|
||||
static void Task_MuddySlope(u8 taskId)
|
||||
|
||||
+6
-6
@@ -1038,13 +1038,13 @@ void SetRainStrengthFromSoundEffect(u16 soundEffect)
|
||||
{
|
||||
switch (soundEffect)
|
||||
{
|
||||
case SE_T_KOAME:
|
||||
case SE_RAIN:
|
||||
gWeatherPtr->rainStrength = 0;
|
||||
break;
|
||||
case SE_T_OOAME:
|
||||
case SE_DOWNPOUR:
|
||||
gWeatherPtr->rainStrength = 1;
|
||||
break;
|
||||
case SE_T_AME:
|
||||
case SE_THUNDERSTORM:
|
||||
gWeatherPtr->rainStrength = 2;
|
||||
break;
|
||||
default:
|
||||
@@ -1062,14 +1062,14 @@ void PlayRainStoppingSoundEffect(void)
|
||||
switch (gWeatherPtr->rainStrength)
|
||||
{
|
||||
case 0:
|
||||
PlaySE(SE_T_KOAME_E);
|
||||
PlaySE(SE_RAIN_STOP);
|
||||
break;
|
||||
case 1:
|
||||
PlaySE(SE_T_OOAME_E);
|
||||
PlaySE(SE_DOWNPOUR_STOP);
|
||||
break;
|
||||
case 2:
|
||||
default:
|
||||
PlaySE(SE_T_AME_E);
|
||||
PlaySE(SE_THUNDERSTORM_STOP);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,7 +479,7 @@ void Rain_InitVars(void)
|
||||
gWeatherPtr->targetRainSpriteCount = 10;
|
||||
gWeatherPtr->gammaTargetIndex = 3;
|
||||
gWeatherPtr->gammaStepDelay = 20;
|
||||
SetRainStrengthFromSoundEffect(SE_T_KOAME);
|
||||
SetRainStrengthFromSoundEffect(SE_RAIN);
|
||||
}
|
||||
|
||||
void Rain_InitAll(void)
|
||||
@@ -1023,7 +1023,7 @@ void Thunderstorm_InitVars(void)
|
||||
gWeatherPtr->gammaStepDelay = 20;
|
||||
gWeatherPtr->weatherGfxLoaded = FALSE; // duplicate assignment
|
||||
gWeatherPtr->thunderTriggered = 0;
|
||||
SetRainStrengthFromSoundEffect(SE_T_AME);
|
||||
SetRainStrengthFromSoundEffect(SE_THUNDERSTORM);
|
||||
}
|
||||
|
||||
void Thunderstorm_InitAll(void)
|
||||
@@ -1051,7 +1051,7 @@ void Downpour_InitVars(void)
|
||||
gWeatherPtr->gammaTargetIndex = 3;
|
||||
gWeatherPtr->gammaStepDelay = 20;
|
||||
gWeatherPtr->weatherGfxLoaded = FALSE; // duplicate assignment
|
||||
SetRainStrengthFromSoundEffect(SE_T_OOAME);
|
||||
SetRainStrengthFromSoundEffect(SE_DOWNPOUR);
|
||||
}
|
||||
|
||||
void Downpour_InitAll(void)
|
||||
@@ -1220,9 +1220,9 @@ static void UpdateThunderSound(void)
|
||||
return;
|
||||
|
||||
if (Random() & 1)
|
||||
PlaySE(SE_T_KAMI);
|
||||
PlaySE(SE_THUNDER);
|
||||
else
|
||||
PlaySE(SE_T_KAMI2);
|
||||
PlaySE(SE_THUNDER2);
|
||||
|
||||
gWeatherPtr->thunderTriggered = 0;
|
||||
}
|
||||
|
||||
+28
-27
@@ -44,7 +44,7 @@ static void InitBackupMapLayoutConnections(struct MapHeader *mapHeader);
|
||||
static void LoadSavedMapView(void);
|
||||
static bool8 SkipCopyingMetatileFromSavedMap(u16* mapMetatilePtr, u16 mapWidth, u8 yMode);
|
||||
|
||||
struct MapHeader const *const mapconnection_get_mapheader(struct MapConnection *connection)
|
||||
struct MapHeader const *const GetMapHeaderFromConnection(struct MapConnection *connection)
|
||||
{
|
||||
return Overworld_GetMapHeaderByGroupAndId(connection->mapGroup, connection->mapNum);
|
||||
}
|
||||
@@ -124,7 +124,7 @@ static void InitBackupMapLayoutConnections(struct MapHeader *mapHeader)
|
||||
gMapConnectionFlags = sDummyConnectionFlags;
|
||||
for (i = 0; i < count; i++, connection++)
|
||||
{
|
||||
struct MapHeader const *cMap = mapconnection_get_mapheader(connection);
|
||||
struct MapHeader const *cMap = GetMapHeaderFromConnection(connection);
|
||||
u32 offset = connection->offset;
|
||||
switch (connection->direction)
|
||||
{
|
||||
@@ -741,7 +741,7 @@ int CanCameraMoveInDirection(int direction)
|
||||
void sub_80887F8(struct MapConnection *connection, int direction, int x, int y)
|
||||
{
|
||||
struct MapHeader const *mapHeader;
|
||||
mapHeader = mapconnection_get_mapheader(connection);
|
||||
mapHeader = GetMapHeaderFromConnection(connection);
|
||||
switch (direction)
|
||||
{
|
||||
case CONNECTION_EAST:
|
||||
@@ -812,7 +812,7 @@ struct MapConnection *sub_8088950(u8 direction, int x, int y)
|
||||
bool8 sub_80889A8(u8 direction, int x, int y, struct MapConnection *connection)
|
||||
{
|
||||
struct MapHeader const *mapHeader;
|
||||
mapHeader = mapconnection_get_mapheader(connection);
|
||||
mapHeader = GetMapHeaderFromConnection(connection);
|
||||
switch (direction)
|
||||
{
|
||||
case CONNECTION_SOUTH:
|
||||
@@ -853,7 +853,7 @@ int sub_8088A38(int x, int width)
|
||||
int sub_8088A4C(struct MapConnection *connection, int x, int y)
|
||||
{
|
||||
struct MapHeader const *mapHeader;
|
||||
mapHeader = mapconnection_get_mapheader(connection);
|
||||
mapHeader = GetMapHeaderFromConnection(connection);
|
||||
switch (connection->direction)
|
||||
{
|
||||
case CONNECTION_SOUTH:
|
||||
@@ -900,7 +900,7 @@ struct MapConnection *GetConnectionAtCoords(s16 x, s16 y)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void sub_8088B3C(u16 x, u16 y)
|
||||
void SetCameraFocusCoords(u16 x, u16 y)
|
||||
{
|
||||
gSaveBlock1Ptr->pos.x = x - 7;
|
||||
gSaveBlock1Ptr->pos.y = y - 7;
|
||||
@@ -912,7 +912,8 @@ void GetCameraFocusCoords(u16 *x, u16 *y)
|
||||
*y = gSaveBlock1Ptr->pos.y + 7;
|
||||
}
|
||||
|
||||
void SetPlayerCoords(u16 x, u16 y)
|
||||
// Unused
|
||||
static void SetCameraCoords(u16 x, u16 y)
|
||||
{
|
||||
gSaveBlock1Ptr->pos.x = x;
|
||||
gSaveBlock1Ptr->pos.y = y;
|
||||
@@ -945,12 +946,12 @@ static bool8 SkipCopyingMetatileFromSavedMap(u16* mapMetatilePtr, u16 mapWidth,
|
||||
else
|
||||
mapMetatilePtr += mapWidth;
|
||||
|
||||
if (sub_80FADE4(*mapMetatilePtr & METATILE_ID_MASK, yMode) == 1)
|
||||
if (IsLargeBreakableDecoration(*mapMetatilePtr & METATILE_ID_MASK, yMode) == TRUE)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void copy_tileset_patterns_to_vram(struct Tileset const *tileset, u16 numTiles, u16 offset)
|
||||
static void CopyTilesetToVram(struct Tileset const *tileset, u16 numTiles, u16 offset)
|
||||
{
|
||||
if (tileset)
|
||||
{
|
||||
@@ -961,7 +962,7 @@ void copy_tileset_patterns_to_vram(struct Tileset const *tileset, u16 numTiles,
|
||||
}
|
||||
}
|
||||
|
||||
void copy_tileset_patterns_to_vram2(struct Tileset const *tileset, u16 numTiles, u16 offset)
|
||||
static void CopyTilesetToVramUsingHeap(struct Tileset const *tileset, u16 numTiles, u16 offset)
|
||||
{
|
||||
if (tileset)
|
||||
{
|
||||
@@ -982,7 +983,7 @@ void nullsub_90(void)
|
||||
|
||||
}
|
||||
|
||||
void apply_map_tileset_palette(struct Tileset const *tileset, u16 destOffset, u16 size)
|
||||
void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u16 size)
|
||||
{
|
||||
u16 black = RGB_BLACK;
|
||||
|
||||
@@ -1007,45 +1008,45 @@ void apply_map_tileset_palette(struct Tileset const *tileset, u16 destOffset, u1
|
||||
}
|
||||
}
|
||||
|
||||
void copy_map_tileset1_to_vram(struct MapLayout const *mapLayout)
|
||||
void CopyPrimaryTilesetToVram(struct MapLayout const *mapLayout)
|
||||
{
|
||||
copy_tileset_patterns_to_vram(mapLayout->primaryTileset, NUM_TILES_IN_PRIMARY, 0);
|
||||
CopyTilesetToVram(mapLayout->primaryTileset, NUM_TILES_IN_PRIMARY, 0);
|
||||
}
|
||||
|
||||
void copy_map_tileset2_to_vram(struct MapLayout const *mapLayout)
|
||||
void CopySecondaryTilesetToVram(struct MapLayout const *mapLayout)
|
||||
{
|
||||
copy_tileset_patterns_to_vram(mapLayout->secondaryTileset, NUM_TILES_TOTAL - NUM_TILES_IN_PRIMARY, NUM_TILES_IN_PRIMARY);
|
||||
CopyTilesetToVram(mapLayout->secondaryTileset, NUM_TILES_TOTAL - NUM_TILES_IN_PRIMARY, NUM_TILES_IN_PRIMARY);
|
||||
}
|
||||
|
||||
void copy_map_tileset2_to_vram_2(struct MapLayout const *mapLayout)
|
||||
void CopySecondaryTilesetToVramUsingHeap(struct MapLayout const *mapLayout)
|
||||
{
|
||||
copy_tileset_patterns_to_vram2(mapLayout->secondaryTileset, NUM_TILES_TOTAL - NUM_TILES_IN_PRIMARY, NUM_TILES_IN_PRIMARY);
|
||||
CopyTilesetToVramUsingHeap(mapLayout->secondaryTileset, NUM_TILES_TOTAL - NUM_TILES_IN_PRIMARY, NUM_TILES_IN_PRIMARY);
|
||||
}
|
||||
|
||||
void apply_map_tileset1_palette(struct MapLayout const *mapLayout)
|
||||
static void LoadPrimaryTilesetPalette(struct MapLayout const *mapLayout)
|
||||
{
|
||||
apply_map_tileset_palette(mapLayout->primaryTileset, 0, NUM_PALS_IN_PRIMARY * 16 * 2);
|
||||
LoadTilesetPalette(mapLayout->primaryTileset, 0, NUM_PALS_IN_PRIMARY * 16 * 2);
|
||||
}
|
||||
|
||||
void apply_map_tileset2_palette(struct MapLayout const *mapLayout)
|
||||
void LoadSecondaryTilesetPalette(struct MapLayout const *mapLayout)
|
||||
{
|
||||
apply_map_tileset_palette(mapLayout->secondaryTileset, NUM_PALS_IN_PRIMARY * 16, (NUM_PALS_TOTAL - NUM_PALS_IN_PRIMARY) * 16 * 2);
|
||||
LoadTilesetPalette(mapLayout->secondaryTileset, NUM_PALS_IN_PRIMARY * 16, (NUM_PALS_TOTAL - NUM_PALS_IN_PRIMARY) * 16 * 2);
|
||||
}
|
||||
|
||||
void copy_map_tileset1_tileset2_to_vram(struct MapLayout const *mapLayout)
|
||||
void CopyMapTilesetsToVram(struct MapLayout const *mapLayout)
|
||||
{
|
||||
if (mapLayout)
|
||||
{
|
||||
copy_tileset_patterns_to_vram2(mapLayout->primaryTileset, NUM_TILES_IN_PRIMARY, 0);
|
||||
copy_tileset_patterns_to_vram2(mapLayout->secondaryTileset, NUM_TILES_TOTAL - NUM_TILES_IN_PRIMARY, NUM_TILES_IN_PRIMARY);
|
||||
CopyTilesetToVramUsingHeap(mapLayout->primaryTileset, NUM_TILES_IN_PRIMARY, 0);
|
||||
CopyTilesetToVramUsingHeap(mapLayout->secondaryTileset, NUM_TILES_TOTAL - NUM_TILES_IN_PRIMARY, NUM_TILES_IN_PRIMARY);
|
||||
}
|
||||
}
|
||||
|
||||
void apply_map_tileset1_tileset2_palette(struct MapLayout const *mapLayout)
|
||||
void LoadMapTilesetPalettes(struct MapLayout const *mapLayout)
|
||||
{
|
||||
if (mapLayout)
|
||||
{
|
||||
apply_map_tileset1_palette(mapLayout);
|
||||
apply_map_tileset2_palette(mapLayout);
|
||||
LoadPrimaryTilesetPalette(mapLayout);
|
||||
LoadSecondaryTilesetPalette(mapLayout);
|
||||
}
|
||||
}
|
||||
|
||||
+92
-97
@@ -1,6 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "event_object_lock.h"
|
||||
#include "event_object_movement.h"
|
||||
#include "event_scripts.h"
|
||||
#include "faraway_island.h"
|
||||
#include "field_camera.h"
|
||||
#include "field_effect.h"
|
||||
@@ -24,11 +25,10 @@
|
||||
|
||||
extern struct MapPosition gPlayerFacingPosition;
|
||||
|
||||
extern const u8 EventScript_FldEffCut[];
|
||||
extern const u8 FarawayIsland_Interior_EventScript_HideMewWhenGrassCut[];
|
||||
|
||||
extern const u8 gFieldEffectPic_CutGrass[];
|
||||
extern const u16 gFieldEffectObjectPalette6[];
|
||||
extern const u16 gFieldEffectPal_CutGrass[];
|
||||
|
||||
// cut 'square' defines
|
||||
#define CUT_NORMAL_SIDE 3
|
||||
@@ -122,12 +122,12 @@ static const struct SpriteFrameImage sSpriteImageTable_CutGrass[] =
|
||||
{gFieldEffectPic_CutGrass, 0x20},
|
||||
};
|
||||
|
||||
const struct SpritePalette gFieldEffectObjectPaletteInfo6 = {gFieldEffectObjectPalette6, 0x1000};
|
||||
const struct SpritePalette gSpritePalette_CutGrass = {gFieldEffectPal_CutGrass, FLDEFF_PAL_TAG_CUT_GRASS};
|
||||
|
||||
static const struct SpriteTemplate sSpriteTemplate_CutGrass =
|
||||
{
|
||||
.tileTag = 0xFFFF,
|
||||
.paletteTag = 0x1000,
|
||||
.paletteTag = FLDEFF_PAL_TAG_CUT_GRASS,
|
||||
.oam = &sOamData_CutGrass,
|
||||
.anims = sSpriteAnimTable_CutGrass,
|
||||
.images = sSpriteImageTable_CutGrass,
|
||||
@@ -227,9 +227,7 @@ bool8 SetUpFieldMove_Cut(void)
|
||||
y = gPlayerFacingPosition.y + sHyperCutStruct[i].y;
|
||||
tileCuttable = TRUE;
|
||||
|
||||
j = 0;
|
||||
do
|
||||
{
|
||||
for (j = 0; j < 2; ++j) {
|
||||
if (sHyperCutStruct[i].unk2[j] == 0)
|
||||
break;
|
||||
if (cutTiles[(u8)(sHyperCutStruct[i].unk2[j] - 1)] == FALSE)
|
||||
@@ -237,7 +235,7 @@ bool8 SetUpFieldMove_Cut(void)
|
||||
tileCuttable = FALSE;
|
||||
break;
|
||||
}
|
||||
} while (++j <= 1);
|
||||
}
|
||||
|
||||
if (tileCuttable == TRUE)
|
||||
{
|
||||
@@ -253,11 +251,8 @@ bool8 SetUpFieldMove_Cut(void)
|
||||
sHyperCutTiles[tileArrayId] = TRUE;
|
||||
ret = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (MetatileBehavior_IsCuttableGrass(tileBehavior) == TRUE)
|
||||
sHyperCutTiles[tileArrayId] = TRUE;
|
||||
}
|
||||
else if (MetatileBehavior_IsCuttableGrass(tileBehavior) == TRUE)
|
||||
sHyperCutTiles[tileArrayId] = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -281,7 +276,7 @@ static void FieldCallback_CutGrass(void)
|
||||
|
||||
bool8 FldEff_UseCutOnGrass(void)
|
||||
{
|
||||
u8 taskId = oei_task_add();
|
||||
u8 taskId = CreateFieldMoveTask();
|
||||
|
||||
gTasks[taskId].data[8] = (u32)StartCutGrassFieldEffect >> 16;
|
||||
gTasks[taskId].data[9] = (u32)StartCutGrassFieldEffect;
|
||||
@@ -292,12 +287,12 @@ bool8 FldEff_UseCutOnGrass(void)
|
||||
static void FieldCallback_CutTree(void)
|
||||
{
|
||||
gFieldEffectArguments[0] = GetCursorSelectionMonId();
|
||||
ScriptContext1_SetupScript(EventScript_FldEffCut);
|
||||
ScriptContext1_SetupScript(EventScript_UseCut);
|
||||
}
|
||||
|
||||
bool8 FldEff_UseCutOnTree(void)
|
||||
{
|
||||
u8 taskId = oei_task_add();
|
||||
u8 taskId = CreateFieldMoveTask();
|
||||
|
||||
gTasks[taskId].data[8] = (u32)StartCutTreeFieldEffect >> 16;
|
||||
gTasks[taskId].data[9] = (u32)StartCutTreeFieldEffect;
|
||||
@@ -316,7 +311,7 @@ bool8 FldEff_CutGrass(void)
|
||||
s16 x, y;
|
||||
u8 i = 0;
|
||||
|
||||
PlaySE(SE_W015);
|
||||
PlaySE(SE_M_CUT);
|
||||
PlayerGetDestCoords(&gPlayerFacingPosition.x, &gPlayerFacingPosition.y);
|
||||
for (i = 0; i < CUT_HYPER_AREA; i++)
|
||||
{
|
||||
@@ -355,36 +350,36 @@ static void SetCutGrassMetatile(s16 x, s16 y)
|
||||
|
||||
switch (metatileId)
|
||||
{
|
||||
case METATILE_ID(Fortree, LongGrass_Root):
|
||||
case METATILE_ID(General, LongGrass):
|
||||
case METATILE_ID(General, TallGrass):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(General, Grass));
|
||||
case METATILE_Fortree_LongGrass_Root:
|
||||
case METATILE_General_LongGrass:
|
||||
case METATILE_General_TallGrass:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_General_Grass);
|
||||
break;
|
||||
case METATILE_ID(General, TallGrass_TreeLeft):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(General, Grass_TreeLeft));
|
||||
case METATILE_General_TallGrass_TreeLeft:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_General_Grass_TreeLeft);
|
||||
break;
|
||||
case METATILE_ID(General, TallGrass_TreeRight):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(General, Grass_TreeRight));
|
||||
case METATILE_General_TallGrass_TreeRight:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_General_Grass_TreeRight);
|
||||
break;
|
||||
case METATILE_ID(Fortree, SecretBase_LongGrass_BottomLeft):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(Fortree, SecretBase_LongGrass_TopLeft));
|
||||
case METATILE_Fortree_SecretBase_LongGrass_BottomLeft:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_Fortree_SecretBase_LongGrass_TopLeft);
|
||||
break;
|
||||
case METATILE_ID(Fortree, SecretBase_LongGrass_BottomMid):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(Fortree, SecretBase_LongGrass_TopMid));
|
||||
case METATILE_Fortree_SecretBase_LongGrass_BottomMid:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_Fortree_SecretBase_LongGrass_TopMid);
|
||||
break;
|
||||
case METATILE_ID(Fortree, SecretBase_LongGrass_BottomRight):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(Fortree, SecretBase_LongGrass_TopRight));
|
||||
case METATILE_Fortree_SecretBase_LongGrass_BottomRight:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_Fortree_SecretBase_LongGrass_TopRight);
|
||||
break;
|
||||
case METATILE_ID(Lavaridge, NormalGrass):
|
||||
case METATILE_ID(Lavaridge, AshGrass):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(Lavaridge, LavaField));
|
||||
case METATILE_Lavaridge_NormalGrass:
|
||||
case METATILE_Lavaridge_AshGrass:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_Lavaridge_LavaField);
|
||||
break;
|
||||
case METATILE_ID(Fallarbor, NormalGrass):
|
||||
case METATILE_ID(Fallarbor, AshGrass):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(Fallarbor, AshField));
|
||||
case METATILE_Fallarbor_NormalGrass:
|
||||
case METATILE_Fallarbor_AshGrass:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_Fallarbor_AshField);
|
||||
break;
|
||||
case METATILE_ID(General, TallGrass_TreeUp):
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_ID(General, Grass_TreeUp));
|
||||
case METATILE_General_TallGrass_TreeUp:
|
||||
MapGridSetMetatileIdAt(x, y, METATILE_General_Grass_TreeUp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -402,13 +397,13 @@ static u8 GetLongGrassCaseAt(s16 x, s16 y)
|
||||
{
|
||||
u16 metatileId = MapGridGetMetatileIdAt(x, y);
|
||||
|
||||
if (metatileId == METATILE_ID(General, Grass))
|
||||
if (metatileId == METATILE_General_Grass)
|
||||
return LONG_GRASS_FIELD;
|
||||
else if (metatileId == METATILE_ID(Fortree, SecretBase_LongGrass_TopLeft))
|
||||
else if (metatileId == METATILE_Fortree_SecretBase_LongGrass_TopLeft)
|
||||
return LONG_GRASS_BASE_LEFT;
|
||||
else if (metatileId == METATILE_ID(Fortree, SecretBase_LongGrass_TopMid))
|
||||
else if (metatileId == METATILE_Fortree_SecretBase_LongGrass_TopMid)
|
||||
return LONG_GRASS_BASE_CENTER;
|
||||
else if (metatileId == METATILE_ID(Fortree, SecretBase_LongGrass_TopRight))
|
||||
else if (metatileId == METATILE_Fortree_SecretBase_LongGrass_TopRight)
|
||||
return LONG_GRASS_BASE_RIGHT;
|
||||
else
|
||||
return LONG_GRASS_NONE;
|
||||
@@ -422,34 +417,34 @@ static void SetCutGrassMetatiles(s16 x, s16 y)
|
||||
for (i = 0; i < sCutSquareSide; i++)
|
||||
{
|
||||
s16 currentX = x + i;
|
||||
if (MapGridGetMetatileIdAt(currentX, y) == METATILE_ID(General, LongGrass))
|
||||
if (MapGridGetMetatileIdAt(currentX, y) == METATILE_General_LongGrass)
|
||||
{
|
||||
switch (GetLongGrassCaseAt(currentX, y + 1))
|
||||
{
|
||||
case LONG_GRASS_FIELD:
|
||||
MapGridSetMetatileIdAt(currentX, y + 1, METATILE_ID(Fortree, LongGrass_Root));
|
||||
MapGridSetMetatileIdAt(currentX, y + 1, METATILE_Fortree_LongGrass_Root);
|
||||
break;
|
||||
case LONG_GRASS_BASE_LEFT:
|
||||
MapGridSetMetatileIdAt(currentX, y + 1, METATILE_ID(Fortree, SecretBase_LongGrass_BottomLeft));
|
||||
MapGridSetMetatileIdAt(currentX, y + 1, METATILE_Fortree_SecretBase_LongGrass_BottomLeft);
|
||||
break;
|
||||
case LONG_GRASS_BASE_CENTER:
|
||||
MapGridSetMetatileIdAt(currentX, y + 1, METATILE_ID(Fortree, SecretBase_LongGrass_BottomMid));
|
||||
MapGridSetMetatileIdAt(currentX, y + 1, METATILE_Fortree_SecretBase_LongGrass_BottomMid);
|
||||
break;
|
||||
case LONG_GRASS_BASE_RIGHT:
|
||||
MapGridSetMetatileIdAt(currentX, y + 1, METATILE_ID(Fortree, SecretBase_LongGrass_BottomRight));
|
||||
MapGridSetMetatileIdAt(currentX, y + 1, METATILE_Fortree_SecretBase_LongGrass_BottomRight);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (MapGridGetMetatileIdAt(currentX, lowerY) == METATILE_ID(General, Grass))
|
||||
if (MapGridGetMetatileIdAt(currentX, lowerY) == METATILE_General_Grass)
|
||||
{
|
||||
if (MapGridGetMetatileIdAt(currentX, lowerY + 1) == METATILE_ID(Fortree, LongGrass_Root))
|
||||
MapGridSetMetatileIdAt(currentX, lowerY + 1, METATILE_ID(General, Grass));
|
||||
if (MapGridGetMetatileIdAt(currentX, lowerY + 1) == METATILE_ID(Fortree, SecretBase_LongGrass_BottomLeft))
|
||||
MapGridSetMetatileIdAt(currentX, lowerY + 1, METATILE_ID(Fortree, SecretBase_LongGrass_TopLeft));
|
||||
if (MapGridGetMetatileIdAt(currentX, lowerY + 1) == METATILE_ID(Fortree, SecretBase_LongGrass_BottomMid))
|
||||
MapGridSetMetatileIdAt(currentX, lowerY + 1, METATILE_ID(Fortree, SecretBase_LongGrass_TopMid));
|
||||
if (MapGridGetMetatileIdAt(currentX, lowerY + 1) == METATILE_ID(Fortree, SecretBase_LongGrass_BottomRight))
|
||||
MapGridSetMetatileIdAt(currentX, lowerY + 1, METATILE_ID(Fortree, SecretBase_LongGrass_TopRight));
|
||||
if (MapGridGetMetatileIdAt(currentX, lowerY + 1) == METATILE_Fortree_LongGrass_Root)
|
||||
MapGridSetMetatileIdAt(currentX, lowerY + 1, METATILE_General_Grass);
|
||||
if (MapGridGetMetatileIdAt(currentX, lowerY + 1) == METATILE_Fortree_SecretBase_LongGrass_BottomLeft)
|
||||
MapGridSetMetatileIdAt(currentX, lowerY + 1, METATILE_Fortree_SecretBase_LongGrass_TopLeft);
|
||||
if (MapGridGetMetatileIdAt(currentX, lowerY + 1) == METATILE_Fortree_SecretBase_LongGrass_BottomMid)
|
||||
MapGridSetMetatileIdAt(currentX, lowerY + 1, METATILE_Fortree_SecretBase_LongGrass_TopMid);
|
||||
if (MapGridGetMetatileIdAt(currentX, lowerY + 1) == METATILE_Fortree_SecretBase_LongGrass_BottomRight)
|
||||
MapGridSetMetatileIdAt(currentX, lowerY + 1, METATILE_Fortree_SecretBase_LongGrass_TopRight);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,62 +481,62 @@ static void HandleLongGrassOnHyper(u8 caseId, s16 x, s16 y)
|
||||
|
||||
if (arr[0] == TRUE)
|
||||
{
|
||||
if (MapGridGetMetatileIdAt(newX, y + 3) == METATILE_ID(Fortree, LongGrass_Root))
|
||||
MapGridSetMetatileIdAt(newX, y + 3, METATILE_ID(General, Grass));
|
||||
if (MapGridGetMetatileIdAt(newX, y + 3) == METATILE_ID(Fortree, SecretBase_LongGrass_BottomLeft))
|
||||
MapGridSetMetatileIdAt(newX, y + 3, METATILE_ID(Fortree, SecretBase_LongGrass_TopLeft));
|
||||
if (MapGridGetMetatileIdAt(newX, y + 3) == METATILE_ID(Fortree, SecretBase_LongGrass_BottomMid))
|
||||
MapGridSetMetatileIdAt(newX, y + 3, METATILE_ID(Fortree, SecretBase_LongGrass_TopMid));
|
||||
if (MapGridGetMetatileIdAt(newX, y + 3) == METATILE_ID(Fortree, SecretBase_LongGrass_BottomRight))
|
||||
MapGridSetMetatileIdAt(newX, y + 3, METATILE_ID(Fortree, SecretBase_LongGrass_TopRight));
|
||||
if (MapGridGetMetatileIdAt(newX, y + 3) == METATILE_Fortree_LongGrass_Root)
|
||||
MapGridSetMetatileIdAt(newX, y + 3, METATILE_General_Grass);
|
||||
if (MapGridGetMetatileIdAt(newX, y + 3) == METATILE_Fortree_SecretBase_LongGrass_BottomLeft)
|
||||
MapGridSetMetatileIdAt(newX, y + 3, METATILE_Fortree_SecretBase_LongGrass_TopLeft);
|
||||
if (MapGridGetMetatileIdAt(newX, y + 3) == METATILE_Fortree_SecretBase_LongGrass_BottomMid)
|
||||
MapGridSetMetatileIdAt(newX, y + 3, METATILE_Fortree_SecretBase_LongGrass_TopMid);
|
||||
if (MapGridGetMetatileIdAt(newX, y + 3) == METATILE_Fortree_SecretBase_LongGrass_BottomRight)
|
||||
MapGridSetMetatileIdAt(newX, y + 3, METATILE_Fortree_SecretBase_LongGrass_TopRight);
|
||||
}
|
||||
if (arr[1] == TRUE)
|
||||
{
|
||||
if (MapGridGetMetatileIdAt(newX, y + 2) == METATILE_ID(General, LongGrass))
|
||||
if (MapGridGetMetatileIdAt(newX, y + 2) == METATILE_General_LongGrass)
|
||||
{
|
||||
switch (GetLongGrassCaseAt(newX, y + 3))
|
||||
{
|
||||
case LONG_GRASS_FIELD:
|
||||
MapGridSetMetatileIdAt(newX, y + 3, METATILE_ID(Fortree, LongGrass_Root));
|
||||
MapGridSetMetatileIdAt(newX, y + 3, METATILE_Fortree_LongGrass_Root);
|
||||
break;
|
||||
case LONG_GRASS_BASE_LEFT:
|
||||
MapGridSetMetatileIdAt(newX, y + 3, METATILE_ID(Fortree, SecretBase_LongGrass_BottomLeft));
|
||||
MapGridSetMetatileIdAt(newX, y + 3, METATILE_Fortree_SecretBase_LongGrass_BottomLeft);
|
||||
break;
|
||||
case LONG_GRASS_BASE_CENTER:
|
||||
MapGridSetMetatileIdAt(newX, y + 3, METATILE_ID(Fortree, SecretBase_LongGrass_BottomMid));
|
||||
MapGridSetMetatileIdAt(newX, y + 3, METATILE_Fortree_SecretBase_LongGrass_BottomMid);
|
||||
break;
|
||||
case LONG_GRASS_BASE_RIGHT:
|
||||
MapGridSetMetatileIdAt(newX, y + 3, METATILE_ID(Fortree, SecretBase_LongGrass_BottomRight));
|
||||
MapGridSetMetatileIdAt(newX, y + 3, METATILE_Fortree_SecretBase_LongGrass_BottomRight);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (MapGridGetMetatileIdAt(newX, y + 4) == METATILE_ID(Fortree, LongGrass_Root))
|
||||
MapGridSetMetatileIdAt(newX, y + 4, METATILE_ID(General, Grass));
|
||||
if (MapGridGetMetatileIdAt(newX, y + 4) == METATILE_ID(Fortree, SecretBase_LongGrass_BottomLeft))
|
||||
MapGridSetMetatileIdAt(newX, y + 4, METATILE_ID(Fortree, SecretBase_LongGrass_TopLeft));
|
||||
if (MapGridGetMetatileIdAt(newX, y + 4) == METATILE_ID(Fortree, SecretBase_LongGrass_BottomMid))
|
||||
MapGridSetMetatileIdAt(newX, y + 4, METATILE_ID(Fortree, SecretBase_LongGrass_TopMid));
|
||||
if (MapGridGetMetatileIdAt(newX, y + 4) == METATILE_ID(Fortree, SecretBase_LongGrass_BottomRight))
|
||||
MapGridSetMetatileIdAt(newX, y + 4, METATILE_ID(Fortree, SecretBase_LongGrass_TopRight));
|
||||
if (MapGridGetMetatileIdAt(newX, y + 4) == METATILE_Fortree_LongGrass_Root)
|
||||
MapGridSetMetatileIdAt(newX, y + 4, METATILE_General_Grass);
|
||||
if (MapGridGetMetatileIdAt(newX, y + 4) == METATILE_Fortree_SecretBase_LongGrass_BottomLeft)
|
||||
MapGridSetMetatileIdAt(newX, y + 4, METATILE_Fortree_SecretBase_LongGrass_TopLeft);
|
||||
if (MapGridGetMetatileIdAt(newX, y + 4) == METATILE_Fortree_SecretBase_LongGrass_BottomMid)
|
||||
MapGridSetMetatileIdAt(newX, y + 4, METATILE_Fortree_SecretBase_LongGrass_TopMid);
|
||||
if (MapGridGetMetatileIdAt(newX, y + 4) == METATILE_Fortree_SecretBase_LongGrass_BottomRight)
|
||||
MapGridSetMetatileIdAt(newX, y + 4, METATILE_Fortree_SecretBase_LongGrass_TopRight);
|
||||
}
|
||||
if (arr[2] == TRUE)
|
||||
{
|
||||
if (MapGridGetMetatileIdAt(newX, y + 3) == METATILE_ID(General, LongGrass))
|
||||
if (MapGridGetMetatileIdAt(newX, y + 3) == METATILE_General_LongGrass)
|
||||
{
|
||||
switch (GetLongGrassCaseAt(newX, y + 4))
|
||||
{
|
||||
case LONG_GRASS_FIELD:
|
||||
MapGridSetMetatileIdAt(newX, y + 4, METATILE_ID(Fortree, LongGrass_Root));
|
||||
MapGridSetMetatileIdAt(newX, y + 4, METATILE_Fortree_LongGrass_Root);
|
||||
break;
|
||||
case LONG_GRASS_BASE_LEFT:
|
||||
MapGridSetMetatileIdAt(newX, y + 4, METATILE_ID(Fortree, SecretBase_LongGrass_BottomLeft));
|
||||
MapGridSetMetatileIdAt(newX, y + 4, METATILE_Fortree_SecretBase_LongGrass_BottomLeft);
|
||||
break;
|
||||
case LONG_GRASS_BASE_CENTER:
|
||||
MapGridSetMetatileIdAt(newX, y + 4, METATILE_ID(Fortree, SecretBase_LongGrass_BottomMid));
|
||||
MapGridSetMetatileIdAt(newX, y + 4, METATILE_Fortree_SecretBase_LongGrass_BottomMid);
|
||||
break;
|
||||
case LONG_GRASS_BASE_RIGHT:
|
||||
MapGridSetMetatileIdAt(newX, y + 4, METATILE_ID(Fortree, SecretBase_LongGrass_BottomRight));
|
||||
MapGridSetMetatileIdAt(newX, y + 4, METATILE_Fortree_SecretBase_LongGrass_BottomRight);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -595,16 +590,16 @@ void FixLongGrassMetatilesWindowTop(s16 x, s16 y)
|
||||
switch (GetLongGrassCaseAt(x, y + 1))
|
||||
{
|
||||
case LONG_GRASS_FIELD:
|
||||
MapGridSetMetatileIdAt(x, y + 1, METATILE_ID(Fortree, LongGrass_Root));
|
||||
MapGridSetMetatileIdAt(x, y + 1, METATILE_Fortree_LongGrass_Root);
|
||||
break;
|
||||
case LONG_GRASS_BASE_LEFT:
|
||||
MapGridSetMetatileIdAt(x, y + 1, METATILE_ID(Fortree, SecretBase_LongGrass_BottomLeft));
|
||||
MapGridSetMetatileIdAt(x, y + 1, METATILE_Fortree_SecretBase_LongGrass_BottomLeft);
|
||||
break;
|
||||
case LONG_GRASS_BASE_CENTER:
|
||||
MapGridSetMetatileIdAt(x, y + 1, METATILE_ID(Fortree, SecretBase_LongGrass_BottomMid));
|
||||
MapGridSetMetatileIdAt(x, y + 1, METATILE_Fortree_SecretBase_LongGrass_BottomMid);
|
||||
break;
|
||||
case LONG_GRASS_BASE_RIGHT:
|
||||
MapGridSetMetatileIdAt(x, y + 1, METATILE_ID(Fortree, SecretBase_LongGrass_BottomRight));
|
||||
MapGridSetMetatileIdAt(x, y + 1, METATILE_Fortree_SecretBase_LongGrass_BottomRight);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -612,7 +607,7 @@ void FixLongGrassMetatilesWindowTop(s16 x, s16 y)
|
||||
|
||||
void FixLongGrassMetatilesWindowBottom(s16 x, s16 y)
|
||||
{
|
||||
if (MapGridGetMetatileIdAt(x, y) == METATILE_ID(General, Grass))
|
||||
if (MapGridGetMetatileIdAt(x, y) == METATILE_General_Grass)
|
||||
{
|
||||
u8 metatileBehavior = MapGridGetMetatileBehaviorAt(x, y + 1);
|
||||
if (MetatileBehavior_IsLongGrassSouthEdge(metatileBehavior))
|
||||
@@ -620,17 +615,17 @@ void FixLongGrassMetatilesWindowBottom(s16 x, s16 y)
|
||||
s32 metatileId = MapGridGetMetatileIdAt(x, y + 1);
|
||||
switch (metatileId)
|
||||
{
|
||||
case METATILE_ID(Fortree, LongGrass_Root):
|
||||
MapGridSetMetatileIdAt(x, y + 1, METATILE_ID(General, Grass));
|
||||
case METATILE_Fortree_LongGrass_Root:
|
||||
MapGridSetMetatileIdAt(x, y + 1, METATILE_General_Grass);
|
||||
break;
|
||||
case METATILE_ID(Fortree, SecretBase_LongGrass_BottomLeft):
|
||||
MapGridSetMetatileIdAt(x, y + 1, METATILE_ID(Fortree, SecretBase_LongGrass_TopLeft));
|
||||
case METATILE_Fortree_SecretBase_LongGrass_BottomLeft:
|
||||
MapGridSetMetatileIdAt(x, y + 1, METATILE_Fortree_SecretBase_LongGrass_TopLeft);
|
||||
break;
|
||||
case METATILE_ID(Fortree, SecretBase_LongGrass_BottomMid):
|
||||
MapGridSetMetatileIdAt(x, y + 1, METATILE_ID(Fortree, SecretBase_LongGrass_TopMid));
|
||||
case METATILE_Fortree_SecretBase_LongGrass_BottomMid:
|
||||
MapGridSetMetatileIdAt(x, y + 1, METATILE_Fortree_SecretBase_LongGrass_TopMid);
|
||||
break;
|
||||
case METATILE_ID(Fortree, SecretBase_LongGrass_BottomRight):
|
||||
MapGridSetMetatileIdAt(x, y + 1, METATILE_ID(Fortree, SecretBase_LongGrass_TopRight));
|
||||
case METATILE_Fortree_SecretBase_LongGrass_BottomRight:
|
||||
MapGridSetMetatileIdAt(x, y + 1, METATILE_Fortree_SecretBase_LongGrass_TopRight);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -639,7 +634,7 @@ void FixLongGrassMetatilesWindowBottom(s16 x, s16 y)
|
||||
|
||||
static void StartCutTreeFieldEffect(void)
|
||||
{
|
||||
PlaySE(SE_W015);
|
||||
PlaySE(SE_M_CUT);
|
||||
FieldEffectActiveListRemove(FLDEFF_USE_CUT_ON_TREE);
|
||||
EnableBothScriptContexts();
|
||||
}
|
||||
|
||||
+8
-8
@@ -10,8 +10,8 @@
|
||||
#include "constants/field_effects.h"
|
||||
|
||||
// static functions
|
||||
static void hm2_dig(void);
|
||||
static void sub_8135780(void);
|
||||
static void FieldCallback_Dig(void);
|
||||
static void StartDigFieldEffect(void);
|
||||
|
||||
// text
|
||||
bool8 SetUpFieldMove_Dig(void)
|
||||
@@ -19,7 +19,7 @@ bool8 SetUpFieldMove_Dig(void)
|
||||
if (CanUseDigOrEscapeRopeOnCurMap() == TRUE)
|
||||
{
|
||||
gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu;
|
||||
gPostMenuFieldCallback = hm2_dig;
|
||||
gPostMenuFieldCallback = FieldCallback_Dig;
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
@@ -28,7 +28,7 @@ bool8 SetUpFieldMove_Dig(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void hm2_dig(void)
|
||||
static void FieldCallback_Dig(void)
|
||||
{
|
||||
Overworld_ResetStateAfterDigEscRope();
|
||||
FieldEffectStart(FLDEFF_USE_DIG);
|
||||
@@ -37,16 +37,16 @@ static void hm2_dig(void)
|
||||
|
||||
bool8 FldEff_UseDig(void)
|
||||
{
|
||||
u8 taskId = oei_task_add();
|
||||
u8 taskId = CreateFieldMoveTask();
|
||||
|
||||
gTasks[taskId].data[8] = (u32)sub_8135780 >> 16;
|
||||
gTasks[taskId].data[9] = (u32)sub_8135780;
|
||||
gTasks[taskId].data[8] = (u32)StartDigFieldEffect >> 16;
|
||||
gTasks[taskId].data[9] = (u32)StartDigFieldEffect;
|
||||
if (!ShouldDoBrailleDigEffect())
|
||||
SetPlayerAvatarTransitionFlags(PLAYER_AVATAR_FLAG_ON_FOOT);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void sub_8135780(void)
|
||||
static void StartDigFieldEffect(void)
|
||||
{
|
||||
u8 taskId;
|
||||
|
||||
|
||||
+116
-89
@@ -8,161 +8,188 @@
|
||||
|
||||
static EWRAM_DATA u8 sEscalatorAnim_TaskId = 0;
|
||||
|
||||
static void sub_80E12E8(u8 taskId, const s16 *list, u16 isImpassableFlag)
|
||||
static void SetEscalatorMetatile(u8 taskId, const s16 *metatileIds, u16 metatileMasks);
|
||||
static void Task_DrawEscalator(u8 taskId);
|
||||
static void Task_DrawTeleporterHousing(u8 taskId);
|
||||
static void Task_DrawTeleporterCable(u8 taskId);
|
||||
|
||||
#define ESCALATOR_STAGES 3
|
||||
#define LAST_ESCALATOR_STAGE (ESCALATOR_STAGES - 1)
|
||||
|
||||
static const u16 sEscalatorMetatiles_1F_0[ESCALATOR_STAGES] = {
|
||||
METATILE_PokemonCenter_Escalator1F_Tile0_Frame2,
|
||||
METATILE_PokemonCenter_Escalator1F_Tile0_Frame1,
|
||||
METATILE_PokemonCenter_Escalator1F_Tile0_Frame0
|
||||
};
|
||||
|
||||
static const u16 sEscalatorMetatiles_1F_1[ESCALATOR_STAGES] = {
|
||||
METATILE_PokemonCenter_Escalator1F_Tile1_Frame2,
|
||||
METATILE_PokemonCenter_Escalator1F_Tile1_Frame1,
|
||||
METATILE_PokemonCenter_Escalator1F_Tile1_Frame0
|
||||
};
|
||||
|
||||
static const u16 sEscalatorMetatiles_1F_2[ESCALATOR_STAGES] = {
|
||||
METATILE_PokemonCenter_Escalator1F_Tile2_Frame2,
|
||||
METATILE_PokemonCenter_Escalator1F_Tile2_Frame1,
|
||||
METATILE_PokemonCenter_Escalator1F_Tile2_Frame0
|
||||
};
|
||||
|
||||
static const u16 sEscalatorMetatiles_1F_3[ESCALATOR_STAGES] = {
|
||||
METATILE_PokemonCenter_Escalator1F_Tile3_Frame2,
|
||||
METATILE_PokemonCenter_Escalator1F_Tile3_Frame1,
|
||||
METATILE_PokemonCenter_Escalator1F_Tile3_Frame0
|
||||
};
|
||||
|
||||
static const u16 sEscalatorMetatiles_2F_0[ESCALATOR_STAGES] = {
|
||||
METATILE_PokemonCenter_Escalator2F_Tile0_Frame0,
|
||||
METATILE_PokemonCenter_Escalator2F_Tile0_Frame1,
|
||||
METATILE_PokemonCenter_Escalator2F_Tile0_Frame2
|
||||
};
|
||||
|
||||
static const u16 sEscalatorMetatiles_2F_1[ESCALATOR_STAGES] = {
|
||||
METATILE_PokemonCenter_Escalator2F_Tile1_Frame0,
|
||||
METATILE_PokemonCenter_Escalator2F_Tile1_Frame1,
|
||||
METATILE_PokemonCenter_Escalator2F_Tile1_Frame2
|
||||
};
|
||||
|
||||
static const u16 sEscalatorMetatiles_2F_2[ESCALATOR_STAGES] = {
|
||||
METATILE_PokemonCenter_Escalator2F_Tile2_Frame0,
|
||||
METATILE_PokemonCenter_Escalator2F_Tile2_Frame1,
|
||||
METATILE_PokemonCenter_Escalator2F_Tile2_Frame2
|
||||
};
|
||||
|
||||
#define tState data[0]
|
||||
#define tTransitionStage data[1]
|
||||
#define tGoingUp data[2]
|
||||
#define tDrawingEscalator data[3]
|
||||
#define tPlayerX data[4]
|
||||
#define tPlayerY data[5]
|
||||
|
||||
static void SetEscalatorMetatile(u8 taskId, const s16 *metatileIds, u16 metatileMasks)
|
||||
{
|
||||
s16 r5 = gTasks[taskId].data[4] - 1;
|
||||
s16 r3 = gTasks[taskId].data[5] - 1;
|
||||
s16 r4 = gTasks[taskId].data[1];
|
||||
s16 y;
|
||||
s16 x;
|
||||
s16 x = gTasks[taskId].tPlayerX - 1;
|
||||
s16 y = gTasks[taskId].tPlayerY - 1;
|
||||
s16 transitionStage = gTasks[taskId].tTransitionStage;
|
||||
s16 i;
|
||||
s16 j;
|
||||
|
||||
if (gTasks[taskId].data[2] == 0)
|
||||
// Check all the escalator sections and only progress the selected one to the next stage
|
||||
if (!gTasks[taskId].tGoingUp)
|
||||
{
|
||||
for (y = 0; y < 3; y++)
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
for (x = 0; x < 3; x++)
|
||||
for (j = 0; j < 3; j++)
|
||||
{
|
||||
s16 metatileId = MapGridGetMetatileIdAt(r5 + x, r3 + y);
|
||||
s16 metatileId = MapGridGetMetatileIdAt(x + j, y + i);
|
||||
|
||||
if (list[r4] == metatileId)
|
||||
if (metatileIds[transitionStage] == metatileId)
|
||||
{
|
||||
if (r4 != 2)
|
||||
MapGridSetMetatileIdAt(r5 + x, r3 + y, isImpassableFlag | list[r4 + 1]);
|
||||
if (transitionStage != LAST_ESCALATOR_STAGE)
|
||||
MapGridSetMetatileIdAt(x + j, y + i, metatileMasks | metatileIds[transitionStage + 1]);
|
||||
else
|
||||
MapGridSetMetatileIdAt(r5 + x, r3 + y, isImpassableFlag | list[0]);
|
||||
MapGridSetMetatileIdAt(x + j, y + i, metatileMasks | metatileIds[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (y = 0; y < 3; y++)
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
for (x = 0; x < 3; x++)
|
||||
for (j = 0; j < 3; j++)
|
||||
{
|
||||
s16 metatileId = MapGridGetMetatileIdAt(r5 + x, r3 + y);
|
||||
s16 metatileId = MapGridGetMetatileIdAt(x + j, y + i);
|
||||
|
||||
if (list[2 - r4] == metatileId)
|
||||
if (metatileIds[LAST_ESCALATOR_STAGE - transitionStage] == metatileId)
|
||||
{
|
||||
if (r4 != 2)
|
||||
MapGridSetMetatileIdAt(r5 + x, r3 + y, isImpassableFlag | list[1 - r4]);
|
||||
if (transitionStage != LAST_ESCALATOR_STAGE)
|
||||
MapGridSetMetatileIdAt(x + j, y + i, metatileMasks | metatileIds[1 - transitionStage]);
|
||||
else
|
||||
MapGridSetMetatileIdAt(r5 + x, r3 + y, isImpassableFlag | list[2]);
|
||||
MapGridSetMetatileIdAt(x + j, y + i, metatileMasks | metatileIds[LAST_ESCALATOR_STAGE]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const u16 sElevatorMetatiles_1F_0[] = {
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile0_Frame2),
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile0_Frame1),
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile0_Frame0)
|
||||
};
|
||||
|
||||
static const u16 sElevatorMetatiles_1F_1[] = {
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile1_Frame2),
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile1_Frame1),
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile1_Frame0)
|
||||
};
|
||||
|
||||
static const u16 sElevatorMetatiles_1F_2[] = {
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile2_Frame2),
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile2_Frame1),
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile2_Frame0)
|
||||
};
|
||||
|
||||
static const u16 sElevatorMetatiles_1F_3[] = {
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile3_Frame2),
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile3_Frame1),
|
||||
METATILE_ID(PokemonCenter, Elevator1F_Tile3_Frame0)
|
||||
};
|
||||
|
||||
static const u16 sElevatorMetatiles_2F_0[] = {
|
||||
METATILE_ID(PokemonCenter, Elevator2F_Tile0_Frame0),
|
||||
METATILE_ID(PokemonCenter, Elevator2F_Tile0_Frame1),
|
||||
METATILE_ID(PokemonCenter, Elevator2F_Tile0_Frame2)
|
||||
};
|
||||
|
||||
static const u16 sElevatorMetatiles_2F_1[] = {
|
||||
METATILE_ID(PokemonCenter, Elevator2F_Tile1_Frame0),
|
||||
METATILE_ID(PokemonCenter, Elevator2F_Tile1_Frame1),
|
||||
METATILE_ID(PokemonCenter, Elevator2F_Tile1_Frame2)
|
||||
};
|
||||
|
||||
static const u16 sElevatorMetatiles_2F_2[] = {
|
||||
METATILE_ID(PokemonCenter, Elevator2F_Tile2_Frame0),
|
||||
METATILE_ID(PokemonCenter, Elevator2F_Tile2_Frame1),
|
||||
METATILE_ID(PokemonCenter, Elevator2F_Tile2_Frame2)
|
||||
};
|
||||
|
||||
static void sub_80E1444(u8 taskId)
|
||||
static void Task_DrawEscalator(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
data[3] = 1;
|
||||
tDrawingEscalator = TRUE;
|
||||
|
||||
switch (data[0])
|
||||
// Set tile for each section of the escalator in sequence for current transition stage
|
||||
switch (tState)
|
||||
{
|
||||
case 0:
|
||||
sub_80E12E8(taskId, sElevatorMetatiles_1F_0, 0);
|
||||
SetEscalatorMetatile(taskId, sEscalatorMetatiles_1F_0, 0);
|
||||
break;
|
||||
case 1:
|
||||
sub_80E12E8(taskId, sElevatorMetatiles_1F_1, 0);
|
||||
SetEscalatorMetatile(taskId, sEscalatorMetatiles_1F_1, 0);
|
||||
break;
|
||||
case 2:
|
||||
sub_80E12E8(taskId, sElevatorMetatiles_1F_2, METATILE_COLLISION_MASK);
|
||||
SetEscalatorMetatile(taskId, sEscalatorMetatiles_1F_2, METATILE_COLLISION_MASK);
|
||||
break;
|
||||
case 3:
|
||||
sub_80E12E8(taskId, sElevatorMetatiles_1F_3, 0);
|
||||
SetEscalatorMetatile(taskId, sEscalatorMetatiles_1F_3, 0);
|
||||
break;
|
||||
case 4:
|
||||
sub_80E12E8(taskId, sElevatorMetatiles_2F_0, METATILE_COLLISION_MASK);
|
||||
SetEscalatorMetatile(taskId, sEscalatorMetatiles_2F_0, METATILE_COLLISION_MASK);
|
||||
break;
|
||||
case 5:
|
||||
sub_80E12E8(taskId, sElevatorMetatiles_2F_1, 0);
|
||||
SetEscalatorMetatile(taskId, sEscalatorMetatiles_2F_1, 0);
|
||||
break;
|
||||
case 6:
|
||||
sub_80E12E8(taskId, sElevatorMetatiles_2F_2, 0);
|
||||
SetEscalatorMetatile(taskId, sEscalatorMetatiles_2F_2, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
data[0] = (data[0] + 1) & 7;
|
||||
if (!data[0])
|
||||
tState = (tState + 1) & 7;
|
||||
|
||||
// If all metatiles of the escalator have been set, draw map and progress to next stage
|
||||
if (tState == 0)
|
||||
{
|
||||
DrawWholeMapView();
|
||||
data[1] = (data[1] + 1) % 3;
|
||||
data[3] = 0;
|
||||
tTransitionStage = (tTransitionStage + 1) % ESCALATOR_STAGES;
|
||||
tDrawingEscalator = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static u8 sub_80E150C(u16 var)
|
||||
static u8 CreateEscalatorTask(bool16 goingUp)
|
||||
{
|
||||
u8 taskId = CreateTask(sub_80E1444, 0);
|
||||
u8 taskId = CreateTask(Task_DrawEscalator, 0);
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
PlayerGetDestCoords(&data[4], &data[5]);
|
||||
data[0] = 0;
|
||||
data[1] = 0;
|
||||
data[2] = var;
|
||||
sub_80E1444(taskId);
|
||||
PlayerGetDestCoords(&tPlayerX, &tPlayerY);
|
||||
tState = 0;
|
||||
tTransitionStage = 0;
|
||||
tGoingUp = goingUp;
|
||||
Task_DrawEscalator(taskId);
|
||||
return taskId;
|
||||
}
|
||||
|
||||
void sub_80E1558(u8 var)
|
||||
void StartEscalator(bool8 goingUp)
|
||||
{
|
||||
sEscalatorAnim_TaskId = sub_80E150C(var);
|
||||
sEscalatorAnim_TaskId = CreateEscalatorTask(goingUp);
|
||||
}
|
||||
|
||||
void sub_80E1570(void)
|
||||
void StopEscalator(void)
|
||||
{
|
||||
DestroyTask(sEscalatorAnim_TaskId);
|
||||
}
|
||||
|
||||
bool8 sub_80E1584(void)
|
||||
bool8 IsEscalatorMoving(void)
|
||||
{
|
||||
if (gTasks[sEscalatorAnim_TaskId].data[3] == 0 && gTasks[sEscalatorAnim_TaskId].data[1] == 2)
|
||||
if (gTasks[sEscalatorAnim_TaskId].tDrawingEscalator == FALSE
|
||||
&& gTasks[sEscalatorAnim_TaskId].tTransitionStage == LAST_ESCALATOR_STAGE)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#undef tState
|
||||
#undef tTransitionStage
|
||||
#undef tGoingUp
|
||||
#undef tDrawingEscalator
|
||||
#undef tPlayerX
|
||||
#undef tPlayerY
|
||||
|
||||
+3
-3
@@ -96,7 +96,7 @@ bool8 SetUpFieldMove_Flash(void)
|
||||
|
||||
static void FieldCallback_Flash(void)
|
||||
{
|
||||
u8 taskId = oei_task_add();
|
||||
u8 taskId = CreateFieldMoveTask();
|
||||
gFieldEffectArguments[0] = GetCursorSelectionMonId();
|
||||
gTasks[taskId].data[8] = (uintptr_t)FldEff_UseFlash >> 16;
|
||||
gTasks[taskId].data[9] = (uintptr_t)FldEff_UseFlash;
|
||||
@@ -104,9 +104,9 @@ static void FieldCallback_Flash(void)
|
||||
|
||||
static void FldEff_UseFlash(void)
|
||||
{
|
||||
PlaySE(SE_W115);
|
||||
PlaySE(SE_M_REFLECT);
|
||||
FlagSet(FLAG_SYS_USE_FLASH);
|
||||
ScriptContext1_SetupScript(EventScript_FldEffFlash);
|
||||
ScriptContext1_SetupScript(EventScript_UseFlash);
|
||||
}
|
||||
|
||||
static void CB2_ChangeMapMain(void)
|
||||
|
||||
+294
-280
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user