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

Fix braces style #4023

Merged
Merged
Show file tree
Hide file tree
Changes from 4 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
7 changes: 4 additions & 3 deletions src/battle_ai_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,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.
Expand Down Expand Up @@ -676,7 +676,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];
}
}
Expand Down
21 changes: 12 additions & 9 deletions src/battle_ai_switch_items.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2001,7 +2002,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;
}
Expand Down Expand Up @@ -2127,7 +2129,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
}
Expand All @@ -2139,12 +2142,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;
Expand Down
3 changes: 2 additions & 1 deletion src/battle_ai_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
16 changes: 10 additions & 6 deletions src/battle_anim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down Expand Up @@ -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];

Expand Down Expand Up @@ -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;
}
Expand Down
6 changes: 4 additions & 2 deletions src/battle_anim_normal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
16 changes: 11 additions & 5 deletions src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -5640,7 +5640,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--;
Expand Down Expand Up @@ -6626,14 +6627,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 {
}
Bassoonian marked this conversation as resolved.
Show resolved Hide resolved
else
{
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_MirrorHerbCopyStatChange;
}
Expand Down Expand Up @@ -6887,7 +6892,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);
}
Expand Down
3 changes: 2 additions & 1 deletion src/daycare.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,8 @@ static s32 GetParentToInheritNature(struct DayCare *daycare)
#if P_NATURE_INHERITANCE == GEN_3
&& (GetBoxMonGender(&daycare->mons[i].mon) == MON_FEMALE || IS_DITTO(GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SPECIES)))
#endif
) {
)
{
slot = i;
numWithEverstone++;
}
Expand Down
3 changes: 2 additions & 1 deletion src/field_effect.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Loading