Various Naming (#445)

* Mass renames
This commit is contained in:
coco875
2023-10-08 00:31:48 +02:00
committed by GitHub
parent 2b74bbbcef
commit d8cfed9491
135 changed files with 6015 additions and 5760 deletions
+82 -81
View File
@@ -500,7 +500,7 @@ void update_actor_kiwano_fruit(struct KiwanoFruit *fruit) {
s32 nearestWaypoint;
player = &gPlayers[fruit->targetPlayer];
if (((player->unk_000 & 0x1000) != 0) || (player->unk_110.unk34 == 0)) {
if (((player->type & PLAYER_CPU) != 0) || (player->unk_110.unk34 == 0)) {
fruit->state = 0;
return;
}
@@ -530,14 +530,14 @@ void update_actor_kiwano_fruit(struct KiwanoFruit *fruit) {
fruit->velocity[0] = 0.0f;
fruit->velocity[1] = 2.3f;
fruit->velocity[2] = 0.0f;
if ((player->unk_0BC & 0x200) != 0) {
if ((player->effects & 0x200) != 0) {
func_800C9060(player - gPlayerOne, 0x1900A052U);
} else {
player->unk_0BC |= 0x8000;
player->effects |= 0x8000;
player->pos[0] -= temp_f2 * 4.0f;
player->pos[2] -= temp_f14 * 4.0f;
player->unk_034[0] -= temp_f2 * 0.7f;
player->unk_034[2] -= temp_f14 * 0.7f;
player->velocity[0] -= temp_f2 * 0.7f;
player->velocity[2] -= temp_f14 * 0.7f;
func_800C9060(player - gPlayerOne, 0x19007018U);
if (gModeSelection != GRAND_PRIX) {
D_80162DF8 = 1;
@@ -809,12 +809,12 @@ void func_80298AC0(Player *player) {
sp64[1] = data->pos[1];
sp64[2] = data->pos[2];
if (func_8029EEB8(player, sp64, 5.0f, 40.0f, 0.8f) == 1) {
if ((player->unk_0BC & 0x200) != 0) {
func_800C98B8(player->pos, player->unk_034, 0x19018010);
if ((player->effects & 0x200) != 0) {
func_800C98B8(player->pos, player->velocity, 0x19018010);
func_800C90F4((u8) (player - gPlayerOne), (player->characterId * 0x10) + 0x2900800D);
data->someId |= 0x400;
}
if ((player->unk_000 & 0x100) == 0) {
if ((player->type & PLAYER_INVISIBLE_OR_BOMB) == 0) {
func_800C9060((u8) (player - gPlayerOne), 0x19007018);
}
break;
@@ -828,7 +828,7 @@ void func_80298C94(void) {
for (index = 0; index < 4; index++){
// wtf is up with the << 0x18 >> 0x18? is it some weird type conversion?
if (((gPlayers[index].unk_000 & 0xC000) != 0) && (((get_surface_type(gPlayers[index].unk_110.unk3A) << 0x18) >> 0x18) == 8)) {
if (((gPlayers[index].type & 0xC000) != 0) && (((get_surface_type(gPlayers[index].unk_110.unk3A) << 0x18) >> 0x18) == 8)) {
func_80298AC0(&gPlayers[index]);
}
}
@@ -1587,9 +1587,9 @@ void func_8029B8E8(Camera *camera, struct TrainCar *actor) {
Mat4 spE0;
Mat4 spA0;
f32 temp_f0 = is_within_render_distance(camera->pos, actor->pos, camera->rot[1], 2500.0f, gCameraZoom[camera - camera1], 9000000.0f);
f32 distance = is_within_render_distance(camera->pos, actor->pos, camera->rot[1], 2500.0f, gCameraZoom[camera - camera1], 9000000.0f);
if (temp_f0 < 0.0f) { return; }
if (distance < 0.0f) { return; }
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
@@ -1597,12 +1597,12 @@ void func_8029B8E8(Camera *camera, struct TrainCar *actor) {
maxObjectsReached = render_set_position(sp120, 0) == 0;
if (maxObjectsReached) { return; }
if (temp_f0 < 122500.0f) {
if (distance < 122500.0f) {
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1C0F0);
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1B978);
} else if (temp_f0 < 640000.0f) {
} else if (distance < 640000.0f) {
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1D670);
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1D160);
@@ -1610,7 +1610,7 @@ void func_8029B8E8(Camera *camera, struct TrainCar *actor) {
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1E910);
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1E480);
}
if (1440000.0f < temp_f0) { return; }
if (1440000.0f < distance) { return; }
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_22D28);
@@ -2126,8 +2126,8 @@ void init_kiwano_fruit(void) {
for (i = 0; i < 4; i++) {
phi_s1 = &gPlayers[i];
//temp_v0 = *phi_s1;
if ((phi_s1->unk_000 & 0x4000) == 0) { continue; }
if ((phi_s1->unk_000 & 0x100) != 0) { continue; }
if ((phi_s1->type & 0x4000) == 0) { continue; }
if ((phi_s1->type & 0x100) != 0) { continue; }
phi_s0 = addActorToEmptySlot(sp64, sp50, sp58, ACTOR_KIWANO_FRUIT);
actor = &gActorList[phi_s0];
@@ -2378,7 +2378,7 @@ void func_8029E158(void) {
init_red_shell_texture();
destroy_all_actors();
place_course_actors();
func_800122D8();
init_course_vehicles();
}
void func_8029E7DC(struct Actor *actor) {
@@ -2533,6 +2533,7 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
return -1;
}
// returns actor index if any slot avaible returns -1
s16 addActorToEmptySlot(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
s32 index;
@@ -2625,9 +2626,9 @@ s32 func_8029EEB8(Player *player, Vec3f pos, f32 arg2, f32 arg3, f32 arg4) {
}
temp_f0_3 = sqrtf(arg3);
sp28 = temp_f0_3 - arg2;
temp_f16 = player->unk_034[0];
temp_f18 = player->unk_034[2];
if (player->unk_0BC & 0x200) {
temp_f16 = player->velocity[0];
temp_f18 = player->velocity[2];
if (player->effects & 0x200) {
return 1;
}
if (temp_f0_3 < 0.1f) {
@@ -2635,12 +2636,12 @@ s32 func_8029EEB8(Player *player, Vec3f pos, f32 arg2, f32 arg3, f32 arg4) {
if (temp_f0_4 < 0.5f) {
temp_f0_4 = 0.5f;
}
player->unk_034[0] = 0;
player->unk_034[2] = 0;
player->velocity[0] = 0;
player->velocity[2] = 0;
player->pos[0] += (temp_f16 / temp_f0_4) * arg2;
player->pos[2] += (temp_f18 / temp_f0_4) * arg2;
} else {
player->unk_0BC |= 0x8000;
player->effects |= 0x8000;
temp_f20 /= temp_f0_3;
temp_f14 /= temp_f0_3;
temp_f0_5 = sqrtf((temp_f16 * temp_f16) + (temp_f18 * temp_f18));
@@ -2648,14 +2649,14 @@ s32 func_8029EEB8(Player *player, Vec3f pos, f32 arg2, f32 arg3, f32 arg4) {
temp_f0_6 = 1.2f;
player->pos[0] = pos[0] - (temp_f20 * arg2 * temp_f0_6);
player->pos[2] = pos[2] - (temp_f14 * arg2 * temp_f0_6);
player->unk_034[0] = 0.0f;
player->unk_034[2] = 0.0f;
player->velocity[0] = 0.0f;
player->velocity[2] = 0.0f;
return 1;
}
temp_f2_2 = ((temp_f20 * temp_f16) + (temp_f14 * temp_f18)) / temp_f0_5;
temp_f2_2 = temp_f0_5 * temp_f2_2 * arg4 * 1.3f;
player->unk_034[0] -= temp_f20 * temp_f2_2;
player->unk_034[2] -= temp_f14 * temp_f2_2;
player->velocity[0] -= temp_f20 * temp_f2_2;
player->velocity[2] -= temp_f14 * temp_f2_2;
player->pos[0] += temp_f20 * sp28 * 0.5f;
player->pos[2] += temp_f14 * sp28 * 0.5f;
}
@@ -2664,12 +2665,12 @@ s32 func_8029EEB8(Player *player, Vec3f pos, f32 arg2, f32 arg3, f32 arg4) {
s32 func_8029F1F8(Player *player, struct Actor *marioRacewaySign) {
if (func_8029EEB8(player, marioRacewaySign->pos, 7.0f, 200.0f, 0.8f) == 1) {
if ((player->unk_000 & 0x4000) != 0) {
if ((player->unk_0BC & 0x200) != 0) {
if ((player->type & 0x4000) != 0) {
if ((player->effects & 0x200) != 0) {
marioRacewaySign->flags |= 0x400;
func_800C98B8(player->pos, player->unk_034, 0x19018010U);
func_800C98B8(player->pos, player->velocity, 0x19018010U);
func_800C90F4(player - gPlayerOne, (player->characterId * 0x10) + 0x2900800D);
} else if ((player->unk_000 & 0x100) == 0) {
} else if ((player->type & PLAYER_INVISIBLE_OR_BOMB) == 0) {
func_800C9060(player - gPlayerOne, 0x1900701AU);
}
}
@@ -2680,12 +2681,12 @@ s32 func_8029F1F8(Player *player, struct Actor *marioRacewaySign) {
s32 func_8029F2FC(Player *player, struct PiranhaPlant *plant) {
if (func_8029EEB8(player, plant->pos, plant->boundingBoxSize, plant->boundingBoxSize, 2.5f) == 1) {
if ((player->unk_000 & 0x4000) != 0) {
if ((player->unk_0BC & 0x200) != 0) {
if ((player->type & 0x4000) != 0) {
if ((player->effects & 0x200) != 0) {
plant->flags |= 0x400;
func_800C98B8(player->pos, player->unk_034, 0x1901A24AU);
func_800C98B8(player->pos, player->velocity, 0x1901A24AU);
func_800C90F4(player - gPlayerOne, (player->characterId * 0x10) + 0x2900800D);
} else if ((player->unk_000 & 0x100) == 0) {
} else if ((player->type & PLAYER_INVISIBLE_OR_BOMB) == 0) {
func_800C9060(player - gPlayerOne, 0x1900A052U);
}
}
@@ -2731,15 +2732,15 @@ s32 func_8029F408(Player *player, struct YoshiValleyEgg *egg) {
if (totalBox < xz_dist) {
return 0;
}
if ((player->unk_000 & 0x4000) != 0) {
if ((player->unk_0BC & 0x200) != 0) {
if ((player->type & 0x4000) != 0) {
if ((player->effects & 0x200) != 0) {
egg->flags |= 0x400;
egg->pathCenter[1] = 8.0f;
func_800C98B8(player->pos, player->unk_034, 0x19018010);
func_800C98B8(player->pos, player->velocity, 0x19018010);
func_800C90F4(player - gPlayerOne, (player->characterId * 0x10) + 0x2900800D);
} else {
func_8008DABC(player, player - gPlayerOne);
if ((gModeSelection == TIME_TRIALS) && ((player->unk_000 & 0x1000) == 0)) {
if ((gModeSelection == TIME_TRIALS) && ((player->type & PLAYER_CPU) == 0)) {
D_80162DF8 = 1;
}
}
@@ -2794,33 +2795,33 @@ s32 func_8029F69C(Player *player, struct Actor *actor) {
if (var_f16 < xz_dist) {
return 0;
}
sp48 = player->unk_034[0];
sp44 = player->unk_034[2];
if (player->unk_000 & 0x4000) {
if (player->unk_0BC & 0x200) {
sp48 = player->velocity[0];
sp44 = player->velocity[2];
if (player->type & 0x4000) {
if (player->effects & 0x200) {
actor->flags |= 0x400;
func_800C98B8(player->pos, player->unk_034, 0x19018010U);
func_800C98B8(player->pos, player->velocity, 0x19018010U);
func_800C90F4(player - gPlayerOne, (player->characterId * 0x10) + 0x2900800D);
return 1;
}
if (!(player->unk_000 & 0x100)) {
if (!(player->type & PLAYER_INVISIBLE_OR_BOMB)) {
func_800C9060(player - gPlayerOne, 0x19007018U);
}
}
if (!(player->unk_0BC & 0x200)) {
player->unk_0BC |= 0x8000;
if (!(player->effects & 0x200)) {
player->effects |= 0x8000;
}
sp20[0] = actor->pos[0];
sp20[1] = actor->pos[1];
sp20[2] = actor->pos[2];
if (((gCurrentCourseId == 0) || (gCurrentCourseId == 4) || (gCurrentCourseId == 7) || (gCurrentCourseId == 8)) && (player->unk_094 > 1.0f)) {
if (((gCurrentCourseId == COURSE_MARIO_RACEWAY) || (gCurrentCourseId == COURSE_YOSHI_VALLEY) || (gCurrentCourseId == COURSE_ROYAL_RACEWAY) || (gCurrentCourseId == COURSE_LUIGI_RACEWAY)) && (player->unk_094 > 1.0f)) {
func_80077AB0(sp20, 0);
}
if (xz_dist < 0.1f) {
sqrtf((sp48 * sp48) + (sp44 * sp44));
if(xz_dist){}
player->unk_034[0] = 0;
player->unk_034[2] = 0;
player->velocity[0] = 0;
player->velocity[2] = 0;
player->pos[0] = sp20[0] - (x_dist * var_f16 * 1.2f);
player->pos[2] = sp20[2] - (z_dist * var_f16 * 1.2f);
} else {
@@ -2830,14 +2831,14 @@ s32 func_8029F69C(Player *player, struct Actor *actor) {
if (temp_f0_4 < 0.25f) {
player->pos[0] = sp20[0] - (x_dist * var_f16 * 1.2f);
player->pos[2] = sp20[2] - (z_dist * var_f16 * 1.2f);
player->unk_034[0] = 0;
player->unk_034[2] = 0;
player->velocity[0] = 0;
player->velocity[2] = 0;
return 1;
}
temp_f12 = ((x_dist * sp48) + (z_dist * sp44)) / temp_f0_4;
temp_f12 = temp_f0_4 * temp_f12 * 1.5f;
player->unk_034[0] -= x_dist * temp_f12;
player->unk_034[2] -= z_dist * temp_f12;
player->velocity[0] -= x_dist * temp_f12;
player->velocity[2] -= z_dist * temp_f12;
temp_f2 = xz_dist - var_f16;
player->pos[0] += x_dist * temp_f2 * 0.5f;
player->pos[2] += z_dist * temp_f2 * 0.5f;
@@ -3149,18 +3150,18 @@ void func_802A0450(Player *player, struct Actor *actor) {
temp_lo = player - gPlayerOne;
switch (actor->type) {
case ACTOR_YOSHI_VALLEY_EGG:
if (!(player->unk_0BC & 0x80000000) && !(player->unk_000 & 0x100)) {
if (!(player->effects & 0x80000000) && !(player->type & PLAYER_INVISIBLE_OR_BOMB)) {
func_8029F408(player, (struct YoshiValleyEgg *) actor);
}
break;
case ACTOR_BANANA:
if (player->unk_0BC & 0x800008C0) { break; }
if (player->effects & 0x800008C0) { break; }
if (player->statusEffects & 1) { break; }
temp_v1 = actor->rot[0];
if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (func_8029FB80(player, actor) != 1)) { break; }
player->statusEffects |= 1;
owner = &gPlayers[temp_v1];
if (owner->unk_000 & 0x4000) {
if (owner->type & 0x4000) {
if (actor->flags & 0xF) {
if (temp_lo != temp_v1) {
func_800C90F4(temp_v1, (owner->characterId * 0x10) + 0x29008006);
@@ -3176,14 +3177,14 @@ void func_802A0450(Player *player, struct Actor *actor) {
func_8029FDC8(actor);
break;
case ACTOR_GREEN_SHELL:
if (player->unk_0BC & 0x80000400) { break; }
if (player->effects & 0x80000400) { break; }
if (player->statusEffects & 4) { break; }
temp_v1 = actor->rot[2];
if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (func_8029FB80(player, actor) != 1)) { break; }
player->statusEffects |= 4;
func_800C98B8(player->pos, player->unk_034, 0x19018010U);
func_800C98B8(player->pos, player->velocity, 0x19018010U);
owner = &gPlayers[temp_v1];
if ((owner->unk_000 & 0x4000) && (temp_lo != temp_v1)) {
if ((owner->type & 0x4000) && (temp_lo != temp_v1)) {
func_800C90F4(temp_v1, (owner->characterId * 0x10) + 0x29008006);
}
func_8029FDC8(actor);
@@ -3192,12 +3193,12 @@ void func_802A0450(Player *player, struct Actor *actor) {
if (player->statusEffects & 2) { break; }
temp_v1 = actor->rot[2];
if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (func_8029FB80(player, actor) != 1)) { break; }
if (!(player->unk_0BC & 0x80000000)) {
if (!(player->effects & 0x80000000)) {
player->statusEffects |= 2;
func_800C98B8(player->pos, player->unk_034, 0x19018010U);
func_800C98B8(player->pos, player->velocity, 0x19018010U);
}
owner = &gPlayers[temp_v1];
if ((owner->unk_000 & 0x4000) && (temp_lo != temp_v1)) {
if ((owner->type & 0x4000) && (temp_lo != temp_v1)) {
func_800C90F4(temp_v1, (owner->characterId * 0x10) + 0x29008006);
}
if (temp_lo == actor->unk_04) {
@@ -3206,27 +3207,27 @@ void func_802A0450(Player *player, struct Actor *actor) {
break;
case ACTOR_RED_SHELL:
temp_v1 = actor->rot[2];
if (player->unk_0BC & 0x01000000) { break; }
if (player->effects & 0x01000000) { break; }
if (player->statusEffects & 2) { break; }
temp_v1 = actor->rot[2];
if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (func_8029FB80(player, actor) != 1)) { break; }
if (!(player->unk_0BC & 0x80000000)) {
if (!(player->effects & 0x80000000)) {
player->statusEffects |= 2;
func_800C98B8(player->pos, player->unk_034, 0x19018010U);
func_800C98B8(player->pos, player->velocity, 0x19018010U);
}
owner = &gPlayers[temp_v1];
if ((owner->unk_000 & 0x4000) && (temp_lo != temp_v1)) {
if ((owner->type & 0x4000) && (temp_lo != temp_v1)) {
func_800C90F4(temp_v1, (owner->characterId * 0x10) + 0x29008006);
}
func_8029FDC8(actor);
break;
case ACTOR_PIRANHA_PLANT:
if (!(player->unk_0BC & 0x80000000)) {
if (!(player->effects & 0x80000000)) {
func_8029F2FC(player, (struct PiranhaPlant *) actor);
}
break;
case ACTOR_MARIO_RACEWAY_SIGN:
if (!(player->unk_0BC & 0x80000000)) {
if (!(player->effects & 0x80000000)) {
func_8029F1F8(player, actor);
}
break;
@@ -3242,18 +3243,18 @@ void func_802A0450(Player *player, struct Actor *actor) {
case 31:
case 32:
case 33:
if (!(player->unk_0BC & 0x80000000)) {
if (!(player->effects & 0x80000000)) {
func_8029F69C(player, actor);
}
break;
case ACTOR_FALLING_ROCK:
if (!(player->unk_0BC & 0x80000000) && !(player->unk_000 & 0x100)) {
if (!(player->effects & 0x80000000) && !(player->type & PLAYER_INVISIBLE_OR_BOMB)) {
if (func_8029FB80(player, actor) == 1) {
func_800C98B8(actor->pos, actor->velocity, SOUND_ACTION_EXPLOSION);
if ((gModeSelection == TIME_TRIALS) && !(player->unk_000 & 0x1000)) {
if ((gModeSelection == TIME_TRIALS) && !(player->type & PLAYER_CPU)) {
D_80162DF8 = 1;
}
if (player->unk_0BC & 0x200) {
if (player->effects & 0x200) {
actor->velocity[1] = 10.0f;
} else {
func_8008DABC(player, player - gPlayerOne);
@@ -3263,12 +3264,12 @@ void func_802A0450(Player *player, struct Actor *actor) {
break;
case ACTOR_FAKE_ITEM_BOX:
temp_v1 = actor->velocity[0];
if (player->unk_0BC & 0x80000000) { break; }
if (player->effects & 0x80000000) { break; }
temp_v1 = actor->velocity[0];
if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (func_8029FB80(player, actor) != 1)) { break; }
player->statusEffects |= 0x400000;
player->statusEffects |= REVERSE_EFFECT;
owner = &gPlayers[temp_v1];
if (owner->unk_000 & 0x4000) {
if (owner->type & 0x4000) {
if (actor->flags & 0xF) {
if (temp_lo != temp_v1) {
func_800C90F4(temp_v1, (owner->characterId * 0x10) + 0x29008006);
@@ -3293,7 +3294,7 @@ void func_802A0450(Player *player, struct Actor *actor) {
actor->state = 3;
actor->flags = -0x8000;
actor->unk_04 = 0;
if (player->unk_000 & 0x4000) {
if (player->type & 0x4000) {
func_8007ABFC(player - gPlayerOne, 7);
}
} else if (actor->state == 0) {
@@ -3306,7 +3307,7 @@ void func_802A0450(Player *player, struct Actor *actor) {
actor->state = 3;
actor->flags = -0x8000;
actor->unk_04 = 0;
if (player->unk_000 & 0x4000) {
if (player->type & 0x4000) {
func_8007ABFC(player - gPlayerOne, 0);
}
} else if (actor->state == 0) {
@@ -3327,12 +3328,12 @@ void evaluate_player_collision(void) {
for (i = 0; i < 8; i++) {
phi_s1 = &gPlayers[i];
if (((phi_s1->unk_000 & 0x8000) != 0) && ((phi_s1->unk_0BC & 0x4000000) == 0)) {
if (((phi_s1->type & 0x8000) != 0) && ((phi_s1->effects & 0x4000000) == 0)) {
func_802977E4(phi_s1);
for (j = 0; j < ACTOR_LIST_SIZE; j++) {
temp_a1 = &gActorList[j];
if ((phi_s1->unk_0BC & 0x4000000) == 0) {
if ((phi_s1->effects & 0x4000000) == 0) {
// temp_v0 = temp_a1->unk2;
if (((temp_a1->flags & 0x8000) != 0) && ((temp_a1->flags & 0x4000) != 0)) {
func_802A0450(phi_s1, temp_a1);
@@ -3444,7 +3445,7 @@ void update_actor_fake_item_box(struct FakeItemBox *fake_item_box) {
func_802ADDC8(&fake_item_box->unk30, fake_item_box->boundingBoxSize, fake_item_box->pos[0], fake_item_box->pos[1], fake_item_box->pos[2]);
func_802B4E30((struct Actor *)fake_item_box);
temp_v1_3 = &gControllers[temp_v1];
if ((temp_v0_4->unk_000 & 0x4000) != 0) {
if ((temp_v0_4->type & 0x4000) != 0) {
if ((temp_v1_3->buttonDepressed & Z_TRIG) != 0) {
temp_v1_3->buttonDepressed &= 0xDFFF;
+130 -104
View File
@@ -99,7 +99,7 @@ void func_802B0570(struct BananaActor *banana) {
func_802B0464(banana->youngerIndex);
func_802B04E8(banana, banana->elderIndex);
if ((gPlayers[banana->playerId].unk_000 & 0x4000) != 0) {
if ((gPlayers[banana->playerId].type & 0x4000) != 0) {
func_800C9060(banana->playerId, 0x19019053);
}
banana->flags = -0x8000;
@@ -293,7 +293,7 @@ void update_actor_banana_bunch(struct BananaBunchParent *banana_bunch) {
if (someCount == 0) {
destroy_actor((struct Actor *) banana_bunch);
owner->statusEffects &= ~0x40000;
} else if ((owner->unk_000 & 0x4000) != 0) {
} else if ((owner->type & 0x4000) != 0) {
controller = &gControllers[banana_bunch->playerId];
if ((controller->buttonPressed & Z_TRIG) != 0) {
controller->buttonPressed &= ~Z_TRIG;
@@ -311,22 +311,22 @@ void update_actor_banana_bunch(struct BananaBunchParent *banana_bunch) {
}
}
s32 func_802B0E14(s16 arg0) {
struct ShellActor *temp;
bool is_shell_exist(s16 arg0) {
struct ShellActor *actor;
if (arg0 < 0) {
return 0;
return FALSE;
}
temp = (struct ShellActor*) &gActorList[arg0];
if (temp->type == ACTOR_GREEN_SHELL) {
if (temp->state == TRIPLE_GREEN_SHELL) {
return 1;
actor = (struct ShellActor*) &gActorList[arg0];
if (actor->type == ACTOR_GREEN_SHELL) {
if (actor->state == TRIPLE_GREEN_SHELL) {
return TRUE;
}
return 0;
return FALSE;
}
if (temp->state == TRIPLE_RED_SHELL) {
return 1;
if (actor->state == TRIPLE_RED_SHELL) {
return TRUE;
}
return 0;
return FALSE;
}
void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) {
@@ -336,7 +336,7 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) {
struct ShellActor *shell;
Vec3f someVelocity;
UNUSED s32 pad3;
s16 someCount;
s16 shellCount;
u16 someRotAngle;
Player *player;
@@ -345,43 +345,43 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) {
parent->rotAngle += parent->rotVelocity;
someRotAngle = parent->rotAngle;
switch (parent->state) {
case 0:
if (func_802B19EC(parent, &gPlayers[playerId], shellType, 0U) != -1) {
case SPAWN_FIRST_SHELL:
if (init_triple_shell(parent, &gPlayers[playerId], shellType, 0U) != -1) {
func_800C9060(playerId, 0x19008012);
parent->shellsAvailable += 1;
}
parent->state = 1;
parent->state = SPAWN_SECOND_SHELL;
break;
case 1:
case SPAWN_SECOND_SHELL:
if (parent->rotVelocity > 0) {
if (someRotAngle >= 0xD556) {
if (func_802B19EC(parent, &gPlayers[playerId], shellType, 1U) != -1) {
if (init_triple_shell(parent, &gPlayers[playerId], shellType, 1U) != -1) {
func_800C9060(playerId, 0x19008012);
parent->shellsAvailable += 1;
}
parent->state = 2;
parent->state = SPAWN_THIRD_SHELL;
}
} else {
if (someRotAngle < 0x2AAA) {
if (func_802B19EC(parent, &gPlayers[playerId], shellType, 1U) != -1) {
if (init_triple_shell(parent, &gPlayers[playerId], shellType, 1U) != -1) {
func_800C9060(playerId, 0x19008012);
parent->shellsAvailable += 1;
}
parent->state = 2;
parent->state = SPAWN_THIRD_SHELL;
}
}
break;
case 2:
case SPAWN_THIRD_SHELL:
if (parent->rotVelocity > 0) {
if ((someRotAngle >= 0x2AAB) && (someRotAngle < 0x31C7)) {
if (func_802B19EC(parent, &gPlayers[playerId], shellType, 2U) != -1) {
if (init_triple_shell(parent, &gPlayers[playerId], shellType, 2U) != -1) {
func_800C9060(playerId, 0x19008012);
parent->shellsAvailable += 1;
}
parent->state = 3;
}
} else if ((someRotAngle < 0xD555) && (someRotAngle >= 0xCE39)) {
if (func_802B19EC(parent, &gPlayers[playerId], shellType, 2U) != -1) {
if (init_triple_shell(parent, &gPlayers[playerId], shellType, 2U) != -1) {
func_800C9060(playerId, 0x19008012);
parent->shellsAvailable += 1;
}
@@ -398,23 +398,23 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) {
shell->flags |= 0x4000;
break;
case 4:
someCount = 0;
if (func_802B0E14(parent->shellIndices[0]) == 1) {
someCount = 1;
shellCount = 0;
if (is_shell_exist(parent->shellIndices[0]) == 1) {
shellCount = 1;
} else {
parent->shellIndices[0] = -1.0f;
}
if (func_802B0E14(parent->shellIndices[1]) == 1) {
someCount++;
if (is_shell_exist(parent->shellIndices[1]) == 1) {
shellCount++;
} else {
parent->shellIndices[1] = -1.0f;
}
if (func_802B0E14(parent->shellIndices[2]) == 1) {
someCount++;
if (is_shell_exist(parent->shellIndices[2]) == 1) {
shellCount++;
} else {
parent->shellIndices[2] = -1.0f;
}
if (someCount == 0) {
if (shellCount == 0) {
destroy_actor((struct Actor *) parent);
break;
}
@@ -505,14 +505,14 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) {
}
}
// This function could reasonably be called "spawn_banana_bunch" or similar
s32 func_802B17F4(Player *player) {
s32 use_banana_bunch_item(Player *player) {
Vec3f startingVelocity = {0.0f, 0.0f, 0.0f};
Vec3s startingRot = {0, 0, 0};
Vec3f startingPos = {0.0f, 0.0f, 0.0f};
s16 actorIndex;
struct BananaBunchParent *bananaBunch;
// this have a animation of spawning so see update_actor_banana_bunch
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_BANANA_BUNCH);
if (actorIndex < 0) {
return actorIndex;
@@ -520,18 +520,18 @@ s32 func_802B17F4(Player *player) {
bananaBunch = (struct BananaBunchParent *) &gActorList[actorIndex];
bananaBunch->state = 0;
bananaBunch->playerId = player - gPlayerOne;
player->statusEffects |= 0x40000;
player->statusEffects |= HOLD_BANANA_EFFECT;
return actorIndex;
}
// This function could reasonably be called "spawn_triple_shell" or similar
s32 func_802B18E4(Player *player, s16 tripleShellType) {
s32 use_triple_shell_item(Player *player, s16 tripleShellType) {
Vec3f startingVelocity = {0.0f, 0.0f, 0.0f};
Vec3s startingRot = {0, 0, 0};
Vec3f startingPos = {0.0f, 0.0f, 0.0f};
s16 actorIndex;
TripleShellParent *parent;
// this have a animation of spawning so see update_actor_triple_shell
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, tripleShellType);
if (actorIndex < 0) {
return actorIndex;
@@ -546,8 +546,7 @@ s32 func_802B18E4(Player *player, s16 tripleShellType) {
return actorIndex;
}
// This function could reasonably be called "spawn_shell_for_triple_shell" or similar
s32 func_802B19EC(TripleShellParent *parent, Player *player, s16 shellType, u16 shellId) {
s32 init_triple_shell(TripleShellParent *parent, Player *player, s16 shellType, u16 shellId) {
Vec3f startingVelocity = {0.0f, 0.0f, 0.0f};
Vec3s startingRot = {0, 0, 0};
Vec3f startingPos;
@@ -557,7 +556,7 @@ s32 func_802B19EC(TripleShellParent *parent, Player *player, s16 shellType, u16
startingPos[0] = 0.0f;
startingPos[1] = -player->boundingBoxSize;
startingPos[2] = player->boundingBoxSize - 4.0f;
mtxf_translate_vec3f_mat3(startingPos, player->unk_174);
mtxf_translate_vec3f_mat3(startingPos, player->orientationMatrix);
startingPos[0] += player->pos[0];
startingPos[1] += player->pos[1];
startingPos[2] += player->pos[2];
@@ -592,21 +591,27 @@ s32 func_802B19EC(TripleShellParent *parent, Player *player, s16 shellType, u16
return 1;
}
// This function could reasonably be called "spawn_green_shell" or similar
s32 func_802B1C9C(Player *player) {
s32 use_green_shell_item(Player *player) {
Vec3f startingVelocity = {0.0f, 0.0f, 0.0f};
Vec3s startingRot = {0, 0, 0};
Vec3f startingPos;
s16 actorIndex;
struct ShellActor *shell;
// place behind player
startingPos[0] = 0.0f;
startingPos[1] = -player->boundingBoxSize;
startingPos[2] = player->boundingBoxSize - 4.0f;
mtxf_translate_vec3f_mat3(startingPos, player->unk_174);
// rotate to match player orientation
mtxf_translate_vec3f_mat3(startingPos, player->orientationMatrix);
// move to player position
startingPos[0] += player->pos[0];
startingPos[1] += player->pos[1];
startingPos[2] += player->pos[2];
// spawn the shell
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_GREEN_SHELL);
if (actorIndex < 0) {
return actorIndex;
@@ -625,21 +630,27 @@ s32 func_802B1C9C(Player *player) {
return actorIndex;
}
// This function could reasonably be called "spawn_red_shell" or similar
s32 func_802B1E48(Player *player) {
s32 use_red_shell_item(Player *player) {
Vec3f startingVelocity = {0.0f, 0.0f, 0.0f};
Vec3s startingRot = {0, 0, 0};
Vec3f startingPos;
s16 actorIndex;
struct ShellActor *shell;
// place behind player
startingPos[0] = 0.0f;
startingPos[1] = -player->boundingBoxSize;
startingPos[2] = player->boundingBoxSize - 4.0f;
mtxf_translate_vec3f_mat3(startingPos, player->unk_174);
// rotate to match player orientation
mtxf_translate_vec3f_mat3(startingPos, player->orientationMatrix);
// move to player position
startingPos[0] += player->pos[0];
startingPos[1] += player->pos[1];
startingPos[2] += player->pos[2];
// spawn the shell
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_RED_SHELL);
if (actorIndex < 0) {
return actorIndex;
@@ -658,11 +669,10 @@ s32 func_802B1E48(Player *player) {
return actorIndex;
}
// This function could reasonably be called "spawn_blue_shell"
// Interestingly blue shells start their life as a red shell,
// and then just change the type from red to blue shell
void func_802B1FFC(Player *player) {
gActorList[func_802B1E48(player)].type = ACTOR_BLUE_SPINY_SHELL;
void use_blue_shell_item(Player *player) {
gActorList[use_red_shell_item(player)].type = ACTOR_BLUE_SPINY_SHELL;
}
void update_actor_banana(struct BananaActor *banana) {
@@ -706,7 +716,7 @@ void update_actor_banana(struct BananaActor *banana) {
}
func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
func_802B4E30((struct Actor *) banana);
if ((player->unk_000 & 0x4000) != 0) {
if ((player->type & 0x4000) != 0) {
if (gDemoMode) {
controller = gControllerOne;
} else {
@@ -856,13 +866,13 @@ void func_802B2914(struct BananaBunchParent *banana_bunch, Player *player, s16 b
startingPos[0] = 0.0f;
startingPos[1] = -player->boundingBoxSize;
startingPos[2] = -(player->boundingBoxSize + 4.0f);
mtxf_translate_vec3f_mat3(startingPos, player->unk_174);
mtxf_translate_vec3f_mat3(startingPos, player->orientationMatrix);
startingPos[0] += player->pos[0];
startingPos[1] += player->pos[1];
startingPos[2] += player->pos[2];
startingVelocity[0] = player->unk_034[0];
startingVelocity[1] = player->unk_034[1];
startingVelocity[2] = player->unk_034[2];
startingVelocity[0] = player->velocity[0];
startingVelocity[1] = player->velocity[1];
startingVelocity[2] = player->velocity[2];
startingRot[0] = 0;
startingRot[1] = 0;
startingRot[2] = 0;
@@ -915,14 +925,13 @@ void func_802B2914(struct BananaBunchParent *banana_bunch, Player *player, s16 b
tempBanana->youngerIndex = actorIndex;
break;
}
if ((player->unk_000 & 0x4000) != 0) {
if ((player->type & 0x4000) != 0) {
func_800C9060(player - gPlayerOne, 0x19008012);
}
}
}
// This function could reasonably be called "spawn_fake_itembox" or similar
s32 func_802B2C40(Player *player) {
s32 use_fake_itembox_item(Player *player) {
struct FakeItemBox *itemBox;
UNUSED s32 pad[5];
s16 actorIndex;
@@ -930,32 +939,41 @@ s32 func_802B2C40(Player *player) {
Vec3s startingRot;
Vec3f startingPos;
// place behind player
startingPos[0] = 0.0f;
startingPos[1] = -player->boundingBoxSize;
startingPos[2] = -(player->boundingBoxSize + 4.0f);
mtxf_translate_vec3f_mat3(startingPos, player->unk_174);
// rotate to match player orientation
mtxf_translate_vec3f_mat3(startingPos, player->orientationMatrix);
// move to player position
startingPos[0] += player->pos[0];
startingPos[1] += player->pos[1];
startingPos[2] += player->pos[2];
startingVelocity[0] = player->unk_034[0];
startingVelocity[1] = player->unk_034[1];
startingVelocity[2] = player->unk_034[2];
// set the itembox's velocity to the player's velocity
startingVelocity[0] = player->velocity[0];
startingVelocity[1] = player->velocity[1];
startingVelocity[2] = player->velocity[2];
startingRot[0] = 0;
startingRot[1] = 0;
startingRot[2] = 0;
// spawn the itembox
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_FAKE_ITEM_BOX);
if (actorIndex < 0) {
return actorIndex;
}
itemBox = (struct FakeItemBox*)&gActorList[actorIndex];
itemBox->playerId = (player - gPlayerOne);
itemBox->state = 0;
player->statusEffects |= 0x40000;
itemBox->state = HELD_FAKE_ITEM_BOX;
player->statusEffects |= HOLD_BANANA_EFFECT;
return actorIndex;
}
// This function could reasonably be called "spawn_banana" or similar
s32 func_802B2D70(Player *player) {
s32 use_banana_item(Player *player) {
UNUSED s32 pad[6];
u16 playerId;
s16 actorIndex;
@@ -969,20 +987,28 @@ s32 func_802B2D70(Player *player) {
return -1;
}
// Extremely weird fake match to fix a tiny stack difference
// place the banana in back of the player
startingPos[0, 0] = 0.0f;
startingPos[1] = -player->boundingBoxSize;
startingPos[2] = -(player->boundingBoxSize + 4.0f);
mtxf_translate_vec3f_mat3(startingPos, player->unk_174);
// apply the player's orientation to the banana
mtxf_translate_vec3f_mat3(startingPos, player->orientationMatrix);
// add the player's position to the banana's position
startingPos[0] += player->pos[0];
startingPos[1] += player->pos[1];
startingPos[2] += player->pos[2];
startingVelocity[0] = player->unk_034[0];
startingVelocity[1] = player->unk_034[1];
startingVelocity[2] = player->unk_034[2];
// set the banana's velocity to the player's velocity
startingVelocity[0] = player->velocity[0];
startingVelocity[1] = player->velocity[1];
startingVelocity[2] = player->velocity[2];
startingRot[0] = 0;
startingRot[1] = 0;
startingRot[2] = 0;
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_BANANA);
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_BANANA); // spawn banana
if (actorIndex < 0) {
return actorIndex;
}
@@ -990,7 +1016,7 @@ s32 func_802B2D70(Player *player) {
banana->playerId = playerId;
banana->state = HELD_BANANA;
banana->unk_04 = 0x0014;
player->statusEffects |= 0x40000;
player->statusEffects |= HOLD_BANANA_EFFECT;
return actorIndex;
}
@@ -999,12 +1025,12 @@ s32 func_802B2D70(Player *player) {
*
* @param Activating player (not to be struck)
*/
void func_802B2EBC(Player *player) {
void use_thunder_item(Player *player) {
s32 index;
Player *otherPlayer;
func_8009E5BC();
if ((player->unk_000 & 0x4000) != 0) {
if ((player->type & 0x4000) != 0) {
// Play sound.
func_800CAB4C(player - gPlayerOne);
}
@@ -1012,7 +1038,7 @@ void func_802B2EBC(Player *player) {
for (index = 0; index < 8; index++) {
otherPlayer = &gPlayers[index];
if (player != otherPlayer) {
otherPlayer->statusEffects |= 0x4000;
otherPlayer->statusEffects |= HIT_ROTATING_EFFECT;
}
}
}
@@ -1021,54 +1047,54 @@ void func_802B2EBC(Player *player) {
void func_802B2FA0(Player *player) {
s32 playerId = player - gPlayerOne;
switch (player->unk_010) {
switch (player->currentItemCopy) {
case ITEM_GREEN_SHELL:
func_802B1C9C(player);
use_green_shell_item(player);
break;
case ITEM_RED_SHELL:
func_802B1E48(player);
use_red_shell_item(player);
break;
case ITEM_BLUE_SPINY_SHELL:
func_802B1FFC(player);
use_blue_shell_item(player);
break;
case ITEM_BANANA:
func_802B2D70(player);
use_banana_item(player);
break;
case ITEM_BANANA_BUNCH:
func_802B17F4(player);
use_banana_bunch_item(player);
break;
case ITEM_MUSHROOM:
player->statusEffects |= 0x200;
player->statusEffects |= BOOST_EFFECT;
break;
case ITEM_DOUBLE_MUSHROOM:
player->statusEffects |= 0x200;
player->statusEffects |= BOOST_EFFECT;
break;
case ITEM_TRIPLE_MUSHROOM:
player->statusEffects |= 0x200;
player->statusEffects |= BOOST_EFFECT;
break;
case ITEM_SUPER_MUSHROOM:
player->statusEffects |= 0x200;
player->statusEffects |= BOOST_EFFECT;
break;
case ITEM_BOO:
player->statusEffects |= 0x800;
player->statusEffects |= BOO_EFFECT;
break;
case ITEM_STAR:
player->statusEffects |= 0x2000;
player->statusEffects |= STAR_EFFECT;
break;
case ITEM_THUNDERBOLT:
func_802B2EBC(player);
use_thunder_item(player);
break;
case ITEM_FAKE_ITEM_BOX:
func_802B2C40(player);
use_fake_itembox_item(player);
break;
case ITEM_TRIPLE_GREEN_SHELL:
func_802B18E4(player, ACTOR_TRIPLE_GREEN_SHELL);
use_triple_shell_item(player, ACTOR_TRIPLE_GREEN_SHELL);
break;
case ITEM_TRIPLE_RED_SHELL:
func_802B18E4(player, ACTOR_TRIPLE_RED_SHELL);
use_triple_shell_item(player, ACTOR_TRIPLE_RED_SHELL);
break;
}
func_8007AC9C(playerId);
consume_item(playerId);
}
// Check if a player is using an item?
@@ -1081,7 +1107,7 @@ void func_802B30EC(void) {
for (player = &gPlayers[0], loopController = &gControllers[0], target = &gControllers[4]; loopController != target; player++, loopController++) {
controller = loopController;
if (func_800910E4(player) == 0) {
if((player->unk_000 & 0x100) != 0){
if((player->type & PLAYER_INVISIBLE_OR_BOMB) != 0){
if ((player - gPlayerTwo) == 0) {
controller = gControllerSix;
} else if((player - gPlayerThree) == 0) {
@@ -1093,7 +1119,7 @@ void func_802B30EC(void) {
}
}
if (((player->unk_000 & 0x4000) != 0) && (player->unk_010 != ITEM_NONE) && ((player->unk_000 & 0x2000) == 0)) {
if (((player->type & 0x4000) != 0) && (player->currentItemCopy != ITEM_NONE) && ((player->type & PLAYER_START_SEQUENCE) == 0)) {
if ((controller->buttonPressed & Z_TRIG) != 0) {
controller->buttonPressed &= ~Z_TRIG;
func_802B2FA0(player);
@@ -1136,7 +1162,7 @@ void update_actor_green_shell(struct ShellActor *shell) {
somePosVel[0] = 0.0f;
somePosVel[1] = player->boundingBoxSize;
somePosVel[2] = -(player->boundingBoxSize + shell->boundingBoxSize + 2.0f);
mtxf_translate_vec3f_mat3(somePosVel, player->unk_174);
mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
shell->pos[0] = player->pos[0] + somePosVel[0];
pad2 = player->pos[1] - somePosVel[1];
shell->pos[2] = player->pos[2] + somePosVel[2];
@@ -1147,7 +1173,7 @@ void update_actor_green_shell(struct ShellActor *shell) {
} else {
shell->pos[1] = pad2;
}
if ((player->unk_000 & 0x4000) != 0) {
if ((player->type & 0x4000) != 0) {
controller = &gControllers[shell->playerId];
if ((controller->buttonDepressed & 0x2000) != 0) {
controller->buttonDepressed &= ~0x2000;
@@ -1216,7 +1242,7 @@ void update_actor_green_shell(struct ShellActor *shell) {
somePosVel[0] = sins(shell->rotAngle) * 6.0f;
somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
somePosVel[2] = coss(shell->rotAngle) * 6.0f;
mtxf_translate_vec3f_mat3(somePosVel, player->unk_174);
mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
shell->pos[0] = player->pos[0] + somePosVel[0];
shell->pos[1] = player->pos[1] + somePosVel[1];
shell->pos[2] = player->pos[2] + somePosVel[2];
@@ -1257,7 +1283,7 @@ void update_actor_green_shell(struct ShellActor *shell) {
somePosVel[0] = sins(shell->rotAngle) * 8.0f;
somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
somePosVel[2] = coss(shell->rotAngle) * 8.0f;
mtxf_translate_vec3f_mat3(somePosVel, player->unk_174);
mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
somePos2[0] = shell->pos[0];
somePos2[1] = shell->pos[1];
somePos2[2] = shell->pos[2];
@@ -1420,7 +1446,7 @@ void func_802B3E7C(struct ShellActor *shell, Player *player) {
shell->velocity[1] = -2.0f;
shell->velocity[2] = z_velocity;
if (player->unk_0BC & 0x80000000) {
if (player->effects & 0x80000000) {
func_8029FDC8((struct Actor *) shell);
} else {
func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], newPosition[0], newPosition[1], newPosition[2]);
@@ -1442,7 +1468,7 @@ s16 func_802B3FD0(Player *owner, struct ShellActor *shell) {
for (playerIndex = 0; playerIndex < 4; playerIndex++) {
player = &gPlayers[playerIndex];
if ((player->unk_000 & 0x8000) == 0) {continue;}
if ((player->type & PLAYER_EXISTS) == 0) {continue;}
if (player == owner) {continue; }
if (gPlayerBalloonCount[playerIndex] < 0) { continue; }
// func_802B51E8 is not quite a 3D distance function, it doubles (rather than squares) the Z difference of the positions
@@ -1515,7 +1541,7 @@ void update_actor_red_blue_shell(struct ShellActor *shell) {
somePosVel[0] = 0.0f;
somePosVel[1] = player->boundingBoxSize;
somePosVel[2] = -(player->boundingBoxSize + shell->boundingBoxSize + 2.0f);
mtxf_translate_vec3f_mat3(somePosVel, player->unk_174);
mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
shell->pos[0] = player->pos[0] + somePosVel[0];
pad7 = player->pos[1] - somePosVel[1];
shell->pos[2] = player->pos[2] + somePosVel[2];
@@ -1528,7 +1554,7 @@ void update_actor_red_blue_shell(struct ShellActor *shell) {
shell->pos[1] = pad7;
}
if ((player->unk_000 & 0x4000) != 0) {
if ((player->type & 0x4000) != 0) {
if (gDemoMode) {
controller = gControllerOne;
} else {
@@ -1594,7 +1620,7 @@ void update_actor_red_blue_shell(struct ShellActor *shell) {
somePosVel[0] = sins(shell->rotAngle) * 8.0f;
somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
somePosVel[2] = coss(shell->rotAngle) * 8.0f;
mtxf_translate_vec3f_mat3(somePosVel, player->unk_174);
mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
shell->pos[0] = player->pos[0] + somePosVel[0];
shell->pos[1] = player->pos[1] + somePosVel[1];
shell->pos[2] = player->pos[2] + somePosVel[2];
@@ -1699,7 +1725,7 @@ void update_actor_red_blue_shell(struct ShellActor *shell) {
somePosVel[0] = sins(shell->rotAngle) * 8.0f;
somePosVel[1] = shell->boundingBoxSize - player->boundingBoxSize;
somePosVel[2] = coss(shell->rotAngle) * 8.0f;
mtxf_translate_vec3f_mat3(somePosVel, player->unk_174);
mtxf_translate_vec3f_mat3(somePosVel, player->orientationMatrix);
origPos[0] = shell->pos[0];
origPos[1] = shell->pos[1];
origPos[2] = shell->pos[2];
+10 -10
View File
@@ -14,19 +14,19 @@ void func_802B0648(struct BananaBunchParent*);
void func_802B0788(s16, struct BananaBunchParent*, Player*);
s32 func_802B09C0(s16);
void update_actor_banana_bunch(struct BananaBunchParent*);
s32 func_802B0E14(s16);
s32 is_shell_exist(s16);
void update_actor_triple_shell(TripleShellParent*, s16);
s32 func_802B17F4(Player*);
s32 func_802B18E4(Player*, s16);
s32 func_802B19EC(TripleShellParent*, Player*, s16, u16);
s32 func_802B1C9C(Player*);
s32 func_802B1E48(Player*);
void func_802B1FFC(Player*);
s32 use_banana_bunch_item(Player*);
s32 use_triple_shell_item(Player*, s16);
s32 init_triple_shell(TripleShellParent*, Player*, s16, u16);
s32 use_green_shell_item(Player*);
s32 use_red_shell_item(Player*);
void use_blue_shell_item(Player*);
void update_actor_banana(struct BananaActor*);
void func_802B2914(struct BananaBunchParent*, Player*, s16);
s32 func_802B2C40(Player*);
s32 func_802B2D70(Player*);
void func_802B2EBC(Player*);
s32 use_fake_itembox_item(Player*);
s32 use_banana_item(Player*);
void use_thunder_item(Player*);
void func_802B2FA0(Player*);
void func_802B30EC(void);
void update_actor_green_shell(struct ShellActor*);
+33 -33
View File
@@ -631,7 +631,7 @@ void func_802B64C4(Vec3f arg0, s16 arg1) {
arg0[2] = sp2C * temp1 + (temp_f0 * temp3);
}
void func_802B6540(Mat3 dest, f32 arg1, f32 arg2, f32 arg3, s16 arg4) {
void calculate_orientation_matrix(Mat3 dest, f32 arg1, f32 arg2, f32 arg3, s16 rotationAngle) {
Mat3 mtx_rot_y;
Mat3 matrix;
s32 i, j;
@@ -643,8 +643,8 @@ void func_802B6540(Mat3 dest, f32 arg1, f32 arg2, f32 arg3, s16 arg4) {
f32 sinValue;
f32 cossValue;
sinValue = sins(arg4);
cossValue = coss(arg4);
sinValue = sins(rotationAngle);
cossValue = coss(rotationAngle);
mtx_rot_y[0][0] = cossValue;
mtx_rot_y[2][1] = 0;
mtx_rot_y[1][2] = 0;
@@ -676,11 +676,11 @@ void func_802B6540(Mat3 dest, f32 arg1, f32 arg2, f32 arg3, s16 arg4) {
matrix[1][1] = -1;
} else {
a = (f32) -(360.0 - ((f64) (func_802B7CE8(arg2) * 180.0f) / M_PI));
a = (f32) -(360.0 - ((f64) (calculate_vector_angle_xy(arg2) * 180.0f) / M_PI));
b = -arg3 / sqrtf((arg1 * arg1) + (arg3 * arg3));
c = 0;
d = arg1 / sqrtf((arg1 * arg1) + (arg3 * arg3));
func_802B6A84(matrix, a, b, c, d);
calculate_rotation_matrix(matrix, a, b, c, d);
}
dest[0][0] = (mtx_rot_y[0][0] * matrix[0][0]) + (mtx_rot_y[0][1] * matrix[1][0]) + (mtx_rot_y[0][2] * matrix[2][0]);
@@ -697,7 +697,7 @@ void func_802B6540(Mat3 dest, f32 arg1, f32 arg2, f32 arg3, s16 arg4) {
}
// include in func_802B6540
// include in calculate_orientation_matrix
UNUSED void func_802B68F8(Mat3 matrix, f32 arg1, f32 arg2, f32 arg3) {
s32 i, j;
f32 a;
@@ -720,15 +720,15 @@ UNUSED void func_802B68F8(Mat3 matrix, f32 arg1, f32 arg2, f32 arg3) {
}
matrix[1][1] = -1.0f;
} else {
a = (f32) -(360.0 - ((f64) (func_802B7CE8(arg2) * 180.0f) / M_PI));
a = (f32) -(360.0 - ((f64) (calculate_vector_angle_xy(arg2) * 180.0f) / M_PI));
b = -arg3 / sqrtf((arg1 * arg1) + (arg3 * arg3));
c = 0;
d = arg1 / sqrtf((arg1 * arg1) + (arg3 * arg3));
func_802B6A84(matrix, a, b, c, d);
calculate_rotation_matrix(matrix, a, b, c, d);
}
}
void func_802B6A84(Mat3 arg0, s16 arg1, f32 arg2, f32 arg3, f32 arg4) {
void calculate_rotation_matrix(Mat3 destMatrix, s16 rotationAngle, f32 rotationX, f32 rotationY, f32 rotationZ) {
f32 sinValue;
f32 cossValue;
f32 temp_f12;
@@ -737,29 +737,29 @@ void func_802B6A84(Mat3 arg0, s16 arg1, f32 arg2, f32 arg3, f32 arg4) {
f32 temp;
UNUSED s32 pad[2];
sinValue = sins((u16) arg1);
cossValue = coss((u16) arg1);
sinValue = sins((u16) rotationAngle);
cossValue = coss((u16) rotationAngle);
temp_f12 = 1.0f - cossValue;
temp_f10 = (arg4 * arg2) * temp_f12;
temp_f2 = (arg3 * arg4) * temp_f12;
temp = ((arg2 * arg3) * temp_f12);
temp_f10 = (rotationZ * rotationX) * temp_f12;
temp_f2 = (rotationY * rotationZ) * temp_f12;
temp = ((rotationX * rotationY) * temp_f12);
temp_f12 = arg2 * arg2;
arg0[0][0] = ((1.0f - temp_f12) * cossValue) + temp_f12;
arg0[2][1] = temp_f2 - (arg2 * sinValue);
arg0[1][2] = temp_f2 + (arg2 * sinValue);
temp_f12 = rotationX * rotationX;
destMatrix[0][0] = ((1.0f - temp_f12) * cossValue) + temp_f12;
destMatrix[2][1] = temp_f2 - (rotationX * sinValue);
destMatrix[1][2] = temp_f2 + (rotationX * sinValue);
temp_f12 = arg3 * arg3;
arg0[1][1] = (((1.0f - temp_f12) * cossValue) + temp_f12);
arg0[2][0] = temp_f10 + (arg3 * sinValue);
arg0[0][2] = temp_f10 - (arg3 * sinValue);
temp_f12 = rotationY * rotationY;
destMatrix[1][1] = (((1.0f - temp_f12) * cossValue) + temp_f12);
destMatrix[2][0] = temp_f10 + (rotationY * sinValue);
destMatrix[0][2] = temp_f10 - (rotationY * sinValue);
temp_f12 = arg4 * arg4;
arg0[2][2] = (((1.0f - temp_f12) * cossValue) + temp_f12);
arg0[1][0] = temp - (arg4 * sinValue);
arg0[0][1] = temp + (arg4 * sinValue);
temp_f12 = rotationZ * rotationZ;
destMatrix[2][2] = (((1.0f - temp_f12) * cossValue) + temp_f12);
destMatrix[1][0] = temp - (rotationZ * sinValue);
destMatrix[0][1] = temp + (rotationZ * sinValue);
}
void func_802B6BC0(Mat4 arg0, s16 arg1, f32 arg2, f32 arg3, f32 arg4) {
@@ -950,7 +950,7 @@ u16 atan2s(f32 x, f32 y) {
return ret;
}
f32 func_802B79B8(f32 arg0, f32 arg1) {
f32 atan2f(f32 arg0, f32 arg1) {
return atan2s(arg0, arg1);
}
@@ -990,11 +990,11 @@ UNUSED f32 func_802B79F0(f32 arg0, f32 arg1) {
}
UNUSED u16 func_802B7B50(f32 arg0, f32 arg1) {
return ((func_802B79B8(arg0, arg1) * 32768.0f) / M_PI);
return ((atan2f(arg0, arg1) * 32768.0f) / M_PI);
}
UNUSED void func_802B7C18(f32 arg0) {
func_802B79B8(arg0, 1.0f);
atan2f(arg0, 1.0f);
}
s16 func_802B7C40(f32 arg0) {
@@ -1002,19 +1002,19 @@ s16 func_802B7C40(f32 arg0) {
}
UNUSED void func_802B7C6C(f32 arg0) {
func_802B79B8(arg0, sqrtf(1.0 - (arg0 * arg0)));
atan2f(arg0, sqrtf(1.0 - (arg0 * arg0)));
}
s16 func_802B7CA8(f32 arg0) {
return atan2s(arg0, sqrtf(1.0 - (arg0 * arg0)));
}
f32 func_802B7CE8(f32 arg0) {
return func_802B79B8(sqrtf(1.0 - (arg0 * arg0)), arg0);
f32 calculate_vector_angle_xy(f32 vectorX) {
return atan2f(sqrtf(1.0 - (vectorX * vectorX)), vectorX);
}
UNUSED s16 func_802B7D28(f32 arg0) {
return func_802B79B8(sqrtf(1.0 - (f64)(arg0 * arg0)), arg0) * 32768.0f / M_PI;
return atan2f(sqrtf(1.0 - (f64)(arg0 * arg0)), arg0) * 32768.0f / M_PI;
}
u16 random_u16(void) {
+4 -4
View File
@@ -43,18 +43,18 @@ void func_802B5F74(Mat4, Vec3f, Vec3s);
void mtxf_translate_vec3f_mat3(Vec3f, Mat3);
void mtxf_translate_vec3f_mat4(Vec3f, Mat4);
void func_802B64C4(Vec3f, s16);
void func_802B6540(Mat3, f32, f32, f32, s16);
void func_802B6A84(Mat3, s16, f32, f32, f32);
void calculate_orientation_matrix(Mat3, f32, f32, f32, s16);
void calculate_rotation_matrix(Mat3, s16, f32, f32, f32);
void func_802B6BC0(Mat4, s16, f32, f32, f32);
void func_802B6D58(Mat4, Vec3f, Vec3f);
void mtxf_multiplication(Mat4, Mat4, Mat4);
void mtxf_to_mtx(Mtx*, Mat4);
u16 atan2_lookup(f32, f32);
u16 atan2s(f32, f32);
f32 func_802B79B8(f32, f32);
f32 atan2f(f32, f32);
s16 func_802B7C40(f32);
s16 func_802B7CA8(f32);
f32 func_802B7CE8(f32);
f32 calculate_vector_angle_xy(f32);
u16 random_u16(void);
u16 random_int(u16);
s16 func_802B7F34(f32, f32, f32, f32);
+60 -60
View File
@@ -103,15 +103,15 @@ void update_player_battle_status(void) {
for (playerIndex = 0; playerIndex < 4; playerIndex++) {
player = &gPlayers[playerIndex];
if (!(player->unk_000 & PLAYER_EXISTS)) {
if (!(player->type & PLAYER_EXISTS)) {
continue;
}
if (player->unk_000 & PLAYER_CINEMATIC_MODE) {
if (player->type & PLAYER_CINEMATIC_MODE) {
continue;
}
// If player has no balloons left
if (gPlayerBalloonCount[playerIndex] < 0) {
player->unk_000 |= PLAYER_CINEMATIC_MODE;
player->type |= PLAYER_CINEMATIC_MODE;
playersDead[deadCounter] = (s16) (player - gPlayerOne);
deadCounter++;
func_800CA118((u8) playerIndex); // play sad character sound?
@@ -136,7 +136,7 @@ void func_8028E298(void) {
for (i = 0; i < 8; i++) {
if ((gPlayers[i].unk_000 & PLAYER_CINEMATIC_MODE)) {
if ((gPlayers[i].type & PLAYER_CINEMATIC_MODE)) {
continue;
}
temp_a2 = gPathIndexByPlayerId[i];
@@ -496,13 +496,13 @@ void start_race(void) {
for (i = 0; i < 8; i++) {
if ((gPlayers[i].unk_000 & PLAYER_EXISTS) == 0) {
if ((gPlayers[i].type & PLAYER_EXISTS) == 0) {
continue;
}
// Sets player to human.
if (gPlayers[i].unk_000 & PLAYER_START_SEQUENCE) {
gPlayers[i].unk_000 ^= PLAYER_START_SEQUENCE;
if (gPlayers[i].type & PLAYER_START_SEQUENCE) {
gPlayers[i].type ^= PLAYER_START_SEQUENCE;
}
}
@@ -517,7 +517,7 @@ f32 func_8028EE8C(s32 arg0) {
}
void func_8028EEF0(s32 i) {
gPlayers[i].unk_000 |= PLAYER_CINEMATIC_MODE;
gPlayers[i].type |= PLAYER_CINEMATIC_MODE;
}
void func_8028EF28(void) {
@@ -528,7 +528,7 @@ void func_8028EF28(void) {
{
Player *player = &gPlayers[i];
if ((gPlayers[i].unk_000 & PLAYER_EXISTS) == 0) {
if ((gPlayers[i].type & PLAYER_EXISTS) == 0) {
continue;
}
@@ -537,12 +537,12 @@ void func_8028EF28(void) {
} else if (gLapCountByPlayerId[i] > gPlayers[i].lapCount) {
gPlayers[i].lapCount++;
if ((gPlayers[i].unk_000 & PLAYER_HUMAN) != 0) {
if ((gPlayers[i].type & PLAYER_HUMAN) != 0) {
if (gPlayers[i].lapCount == 3) {
func_8028EEF0(i);
currentPosition = gPlayers[i].currentRank;
gPlayers[i].unk_000 |= PLAYER_CPU;
gPlayers[i].type |= PLAYER_CPU;
if (currentPosition < 4) {
D_80150120 = 1;
@@ -557,7 +557,7 @@ void func_8028EF28(void) {
if (gModeSelection == GRAND_PRIX && gPlayerCountSelection1 == 2 && D_802BA048 == 0) {
D_802BA048 = 1;
}
if ((gPlayers[i].unk_000 & PLAYER_INVISIBLE_OR_BOMB) == 0) {
if ((gPlayers[i].type & PLAYER_INVISIBLE_OR_BOMB) == 0) {
D_800DC510 = 4;
}
if (gModeSelection == TIME_TRIALS) {
@@ -581,7 +581,7 @@ void func_8028EF28(void) {
D_800DC510 = 5;
i = gPlayerPositionLUT[1];
gPlayers[i].statusEffects |= 0x200000;
gPlayers[i].unk_000 |= PLAYER_CPU;
gPlayers[i].type |= PLAYER_CPU;
func_800CA118((u8)i);
break;
case 3:
@@ -599,7 +599,7 @@ void func_8028EF28(void) {
*(gNmiUnknown2 + i * 3 + 2) = 99;
}
gPlayers[i].statusEffects |= 0x200000;
gPlayers[i].unk_000 |= PLAYER_CPU;
gPlayers[i].type |= PLAYER_CPU;
func_800CA118((u8)i);
}
break;
@@ -614,7 +614,7 @@ void func_8028EF28(void) {
D_800DC510 = 5;
i = gPlayerPositionLUT[3];
gPlayers[i].statusEffects |= 0x200000;
gPlayers[i].unk_000 |= PLAYER_CPU;
gPlayers[i].type |= PLAYER_CPU;
func_800CA118((u8)i);
}
break;
@@ -623,7 +623,7 @@ void func_8028EF28(void) {
}
} else if (gPlayers[i].lapCount == 2) {
if ((gPlayers[i].unk_000 & 0x100) != 0) {
if ((gPlayers[i].type & 0x100) != 0) {
return;
}
if ((D_802BA032 & 0x4000) == 0) {
@@ -655,9 +655,9 @@ void update_race_position_data(void) {
s16 position;
for (i = 0; i < 8; i++) {
if (((gPlayers[i].unk_000 & PLAYER_EXISTS) != 0) &&
((gPlayers[i].unk_000 & PLAYER_CINEMATIC_MODE) == 0) &&
((gPlayers[i].unk_000 & PLAYER_INVISIBLE_OR_BOMB) == 0)) {
if (((gPlayers[i].type & PLAYER_EXISTS) != 0) &&
((gPlayers[i].type & PLAYER_CINEMATIC_MODE) == 0) &&
((gPlayers[i].type & PLAYER_INVISIBLE_OR_BOMB) == 0)) {
position = gGPCurrentRaceRankByPlayerId[i];
gPlayers[i].currentRank = position;
gPlayerPositionLUT[position] = i;
@@ -810,8 +810,8 @@ void func_8028F970(void) {
Player *player = &gPlayers[i];
struct Controller *controller = &gControllers[i];
if (!(player->unk_000 & PLAYER_HUMAN)) { continue; }
if (player->unk_000 & PLAYER_CPU) { continue; }
if (!(player->type & PLAYER_HUMAN)) { continue; }
if (player->type & PLAYER_CPU) { continue; }
if (gActiveScreenMode != SCREEN_MODE_3P_4P_SPLITSCREEN) {
if ((controller->buttonPressed & L_TRIG) && !(controller->button & R_TRIG)) {
@@ -834,13 +834,13 @@ void func_8028F970(void) {
func_800C9F90(1);
D_80162DF0 = 1;
if (gModeSelection == TIME_TRIALS) {
if (gPlayerOne->unk_000 & (PLAYER_EXISTS | PLAYER_INVISIBLE_OR_BOMB)) {
if (gPlayerOne->type & (PLAYER_EXISTS | PLAYER_INVISIBLE_OR_BOMB)) {
func_80005AE8(gPlayerOne);
}
if (gPlayerTwo->unk_000 & (PLAYER_EXISTS | PLAYER_INVISIBLE_OR_BOMB)) {
if (gPlayerTwo->type & (PLAYER_EXISTS | PLAYER_INVISIBLE_OR_BOMB)) {
func_80005AE8(gPlayerTwo);
}
if (gPlayerThree->unk_000 & (PLAYER_EXISTS | PLAYER_INVISIBLE_OR_BOMB)) {
if (gPlayerThree->type & (PLAYER_EXISTS | PLAYER_INVISIBLE_OR_BOMB)) {
func_80005AE8(gPlayerThree);
}
}
@@ -939,10 +939,10 @@ void func_8028FCBC(void) {
func_8005C64C(&D_8018D2AC);
}
for (i = 0; i < 8; i++) {
if ((ply->unk_000 & PLAYER_EXISTS) == 0) {
if ((ply->type & PLAYER_EXISTS) == 0) {
continue;
}
ply->unk_000 |= PLAYER_START_SEQUENCE;
ply->type |= PLAYER_START_SEQUENCE;
ply++;
}
D_800DC5B8 = 1;
@@ -1013,7 +1013,7 @@ void func_8028FCBC(void) {
break;
case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL:
case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL:
if (((gPlayerOne->unk_000 & PLAYER_CINEMATIC_MODE) != 0) && ((gPlayerTwo->unk_000 & PLAYER_CINEMATIC_MODE) != 0)) {
if (((gPlayerOne->type & PLAYER_CINEMATIC_MODE) != 0) && ((gPlayerTwo->type & PLAYER_CINEMATIC_MODE) != 0)) {
if (gPlayerOne->currentRank < gPlayerTwo->currentRank) {
@@ -1134,9 +1134,9 @@ void func_802903D8(Player *playerOne, Player *playerTwo) {
sp60[1] = (playerOne->pos[1] - playerOne->boundingBoxSize) - (playerTwo->pos[1] - playerTwo->boundingBoxSize);
sp60[2] = playerOne->pos[2] - playerTwo->pos[2];
sp54[0] = playerTwo->unk_034[0] - playerOne->unk_034[0];
sp54[1] = playerTwo->unk_034[1] - playerOne->unk_034[1];
sp54[2] = playerTwo->unk_034[2] - playerOne->unk_034[2];
sp54[0] = playerTwo->velocity[0] - playerOne->velocity[0];
sp54[1] = playerTwo->velocity[1] - playerOne->velocity[1];
sp54[2] = playerTwo->velocity[2] - playerOne->velocity[2];
temp_f0 = sqrtf((sp60[0] * sp60[0]) + (sp60[1] * sp60[1]) + (sp60[2] * sp60[2]));
@@ -1146,32 +1146,32 @@ void func_802903D8(Player *playerOne, Player *playerTwo) {
if (sp74 > 0) { return; }
if (playerOne->unk_000 & PLAYER_UNKNOWN_0x40) {
if (playerTwo->unk_000 & PLAYER_UNKNOWN_0x40) {
if (playerOne->type & PLAYER_UNKNOWN_0x40) {
if (playerTwo->type & PLAYER_UNKNOWN_0x40) {
func_8008FC1C(playerOne);
func_8008FC1C(playerTwo);
func_800C9060((playerTwo - gPlayerOne), 0x19008001U);
return;
} else {
playerTwo->statusEffects |= 0x400000;
playerTwo->statusEffects |= REVERSE_EFFECT;
func_8008FC1C(playerOne);
func_800C9060((playerTwo - gPlayerOne), 0x19008001U);
}
} else if (playerTwo->unk_000 & PLAYER_UNKNOWN_0x40) {
playerOne->statusEffects |= 0x400000;
} else if (playerTwo->type & PLAYER_UNKNOWN_0x40) {
playerOne->statusEffects |= REVERSE_EFFECT;
func_8008FC1C(playerTwo);
func_800C9060(playerOne - gPlayerOne, 0x19008001U);
return;
}
if (playerOne->unk_0BC & 0x200) {
if (!(playerTwo->unk_0BC & 0x200)) {
playerTwo->statusEffects |= 0x01000000;
if (playerOne->effects & 0x200) {
if (!(playerTwo->effects & 0x200)) {
playerTwo->statusEffects |= HIT_BY_ITEM_EFFECT;
}
} else if (playerTwo->unk_0BC & 0x200) {
playerOne->statusEffects |= 0x01000000;
} else if (playerTwo->effects & 0x200) {
playerOne->statusEffects |= HIT_BY_ITEM_EFFECT;
} else {
playerOne->unk_0BC |= 0x8000;
playerTwo->unk_0BC |= 0x8000;
playerOne->effects |= 0x8000;
playerTwo->effects |= 0x8000;
}
temp_f0_2 = sqrtf((sp54[0] * sp54[0]) + (sp54[1] * sp54[1]) + (sp54[2] * sp54[2]));
sp60[0] /= temp_f0;
@@ -1190,29 +1190,29 @@ 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->unk_0BC & 0x200) != 0x200) {
if ((playerOne->effects & 0x200) != 0x200) {
temp_f2 = (temp_f0_2 * sp20) / sp24;
playerOne->unk_034[0] += sp60[0] * temp_f2;
playerOne->unk_034[1] += sp60[1] * temp_f2;
playerOne->unk_034[2] += sp60[2] * temp_f2;
playerOne->velocity[0] += sp60[0] * temp_f2;
playerOne->velocity[1] += sp60[1] * temp_f2;
playerOne->velocity[2] += sp60[2] * temp_f2;
playerOne->pos[0] -= sp60[0] * sp74 * 0.5f;
playerOne->pos[1] -= sp60[1] * sp74 * 0.5f;
playerOne->pos[2] -= sp60[2] * sp74 * 0.5f;
}
if ((playerTwo->unk_0BC & 0x200) != 0x200) {
if ((playerTwo->effects & 0x200) != 0x200) {
temp_f2 = (temp_f0_2 * sp24) / sp20;
playerTwo->unk_034[0] -= sp60[0] * temp_f2;
playerTwo->unk_034[1] -= sp60[1] * temp_f2;
playerTwo->unk_034[2] -= sp60[2] * temp_f2;
playerTwo->velocity[0] -= sp60[0] * temp_f2;
playerTwo->velocity[1] -= sp60[1] * temp_f2;
playerTwo->velocity[2] -= sp60[2] * temp_f2;
playerTwo->pos[0] += sp60[0] * sp74 * 0.5f;
playerTwo->pos[1] += sp60[1] * sp74 * 0.5f;
playerTwo->pos[2] += sp60[2] * sp74 * 0.5f;
}
if (playerOne->unk_000 & PLAYER_HUMAN) {
if (playerOne->type & PLAYER_HUMAN) {
func_800C9060((playerOne - gPlayerOne), 0x19008001U);
return;
}
if (playerTwo->unk_000 & PLAYER_HUMAN) {
if (playerTwo->type & PLAYER_HUMAN) {
func_800C9060((playerTwo - gPlayerOne), 0x19008001U);
}
}
@@ -1226,18 +1226,18 @@ void func_802909F0(void) {
for (i = 0; i < 7; i++) {
ply = &gPlayers[i];
if ((ply->unk_000 & PLAYER_EXISTS) &&
(!(ply->unk_0BC & 0x80000000)) &&
(!(ply->unk_000 & PLAYER_INVISIBLE_OR_BOMB)) &&
(!(ply->unk_0BC & 0x4000000))) {
if ((ply->type & PLAYER_EXISTS) &&
(!(ply->effects & 0x80000000)) &&
(!(ply->type & PLAYER_INVISIBLE_OR_BOMB)) &&
(!(ply->effects & 0x4000000))) {
for (k = i + 1; k < 8; k++) {
ply2 = &gPlayers[k];
if ((ply2->unk_000 & PLAYER_EXISTS) &&
(!(ply2->unk_0BC & 0x80000000)) &&
(!(ply2->unk_000 & PLAYER_INVISIBLE_OR_BOMB)) &&
(!(ply2->unk_0BC & 0x4000000))) {
if ((ply2->type & PLAYER_EXISTS) &&
(!(ply2->effects & 0x80000000)) &&
(!(ply2->type & PLAYER_INVISIBLE_OR_BOMB)) &&
(!(ply2->effects & 0x4000000))) {
func_802903D8(ply, ply2);
}
+3 -3
View File
@@ -134,7 +134,7 @@ void load_surface_map(uintptr_t addr, struct UnkStruct_800DC5EC *arg1) {
} else {
switch(gCurrentCourseId) {
case 2:
case COURSE_BOWSER_CASTLE:
if ((temp_v0_3 >= 0x11) && (temp_v0_3 < 0x18)) {
temp_v1 = temp_v0_3;
} else if ((temp_v0_3 == 255) && (sp1E != 255)) {
@@ -145,7 +145,7 @@ void load_surface_map(uintptr_t addr, struct UnkStruct_800DC5EC *arg1) {
temp_v1 = arg1->pathCounter;
}
break;
case 1:
case COURSE_CHOCO_MOUNTAIN:
if ((temp_v0_3 >= 0xE) && (temp_v0_3 < 0x16)) {
temp_v1 = temp_v0_3;
} else if ((temp_v0_3 == 255) && (sp1E != 255)) {
@@ -230,7 +230,7 @@ void func_8029122C(struct UnkStruct_800DC5EC *arg0, s32 arg1) {
render_set_position(matrix, 0);
switch (gCurrentCourseId) {
case COURSE_BOWSER_CASTLE:
if (gActiveScreenMode != 0) { return; }
if (gActiveScreenMode != SCREEN_MODE_1P) { return; }
if (pathCounter < 6) { return; }
if (pathCounter > 9) { return; }
if (pathCounter == 9) {