diff --git a/include/defines.h b/include/defines.h index d0cfadf98..3c7341ec6 100644 --- a/include/defines.h +++ b/include/defines.h @@ -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 diff --git a/src/actors/kiwano_fruit/update.inc.c b/src/actors/kiwano_fruit/update.inc.c index 2917a9908..7aa5b308f 100644 --- a/src/actors/kiwano_fruit/update.inc.c +++ b/src/actors/kiwano_fruit/update.inc.c @@ -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; diff --git a/src/camera.c b/src/camera.c index bda5e91bd..dff38940b 100644 --- a/src/camera.c +++ b/src/camera.c @@ -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) { diff --git a/src/code_8003DC40.c b/src/code_8003DC40.c index efa143792..cf04269d9 100644 --- a/src/code_8003DC40.c +++ b/src/code_8003DC40.c @@ -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))) { diff --git a/src/code_80057C60.c b/src/code_80057C60.c index 4f3d82a40..8681ac7d7 100644 --- a/src/code_80057C60.c +++ b/src/code_80057C60.c @@ -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); diff --git a/src/code_80086E70.c b/src/code_80086E70.c index 50619609a..b701f79c3 100644 --- a/src/code_80086E70.c +++ b/src/code_80086E70.c @@ -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) { diff --git a/src/cpu_vehicles_camera_path.c b/src/cpu_vehicles_camera_path.c index f57b74696..18c8a5b2b 100644 --- a/src/cpu_vehicles_camera_path.c +++ b/src/cpu_vehicles_camera_path.c @@ -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); diff --git a/src/cpu_vehicles_camera_path/behaviour_utils.inc.c b/src/cpu_vehicles_camera_path/behaviour_utils.inc.c index 7fb8a1214..728d0c893 100644 --- a/src/cpu_vehicles_camera_path/behaviour_utils.inc.c +++ b/src/cpu_vehicles_camera_path/behaviour_utils.inc.c @@ -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; diff --git a/src/cpu_vehicles_camera_path/cpu_speed_control.inc.c b/src/cpu_vehicles_camera_path/cpu_speed_control.inc.c index 496410224..319bad36c 100644 --- a/src/cpu_vehicles_camera_path/cpu_speed_control.inc.c +++ b/src/cpu_vehicles_camera_path/cpu_speed_control.inc.c @@ -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) { diff --git a/src/effects.c b/src/effects.c index 5d52f0cc8..2246729d6 100644 --- a/src/effects.c +++ b/src/effects.c @@ -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; diff --git a/src/player_controller.c b/src/player_controller.c index eca71a348..e31341729 100644 --- a/src/player_controller.c +++ b/src/player_controller.c @@ -536,12 +536,12 @@ void func_80028864(Player* player, Camera* camera, s8 playerId, s8 screenId) { //! @todo make a proper match ((*(D_801633F8 + (playerId))) == ((s16) 1U))) { player->effects &= ~LOST_RACE_EFFECT; - if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40) || - ((player->effects & 0x400) == 0x400) || ((player->effects & 0x4000) == 0x4000) || - ((player->effects & 0x80000) == 0x80000) || ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || + if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) || + ((player->effects & UNKNOWN_EFFECT_0x400) == UNKNOWN_EFFECT_0x400) || ((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_0x1000000) == UNKNOWN_EFFECT_0x1000000) || ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) || - ((player->effects & 0x20000) == 0x20000) || (player->unk_044 & 0x800)) { + ((player->effects & UNKNOWN_EFFECT_0x20000) == UNKNOWN_EFFECT_0x20000) || (player->unk_044 & 0x800)) { func_8002E594(player, camera, screenId, playerId); } else { func_8002D268(player, camera, screenId, playerId); @@ -558,19 +558,19 @@ void func_80028864(Player* player, Camera* camera, s8 playerId, s8 screenId) { if ((player->type & PLAYER_HUMAN) != PLAYER_HUMAN) { player->currentSpeed = 50.0f; } - player->effects &= ~8; + player->effects &= ~UNKNOWN_EFFECT_0x8; } } void func_80028C44(Player* player, Camera* camera, s8 playerId, s8 screenId) { if ((player->type & PLAYER_START_SEQUENCE) == 0) { player->effects &= ~LOST_RACE_EFFECT; - if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40) || - ((player->effects & 0x400) == 0x400) || ((player->effects & 0x4000) == 0x4000) || - ((player->effects & 0x80000) == 0x80000) || ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || + if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) || + ((player->effects & UNKNOWN_EFFECT_0x400) == UNKNOWN_EFFECT_0x400) || ((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_0x1000000) == UNKNOWN_EFFECT_0x1000000) || ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) || - ((player->effects & 0x20000) == 0x20000) || ((player->unk_044 & 0x800) != 0)) { + ((player->effects & UNKNOWN_EFFECT_0x20000) == UNKNOWN_EFFECT_0x20000) || ((player->unk_044 & 0x800) != 0)) { func_8002E594(player, camera, screenId, playerId); } else { func_8002D268(player, camera, screenId, playerId); @@ -583,22 +583,22 @@ void func_80028C44(Player* player, Camera* camera, s8 playerId, s8 screenId) { void func_80028D3C(Player* player, Camera* camera, s8 playerId, s8 screenId) { if ((((player->type & PLAYER_START_SEQUENCE) == 0) && (D_800DC510 != 5)) || (player->unk_0CA & 2) != 0 || (player->unk_0CA & 8) != 0 || - (player->effects & (0x40000000 | UNKNOWN_EFFECT_0x1000000 | 0x2000000 | 0x4000000 | 0x8000000 | + (player->effects & (LIGHTNING_EFFECT | UNKNOWN_EFFECT_0x1000000 | HIT_BY_ITEM_EFFECT | HIT_EFFECT | UNKNOWN_EFFECT_0x8000000 | TERRAIN_TUMBLE_EFFECT | 0xC00 | 0xC0)) != 0) { player->effects &= ~LOST_RACE_EFFECT; - if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40) || - ((player->effects & 0x400) == 0x400) || ((player->effects & 0x4000) == 0x4000) || - ((player->effects & 0x80000) == 0x80000) || ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || + if (((player->effects & BANANA_SPINOUT_EFFECT) == BANANA_SPINOUT_EFFECT) || ((player->effects & DRIVING_SPINOUT_EFFECT) == DRIVING_SPINOUT_EFFECT) || + ((player->effects & UNKNOWN_EFFECT_0x400) == UNKNOWN_EFFECT_0x400) || ((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_0x1000000) == UNKNOWN_EFFECT_0x1000000) || ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) || - ((player->effects & 0x20000) == 0x20000) || ((player->unk_044 & 0x800) != 0)) { + ((player->effects & UNKNOWN_EFFECT_0x20000) == UNKNOWN_EFFECT_0x20000) || ((player->unk_044 & 0x800) != 0)) { func_8002E594(player, camera, screenId, playerId); } else { func_8002D268(player, camera, screenId, playerId); } } else { - player->effects = player->effects & ~8; + player->effects = player->effects & ~UNKNOWN_EFFECT_0x8; } } @@ -609,7 +609,7 @@ void func_80028E70(Player* player, Camera* camera, s8 playerId, s8 screenId) { if (!(player->type & PLAYER_START_SEQUENCE)) { func_80038C6C(player, camera, screenId, playerId); } else { - player->effects &= ~8; + player->effects &= ~UNKNOWN_EFFECT_0x8; } break; default: @@ -726,7 +726,7 @@ void func_8002934C(Player* player, Camera* camera, s8 screenId, s8 playerId) { temp_f2 = (gCharacterSize[player->characterId] * 18.0f) * player->size; temp_f0 = player->unk_230 - player->unk_23C; - if ((player->effects & 8) != 8) { + if ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) { if ((player->effects & LIGHTNING_EFFECT) == LIGHTNING_EFFECT) { player->unk_0CC[screenId] = (s16) ((s32) (((f64) atan1s(temp_f0 / temp_f2)) * 1.6)); } else { @@ -736,7 +736,7 @@ void func_8002934C(Player* player, Camera* camera, s8 screenId, s8 playerId) { if ((player->effects & HIT_EFFECT) == HIT_EFFECT) { player->unk_0CC[screenId] = (s16) ((s32) player->unk_D9C); } - if ((player->effects & 8) != 8) { + if ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) { temp_f0 = player->unk_1F8 - player->unk_1FC; player->unk_0D4[screenId] = (((atan1s(temp_f0 / temp_f2)) * 0.9)); } else { @@ -760,9 +760,9 @@ void func_8002934C(Player* player, Camera* camera, s8 screenId, s8 playerId) { var_a0 = 0x201 - var_a0; player->unk_002 |= (4 << (screenId * 4)); } - 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))) { + 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))) { if (var_a0 < 0x51) { var_a1 = 0x208; var_t0 = 0; @@ -774,17 +774,17 @@ void func_8002934C(Player* player, Camera* camera, s8 screenId, s8 playerId) { var_a1 = 0x666; var_t0 = 0; } - if (((player->effects & 0x80000) == 0x80000) || ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || + if (((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) || ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || (player->unk_044 & 0x800)) { player->unk_050[screenId] = 0; } - if (((player->effects & 8) == 8) && ((player->unk_0CA & 2) == 2)) { + if (((player->effects & UNKNOWN_EFFECT_0x8) == UNKNOWN_EFFECT_0x8) && ((player->unk_0CA & 2) == 2)) { player->unk_050[screenId] = 0; } var_a0 = (player->unk_048[screenId] + player->rotation[1] + player->unk_0C0); - 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)) { + 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)) { if (var_a0 >= 0x7FF9) { var_a0 = -var_a0; var_a0 /= var_a1; @@ -804,8 +804,8 @@ void func_8002934C(Player* player, Camera* camera, s8 screenId, s8 playerId) { if ((player->animFrameSelector[screenId]) >= 0x23) { player->animFrameSelector[screenId] = 0x22; } - if ((player->effects & 0x80) || (player->effects & 0x40) || (player->effects & 0x80000) || - (player->effects & UNKNOWN_EFFECT_0x800000) || (player->effects & 0x20000) || (player->unk_044 & 0x800)) { + if ((player->effects & BANANA_SPINOUT_EFFECT) || (player->effects & DRIVING_SPINOUT_EFFECT) || (player->effects & UNKNOWN_EFFECT_0x80000) || + (player->effects & UNKNOWN_EFFECT_0x800000) || (player->effects & UNKNOWN_EFFECT_0x20000) || (player->unk_044 & 0x800)) { if ((player->animFrameSelector[screenId]) >= 0x14) { player->animFrameSelector[screenId] = 0; @@ -814,20 +814,20 @@ void func_8002934C(Player* player, Camera* camera, s8 screenId, s8 playerId) { if ((player->animGroupSelector[screenId]) >= 9) { player->animGroupSelector[screenId] = 4; } - if (((player->effects & 0x80000) == 0x80000) || ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || + if (((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) || ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || (player->unk_044 & 0x800)) { player->animGroupSelector[screenId] = 4; } - if (((player->effects & 0x400) == 0x400) || + if (((player->effects & UNKNOWN_EFFECT_0x400) == UNKNOWN_EFFECT_0x400) || ((player->effects & UNKNOWN_EFFECT_0x1000000) == UNKNOWN_EFFECT_0x1000000) || ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) || (player->effects & TERRAIN_TUMBLE_EFFECT) || - (player->effects & 0x80) || (player->effects & 0x40)) { + (player->effects & BANANA_SPINOUT_EFFECT) || (player->effects & DRIVING_SPINOUT_EFFECT)) { player->unk_002 |= 1 << (screenId * 4); D_80165190[screenId][playerId] = 1; - if ((player->effects & 0x80) || (player->effects & 0x40)) { + if ((player->effects & BANANA_SPINOUT_EFFECT) || (player->effects & DRIVING_SPINOUT_EFFECT)) { if ((player->animFrameSelector[screenId] == gLastAnimFrameSelector[screenId][playerId]) && (player->animGroupSelector[screenId] == gLastAnimGroupSelector[screenId][playerId])) { player->unk_002 &= ~(1 << (screenId * 4)); @@ -915,7 +915,7 @@ void func_80029B4C(Player* player, UNUSED f32 arg1, f32 arg2, UNUSED f32 arg3) { player->tyres[BACK_RIGHT].pos[1] = player->pos[1] + sp8C[1]; player->tyres[BACK_RIGHT].pos[2] = player->pos[2] + sp8C[2]; player_terrain_collision(player, &player->tyres[BACK_RIGHT], sp80[0], sp80[1], sp80[2]); - if (!(player->effects & 8)) { + if (!(player->effects & UNKNOWN_EFFECT_0x8)) { a = (player->tyres[BACK_LEFT].baseHeight + player->tyres[FRONT_LEFT].baseHeight) / 2; move_f32_towards(&player->unk_230, a, 0.5f); @@ -931,10 +931,10 @@ void func_80029B4C(Player* player, UNUSED f32 arg1, f32 arg2, UNUSED f32 arg3) { temp_f2_3 = ((gCharacterSize[player->characterId] * 18.0f) + 1.0f) * player->size; temp_f0_2 = player->unk_23C - player->unk_230; player->unk_206 = -atan1s(temp_f0_2 / temp_f2_3); - if (((player->unk_0CA & 2) == 2) || (player->effects & 8)) { + if (((player->unk_0CA & 2) == 2) || (player->effects & UNKNOWN_EFFECT_0x8)) { player->unk_206 = 0; } - if ((player->effects & 8) != 8) { + if ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) { temp_f0_2 = player->unk_1F8 - player->unk_1FC; move_s16_towards(&player->slopeAccel, atan1s(temp_f0_2 / temp_f2_3), 0.5f); } else { @@ -947,18 +947,18 @@ void func_80029B4C(Player* player, UNUSED f32 arg1, f32 arg2, UNUSED f32 arg3) { } move_s16_towards(&player->slopeAccel, temp_v0, 0.5f); } - if (((player->effects & 8) == 8) && ((player->unk_0CA & 2) == 2)) { + if (((player->effects & UNKNOWN_EFFECT_0x8) == UNKNOWN_EFFECT_0x8) && ((player->unk_0CA & 2) == 2)) { player->slopeAccel = (s16) ((s32) player->unk_D9C); } player->surfaceType = get_surface_type(player->collision.meshIndexZX) & 0xFF; if (player->surfaceType == BOOST_RAMP_ASPHALT) { if (((player->effects & BOOST_RAMP_ASPHALT_EFFECT) != BOOST_RAMP_ASPHALT_EFFECT) && - ((player->effects & 8) != 8)) { + ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8)) { player->soundEffects |= BOOST_RAMP_ASPHALT_SOUND_EFFECT; } } if (player->surfaceType == BOOST_RAMP_WOOD) { - if (((player->effects & BOOST_RAMP_WOOD_EFFECT) != BOOST_RAMP_WOOD_EFFECT) && ((player->effects & 8) != 8)) { + if (((player->effects & BOOST_RAMP_WOOD_EFFECT) != BOOST_RAMP_WOOD_EFFECT) && ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8)) { player->soundEffects |= BOOST_RAMP_WOOD_SOUND_EFFECT; } } @@ -1004,7 +1004,7 @@ void func_8002A194(Player* player, f32 x, f32 y, f32 z) { player->tyres[BACK_RIGHT].baseHeight = calculate_surface_height( player->tyres[BACK_LEFT].pos[0], y, player->tyres[BACK_LEFT].pos[2], player->collision.meshIndexZX); - if ((player->effects & 8) != 8) { + if ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) { player->unk_230 = (player->tyres[BACK_LEFT].baseHeight + player->tyres[FRONT_LEFT].baseHeight) / 2; player->unk_23C = (player->tyres[BACK_RIGHT].baseHeight + player->tyres[FRONT_RIGHT].baseHeight) / 2; player->unk_1FC = (player->tyres[FRONT_RIGHT].baseHeight + player->tyres[FRONT_LEFT].baseHeight) / 2; @@ -1018,7 +1018,7 @@ void func_8002A194(Player* player, f32 x, f32 y, f32 z) { var_f20 = (gCharacterSize[player->characterId] * 18) + 1; temp_f0 = (player->unk_23C - player->unk_230); player->unk_206 = -atan1s(temp_f0 / var_f20); - if ((player->effects & 8) != 8) { + if ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) { temp_f0 = (player->unk_1F8 - player->unk_1FC); move_s16_towards(&player->slopeAccel, atan1s(temp_f0 / var_f20), 0.5f); } else { @@ -1038,12 +1038,12 @@ void func_8002A194(Player* player, f32 x, f32 y, f32 z) { } if (player->surfaceType == BOOST_RAMP_ASPHALT) { if (((player->effects & BOOST_RAMP_ASPHALT_EFFECT) != BOOST_RAMP_ASPHALT_EFFECT) && - ((player->effects & 8) != 8)) { + ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8)) { player->soundEffects |= BOOST_RAMP_ASPHALT_SOUND_EFFECT; } } if (player->surfaceType == BOOST_RAMP_WOOD) { - if (((player->effects & BOOST_RAMP_WOOD_EFFECT) != BOOST_RAMP_WOOD_EFFECT) && ((player->effects & 8) != 8)) { + if (((player->effects & BOOST_RAMP_WOOD_EFFECT) != BOOST_RAMP_WOOD_EFFECT) && ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8)) { player->soundEffects |= BOOST_RAMP_WOOD_SOUND_EFFECT; } } @@ -1112,7 +1112,7 @@ void func_8002A79C(Player* player, s8 playerIndex) { player->unk_23A += 1; if (player->unk_23A >= 0x1F) { player->unk_23A = 0; - player->effects &= ~0x100; + player->effects &= ~MINI_TURBO_EFFECT; player->driftState = 0; player->unk_228 = 0; } @@ -1167,7 +1167,7 @@ void kart_hop(Player* player) { player->kartHopJerk = gKartHopJerkTable[player->characterId]; player->kartHopAcceleration = 0.0f; player->kartHopVelocity = gKartHopInitialVelocityTable[player->characterId]; - player->effects |= 2; + player->effects |= UNKNOWN_EFFECT_0x2; player->unk_DAC = 3.0f; player->kartGravity = 500.0f; func_80036C5C(player); @@ -1214,7 +1214,7 @@ void func_8002AAC0(Player* player) { void func_8002AB70(Player* player) { UNUSED s32 pad[2]; - if (((player->effects & 8) != 8) && (player->unk_08C > 0.0f)) { + if (((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) && (player->unk_08C > 0.0f)) { if (((player->slopeAccel / 182) < -1) && ((player->slopeAccel / 182) >= -0x14) && (((player->speed / 18.0f) * 216.0f) >= 20.0f)) { move_f32_towards(&player->kartGravity, 500.0f, 1.0f); @@ -1228,7 +1228,7 @@ void func_8002AB70(Player* player) { player->unk_DAC = 2.0f; } move_f32_towards(&player->kartGravity, gKartGravityTable[player->characterId], 0.02f); - if ((player->effects & 2) == 2) { + if ((player->effects & UNKNOWN_EFFECT_0x2) == UNKNOWN_EFFECT_0x2) { move_f32_towards(&player->unk_DAC, 1.0f, 0.07f); } else { move_f32_towards(&player->unk_DAC, 1.0f, 0.07f); @@ -1242,10 +1242,10 @@ void func_8002AB70(Player* player) { move_f32_towards(&player->unk_DAC, 25.0f, 1.0f); player->kartGravity = 1800.0f; } - if ((player->effects & 0x400) == 0x400) { + if ((player->effects & UNKNOWN_EFFECT_0x400) == UNKNOWN_EFFECT_0x400) { player->kartGravity = 1100.0f; } - if (player->effects & 0x80000) { + if (player->effects & UNKNOWN_EFFECT_0x80000) { player->kartGravity = 1500.0f; } if ((player->unk_044 & 0x800) != 0) { @@ -1281,11 +1281,11 @@ void func_8002AE38(Player* player, s8 arg1, f32 arg2, f32 arg3, f32 arg4, f32 ar sp28 = (sins(-player->rotation[1]) * player->speed) + arg2; temp_f16 = (coss(-player->rotation[1]) * player->speed) + arg3; - if (((player->effects & 0x800) != 0x800) && ((player->effects & DRIFTING_EFFECT) != DRIFTING_EFFECT) && + if (((player->effects & UNKNOWN_EFFECT_0x800) != UNKNOWN_EFFECT_0x800) && ((player->effects & DRIFTING_EFFECT) != DRIFTING_EFFECT) && !(player->unk_044 & 0x4000) && ((((player->speed / 18.0f) * 216.0f) <= 8.0f) || (((player->unk_07C >> 0x10) < 5) && ((player->unk_07C >> 0x10) > -5)))) { - if ((player->effects & 0x20) == 0x20) { + if ((player->effects & UNKNOWN_EFFECT_0x20) == UNKNOWN_EFFECT_0x20) { player->unk_0C0 = (f32) (player->unk_0C0 - (player->unk_0C0 / 10)); } else { temp_v0_3 = player->unk_0C0; @@ -1344,7 +1344,7 @@ void func_8002B218(Player* player) { } if (player->unk_006 == sp24[someIndex]) { - player->effects &= ~0x10; + player->effects &= ~DRIFTING_EFFECT; break; } } @@ -1369,7 +1369,7 @@ void apply_sound_effect(Player* player, s8 playerId, UNUSED s8 screenId) { if ((player->soundEffects & 0x1000) == 0x1000) { func_8008D570(player, playerId); } - if ((player->soundEffects & 0x20000) == 0x20000) { + if ((player->soundEffects & UNKNOWN_EFFECT_0x20000) == UNKNOWN_EFFECT_0x20000) { func_8008D7B0(player, playerId); } if ((player->soundEffects & HIT_SOUND_EFFECT) == HIT_SOUND_EFFECT) { @@ -1378,7 +1378,7 @@ void apply_sound_effect(Player* player, s8 playerId, UNUSED s8 screenId) { if ((player->soundEffects & HIT_ROTATING_SOUND_EFFECT) == HIT_ROTATING_SOUND_EFFECT) { apply_hit_rotating_sound_effect(player, playerId); } - if ((player->soundEffects & 0x200000) == 0x200000) { + if ((player->soundEffects & CPU_FAST_EFFECT) == CPU_FAST_EFFECT) { func_8008C73C(player, playerId); } if ((player->soundEffects & REVERSE_SOUND_EFFECT) == REVERSE_SOUND_EFFECT) { @@ -1411,19 +1411,19 @@ void func_8002B5C0(Player* player, UNUSED s8 playerId, UNUSED s8 screenId) { if (((player->unk_0CA & 8) != 0) || ((player->unk_0CA & 2) != 0)) { player->soundEffects &= 0xFE1D0478; } - if ((player->effects & 0x400) == 0x400) { + if ((player->effects & UNKNOWN_EFFECT_0x400) == UNKNOWN_EFFECT_0x400) { player->soundEffects &= 0xFF5D457E; } - 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->soundEffects &= 0xFF5F457E; } - if ((player->effects & 0x800) == 0x800) { + if ((player->effects & UNKNOWN_EFFECT_0x800) == UNKNOWN_EFFECT_0x800) { player->soundEffects &= 0xFF5D457E; } if ((player->unk_044 & 0x4000) != 0) { player->soundEffects &= 0xFF5D457E; } - if ((player->effects & 0x80000) == 0x80000) { + if ((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) { player->soundEffects &= 0xFE1D4478; } if ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) { @@ -1453,10 +1453,10 @@ void func_8002B5C0(Player* player, UNUSED s8 playerId, UNUSED s8 screenId) { if ((player->effects & BOO_EFFECT) == BOO_EFFECT) { player->soundEffects &= 0xFE9D8678; } - if ((player->effects & 0x4000) == 0x4000) { + if ((player->effects & UNKNOWN_EFFECT_0x4000) == UNKNOWN_EFFECT_0x4000) { player->soundEffects &= 0xFF5D45FF; } - if ((player->effects & 0x20000) == 0x20000) { + if ((player->effects & UNKNOWN_EFFECT_0x20000) == UNKNOWN_EFFECT_0x20000) { player->soundEffects &= 0xFE1D0478; } } @@ -1533,7 +1533,7 @@ void func_8002B9CC(Player* player, s8 playerIndex, UNUSED s32 arg2) { if (sqrtf((temp_f0 * temp_f0) + (temp_f2 * temp_f2) + (temp_f14 * temp_f14)) >= 6.5) { player->unk_08C /= 4; player->currentSpeed /= 4; - if (!(player->effects & 0x80) && !(player->effects & 0x40)) { + if (!(player->effects & BANANA_SPINOUT_EFFECT) && !(player->effects & DRIVING_SPINOUT_EFFECT)) { func_8008C73C(player, playerIndex); } } @@ -1544,7 +1544,7 @@ void func_8002B9CC(Player* player, s8 playerIndex, UNUSED s32 arg2) { if (sqrtf((temp_f0 * temp_f0) + (temp_f2 * temp_f2) + (temp_f14 * temp_f14)) >= 4.2) { player->unk_08C /= 4; player->currentSpeed /= 4; - if (!(player->effects & 0x80) && !(player->effects & 0x40)) { + if (!(player->effects & BANANA_SPINOUT_EFFECT) && !(player->effects & DRIVING_SPINOUT_EFFECT)) { func_8008C73C(player, playerIndex); } } @@ -1662,7 +1662,7 @@ void func_8002BF4C(Player* player, s8 playerIndex) { player->effects &= 0xFFDFFFFF; return; } - if ((player->effects & 0x200000) == 0x200000) { + if ((player->effects & CPU_FAST_EFFECT) == CPU_FAST_EFFECT) { player->unk_0E2 -= 1; if (player->unk_0E2 <= 0) { player->effects &= 0xFFDFFFFF; @@ -1676,7 +1676,7 @@ void func_8002BF4C(Player* player, s8 playerIndex) { var_a2 == 1))) { player->unk_0E2 += 1; if (player->unk_0E2 >= 0x3D) { - player->effects |= 0x200000; + player->effects |= CPU_FAST_EFFECT; if ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB) { uselessAssignment = player->type & PLAYER_INVISIBLE_OR_BOMB; func_800C90F4(playerIndex, (player->characterId * 0x10) + 0x29008001); @@ -1720,7 +1720,7 @@ void func_8002C17C(Player* player, s8 playerId) { } else if (D_80165330[playerId] == 0) { gCopyNearestPathPointByPlayerId[playerId] = gNearestPathPointByPlayerId[playerId]; gCopyPathIndexByPlayerId[playerId] = gPathIndexByPlayerId[playerId]; - } else if (!(player->effects & 8)) { + } else if (!(player->effects & UNKNOWN_EFFECT_0x8)) { if (func_802ABDF4(player->collision.meshIndexZX) == 0) { D_80165330[playerId] = 0; } @@ -1742,7 +1742,7 @@ void func_8002C17C(Player* player, s8 playerId) { D_80165330[playerId] = 1; gCopyNearestPathPointByPlayerId[playerId] = gNearestPathPointByPlayerId[playerId]; gCopyPathIndexByPlayerId[playerId] = gPathIndexByPlayerId[playerId]; - } else if (((player->effects & BOOST_RAMP_ASPHALT_EFFECT) == 0) && !(player->effects & 8)) { + } else if (((player->effects & BOOST_RAMP_ASPHALT_EFFECT) == 0) && !(player->effects & UNKNOWN_EFFECT_0x8)) { D_80165330[playerId] = 0; gCopyNearestPathPointByPlayerId[playerId] = gNearestPathPointByPlayerId[playerId]; gCopyPathIndexByPlayerId[playerId] = gPathIndexByPlayerId[playerId]; @@ -1756,7 +1756,7 @@ void func_8002C17C(Player* player, s8 playerId) { } else if (D_80165330[playerId] == 0) { gCopyNearestPathPointByPlayerId[playerId] = gNearestPathPointByPlayerId[playerId]; gCopyPathIndexByPlayerId[playerId] = gPathIndexByPlayerId[playerId]; - } else if (!((player->effects & 8) || (player->unk_0CA & 1))) { + } else if (!((player->effects & UNKNOWN_EFFECT_0x8) || (player->unk_0CA & 1))) { D_80165330[playerId] = 0; } break; @@ -1804,7 +1804,7 @@ void func_8002C4F8(Player* player, s8 playerIndex) { } if (player->collision.surfaceDistance[2] >= 600.0f) { player->unk_0CA |= 0x0100; - } else if ((player->effects & 8) != 8) { + } else if ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) { player->unk_0CA &= ~0x0100; } if ((player->type & PLAYER_CPU) && ((func_802ABDF4(player->collision.meshIndexZX) != 0) || (player->unk_0CA & 1))) { @@ -1813,7 +1813,7 @@ void func_8002C4F8(Player* player, s8 playerIndex) { func_80090868(player); } } - if ((player->type & PLAYER_CPU) && (player->surfaceType == OUT_OF_BOUNDS) && !(player->effects & 8)) { + if ((player->type & PLAYER_CPU) && (player->surfaceType == OUT_OF_BOUNDS) && !(player->effects & UNKNOWN_EFFECT_0x8)) { func_80090778(player); func_80090868(player); } @@ -1822,7 +1822,7 @@ void func_8002C4F8(Player* player, s8 playerIndex) { void func_8002C7E4(Player* player, s8 playerIndex, s8 arg2) { if ((player->unk_046 & 1) != 1) { - if ((player->effects & 0x8000) == 0x8000) { + if ((player->effects & UNKNOWN_EFFECT_0x8000) == UNKNOWN_EFFECT_0x8000) { if ((player->effects & BOOST_EFFECT) != BOOST_EFFECT) { func_8002B9CC(player, playerIndex, arg2); } @@ -1843,14 +1843,14 @@ void func_8002C7E4(Player* player, s8 playerIndex, s8 arg2) { } } } - if ((player->effects & 0x8000) == 0x8000) { - player->effects &= ~0x8000; + if ((player->effects & UNKNOWN_EFFECT_0x8000) == UNKNOWN_EFFECT_0x8000) { + player->effects &= ~UNKNOWN_EFFECT_0x8000; player->unk_10C = 1; player->unk_044 &= ~0x0001; return; } player->unk_046 &= ~0x0001; - player->effects &= ~0x8000; + player->effects &= ~UNKNOWN_EFFECT_0x8000; if (player->unk_10C > 0) { player->unk_10C += 1; } @@ -1871,7 +1871,7 @@ void func_8002C954(Player* player, s8 playerId, Vec3f velocity) { if (((((player->effects & TERRAIN_TUMBLE_EFFECT) != TERRAIN_TUMBLE_EFFECT) && ((player->effects & BOOST_RAMP_ASPHALT_EFFECT) == BOOST_RAMP_ASPHALT_EFFECT)) || ((((temp_f0 >= 20.0f) || (temp_f0 < (-1.0f))) && ((player->effects & TERRAIN_TUMBLE_EFFECT) == 0)) && - (player->effects & 8)) || + (player->effects & UNKNOWN_EFFECT_0x8)) || ((player->collision.unk34 == 0) && ((player->effects & TERRAIN_TUMBLE_EFFECT) == 0))) && (((player->unk_0CA & 2) == 0) || (!(player->unk_0CA & 8)))) { func_8008F494(player, playerId); @@ -1924,7 +1924,7 @@ void apply_effect(Player* player, s8 playerIndex, s8 arg2) { if (((player->unk_0CA & 2) == 2) || ((player->unk_0CA & 8) == 8)) { func_80090970(player, playerIndex, arg2); } - if ((player->effects & 0x800) == 0x800) { + if ((player->effects & UNKNOWN_EFFECT_0x800) == UNKNOWN_EFFECT_0x800) { func_8008CEB0(player, playerIndex); } if (player->unk_044 & 0x4000) { @@ -1957,10 +1957,10 @@ void apply_effect(Player* player, s8 playerIndex, s8 arg2) { if (((player->effects & UNKNOWN_EFFECT_0x20000000) == UNKNOWN_EFFECT_0x20000000) && (player->unk_228 >= 0x64)) { player_decelerate_alternative(player, 4.0f); } - 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_8008C9EC(player, playerIndex); } - if ((player->effects & 0x400) == 0x400) { + if ((player->effects & UNKNOWN_EFFECT_0x400) == UNKNOWN_EFFECT_0x400) { func_8008C62C(player, playerIndex); } if ((player->effects & UNKNOWN_EFFECT_0x1000000) == UNKNOWN_EFFECT_0x1000000) { @@ -1969,10 +1969,10 @@ void apply_effect(Player* player, s8 playerIndex, s8 arg2) { if ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) { apply_hit_by_item_effect(player, playerIndex); } - if ((player->effects & 0x4000) == 0x4000) { + if ((player->effects & UNKNOWN_EFFECT_0x4000) == UNKNOWN_EFFECT_0x4000) { func_8008F1B8(player, playerIndex); } - if ((player->effects & 0x80000) == 0x80000) { + if ((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) { func_8008D698(player, playerIndex); } if ((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) { @@ -2112,12 +2112,12 @@ void func_8002D268(Player* player, UNUSED Camera* camera, s8 screenId, s8 player gravityZ = -1 * (player->unk_064[2] + sp16C[2]) + ((-player->collision.orientationVector[2] * player->kartGravity) * sp104[temp3]); } - if (((player->effects & 8) != 8) && ((player->effects & 0x20) == 0x20)) { + if (((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) && ((player->effects & UNKNOWN_EFFECT_0x20) == UNKNOWN_EFFECT_0x20)) { gravityX = 0 * (player->unk_064[0] + sp16C[0]); gravityY = -1 * player->kartGravity / 4; gravityZ = 0 * (player->unk_064[2] + sp16C[2]); } - if ((player->effects & 8) == 8) { + if ((player->effects & UNKNOWN_EFFECT_0x8) == UNKNOWN_EFFECT_0x8) { gravityX = 0 * (player->unk_064[0] + sp16C[0]); gravityY = -1 * player->kartGravity; gravityZ = 0 * (player->unk_064[2] + sp16C[2]); @@ -2216,12 +2216,12 @@ void func_8002D268(Player* player, UNUSED Camera* camera, s8 screenId, s8 player calculate_orientation_matrix(player->orientationMatrix, player->unk_058, player->unk_05C, player->unk_060, player->rotation[1] + 0x8000); } - player->effects |= 8; + player->effects |= UNKNOWN_EFFECT_0x8; player->unk_0C2 += 1; surfaceDistance = player->collision.surfaceDistance[2]; if (surfaceDistance <= 0.0f) { - player->effects = player->effects & (~2); - player->effects = player->effects & (~8); + player->effects = player->effects & (~UNKNOWN_EFFECT_0x2); + player->effects = player->effects & (~UNKNOWN_EFFECT_0x8); if (player->unk_0C2 >= 35) { if (player->unk_0C2 >= 0x32) { player->unk_0C2 = 0x32; @@ -2295,12 +2295,12 @@ void func_8002D268(Player* player, UNUSED Camera* camera, s8 screenId, s8 player } } } - if (((!(player->effects & 8)) && (func_802ABDB8(player->collision.meshIndexZX) != 0)) && + if (((!(player->effects & UNKNOWN_EFFECT_0x8)) && (func_802ABDB8(player->collision.meshIndexZX) != 0)) && ((player->effects & TERRAIN_TUMBLE_EFFECT) != TERRAIN_TUMBLE_EFFECT)) { if ((!(player->unk_0CA & 2)) || (!(player->unk_0CA & 8))) { func_8008F494(player, playerId); } - } else if (((!(player->effects & 8)) && (func_802ABDB8(player->collision.meshIndexZX) == 0)) && + } else if (((!(player->effects & UNKNOWN_EFFECT_0x8)) && (func_802ABDB8(player->collision.meshIndexZX) == 0)) && (player->effects & TERRAIN_TUMBLE_EFFECT)) { func_8008F5A4(player, playerId); } @@ -2401,11 +2401,11 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player Vec3f sp48; s16 sp46; func_8002B830(player, playerId, screenId); - if ((((((((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40)) || - ((player->effects & 0x4000) == 0x4000)) || - ((player->effects & 0x80000) == 0x80000)) || + 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 & 0x20000) == 0x20000)) || + ((player->effects & UNKNOWN_EFFECT_0x20000) == UNKNOWN_EFFECT_0x20000)) || (player->unk_044 & 0x800)) { sp46 = 1; } else { @@ -2414,8 +2414,8 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player apply_effect(player, playerId, screenId); func_8002AB70(player); func_8002FCA8(player, playerId); - if ((((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40)) || - ((player->effects & 0x20000) == 0x20000)) { + 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)) { gravityX = -1 * (player->unk_064[0]) + (((-player->collision.orientationVector[0]) * player->kartGravity) * 0.1); gravityY = (-player->collision.orientationVector[1]) * player->kartGravity; gravityZ = -1 * (player->unk_064[2]) + (((-player->collision.orientationVector[2]) * player->kartGravity) * 0.1); @@ -2443,7 +2443,7 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player newVelocity[0] = player->velocity[0]; newVelocity[1] = player->velocity[1]; newVelocity[2] = player->velocity[2]; - if ((player->unk_10C < 3) && ((player->unk_256) < 3) && ((player->effects & 0x400) != 0x400) && + if ((player->unk_10C < 3) && ((player->unk_256) < 3) && ((player->effects & UNKNOWN_EFFECT_0x400) != UNKNOWN_EFFECT_0x400) && ((player->effects & UNKNOWN_EFFECT_0x1000000) != UNKNOWN_EFFECT_0x1000000) && ((player->effects & HIT_BY_ITEM_EFFECT) != HIT_BY_ITEM_EFFECT)) { newVelocity[0] += (((((spEC[0] + gravityX) + spD4[0])) - (newVelocity[0] * (0.12 * player->kartFriction))) / 6000) / @@ -2478,16 +2478,16 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player nextY += player->kartHopVelocity; actor_terrain_collision(&player->collision, player->boundingBoxSize, nextX, nextY, nextZ, player->oldPos[0], player->oldPos[1], player->oldPos[2]); - player->effects |= 8; + player->effects |= UNKNOWN_EFFECT_0x8; player->unk_0C2 += 1; player->unk_058 = 0.0f; player->unk_060 = 0.0f; player->unk_05C = 1.0f; surfaceDistance = player->collision.surfaceDistance[2]; if (surfaceDistance <= 0.0f) { - player->effects &= ~2; - player->effects &= ~8; - if ((((player->effects & 0x400) != 0x400) && + player->effects &= ~UNKNOWN_EFFECT_0x2; + player->effects &= ~UNKNOWN_EFFECT_0x8; + if ((((player->effects & UNKNOWN_EFFECT_0x400) != UNKNOWN_EFFECT_0x400) && ((player->effects & UNKNOWN_EFFECT_0x1000000) != UNKNOWN_EFFECT_0x1000000)) && ((player->effects & HIT_BY_ITEM_EFFECT) != HIT_BY_ITEM_EFFECT)) { if (player->unk_0C2 >= 0x1C) { @@ -2530,7 +2530,7 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player if (player->unk_0C2 >= 0x28) { player->unk_0C2 = 0x0014; } - if ((player->effects & 0x400) == 0x400) { + if ((player->effects & UNKNOWN_EFFECT_0x400) == UNKNOWN_EFFECT_0x400) { player->unk_0C2 /= 6.5; player->kartHopJerk = 0.06f; player->kartHopAcceleration = 0.0f; @@ -2583,7 +2583,7 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player if ((!(player->unk_0CA & 2)) || (!(player->unk_0CA & 8))) { func_8008F494(player, playerId); } - } else if (((!(player->effects & 8)) && (func_802ABDB8(player->collision.meshIndexZX) == 0)) && + } else if (((!(player->effects & UNKNOWN_EFFECT_0x8)) && (func_802ABDB8(player->collision.meshIndexZX) == 0)) && (player->effects & TERRAIN_TUMBLE_EFFECT)) { func_8008F5A4(player, playerId); } @@ -2599,9 +2599,9 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player temp = (newVelocity[0] * newVelocity[0]) + (newVelocity[2] * newVelocity[2]); player->previousSpeed = player->speed; player->speed = sqrtf(temp); - if ((((player->effects & 0x400) != 0x400) && (player->unk_08C <= 0) && (player->speed < 0.13)) || - (((player->effects & 0x400) != 0x400) && (player->unk_08C <= 0) && (player->speed < 0.20) && - ((player->effects & 1) == 1))) { + if ((((player->effects & UNKNOWN_EFFECT_0x400) != UNKNOWN_EFFECT_0x400) && (player->unk_08C <= 0) && (player->speed < 0.13)) || + (((player->effects & UNKNOWN_EFFECT_0x400) != UNKNOWN_EFFECT_0x400) && (player->unk_08C <= 0) && (player->speed < 0.20) && + ((player->effects & BRAKING_EFFECT) == BRAKING_EFFECT))) { newVelocity[0] = newVelocity[0] + (-1 * newVelocity[0]); newVelocity[2] = newVelocity[2] + (-1 * newVelocity[2]); } else { @@ -2655,7 +2655,7 @@ void control_cpu_movement(Player* player, UNUSED Camera* camera, s8 screenId, s8 sp7C = 0 * player->unk_064[2] + spDC[2]; player->unk_10C = 0; player->unk_256 = 0; - player->effects &= ~0x8000; + player->effects &= ~UNKNOWN_EFFECT_0x8000; spF4[2] = func_80030150(player, playerId); mtxf_transform_vec3f_mat3(spF4, player->orientationMatrix); newVelocity[0] = player->velocity[0]; @@ -2675,8 +2675,8 @@ void control_cpu_movement(Player* player, UNUSED Camera* camera, s8 screenId, s8 calculate_orientation_matrix(player->orientationMatrix, player->unk_058, player->unk_05C, player->unk_060, player->rotation[1]); player->unk_0C2 = 0; - player->effects &= ~2; - player->effects &= ~8; + player->effects &= ~UNKNOWN_EFFECT_0x2; + player->effects &= ~UNKNOWN_EFFECT_0x8; player->slopeAccel = 0; player->unk_206 = 0; toSqrt = (newVelocity[0] * newVelocity[0]) + (newVelocity[2] * newVelocity[2]); @@ -2762,7 +2762,7 @@ void func_8002F730(Player* player, UNUSED Camera* camera, UNUSED s8 screenId, s8 player->unk_05C = 1.0f; player->unk_060 = 0.0f; calculate_orientation_matrix(player->orientationMatrix, 0.0f, 1.0f, 0.0f, (s16) (s32) player->rotation[1]); - player->effects &= ~8; + player->effects &= ~UNKNOWN_EFFECT_0x8; surfaceDistance = player->collision.surfaceDistance[2]; if (surfaceDistance <= 0.0f) { if (1) {}; @@ -2781,7 +2781,7 @@ void func_8002F730(Player* player, UNUSED Camera* camera, UNUSED s8 screenId, s8 player->previousSpeed = player->speed; player->speed = sqrtf(sqrt); if (((player->unk_08C <= 0.0f) && ((f64) player->speed < 0.13)) || - ((player->unk_08C <= 0.0f) && ((f64) player->speed < 0.2) && ((player->effects & 1) == 1))) { + ((player->unk_08C <= 0.0f) && ((f64) player->speed < 0.2) && ((player->effects & BRAKING_EFFECT) == BRAKING_EFFECT))) { newVelocity[0] = newVelocity[0] + (newVelocity[0] * -1.0f); newVelocity[2] = newVelocity[2] + (newVelocity[2] * -1.0f); } else { @@ -2844,7 +2844,7 @@ void func_8002FCA8(Player* player, s8 playerIndex) { var_f0 += 1.0; } } - if (((player->effects & 0x200000) == 0x200000) && ((player->type & PLAYER_HUMAN) != PLAYER_HUMAN)) { + if (((player->effects & CPU_FAST_EFFECT) == CPU_FAST_EFFECT) && ((player->type & PLAYER_HUMAN) != PLAYER_HUMAN)) { var_f0 = -3.0f; } @@ -2862,13 +2862,13 @@ void func_8002FE84(Player* player, f32 arg1) { s16 temp_lo; s32 test; - if ((player->effects & 0x4000) == 0x4000) { + if ((player->effects & UNKNOWN_EFFECT_0x4000) == UNKNOWN_EFFECT_0x4000) { player->unk_098 = ((player->currentSpeed * player->currentSpeed) / 25.0f) * 1.1; return; } // Huh? - if (((player->effects & 0xFFFFFFFF) & 8) == 8) { + if (((player->effects & 0xFFFFFFFF) & UNKNOWN_EFFECT_0x8) == UNKNOWN_EFFECT_0x8) { player->unk_098 = ((player->currentSpeed * player->currentSpeed) / 25.0f) * 1.1; return; } @@ -2897,7 +2897,7 @@ void func_8002FE84(Player* player, f32 arg1) { var_f0 += test * 0.004; } player->unk_098 = arg1 * (1.0 + (var_f0 * 0.7)); - if ((player->effects & 0x20) == 0x20) { + if ((player->effects & UNKNOWN_EFFECT_0x20) == UNKNOWN_EFFECT_0x20) { temp_f0_3 = player->currentSpeed + 180.0f; player->unk_098 = (temp_f0_3 * temp_f0_3) / 25.0f; } @@ -2932,7 +2932,7 @@ f32 func_80030150(Player* player, s8 playerIndex) { var_f0 += D_800E2E90[player->characterId][player->tyres[FRONT_LEFT].surfaceType]; } } - if (((player->effects & 8) != 8) && ((player->unk_0CA & 2) != 2)) { + if (((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) && ((player->unk_0CA & 2) != 2)) { temp_lo = player->slopeAccel / 182; if (var_f2 >= 20.0f) { if ((temp_lo > 0x11) || (temp_lo < -0x11)) { @@ -2983,7 +2983,7 @@ f32 func_80030150(Player* player, s8 playerIndex) { var_f0 += 0.05; } } - if ((player->effects & 8) != 0) { + if ((player->effects & UNKNOWN_EFFECT_0x8) != 0) { move_f32_towards(&player->unk_0A0, player->unk_08C * 0.04, 0.15f); } else { move_f32_towards(&player->unk_0A0, 0.0f, 0.1f); @@ -2999,7 +2999,7 @@ f32 func_80030150(Player* player, s8 playerIndex) { } } if ((player->type & PLAYER_HUMAN) != PLAYER_HUMAN) { - if ((player->effects & 0x200000) == 0x200000) { + if ((player->effects & CPU_FAST_EFFECT) == CPU_FAST_EFFECT) { move_f32_towards(&player->unk_0E8, 380.0f, 0.5f); } else { move_f32_towards(&player->unk_0E8, 0.0f, 0.1f); @@ -3012,7 +3012,7 @@ f32 func_80030150(Player* player, s8 playerIndex) { } else { move_f32_towards(&player->unk_0E8, 0.0f, 0.01f); } - if ((player->effects & 0x200000) == 0x200000) { + if ((player->effects & CPU_FAST_EFFECT) == CPU_FAST_EFFECT) { move_f32_towards(&player->unk_0E4, 580.0f, 0.01f); } else { move_f32_towards(&player->unk_0E4, 0.0f, 0.01f); @@ -3027,7 +3027,7 @@ f32 func_80030150(Player* player, s8 playerIndex) { ((player->type & PLAYER_START_SEQUENCE) == PLAYER_START_SEQUENCE)) { return (1.0f - player->unk_104) * var_f2; } - 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->effects & UNKNOWN_EFFECT_0x1000000) == UNKNOWN_EFFECT_0x1000000) || ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT)) { return (1.0f - player->unk_104) * var_f2; @@ -3315,7 +3315,7 @@ void player_accelerate_alternative(Player* player) { if (player->topSpeed <= player->currentSpeed) { player->currentSpeed = player->topSpeed; } - if (!((player->effects & 8)) || ((player->effects & LIGHTNING_EFFECT))) { + if (!((player->effects & UNKNOWN_EFFECT_0x8)) || ((player->effects & LIGHTNING_EFFECT))) { player->unk_08C = (player->currentSpeed * player->currentSpeed) / 25.0f; } player->unk_044 |= 0x20; @@ -3339,7 +3339,7 @@ void player_decelerate_alternative(Player* player, f32 speed) { if (player->topSpeed <= player->currentSpeed) { player->currentSpeed = player->topSpeed; } - if ((player->effects & 8) != 8) { + if ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) { player->unk_08C = (player->currentSpeed * player->currentSpeed) / 25.0f; } player->unk_044 &= 0xFFDF; @@ -3501,9 +3501,9 @@ void func_800323E4(Player* player) { if (player == gPlayerEight) { playerIndex = 7; } - player->effects |= 1; + player->effects |= BRAKING_EFFECT; // This check will never be true, why is it here? - if ((player->effects & 0x20) == 0x20) { + if ((player->effects & UNKNOWN_EFFECT_0x20) == UNKNOWN_EFFECT_0x20) { player_decelerate_alternative(player, 1.0f); player->unk_20C = var_f2; } else { @@ -3824,10 +3824,10 @@ void func_80033AE0(Player* player, struct Controller* controller, s8 arg2) { 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8 }; - if (((((player->effects & 2) != 2) && ((((player->unk_0C0 / 182) <= 6) && ((player->unk_0C0 / 182) >= (-6))) || + if (((((player->effects & UNKNOWN_EFFECT_0x2) != UNKNOWN_EFFECT_0x2) && ((((player->unk_0C0 / 182) <= 6) && ((player->unk_0C0 / 182) >= (-6))) || ((controller->button & R_TRIG) != R_TRIG))) || (((player->speed / 18.0f) * 216.0f) <= 20.0f)) || - ((player->effects & 0x8000) == 0x8000)) { + ((player->effects & UNKNOWN_EFFECT_0x8000) == UNKNOWN_EFFECT_0x8000)) { func_80036CB4(player); } if ((player->unk_0C0 / 182) < (-5)) { @@ -3842,7 +3842,7 @@ void func_80033AE0(Player* player, struct Controller* controller, s8 arg2) { player->unk_044 &= 0xFFF9; D_801652C0[arg2] = 0; } - if (((player->effects & 2) == 2) || ((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT)) { + if (((player->effects & UNKNOWN_EFFECT_0x2) == UNKNOWN_EFFECT_0x2) || ((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT)) { player->unk_044 &= 0xFFF9; } sp2E4 = player->unk_07C; @@ -3857,7 +3857,7 @@ void func_80033AE0(Player* player, struct Controller* controller, s8 arg2) { if (((sp2D0 >= 0x5A) || (sp2D0 < (-0x59))) && (!(player->unk_044 & 0x4000))) { if ((((((!(player->effects & DRIFTING_EFFECT)) && (gCCSelection == CC_150)) && (gModeSelection != BATTLE)) && - (!(player->effects & 8))) && + (!(player->effects & UNKNOWN_EFFECT_0x8))) && (((player->speed / 18.0f) * 216.0f) >= 40.0f)) && (player->unk_204 == 0)) { player->soundEffects |= 0x80; @@ -3869,11 +3869,11 @@ void func_80033AE0(Player* player, struct Controller* controller, s8 arg2) { if (((s32) player->tyres[BACK_LEFT].surfaceType) < 0xF) { var_f2 += D_800E3610[player->characterId][player->tyres[BACK_LEFT].surfaceType]; } - if ((player->effects & 0x20) == 0x20) { + if ((player->effects & UNKNOWN_EFFECT_0x20) == UNKNOWN_EFFECT_0x20) { sp2C8 = 10; sp2CC = 10; } else { - if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && ((player->effects & 2) != 2)) { + if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && ((player->effects & UNKNOWN_EFFECT_0x2) != UNKNOWN_EFFECT_0x2)) { var_a0 = 3; } else { var_a0 = 0; @@ -4022,7 +4022,7 @@ void func_80033AE0(Player* player, struct Controller* controller, s8 arg2) { if (var_f2_2 < 0.0f) { var_f2_2 = -var_f2_2; } - if ((player->effects & 0x20) == 0x20) { + if ((player->effects & UNKNOWN_EFFECT_0x20) == UNKNOWN_EFFECT_0x20) { var_f2_2 = var_f2_2 * (sp44[((s16) ((player->speed / 18.0f) * 216.0f)) + 10] * 1.5f); } else if ((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) { var_f2_2 = var_f2_2 * sp44[(s16) ((player->speed / 18.0f) * 216.0f)]; @@ -4042,8 +4042,8 @@ void func_80033AE0(Player* player, struct Controller* controller, s8 arg2) { if (((s32) player->tyres[BACK_LEFT].surfaceType) < 0xF) { var_f12 += D_800E3410[player->characterId][player->tyres[BACK_LEFT].surfaceType]; } - if (((player->effects & 2) != 2) && ((player->effects & DRIFTING_EFFECT) != DRIFTING_EFFECT)) { - if ((player->effects & 0x20) == 0x20) { + if (((player->effects & UNKNOWN_EFFECT_0x2) != UNKNOWN_EFFECT_0x2) && ((player->effects & DRIFTING_EFFECT) != DRIFTING_EFFECT)) { + if ((player->effects & UNKNOWN_EFFECT_0x20) == UNKNOWN_EFFECT_0x20) { player->unk_078 = (s16) ((s32) (((f32) ((((s32) player->unk_07C) >> 0x10) * 5)) * var_f2_2)); } else { if ((player->effects & BRAKING_EFFECT) != BRAKING_EFFECT) { @@ -4070,7 +4070,7 @@ void func_80033AE0(Player* player, struct Controller* controller, s8 arg2) { player->driftState = 0; } } - } else if (((player->effects & 8) != 8) && ((player->effects & 2) != 2)) { + } else if (((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) && ((player->effects & UNKNOWN_EFFECT_0x2) != UNKNOWN_EFFECT_0x2)) { if ((((s16) player->unk_0C0) / 182) > 0) { var_s1_2 = (((s32) (((player->unk_07C >> 0x10) * 0xD) + 0x2B1)) / 106) + 0x28; if ((player->unk_07C >> 0x10) < (-0x27)) { @@ -4141,14 +4141,14 @@ void apply_cpu_turn(Player* player, s16 targetAngle) { 3.0f, 3.0f, 3.0f, 3.0f, 3.0f, 3.0f, 3.0f, 3.0f, }; - if (!((player->effects & 0x80) || (player->effects & 0x40) || (player->effects & 0x400) || - (player->effects & TERRAIN_TUMBLE_EFFECT) || (player->effects & 0x20000) || + if (!((player->effects & BANANA_SPINOUT_EFFECT) || (player->effects & DRIVING_SPINOUT_EFFECT) || (player->effects & UNKNOWN_EFFECT_0x400) || + (player->effects & TERRAIN_TUMBLE_EFFECT) || (player->effects & UNKNOWN_EFFECT_0x20000) || (player->effects & UNKNOWN_EFFECT_0x1000000) || (player->effects & HIT_BY_ITEM_EFFECT) || (player->effects & HIT_EFFECT))) { if (!(((player->speed / 18.0f) * 216.0f) >= 110.0f)) { player->effects &= ~UNKNOWN_EFFECT_0x20000000; player->unk_228 = 0; - if (!(player->effects & 0x80) && !(player->effects & 0x40)) { + if (!(player->effects & BANANA_SPINOUT_EFFECT) && !(player->effects & DRIVING_SPINOUT_EFFECT)) { sp304 = (s32) player->unk_07C >> 0x10; move_s32_towards(&sp304, (s32) targetAngle, 0.35f); sp304 <<= 0x10; @@ -4169,13 +4169,13 @@ void apply_cpu_turn(Player* player, s16 targetAngle) { var_f0; } player->unk_07C = sp304; - if (((player->effects & 2) != 2) && ((player->effects & DRIFTING_EFFECT) != DRIFTING_EFFECT)) { - if ((player->effects & 1) != 1) { + if (((player->effects & UNKNOWN_EFFECT_0x2) != UNKNOWN_EFFECT_0x2) && ((player->effects & DRIFTING_EFFECT) != DRIFTING_EFFECT)) { + if ((player->effects & BRAKING_EFFECT) != BRAKING_EFFECT) { player->unk_078 = (player->unk_07C >> 0x10) * var_f0; } else { player->unk_078 = (player->unk_07C >> 0x10) * (var_f0 + 1.5); } - } else if ((player->effects & 8) != 8) { + } else if ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) { if (((s16) player->unk_0C0 / 182) > 0) { var_v0 = player->unk_07C >> 0x10; } else { @@ -4190,8 +4190,8 @@ void apply_cpu_turn(Player* player, s16 targetAngle) { } player->unk_078 = var_v0 * var_f0; } - if ((((player->effects & 2) != 2) && (player->unk_0C0 < 0x3D) && (player->unk_0C0 > -0x3D)) || - (((player->speed / 18.0f) * 216.0f) <= 20.0f) || ((player->effects & 0x8000) == 0x8000)) { + if ((((player->effects & UNKNOWN_EFFECT_0x2) != UNKNOWN_EFFECT_0x2) && (player->unk_0C0 < 0x3D) && (player->unk_0C0 > -0x3D)) || + (((player->speed / 18.0f) * 216.0f) <= 20.0f) || ((player->effects & UNKNOWN_EFFECT_0x8000) == UNKNOWN_EFFECT_0x8000)) { func_80036CB4(player); } } @@ -4220,11 +4220,11 @@ void func_80036CB4(Player* player) { test = ((((player->unk_07C >> 0x10) * 0xD) + 0x2B1) / 106) - 0x35; player->unk_07C = test << 0x10; } - player->effects &= ~0x10; + player->effects &= ~DRIFTING_EFFECT; } if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && ((player->type & PLAYER_HUMAN) != PLAYER_HUMAN)) { - player->effects &= ~0x10; + player->effects &= ~DRIFTING_EFFECT; } } @@ -4235,16 +4235,16 @@ void func_80036DB4(Player* player, Vec3f arg1, Vec3f arg2) { f32 var_f18; s32 temp_t6; - if (((player->effects & LOST_RACE_EFFECT) == LOST_RACE_EFFECT) || ((player->effects & 0x20) == 0x20)) { + if (((player->effects & LOST_RACE_EFFECT) == LOST_RACE_EFFECT) || ((player->effects & UNKNOWN_EFFECT_0x20) == UNKNOWN_EFFECT_0x20)) { arg1[0] = 0.0f; arg1[1] = 0.0f; arg1[2] = 0.0f; mtxf_transform_vec3f_mat3(arg1, player->orientationMatrix); } else { - if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && ((player->effects & 2) != 2)) { + if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && ((player->effects & UNKNOWN_EFFECT_0x2) != UNKNOWN_EFFECT_0x2)) { var_f18 = player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) * 3.0f) + (-player->unk_20C * 10.0f); sp20 = player->unk_084 * 3.0f; - } else if (!(player->effects & 0x800) && !(player->unk_044 & 0x4000)) { + } else if (!(player->effects & UNKNOWN_EFFECT_0x800) && !(player->unk_044 & 0x4000)) { thing = player->unk_0FA; if (thing > 0) { thing *= -1; @@ -4269,7 +4269,7 @@ void func_80036DB4(Player* player, Vec3f arg1, Vec3f arg2) { sp20 = player->unk_084; } if ((player->effects & STAR_EFFECT) == STAR_EFFECT) { - if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && ((player->effects & 2) != 2)) { + if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && ((player->effects & UNKNOWN_EFFECT_0x2) != UNKNOWN_EFFECT_0x2)) { var_f18 = player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) * 3.0f) + (-player->unk_20C * 10.0f); sp20 = player->unk_084 * 3.0f; } else { @@ -4293,16 +4293,16 @@ void func_800371F4(Player* player, Vec3f arg1, Vec3f arg2) { f32 var_f18; s32 temp_t6; - if (((player->effects & LOST_RACE_EFFECT) == LOST_RACE_EFFECT) || ((player->effects & 0x20) == 0x20)) { + if (((player->effects & LOST_RACE_EFFECT) == LOST_RACE_EFFECT) || ((player->effects & UNKNOWN_EFFECT_0x20) == UNKNOWN_EFFECT_0x20)) { arg1[0] = 0.0f; arg1[1] = 0.0f; arg1[2] = 0.0f; mtxf_transform_vec3f_mat3(arg1, player->orientationMatrix); } else { - if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && ((player->effects & 2) != 2)) { + if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && ((player->effects & UNKNOWN_EFFECT_0x2) != UNKNOWN_EFFECT_0x2)) { var_f18 = player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) * 3.0f) + (-player->unk_20C * 50.0f); sp20 = player->unk_084 * 3.0f; - } else if (!(player->effects & 0x800) && !(player->unk_044 & 0x4000)) { + } else if (!(player->effects & UNKNOWN_EFFECT_0x800) && !(player->unk_044 & 0x4000)) { var_v0 = player->unk_0FA; if (var_v0 > 0) { var_v0 *= -1; @@ -4330,7 +4330,7 @@ void func_800371F4(Player* player, Vec3f arg1, Vec3f arg2) { sp20 = player->unk_084; } if ((player->effects & STAR_EFFECT) == STAR_EFFECT) { - if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && ((player->effects & 2) != 2)) { + if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && ((player->effects & UNKNOWN_EFFECT_0x2) != UNKNOWN_EFFECT_0x2)) { var_f18 = player->unk_208 + ((-(player->speed / 18.0f) * 216.0f) * 3.0f) + (-player->unk_20C * 50.0f); sp20 = player->unk_084 * 3.0f; } else { @@ -4352,13 +4352,13 @@ void func_80037614(Player* player, Vec3f arg1, Vec3f arg2) { f32 var_f12; f32 var_f2; - if (((player->effects & LOST_RACE_EFFECT) == LOST_RACE_EFFECT) || ((player->effects & 0x20) == 0x20)) { + if (((player->effects & LOST_RACE_EFFECT) == LOST_RACE_EFFECT) || ((player->effects & UNKNOWN_EFFECT_0x20) == UNKNOWN_EFFECT_0x20)) { arg1[0] = 0.0f; arg1[1] = 0.0f; arg1[2] = 0.0f; mtxf_transform_vec3f_mat3(arg1, player->orientationMatrix); } else { - if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && ((player->effects & 2) != 2)) { + if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && ((player->effects & UNKNOWN_EFFECT_0x2) != UNKNOWN_EFFECT_0x2)) { var_f2 = ((-(player->speed / 18.0f) * 216.0f) * 2) + -80.0f; var_f12 = -80.0f; } else { @@ -4380,13 +4380,13 @@ void func_8003777C(Player* player, Vec3f arg1, Vec3f arg2) { f32 var_f12; f32 var_f2; - if (((player->effects & LOST_RACE_EFFECT) == LOST_RACE_EFFECT) || ((player->effects & 0x20) == 0x20)) { + if (((player->effects & LOST_RACE_EFFECT) == LOST_RACE_EFFECT) || ((player->effects & UNKNOWN_EFFECT_0x20) == UNKNOWN_EFFECT_0x20)) { arg1[0] = 0.0f; arg1[1] = 0.0f; arg1[2] = 0.0f; mtxf_transform_vec3f_mat3(arg1, player->orientationMatrix); } else { - if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && ((player->effects & 2) != 2)) { + if (((player->effects & DRIFTING_EFFECT) == DRIFTING_EFFECT) && ((player->effects & UNKNOWN_EFFECT_0x2) != UNKNOWN_EFFECT_0x2)) { var_f2 = ((-(player->speed / 18.0f) * 216.0f) * 2) + -80.0f; var_f12 = -80.0f; } else { @@ -4407,7 +4407,7 @@ void func_800378E8(Player* player, Vec3f arg1, Vec3f arg2) { f32 var_f12; f32 var_f2; - if ((player->effects & 0x20) == 0x20) { + if ((player->effects & UNKNOWN_EFFECT_0x20) == UNKNOWN_EFFECT_0x20) { arg1[0] = 0.0f; arg1[1] = 0.0f; arg1[2] = 0.0f; @@ -4434,7 +4434,7 @@ void func_80037A4C(Player* player, Vec3f arg1, Vec3f arg2) { f32 var_f12; f32 var_f2; - if ((player->effects & 0x20) == 0x20) { + if ((player->effects & UNKNOWN_EFFECT_0x20) == UNKNOWN_EFFECT_0x20) { arg1[0] = 0.0f; arg1[1] = 0.0f; arg1[2] = 0.0f; @@ -4497,14 +4497,14 @@ void func_80037BB4(Player* player, Vec3f arg1) { } void func_80037CFC(Player* player, struct Controller* controller, s8 playerIndex) { - if (((player->effects & 0x80) != 0x80) && ((player->effects & 0x40) != 0x40) && - ((player->effects & 0x400) != 0x400) && ((player->effects & 0x4000) != 0x4000) && + if (((player->effects & BANANA_SPINOUT_EFFECT) != BANANA_SPINOUT_EFFECT) && ((player->effects & DRIVING_SPINOUT_EFFECT) != DRIVING_SPINOUT_EFFECT) && + ((player->effects & UNKNOWN_EFFECT_0x400) != UNKNOWN_EFFECT_0x400) && ((player->effects & UNKNOWN_EFFECT_0x4000) != UNKNOWN_EFFECT_0x4000) && ((player->effects & UNKNOWN_EFFECT_0x1000000) != UNKNOWN_EFFECT_0x1000000) && ((player->effects & HIT_BY_ITEM_EFFECT) != HIT_BY_ITEM_EFFECT) && ((player->effects & TERRAIN_TUMBLE_EFFECT) != TERRAIN_TUMBLE_EFFECT) && - ((player->effects & 0x20000) != 0x20000)) { - if (((player->effects & HIT_EFFECT) != HIT_EFFECT) && ((player->effects & 8) != 8) && - ((player->effects & 2) != 2) && ((player->effects & DRIFTING_EFFECT) != DRIFTING_EFFECT) && + ((player->effects & UNKNOWN_EFFECT_0x20000) != UNKNOWN_EFFECT_0x20000)) { + if (((player->effects & HIT_EFFECT) != HIT_EFFECT) && ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) && + ((player->effects & UNKNOWN_EFFECT_0x2) != UNKNOWN_EFFECT_0x2) && ((player->effects & DRIFTING_EFFECT) != DRIFTING_EFFECT) && (controller->buttonPressed & R_TRIG)) { kart_hop(player); if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && @@ -4512,26 +4512,26 @@ void func_80037CFC(Player* player, struct Controller* controller, s8 playerIndex func_800C9060(playerIndex, 0x19008000); } } - if ((player->effects & 8) != 8) { + if ((player->effects & UNKNOWN_EFFECT_0x8) != UNKNOWN_EFFECT_0x8) { func_80033AE0(player, controller, playerIndex); - } else if (((player->effects & 2) == 2) && (player->collision.surfaceDistance[2] <= 5.0f)) { + } else if (((player->effects & UNKNOWN_EFFECT_0x2) == UNKNOWN_EFFECT_0x2) && (player->collision.surfaceDistance[2] <= 5.0f)) { func_80033AE0(player, controller, playerIndex); } - player->effects &= ~1; + player->effects &= ~BRAKING_EFFECT; if ((!(player->effects & BOOST_RAMP_ASPHALT_EFFECT)) && (!(player->effects & BOOST_RAMP_WOOD_EFFECT))) { if (((player->speed / 18.0f) * 216.0f) <= 12.0f) { if (controller->button & A_BUTTON) { if (controller->button & B_BUTTON) { - player->effects |= 0x20; - if ((player->effects & 0x20) != 0x20) { + player->effects |= UNKNOWN_EFFECT_0x20; + if ((player->effects & UNKNOWN_EFFECT_0x20) != UNKNOWN_EFFECT_0x20) { player->currentSpeed += 100.0f; } } } } - if (((player->effects & 0x20) == 0x20) && + if (((player->effects & UNKNOWN_EFFECT_0x20) == UNKNOWN_EFFECT_0x20) && (((controller->button & B_BUTTON) == 0) || (!(controller->button & A_BUTTON)))) { - player->effects &= ~0x20; + player->effects &= ~UNKNOWN_EFFECT_0x20; } } if ((player->unk_044 & 1) != 1) { @@ -4554,7 +4554,7 @@ void func_80037CFC(Player* player, struct Controller* controller, s8 playerIndex detect_triple_b_combo_b_released(player); } } - if ((!(player->effects & BOOST_RAMP_ASPHALT_EFFECT)) && (!(player->effects & 4))) { + if ((!(player->effects & BOOST_RAMP_ASPHALT_EFFECT)) && (!(player->effects & BOOST_RAMP_WOOD_EFFECT))) { if (((get_clamped_stickY_with_deadzone(controller) < (-0x31)) && (((player->speed / 18.0f) * 216.0f) <= 5.0f)) && (controller->button & B_BUTTON)) { player->currentSpeed = 140.0f; @@ -4570,14 +4570,14 @@ void func_80037CFC(Player* player, struct Controller* controller, s8 playerIndex } } } else { - if ((player->effects & 0x4000) == 0x4000) { + if ((player->effects & UNKNOWN_EFFECT_0x4000) == UNKNOWN_EFFECT_0x4000) { if (controller->button & A_BUTTON) { player_accelerate_alternative(player); } else { player_decelerate_alternative(player, 5.0f); } } - 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->effects & UNKNOWN_EFFECT_0x1000000) == UNKNOWN_EFFECT_0x1000000)) || ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT)) { if (controller->button & A_BUTTON) { @@ -4877,13 +4877,13 @@ void func_80038C6C(Player* player, UNUSED Camera* camera, s8 screenId, s8 player player->unk_060 = 0; player->unk_05C = 1.0f; calculate_orientation_matrix(player->orientationMatrix, 0, 1.0f, 0, player->rotation[1]); - player->effects |= 8; + player->effects |= UNKNOWN_EFFECT_0x8; player->unk_0C2 += 1; surfaceDistance = player->collision.surfaceDistance[2]; if (surfaceDistance <= 0) { player->unk_0C2 = 0; - player->effects &= ~2; - player->effects &= ~8; + player->effects &= ~UNKNOWN_EFFECT_0x2; + player->effects &= ~UNKNOWN_EFFECT_0x8; player->kartHopVelocity = player->unk_0C2; } surfaceDistance = player->collision.surfaceDistance[2]; diff --git a/src/racing/actors.c b/src/racing/actors.c index c4b2bd88b..47a9e8923 100644 --- a/src/racing/actors.c +++ b/src/racing/actors.c @@ -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); diff --git a/src/racing/race_logic.c b/src/racing/race_logic.c index 4c86086d6..eb697f69b 100644 --- a/src/racing/race_logic.c +++ b/src/racing/race_logic.c @@ -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); } diff --git a/src/render_player.c b/src/render_player.c index 81a0644b7..a757be228 100644 --- a/src/render_player.c +++ b/src/render_player.c @@ -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, diff --git a/src/update_objects.c b/src/update_objects.c index 3acd755a8..e0e971b70 100644 --- a/src/update_objects.c +++ b/src/update_objects.c @@ -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;