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

Replaced all usages of tabs in C files with spaces #5261

Merged
merged 1 commit into from
Aug 26, 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
36 changes: 18 additions & 18 deletions src/battle_ai_switch_items.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ void GetAIPartyIndexes(u32 battler, s32 *firstId, s32 *lastId)
static bool32 HasBadOdds(u32 battler, bool32 emitResult)
{
//Variable initialization
u8 opposingPosition, atkType1, atkType2, defType1, defType2, effectiveness;
u8 opposingPosition, atkType1, atkType2, defType1, defType2, effectiveness;
s32 i, damageDealt = 0, maxDamageDealt = 0, damageTaken = 0, maxDamageTaken = 0;
u32 aiMove, playerMove, aiBestMove = MOVE_NONE, aiAbility = AI_DATA->abilities[battler], opposingBattler, weather = AI_GetWeather(AI_DATA);
bool32 getsOneShot = FALSE, hasStatusMove = FALSE, hasSuperEffectiveMove = FALSE;
u16 typeEffectiveness = UQ_4_12(1.0), aiMoveEffect; //baseline typing damage
u16 typeEffectiveness = UQ_4_12(1.0), aiMoveEffect; //baseline typing damage

// Only use this if AI_FLAG_SMART_SWITCHING is set for the trainer
if (!(AI_THINKING_STRUCT->aiFlags[battler] & AI_FLAG_SMART_SWITCHING))
Expand All @@ -85,14 +85,14 @@ static bool32 HasBadOdds(u32 battler, bool32 emitResult)
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
return FALSE;

opposingPosition = BATTLE_OPPOSITE(GetBattlerPosition(battler));
opposingPosition = BATTLE_OPPOSITE(GetBattlerPosition(battler));
opposingBattler = GetBattlerAtPosition(opposingPosition);

// Gets types of player (opposingBattler) and computer (battler)
atkType1 = gBattleMons[opposingBattler].types[0];
atkType2 = gBattleMons[opposingBattler].types[1];
defType1 = gBattleMons[battler].types[0];
defType2 = gBattleMons[battler].types[1];
atkType1 = gBattleMons[opposingBattler].types[0];
atkType2 = gBattleMons[opposingBattler].types[1];
defType1 = gBattleMons[battler].types[0];
defType2 = gBattleMons[battler].types[1];

// Check AI moves for damage dealt
for (i = 0; i < MAX_MON_MOVES; i++)
Expand Down Expand Up @@ -191,13 +191,13 @@ static bool32 HasBadOdds(u32 battler, bool32 emitResult)
}

// General bad type matchups have more wiggle room
if (typeEffectiveness >= UQ_4_12(2.0)) // If the player has at least a 2x type advantage
{
if (!hasSuperEffectiveMove // If the AI doesn't have a super effective move
&& (gBattleMons[battler].hp >= gBattleMons[battler].maxHP / 2 // And the current mon has at least 1/2 their HP, or 1/4 HP and Regenerator
if (typeEffectiveness >= UQ_4_12(2.0)) // If the player has at least a 2x type advantage
{
if (!hasSuperEffectiveMove // If the AI doesn't have a super effective move
&& (gBattleMons[battler].hp >= gBattleMons[battler].maxHP / 2 // And the current mon has at least 1/2 their HP, or 1/4 HP and Regenerator
|| (aiAbility == ABILITY_REGENERATOR
&& gBattleMons[battler].hp >= gBattleMons[battler].maxHP / 4)))
{
{
// Then check if they have an important status move, which is worth using even in a bad matchup
if (hasStatusMove)
return FALSE;
Expand All @@ -207,13 +207,13 @@ static bool32 HasBadOdds(u32 battler, bool32 emitResult)
return FALSE;

// Switch mon out
gBattleStruct->AI_monToSwitchIntoId[battler] = PARTY_SIZE;
if (emitResult)
gBattleStruct->AI_monToSwitchIntoId[battler] = PARTY_SIZE;
if (emitResult)
BtlController_EmitTwoReturnValues(battler, 1, B_ACTION_SWITCH, 0);
return TRUE;
}
}
return FALSE;
return TRUE;
}
}
return FALSE;
}

static bool32 ShouldSwitchIfAllBadMoves(u32 battler, bool32 emitResult)
Expand Down
40 changes: 20 additions & 20 deletions src/battle_ai_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -2197,7 +2197,7 @@ bool32 IsAttackBoostMoveEffect(u32 effect)
switch (effect)
{
case EFFECT_ATTACK_UP:
case EFFECT_ATTACK_UP_2:
case EFFECT_ATTACK_UP_2:
case EFFECT_ATTACK_ACCURACY_UP:
case EFFECT_ATTACK_SPATK_UP:
case EFFECT_DRAGON_DANCE:
Expand All @@ -2217,34 +2217,34 @@ bool32 IsStatRaisingEffect(u32 effect)
switch (effect)
{
case EFFECT_ATTACK_UP:
case EFFECT_ATTACK_UP_2:
case EFFECT_DEFENSE_UP:
case EFFECT_DEFENSE_UP_2:
case EFFECT_ATTACK_UP_2:
case EFFECT_DEFENSE_UP:
case EFFECT_DEFENSE_UP_2:
case EFFECT_DEFENSE_UP_3:
case EFFECT_SPEED_UP:
case EFFECT_SPEED_UP_2:
case EFFECT_SPECIAL_ATTACK_UP:
case EFFECT_SPECIAL_ATTACK_UP_2:
case EFFECT_SPEED_UP:
case EFFECT_SPEED_UP_2:
case EFFECT_SPECIAL_ATTACK_UP:
case EFFECT_SPECIAL_ATTACK_UP_2:
case EFFECT_SPECIAL_ATTACK_UP_3:
case EFFECT_SPECIAL_DEFENSE_UP:
case EFFECT_SPECIAL_DEFENSE_UP_2:
case EFFECT_SPECIAL_DEFENSE_UP:
case EFFECT_SPECIAL_DEFENSE_UP_2:
case EFFECT_ACCURACY_UP:
case EFFECT_ACCURACY_UP_2:
case EFFECT_EVASION_UP:
case EFFECT_EVASION_UP_2:
case EFFECT_MINIMIZE:
case EFFECT_DEFENSE_CURL:
case EFFECT_CALM_MIND:
case EFFECT_CALM_MIND:
case EFFECT_COSMIC_POWER:
case EFFECT_DRAGON_DANCE:
case EFFECT_ACUPRESSURE:
case EFFECT_SHELL_SMASH:
case EFFECT_SHIFT_GEAR:
case EFFECT_ATTACK_ACCURACY_UP:
case EFFECT_ATTACK_SPATK_UP:
case EFFECT_GROWTH:
case EFFECT_COIL:
case EFFECT_QUIVER_DANCE:
case EFFECT_DRAGON_DANCE:
case EFFECT_ACUPRESSURE:
case EFFECT_SHELL_SMASH:
case EFFECT_SHIFT_GEAR:
case EFFECT_ATTACK_ACCURACY_UP:
case EFFECT_ATTACK_SPATK_UP:
case EFFECT_GROWTH:
case EFFECT_COIL:
case EFFECT_QUIVER_DANCE:
case EFFECT_BULK_UP:
case EFFECT_GEOMANCY:
case EFFECT_STOCKPILE:
Expand Down
52 changes: 26 additions & 26 deletions src/battle_anim_dragon.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,36 +627,36 @@ static void AnimOverheatFlame_Step(struct Sprite *sprite)

void AnimDracoMeteorRock(struct Sprite *sprite)
{
if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
{
sprite->data[0] = sprite->x - gBattleAnimArgs[0];
sprite->data[2] = sprite->x - gBattleAnimArgs[2];
}
else
{
sprite->data[0] = sprite->x + gBattleAnimArgs[0];
sprite->data[2] = sprite->x + gBattleAnimArgs[2];
}

sprite->data[1] = sprite->y + gBattleAnimArgs[1];
sprite->data[3] = sprite->y + gBattleAnimArgs[3];
sprite->data[4] = gBattleAnimArgs[4];

sprite->data[6] = gBattleAnimArgs[2];
sprite->data[7] = gBattleAnimArgs[3];

sprite->x = sprite->data[0];
sprite->y = sprite->data[1];
sprite->callback = AnimDracoMeteorRock_Step;
if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
{
sprite->data[0] = sprite->x - gBattleAnimArgs[0];
sprite->data[2] = sprite->x - gBattleAnimArgs[2];
}
else
{
sprite->data[0] = sprite->x + gBattleAnimArgs[0];
sprite->data[2] = sprite->x + gBattleAnimArgs[2];
}

sprite->data[1] = sprite->y + gBattleAnimArgs[1];
sprite->data[3] = sprite->y + gBattleAnimArgs[3];
sprite->data[4] = gBattleAnimArgs[4];

sprite->data[6] = gBattleAnimArgs[2];
sprite->data[7] = gBattleAnimArgs[3];

sprite->x = sprite->data[0];
sprite->y = sprite->data[1];
sprite->callback = AnimDracoMeteorRock_Step;
}

static void AnimDracoMeteorRock_Step(struct Sprite *sprite)
{
sprite->x2 = ((sprite->data[2] - sprite->data[0]) * sprite->data[5]) / sprite->data[4];
sprite->y2 = ((sprite->data[3] - sprite->data[1]) * sprite->data[5]) / sprite->data[4];
sprite->x2 = ((sprite->data[2] - sprite->data[0]) * sprite->data[5]) / sprite->data[4];
sprite->y2 = ((sprite->data[3] - sprite->data[1]) * sprite->data[5]) / sprite->data[4];

if (sprite->data[5] == sprite->data[4])
DestroyAnimSprite(sprite);
if (sprite->data[5] == sprite->data[4])
DestroyAnimSprite(sprite);

sprite->data[5]++;
sprite->data[5]++;
}
52 changes: 26 additions & 26 deletions src/battle_anim_effects_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -2535,13 +2535,13 @@ const struct SpriteTemplate gTauntFingerSpriteTemplate =

const struct SpriteTemplate gPowerOrbs_Float =
{
.tileTag = ANIM_TAG_RED_ORB,
.paletteTag = ANIM_TAG_RED_ORB,
.oam = &gOamData_AffineOff_ObjNormal_16x16,
.anims = gSporeParticleAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimSporeParticle,
.tileTag = ANIM_TAG_RED_ORB,
.paletteTag = ANIM_TAG_RED_ORB,
.oam = &gOamData_AffineOff_ObjNormal_16x16,
.anims = gSporeParticleAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimSporeParticle,
};

const union AnimCmd gRockPolishStreak_AnimCmd[] =
Expand Down Expand Up @@ -7234,42 +7234,42 @@ static void AnimNightSlash(struct Sprite *sprite)

static const union AffineAnimCmd sCompressTargetHorizontallyAffineAnimCmds[] =
{
AFFINEANIMCMD_FRAME(64, 0, 0, 16), //Compress
AFFINEANIMCMD_FRAME(0, 0, 0, 64),
AFFINEANIMCMD_FRAME(-64, 0, 0, 16),
AFFINEANIMCMD_END,
AFFINEANIMCMD_FRAME(64, 0, 0, 16), //Compress
AFFINEANIMCMD_FRAME(0, 0, 0, 64),
AFFINEANIMCMD_FRAME(-64, 0, 0, 16),
AFFINEANIMCMD_END,
};

static const union AffineAnimCmd sCompressTargetHorizontallyAffineAnimCmdsFast[] =
{
AFFINEANIMCMD_FRAME(32, 0, 0, 16), //Compress
AFFINEANIMCMD_FRAME(0, 0, 0, 32),
AFFINEANIMCMD_FRAME(-32, 0, 0, 16),
AFFINEANIMCMD_END,
AFFINEANIMCMD_FRAME(32, 0, 0, 16), //Compress
AFFINEANIMCMD_FRAME(0, 0, 0, 32),
AFFINEANIMCMD_FRAME(-32, 0, 0, 16),
AFFINEANIMCMD_END,
};

static void AnimTask_CompressTargetStep(u8 taskId)
{
struct Task* task = &gTasks[taskId];
struct Task* task = &gTasks[taskId];

if (!RunAffineAnimFromTaskData(task))
DestroyAnimVisualTask(taskId);
if (!RunAffineAnimFromTaskData(task))
DestroyAnimVisualTask(taskId);
}

void AnimTask_CompressTargetHorizontally(u8 taskId)
{
struct Task* task = &gTasks[taskId];
u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
PrepareAffineAnimInTaskData(task, spriteId, sCompressTargetHorizontallyAffineAnimCmds);
task->func = AnimTask_CompressTargetStep;
struct Task* task = &gTasks[taskId];
u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
PrepareAffineAnimInTaskData(task, spriteId, sCompressTargetHorizontallyAffineAnimCmds);
task->func = AnimTask_CompressTargetStep;
}

void AnimTask_CompressTargetHorizontallyFast(u8 taskId)
{
struct Task* task = &gTasks[taskId];
u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
PrepareAffineAnimInTaskData(task, spriteId, sCompressTargetHorizontallyAffineAnimCmdsFast);
task->func = AnimTask_CompressTargetStep;
struct Task* task = &gTasks[taskId];
u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
PrepareAffineAnimInTaskData(task, spriteId, sCompressTargetHorizontallyAffineAnimCmdsFast);
task->func = AnimTask_CompressTargetStep;
}

void AnimTask_CreateSmallSteelBeamOrbs(u8 taskId)
Expand Down
16 changes: 8 additions & 8 deletions src/battle_anim_electric.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,17 +525,17 @@ const struct SpriteTemplate gFlashCannonGrayChargeTemplate =

static const union AffineAnimCmd sSpriteAffineAnim_JudgmentBall[] =
{
AFFINEANIMCMD_FRAME(16, 16, 0, 0),
AFFINEANIMCMD_FRAME(8, 8, 0, 15), //Half size
AFFINEANIMCMD_FRAME(0, 0, 0, 120), //Delay
AFFINEANIMCMD_FRAME(24, 24, 0, 5), //Normal size
AFFINEANIMCMD_FRAME(0, 0, 0, 10), //Delay
AFFINEANIMCMD_FRAME(-16, -16, 0, 15), //Revert to 1 px
AFFINEANIMCMD_END,
AFFINEANIMCMD_FRAME(16, 16, 0, 0),
AFFINEANIMCMD_FRAME(8, 8, 0, 15), //Half size
AFFINEANIMCMD_FRAME(0, 0, 0, 120), //Delay
AFFINEANIMCMD_FRAME(24, 24, 0, 5), //Normal size
AFFINEANIMCMD_FRAME(0, 0, 0, 10), //Delay
AFFINEANIMCMD_FRAME(-16, -16, 0, 15), //Revert to 1 px
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd* const sSpriteAffineAnimTable_JudgmentBall[] =
{
sSpriteAffineAnim_JudgmentBall,
sSpriteAffineAnim_JudgmentBall,
};
const struct SpriteTemplate gJudgmentBlackChargeTemplate =
{
Expand Down
28 changes: 14 additions & 14 deletions src/battle_anim_fight.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,24 +403,24 @@ const struct SpriteTemplate gFocusPunchFistSpriteTemplate =

const struct SpriteTemplate gPalmSpriteTemplate =
{
.tileTag = ANIM_TAG_PURPLE_HAND_OUTLINE,
.paletteTag = ANIM_TAG_PURPLE_HAND_OUTLINE,
.oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = gAnims_HandsAndFeet,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimBasicFistOrFoot,
.tileTag = ANIM_TAG_PURPLE_HAND_OUTLINE,
.paletteTag = ANIM_TAG_PURPLE_HAND_OUTLINE,
.oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = gAnims_HandsAndFeet,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimBasicFistOrFoot,
};

const struct SpriteTemplate gAuraSphereBlast =
{
.tileTag = ANIM_TAG_CIRCLE_OF_LIGHT,
.paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT,
.oam = &gOamData_AffineOff_ObjNormal_64x64,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimSuperpowerFireball,
.tileTag = ANIM_TAG_CIRCLE_OF_LIGHT,
.paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT,
.oam = &gOamData_AffineOff_ObjNormal_64x64,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimSuperpowerFireball,
};

const union AffineAnimCmd gForcePalmAffineAnimCmd_1[] =
Expand Down
14 changes: 7 additions & 7 deletions src/battle_anim_fire.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,13 @@ const struct SpriteTemplate gSpacialRendBladesTemplate2 =
// Sea of Fire
const struct SpriteTemplate gTwisterEmberSpriteTemplate =
{
.tileTag = ANIM_TAG_SMALL_EMBER,
.paletteTag = ANIM_TAG_SMALL_EMBER,
.oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = gAnims_BasicFire,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimMoveTwisterParticle,
.tileTag = ANIM_TAG_SMALL_EMBER,
.paletteTag = ANIM_TAG_SMALL_EMBER,
.oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = gAnims_BasicFire,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimMoveTwisterParticle,
};

static void AnimLavaPlumeOrbitScatter(struct Sprite *sprite)
Expand Down
2 changes: 1 addition & 1 deletion src/battle_anim_flying.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ void AnimFlyBallAttack(struct Sprite *sprite)
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
sprite->data[3] = sprite->y;
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
sprite->data[5] = gBattleAnimArgs[1]; // if sprite is to remain invisible
sprite->data[5] = gBattleAnimArgs[1]; // if sprite is to remain invisible

InitAnimLinearTranslation(sprite);
sprite->callback = AnimFlyBallAttack_Step;
Expand Down
Loading
Loading