Replace effect magic numbers with defined values

This commit is contained in:
Jed Grabman 2025-06-30 14:36:17 -04:00
parent c16d6f9934
commit 3190ad2a7a
15 changed files with 329 additions and 320 deletions

View File

@ -329,7 +329,9 @@ enum PLACE { FIRST_PLACE, SECOND_PLACE, THIRD_PLACE, FOURTH_PLACE };
* for effects
*/
#define BRAKING_EFFECT 0x1 // pressing brake
#define UNKNOWN_EFFECT_0x2 0x2 //
#define BOOST_RAMP_WOOD_EFFECT 0x4 // being boosted by a ramp
#define UNKNOWN_EFFECT_0x8 0x8 //
#define UNKNOWN_EFFECT_0xC 0xC //
#define DRIFTING_EFFECT 0x10 // drifting
#define UNKNOWN_EFFECT_0x20 0x20 //
@ -337,9 +339,16 @@ enum PLACE { FIRST_PLACE, SECOND_PLACE, THIRD_PLACE, FOURTH_PLACE };
#define BANANA_SPINOUT_EFFECT 0x80 // spinout (from hitting a banana or another driver)
#define MINI_TURBO_EFFECT 0x100 // mini-turbo
#define STAR_EFFECT 0x200 // being a star
#define UNKNOWN_EFFECT_0x400 0x400 //
#define UNKNOWN_EFFECT_0x800 0x800 //
#define LOST_RACE_EFFECT 0x1000 // lost race
#define BOOST_EFFECT 0x2000 // being boosted by trigger a mushroom
#define UNKNOWN_EFFECT_0x4000 0x4000 //
#define UNKNOWN_EFFECT_0x8000 0x8000 //
#define TERRAIN_TUMBLE_EFFECT 0x10000 // tumbling after hitting steep terrain
#define UNKNOWN_EFFECT_0x20000 0x20000 //
#define UNKNOWN_EFFECT_0x40000 0x40000 //
#define UNKNOWN_EFFECT_0x80000 0x80000 //
#define BOOST_RAMP_ASPHALT_EFFECT 0x100000 // being boosted by a boost pad
#define CPU_FAST_EFFECT 0x200000 // CPU Rubberbanding flag?
#define REVERSE_EFFECT 0x400000 // being in reverse of the course

View File

@ -51,7 +51,7 @@ void update_actor_kiwano_fruit(struct KiwanoFruit* fruit) {
if ((player->effects & STAR_EFFECT) != 0) {
func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0xA0, 0x52));
} else {
player->effects |= 0x8000;
player->effects |= UNKNOWN_EFFECT_0x8000;
player->pos[0] -= temp_f2 * 4.0f;
player->pos[2] -= temp_f14 * 4.0f;
player->velocity[0] -= temp_f2 * 0.7f;

View File

@ -375,7 +375,7 @@ void func_8001CCEC(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a
arg2[0] += (x - camera->lookAt[0]) * D_80164A78[index];
arg2[2] += ((z - camera->lookAt[2]) * D_80164A78[index]);
if ((((player->speed / 18) * 216) <= 5.0f) && ((player->effects & 2) == 2)) {
if ((((player->speed / 18) * 216) <= 5.0f) && ((player->effects & UNKNOWN_EFFECT_0x2) == UNKNOWN_EFFECT_0x2)) {
arg2[1] += ((y - camera->lookAt[1]) * 0.02);
} else {
arg2[1] += ((y - camera->lookAt[1]) * 0.5);
@ -394,7 +394,7 @@ void func_8001CCEC(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a
*arg3 = camera->pos[0] + ((x - camera->pos[0]) * D_80164A78[index]);
*arg5 = camera->pos[2] + ((z - camera->pos[2]) * D_80164A78[index]);
if ((((player->speed / 18) * 216) <= 5.0f) && ((player->effects & 2) == 2)) {
if ((((player->speed / 18) * 216) <= 5.0f) && ((player->effects & UNKNOWN_EFFECT_0x2) == UNKNOWN_EFFECT_0x2)) {
*arg4 = camera->pos[1] + (((y - camera->pos[1]) * 0.01));
} else {
*arg4 = camera->pos[1] + (((y - camera->pos[1]) * 0.15));
@ -595,7 +595,7 @@ void func_8001D944(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a
arg2[0] += (x - camera->lookAt[0]) * D_80164A78[index];
arg2[2] += ((z - camera->lookAt[2]) * D_80164A78[index]);
if ((((player->speed / 18) * 216) <= 5.0f) && ((player->effects & 2) == 2)) {
if ((((player->speed / 18) * 216) <= 5.0f) && ((player->effects & UNKNOWN_EFFECT_0x2) == UNKNOWN_EFFECT_0x2)) {
arg2[1] += ((y - camera->lookAt[1]) * 0.02);
} else {
arg2[1] += ((y - camera->lookAt[1]) * 0.5);
@ -614,7 +614,7 @@ void func_8001D944(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a
*arg3 = camera->pos[0] + ((x - camera->pos[0]) * D_80164A78[index]);
*arg5 = camera->pos[2] + ((z - camera->pos[2]) * D_80164A78[index]);
if ((((player->speed / 18) * 216) <= 5.0f) && ((player->effects & 2) == 2)) {
if ((((player->speed / 18) * 216) <= 5.0f) && ((player->effects & UNKNOWN_EFFECT_0x2) == UNKNOWN_EFFECT_0x2)) {
*arg4 = camera->pos[1] + (((y - camera->pos[1]) * 0.01));
} else {
*arg4 = camera->pos[1] + (((y - camera->pos[1]) * 0.15));
@ -729,7 +729,7 @@ void func_8001E45C(Camera* camera, Player* player, s8 arg2) {
move_s16_towards(&camera->unk_B0, 0, 0.05f);
var_a3 = ((s16) camera->unk_2C / 182) - ((s16) player->rotation[1] / 182);
if (player->unk_078 == 0) {
if ((player->effects & 0x20) == 0x20) {
if ((player->effects & UNKNOWN_EFFECT_0x20) == UNKNOWN_EFFECT_0x20) {
var_a3 = 0x02D8;
} else {
var_a3 = 0x01F4;
@ -746,11 +746,11 @@ void func_8001E45C(Camera* camera, Player* player, s8 arg2) {
var_a3 = (player->unk_078 / 2) + 0xA5;
}
}
if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40) ||
((player->effects & 0x4000) == 0x4000) || ((player->effects & 0x80000) == 0x80000) ||
((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || (((player->effects & 0x20) == 0x20) && (player->unk_078 != 0)) ||
if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) ||
((player->effects & UNKNOWN_EFFECT_0x4000) == UNKNOWN_EFFECT_0x4000) || ((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) ||
((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || (((player->effects & UNKNOWN_EFFECT_0x20) == UNKNOWN_EFFECT_0x20) && (player->unk_078 != 0)) ||
(player->collision.surfaceDistance[0] <= 0.0f) || (player->collision.surfaceDistance[1] <= 0.0f) ||
((player->effects & 0x20000) == 0x20000)) {
((player->effects & UNKNOWN_EFFECT_0x20000) == UNKNOWN_EFFECT_0x20000)) {
func_8001CCEC(player, camera, sp64, &sp84, &sp80, &sp7C, &sp58, (s32) camera->unk_2C, (s32) arg2);
} else {
adjust_angle(&camera->unk_2C, (s16) (player->rotation[1] + camera->unk_B0), var_a3);
@ -852,7 +852,7 @@ void func_8001EA0C(Camera* camera, Player* player, s8 arg2) {
move_s16_towards(&camera->unk_B0, 0, 0.05f);
var_a3 = ((s16) camera->unk_2C / 182) - ((s16) player->rotation[1] / 182);
if (player->unk_078 == 0) {
if ((player->effects & 0x20) == 0x20) {
if ((player->effects & UNKNOWN_EFFECT_0x20) == UNKNOWN_EFFECT_0x20) {
var_a3 = 0x02D8;
} else {
var_a3 = 0x01F4;
@ -869,11 +869,11 @@ void func_8001EA0C(Camera* camera, Player* player, s8 arg2) {
var_a3 = (player->unk_078 / 2) + 0xA5;
}
}
if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40) ||
((player->effects & 0x4000) == 0x4000) || ((player->effects & 0x80000) == 0x80000) ||
((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || (((player->effects & 0x20) == 0x20) && (player->unk_078 != 0)) ||
if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) ||
((player->effects & UNKNOWN_EFFECT_0x4000) == UNKNOWN_EFFECT_0x4000) || ((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) ||
((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || (((player->effects & UNKNOWN_EFFECT_0x20) == UNKNOWN_EFFECT_0x20) && (player->unk_078 != 0)) ||
(player->collision.surfaceDistance[0] <= 0.0f) || (player->collision.surfaceDistance[1] <= 0.0f) ||
((player->effects & 0x20000) == 0x20000)) {
((player->effects & UNKNOWN_EFFECT_0x20000) == UNKNOWN_EFFECT_0x20000)) {
func_8001D944(player, camera, sp64, &sp84, &sp80, &sp7C, &sp58, (s32) camera->unk_2C, (s32) arg2);
} else {
adjust_angle(&camera->unk_2C, (s16) (player->rotation[1] + camera->unk_B0), var_a3);
@ -1036,7 +1036,7 @@ void func_8001F394(Player* player, f32* arg1) {
if ((player->soundEffects & 0x100) == 0x100) {
D_80164A08[playerIndex] = 4;
}
if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40)) {
if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT)) {
D_80164A08[playerIndex] = 5;
}
D_80164498[playerIndex] = 0.0f;
@ -1070,7 +1070,7 @@ void func_8001F394(Player* player, f32* arg1) {
break;
case 3:
if (((player->effects & BOOST_RAMP_ASPHALT_EFFECT) == BOOST_RAMP_ASPHALT_EFFECT) &&
((player->effects & 8) == 8)) {
((player->effects & UNKNOWN_EFFECT_0x8) == UNKNOWN_EFFECT_0x8)) {
move_f32_towards(&D_80164498[playerIndex], 20.0f, 0.1f);
} else {
if (D_80164498[playerIndex] > 1.0f) {
@ -1094,7 +1094,7 @@ void func_8001F394(Player* player, f32* arg1) {
}
break;
case 5:
if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40)) {
if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT)) {
move_f32_towards(&D_80164498[playerIndex], 18.0f, 0.2f);
} else {
if (D_80164498[playerIndex] > 1.0f) {

View File

@ -296,7 +296,7 @@ void func_8003F734(Player* player, Vec3f arg1, Vec3f arg2, f32* arg3, f32* arg4,
*arg5 += arg1[1] * player->collision.surfaceDistance[0] * 0.1;
*arg6 += arg1[2] * player->collision.surfaceDistance[0] * 1;
func_8002A5F4(arg1, *arg3, arg2, 1, 0);
if ((!(player->effects & TERRAIN_TUMBLE_EFFECT)) && ((player->effects & 8) == 0)) {
if ((!(player->effects & TERRAIN_TUMBLE_EFFECT)) && ((player->effects & UNKNOWN_EFFECT_0x8) == 0)) {
arg2[1] *= -1e-05;
}
} else {
@ -309,11 +309,11 @@ void func_8003F734(Player* player, Vec3f arg1, Vec3f arg2, f32* arg3, f32* arg4,
}
*arg6 += arg1[2] * player->collision.surfaceDistance[0] * 1;
func_8002A5F4(arg1, *arg3, arg2, 1.2f, 0);
if ((!(player->effects & TERRAIN_TUMBLE_EFFECT)) && ((player->effects & 8) == 0)) {
if ((!(player->effects & TERRAIN_TUMBLE_EFFECT)) && ((player->effects & UNKNOWN_EFFECT_0x8) == 0)) {
arg2[1] *= -1e-05;
}
}
player->effects &= ~0x10;
player->effects &= ~DRIFTING_EFFECT;
temp_f12 = player->collision.surfaceDistance[0] * arg1[0];
temp_f14 = player->collision.surfaceDistance[0] * arg1[2];
if (((temp_f12 >= 0) && (temp_f14 >= 0)) || ((temp_f12 < 0) && (temp_f14 >= 0))) {
@ -350,7 +350,7 @@ void func_8003FBAC(Player* player, Vec3f arg1, Vec3f arg2, f32* arg3, f32* arg4,
*arg5 += arg1[1] * player->collision.surfaceDistance[1] * 0.1;
*arg6 += arg1[2] * player->collision.surfaceDistance[1] * 1;
func_8002A5F4(arg1, *arg3, arg2, 1, 0);
if ((!(player->effects & TERRAIN_TUMBLE_EFFECT)) && ((player->effects & 8) == 0)) {
if ((!(player->effects & TERRAIN_TUMBLE_EFFECT)) && ((player->effects & UNKNOWN_EFFECT_0x8) == 0)) {
arg2[1] *= -1e-05;
}
} else {
@ -363,11 +363,11 @@ void func_8003FBAC(Player* player, Vec3f arg1, Vec3f arg2, f32* arg3, f32* arg4,
}
*arg6 += arg1[2] * player->collision.surfaceDistance[1] * 1;
func_8002A5F4(arg1, *arg3, arg2, 1.2f, 0);
if ((!(player->effects & TERRAIN_TUMBLE_EFFECT)) && ((player->effects & 8) == 0)) {
if ((!(player->effects & TERRAIN_TUMBLE_EFFECT)) && ((player->effects & UNKNOWN_EFFECT_0x8) == 0)) {
arg2[1] *= -1e-05;
}
}
player->effects &= ~0x10;
player->effects &= ~DRIFTING_EFFECT;
temp_f12 = player->collision.surfaceDistance[1] * arg1[0];
temp_f14 = player->collision.surfaceDistance[1] * arg1[2];
if (((temp_f12 >= 0) && (temp_f14 >= 0)) || ((temp_f12 >= 0) && (temp_f14 < 0))) {

View File

@ -3376,7 +3376,7 @@ void func_8005F90C(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
f32 var_f12;
var_t1 = 0;
if ((player->effects & 0x80) == 0x80) {
if ((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) {
var_f0 = player->pos[0];
var_f2 = player->pos[1] - player->boundingBoxSize;
var_f12 = player->pos[2];
@ -3825,7 +3825,7 @@ void func_80061754(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s32 arg3, U
set_particle_position_and_rotation(player, &player->particles[0x1E + arg1], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0);
init_new_particle_player(&player->particles[0x1E + arg1], 6, 1.0f);
if ((player->effects & HIT_BY_ITEM_EFFECT) || ((player->effects) & UNKNOWN_EFFECT_0x1000000) ||
((player->effects) & 0x400) || ((player->effects) & BOO_EFFECT)) {
((player->effects) & UNKNOWN_EFFECT_0x400) || ((player->effects) & BOO_EFFECT)) {
set_particle_colour(&player->particles[0x1E + arg1], 0x00FFFFFF, 0x00A0);
player->particles[0x1E + arg1].red -= temp_s1;
player->particles[0x1E + arg1].green -= temp_s1;
@ -4382,7 +4382,7 @@ void func_80063408(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) {
++player->particles[10 + arg1].timer;
player->particles[10 + arg1].pos[1] += 1.0f;
if (((player->effects & 0x80) != 0) || ((player->effects & 0x40) != 0)) {
if (((player->effects & BANANA_SPINOUT_EFFECT) != 0) || ((player->effects & DRIVING_SPINOUT_EFFECT) != 0)) {
player->particles[10 + arg1].IsAlive = 0;
player->particles[10 + arg1].timer = 0;
}
@ -4444,7 +4444,7 @@ void func_800635D4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) {
++player->particles[10 + arg1].timer;
player->particles[10 + arg1].pos[1] += 0.2;
if (((player->effects & 0x80) != 0) || ((player->effects & 0x40) != 0)) {
if (((player->effects & BANANA_SPINOUT_EFFECT) != 0) || ((player->effects & DRIVING_SPINOUT_EFFECT) != 0)) {
player->particles[10 + arg1].IsAlive = 0;
player->particles[10 + arg1].timer = 0;
}
@ -4927,13 +4927,13 @@ void func_800650FC(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) {
player->particles[20 + arg3].pos[2] = (f32) player->pos[2];
player->particles[20 + arg3].pos[0] = (f32) player->pos[0];
player->particles[20 + arg3].pos[1] = (f32) (player->pos[1] + 4.0f);
if ((player->effects & 0x80) == 0x80) {
if ((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) {
player->particles[20 + arg3].rotation += 4732;
} else {
player->particles[20 + arg3].rotation -= 4732;
}
if (((player->effects & 0x80) != 0x80) && ((player->effects & 0x40) != 0x40)) {
if (((player->effects & BANANA_SPINOUT_EFFECT) != BANANA_SPINOUT_EFFECT) && ((player->effects & DRIVING_SPINOUT_EFFECT) != DRIVING_SPINOUT_EFFECT)) {
player->particles[20 + arg3].IsAlive = 0;
player->particles[20 + arg3].timer = 0;
player->particles[20 + arg3].type = 0;
@ -6262,17 +6262,17 @@ void func_8006C6AC(Player* player, s16 arg1, s8 arg2, s8 arg3) {
} else {
if (player->unk_0DE & 1) {
func_80060BCC(player, arg1, sp28, arg2_copy, arg3);
} else if (!(player->effects & 8) && !(player->effects & 2)) {
} else if (!(player->effects & UNKNOWN_EFFECT_0x8) && !(player->effects & UNKNOWN_EFFECT_0x2)) {
if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) &&
((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) {
check_drift_particles_setup_valid(player, arg1, sp28, arg2_copy, arg3);
} else if (((f64) (D_801652A0[arg2_copy] - player->tyres[BACK_RIGHT].baseHeight) >= 3.5) ||
((f64) (D_801652A0[arg2_copy] - player->tyres[BACK_LEFT].baseHeight) >= 3.5)) {
func_8005EA94(player, arg1, sp28, arg2_copy, arg3);
} else if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40)) {
} else if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT)) {
func_8005F90C(player, arg1, sp28, arg2_copy, arg3);
} else if (((player->effects & 0x4000) && !(player->type & PLAYER_START_SEQUENCE)) ||
(player->effects & 0x800) || (player->effects & 0x20) || (player->unk_044 & 0x4000)) {
} else if (((player->effects & UNKNOWN_EFFECT_0x4000) && !(player->type & PLAYER_START_SEQUENCE)) ||
(player->effects & UNKNOWN_EFFECT_0x800) || (player->effects & UNKNOWN_EFFECT_0x20) || (player->unk_044 & 0x4000)) {
func_8005ED48(player, arg1, sp28, arg2_copy, arg3);
} else {
setup_tyre_particles(player, arg1, sp28, arg2_copy, arg3);
@ -6338,7 +6338,7 @@ void func_8006C9B8(Player* player, s16 arg1, s8 playerIndex, s8 arg3) {
if (((((player->unk_0CA & 0x1000) == 0x1000) ||
((player->unk_0E0 < 2) && (player->effects & UNKNOWN_EFFECT_0x1000000))) ||
((player->unk_0E0 < 2) && (player->effects & HIT_BY_ITEM_EFFECT))) ||
(player->effects & 0x400)) {
(player->effects & UNKNOWN_EFFECT_0x400)) {
func_8006199C(player, arg1, sp28, playerIndex, arg3);
player->unk_046 &= ~0x0008;
player->unk_044 &= ~0x0100;
@ -6371,7 +6371,7 @@ void func_8006C9B8(Player* player, s16 arg1, s8 playerIndex, s8 arg3) {
func_800621BC(player, arg1, sp28, playerIndex, arg3);
return;
}
if (((player->effects & 0x200000) || (player->effects & BOOST_RAMP_ASPHALT_EFFECT)) &&
if (((player->effects & CPU_FAST_EFFECT) || (player->effects & BOOST_RAMP_ASPHALT_EFFECT)) &&
((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) {
func_80061EF4(player, arg1, sp28, playerIndex, arg3);
player->unk_046 &= ~0x0008;
@ -6414,7 +6414,7 @@ void func_8006CEC0(Player* arg0, s16 arg1, s8 arg2, s8 arg3) {
if ((arg0->unk_044 & 0x200) && (arg0->type & 0x4000)) {
func_80061224(arg0, arg1, sp20, arg2, arg3);
return;
} else if (((arg0->effects & 0x40000000) == 0x40000000) && (arg0->unk_0B0 < 0x32)) {
} else if (((arg0->effects & LIGHTNING_EFFECT) == LIGHTNING_EFFECT) && (arg0->unk_0B0 < 0x32)) {
func_80061094(arg0, arg1, sp20, arg2, arg3);
return;
} else if ((arg0->type & 0x4000) == 0x4000) {
@ -6428,7 +6428,7 @@ void func_8006CEC0(Player* arg0, s16 arg1, s8 arg2, s8 arg3) {
}
switch (gActiveScreenMode) {
case SCREEN_MODE_1P:
if (((arg0->effects & 0x04000000) != 0x04000000) && ((arg0->effects & 0x400) != 0x400) &&
if (((arg0->effects & 0x04000000) != 0x04000000) && ((arg0->effects & UNKNOWN_EFFECT_0x400) != UNKNOWN_EFFECT_0x400) &&
((arg0->effects & UNKNOWN_EFFECT_0x1000000) != UNKNOWN_EFFECT_0x1000000)) {
if (((arg0->unk_0CA & 2) != 2) && ((arg0->unk_0CA & 0x10) != 0x10) && !(arg0->unk_0CA & 0x100)) {
func_80060504(arg0, arg1, sp20, arg2, arg3);
@ -6441,7 +6441,7 @@ void func_8006CEC0(Player* arg0, s16 arg1, s8 arg2, s8 arg3) {
case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL:
case SCREEN_MODE_3P_4P_SPLITSCREEN:
if (((arg0->type & 0x4000) != 0) && ((arg0->effects & 0x04000000) != 0x04000000) &&
((arg0->effects & 0x400) != 0x400) &&
((arg0->effects & UNKNOWN_EFFECT_0x400) != UNKNOWN_EFFECT_0x400) &&
((arg0->effects & UNKNOWN_EFFECT_0x1000000) != UNKNOWN_EFFECT_0x1000000)) {
if (((arg0->unk_0CA & 2) != 2) && ((arg0->unk_0CA & 0x10) != 0x10) && !(arg0->unk_0CA & 0x100)) {
func_80060504(arg0, arg1, sp20, arg2, arg3);

View File

@ -1043,7 +1043,7 @@ f32 func_8008933C(Player* player, s32 objectIndex, f32 arg2, f32 arg3) {
if (temp_v1->unk_18[6] == 0) {
object = &gObjectList[objectIndex];
player->unk_046 |= 2;
player->effects |= 0x8000;
player->effects |= UNKNOWN_EFFECT_0x8000;
temp_v1->unk_18[6] = 4;
something = (player->pos[0] - object->pos[0]) * object->velocity[0];
if (something >= 0.0f) {

View File

@ -1239,7 +1239,7 @@ void update_player_path_completion(s32 playerId, Player* player) {
s16 var_t0 = 0;
if (gCurrentCourseId == COURSE_KALAMARI_DESERT) {
D_801634EC = 0;
if (player->effects & 0x200) {
if (player->effects & STAR_EFFECT) {
D_801634EC = 1;
}
if (gIsMirrorMode != 0) {
@ -1353,7 +1353,7 @@ void update_vehicles(void) {
void play_cpu_sound_effect(s32 arg0, Player* player) {
if (D_80163398[arg0] >= 0xB) {
if ((player->effects & 0x80) || (player->effects & 0x40) || (player->effects & 0x20000)) {
if ((player->effects & BANANA_SPINOUT_EFFECT) || (player->effects & DRIVING_SPINOUT_EFFECT) || (player->effects & UNKNOWN_EFFECT_0x20000)) {
func_800C92CC(arg0, SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0A));
D_80163398[arg0] = 0;
}
@ -1521,7 +1521,7 @@ void update_player(s32 playerId) {
}
if (D_801631E0[playerId] == true) {
D_801630E8[playerId] = 0;
player->effects &= ~0x10;
player->effects &= ~DRIFTING_EFFECT;
if ((playerId & 1) != (gIncrementUpdatePlayer & 1)) {
apply_cpu_turn(player, 0);
regulate_cpu_speed(playerId, gPreviousCpuTargetSpeed[playerId], player);
@ -1543,7 +1543,7 @@ void update_player(s32 playerId) {
determine_ideal_cpu_position_offset(playerId, gCurrentNearestPathPoint);
distX = gOffsetPosition[0] - player->pos[0];
minAngle = gOffsetPosition[2] - player->pos[2];
if (!(player->effects & 0x80) && !(player->effects & 0x40) && !(player->effects & 0x800)) {
if (!(player->effects & BANANA_SPINOUT_EFFECT) && !(player->effects & DRIVING_SPINOUT_EFFECT) && !(player->effects & UNKNOWN_EFFECT_0x800)) {
if (((distX * distX) + (minAngle * minAngle)) > 6400.0f) {
if (gPlayerPathIndex == 0) {
func_8000B140(playerId);
@ -1597,13 +1597,13 @@ void update_player(s32 playerId) {
case -1:
if (steeringSensitivity > 5) {
D_801630E8[playerId] = 0;
player->effects &= ~0x10;
player->effects &= ~DRIFTING_EFFECT;
}
break;
case 1:
if (steeringSensitivity < -5) {
D_801630E8[playerId] = 0;
player->effects &= ~0x10;
player->effects &= ~DRIFTING_EFFECT;
}
break;
default:
@ -1700,9 +1700,9 @@ void update_player(s32 playerId) {
if ((cpu_BehaviourState[playerId] == CPU_BEHAVIOUR_STATE_RUNNING) &&
((gTrackPositionFactor[playerId] > 0.9f) || (gTrackPositionFactor[playerId] < -0.9f))) {
D_801630E8[playerId] = 0;
player->effects &= ~0x10;
player->effects &= ~DRIFTING_EFFECT;
}
if (player->effects & 2) {
if (player->effects & UNKNOWN_EFFECT_0x2) {
switch (D_801630E8[playerId]) {
case 1:
newAngle = 0x0035;
@ -2422,7 +2422,7 @@ void func_80015390(Camera* camera, UNUSED Player* player, UNUSED s32 arg2) {
} else {
var_a2 = 0xA0 + (temp_s1->unk_078 / 16);
}
if (!((temp_s1->effects & 0x80) || (temp_s1->effects & 0x40))) {
if (!((temp_s1->effects & BANANA_SPINOUT_EFFECT) || (temp_s1->effects & DRIVING_SPINOUT_EFFECT))) {
adjust_angle(&camera->unk_2C, temp_s1->rotation[1], var_a2);
}
func_8001D794(temp_s1, camera, sp64, &sp84, &sp80, &sp7C, camera->unk_2C);

View File

@ -47,7 +47,7 @@ void cpu_behaviour_start(s32 playerId, Player* player) {
break;
case BEHAVIOUR_HOP:
kart_hop(player);
player->effects &= ~0x10;
player->effects &= ~DRIFTING_EFFECT;
D_801630E8[playerId] = 0;
break;
case BEHAVIOUR_DRIVE_CENTER:
@ -95,7 +95,7 @@ void cpu_behaviour_end(s32 playerIndex, Player* player) {
if (nearestPathPoint >= pathPointEnd) {
switch (behaviourType) {
case BEHAVIOUR_1:
player->effects &= ~0x10;
player->effects &= ~DRIFTING_EFFECT;
D_801630E8[playerIndex] = 0;
cpu_BehaviourState[playerIndex] = CPU_BEHAVIOUR_STATE_START;
break;

View File

@ -133,7 +133,7 @@ void regulate_cpu_speed(s32 playerId, f32 targetSpeed, Player* player) {
s32 var_a1;
speed = player->speed;
if (!(player->effects & 0x80) && !(player->effects & 0x40) && !(player->effects & 0x20000) &&
if (!(player->effects & BANANA_SPINOUT_EFFECT) && !(player->effects & DRIVING_SPINOUT_EFFECT) && !(player->effects & UNKNOWN_EFFECT_0x20000) &&
!(player->soundEffects & 0x400000) && !(player->soundEffects & 0x01000000) && !(player->soundEffects & 2) &&
!(player->soundEffects & 4)) {
if (gCurrentCourseId == COURSE_AWARD_CEREMONY) {

View File

@ -145,14 +145,14 @@ UNUSED void func_unnamed34(void) {
void clean_effect(Player* player, s8 playerIndex) {
if ((player->effects & 0x400) == 0x400) {
if ((player->effects & UNKNOWN_EFFECT_0x400) == UNKNOWN_EFFECT_0x400) {
func_8008C6D0(player, playerIndex);
}
if (((player->effects & 0x80) == 0x80) || (player->effects & 0x40) == 0x40) {
if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || (player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) {
func_8008C8C4(player, playerIndex);
}
if ((player->effects & 0x800) == 0x800) {
if ((player->effects & UNKNOWN_EFFECT_0x800) == UNKNOWN_EFFECT_0x800) {
func_8008D0E4(player, playerIndex);
}
if ((player->unk_044 & 0x4000) != 0) {
@ -161,7 +161,7 @@ void clean_effect(Player* player, s8 playerIndex) {
if ((player->effects & BOOST_EFFECT) == BOOST_EFFECT) {
remove_boost_effect(player);
}
if ((player->effects & 0x80000) == 0x80000) {
if ((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) {
func_8008D760(player);
}
if ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) {
@ -179,7 +179,7 @@ void clean_effect(Player* player, s8 playerIndex) {
if ((player->effects & BOOST_RAMP_WOOD_EFFECT) == BOOST_RAMP_WOOD_EFFECT) {
remove_boost_ramp_wood_effect(player);
}
if ((player->effects & 0x4000) == 0x4000) {
if ((player->effects & UNKNOWN_EFFECT_0x4000) == UNKNOWN_EFFECT_0x4000) {
func_8008F3E0(player);
}
if ((player->effects & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT) {
@ -189,7 +189,7 @@ void clean_effect(Player* player, s8 playerIndex) {
func_8008FEDC(player, playerIndex);
}
player->unk_044 = (s16) (player->unk_044 & 0xFFFE);
player->effects = (s32) (player->effects & ~0x20);
player->effects = (s32) (player->effects & ~UNKNOWN_EFFECT_0x20);
}
void func_8008C528(Player* player, s8 playerIndex) {
@ -204,8 +204,8 @@ void func_8008C528(Player* player, s8 playerIndex) {
player->kartHopVelocity = D_800E3790[temp_v1];
player->unk_0A8 = 0;
player->effects = player->effects | 0x400;
player->effects = player->effects & ~0x10;
player->effects = player->effects | UNKNOWN_EFFECT_0x400;
player->effects = player->effects & ~DRIFTING_EFFECT;
player->unk_0C0 = 0;
player->unk_236 = 2;
player->unk_042 = 0;
@ -241,7 +241,7 @@ void func_8008C6D0(Player* player, s8 playerIndex) {
player->unk_206 = 0;
player->slopeAccel = 0;
player->effects = (s32) (player->effects & ~0x400);
player->effects = (s32) (player->effects & ~UNKNOWN_EFFECT_0x400);
player->unk_0A8 = 0;
player->unk_0C0 = 0;
player->unk_07C = 0;
@ -297,7 +297,7 @@ void func_8008C8C4(Player* player, s8 playerId) {
player->rotation[1] = player->unk_0AE;
player->unk_07C = 0;
player->unk_0C0 = 0;
player->effects &= ~0x800;
player->effects &= ~UNKNOWN_EFFECT_0x800;
D_80165190[0][playerId] = 1;
D_80165190[1][playerId] = 1;
@ -334,7 +334,7 @@ void func_8008C9EC(Player* player, s8 playerIndex) {
player_decelerate_alternative(player, 30.0f);
}
}
if ((player->effects & 0x80) == 0x80) {
if ((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) {
player->rotation[1] -= sp30[player->unk_0B2];
D_8018D920[playerIndex] -= sp30[player->unk_0B2];
stackPadding1 = (u16) D_8018D920[playerIndex] / (0x10000 / (0x168 / (sp30[player->unk_0B2] / 182)));
@ -376,14 +376,14 @@ void func_8008CDC0(Player* player, s8 playerIndex) {
player->unk_0B4 = 0;
player->unk_0B8 = 3.0f;
player->unk_0AC = 1;
player->effects &= ~0x10;
player->effects &= ~DRIFTING_EFFECT;
if (((player->unk_07C >> 0x10) >= 0x14) || ((player->unk_07C >> 0x10) < -0x13) ||
(((player->speed / 18.0f) * 216.0f) <= 30.0f) || ((player->effects & 8) != 0) ||
(((player->speed / 18.0f) * 216.0f) <= 30.0f) || ((player->effects & UNKNOWN_EFFECT_0x8) != 0) ||
(((player->type & PLAYER_HUMAN) == 0) && ((player->effects & LOST_RACE_EFFECT) == 0))) {
func_8008C73C(player, playerIndex);
} else {
player->effects |= 0x800;
player->effects |= UNKNOWN_EFFECT_0x800;
}
}
@ -402,17 +402,17 @@ void func_8008CEB0(Player* player, s8 playerIndex) {
var_v1 = 0;
var_a3 = -var_a3;
var_f0 *= 0.8;
if ((player->effects & 1) == 1) {
player->effects |= 0x40000;
if ((player->effects & BRAKING_EFFECT) == BRAKING_EFFECT) {
player->effects |= UNKNOWN_EFFECT_0x40000;
}
if (var_f0 <= 1.0f) {
player->effects &= ~0x800;
if ((player->effects & 0x40000) != 0x40000) {
player->effects &= ~UNKNOWN_EFFECT_0x800;
if ((player->effects & UNKNOWN_EFFECT_0x40000) != UNKNOWN_EFFECT_0x40000) {
func_8008C73C(player, playerIndex);
var_v1 = 0;
} else {
player->unk_0B6 |= 0x20;
player->effects &= ~0x40000;
player->effects &= ~UNKNOWN_EFFECT_0x40000;
if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) {
func_800C90F4(playerIndex, (player->characterId * 0x10) + 0x29008008);
var_v1 = 0;
@ -431,14 +431,14 @@ void func_8008CEB0(Player* player, s8 playerIndex) {
player->unk_0B8 = var_f0;
player->unk_0B4 = var_v1;
player->unk_0AC = var_a3;
if (player->effects & 8) {
if (player->effects & UNKNOWN_EFFECT_0x8) {
func_8008C73C(player, playerIndex);
player->effects &= ~0x800;
player->effects &= ~UNKNOWN_EFFECT_0x800;
}
}
void func_8008D0E4(Player* player, UNUSED s8 playerIndex) {
player->effects &= ~0x800;
player->effects &= ~UNKNOWN_EFFECT_0x800;
}
void func_8008D0FC(Player* player, s8 playerIndex) {
@ -448,7 +448,7 @@ void func_8008D0FC(Player* player, s8 playerIndex) {
player->unk_0B4 = 0;
player->unk_0B8 = 2.0f;
player->unk_0AC = 1;
player->effects &= ~0x10;
player->effects &= ~DRIFTING_EFFECT;
player->unk_044 |= 0x4000;
}
@ -467,17 +467,17 @@ void func_8008D170(Player* player, s8 playerIndex) {
var_v1 = 0;
var_a3 = -var_a3;
var_f0 *= 0.9;
if (((player->effects & 1) == 1) || !(player->unk_044 & 0x20)) {
player->effects |= 0x40000;
if (((player->effects & BRAKING_EFFECT) == BRAKING_EFFECT) || !(player->unk_044 & 0x20)) {
player->effects |= UNKNOWN_EFFECT_0x40000;
}
if (var_f0 <= 1.3) {
player->unk_044 &= ~0x4000;
if ((player->effects & 0x40000) != 0x40000) {
if ((player->effects & UNKNOWN_EFFECT_0x40000) != UNKNOWN_EFFECT_0x40000) {
func_8008C73C(player, playerIndex);
var_v1 = 0;
} else {
player->unk_0B6 |= 0x20;
player->effects &= ~0x40000;
player->effects &= ~UNKNOWN_EFFECT_0x40000;
if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) {
func_800C90F4(playerIndex, (player->characterId * 0x10) + 0x29008008);
var_v1 = 0;
@ -496,7 +496,7 @@ void func_8008D170(Player* player, s8 playerIndex) {
player->unk_0B8 = var_f0;
player->unk_0B4 = var_v1;
player->unk_0AC = var_a3;
if (player->effects & 8) {
if (player->effects & UNKNOWN_EFFECT_0x8) {
func_8008C73C(player, playerIndex);
player->unk_044 &= ~0x4000;
}
@ -557,8 +557,8 @@ void func_8008D570(Player* player, s8 playerIndex) {
clean_effect(player, playerIndex);
player->unk_0AE = player->rotation[1];
player->effects |= 0x80000;
player->effects &= ~0x10;
player->effects |= UNKNOWN_EFFECT_0x80000;
player->effects &= ~DRIFTING_EFFECT;
player->soundEffects &= ~0x1000;
player->kartHopJerk = D_800E3730[player->characterId];
player->kartHopAcceleration = 0.0f;
@ -596,7 +596,7 @@ void func_8008D698(Player* player, s8 playerIndex) {
if (player->unk_0B2 <= 0) {
player->unk_0B2 = 0;
}
if ((player->unk_0B2 == 0) && ((player->effects & 8) != 8)) {
if ((player->unk_0B2 == 0) && ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8)) {
func_8008D760(player);
}
}
@ -617,7 +617,7 @@ void func_8008D7B0(Player* player, s8 playerIndex) {
player->unk_0AE = player->rotation[1];
player->effects |= UNKNOWN_EFFECT_0x800000;
player->effects &= ~0x10;
player->effects &= ~DRIFTING_EFFECT;
player->soundEffects &= ~0x20000;
player->kartHopJerk = D_800E3770[player->characterId];
player->kartHopAcceleration = 0.0f;
@ -650,7 +650,7 @@ void func_8008D8B4(Player* player, s8 playerIndex) {
if (player->unk_0B2 <= 0) {
player->unk_0B2 = 0;
}
if ((player->unk_0B2 == 0) && ((player->effects & 8) != 8)) {
if ((player->unk_0B2 == 0) && ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8)) {
func_8008D97C(player);
}
}
@ -801,7 +801,7 @@ void apply_hit_effect(Player* player, s8 playerIndex) {
player->unk_DB4.unk10 = 4.5f;
player->pos[1] -= 0.085;
if ((player->effects & 8) != 8) {
if ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) {
D_8018D990[playerIndex] = 3;
player->unk_238 = 0;
}
@ -832,7 +832,7 @@ void apply_hit_rotating_sound_effect(Player* player, s8 playerIndex) {
player->soundEffects &= ~HIT_ROTATING_SOUND_EFFECT;
player->effects |= 0x40020000;
player->effects &= ~0x10;
player->effects &= ~DRIFTING_EFFECT;
player->unk_08C *= 0.6;
player->unk_0B0 = 0;
player->size = 1.0f;
@ -863,8 +863,8 @@ void apply_hit_rotating_sound_effect(Player* player, s8 playerIndex) {
void apply_lightning_effect(Player* player, s8 playerIndex) {
s16 test;
if (((player->effects & 0x8000) == 0x8000) && ((player->effects & HIT_EFFECT) != HIT_EFFECT)) {
player->effects &= ~0x20000;
if (((player->effects & UNKNOWN_EFFECT_0x8000) == UNKNOWN_EFFECT_0x8000) && ((player->effects & HIT_EFFECT) != HIT_EFFECT)) {
player->effects &= ~UNKNOWN_EFFECT_0x20000;
player->unk_0A8 = 0;
player->unk_07C = 0;
player->unk_0C0 = 0;
@ -875,7 +875,7 @@ void apply_lightning_effect(Player* player, s8 playerIndex) {
D_80165190[2][playerIndex] = 1;
D_80165190[3][playerIndex] = 1;
apply_hit_sound_effect(player, playerIndex);
} else if ((player->effects & 0x20000) == 0x20000) {
} else if ((player->effects & UNKNOWN_EFFECT_0x20000) == UNKNOWN_EFFECT_0x20000) {
player->rotation[1] -= 0x5B0;
D_8018D920[playerIndex] -= 0x5B0;
test = (u16) D_8018D920[playerIndex] / 1456;
@ -883,7 +883,7 @@ void apply_lightning_effect(Player* player, s8 playerIndex) {
player->unk_0B2--;
if (player->unk_0B2 <= 0) {
player->unk_0A8 = 0;
player->effects &= ~0x20000;
player->effects &= ~UNKNOWN_EFFECT_0x20000;
player->unk_07C = 0;
player->unk_0C0 = 0;
player->rotation[1] = player->unk_0AE;
@ -924,11 +924,11 @@ void remove_lightning_effect(Player* player, UNUSED s8 playerIndex) {
player->unk_DB4.unk2 = 0;
player->effects |= UNKNOWN_EFFECT_0x8000000;
if ((player->effects & 0x20000) == 0x20000) {
if ((player->effects & UNKNOWN_EFFECT_0x20000) == UNKNOWN_EFFECT_0x20000) {
player->rotation[1] = player->unk_0AE;
}
player->effects &= ~0x20000;
player->effects &= ~UNKNOWN_EFFECT_0x20000;
}
void func_8008E4A4(Player* player, s8 playerIndex) {
@ -944,7 +944,7 @@ void func_8008E4A4(Player* player, s8 playerIndex) {
player->velocity[2] = 0.0f;
player->effects &= ~0xC0;
if ((player->effects & 8) != 8) {
if ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) {
++player->unk_0E0;
}
@ -998,7 +998,7 @@ void apply_reverse_sound_effect(Player* player, s8 playerIndex) {
player->unk_0A8 = 0;
player->effects |= UNKNOWN_EFFECT_0x1000000;
player->effects &= ~0x10;
player->effects &= ~DRIFTING_EFFECT;
player->kartHopJerk = 0.0f;
player->kartHopAcceleration = 0.0f;
player->kartHopVelocity = 0.0f;
@ -1055,7 +1055,7 @@ void apply_hit_by_item_effect(Player* player, s8 playerIndex) {
player->currentSpeed = 0.0f;
player->effects &= ~0xC0;
if ((player->effects & 8) != 8) {
if ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) {
++player->unk_0E0;
}
@ -1106,7 +1106,7 @@ void apply_hit_by_item_sound_effect(Player* player, s8 playerIndex) {
func_8008C310(player);
player->unk_0A8 = 0;
player->effects &= ~0x10;
player->effects &= ~DRIFTING_EFFECT;
player->kartHopJerk = 0.0f;
player->kartHopAcceleration = 0.0f;
player->kartHopVelocity = 0.0f;
@ -1162,7 +1162,7 @@ void apply_boost_ramp_asphalt_sound_effect(Player* player, s8 playerId) {
func_800C9060(playerId, 0x1900A40B);
}
player->unk_044 &= ~0x1;
player->effects &= ~0x20;
player->effects &= ~UNKNOWN_EFFECT_0x20;
}
void apply_boost_ramp_asphalt_effect(Player* player) {
@ -1172,7 +1172,7 @@ void apply_boost_ramp_asphalt_effect(Player* player) {
if ((u16) player->unk_256 > 0) {
player->currentSpeed = 0.0f;
}
if ((player->surfaceType != BOOST_RAMP_ASPHALT) && ((player->effects & 8) != 8)) {
if ((player->surfaceType != BOOST_RAMP_ASPHALT) && ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8)) {
move_f32_towards(&player->boostPower, 0, 1.0f);
} else {
move_f32_towards(&player->boostPower, 400.0f, 0.01f);
@ -1210,13 +1210,13 @@ void apply_boost_ramp_wood_sound_effect(Player* player, s8 playerId) {
}
player->unk_044 &= ~0x1;
player->effects &= ~0x20;
player->effects &= ~UNKNOWN_EFFECT_0x20;
}
void apply_boost_ramp_wood_effect(Player* player) {
player->currentSpeed = gTopSpeedTable[0][player->characterId];
if ((player->surfaceType != BOOST_RAMP_WOOD) && ((player->effects & 8) != 8)) {
if ((player->surfaceType != BOOST_RAMP_WOOD) && ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8)) {
move_f32_towards(&player->boostPower, 0, 1.0f);
} else {
move_f32_towards(&player->boostPower, 300.0f, 0.1f);
@ -1242,7 +1242,7 @@ void func_8008F104(Player* player, s8 playerIndex) {
player->unk_0B2 = 2;
player->unk_0C0 = 0;
player->unk_07C = 0;
player->effects |= 0x4000;
player->effects |= UNKNOWN_EFFECT_0x4000;
player->unk_078 = 0;
D_8018D920[playerIndex] = -0x8000;
@ -1263,7 +1263,7 @@ void func_8008F1B8(Player* player, s8 arg1) {
temp = ((u16) D_8018D920[arg1] / 182);
if (temp == 180) {
player->effects &= ~0x4000;
player->effects &= ~UNKNOWN_EFFECT_0x4000;
player->type &= ~0x80;
player->currentSpeed /= 3.0f;
}
@ -1273,7 +1273,7 @@ void func_8008F1B8(Player* player, s8 arg1) {
D_8018D920[arg1] -= 182;
temp = ((u16) D_8018D920[arg1] / 182);
if (temp == 180) {
player->effects &= ~0x4000;
player->effects &= ~UNKNOWN_EFFECT_0x4000;
player->type &= ~0x80;
player->currentSpeed /= 3.0f;
}
@ -1302,7 +1302,7 @@ void func_8008F1B8(Player* player, s8 arg1) {
}
void func_8008F3E0(Player* player) {
player->effects &= ~0x4000;
player->effects &= ~UNKNOWN_EFFECT_0x4000;
}
void func_8008F3F4(Player* player, UNUSED s8 arg1) {
@ -1325,7 +1325,7 @@ void func_8008F3F4(Player* player, UNUSED s8 arg1) {
void func_8008F494(Player* player, s8 playerIndex) {
if ((((player->effects & BANANA_SPINOUT_EFFECT) != 0) || ((player->effects & DRIVING_SPINOUT_EFFECT) != 0) ||
((player->effects & UNKNOWN_EFFECT_0x1000000)) || ((player->effects & HIT_BY_ITEM_EFFECT)) ||
((player->effects & 0x400) != 0)) &&
((player->effects & UNKNOWN_EFFECT_0x400) != 0)) &&
(gModeSelection == BATTLE)) {
player->unk_044 |= 0x8000;
}
@ -1335,7 +1335,7 @@ void func_8008F494(Player* player, s8 playerIndex) {
player->unk_0A8 = 0;
player->effects |= TERRAIN_TUMBLE_EFFECT;
player->effects &= ~0x10;
player->effects &= ~DRIFTING_EFFECT;
player->unk_236 = 0x1E;
player->unk_042 = 0;
@ -1567,7 +1567,7 @@ void func_8008FDA8(Player* player, UNUSED s8 arg1) {
void func_8008FDF4(Player* player, s8 playerIndex) {
clean_effect(player, playerIndex);
player->effects &= ~0x10;
player->effects &= ~DRIFTING_EFFECT;
player->kartHopJerk = D_800E37F0[player->characterId];
player->kartHopAcceleration = 0.0f;
player->kartHopVelocity = D_800E37D0[player->characterId];
@ -1576,8 +1576,8 @@ void func_8008FDF4(Player* player, s8 playerIndex) {
}
void func_8008FE84(Player* player, UNUSED s8 playerIndex) {
player->effects &= ~0x10;
if ((player->effects & 8) != 8) {
player->effects &= ~DRIFTING_EFFECT;
if ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) {
player->effects &= ~UNKNOWN_EFFECT_0x10000000;
player->currentSpeed /= 2;
player->unk_08C /= 2;
@ -1768,7 +1768,7 @@ void func_80090778(Player* player) {
player->unk_07C = 0;
player->unk_0C0 = 0;
player->unk_0CA |= 8;
player->effects &= ~0x10;
player->effects &= ~DRIFTING_EFFECT;
player->unk_222 = 0;
player->unk_08C = 0.0f;
@ -1779,8 +1779,8 @@ void func_80090778(Player* player) {
player->unk_0C2 = 0;
player->unk_DB4.unk8 = 0.0f;
if ((player->effects & LIGHTNING_EFFECT) == LIGHTNING_EFFECT) {
if ((player->effects & 0x20000) == 0x20000) {
player->effects &= ~0x20000;
if ((player->effects & UNKNOWN_EFFECT_0x20000) == UNKNOWN_EFFECT_0x20000) {
player->effects &= ~UNKNOWN_EFFECT_0x20000;
player->unk_0A8 = 0;
player->unk_07C = 0;
player->unk_0C0 = 0;
@ -1788,7 +1788,7 @@ void func_80090778(Player* player) {
}
remove_lightning_effect(player, playerIndex);
}
player->effects &= ~0x20;
player->effects &= ~UNKNOWN_EFFECT_0x20;
}
void func_80090868(Player* player) {
@ -1931,7 +1931,7 @@ void func_80090970(Player* player, s8 playerId, s8 arg2) {
}
move_f32_towards(&player->pos[1], (player->unk_074 + player->boundingBoxSize) - 2.0f, 0.04f);
player->unk_0C8++;
if (((player->effects & 8) != 8) || (player->effects & 0x8000)) {
if (((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) || (player->effects & UNKNOWN_EFFECT_0x8000)) {
player->unk_0CA &= ~0x1000;
if (player->unk_0C8 >= 0x5B) {
if (player->type & PLAYER_HUMAN) {
@ -1973,7 +1973,7 @@ void func_80090970(Player* player, s8 playerId, s8 arg2) {
}
#define EFFECT_BLACKLIST_USE_ITEM \
LIGHTNING_EFFECT | 0x10000000 | 0x8000000 | HIT_EFFECT | HIT_BY_ITEM_EFFECT | 0x1000000 | 0x800000 | \
LIGHTNING_EFFECT | 0x10000000 | UNKNOWN_EFFECT_0x8000000 | HIT_EFFECT | HIT_BY_ITEM_EFFECT | 0x1000000 | 0x800000 | \
BOOST_RAMP_ASPHALT_EFFECT | 0x20000 | 0x10000 | 0x4000 | 0x800 | 0x400 | STAR_EFFECT | 0x80 | 0x40 | \
BOOST_RAMP_WOOD_EFFECT
@ -1991,7 +1991,7 @@ bool prevent_item_use(Player* player) {
case ITEM_DOUBLE_MUSHROOM:
case ITEM_TRIPLE_MUSHROOM:
case ITEM_SUPER_MUSHROOM:
if ((player->effects & 8) != 0) {
if ((player->effects & UNKNOWN_EFFECT_0x8) != 0) {
return true;
}
phi_v0 = EFFECT_BLACKLIST_USE_ITEM;

File diff suppressed because it is too large Load Diff

View File

@ -1552,7 +1552,7 @@ bool query_and_resolve_collision_player_actor(Player* player, Vec3f pos, f32 min
player->pos[0] += (xVelocity / temp_f0_4) * minDist;
player->pos[2] += (zVelocity / temp_f0_4) * minDist;
} else {
player->effects |= 0x8000;
player->effects |= UNKNOWN_EFFECT_0x8000;
xDist /= sqrtDist;
zDist /= sqrtDist;
temp_f0_5 = sqrtf((xVelocity * xVelocity) + (zVelocity * zVelocity));
@ -1729,7 +1729,7 @@ bool collision_tree(Player* player, struct Actor* actor) {
}
}
if (!(player->effects & STAR_EFFECT)) {
player->effects |= 0x8000;
player->effects |= UNKNOWN_EFFECT_0x8000;
}
actorPos[0] = actor->pos[0];
actorPos[1] = actor->pos[1];
@ -2281,12 +2281,12 @@ void evaluate_collision_for_players_and_actors(void) {
for (i = 0; i < NUM_PLAYERS; i++) {
phi_s1 = &gPlayers[i];
if (((phi_s1->type & PLAYER_EXISTS) != 0) && ((phi_s1->effects & 0x4000000) == 0)) {
if (((phi_s1->type & PLAYER_EXISTS) != 0) && ((phi_s1->effects & HIT_EFFECT) == 0)) {
func_802977E4(phi_s1);
for (j = 0; j < ACTOR_LIST_SIZE; j++) {
temp_a1 = &gActorList[j];
if ((phi_s1->effects & 0x4000000) == 0) {
if ((phi_s1->effects & HIT_EFFECT) == 0) {
// temp_v0 = temp_a1->unk2;
if (((temp_a1->flags & 0x8000) != 0) && ((temp_a1->flags & 0x4000) != 0)) {
evaluate_collision_between_player_actor(phi_s1, temp_a1);

View File

@ -1148,15 +1148,15 @@ void func_802903D8(Player* playerOne, Player* playerTwo) {
func_800C9060(playerOne - gPlayerOne, 0x19008001U);
return;
}
if (playerOne->effects & 0x200) {
if (!(playerTwo->effects & 0x200)) {
if (playerOne->effects & STAR_EFFECT) {
if (!(playerTwo->effects & STAR_EFFECT)) {
playerTwo->soundEffects |= HIT_BY_ITEM_SOUND_EFFECT;
}
} else if (playerTwo->effects & 0x200) {
} else if (playerTwo->effects & STAR_EFFECT) {
playerOne->soundEffects |= HIT_BY_ITEM_SOUND_EFFECT;
} else {
playerOne->effects |= 0x8000;
playerTwo->effects |= 0x8000;
playerOne->effects |= UNKNOWN_EFFECT_0x8000;
playerTwo->effects |= UNKNOWN_EFFECT_0x8000;
}
temp_f0_2 = sqrtf((sp54[0] * sp54[0]) + (sp54[1] * sp54[1]) + (sp54[2] * sp54[2]));
sp60[0] /= temp_f0;
@ -1175,7 +1175,7 @@ void func_802903D8(Player* playerOne, Player* playerTwo) {
temp_f16 = ((sp60[0] * sp54[0]) + (sp60[1] * sp54[1]) + (sp60[2] * sp54[2])) / temp_f0_2;
}
temp_f0_2 = temp_f0_2 * temp_f16 * 0.85;
if ((playerOne->effects & 0x200) != 0x200) {
if ((playerOne->effects & STAR_EFFECT) != STAR_EFFECT) {
temp_f2 = (temp_f0_2 * sp20) / sp24;
playerOne->velocity[0] += sp60[0] * temp_f2;
playerOne->velocity[1] += sp60[1] * temp_f2;
@ -1184,7 +1184,7 @@ void func_802903D8(Player* playerOne, Player* playerTwo) {
playerOne->pos[1] -= sp60[1] * sp74 * 0.5f;
playerOne->pos[2] -= sp60[2] * sp74 * 0.5f;
}
if ((playerTwo->effects & 0x200) != 0x200) {
if ((playerTwo->effects & STAR_EFFECT) != STAR_EFFECT) {
temp_f2 = (temp_f0_2 * sp24) / sp20;
playerTwo->velocity[0] -= sp60[0] * temp_f2;
playerTwo->velocity[1] -= sp60[1] * temp_f2;
@ -1212,13 +1212,13 @@ void func_802909F0(void) {
ply = &gPlayers[i];
if ((ply->type & PLAYER_EXISTS) && (!(ply->effects & BOO_EFFECT)) &&
(!(ply->type & PLAYER_INVISIBLE_OR_BOMB)) && (!(ply->effects & 0x4000000))) {
(!(ply->type & PLAYER_INVISIBLE_OR_BOMB)) && (!(ply->effects & HIT_EFFECT))) {
for (k = i + 1; k < NUM_PLAYERS; k++) {
ply2 = &gPlayers[k];
if ((ply2->type & PLAYER_EXISTS) && (!(ply2->effects & BOO_EFFECT)) &&
(!(ply2->type & PLAYER_INVISIBLE_OR_BOMB)) && (!(ply2->effects & 0x4000000))) {
(!(ply2->type & PLAYER_INVISIBLE_OR_BOMB)) && (!(ply2->effects & HIT_EFFECT))) {
func_802903D8(ply, ply2);
}

View File

@ -956,11 +956,11 @@ void func_80022A98(Player* player, s8 playerIndex) {
if ((player->type & PLAYER_EXISTS) == PLAYER_EXISTS) {
func_80026A48(player, playerIndex);
func_800235AC(player, playerIndex);
if (((player->effects & HIT_EFFECT) == HIT_EFFECT) || ((player->effects & 0x08000000) == 0x08000000)) {
if (((player->effects & HIT_EFFECT) == HIT_EFFECT) || ((player->effects & UNKNOWN_EFFECT_0x8000000) == UNKNOWN_EFFECT_0x8000000)) {
if ((player->effects & HIT_EFFECT) == HIT_EFFECT) {
func_80022B50(player, playerIndex);
}
if ((player->effects & 0x08000000) == 0x08000000) {
if ((player->effects & UNKNOWN_EFFECT_0x8000000) == UNKNOWN_EFFECT_0x8000000) {
func_80022BC4(player, playerIndex);
}
} else {
@ -1271,7 +1271,7 @@ void func_800235AC(Player* player, s8 playerIndex) {
}
void func_80023BF0(Player* player, s8 playerId, s8 screenId, s8 arg3) {
if (((player->effects & HIT_EFFECT) == HIT_EFFECT) || ((player->effects & 0x8000000) == 0x8000000)) {
if (((player->effects & HIT_EFFECT) == HIT_EFFECT) || ((player->effects & UNKNOWN_EFFECT_0x8000000) == UNKNOWN_EFFECT_0x8000000)) {
func_80022CA8(player, playerId, screenId, arg3);
} else {
func_80022E84(player, playerId, screenId, arg3);
@ -1301,10 +1301,10 @@ void render_player_shadow(Player* player, s8 playerId, s8 screenId) {
spAC = -sins(temp_t9 << 7) * 2;
if (((player->effects & UNKNOWN_EFFECT_0x1000000) == UNKNOWN_EFFECT_0x1000000) ||
((player->effects & 0x400) == 0x400) || ((player->effects & 0x80000) == 0x80000) ||
((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || ((player->effects & 0x400) == 0x400) ||
((player->effects & UNKNOWN_EFFECT_0x400) == UNKNOWN_EFFECT_0x400) || ((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) ||
((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || ((player->effects & UNKNOWN_EFFECT_0x400) == UNKNOWN_EFFECT_0x400) ||
((player->unk_0CA & 2) == 2) || ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) ||
((player->effects & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT) || ((player->effects & 8) == 8)) {
((player->effects & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT) || ((player->effects & UNKNOWN_EFFECT_0x8) == UNKNOWN_EFFECT_0x8)) {
var_f2 = (f32) (1.0 - ((f64) player->collision.surfaceDistance[2] * 0.02));
if (var_f2 < 0.0f) {
@ -1435,7 +1435,7 @@ void render_kart(Player* player, s8 playerId, s8 arg2, s8 flipOffset) {
} else {
thing = (u16) (player->unk_048[arg2] + player->rotation[1] + player->unk_0C0);
temp_v1 = player->unk_0CC[arg2] * sins(thing);
if ((player->effects & 8) == 8) {
if ((player->effects & UNKNOWN_EFFECT_0x8) == UNKNOWN_EFFECT_0x8) {
sp14C[0] = cameras[arg2].rot[0] - 0x4000;
} else {
sp14C[0] = -temp_v1 * 0.8;
@ -1747,7 +1747,7 @@ void render_player(Player* player, s8 playerId, s8 screenId) {
void func_80026A48(Player* player, s8 playerIndex) {
f32 temp_f0;
if (((player->effects & 0x4000) == 0x4000) && ((player->type & PLAYER_START_SEQUENCE) == 0)) {
if (((player->effects & UNKNOWN_EFFECT_0x4000) == UNKNOWN_EFFECT_0x4000) && ((player->type & PLAYER_START_SEQUENCE) == 0)) {
player->tyreSpeed += D_800DDE74[8];
if (player->tyreSpeed >= 0x400) {
player->tyreSpeed = 0;
@ -1779,9 +1779,9 @@ void update_wheel_palette(Player* player, s8 playerId, s8 screenId, s8 arg3) {
s16 temp_t2 = player->tyreSpeed;
s16 temp_num = 0x40; // setting this as a variable gets rid of regalloc
if (((player->effects & 0x4000) == 0x4000) && ((player->type & PLAYER_START_SEQUENCE) == 0)) {
if (((player->effects & 0x80) != 0x80) && ((player->effects & 0x40) != 0x40) &&
((player->effects & 0x20000) != 0x20000) && ((player->effects & 0x80000) != 0x80000) &&
if (((player->effects & UNKNOWN_EFFECT_0x4000) == UNKNOWN_EFFECT_0x4000) && ((player->type & PLAYER_START_SEQUENCE) == 0)) {
if (((player->effects & BANANA_SPINOUT_EFFECT) != BANANA_SPINOUT_EFFECT) && ((player->effects & DRIVING_SPINOUT_EFFECT) != DRIVING_SPINOUT_EFFECT) &&
((player->effects & UNKNOWN_EFFECT_0x20000) != UNKNOWN_EFFECT_0x20000) && ((player->effects & UNKNOWN_EFFECT_0x80000) != UNKNOWN_EFFECT_0x80000) &&
((player->effects & UNKNOWN_EFFECT_0x800000) != UNKNOWN_EFFECT_0x800000) && ((player->unk_044 & 0x800) == 0)) {
if (frameId <= 20) {
@ -1809,9 +1809,9 @@ void update_wheel_palette(Player* player, s8 playerId, s8 screenId, s8 arg3) {
}
}
} else {
if (((player->effects & 0x80) != 0x80) && ((player->effects & 0x40) != 0x40) &&
((player->effects & 0x80000) != 0x80000) && ((player->effects & UNKNOWN_EFFECT_0x800000) != UNKNOWN_EFFECT_0x800000) &&
((player->effects & 0x20000) != 0x20000) && ((player->unk_044 & 0x800) == 0)) {
if (((player->effects & BANANA_SPINOUT_EFFECT) != BANANA_SPINOUT_EFFECT) && ((player->effects & DRIVING_SPINOUT_EFFECT) != DRIVING_SPINOUT_EFFECT) &&
((player->effects & UNKNOWN_EFFECT_0x80000) != UNKNOWN_EFFECT_0x80000) && ((player->effects & UNKNOWN_EFFECT_0x800000) != UNKNOWN_EFFECT_0x800000) &&
((player->effects & UNKNOWN_EFFECT_0x20000) != UNKNOWN_EFFECT_0x20000) && ((player->unk_044 & 0x800) == 0)) {
if (frameId <= 20) {
load_player_data_non_blocking(player,

View File

@ -3152,7 +3152,7 @@ void func_80079860(s32 playerId) {
player = &gPlayerOne[playerId];
if ((func_80072354(objectIndex, 1) != 0) &&
(((func_802ABDF4(player->collision.meshIndexZX) != 0) && (player->collision.surfaceDistance[2] <= 3.0f)) ||
(player->unk_0CA & 1) || ((player->surfaceType == OUT_OF_BOUNDS) && !(player->effects & 8)))) {
(player->unk_0CA & 1) || ((player->surfaceType == OUT_OF_BOUNDS) && !(player->effects & UNKNOWN_EFFECT_0x8)))) {
func_80090778(player);
func_800797AC(playerId);
}
@ -3476,7 +3476,7 @@ void update_object_lakitu_reverse(s32 objectIndex, s32 playerId) {
}
switch (gObjectList[objectIndex].unk_0D6) { /* switch 1; irregular */
case 1: /* switch 1 */
if ((gObjectList[objectIndex].state >= 3) && (!(sp2C->effects & 0x400000))) {
if ((gObjectList[objectIndex].state >= 3) && (!(sp2C->effects & REVERSE_EFFECT))) {
func_80086F10(objectIndex, 6, &D_800E69F4);
gObjectList[objectIndex].unk_0D6 = 2;
gObjectList[objectIndex].unk_04C = 0x00000050;
@ -3536,7 +3536,7 @@ void func_8007A88C(s32 playerId) {
objectIndex = gIndexLakituList[playerId];
player = &gPlayerOne[playerId];
if ((gObjectList[objectIndex].state == 0) && (player->effects & 0x400000)) {
if ((gObjectList[objectIndex].state == 0) && (player->effects & REVERSE_EFFECT)) {
func_800790E4(playerId);
}
}
@ -5986,7 +5986,7 @@ void func_80080B28(s32 objectIndex, s32 playerId) {
if ((temp_f0 <= 9.0) && !(temp_s0->effects & 0x04000000) &&
(has_collided_horizontally_with_player(objectIndex, temp_s0) != 0)) {
if ((temp_s0->type & PLAYER_EXISTS) && !(temp_s0->type & 0x100)) {
if (!(temp_s0->effects & 0x200)) {
if (!(temp_s0->effects & STAR_EFFECT)) {
func_80089474(objectIndex, playerId, 1.4f, 1.1f, SOUND_ARG_LOAD(0x19, 0x00, 0xA0, 0x4C));
} else if (func_80072354(objectIndex, 0x00000040) != 0) {
if (temp_s0->type & 0x1000) {
@ -6394,7 +6394,7 @@ void func_80081D34(s32 objectIndex) {
if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) {
func_80072180();
}
if (player->effects & 0x200) {
if (player->effects & STAR_EFFECT) {
func_800C9060(playerIndex, 0x1900A046U);
} else {
player->soundEffects |= 2;