Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed brace style inconsistencies #2072

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/AgbRfu_LinkManager.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ void rfu_LMAN_REQ_sendData(bool8 clockChangeFlag)
clockChangeFlag = FALSE;
}
else
{
lman.parentAck_flag = 0;
}
rfu_REQ_sendData(clockChangeFlag);
}

Expand Down
2 changes: 2 additions & 0 deletions src/battle_anim_effects_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -4043,7 +4043,9 @@ static void AnimMilkBottle_Step1(struct Sprite *sprite)
sprite->data[6]++;
}
else if (sprite->data[7] > 0)
{
sprite->data[7]--;
}

SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[6], sprite->data[7]));
if (sprite->data[6] == 16 && sprite->data[7] == 0)
Expand Down
4 changes: 4 additions & 0 deletions src/battle_anim_effects_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2209,7 +2209,9 @@ static void AnimTask_Splash_Step(u8 taskId)
task->data[4] -= 2;
}
else
{
task->data[1]++;
}
break;
case 3:
if (!RunAffineAnimFromTaskData(task))
Expand Down Expand Up @@ -2956,7 +2958,9 @@ static void AnimTask_SpeedDust_Step(u8 taskId)
task->data[8] = 1;
}
else
{
task->data[8] = 2;
}
}
}
break;
Expand Down
6 changes: 6 additions & 0 deletions src/battle_anim_electric.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,9 @@ static void AnimZapCannonSpark_Step(struct Sprite *sprite)
sprite->invisible ^= 1;
}
else
{
DestroyAnimSprite(sprite);
}
}

static void AnimThunderboltOrb_Step(struct Sprite *sprite)
Expand Down Expand Up @@ -870,7 +872,9 @@ static void AnimTask_ElectricChargingParticles_Step(u8 taskId)
}
}
else if(task->data[7] == 0)
{
DestroyAnimVisualTask(taskId);
}
}

static void AnimElectricChargingParticles_Step(struct Sprite *sprite)
Expand Down Expand Up @@ -991,7 +995,9 @@ void AnimTask_VoltTackleAttackerReappear(u8 taskId)
gSprites[task->data[15]].x2 = task->data[14];
}
else
{
task->data[0]++;
}

}
break;
Expand Down
2 changes: 2 additions & 0 deletions src/battle_anim_ghost.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ static void AnimConfuseRayBallBounce_Step2(struct Sprite *sprite)
sprite->callback = DestroyAnimSpriteAndDisableBlend;
}
else
{
UpdateConfuseRayBallBlend(sprite);
}
}

static void UpdateConfuseRayBallBlend(struct Sprite *sprite)
Expand Down
14 changes: 14 additions & 0 deletions src/battle_anim_throw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,9 @@ static void SpriteCB_Ball_Wobble_Step(struct Sprite *sprite)
gBattleSpritesDataPtr->animationData->ballSubpx &= 0xFF;
}
else
{
gBattleSpritesDataPtr->animationData->ballSubpx += 176;
}

sprite->sTimer++;
sprite->affineAnimPaused = FALSE;
Expand All @@ -1172,7 +1174,9 @@ static void SpriteCB_Ball_Wobble_Step(struct Sprite *sprite)
ChangeSpriteAffineAnim(sprite, BALL_ROTATE_RIGHT);
}
else
{
sprite->affineAnimPaused = TRUE;
}
break;
case BALL_ROLL_2:
if (gBattleSpritesDataPtr->animationData->ballSubpx > 255)
Expand All @@ -1181,7 +1185,9 @@ static void SpriteCB_Ball_Wobble_Step(struct Sprite *sprite)
gBattleSpritesDataPtr->animationData->ballSubpx &= 0xFF;
}
else
{
gBattleSpritesDataPtr->animationData->ballSubpx += 176;
}

sprite->sTimer++;
sprite->affineAnimPaused = FALSE;
Expand Down Expand Up @@ -1216,7 +1222,9 @@ static void SpriteCB_Ball_Wobble_Step(struct Sprite *sprite)
gBattleSpritesDataPtr->animationData->ballSubpx &= 0xFF;
}
else
{
gBattleSpritesDataPtr->animationData->ballSubpx += 176;
}

sprite->sTimer++;
sprite->affineAnimPaused = FALSE;
Expand Down Expand Up @@ -1390,7 +1398,9 @@ static void SpriteCB_Ball_FadeOut(struct Sprite *sprite)
static void DestroySpriteAfterOneFrame(struct Sprite *sprite)
{
if (sprite->sFrame == 0)
{
sprite->sFrame = -1;
}
else
{
FreeSpriteOamMatrix(sprite);
Expand All @@ -1410,7 +1420,9 @@ static void MakeCaptureStars(struct Sprite *sprite)
u8 subpriority;

if (sprite->subpriority)
{
subpriority = sprite->subpriority - 1;
}
else
{
subpriority = 0;
Expand Down Expand Up @@ -2358,7 +2370,9 @@ static void SpriteCB_ShinyStars_Diagonal(struct Sprite *sprite)
{
// Delayed four frames to de-sync from encircling stars
if (sprite->sTimer < 4)
{
sprite->sTimer++;
}
else
{
sprite->invisible = FALSE;
Expand Down
12 changes: 10 additions & 2 deletions src/battle_controller_opponent.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ static void Intro_WaitForShinyAnimAndHealthbox(void)
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
}
else
{
return;
}
}
else if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{
Expand All @@ -270,13 +272,17 @@ static void Intro_WaitForShinyAnimAndHealthbox(void)
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
}
else
{
return;
}
}
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
}
else
{
return;
}

gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 3;
gBattlerControllerFuncs[gActiveBattler] = Intro_DelayAndEnd;
Expand Down Expand Up @@ -331,7 +337,9 @@ static void Intro_TryShinyAnimShowHealthbox(void)
m4aMPlayContinue(&gMPlayInfo_BGM);
}
else
{
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100);
}
}
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored = TRUE;
bgmRestored = TRUE;
Expand Down
8 changes: 8 additions & 0 deletions src/battle_gfx_sfx_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,13 +773,21 @@ bool8 BattleLoadAllHealthBoxesGfx(u8 state)
LoadCompressedSpriteSheet(&sSpriteSheet_SinglesPlayerHealthbox);
}
else if (state == 3)
{
LoadCompressedSpriteSheet(&sSpriteSheet_SinglesOpponentHealthbox);
}
else if (state == 4)
{
LoadCompressedSpriteSheet(&sSpriteSheets_HealthBar[gBattlerPositions[0]]);
}
else if (state == 5)
{
LoadCompressedSpriteSheet(&sSpriteSheets_HealthBar[gBattlerPositions[1]]);
}
else
{
retVal = TRUE;
}
}
else
{
Expand Down
34 changes: 34 additions & 0 deletions src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1654,7 +1654,9 @@ static void CB2_HandleStartMultiBattle(void)
gBattleCommunication[MULTIUSE_STATE]++;
}
else
{
break;
}
// fall through
case 3:
if (IsLinkTaskFinished())
Expand Down Expand Up @@ -3084,7 +3086,9 @@ static void BattleStartClearSetData(void)
gHitMarker |= HITMARKER_NO_ANIMATIONS;
}
else if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK)) && GetBattleSceneInRecordedBattle())
{
gHitMarker |= HITMARKER_NO_ANIMATIONS;
}

gBattleScripting.battleStyle = gSaveBlock2Ptr->optionsBattleStyle;

Expand Down Expand Up @@ -3584,7 +3588,9 @@ static void BattleIntroPrintOpponentSendsOut(void)
return;

if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED))
{
position = B_POSITION_OPPONENT_LEFT;
}
else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
{
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_IS_MASTER)
Expand All @@ -3593,7 +3599,9 @@ static void BattleIntroPrintOpponentSendsOut(void)
position = B_POSITION_PLAYER_LEFT;
}
else
{
position = B_POSITION_OPPONENT_LEFT;
}

PrepareStringBattle(STRINGID_INTROSENDOUT, GetBattlerAtPosition(position));
gBattleMainFunc = BattleIntroOpponent1SendsOutMonAnimation;
Expand All @@ -3604,7 +3612,9 @@ static void BattleIntroOpponent2SendsOutMonAnimation(void)
u32 position;

if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED))
{
position = B_POSITION_OPPONENT_RIGHT;
}
else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
{
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_IS_MASTER)
Expand All @@ -3613,7 +3623,9 @@ static void BattleIntroOpponent2SendsOutMonAnimation(void)
position = B_POSITION_PLAYER_RIGHT;
}
else
{
position = B_POSITION_OPPONENT_RIGHT;
}

for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++)
{
Expand Down Expand Up @@ -3641,10 +3653,14 @@ static void BattleIntroOpponent1SendsOutMonAnimation(void)
position = B_POSITION_PLAYER_LEFT;
}
else
{
position = B_POSITION_OPPONENT_LEFT;
}
}
else
{
position = B_POSITION_OPPONENT_LEFT;
}

if (gBattleControllerExecFlags)
return;
Expand Down Expand Up @@ -3699,7 +3715,9 @@ static void BattleIntroPrintPlayerSendsOut(void)
u8 position;

if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED))
{
position = B_POSITION_PLAYER_LEFT;
}
else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
{
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_IS_MASTER)
Expand All @@ -3708,7 +3726,9 @@ static void BattleIntroPrintPlayerSendsOut(void)
position = B_POSITION_OPPONENT_LEFT;
}
else
{
position = B_POSITION_PLAYER_LEFT;
}

if (!(gBattleTypeFlags & BATTLE_TYPE_SAFARI))
PrepareStringBattle(STRINGID_INTROSENDOUT, GetBattlerAtPosition(position));
Expand All @@ -3722,7 +3742,9 @@ static void BattleIntroPlayer2SendsOutMonAnimation(void)
u32 position;

if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED))
{
position = B_POSITION_PLAYER_RIGHT;
}
else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
{
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_IS_MASTER)
Expand All @@ -3731,7 +3753,9 @@ static void BattleIntroPlayer2SendsOutMonAnimation(void)
position = B_POSITION_OPPONENT_RIGHT;
}
else
{
position = B_POSITION_PLAYER_RIGHT;
}

for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++)
{
Expand All @@ -3754,7 +3778,9 @@ static void BattleIntroPlayer1SendsOutMonAnimation(void)
u32 position;

if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED))
{
position = B_POSITION_PLAYER_LEFT;
}
else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
{
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_IS_MASTER)
Expand All @@ -3763,7 +3789,9 @@ static void BattleIntroPlayer1SendsOutMonAnimation(void)
position = B_POSITION_OPPONENT_LEFT;
}
else
{
position = B_POSITION_PLAYER_LEFT;
}

if (gBattleControllerExecFlags)
return;
Expand Down Expand Up @@ -4678,7 +4706,9 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves)
moveBattler1 = gBattleMons[battler1].moves[*(gBattleStruct->chosenMovePositions + battler1)];
}
else
{
moveBattler1 = MOVE_NONE;
}

if (gChosenActionByBattler[battler2] == B_ACTION_USE_MOVE)
{
Expand All @@ -4688,7 +4718,9 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves)
moveBattler2 = gBattleMons[battler2].moves[*(gBattleStruct->chosenMovePositions + battler2)];
}
else
{
moveBattler2 = MOVE_NONE;
}
}

// both move priorities are different than 0
Expand All @@ -4705,7 +4737,9 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves)
// else battler1 has more speed
}
else if (gBattleMoves[moveBattler1].priority < gBattleMoves[moveBattler2].priority)
{
strikesFirst = 1; // battler2's move has greater priority
}

// else battler1's move has greater priority
}
Expand Down
Loading
Loading