mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Cleanup from https://github.com/pret/pokefirered/pull/532
This commit is contained in:
parent
aa9ccbf194
commit
4b08a511c3
@ -301,7 +301,7 @@ bool16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u8 speed, voi
|
||||
sTempTextPrinter.textSpeed = 0;
|
||||
|
||||
// Render all text (up to limit) at once
|
||||
for (j = 0; j < 0x400; ++j)
|
||||
for (j = 0; j < 0x400; j++)
|
||||
{
|
||||
if (RenderFont(&sTempTextPrinter) == RENDER_FINISH)
|
||||
break;
|
||||
@ -322,7 +322,7 @@ void RunTextPrinters(void)
|
||||
|
||||
if (!gDisableTextPrinters)
|
||||
{
|
||||
for (i = 0; i < NUM_TEXT_PRINTERS; ++i)
|
||||
for (i = 0; i < NUM_TEXT_PRINTERS; i++)
|
||||
{
|
||||
if (sTextPrinters[i].active)
|
||||
{
|
||||
@ -1318,7 +1318,7 @@ static u32 (*GetFontWidthFunc(u8 fontId))(u16, bool32)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sGlyphWidthFuncs); ++i)
|
||||
for (i = 0; i < ARRAY_COUNT(sGlyphWidthFuncs); i++)
|
||||
{
|
||||
if (fontId == sGlyphWidthFuncs[i].fontId)
|
||||
return sGlyphWidthFuncs[i].func;
|
||||
|
@ -38,7 +38,7 @@ bool16 InitWindows(const struct WindowTemplate *templates)
|
||||
u8 *allocatedTilemapBuffer;
|
||||
int allocatedBaseBlock;
|
||||
|
||||
for (i = 0; i < NUM_BACKGROUNDS; ++i)
|
||||
for (i = 0; i < NUM_BACKGROUNDS; i++)
|
||||
{
|
||||
bgTilemapBuffer = GetBgTilemapBuffer(i);
|
||||
if (bgTilemapBuffer != NULL)
|
||||
@ -47,7 +47,7 @@ bool16 InitWindows(const struct WindowTemplate *templates)
|
||||
gWindowBgTilemapBuffers[i] = bgTilemapBuffer;
|
||||
}
|
||||
|
||||
for (i = 0; i < WINDOWS_MAX; ++i)
|
||||
for (i = 0; i < WINDOWS_MAX; i++)
|
||||
{
|
||||
gWindows[i].window = sDummyWindowTemplate;
|
||||
gWindows[i].tileData = NULL;
|
||||
@ -76,7 +76,7 @@ bool16 InitWindows(const struct WindowTemplate *templates)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for (j = 0; j < attrib; ++j)
|
||||
for (j = 0; j < attrib; j++)
|
||||
allocatedTilemapBuffer[j] = 0;
|
||||
|
||||
gWindowBgTilemapBuffers[bgLayer] = allocatedTilemapBuffer;
|
||||
@ -151,7 +151,7 @@ u16 AddWindow(const struct WindowTemplate *template)
|
||||
if (allocatedTilemapBuffer == NULL)
|
||||
return WINDOW_NONE;
|
||||
|
||||
for (i = 0; i < attrib; ++i)
|
||||
for (i = 0; i < attrib; i++)
|
||||
allocatedTilemapBuffer[i] = 0;
|
||||
|
||||
gWindowBgTilemapBuffers[bgLayer] = allocatedTilemapBuffer;
|
||||
@ -249,7 +249,7 @@ void FreeAllWindowBuffers(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_BACKGROUNDS; ++i)
|
||||
for (i = 0; i < NUM_BACKGROUNDS; i++)
|
||||
{
|
||||
if (gWindowBgTilemapBuffers[i] != NULL && gWindowBgTilemapBuffers[i] != DummyWindowBgTilemap)
|
||||
{
|
||||
@ -258,7 +258,7 @@ void FreeAllWindowBuffers(void)
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < WINDOWS_MAX; ++i)
|
||||
for (i = 0; i < WINDOWS_MAX; i++)
|
||||
{
|
||||
if (gWindows[i].tileData != NULL)
|
||||
{
|
||||
@ -342,7 +342,7 @@ void PutWindowRectTilemapOverridePalette(u8 windowId, u8 x, u8 y, u8 width, u8 h
|
||||
u16 currentRow = windowLocal.window.baseBlock + (y * windowLocal.window.width) + x + GetBgAttribute(windowLocal.window.bg, BG_ATTR_BASETILE);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < height; ++i)
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
WriteSequenceToBgTilemapBuffer(
|
||||
windowLocal.window.bg,
|
||||
@ -379,7 +379,7 @@ void PutWindowRectTilemap(u8 windowId, u8 x, u8 y, u8 width, u8 height)
|
||||
u16 currentRow = windowLocal.window.baseBlock + (y * windowLocal.window.width) + x + GetBgAttribute(windowLocal.window.bg, BG_ATTR_BASETILE);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < height; ++i)
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
WriteSequenceToBgTilemapBuffer(
|
||||
windowLocal.window.bg,
|
||||
|
@ -50,11 +50,11 @@ void SpriteCB_VsLetterInit(struct Sprite *sprite);
|
||||
void CB2_InitEndLinkBattle(void);
|
||||
u32 GetBattleBgTemplateData(u8 arrayId, u8 caseId);
|
||||
u32 GetBattleWindowTemplatePixelWidth(u32 setId, u32 tableId);
|
||||
void SpriteCb_WildMon(struct Sprite *sprite);
|
||||
void SpriteCB_WildMon(struct Sprite *sprite);
|
||||
void SpriteCallbackDummy_2(struct Sprite *sprite);
|
||||
void SpriteCB_FaintOpponentMon(struct Sprite *sprite);
|
||||
void SpriteCb_ShowAsMoveTarget(struct Sprite *sprite);
|
||||
void SpriteCb_HideAsMoveTarget(struct Sprite *sprite);
|
||||
void SpriteCB_ShowAsMoveTarget(struct Sprite *sprite);
|
||||
void SpriteCB_HideAsMoveTarget(struct Sprite *sprite);
|
||||
void SpriteCB_OpponentMonFromBall(struct Sprite *sprite);
|
||||
void SpriteCB_BattleSpriteStartSlideLeft(struct Sprite *sprite);
|
||||
void SpriteCB_FaintSlideAnim(struct Sprite *sprite);
|
||||
|
@ -64,7 +64,6 @@ u8 GetBattlerForBattleScript(u8 caseId);
|
||||
void PressurePPLose(u8 target, u8 attacker, u16 move);
|
||||
void PressurePPLoseOnUsingPerishSong(u8 attacker);
|
||||
void PressurePPLoseOnUsingImprison(u8 attacker);
|
||||
void MarkAllBattlersForControllerExec(void); // unused
|
||||
void MarkBattlerForControllerExec(u8 battlerId);
|
||||
void MarkBattlerReceivedLinkData(u8 battlerId);
|
||||
void CancelMultiTurnMoves(u8 battlerId);
|
||||
|
@ -316,6 +316,11 @@
|
||||
#define FLEE_ITEM 1
|
||||
#define FLEE_ABILITY 2
|
||||
|
||||
// Return value for IsRunningFromBattleImpossible.
|
||||
#define BATTLE_RUN_SUCCESS 0
|
||||
#define BATTLE_RUN_FORBIDDEN 1
|
||||
#define BATTLE_RUN_FAILURE 2
|
||||
|
||||
#define B_WIN_TYPE_NORMAL 0
|
||||
#define B_WIN_TYPE_ARENA 1
|
||||
|
||||
|
@ -35,7 +35,7 @@ static void SaveArenaChallenge(void);
|
||||
static void SetArenaPrize(void);
|
||||
static void GiveArenaPrize(void);
|
||||
static void BufferArenaOpponentName(void);
|
||||
static void SpriteCb_JudgmentIcon(struct Sprite *sprite);
|
||||
static void SpriteCB_JudgmentIcon(struct Sprite *sprite);
|
||||
static void ShowJudgmentSprite(u8 x, u8 y, u8 category, u8 battler);
|
||||
|
||||
static const s8 sMindRatings[] =
|
||||
@ -456,7 +456,7 @@ static const struct SpriteTemplate sSpriteTemplate_JudgmentIcon =
|
||||
.anims = sJudgementIconAnimCmds,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCb_JudgmentIcon,
|
||||
.callback = SpriteCB_JudgmentIcon,
|
||||
};
|
||||
|
||||
static const struct CompressedSpriteSheet sBattleArenaJudgementSymbolsSpriteSheet[] =
|
||||
@ -679,7 +679,7 @@ static void ShowJudgmentSprite(u8 x, u8 y, u8 category, u8 battler)
|
||||
StartSpriteAnim(&gSprites[pointsPlayer], animNum);
|
||||
}
|
||||
|
||||
static void SpriteCb_JudgmentIcon(struct Sprite *sprite)
|
||||
static void SpriteCB_JudgmentIcon(struct Sprite *sprite)
|
||||
{
|
||||
if (gBattleCommunication[0] > 8)
|
||||
DestroySprite(sprite);
|
||||
|
@ -364,7 +364,7 @@ static void HandleInputChooseTarget(void)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8));
|
||||
EndBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX);
|
||||
PlayerBufferExecCompleted();
|
||||
@ -372,7 +372,7 @@ static void HandleInputChooseTarget(void)
|
||||
else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
|
||||
gBattlerControllerFuncs[gActiveBattler] = HandleInputChooseMove;
|
||||
DoBounceEffect(gActiveBattler, BOUNCE_HEALTHBOX, 7, 1);
|
||||
DoBounceEffect(gActiveBattler, BOUNCE_MON, 7, 1);
|
||||
@ -381,7 +381,7 @@ static void HandleInputChooseTarget(void)
|
||||
else if (JOY_NEW(DPAD_LEFT | DPAD_UP))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
|
||||
|
||||
do
|
||||
{
|
||||
@ -422,12 +422,12 @@ static void HandleInputChooseTarget(void)
|
||||
if (gAbsentBattlerFlags & gBitTable[gMultiUsePlayerCursor])
|
||||
i = 0;
|
||||
} while (i == 0);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_ShowAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_ShowAsMoveTarget;
|
||||
}
|
||||
else if (JOY_NEW(DPAD_RIGHT | DPAD_DOWN))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
|
||||
|
||||
do
|
||||
{
|
||||
@ -464,7 +464,7 @@ static void HandleInputChooseTarget(void)
|
||||
if (gAbsentBattlerFlags & gBitTable[gMultiUsePlayerCursor])
|
||||
i = 0;
|
||||
} while (i == 0);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_ShowAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_ShowAsMoveTarget;
|
||||
}
|
||||
}
|
||||
|
||||
@ -537,7 +537,7 @@ static void HandleInputChooseMove(void)
|
||||
else
|
||||
gMultiUsePlayerCursor = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
|
||||
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_ShowAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_ShowAsMoveTarget;
|
||||
}
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)
|
||||
|
@ -108,8 +108,8 @@ static u8 UpdateTourneyTreeCursor(u8);
|
||||
static void DecideRoundWinners(u8);
|
||||
static u8 GetOpposingNPCTournamentIdByRound(u8, u8);
|
||||
static void DrawTourneyAdvancementLine(u8, u8);
|
||||
static void SpriteCb_HorizontalScrollArrow(struct Sprite *);
|
||||
static void SpriteCb_VerticalScrollArrow(struct Sprite *);
|
||||
static void SpriteCB_HorizontalScrollArrow(struct Sprite *);
|
||||
static void SpriteCB_VerticalScrollArrow(struct Sprite *);
|
||||
static void InitDomeChallenge(void);
|
||||
static void GetDomeData(void);
|
||||
static void SetDomeData(void);
|
||||
@ -1089,7 +1089,7 @@ static const struct SpriteTemplate sHorizontalScrollArrowSpriteTemplate =
|
||||
.anims = sSpriteAnimTable_HorizontalScrollArrow,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCb_HorizontalScrollArrow
|
||||
.callback = SpriteCB_HorizontalScrollArrow
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sVerticalScrollArrowSpriteTemplate =
|
||||
@ -1100,7 +1100,7 @@ static const struct SpriteTemplate sVerticalScrollArrowSpriteTemplate =
|
||||
.anims = sSpriteAnimTable_VerticalScrollArrow,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCb_VerticalScrollArrow
|
||||
.callback = SpriteCB_VerticalScrollArrow
|
||||
};
|
||||
|
||||
// Organized by seed starting position, i.e. seed 0 battles seed 8 first
|
||||
@ -3115,7 +3115,7 @@ static void Task_ShowTourneyInfoCard(u8 taskId)
|
||||
// Note: Card scrolling up means the current card goes down and another one appears from top.
|
||||
// The same is true for scrolling left.
|
||||
// That means that the sprite needs to move with the moving card in the opposite scrolling direction.
|
||||
static void SpriteCb_TrainerIconCardScrollUp(struct Sprite *sprite)
|
||||
static void SpriteCB_TrainerIconCardScrollUp(struct Sprite *sprite)
|
||||
{
|
||||
sprite->y += 4;
|
||||
if (sprite->data[0] != 0)
|
||||
@ -3135,7 +3135,7 @@ static void SpriteCb_TrainerIconCardScrollUp(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_TrainerIconCardScrollDown(struct Sprite *sprite)
|
||||
static void SpriteCB_TrainerIconCardScrollDown(struct Sprite *sprite)
|
||||
{
|
||||
sprite->y -= 4;
|
||||
if (sprite->data[0] != 0)
|
||||
@ -3155,7 +3155,7 @@ static void SpriteCb_TrainerIconCardScrollDown(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_TrainerIconCardScrollLeft(struct Sprite *sprite)
|
||||
static void SpriteCB_TrainerIconCardScrollLeft(struct Sprite *sprite)
|
||||
{
|
||||
sprite->x += 4;
|
||||
if (sprite->data[0] != 0)
|
||||
@ -3175,7 +3175,7 @@ static void SpriteCb_TrainerIconCardScrollLeft(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_TrainerIconCardScrollRight(struct Sprite *sprite)
|
||||
static void SpriteCB_TrainerIconCardScrollRight(struct Sprite *sprite)
|
||||
{
|
||||
sprite->x -= 4;
|
||||
if (sprite->data[0] != 0)
|
||||
@ -3197,13 +3197,13 @@ static void SpriteCb_TrainerIconCardScrollRight(struct Sprite *sprite)
|
||||
|
||||
#define sMonIconStill data[3]
|
||||
|
||||
static void SpriteCb_MonIcon(struct Sprite *sprite)
|
||||
static void SpriteCB_MonIconDomeInfo(struct Sprite *sprite)
|
||||
{
|
||||
if (!sprite->sMonIconStill)
|
||||
UpdateMonIconFrame(sprite);
|
||||
}
|
||||
|
||||
static void SpriteCb_MonIconCardScrollUp(struct Sprite *sprite)
|
||||
static void SpriteCB_MonIconCardScrollUp(struct Sprite *sprite)
|
||||
{
|
||||
if (!sprite->sMonIconStill)
|
||||
UpdateMonIconFrame(sprite);
|
||||
@ -3213,7 +3213,7 @@ static void SpriteCb_MonIconCardScrollUp(struct Sprite *sprite)
|
||||
if (sprite->y >= -16)
|
||||
sprite->invisible = FALSE;
|
||||
if (++sprite->data[1] == 40)
|
||||
sprite->callback = SpriteCb_MonIcon;
|
||||
sprite->callback = SpriteCB_MonIconDomeInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3225,7 +3225,7 @@ static void SpriteCb_MonIconCardScrollUp(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_MonIconCardScrollDown(struct Sprite *sprite)
|
||||
static void SpriteCB_MonIconCardScrollDown(struct Sprite *sprite)
|
||||
{
|
||||
if (!sprite->sMonIconStill)
|
||||
UpdateMonIconFrame(sprite);
|
||||
@ -3235,7 +3235,7 @@ static void SpriteCb_MonIconCardScrollDown(struct Sprite *sprite)
|
||||
if (sprite->y <= 176)
|
||||
sprite->invisible = FALSE;
|
||||
if (++sprite->data[1] == 40)
|
||||
sprite->callback = SpriteCb_MonIcon;
|
||||
sprite->callback = SpriteCB_MonIconDomeInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3247,7 +3247,7 @@ static void SpriteCb_MonIconCardScrollDown(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_MonIconCardScrollLeft(struct Sprite *sprite)
|
||||
static void SpriteCB_MonIconCardScrollLeft(struct Sprite *sprite)
|
||||
{
|
||||
if (!sprite->sMonIconStill)
|
||||
UpdateMonIconFrame(sprite);
|
||||
@ -3257,7 +3257,7 @@ static void SpriteCb_MonIconCardScrollLeft(struct Sprite *sprite)
|
||||
if (sprite->x >= -16)
|
||||
sprite->invisible = FALSE;
|
||||
if (++sprite->data[1] == 64)
|
||||
sprite->callback = SpriteCb_MonIcon;
|
||||
sprite->callback = SpriteCB_MonIconDomeInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3269,7 +3269,7 @@ static void SpriteCb_MonIconCardScrollLeft(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_MonIconCardScrollRight(struct Sprite *sprite)
|
||||
static void SpriteCB_MonIconCardScrollRight(struct Sprite *sprite)
|
||||
{
|
||||
if (!sprite->sMonIconStill)
|
||||
UpdateMonIconFrame(sprite);
|
||||
@ -3279,7 +3279,7 @@ static void SpriteCb_MonIconCardScrollRight(struct Sprite *sprite)
|
||||
if (sprite->x <= DISPLAY_WIDTH + 16)
|
||||
sprite->invisible = FALSE;
|
||||
if (++sprite->data[1] == 64)
|
||||
sprite->callback = SpriteCb_MonIcon;
|
||||
sprite->callback = SpriteCB_MonIconDomeInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3291,7 +3291,7 @@ static void SpriteCb_MonIconCardScrollRight(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_HorizontalScrollArrow(struct Sprite *sprite)
|
||||
static void SpriteCB_HorizontalScrollArrow(struct Sprite *sprite)
|
||||
{
|
||||
int taskId1 = sprite->data[0];
|
||||
int arrId = gTasks[gTasks[taskId1].data[4]].data[1];
|
||||
@ -3360,7 +3360,7 @@ static void SpriteCb_HorizontalScrollArrow(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_VerticalScrollArrow(struct Sprite *sprite)
|
||||
static void SpriteCB_VerticalScrollArrow(struct Sprite *sprite)
|
||||
{
|
||||
int taskId1 = sprite->data[0];
|
||||
|
||||
@ -3526,7 +3526,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollUp;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollUp;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3537,7 +3537,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollUp;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollUp;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3550,7 +3550,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollUp;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollUp;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3561,7 +3561,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollUp;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollUp;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3642,7 +3642,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollDown;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollDown;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3653,7 +3653,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollDown;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollDown;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3666,7 +3666,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollDown;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollDown;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3677,7 +3677,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollDown;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollDown;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3725,7 +3725,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3736,7 +3736,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3749,7 +3749,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3760,7 +3760,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3808,7 +3808,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3819,7 +3819,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3832,7 +3832,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3843,7 +3843,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3889,7 +3889,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3900,7 +3900,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3913,7 +3913,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3924,7 +3924,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3972,7 +3972,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3983,7 +3983,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -3996,7 +3996,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -4007,7 +4007,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@ -4297,7 +4297,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
|
||||
if (trainerId == TRAINER_PLAYER)
|
||||
{
|
||||
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[trainerTourneyId][i],
|
||||
SpriteCb_MonIcon,
|
||||
SpriteCB_MonIconDomeInfo,
|
||||
x | sInfoTrainerMonX[i],
|
||||
y + sInfoTrainerMonY[i],
|
||||
0, 0, TRUE);
|
||||
@ -4306,7 +4306,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
|
||||
else if (trainerId == TRAINER_FRONTIER_BRAIN)
|
||||
{
|
||||
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[trainerTourneyId][i],
|
||||
SpriteCb_MonIcon,
|
||||
SpriteCB_MonIconDomeInfo,
|
||||
x | sInfoTrainerMonX[i],
|
||||
y + sInfoTrainerMonY[i],
|
||||
0, 0, TRUE);
|
||||
@ -4315,7 +4315,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
|
||||
else
|
||||
{
|
||||
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[DOME_MONS[trainerTourneyId][i]].species,
|
||||
SpriteCb_MonIcon,
|
||||
SpriteCB_MonIconDomeInfo,
|
||||
x | sInfoTrainerMonX[i],
|
||||
y + sInfoTrainerMonY[i],
|
||||
0, 0, TRUE);
|
||||
@ -4786,7 +4786,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
if (trainerIds[0] == TRAINER_PLAYER)
|
||||
{
|
||||
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[0]][i],
|
||||
SpriteCb_MonIcon,
|
||||
SpriteCB_MonIconDomeInfo,
|
||||
x | sLeftTrainerMonX[i],
|
||||
y + sLeftTrainerMonY[i],
|
||||
0, 0, TRUE);
|
||||
@ -4795,7 +4795,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
else if (trainerIds[0] == TRAINER_FRONTIER_BRAIN)
|
||||
{
|
||||
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[0]][i],
|
||||
SpriteCb_MonIcon,
|
||||
SpriteCB_MonIconDomeInfo,
|
||||
x | sLeftTrainerMonX[i],
|
||||
y + sLeftTrainerMonY[i],
|
||||
0, 0, TRUE);
|
||||
@ -4804,7 +4804,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
else
|
||||
{
|
||||
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[DOME_MONS[tournamentIds[0]][i]].species,
|
||||
SpriteCb_MonIcon,
|
||||
SpriteCB_MonIconDomeInfo,
|
||||
x | sLeftTrainerMonX[i],
|
||||
y + sLeftTrainerMonY[i],
|
||||
0, 0, TRUE);
|
||||
@ -4826,7 +4826,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
if (trainerIds[1] == TRAINER_PLAYER)
|
||||
{
|
||||
sInfoCard->spriteIds[5 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[1]][i],
|
||||
SpriteCb_MonIcon,
|
||||
SpriteCB_MonIconDomeInfo,
|
||||
x | sRightTrainerMonX[i],
|
||||
y + sRightTrainerMonY[i],
|
||||
0, 0, TRUE);
|
||||
@ -4835,7 +4835,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
else if (trainerIds[1] == TRAINER_FRONTIER_BRAIN)
|
||||
{
|
||||
sInfoCard->spriteIds[5 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[1]][i],
|
||||
SpriteCb_MonIcon,
|
||||
SpriteCB_MonIconDomeInfo,
|
||||
x | sRightTrainerMonX[i],
|
||||
y + sRightTrainerMonY[i],
|
||||
0, 0, TRUE);
|
||||
@ -4844,7 +4844,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
else
|
||||
{
|
||||
sInfoCard->spriteIds[5 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[DOME_MONS[tournamentIds[1]][i]].species,
|
||||
SpriteCb_MonIcon,
|
||||
SpriteCB_MonIconDomeInfo,
|
||||
x | sRightTrainerMonX[i],
|
||||
y + sRightTrainerMonY[i],
|
||||
0, 0, TRUE);
|
||||
|
@ -27,8 +27,8 @@
|
||||
#include "constants/battle_palace.h"
|
||||
|
||||
extern const u8 gBattlePalaceNatureToMoveTarget[];
|
||||
extern const u8 * const gBattleAnims_General[];
|
||||
extern const u8 * const gBattleAnims_Special[];
|
||||
extern const u8 *const gBattleAnims_General[];
|
||||
extern const u8 *const gBattleAnims_Special[];
|
||||
extern const struct CompressedSpriteSheet gSpriteSheet_EnemyShadow;
|
||||
extern const struct SpriteTemplate gSpriteTemplate_EnemyShadow;
|
||||
|
||||
|
@ -78,12 +78,12 @@ static void EndLinkBattleInSteps(void);
|
||||
static void CB2_InitAskRecordBattle(void);
|
||||
static void CB2_AskRecordBattle(void);
|
||||
static void AskRecordBattle(void);
|
||||
static void SpriteCb_MoveWildMonToRight(struct Sprite *sprite);
|
||||
static void SpriteCb_WildMonShowHealthbox(struct Sprite *sprite);
|
||||
static void SpriteCb_WildMonAnimate(struct Sprite *sprite);
|
||||
static void SpriteCB_MoveWildMonToRight(struct Sprite *sprite);
|
||||
static void SpriteCB_WildMonShowHealthbox(struct Sprite *sprite);
|
||||
static void SpriteCB_WildMonAnimate(struct Sprite *sprite);
|
||||
static void SpriteCB_Flicker(struct Sprite *sprite);
|
||||
static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite);
|
||||
static void SpriteCb_BlinkVisible(struct Sprite *sprite);
|
||||
static void SpriteCB_BlinkVisible(struct Sprite *sprite);
|
||||
static void SpriteCB_Idle(struct Sprite *sprite);
|
||||
static void SpriteCB_BattleSpriteSlideLeft(struct Sprite *sprite);
|
||||
static void TurnValuesCleanUp(bool8 var0);
|
||||
@ -557,7 +557,7 @@ const u8 gStatusConditionString_IceJpn[] = _("こおり$$$$");
|
||||
const u8 gStatusConditionString_ConfusionJpn[] = _("こんらん$$$");
|
||||
const u8 gStatusConditionString_LoveJpn[] = _("メロメロ$$$");
|
||||
|
||||
const u8 * const gStatusConditionStringsTable[][2] =
|
||||
const u8 *const gStatusConditionStringsTable[][2] =
|
||||
{
|
||||
{gStatusConditionString_PoisonJpn, gText_Poison},
|
||||
{gStatusConditionString_SleepJpn, gText_Sleep},
|
||||
@ -816,8 +816,8 @@ static void SetAllPlayersBerryData(void)
|
||||
gEnigmaBerries[2].itemEffect[i] = 0;
|
||||
}
|
||||
|
||||
gEnigmaBerries[0].holdEffect = 0;
|
||||
gEnigmaBerries[2].holdEffect = 0;
|
||||
gEnigmaBerries[0].holdEffect = HOLD_EFFECT_NONE;
|
||||
gEnigmaBerries[2].holdEffect = HOLD_EFFECT_NONE;
|
||||
gEnigmaBerries[0].holdEffectParam = 0;
|
||||
gEnigmaBerries[2].holdEffectParam = 0;
|
||||
}
|
||||
@ -2650,38 +2650,38 @@ u32 GetBattleWindowTemplatePixelWidth(u32 windowsType, u32 tableId)
|
||||
#define sBattler data[0]
|
||||
#define sSpeciesId data[2]
|
||||
|
||||
void SpriteCb_WildMon(struct Sprite *sprite)
|
||||
void SpriteCB_WildMon(struct Sprite *sprite)
|
||||
{
|
||||
sprite->callback = SpriteCb_MoveWildMonToRight;
|
||||
sprite->callback = SpriteCB_MoveWildMonToRight;
|
||||
StartSpriteAnimIfDifferent(sprite, 0);
|
||||
BeginNormalPaletteFade(0x20000, 0, 10, 10, RGB(8, 8, 8));
|
||||
}
|
||||
|
||||
static void SpriteCb_MoveWildMonToRight(struct Sprite *sprite)
|
||||
static void SpriteCB_MoveWildMonToRight(struct Sprite *sprite)
|
||||
{
|
||||
if ((gIntroSlideFlags & 1) == 0)
|
||||
{
|
||||
sprite->x2 += 2;
|
||||
if (sprite->x2 == 0)
|
||||
{
|
||||
sprite->callback = SpriteCb_WildMonShowHealthbox;
|
||||
sprite->callback = SpriteCB_WildMonShowHealthbox;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_WildMonShowHealthbox(struct Sprite *sprite)
|
||||
static void SpriteCB_WildMonShowHealthbox(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->animEnded)
|
||||
{
|
||||
StartHealthboxSlideIn(sprite->sBattler);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[sprite->sBattler]);
|
||||
sprite->callback = SpriteCb_WildMonAnimate;
|
||||
sprite->callback = SpriteCB_WildMonAnimate;
|
||||
StartSpriteAnimIfDifferent(sprite, 0);
|
||||
BeginNormalPaletteFade(0x20000, 0, 10, 0, RGB(8, 8, 8));
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_WildMonAnimate(struct Sprite *sprite)
|
||||
static void SpriteCB_WildMonAnimate(struct Sprite *sprite)
|
||||
{
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
@ -2798,14 +2798,14 @@ static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite)
|
||||
}
|
||||
|
||||
// Used when selecting a move, which can hit multiple targets, in double battles.
|
||||
void SpriteCb_ShowAsMoveTarget(struct Sprite *sprite)
|
||||
void SpriteCB_ShowAsMoveTarget(struct Sprite *sprite)
|
||||
{
|
||||
sprite->data[3] = 8;
|
||||
sprite->data[4] = sprite->invisible;
|
||||
sprite->callback = SpriteCb_BlinkVisible;
|
||||
sprite->callback = SpriteCB_BlinkVisible;
|
||||
}
|
||||
|
||||
static void SpriteCb_BlinkVisible(struct Sprite *sprite)
|
||||
static void SpriteCB_BlinkVisible(struct Sprite *sprite)
|
||||
{
|
||||
if (--sprite->data[3] == 0)
|
||||
{
|
||||
@ -2814,7 +2814,7 @@ static void SpriteCb_BlinkVisible(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
void SpriteCb_HideAsMoveTarget(struct Sprite *sprite)
|
||||
void SpriteCB_HideAsMoveTarget(struct Sprite *sprite)
|
||||
{
|
||||
sprite->invisible = sprite->data[4];
|
||||
sprite->data[4] = FALSE;
|
||||
@ -3038,13 +3038,13 @@ static void BattleStartClearSetData(void)
|
||||
|
||||
gDisableStructs[i].isFirstTurn = 2;
|
||||
sUnusedBattlersArray[i] = 0;
|
||||
gLastMoves[i] = 0;
|
||||
gLastLandedMoves[i] = 0;
|
||||
gLastMoves[i] = MOVE_NONE;
|
||||
gLastLandedMoves[i] = MOVE_NONE;
|
||||
gLastHitByType[i] = 0;
|
||||
gLastResultingMoves[i] = 0;
|
||||
gLastResultingMoves[i] = MOVE_NONE;
|
||||
gLastHitBy[i] = 0xFF;
|
||||
gLockedMoves[i] = 0;
|
||||
gLastPrintedMoves[i] = 0;
|
||||
gLockedMoves[i] = MOVE_NONE;
|
||||
gLastPrintedMoves[i] = MOVE_NONE;
|
||||
gBattleResources->flags->flags[i] = 0;
|
||||
gPalaceSelectionBattleScripts[i] = 0;
|
||||
}
|
||||
@ -3105,10 +3105,10 @@ static void BattleStartClearSetData(void)
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
*((u8 *)gBattleStruct->lastTakenMove + i) = 0;
|
||||
*((u8 *)gBattleStruct->usedHeldItems + i) = 0;
|
||||
*((u8 *)gBattleStruct->choicedMove + i) = 0;
|
||||
*((u8 *)gBattleStruct->changedItems + i) = 0;
|
||||
*((u8 *)gBattleStruct->lastTakenMove + i) = MOVE_NONE;
|
||||
*((u8 *)gBattleStruct->usedHeldItems + i) = ITEM_NONE;
|
||||
*((u8 *)gBattleStruct->choicedMove + i) = MOVE_NONE;
|
||||
*((u8 *)gBattleStruct->changedItems + i) = ITEM_NONE;
|
||||
*(i + 0 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i + 1 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i + 2 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
@ -3205,15 +3205,15 @@ void SwitchInClearSetData(void)
|
||||
gMoveResultFlags = 0;
|
||||
gDisableStructs[gActiveBattler].isFirstTurn = 2;
|
||||
gDisableStructs[gActiveBattler].truantSwitchInHack = disableStructCopy.truantSwitchInHack;
|
||||
gLastMoves[gActiveBattler] = 0;
|
||||
gLastLandedMoves[gActiveBattler] = 0;
|
||||
gLastMoves[gActiveBattler] = MOVE_NONE;
|
||||
gLastLandedMoves[gActiveBattler] = MOVE_NONE;
|
||||
gLastHitByType[gActiveBattler] = 0;
|
||||
gLastResultingMoves[gActiveBattler] = 0;
|
||||
gLastPrintedMoves[gActiveBattler] = 0;
|
||||
gLastResultingMoves[gActiveBattler] = MOVE_NONE;
|
||||
gLastPrintedMoves[gActiveBattler] = MOVE_NONE;
|
||||
gLastHitBy[gActiveBattler] = 0xFF;
|
||||
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = 0;
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = 0;
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = MOVE_NONE;
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = MOVE_NONE;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
@ -3229,18 +3229,18 @@ void SwitchInClearSetData(void)
|
||||
{
|
||||
if (i != gActiveBattler && GetBattlerSide(i) != GetBattlerSide(gActiveBattler))
|
||||
{
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 0) = 0;
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 1) = 0;
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 0) = MOVE_NONE;
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 1) = MOVE_NONE;
|
||||
}
|
||||
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
}
|
||||
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = 0;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = MOVE_NONE;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = MOVE_NONE;
|
||||
|
||||
gBattleResources->flags->flags[gActiveBattler] = 0;
|
||||
gCurrentMove = 0;
|
||||
gCurrentMove = MOVE_NONE;
|
||||
gBattleStruct->arenaTurnCounter = 0xFF;
|
||||
|
||||
ClearBattlerMoveHistory(gActiveBattler);
|
||||
@ -3297,18 +3297,18 @@ void FaintClearSetData(void)
|
||||
|
||||
gDisableStructs[gActiveBattler].isFirstTurn = 2;
|
||||
|
||||
gLastMoves[gActiveBattler] = 0;
|
||||
gLastLandedMoves[gActiveBattler] = 0;
|
||||
gLastMoves[gActiveBattler] = MOVE_NONE;
|
||||
gLastLandedMoves[gActiveBattler] = MOVE_NONE;
|
||||
gLastHitByType[gActiveBattler] = 0;
|
||||
gLastResultingMoves[gActiveBattler] = 0;
|
||||
gLastPrintedMoves[gActiveBattler] = 0;
|
||||
gLastResultingMoves[gActiveBattler] = MOVE_NONE;
|
||||
gLastPrintedMoves[gActiveBattler] = MOVE_NONE;
|
||||
gLastHitBy[gActiveBattler] = 0xFF;
|
||||
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = 0;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = MOVE_NONE;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = MOVE_NONE;
|
||||
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = 0;
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = 0;
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = MOVE_NONE;
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = MOVE_NONE;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
@ -3324,8 +3324,8 @@ void FaintClearSetData(void)
|
||||
{
|
||||
if (i != gActiveBattler && GetBattlerSide(i) != GetBattlerSide(gActiveBattler))
|
||||
{
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 0) = 0;
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 1) = 0;
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 0) = MOVE_NONE;
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 1) = MOVE_NONE;
|
||||
}
|
||||
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
@ -3371,8 +3371,8 @@ static void BattleIntroPrepareBackgroundSlide(void)
|
||||
BtlController_EmitIntroSlide(BUFFER_A, gBattleTerrain);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
gBattleMainFunc = BattleIntroDrawTrainersOrMonsSprites;
|
||||
gBattleCommunication[0] = 0;
|
||||
gBattleCommunication[1] = 0;
|
||||
gBattleCommunication[MULTIUSE_STATE] = 0;
|
||||
gBattleCommunication[SPRITES_INIT_STATE1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3387,7 +3387,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
|
||||
for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++)
|
||||
{
|
||||
if ((gBattleTypeFlags & BATTLE_TYPE_SAFARI)
|
||||
&& GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
&& GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
{
|
||||
ptr = (u8 *)&gBattleMons[gActiveBattler];
|
||||
for (i = 0; i < sizeof(struct BattlePokemon); i++)
|
||||
@ -3545,7 +3545,6 @@ static void BattleIntroDrawPartySummaryScreens(void)
|
||||
|
||||
gBattleMainFunc = BattleIntroPrintWildMonAttacked;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void BattleIntroPrintTrainerWantsToBattle(void)
|
||||
@ -3839,7 +3838,7 @@ static void TryDoEventsBeforeFirstTurn(void)
|
||||
|
||||
gBattleStruct->switchInAbilitiesCounter++;
|
||||
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
return;
|
||||
}
|
||||
if (AbilityBattleEffects(ABILITYEFFECT_INTIMIDATE1, 0, 0, 0, 0) != 0)
|
||||
@ -3854,7 +3853,7 @@ static void TryDoEventsBeforeFirstTurn(void)
|
||||
|
||||
gBattleStruct->switchInItemsCounter++;
|
||||
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||
@ -3997,11 +3996,11 @@ u8 IsRunningFromBattleImpossible(void)
|
||||
gPotentialItemEffectBattler = gActiveBattler;
|
||||
|
||||
if (holdEffect == HOLD_EFFECT_CAN_ALWAYS_RUN)
|
||||
return 0;
|
||||
return BATTLE_RUN_SUCCESS;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
|
||||
return 0;
|
||||
return BATTLE_RUN_SUCCESS;
|
||||
if (gBattleMons[gActiveBattler].ability == ABILITY_RUN_AWAY)
|
||||
return 0;
|
||||
return BATTLE_RUN_SUCCESS;
|
||||
|
||||
side = GetBattlerSide(gActiveBattler);
|
||||
|
||||
@ -4013,7 +4012,7 @@ u8 IsRunningFromBattleImpossible(void)
|
||||
gBattleScripting.battler = i;
|
||||
gLastUsedAbility = gBattleMons[i].ability;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
|
||||
return 2;
|
||||
return BATTLE_RUN_FAILURE;
|
||||
}
|
||||
if (side != GetBattlerSide(i)
|
||||
&& gBattleMons[gActiveBattler].ability != ABILITY_LEVITATE
|
||||
@ -4023,7 +4022,7 @@ u8 IsRunningFromBattleImpossible(void)
|
||||
gBattleScripting.battler = i;
|
||||
gLastUsedAbility = gBattleMons[i].ability;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
|
||||
return 2;
|
||||
return BATTLE_RUN_FAILURE;
|
||||
}
|
||||
}
|
||||
i = AbilityBattleEffects(ABILITYEFFECT_CHECK_FIELD_EXCEPT_BATTLER, gActiveBattler, ABILITY_MAGNET_PULL, 0, 0);
|
||||
@ -4032,20 +4031,20 @@ u8 IsRunningFromBattleImpossible(void)
|
||||
gBattleScripting.battler = i - 1;
|
||||
gLastUsedAbility = gBattleMons[i - 1].ability;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
|
||||
return 2;
|
||||
return BATTLE_RUN_FAILURE;
|
||||
}
|
||||
if ((gBattleMons[gActiveBattler].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED))
|
||||
|| (gStatuses3[gActiveBattler] & STATUS3_ROOTED))
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_ESCAPE;
|
||||
return 1;
|
||||
return BATTLE_RUN_FORBIDDEN;
|
||||
}
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE)
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DONT_LEAVE_BIRCH;
|
||||
return 1;
|
||||
return BATTLE_RUN_FORBIDDEN;
|
||||
}
|
||||
return 0;
|
||||
return BATTLE_RUN_SUCCESS;
|
||||
}
|
||||
|
||||
void SwitchPartyOrder(u8 battler)
|
||||
@ -4301,7 +4300,7 @@ static void HandleTurnActionSelectionState(void)
|
||||
BattleScriptExecute(BattleScript_PrintCantRunFromTrainer);
|
||||
gBattleCommunication[gActiveBattler] = STATE_BEFORE_ACTION_CHOSEN;
|
||||
}
|
||||
else if (IsRunningFromBattleImpossible()
|
||||
else if (IsRunningFromBattleImpossible() != BATTLE_RUN_SUCCESS
|
||||
&& gBattleBufferB[gActiveBattler][1] == B_ACTION_RUN)
|
||||
{
|
||||
gSelectionBattleScripts[gActiveBattler] = BattleScript_PrintCantEscapeFromBattle;
|
||||
|
@ -431,7 +431,7 @@ static const u8 sText_SpDef2[] = _("SP. DEF");
|
||||
static const u8 sText_Accuracy[] = _("accuracy");
|
||||
static const u8 sText_Evasiveness[] = _("evasiveness");
|
||||
|
||||
const u8 * const gStatNamesTable[NUM_BATTLE_STATS] =
|
||||
const u8 *const gStatNamesTable[NUM_BATTLE_STATS] =
|
||||
{
|
||||
[STAT_HP] = sText_HP2,
|
||||
[STAT_ATK] = sText_Attack2,
|
||||
@ -449,7 +449,7 @@ 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[FLAVOR_COUNT] =
|
||||
const u8 *const gPokeblockWasTooXStringTable[FLAVOR_COUNT] =
|
||||
{
|
||||
[FLAVOR_SPICY] = sText_PokeblockWasTooSpicy,
|
||||
[FLAVOR_DRY] = sText_PokeblockWasTooDry,
|
||||
@ -514,7 +514,7 @@ static const u8 sText_Trainer2WinText[];
|
||||
static const u8 sText_TwoInGameTrainersDefeated[];
|
||||
static const u8 sText_Trainer2LoseText[];
|
||||
|
||||
const u8 * const gBattleStringsTable[BATTLESTRINGS_COUNT - BATTLESTRINGS_TABLE_START] =
|
||||
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT - BATTLESTRINGS_TABLE_START] =
|
||||
{
|
||||
[STRINGID_TRAINER1LOSETEXT - BATTLESTRINGS_TABLE_START] = sText_Trainer1LoseText,
|
||||
[STRINGID_PKMNGAINEDEXP - BATTLESTRINGS_TABLE_START] = sText_PkmnGainedEXP,
|
||||
@ -1293,7 +1293,7 @@ static const u8 sText_SpAtk[] = _("SP. ATK");
|
||||
static const u8 sText_SpDef[] = _("SP. DEF");
|
||||
|
||||
// Unused
|
||||
static const u8 * const sStatNamesTable2[] =
|
||||
static const u8 *const sStatNamesTable2[] =
|
||||
{
|
||||
sText_HP, sText_SpAtk, sText_Attack,
|
||||
sText_SpDef, sText_Defense, sText_Speed
|
||||
@ -1405,7 +1405,7 @@ static const u8 sText_LostToOpponentByReferee[] = _("{B_PLAYER_MON1_NAME} lost t
|
||||
static const u8 sText_TiedOpponentByReferee[] = _("{B_PLAYER_MON1_NAME} tied the opponent\n{B_OPPONENT_MON1_NAME} in a REFEREE's decision!");
|
||||
static const u8 sText_RefCommenceBattle[] = _("REFEREE: {B_PLAYER_MON1_NAME} VS {B_OPPONENT_MON1_NAME}!\nCommence battling!");
|
||||
|
||||
const u8 * const gRefereeStringsTable[] =
|
||||
const u8 *const gRefereeStringsTable[] =
|
||||
{
|
||||
[B_MSG_REF_NOTHING_IS_DECIDED] = sText_RefIfNothingIsDecided,
|
||||
[B_MSG_REF_THATS_IT] = sText_RefThatsIt,
|
||||
|
@ -471,7 +471,7 @@ bool8 TryRunFromBattle(u8 battler)
|
||||
gBattleStruct->runTries++;
|
||||
}
|
||||
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
gCurrentTurnActionNumber = gBattlersCount;
|
||||
gBattleOutcome = B_OUTCOME_RAN;
|
||||
@ -823,7 +823,8 @@ void PressurePPLoseOnUsingPerishSong(u8 attacker)
|
||||
}
|
||||
}
|
||||
|
||||
void MarkAllBattlersForControllerExec(void) // unused
|
||||
// Unused
|
||||
static void MarkAllBattlersForControllerExec(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1220,7 +1221,7 @@ u8 DoFieldEndTurnEffects(void)
|
||||
}
|
||||
}
|
||||
gBattleStruct->turnSideTracker++;
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
break;
|
||||
}
|
||||
if (!effect)
|
||||
@ -1246,7 +1247,7 @@ u8 DoFieldEndTurnEffects(void)
|
||||
}
|
||||
}
|
||||
gBattleStruct->turnSideTracker++;
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
break;
|
||||
}
|
||||
if (!effect)
|
||||
@ -1270,7 +1271,7 @@ u8 DoFieldEndTurnEffects(void)
|
||||
effect++;
|
||||
}
|
||||
gBattleStruct->turnSideTracker++;
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
break;
|
||||
}
|
||||
if (!effect)
|
||||
@ -1294,7 +1295,7 @@ u8 DoFieldEndTurnEffects(void)
|
||||
}
|
||||
}
|
||||
gBattleStruct->turnSideTracker++;
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
break;
|
||||
}
|
||||
if (!effect)
|
||||
@ -1316,7 +1317,7 @@ u8 DoFieldEndTurnEffects(void)
|
||||
effect++;
|
||||
}
|
||||
gBattleStruct->turnSideTracker++;
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
break;
|
||||
}
|
||||
if (!effect)
|
||||
@ -1687,12 +1688,12 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
}
|
||||
if (i == MAX_MON_MOVES) // pokemon does not have the disabled move anymore
|
||||
{
|
||||
gDisableStructs[gActiveBattler].disabledMove = 0;
|
||||
gDisableStructs[gActiveBattler].disabledMove = MOVE_NONE;
|
||||
gDisableStructs[gActiveBattler].disableTimer = 0;
|
||||
}
|
||||
else if (--gDisableStructs[gActiveBattler].disableTimer == 0) // disable ends
|
||||
{
|
||||
gDisableStructs[gActiveBattler].disabledMove = 0;
|
||||
gDisableStructs[gActiveBattler].disabledMove = MOVE_NONE;
|
||||
BattleScriptExecute(BattleScript_DisabledNoMore);
|
||||
effect++;
|
||||
}
|
||||
@ -1704,13 +1705,13 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
{
|
||||
if (gBattleMons[gActiveBattler].moves[gDisableStructs[gActiveBattler].encoredMovePos] != gDisableStructs[gActiveBattler].encoredMove) // pokemon does not have the encored move anymore
|
||||
{
|
||||
gDisableStructs[gActiveBattler].encoredMove = 0;
|
||||
gDisableStructs[gActiveBattler].encoredMove = MOVE_NONE;
|
||||
gDisableStructs[gActiveBattler].encoreTimer = 0;
|
||||
}
|
||||
else if (--gDisableStructs[gActiveBattler].encoreTimer == 0
|
||||
|| gBattleMons[gActiveBattler].pp[gDisableStructs[gActiveBattler].encoredMovePos] == 0)
|
||||
{
|
||||
gDisableStructs[gActiveBattler].encoredMove = 0;
|
||||
gDisableStructs[gActiveBattler].encoredMove = MOVE_NONE;
|
||||
gDisableStructs[gActiveBattler].encoreTimer = 0;
|
||||
BattleScriptExecute(BattleScript_EncoredNoMore);
|
||||
effect++;
|
||||
@ -2103,7 +2104,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
gBattleStruct->atkCancellerTracker++;
|
||||
break;
|
||||
case CANCELLER_DISABLED: // disabled move
|
||||
if (gDisableStructs[gBattlerAttacker].disabledMove == gCurrentMove && gDisableStructs[gBattlerAttacker].disabledMove != 0)
|
||||
if (gDisableStructs[gBattlerAttacker].disabledMove == gCurrentMove && gDisableStructs[gBattlerAttacker].disabledMove != MOVE_NONE)
|
||||
{
|
||||
gProtectStructs[gBattlerAttacker].usedDisabledMove = 1;
|
||||
gBattleScripting.battler = gBattlerAttacker;
|
||||
@ -2172,7 +2173,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS) && (Random() % 4) == 0)
|
||||
{
|
||||
gProtectStructs[gBattlerAttacker].prlzImmobility = 1;
|
||||
// This is removed in Emerald for some reason
|
||||
// This is removed in FRLG and Emerald for some reason
|
||||
//CancelMultiTurnMoves(gBattlerAttacker);
|
||||
gBattlescriptCurrInstr = BattleScript_MoveUsedIsParalyzed;
|
||||
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
|
||||
@ -2210,7 +2211,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is removed in Emerald for some reason
|
||||
// This is removed in FRLG and Emerald for some reason
|
||||
//gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_MULTIPLETURNS;
|
||||
if (gTakenDmg[gBattlerAttacker])
|
||||
{
|
||||
@ -2506,7 +2507,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = GetCurrentWeather();
|
||||
BattleScriptPushCursorAndCallback(BattleScript_OverworldWeatherStarts);
|
||||
@ -2548,7 +2549,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
break;
|
||||
case ABILITY_FORECAST:
|
||||
effect = CastformDataTypeChange(battler);
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
BattleScriptPushCursorAndCallback(BattleScript_CastformChange);
|
||||
gBattleScripting.battler = battler;
|
||||
@ -2569,7 +2570,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
for (target1 = 0; target1 < gBattlersCount; target1++)
|
||||
{
|
||||
effect = CastformDataTypeChange(target1);
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
BattleScriptPushCursorAndCallback(BattleScript_CastformChange);
|
||||
gBattleScripting.battler = target1;
|
||||
@ -2909,7 +2910,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
switch (effect)
|
||||
{
|
||||
@ -2940,7 +2941,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
if (gBattleMons[battler].ability == ABILITY_FORECAST)
|
||||
{
|
||||
effect = CastformDataTypeChange(battler);
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
BattleScriptPushCursorAndCallback(BattleScript_CastformChange);
|
||||
gBattleScripting.battler = battler;
|
||||
@ -3040,7 +3041,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
effect++;
|
||||
}
|
||||
}
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
BattleScriptPushCursorAndCallback(BattleScript_TraceActivates);
|
||||
gStatuses3[i] &= ~STATUS3_TRACE;
|
||||
@ -3300,7 +3301,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
effect = ITEM_STATS_CHANGE;
|
||||
}
|
||||
}
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
gBattleScripting.battler = battlerId;
|
||||
gPotentialItemEffectBattler = battlerId;
|
||||
@ -3371,7 +3372,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
effect = ITEM_STATS_CHANGE;
|
||||
}
|
||||
}
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
gBattleScripting.battler = battlerId;
|
||||
gPotentialItemEffectBattler = battlerId;
|
||||
@ -3583,7 +3584,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
gBattleScripting.battler = battlerId;
|
||||
gPotentialItemEffectBattler = battlerId;
|
||||
@ -3727,7 +3728,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
effect = ITEM_STATS_CHANGE;
|
||||
}
|
||||
}
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
gBattleScripting.battler = battlerId;
|
||||
gPotentialItemEffectBattler = battlerId;
|
||||
@ -3737,7 +3738,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
gBattleScripting.battler = battlerId;
|
||||
gPotentialItemEffectBattler = battlerId;
|
||||
|
@ -226,7 +226,7 @@ bool8 SetUpFieldMove_Cut(void)
|
||||
y = gPlayerFacingPosition.y + sHyperCutStruct[i].y;
|
||||
tileCuttable = TRUE;
|
||||
|
||||
for (j = 0; j < 2; ++j)
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
if (sHyperCutStruct[i].unk2[j] == 0) break; // one line required to match -g
|
||||
if (cutTiles[(u8)(sHyperCutStruct[i].unk2[j] - 1)] == FALSE)
|
||||
|
@ -164,7 +164,7 @@ u16 rfu_initializeAPI(u32 *APIBuffer, u16 buffByteSize, IntrFunc *sioIntrTable_p
|
||||
gRfuFixed = (void *)APIBuffer + 0xdc; // + sizeof(*gRfuStatic)
|
||||
gRfuSlotStatusNI[0] = (void *)APIBuffer + 0x1bc; // + sizeof(*gRfuFixed)
|
||||
gRfuSlotStatusUNI[0] = (void *)APIBuffer + 0x37c; // + sizeof(*gRfuSlotStatusNI[0]) * RFU_CHILD_MAX
|
||||
for (i = 1; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 1; i < RFU_CHILD_MAX; i++)
|
||||
{
|
||||
gRfuSlotStatusNI[i] = &gRfuSlotStatusNI[i - 1][1];
|
||||
gRfuSlotStatusUNI[i] = &gRfuSlotStatusUNI[i - 1][1];
|
||||
@ -173,7 +173,7 @@ u16 rfu_initializeAPI(u32 *APIBuffer, u16 buffByteSize, IntrFunc *sioIntrTable_p
|
||||
gRfuFixed->STWIBuffer = (struct RfuIntrStruct *)&gRfuSlotStatusUNI[3][1];
|
||||
STWI_init_all((struct RfuIntrStruct *)&gRfuSlotStatusUNI[3][1], sioIntrTable_p, copyInterruptToRam);
|
||||
rfu_STC_clearAPIVariables();
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
{
|
||||
gRfuSlotStatusNI[i]->recvBuffer = NULL;
|
||||
gRfuSlotStatusNI[i]->recvBufferSize = 0;
|
||||
@ -214,7 +214,7 @@ static void rfu_STC_clearAPIVariables(void)
|
||||
gRfuLinkStatus->parentChild = MODE_NEUTRAL;
|
||||
rfu_clearAllSlot();
|
||||
gRfuStatic->SCStartFlag = 0;
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
gRfuStatic->cidBak[i] = 0;
|
||||
REG_IME = IMEBackup;
|
||||
}
|
||||
@ -294,7 +294,7 @@ static void rfu_CB_defaultCallback(u8 reqCommand, u16 reqResult)
|
||||
if (gRfuStatic->flags & 8)
|
||||
gRfuFixed->reqCallback(reqCommand, reqResult);
|
||||
bmSlotFlags = gRfuLinkStatus->connSlotFlag | gRfuLinkStatus->linkLossSlotFlag;
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
if ((bmSlotFlags >> i) & 1)
|
||||
rfu_STC_removeLinkData(i, 1);
|
||||
gRfuLinkStatus->parentChild = MODE_NEUTRAL;
|
||||
@ -351,7 +351,7 @@ u16 rfu_MBOOT_CHILD_inheritanceLinkStatus(void)
|
||||
|
||||
// The size of struct RfuLinkStatus is 180
|
||||
checksum = 0;
|
||||
for (i = 0; i < 180/2; ++i)
|
||||
for (i = 0; i < 180/2; i++)
|
||||
checksum += *mb_buff_iwram_p++;
|
||||
if (checksum != *(u16 *)0x30000FA)
|
||||
return 1;
|
||||
@ -455,11 +455,11 @@ void rfu_REQ_configGameData(u8 mbootFlag, u16 serialNo, const u8 *gname, const u
|
||||
packet[1] = serialNo >> 8;
|
||||
if (mbootFlag != 0)
|
||||
packet[1] = (serialNo >> 8) | 0x80;
|
||||
for (i = 2; i < 15; ++i)
|
||||
for (i = 2; i < 15; i++)
|
||||
packet[i] = *gname++;
|
||||
check_sum = 0;
|
||||
unameBackup = uname;
|
||||
for (i = 0; i < 8; ++i)
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
check_sum += *unameBackup++;
|
||||
check_sum += *gnameBackup++;
|
||||
@ -493,10 +493,10 @@ static void rfu_CB_configGameData(u8 reqCommand, u16 reqResult)
|
||||
{
|
||||
gRfuLinkStatus->my.mbootFlag = 0;
|
||||
}
|
||||
for (i = 0; i < RFU_GAME_NAME_LENGTH; ++i)
|
||||
for (i = 0; i < RFU_GAME_NAME_LENGTH; i++)
|
||||
gRfuLinkStatus->my.gname[i] = *gname_uname_p++;
|
||||
++gname_uname_p;
|
||||
for (i = 0; i < PLAYER_NAME_LENGTH + 1; ++i)
|
||||
for (i = 0; i < PLAYER_NAME_LENGTH + 1; i++)
|
||||
gRfuLinkStatus->my.uname[i] = *gname_uname_p++;
|
||||
}
|
||||
rfu_STC_REQ_callback(reqCommand, reqResult);
|
||||
@ -546,7 +546,7 @@ static void rfu_STC_clearLinkStatus(u8 parentChild)
|
||||
CpuFill16(0, gRfuLinkStatus->partner, sizeof(gRfuLinkStatus->partner));
|
||||
gRfuLinkStatus->findParentCount = 0;
|
||||
}
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
gRfuLinkStatus->strength[i] = 0;
|
||||
gRfuLinkStatus->connCount = 0;
|
||||
gRfuLinkStatus->connSlotFlag = 0;
|
||||
@ -609,7 +609,7 @@ static void rfu_STC_readChildList(void)
|
||||
if (STWI_poll_CommandEnd() == 0)
|
||||
{
|
||||
data_p = &gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[4];
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
true_slots[i] = *data_p++;
|
||||
}
|
||||
gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket32.data[0] = stwiParam;
|
||||
@ -696,7 +696,7 @@ static void rfu_STC_readParentCandidateList(void)
|
||||
numSlots = packet_p[1];
|
||||
packet_p += 4;
|
||||
gRfuLinkStatus->findParentCount = 0;
|
||||
for (i = 0; i < RFU_CHILD_MAX && numSlots != 0; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX && numSlots != 0; i++)
|
||||
{
|
||||
numSlots -= 7;
|
||||
uname_p = packet_p + 6;
|
||||
@ -704,7 +704,7 @@ static void rfu_STC_readParentCandidateList(void)
|
||||
check_sum = ~*packet_p;
|
||||
++packet_p;
|
||||
my_check_sum = 0;
|
||||
for (j = 0; j < 8; ++j)
|
||||
for (j = 0; j < 8; j++)
|
||||
{
|
||||
my_check_sum += *packet_p++;
|
||||
my_check_sum += *uname_p++;
|
||||
@ -723,10 +723,10 @@ static void rfu_STC_readParentCandidateList(void)
|
||||
else
|
||||
target->mbootFlag = 0;
|
||||
packet_p += 2;
|
||||
for (j = 0; j < RFU_GAME_NAME_LENGTH; ++j)
|
||||
for (j = 0; j < RFU_GAME_NAME_LENGTH; j++)
|
||||
target->gname[j] = *packet_p++;
|
||||
++packet_p;
|
||||
for (j = 0; j < PLAYER_NAME_LENGTH + 1; ++j)
|
||||
for (j = 0; j < PLAYER_NAME_LENGTH + 1; j++)
|
||||
target->uname[j] = *packet_p++;
|
||||
++gRfuLinkStatus->findParentCount;
|
||||
}
|
||||
@ -737,7 +737,7 @@ void rfu_REQ_startConnectParent(u16 pid)
|
||||
{
|
||||
u16 result = 0;
|
||||
u8 i;
|
||||
for (i = 0; i < RFU_CHILD_MAX && gRfuLinkStatus->partner[i].id != pid; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX && gRfuLinkStatus->partner[i].id != pid; i++)
|
||||
;
|
||||
if (i == RFU_CHILD_MAX)
|
||||
result = ERR_PID_NOT_FOUND;
|
||||
@ -782,7 +782,7 @@ static void rfu_CB_pollConnectParent(u8 reqCommand, u16 reqResult)
|
||||
++gRfuLinkStatus->connCount;
|
||||
gRfuLinkStatus->parentChild = MODE_CHILD;
|
||||
gRfuStatic->flags |= 0x80;
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
{
|
||||
if (gRfuLinkStatus->partner[i].id == gRfuStatic->tryPid)
|
||||
{
|
||||
@ -868,7 +868,7 @@ u16 rfu_syncVBlank(void)
|
||||
{
|
||||
gRfuStatic->flags &= 0xFB;
|
||||
bmSlotFlag = gRfuLinkStatus->connSlotFlag | gRfuLinkStatus->linkLossSlotFlag;
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
if ((bmSlotFlag >> i) & 1)
|
||||
rfu_STC_removeLinkData(i, 1);
|
||||
gRfuLinkStatus->parentChild = MODE_NEUTRAL;
|
||||
@ -921,7 +921,7 @@ u16 rfu_REQBN_watchLink(u16 reqCommandId, u8 *bmLinkLossSlot, u8 *linkLossReason
|
||||
newLinkLossFlag ^= gRfuLinkStatus->connSlotFlag;
|
||||
*bmLinkLossSlot = newLinkLossFlag & gRfuLinkStatus->connSlotFlag;
|
||||
*linkLossReason = REASON_LINK_LOSS;
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
{
|
||||
if ((*bmLinkLossSlot >> i) & 1)
|
||||
{
|
||||
@ -941,7 +941,7 @@ u16 rfu_REQBN_watchLink(u16 reqCommandId, u8 *bmLinkLossSlot, u8 *linkLossReason
|
||||
if (reqResult == 0)
|
||||
{
|
||||
packet_p = &gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[4];
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
gRfuLinkStatus->strength[i] = *packet_p++;
|
||||
to_req_disconnect = 0;
|
||||
i = 0;
|
||||
@ -951,7 +951,7 @@ u16 rfu_REQBN_watchLink(u16 reqCommandId, u8 *bmLinkLossSlot, u8 *linkLossReason
|
||||
rfu_STC_REQ_callback(ID_LINK_STATUS_REQ, reqResult);
|
||||
return reqResult;
|
||||
}
|
||||
for (; i < RFU_CHILD_MAX; ++i)
|
||||
for (; i < RFU_CHILD_MAX; i++)
|
||||
{
|
||||
#if LIBRFU_VERSION >= 1026
|
||||
if (gRfuStatic->lsFixedCount[i] != 0)
|
||||
@ -1128,7 +1128,7 @@ static void rfu_CB_disconnect(u8 reqCommand, u16 reqResult)
|
||||
gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[8] = gRfuStatic->recoveryBmSlot;
|
||||
if (reqResult == 0)
|
||||
{
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
{
|
||||
bm_slot_flag = 1 << i;
|
||||
if (bm_slot_flag & gRfuStatic->recoveryBmSlot)
|
||||
@ -1153,7 +1153,7 @@ void rfu_REQ_CHILD_startConnectRecovery(u8 bmRecoverySlot)
|
||||
u8 i;
|
||||
|
||||
gRfuStatic->recoveryBmSlot = bmRecoverySlot;
|
||||
for (i = 0; i < RFU_CHILD_MAX && !((bmRecoverySlot >> i) & 1); ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX && !((bmRecoverySlot >> i) & 1); i++)
|
||||
;
|
||||
STWI_set_Callback_M(rfu_STC_REQ_callback);
|
||||
// if i == 4, gRfuLinkStatus->partner[i].id becomes gRfuLinkStatus->my.id
|
||||
@ -1174,7 +1174,7 @@ static void rfu_CB_CHILD_pollConnectRecovery(u8 reqCommand, u16 reqResult)
|
||||
if (reqResult == 0 && gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[4] == 0 && gRfuStatic->recoveryBmSlot)
|
||||
{
|
||||
gRfuLinkStatus->parentChild = MODE_CHILD;
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
{
|
||||
bm_slot_flag = 1 << i;
|
||||
rfuLinkStatus = gRfuLinkStatus; // ???
|
||||
@ -1256,7 +1256,7 @@ void rfu_clearAllSlot(void)
|
||||
u16 IMEBackup = REG_IME;
|
||||
|
||||
REG_IME = 0;
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
{
|
||||
CpuFill16(0, gRfuSlotStatusNI[i], 2 * sizeof(struct NIComm));
|
||||
CpuFill16(0, gRfuSlotStatusUNI[i], sizeof(struct UNISend) + sizeof(struct UNIRecv));
|
||||
@ -1324,7 +1324,7 @@ u16 rfu_clearSlot(u8 connTypeFlag, u8 slotStatusIndex)
|
||||
if (NI_comm->state & SLOT_BUSY_FLAG)
|
||||
{
|
||||
rfu_STC_releaseFrame(slotStatusIndex, send_recv, NI_comm);
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
if ((NI_comm->bmSlotOrg >> i) & 1)
|
||||
NI_comm->failCounter = 0;
|
||||
}
|
||||
@ -1450,7 +1450,7 @@ static u16 rfu_STC_setSendData_org(u8 ni_or_uni, u8 bmSendSlot, u8 subFrameSize,
|
||||
slotStatus_NI->send.src = src;
|
||||
slotStatus_NI->send.ack = 0;
|
||||
slotStatus_NI->send.phase = 0;
|
||||
for (i = 0; i < WINDOW_COUNT; ++i)
|
||||
for (i = 0; i < WINDOW_COUNT; i++)
|
||||
{
|
||||
slotStatus_NI->send.recvAckFlag[i] = 0;
|
||||
slotStatus_NI->send.n[i] = 1;
|
||||
@ -1503,7 +1503,7 @@ u16 rfu_changeSendTarget(u8 connType, u8 slotStatusIndex, u8 bmNewTgtSlot)
|
||||
{
|
||||
imeBak = REG_IME;
|
||||
REG_IME = 0;
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
{
|
||||
if ((connType >> i) & 1)
|
||||
gRfuSlotStatusNI[i]->send.failCounter = 0;
|
||||
@ -1536,7 +1536,7 @@ u16 rfu_changeSendTarget(u8 connType, u8 slotStatusIndex, u8 bmNewTgtSlot)
|
||||
|
||||
if (gRfuSlotStatusUNI[slotStatusIndex]->send.state != SLOT_STATE_SEND_UNI)
|
||||
return ERR_SLOT_NOT_SENDING;
|
||||
for (bmSlot = 0, i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (bmSlot = 0, i = 0; i < RFU_CHILD_MAX; i++)
|
||||
if (i != slotStatusIndex)
|
||||
bmSlot |= gRfuSlotStatusUNI[i]->send.bmSlot;
|
||||
if (bmNewTgtSlot & bmSlot)
|
||||
@ -1695,7 +1695,7 @@ static void rfu_CB_sendData(UNUSED u8 reqCommand, u16 reqResult)
|
||||
|
||||
if (reqResult == 0)
|
||||
{
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
{
|
||||
if (gRfuSlotStatusUNI[i]->send.dataReadyFlag)
|
||||
gRfuSlotStatusUNI[i]->send.dataReadyFlag = 0;
|
||||
@ -1739,7 +1739,7 @@ static void rfu_constructSendLLFrame(void)
|
||||
gRfuLinkStatus->LLFReadyFlag = 0;
|
||||
pakcketSize = 0;
|
||||
llf_p = (u8 *)&gRfuFixed->LLFBuffer[1];
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
{
|
||||
currSize = 0;
|
||||
if (gRfuSlotStatusNI[i]->send.state & SLOT_BUSY_FLAG)
|
||||
@ -1815,7 +1815,7 @@ static u16 rfu_STC_NI_constructLLSF(u8 bm_slot_id, u8 **dest_pp, struct NIComm *
|
||||
if (gRfuLinkStatus->parentChild == MODE_PARENT)
|
||||
frame |= NI_comm->bmSlot << 18;
|
||||
frame8_p = (u8 *)&frame;
|
||||
for (i = 0; i < llsf->frameSize; ++i)
|
||||
for (i = 0; i < llsf->frameSize; i++)
|
||||
*(*dest_pp)++ = *frame8_p++;
|
||||
if (size != 0)
|
||||
{
|
||||
@ -1853,7 +1853,7 @@ static u16 rfu_STC_UNI_constructLLSF(u8 bm_slot_id, u8 **dest_p)
|
||||
if (gRfuLinkStatus->parentChild == MODE_PARENT)
|
||||
frame |= UNI_send->bmSlot << 18;
|
||||
frame8_p = (u8 *)&frame;
|
||||
for (i = 0; i < llsf->frameSize; ++i)
|
||||
for (i = 0; i < llsf->frameSize; i++)
|
||||
*(*dest_p)++ = *frame8_p++;
|
||||
src_p = UNI_send->src;
|
||||
gRfuFixed->fastCopyPtr(&src_p, dest_p, UNI_send->payloadSize);
|
||||
@ -1888,7 +1888,7 @@ static void rfu_CB_recvData(u8 reqCommand, u16 reqResult)
|
||||
rfu_STC_PARENT_analyzeRecvPacket();
|
||||
else
|
||||
rfu_STC_CHILD_analyzeRecvPacket();
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
{
|
||||
slotStatusNI = gRfuSlotStatusNI[i];
|
||||
if (slotStatusNI->recv.state == SLOT_STATE_RECV_LAST && !((gRfuStatic->NIEndRecvFlag >> i) & 1))
|
||||
@ -1972,7 +1972,7 @@ static u16 rfu_STC_analyzeLLSF(u8 slot_id, const u8 *src, u16 last_frame)
|
||||
if (last_frame < llsf_p->frameSize)
|
||||
return last_frame;
|
||||
frames = 0;
|
||||
for (i = 0; i < llsf_p->frameSize; ++i)
|
||||
for (i = 0; i < llsf_p->frameSize; i++)
|
||||
frames |= *src++ << 8 * i;
|
||||
llsf_NI.recvFirst = (frames >> llsf_p->recvFirstShift) & llsf_p->recvFirstMask;
|
||||
llsf_NI.connSlotFlag = (frames >> llsf_p->connSlotFlagShift) & llsf_p->connSlotFlagMask;
|
||||
@ -1998,7 +1998,7 @@ static u16 rfu_STC_analyzeLLSF(u8 slot_id, const u8 *src, u16 last_frame)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
if (((gRfuSlotStatusNI[i]->send.bmSlot >> slot_id) & 1)
|
||||
&& ((gRfuLinkStatus->sendSlotNIFlag >> slot_id) & 1))
|
||||
break;
|
||||
@ -2013,7 +2013,7 @@ static u16 rfu_STC_analyzeLLSF(u8 slot_id, const u8 *src, u16 last_frame)
|
||||
|
||||
if (conSlots)
|
||||
{
|
||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
||||
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||
{
|
||||
if ((conSlots >> i) & 1)
|
||||
{
|
||||
@ -2104,7 +2104,7 @@ static void rfu_STC_NI_receive_Sender(u8 NI_slot, u8 bm_flag, const struct RfuLo
|
||||
NI_comm->phase = 0;
|
||||
if (NI_comm->state == SLOT_STATE_SEND_START)
|
||||
{
|
||||
for (i = 0; i < WINDOW_COUNT; ++i)
|
||||
for (i = 0; i < WINDOW_COUNT; i++)
|
||||
{
|
||||
NI_comm->n[i] = 1;
|
||||
NI_comm->now_p[i] = NI_comm->src + NI_comm->payloadSize * i;
|
||||
|
@ -208,13 +208,13 @@ void STWI_send_GameConfigREQ(const u8 *serial_gname, const u8 *uname)
|
||||
*(u16 *)packetBytes = *(u16 *)serial_gname;
|
||||
packetBytes += sizeof(u16);
|
||||
serial_gname += sizeof(u16);
|
||||
for (i = 0; i < 14; ++i)
|
||||
for (i = 0; i < 14; i++)
|
||||
{
|
||||
*packetBytes = *serial_gname;
|
||||
++packetBytes;
|
||||
++serial_gname;
|
||||
}
|
||||
for (i = 0; i < 8; ++i)
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
*packetBytes = *uname;
|
||||
++packetBytes;
|
||||
|
@ -186,7 +186,7 @@ static const u8 sText_PyramidFloor6[] = _("PYRAMID FLOOR 6");
|
||||
static const u8 sText_PyramidFloor7[] = _("PYRAMID FLOOR 7");
|
||||
static const u8 sText_Pyramid[] = _("PYRAMID");
|
||||
|
||||
static const u8 * const sBattlePyramid_MapHeaderStrings[FRONTIER_STAGES_PER_CHALLENGE + 1] =
|
||||
static const u8 *const sBattlePyramid_MapHeaderStrings[FRONTIER_STAGES_PER_CHALLENGE + 1] =
|
||||
{
|
||||
sText_PyramidFloor1,
|
||||
sText_PyramidFloor2,
|
||||
|
@ -46,7 +46,7 @@ static const u16 sDefaultBardSongLyrics[BARD_SONG_LENGTH] = {
|
||||
EC_WORD_DANCE
|
||||
};
|
||||
|
||||
static const u8 * const sGiddyAdjectives[] = {
|
||||
static const u8 *const sGiddyAdjectives[] = {
|
||||
GiddyText_SoPretty,
|
||||
GiddyText_SoDarling,
|
||||
GiddyText_SoRelaxed,
|
||||
@ -60,7 +60,7 @@ static const u8 * const sGiddyAdjectives[] = {
|
||||
// Non-random lines Giddy can say. Not all are strictly
|
||||
// questions, but most are, and the player will receive
|
||||
// a Yes/No prompt afterwards regardless.
|
||||
static const u8 * const sGiddyQuestions[GIDDY_MAX_QUESTIONS] = {
|
||||
static const u8 *const sGiddyQuestions[GIDDY_MAX_QUESTIONS] = {
|
||||
GiddyText_ISoWantToGoOnAVacation,
|
||||
GiddyText_IBoughtCrayonsWith120Colors,
|
||||
GiddyText_WouldntItBeNiceIfWeCouldFloat,
|
||||
|
@ -1945,7 +1945,7 @@ const struct SpriteTemplate gBattlerSpriteTemplates[MAX_BATTLERS_COUNT] =
|
||||
.anims = NULL,
|
||||
.images = gBattlerPicTable_OpponentLeft,
|
||||
.affineAnims = gAffineAnims_BattleSpriteOpponentSide,
|
||||
.callback = SpriteCb_WildMon,
|
||||
.callback = SpriteCB_WildMon,
|
||||
},
|
||||
[B_POSITION_PLAYER_RIGHT] = {
|
||||
.tileTag = TAG_NONE,
|
||||
@ -1963,7 +1963,7 @@ const struct SpriteTemplate gBattlerSpriteTemplates[MAX_BATTLERS_COUNT] =
|
||||
.anims = NULL,
|
||||
.images = gBattlerPicTable_OpponentRight,
|
||||
.affineAnims = gAffineAnims_BattleSpriteOpponentSide,
|
||||
.callback = SpriteCb_WildMon
|
||||
.callback = SpriteCB_WildMon
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -305,7 +305,7 @@ static void RemoveAndCreateMonMarkingsSprite(struct Pokemon *);
|
||||
static void CreateCaughtBallSprite(struct Pokemon *);
|
||||
static void CreateSetStatusSprite(void);
|
||||
static void CreateMoveSelectorSprites(u8);
|
||||
static void SpriteCb_MoveSelector(struct Sprite *);
|
||||
static void SpriteCB_MoveSelector(struct Sprite *);
|
||||
static void DestroyMoveSelectorSprites(u8);
|
||||
static void SetMainMoveSelectorColor(u8);
|
||||
static void KeepMoveSelectorVisible(u8);
|
||||
@ -4082,14 +4082,14 @@ static void CreateMoveSelectorSprites(u8 idArrayStart)
|
||||
else
|
||||
StartSpriteAnim(&gSprites[spriteIds[i]], 6); // middle
|
||||
|
||||
gSprites[spriteIds[i]].callback = SpriteCb_MoveSelector;
|
||||
gSprites[spriteIds[i]].callback = SpriteCB_MoveSelector;
|
||||
gSprites[spriteIds[i]].data[0] = idArrayStart;
|
||||
gSprites[spriteIds[i]].data[1] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_MoveSelector(struct Sprite *sprite)
|
||||
static void SpriteCB_MoveSelector(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->animNum > 3 && sprite->animNum < 7)
|
||||
{
|
||||
|
@ -15,7 +15,7 @@ struct GFRomHeader
|
||||
const struct CompressedSpriteSheet * monBackPics;
|
||||
const struct CompressedSpritePalette * monNormalPalettes;
|
||||
const struct CompressedSpritePalette * monShinyPalettes;
|
||||
const u8 * const * monIcons;
|
||||
const u8 *const * monIcons;
|
||||
const u8 * monIconPaletteIds;
|
||||
const struct SpritePalette * monIconPalettes;
|
||||
const u8 (* monSpeciesNames)[];
|
||||
@ -62,7 +62,7 @@ struct GFRomHeader
|
||||
u32 unk18;
|
||||
const struct BaseStats * baseStats;
|
||||
const u8 (* abilityNames)[];
|
||||
const u8 * const * abilityDescriptions;
|
||||
const u8 *const * abilityDescriptions;
|
||||
const struct Item * items;
|
||||
const struct BattleMove * moves;
|
||||
const struct CompressedSpriteSheet * ballGfx;
|
||||
|
@ -84,7 +84,7 @@ static const u8 sScriptConditionTable[6][3] =
|
||||
1, 0, 1, // !=
|
||||
};
|
||||
|
||||
static u8 * const sScriptStringVars[] =
|
||||
static u8 *const sScriptStringVars[] =
|
||||
{
|
||||
gStringVar1,
|
||||
gStringVar2,
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "task.h"
|
||||
#include "script_menu.h"
|
||||
|
||||
static const u8 * const sDefaultTraderNames[NUM_TRADER_ITEMS] =
|
||||
static const u8 *const sDefaultTraderNames[NUM_TRADER_ITEMS] =
|
||||
{
|
||||
gText_Tristan,
|
||||
gText_Philip,
|
||||
|
@ -2811,7 +2811,7 @@ class Renderer {
|
||||
if ((bc.flags & Bytecode::Flag::ValueMask) != Bytecode::Flag::ValuePop) {
|
||||
popArgs -= 1;
|
||||
}
|
||||
for (unsigned int i = 0; i < popArgs; ++i) {
|
||||
for (unsigned int i = 0; i < popArgs; i++) {
|
||||
m_stack.pop_back();
|
||||
}
|
||||
}
|
||||
@ -2925,7 +2925,7 @@ class Renderer {
|
||||
void render_to(std::ostream& os, const Template& tmpl, const json& data) {
|
||||
m_data = &data;
|
||||
|
||||
for (size_t i = 0; i < tmpl.bytecodes.size(); ++i) {
|
||||
for (size_t i = 0; i < tmpl.bytecodes.size(); i++) {
|
||||
const auto& bc = tmpl.bytecodes[i];
|
||||
|
||||
switch (bc.op) {
|
||||
|
@ -1438,7 +1438,7 @@ auto from_json_array_impl(const BasicJsonType& j, std::array<T, N>& arr,
|
||||
priority_tag<2> /*unused*/)
|
||||
-> decltype(j.template get<T>(), void())
|
||||
{
|
||||
for (std::size_t i = 0; i < N; ++i)
|
||||
for (std::size_t i = 0; i < N; i++)
|
||||
{
|
||||
arr[i] = j.at(i).template get<T>();
|
||||
}
|
||||
@ -4301,7 +4301,7 @@ class binary_reader
|
||||
|
||||
if (len != std::size_t(-1))
|
||||
{
|
||||
for (std::size_t i = 0; i < len; ++i)
|
||||
for (std::size_t i = 0; i < len; i++)
|
||||
{
|
||||
if (JSON_UNLIKELY(not parse_cbor_internal()))
|
||||
{
|
||||
@ -4338,7 +4338,7 @@ class binary_reader
|
||||
string_t key;
|
||||
if (len != std::size_t(-1))
|
||||
{
|
||||
for (std::size_t i = 0; i < len; ++i)
|
||||
for (std::size_t i = 0; i < len; i++)
|
||||
{
|
||||
get();
|
||||
if (JSON_UNLIKELY(not get_cbor_string(key) or not sax->key(key)))
|
||||
@ -4832,7 +4832,7 @@ class binary_reader
|
||||
return false;
|
||||
}
|
||||
|
||||
for (std::size_t i = 0; i < len; ++i)
|
||||
for (std::size_t i = 0; i < len; i++)
|
||||
{
|
||||
if (JSON_UNLIKELY(not parse_msgpack_internal()))
|
||||
{
|
||||
@ -4855,7 +4855,7 @@ class binary_reader
|
||||
}
|
||||
|
||||
string_t key;
|
||||
for (std::size_t i = 0; i < len; ++i)
|
||||
for (std::size_t i = 0; i < len; i++)
|
||||
{
|
||||
get();
|
||||
if (JSON_UNLIKELY(not get_msgpack_string(key) or not sax->key(key)))
|
||||
@ -5190,7 +5190,7 @@ class binary_reader
|
||||
{
|
||||
if (size_and_type.second != 'N')
|
||||
{
|
||||
for (std::size_t i = 0; i < size_and_type.first; ++i)
|
||||
for (std::size_t i = 0; i < size_and_type.first; i++)
|
||||
{
|
||||
if (JSON_UNLIKELY(not get_ubjson_value(size_and_type.second)))
|
||||
{
|
||||
@ -5201,7 +5201,7 @@ class binary_reader
|
||||
}
|
||||
else
|
||||
{
|
||||
for (std::size_t i = 0; i < size_and_type.first; ++i)
|
||||
for (std::size_t i = 0; i < size_and_type.first; i++)
|
||||
{
|
||||
if (JSON_UNLIKELY(not parse_ubjson_internal()))
|
||||
{
|
||||
@ -5251,7 +5251,7 @@ class binary_reader
|
||||
|
||||
if (size_and_type.second != 0)
|
||||
{
|
||||
for (std::size_t i = 0; i < size_and_type.first; ++i)
|
||||
for (std::size_t i = 0; i < size_and_type.first; i++)
|
||||
{
|
||||
if (JSON_UNLIKELY(not get_ubjson_string(key) or not sax->key(key)))
|
||||
{
|
||||
@ -5266,7 +5266,7 @@ class binary_reader
|
||||
}
|
||||
else
|
||||
{
|
||||
for (std::size_t i = 0; i < size_and_type.first; ++i)
|
||||
for (std::size_t i = 0; i < size_and_type.first; i++)
|
||||
{
|
||||
if (JSON_UNLIKELY(not get_ubjson_string(key) or not sax->key(key)))
|
||||
{
|
||||
@ -5356,7 +5356,7 @@ class binary_reader
|
||||
{
|
||||
// step 1: read input into array with system's byte order
|
||||
std::array<std::uint8_t, sizeof(NumberType)> vec;
|
||||
for (std::size_t i = 0; i < sizeof(NumberType); ++i)
|
||||
for (std::size_t i = 0; i < sizeof(NumberType); i++)
|
||||
{
|
||||
get();
|
||||
if (JSON_UNLIKELY(not unexpect_eof(format, "number")))
|
||||
@ -6705,7 +6705,7 @@ scan_number_done:
|
||||
token_type return_type)
|
||||
{
|
||||
assert(current == literal_text[0]);
|
||||
for (std::size_t i = 1; i < length; ++i)
|
||||
for (std::size_t i = 1; i < length; i++)
|
||||
{
|
||||
if (JSON_UNLIKELY(get() != literal_text[i]))
|
||||
{
|
||||
@ -9235,7 +9235,7 @@ class json_pointer
|
||||
else
|
||||
{
|
||||
// iterate array and use index as reference string
|
||||
for (std::size_t i = 0; i < value.m_value.array->size(); ++i)
|
||||
for (std::size_t i = 0; i < value.m_value.array->size(); i++)
|
||||
{
|
||||
flatten(reference_string + "/" + std::to_string(i),
|
||||
value.m_value.array->operator[](i), result);
|
||||
@ -12183,7 +12183,7 @@ class serializer
|
||||
|
||||
// first n-1 elements
|
||||
for (auto i = val.m_value.array->cbegin();
|
||||
i != val.m_value.array->cend() - 1; ++i)
|
||||
i != val.m_value.array->cend() - 1; i++)
|
||||
{
|
||||
o->write_characters(indent_string.c_str(), new_indent);
|
||||
dump(*i, true, ensure_ascii, indent_step, new_indent);
|
||||
@ -12205,7 +12205,7 @@ class serializer
|
||||
|
||||
// first n-1 elements
|
||||
for (auto i = val.m_value.array->cbegin();
|
||||
i != val.m_value.array->cend() - 1; ++i)
|
||||
i != val.m_value.array->cend() - 1; i++)
|
||||
{
|
||||
dump(*i, false, ensure_ascii, indent_step, current_indent);
|
||||
o->write_character(',');
|
||||
@ -12302,7 +12302,7 @@ class serializer
|
||||
std::size_t bytes_after_last_accept = 0;
|
||||
std::size_t undumped_chars = 0;
|
||||
|
||||
for (std::size_t i = 0; i < s.size(); ++i)
|
||||
for (std::size_t i = 0; i < s.size(); i++)
|
||||
{
|
||||
const auto byte = static_cast<uint8_t>(s[i]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user