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

Naming a few boost related variables #281

Merged
merged 3 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
32 changes: 16 additions & 16 deletions src/engine/fox_play.c
Original file line number Diff line number Diff line change
Expand Up @@ -4949,8 +4949,8 @@ void Player_UpdateTankRoll(Player* player) {
}

void Player_ArwingBoost(Player* player) {
f32 sp2C;
f32 sp28;
f32 boostRecoverRate;
f32 boostDepleteRate;
s32 stickY;

if ((player->boostMeter != 0.0f) && (gInputHold->button & gBrakeButton[player->num]) &&
Expand All @@ -4959,12 +4959,12 @@ void Player_ArwingBoost(Player* player) {
}

if (gLevelMode == LEVELMODE_ON_RAILS) {
sp28 = 3.0f;
sp2C = 0.5f;
boostDepleteRate = 3.0f;
boostRecoverRate = 0.5f;

} else {
sp28 = 1.5f;
sp2C = 0.35f;
boostDepleteRate = 1.5f;
boostRecoverRate = 0.35f;
}

player->sfx.boost = 0;
Expand Down Expand Up @@ -5044,7 +5044,7 @@ void Player_ArwingBoost(Player* player) {
Math_SmoothStepToF(&player->arwing.upperLeftFlapYrot, 0.0f, 0.5f, 100.0f, 0.0f);
Math_SmoothStepToF(&player->arwing.bottomLeftFlapYrot, 0.0f, 0.5f, 100.0f, 0.0f);
}
player->boostMeter += sp28;
player->boostMeter += boostDepleteRate;
if (player->boostMeter > 90.0f) {
player->boostMeter = 90.0f;
player->boostCooldown = true;
Expand All @@ -5063,7 +5063,7 @@ void Player_ArwingBoost(Player* player) {
Math_SmoothStepToF(&D_ctx_801779A8[player->num], 50.0f, 1.0f, 10.0f, 0.0f);
} else {
if (player->boostMeter > 0.0f) {
player->boostMeter -= sp2C;
player->boostMeter -= boostRecoverRate;
if (player->boostMeter <= 0.0f) {
player->boostMeter = 0.0f;
player->boostCooldown = false;
Expand All @@ -5085,16 +5085,16 @@ void Player_ArwingBoost2(Player* player) {
}

void Player_ArwingBrake(Player* player) {
f32 sp34;
f32 sp30;
f32 brakeRecoverRate;
f32 brakeDepleteRate;
s32 stickY;

if (gLevelMode == LEVELMODE_ON_RAILS) {
sp30 = 3.0f;
sp34 = 0.5f;
brakeDepleteRate = 3.0f;
brakeRecoverRate = 0.5f;
} else {
sp30 = 1.5f;
sp34 = 0.35f;
brakeDepleteRate = 1.5f;
brakeRecoverRate = 0.35f;
}

player->sfx.brake = false;
Expand Down Expand Up @@ -5143,7 +5143,7 @@ void Player_ArwingBrake(Player* player) {
Math_SmoothStepToF(&player->arwing.bottomLeftFlapYrot, -90.0f, 0.2f, 100.0f, 0.0f);
}

player->boostMeter += sp30;
player->boostMeter += brakeDepleteRate;
if (player->boostMeter > 90.0f) {
player->boostCooldown = true;
player->boostMeter = 90.0f;
Expand All @@ -5159,7 +5159,7 @@ void Player_ArwingBrake(Player* player) {
player->sfx.brake = true;
Math_SmoothStepToF(&D_ctx_801779A8[player->num], 25.0f, 1.0f, 5.0f, 0.0f);
} else if (player->boostMeter > 0.0f) {
player->boostMeter -= sp34;
player->boostMeter -= brakeRecoverRate;
if (player->boostMeter <= 0.0f) {
player->boostMeter = 0.0f;
player->boostCooldown = false;
Expand Down
16 changes: 8 additions & 8 deletions src/engine/fox_tank.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ u8 D_800C9F04 = 0;
u8 D_800C9F08 = 0;
s32 D_800C9F0C = 0; // unused.
f32 D_800C9F10 = 0.0f;
s32 D_800C9F14 = 0;
s32 gTankActiveBurnerCount = 0;
Kiloku marked this conversation as resolved.
Show resolved Hide resolved
s32 D_800C9F18[2] = { 0, 0 }; // unused.
f32 D_800C9F20 = 0.0f;
f32 D_800C9F24 = 0.0f;
Expand Down Expand Up @@ -549,7 +549,7 @@ void func_tank_80045348(Player* player) {

if (player->unk_19C >= 0) {
if ((gBoostButton[player->num] & gInputHold->button) && !player->boostCooldown) {
D_800C9F14++;
gTankActiveBurnerCount++;
sp2E = true;
if (D_800C9F24 == 0.0f) {
player->unk_190 = player->unk_194 = 4.0f;
Expand All @@ -572,7 +572,7 @@ void func_tank_80045348(Player* player) {
D_800C9F24 = 0.0f;
}
if ((gBrakeButton[player->num] & gInputHold->button) && !player->boostCooldown && !sp2E) {
D_800C9F14++;
gTankActiveBurnerCount++;
baseSpeedTarget = 5.0f;
sp40 = 100.0f;
sp3C = 0.2f;
Expand All @@ -599,7 +599,7 @@ void func_tank_80045678(Player* player) {
Audio_KillSfxBySourceAndId(player->sfxSource, NA_SE_TANK_SLIDE);
}
if ((gInputHold->button & Z_TRIG) && !player->boostCooldown) {
D_800C9F14++;
gTankActiveBurnerCount++;
if (D_800C9F20 == 0.0f) {
AUDIO_PLAY_SFX(NA_SE_TANK_BURNER_HALF, player->sfxSource, 0);
}
Expand Down Expand Up @@ -629,7 +629,7 @@ void func_tank_80045678(Player* player) {
Audio_KillSfxBySourceAndId(player->sfxSource, NA_SE_TANK_SLIDE);
}
if ((gInputHold->button & R_TRIG) && !player->boostCooldown) {
D_800C9F14++;
gTankActiveBurnerCount++;
if (player->unk_2C0 == 0.0f) {
AUDIO_PLAY_SFX(NA_SE_TANK_BURNER_HALF, player->sfxSource, 0);
}
Expand Down Expand Up @@ -1115,12 +1115,12 @@ void Tank_UpdateOnRails(Player* player) {

player->wingPosition = 1;
func_tank_80045130(player);
D_800C9F14 = 0;
gTankActiveBurnerCount = 0;
func_tank_80045678(player);
func_tank_80045348(player);
if (!player->boostCooldown) {
if (D_800C9F14 != 0) {
if (D_800C9F14 >= 2) {
if (gTankActiveBurnerCount != 0) {
if (gTankActiveBurnerCount >= 2) {
player->boostMeter += 2.0f;
} else {
player->boostMeter += 1.0f;
Expand Down
Loading