diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index ec8c96223c..320aaa628a 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -546,9 +546,9 @@ static u32 ChooseMoveOrAction_Singles(u32 battlerAi) AI_THINKING_STRUCT->aiLogicId++; } - for (i = 0; i < MAX_MON_MOVES; i++) { + for (i = 0; i < MAX_MON_MOVES; i++) + { gBattleStruct->aiFinalScore[battlerAi][gBattlerTarget][i] = AI_THINKING_STRUCT->score[i]; - } // Check special AI actions. @@ -674,7 +674,8 @@ static u32 ChooseMoveOrAction_Doubles(u32 battlerAi) } } - for (j = 0; j < MAX_MON_MOVES; j++) { + for (j = 0; j < MAX_MON_MOVES; j++) + { gBattleStruct->aiFinalScore[battlerAi][gBattlerTarget][j] = AI_THINKING_STRUCT->score[j]; } } diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index cc1e8b4ad9..d759f237ae 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -597,7 +597,8 @@ static bool32 ShouldSwitchIfAbilityBenefit(u32 battler, bool32 emitResult) ||IsNeutralizingGasOnField()) return FALSE; - switch(AI_DATA->abilities[battler]) { + switch(AI_DATA->abilities[battler]) + { case ABILITY_NATURAL_CURE: moduloChance = 4; //25% //Attempt to cure bad ailment @@ -1999,7 +2000,8 @@ static bool32 AiExpectsToFaintPlayer(u32 battler) if (GetBattlerSide(target) != GetBattlerSide(battler) && CanIndexMoveFaintTarget(battler, target, gBattleStruct->aiMoveOrAction[battler], 0) - && AI_WhoStrikesFirst(battler, target, GetAIChosenMove(battler)) == AI_IS_FASTER) { + && AI_WhoStrikesFirst(battler, target, GetAIChosenMove(battler)) == AI_IS_FASTER) + { // We expect to faint the target and move first -> dont use an item return TRUE; } @@ -2125,7 +2127,8 @@ static bool32 AI_ShouldHeal(u32 battler, u32 healAmount) if (gBattleMons[battler].hp < gBattleMons[battler].maxHP / 4 || gBattleMons[battler].hp == 0 - || (healAmount != 0 && gBattleMons[battler].maxHP - gBattleMons[battler].hp > healAmount)) { + || (healAmount != 0 && gBattleMons[battler].maxHP - gBattleMons[battler].hp > healAmount)) + { // We have low enough HP to consider healing shouldHeal = !AI_OpponentCanFaintAiWithMod(battler, healAmount); // if target can kill us even after we heal, why bother } @@ -2137,12 +2140,12 @@ static bool32 AI_OpponentCanFaintAiWithMod(u32 battler, u32 healAmount) { u32 i; // Check special cases to NOT heal - for (i = 0; i < gBattlersCount; i++) { - if (GetBattlerSide(i) == B_SIDE_PLAYER) { - if (CanTargetFaintAiWithMod(i, battler, healAmount, 0)) { - // Target is expected to faint us - return TRUE; - } + for (i = 0; i < gBattlersCount; i++) + { + if (GetBattlerSide(i) == B_SIDE_PLAYER && CanTargetFaintAiWithMod(i, battler, healAmount, 0)) + { + // Target is expected to faint us + return TRUE; } } return FALSE; diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index f901d61b59..80ae833017 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -469,7 +469,8 @@ s32 AI_CalcDamage(u32 move, u32 battlerAtk, u32 battlerDef, u8 *typeEffectivenes u32 i; gBattleStruct->beatUpSlot = 0; dmg = 0; - for (i = 0; i < partyCount; i++) { + for (i = 0; i < partyCount; i++) + { dmg += CalculateMoveDamage(move, battlerAtk, battlerDef, moveType, 0, FALSE, FALSE, FALSE); } gBattleStruct->beatUpSlot = 0; diff --git a/src/battle_anim.c b/src/battle_anim.c index a80cc3d1f7..c9e3789ee5 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -447,18 +447,21 @@ static u8 GetBattleAnimMoveTargets(u8 battlerArgIndex, u8 *targets) switch (GetBattlerMoveTargetType(gBattleAnimAttacker, gAnimMoveIndex)) { case MOVE_TARGET_FOES_AND_ALLY: - if (IS_ALIVE_AND_PRESENT(BATTLE_PARTNER(BATTLE_OPPOSITE(battler)))) { + if (IS_ALIVE_AND_PRESENT(BATTLE_PARTNER(BATTLE_OPPOSITE(battler)))) + { targets[idx++] = BATTLE_PARTNER(BATTLE_OPPOSITE(battler)); numTargets++; } // fallthrough case MOVE_TARGET_BOTH: - if (IS_ALIVE_AND_PRESENT(battler)) { + if (IS_ALIVE_AND_PRESENT(battler)) + { targets[idx++] = battler; numTargets++; } battler = BATTLE_PARTNER(battler); - if (IS_ALIVE_AND_PRESENT(battler)) { + if (IS_ALIVE_AND_PRESENT(battler)) + { targets[idx++] = battler; numTargets++; } @@ -555,8 +558,8 @@ static void CreateSpriteOnTargets(const struct SpriteTemplate *template, u8 argV if (ntargets == 0) return; - for (i = 0; i < ntargets; i++) { - + for (i = 0; i < ntargets; i++) + { if (overwriteAnimTgt) gBattleAnimArgs[battlerArgIndex] = targets[i]; @@ -673,7 +676,8 @@ static void Cmd_createvisualtaskontargets(void) sBattleAnimScriptPtr++; // copy task arguments - for (i = 0; i < numArgs; i++) { + for (i = 0; i < numArgs; i++) + { gBattleAnimArgs[i] = T1_READ_16(sBattleAnimScriptPtr); sBattleAnimScriptPtr += 2; } diff --git a/src/battle_anim_normal.c b/src/battle_anim_normal.c index 3b2de5ddbb..6333cc8183 100644 --- a/src/battle_anim_normal.c +++ b/src/battle_anim_normal.c @@ -418,12 +418,14 @@ u32 UnpackSelectedBattlePalettes(s16 selector) switch (moveTarget) { case MOVE_TARGET_BOTH: - if (target) { + if (target) + { targetPartner |= 1; } break; case MOVE_TARGET_FOES_AND_ALLY: - if (target) { + if (target) + { targetPartner |= 1; attackerPartner |= 1; } diff --git a/src/battle_util.c b/src/battle_util.c index c506a83a9e..690ce939ba 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5638,7 +5638,8 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 switch (GetBattlerAbility(battler)) { case ABILITY_OPPORTUNIST: - if (gProtectStructs[battler].activateOpportunist == 2) { + if (gProtectStructs[battler].activateOpportunist == 2) + { gBattleScripting.savedBattler = gBattlerAttacker; gBattleScripting.battler = gBattlerAttacker = gBattlerAbility = battler; gProtectStructs[battler].activateOpportunist--; @@ -6624,14 +6625,18 @@ static u8 TryConsumeMirrorHerb(u32 battler, bool32 execute) { u8 effect = 0; - if (gProtectStructs[battler].eatMirrorHerb) { + if (gProtectStructs[battler].eatMirrorHerb) + { gLastUsedItem = gBattleMons[battler].item; gBattleScripting.savedBattler = gBattlerAttacker; gBattleScripting.battler = gBattlerAttacker = battler; gProtectStructs[battler].eatMirrorHerb = 0; - if (execute) { + if (execute) + { BattleScriptExecute(BattleScript_MirrorHerbCopyStatChangeEnd2); - } else { + } + else + { BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_MirrorHerbCopyStatChange; } @@ -6885,7 +6890,8 @@ u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn) u8 atkHoldEffectParam; u16 atkItem; - if (caseID != ITEMEFFECT_USE_LAST_ITEM) { + if (caseID != ITEMEFFECT_USE_LAST_ITEM) + { gLastUsedItem = gBattleMons[battler].item; battlerHoldEffect = GetBattlerHoldEffect(battler, TRUE); } diff --git a/src/daycare.c b/src/daycare.c index 97447e99d6..0a06ed7ddb 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -490,8 +490,8 @@ static s32 GetParentToInheritNature(struct DayCare *daycare) for (i = 0; i < DAYCARE_MON_COUNT; i++) { if (ItemId_GetHoldEffect(GetBoxMonData(&daycare->mons[i].mon, MON_DATA_HELD_ITEM)) == HOLD_EFFECT_PREVENT_EVOLVE - && (P_NATURE_INHERITANCE != GEN_3 || GetBoxMonGender(&daycare->mons[i].mon) == MON_FEMALE || IS_DITTO(GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SPECIES))) - ) { + && (P_NATURE_INHERITANCE != GEN_3 || GetBoxMonGender(&daycare->mons[i].mon) == MON_FEMALE || IS_DITTO(GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SPECIES)))) + { slot = i; numWithEverstone++; } diff --git a/src/field_effect.c b/src/field_effect.c index 8309e10b8e..bece73b025 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -3956,7 +3956,8 @@ static void UseVsSeeker_DoPlayerAnimation(struct Task *task) task->data[0]++; } -static void UseVsSeeker_ResetPlayerGraphics(struct Task *task) { +static void UseVsSeeker_ResetPlayerGraphics(struct Task *task) +{ struct ObjectEvent* playerObj = &gObjectEvents[gPlayerAvatar.objectEventId]; if (!ObjectEventClearHeldMovementIfFinished(playerObj))