mirror of
https://github.com/n64decomp/mk64
synced 2026-06-20 15:04:20 -04:00
@@ -58,7 +58,7 @@ void update_actor_banana(struct BananaActor* banana) {
|
||||
}
|
||||
if ((controller->buttonDepressed & Z_TRIG) != 0) {
|
||||
controller->buttonDepressed &= ~Z_TRIG;
|
||||
banana->state = 1;
|
||||
banana->state = DROPPED_BANANA;
|
||||
banana->unk_04 = 0x00B4;
|
||||
player->soundEffects &= ~HOLD_BANANA_SOUND_EFFECT;
|
||||
func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12));
|
||||
@@ -66,10 +66,10 @@ void update_actor_banana(struct BananaActor* banana) {
|
||||
if ((pad3 > 30.0f) && (controller->rawStickX < 10) && (controller->rawStickX >= -9)) {
|
||||
pad3 = pad3 - ((f32) 30);
|
||||
pad3 = (pad3 / 20.0f) + 0.5f;
|
||||
if (player->unk_094 < 2.0f) {
|
||||
if (player->speed < 2.0f) {
|
||||
temp_f0 = 4.0f;
|
||||
} else {
|
||||
temp_f0 = (player->unk_094 * 0.75f) + 3.5f + pad3;
|
||||
temp_f0 = (player->speed * 0.75f) + 3.5f + pad3;
|
||||
}
|
||||
vec3f_set(someVelocity, 0, pad3, temp_f0);
|
||||
func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#include <actors.h>
|
||||
#include <waypoints.h>
|
||||
#include <path.h>
|
||||
#include <defines.h>
|
||||
#include <main.h>
|
||||
#include <actors_extended.h>
|
||||
#include <code_800029B0.h>
|
||||
|
||||
void func_802B3B44(struct ShellActor* shell) {
|
||||
u16 currentWaypoint;
|
||||
u16 nextWaypoint;
|
||||
u16 currentPathPoint;
|
||||
u16 nextPathPoint;
|
||||
f32 temp_f0;
|
||||
f32 temp_f0_2;
|
||||
f32 temp_f0_3;
|
||||
@@ -28,14 +28,14 @@ void func_802B3B44(struct ShellActor* shell) {
|
||||
f32 temp_f26;
|
||||
Vec3f origPos;
|
||||
|
||||
currentWaypoint = shell->pathIndex;
|
||||
temp_f2 = D_80164490[currentWaypoint].posX;
|
||||
temp_f12 = D_80164490[currentWaypoint].posY;
|
||||
temp_f28 = D_80164490[currentWaypoint].posZ;
|
||||
nextWaypoint = currentWaypoint + 1;
|
||||
currentPathPoint = shell->pathIndex;
|
||||
temp_f2 = gCurrentTrackPath[currentPathPoint].posX;
|
||||
temp_f12 = gCurrentTrackPath[currentPathPoint].posY;
|
||||
temp_f28 = gCurrentTrackPath[currentPathPoint].posZ;
|
||||
nextPathPoint = currentPathPoint + 1;
|
||||
|
||||
if (nextWaypoint >= D_80164430) {
|
||||
nextWaypoint -= D_80164430;
|
||||
if (nextPathPoint >= gSelectedPathCount) {
|
||||
nextPathPoint -= gSelectedPathCount;
|
||||
}
|
||||
|
||||
temp_f20 = temp_f2 - shell->pos[0];
|
||||
@@ -43,9 +43,9 @@ void func_802B3B44(struct ShellActor* shell) {
|
||||
temp_f24 = temp_f28 - shell->pos[2];
|
||||
temp_f0 = (temp_f20 * temp_f20) + (temp_f22 * temp_f22) + (temp_f24 * temp_f24);
|
||||
if (temp_f0 > 400.0f) {
|
||||
temp_f18_3 = D_80164490[nextWaypoint].posX;
|
||||
temp_f16_3 = D_80164490[nextWaypoint].posY;
|
||||
temp_f26 = D_80164490[nextWaypoint].posZ;
|
||||
temp_f18_3 = gCurrentTrackPath[nextPathPoint].posX;
|
||||
temp_f16_3 = gCurrentTrackPath[nextPathPoint].posY;
|
||||
temp_f26 = gCurrentTrackPath[nextPathPoint].posZ;
|
||||
|
||||
temp_f12_0 = temp_f18_3 - shell->pos[0];
|
||||
temp_f12_1 = temp_f16_3 - shell->pos[1];
|
||||
@@ -53,7 +53,7 @@ void func_802B3B44(struct ShellActor* shell) {
|
||||
|
||||
temp_f0_3 = (temp_f12_0 * temp_f12_0) + (temp_f12_1 * temp_f12_1) + (temp_f12_2 * temp_f12_2);
|
||||
if (temp_f0_3 < temp_f0) {
|
||||
shell->pathIndex = nextWaypoint;
|
||||
shell->pathIndex = nextPathPoint;
|
||||
} else {
|
||||
temp_f0_2 = sqrtf(temp_f0) * 4.0f;
|
||||
temp_f20 /= temp_f0_2;
|
||||
@@ -94,11 +94,11 @@ void func_802B3B44(struct ShellActor* shell) {
|
||||
shell->pos[0] = temp_f2;
|
||||
shell->pos[1] = shell->boundingBoxSize + temp_f12;
|
||||
shell->pos[2] = temp_f28;
|
||||
shell->pathIndex = nextWaypoint;
|
||||
shell->pathIndex = nextPathPoint;
|
||||
} else {
|
||||
temp_f18_3 = D_80164490[nextWaypoint].posX;
|
||||
temp_f16_3 = D_80164490[nextWaypoint].posY;
|
||||
temp_f26 = D_80164490[nextWaypoint].posZ;
|
||||
temp_f18_3 = gCurrentTrackPath[nextPathPoint].posX;
|
||||
temp_f16_3 = gCurrentTrackPath[nextPathPoint].posY;
|
||||
temp_f26 = gCurrentTrackPath[nextPathPoint].posZ;
|
||||
|
||||
shell->pos[0] = (temp_f2 + temp_f18_3) * 0.5f;
|
||||
shell->pos[1] = ((temp_f12 + temp_f16_3) * 0.5f) + shell->boundingBoxSize;
|
||||
@@ -317,8 +317,8 @@ void update_actor_red_blue_shell(struct ShellActor* shell) {
|
||||
if (shell->state == MOVING_SHELL) {
|
||||
shell->someTimer = 0x001E;
|
||||
height = 8.0f;
|
||||
if (player->unk_094 > 8.0f) {
|
||||
height = player->unk_094 * 1.2f;
|
||||
if (player->speed > 8.0f) {
|
||||
height = player->speed * 1.2f;
|
||||
}
|
||||
somePosVel[0] = 0.0f;
|
||||
somePosVel[1] = 0.0f;
|
||||
@@ -346,9 +346,9 @@ void update_actor_red_blue_shell(struct ShellActor* shell) {
|
||||
shell->targetPlayer = gPlayerPositionLUT[0];
|
||||
shell->state = BLUE_SHELL_LOCK_ON;
|
||||
shell->shellId = 1000.0f;
|
||||
temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8;
|
||||
if ((s32) D_80164430 < temp_v0) {
|
||||
temp_v0 -= D_80164430;
|
||||
temp_v0 = gNearestPathPointByPlayerId[player - gPlayerOne] + 8;
|
||||
if ((s32) gSelectedPathCount < temp_v0) {
|
||||
temp_v0 -= gSelectedPathCount;
|
||||
}
|
||||
shell->pathIndex = temp_v0;
|
||||
} else if (gModeSelection == BATTLE) {
|
||||
@@ -367,17 +367,17 @@ void update_actor_red_blue_shell(struct ShellActor* shell) {
|
||||
if (player->currentRank == 0) {
|
||||
shell->state = TRIPLE_GREEN_SHELL;
|
||||
shell->someTimer = 0x0258;
|
||||
temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8;
|
||||
if ((s32) D_80164430 < temp_v0) {
|
||||
temp_v0 -= D_80164430;
|
||||
temp_v0 = gNearestPathPointByPlayerId[player - gPlayerOne] + 8;
|
||||
if ((s32) gSelectedPathCount < temp_v0) {
|
||||
temp_v0 -= gSelectedPathCount;
|
||||
}
|
||||
shell->pathIndex = temp_v0;
|
||||
} else if (player->currentRank >= 5) {
|
||||
shell->state = GREEN_SHELL_HIT_A_RACER;
|
||||
shell->shellId = 1000.0f;
|
||||
temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8;
|
||||
if ((s32) D_80164430 < temp_v0) {
|
||||
temp_v0 -= D_80164430;
|
||||
temp_v0 = gNearestPathPointByPlayerId[player - gPlayerOne] + 8;
|
||||
if ((s32) gSelectedPathCount < temp_v0) {
|
||||
temp_v0 -= gSelectedPathCount;
|
||||
}
|
||||
shell->pathIndex = temp_v0;
|
||||
shell->targetPlayer = gPlayerPositionLUT[player->currentRank - 1];
|
||||
|
||||
@@ -60,8 +60,8 @@ void update_actor_green_shell(struct ShellActor* shell) {
|
||||
controller->buttonDepressed &= ~Z_TRIG;
|
||||
if (controller->rawStickY < -0x2D) {
|
||||
var_f2 = 8.0f;
|
||||
if (player->unk_094 > 8.0f) {
|
||||
var_f2 = player->unk_094 * 1.2f;
|
||||
if (player->speed > 8.0f) {
|
||||
var_f2 = player->speed * 1.2f;
|
||||
}
|
||||
somePosVel[0] = 0.0f;
|
||||
somePosVel[1] = 0.0f;
|
||||
@@ -112,8 +112,8 @@ void update_actor_green_shell(struct ShellActor* shell) {
|
||||
}
|
||||
if (shell->state == 2) {
|
||||
var_f2 = 8.0f;
|
||||
if (player->unk_094 > 8.0f) {
|
||||
var_f2 = player->unk_094 * 1.2f;
|
||||
if (player->speed > 8.0f) {
|
||||
var_f2 = player->speed * 1.2f;
|
||||
}
|
||||
somePosVel[0] = 0.0f;
|
||||
somePosVel[1] = 0.0f;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <actors.h>
|
||||
#include <main.h>
|
||||
#include <defines.h>
|
||||
#include <waypoints.h>
|
||||
#include <path.h>
|
||||
|
||||
/**
|
||||
* @brief Updates the kiwano fruit actor.
|
||||
@@ -15,10 +15,10 @@ void update_actor_kiwano_fruit(struct KiwanoFruit* fruit) {
|
||||
f32 temp_f16;
|
||||
f32 temp_f14;
|
||||
f32 temp_f12;
|
||||
s32 nearestWaypoint;
|
||||
s32 nearestPathPoint;
|
||||
|
||||
player = &gPlayers[fruit->targetPlayer];
|
||||
if (((player->type & PLAYER_KART_AI) != 0) || (player->collision.unk34 == 0)) {
|
||||
if (((player->type & PLAYER_CPU) != 0) || (player->collision.unk34 == 0)) {
|
||||
fruit->state = 0;
|
||||
return;
|
||||
}
|
||||
@@ -30,10 +30,10 @@ void update_actor_kiwano_fruit(struct KiwanoFruit* fruit) {
|
||||
fruit->state = 1;
|
||||
fruit->velocity[0] = 80.0f;
|
||||
case 1:
|
||||
nearestWaypoint = gNearestWaypointByPlayerId[(u16) (player - gPlayerOne)];
|
||||
temp_f2 = player->pos[0] - D_80164490[nearestWaypoint].posX;
|
||||
temp_f16 = player->pos[1] - D_80164490[nearestWaypoint].posY;
|
||||
temp_f14 = player->pos[2] - D_80164490[nearestWaypoint].posZ;
|
||||
nearestPathPoint = gNearestPathPointByPlayerId[(u16) (player - gPlayerOne)];
|
||||
temp_f2 = player->pos[0] - gCurrentTrackPath[nearestPathPoint].posX;
|
||||
temp_f16 = player->pos[1] - gCurrentTrackPath[nearestPathPoint].posY;
|
||||
temp_f14 = player->pos[2] - gCurrentTrackPath[nearestPathPoint].posZ;
|
||||
temp_f12 = fruit->velocity[0] / sqrtf((temp_f2 * temp_f2) + (temp_f16 * temp_f16) + (temp_f14 * temp_f14));
|
||||
temp_f2 *= temp_f12;
|
||||
temp_f16 *= temp_f12;
|
||||
|
||||
+10
-9
@@ -12,7 +12,7 @@
|
||||
#include "audio/data.h"
|
||||
#include "audio/port_eu.h"
|
||||
#include "code_800029B0.h"
|
||||
#include "code_80005FD0.h"
|
||||
#include "cpu_vehicles_camera_path.h"
|
||||
#include "menu_items.h"
|
||||
|
||||
s8 D_8018EF10;
|
||||
@@ -1868,7 +1868,7 @@ void func_800C6108(u8 playerId) {
|
||||
D_800E9E64[playerId] = (player->unk_098 / D_800E9F7C[playerId].unk_34) + D_800E9F7C[playerId].unk_28;
|
||||
if (D_800E9EC4) {} // ?
|
||||
}
|
||||
if (player->unk_094 > 4.75f) {
|
||||
if (player->speed > 4.75f) {
|
||||
if (D_800E9EB4[playerId] < (D_800E9F7C[playerId].unk_18 + 0.4f)) {
|
||||
D_800E9DE4[playerId] += 0.005f;
|
||||
}
|
||||
@@ -1880,7 +1880,7 @@ void func_800C6108(u8 playerId) {
|
||||
} else {
|
||||
D_800E9E54[playerId] = (f32) -player->unk_0C0;
|
||||
}
|
||||
if ((player->effects & 0x10) == 0x10) {
|
||||
if ((player->effects & UNKNOWN_EFFECT_0x10) == UNKNOWN_EFFECT_0x10) {
|
||||
D_800E9EB4[playerId] = D_800E9E64[playerId] + D_800E9DE4[playerId];
|
||||
} else {
|
||||
D_800E9EB4[playerId] = D_800E9E64[playerId] + D_800E9DE4[playerId] - (D_800E9E54[playerId] / 12000.0f);
|
||||
@@ -1927,7 +1927,7 @@ D_800E9F7C[playerId].unk_38 = (D_800E9F7C[playerId].unk_0C / 1.5f) + 0.4f;
|
||||
void func_800C64A0(u8 playerId) {
|
||||
switch (D_800E9E74[playerId]) {
|
||||
case 3:
|
||||
D_800E9EF4[playerId] = (gPlayers[playerId].unk_094 / 5.0f) + 0.2f;
|
||||
D_800E9EF4[playerId] = (gPlayers[playerId].speed / 5.0f) + 0.2f;
|
||||
break;
|
||||
case 1:
|
||||
case 13:
|
||||
@@ -1950,7 +1950,7 @@ void func_800C64A0(u8 playerId) {
|
||||
case 29:
|
||||
case 30:
|
||||
case 31:
|
||||
D_800E9EF4[playerId] = (gPlayers[playerId].unk_094 / 5.0f) + 0.2f;
|
||||
D_800E9EF4[playerId] = (gPlayers[playerId].speed / 5.0f) + 0.2f;
|
||||
break;
|
||||
default:
|
||||
D_800E9EF4[playerId] = 1.0f;
|
||||
@@ -1978,7 +1978,7 @@ void func_800C64A0(u8 playerId) {
|
||||
void func_800C6758(u8 playerId) {
|
||||
switch (D_800E9E74[playerId]) { /* irregular */
|
||||
case 3:
|
||||
D_800E9F14[playerId] = (gPlayers[playerId].unk_094 / 9.0f) + 0.6f;
|
||||
D_800E9F14[playerId] = (gPlayers[playerId].speed / 9.0f) + 0.6f;
|
||||
break;
|
||||
case 2:
|
||||
case 13:
|
||||
@@ -2150,7 +2150,8 @@ void func_800C683C(u8 cameraId) {
|
||||
void func_800C70A8(u8 playerId) {
|
||||
if (D_800EA0EC[playerId] == 0) {
|
||||
D_800E9E74[playerId] = 0;
|
||||
if ((D_800E9E54[playerId] > 3500.0f) || ((gPlayers[playerId].effects & 0x10) == 0x10)) {
|
||||
if ((D_800E9E54[playerId] > 3500.0f) ||
|
||||
((gPlayers[playerId].effects & UNKNOWN_EFFECT_0x10) == UNKNOWN_EFFECT_0x10)) {
|
||||
D_800E9E74[playerId] = 1;
|
||||
switch (gPlayers[playerId].tyres[AUDIO_LEFT_TYRE].surfaceType) {
|
||||
case DIRT: /* switch 1 */
|
||||
@@ -2182,7 +2183,7 @@ void func_800C70A8(u8 playerId) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((gPlayers[playerId].effects & 0x10) == 0x10) {
|
||||
if ((gPlayers[playerId].effects & UNKNOWN_EFFECT_0x10) == UNKNOWN_EFFECT_0x10) {
|
||||
D_800E9E74[playerId] = 2;
|
||||
switch (gPlayers[playerId].tyres[AUDIO_LEFT_TYRE].surfaceType) { /* switch 2 */
|
||||
case DIRT: /* switch 2 */
|
||||
@@ -2334,7 +2335,7 @@ void func_800C70A8(u8 playerId) {
|
||||
D_800E9E74[playerId] = 0x0000001B;
|
||||
break;
|
||||
}
|
||||
if (((gPlayers[playerId].unk_094 < 0.5f) || ((gPlayers[playerId].effects & 8) == 8)) &&
|
||||
if (((gPlayers[playerId].speed < 0.5f) || ((gPlayers[playerId].effects & 8) == 8)) &&
|
||||
(D_800E9E74[playerId] != 0x0000001C)) {
|
||||
D_800E9E74[playerId] = 0;
|
||||
}
|
||||
|
||||
+14
-14
@@ -9,11 +9,11 @@
|
||||
#include "code_800029B0.h"
|
||||
#include "math_util.h"
|
||||
#include "racing/memory.h"
|
||||
#include "waypoints.h"
|
||||
#include "path.h"
|
||||
#include "render_player.h"
|
||||
#include "collision.h"
|
||||
#include "code_80057C60.h"
|
||||
#include "code_80005FD0.h"
|
||||
#include "cpu_vehicles_camera_path.h"
|
||||
#include "main.h"
|
||||
#include "spawn_players.h"
|
||||
|
||||
@@ -221,9 +221,9 @@ void func_8001CA78(UNUSED Player* player, Camera* camera, Vec3f arg2, f32* arg3,
|
||||
f32 temp_f18;
|
||||
f32 temp_f16;
|
||||
UNUSED s32 pad;
|
||||
TrackWaypoint* temp_s2;
|
||||
TrackPathPoint* temp_s2;
|
||||
|
||||
temp_s2 = &D_80164550[0][gWaypointCountByPathIndex[0] - 10];
|
||||
temp_s2 = &gTrackPaths[0][gPathCountByPathIndex[0] - 10];
|
||||
sp68[0] = camera->unk_30[0];
|
||||
sp68[1] = camera->unk_30[1];
|
||||
sp68[2] = camera->unk_30[2];
|
||||
@@ -362,7 +362,7 @@ void func_8001CCEC(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a
|
||||
arg2[0] = camera->lookAt[0];
|
||||
arg2[1] = camera->lookAt[1];
|
||||
arg2[2] = camera->lookAt[2];
|
||||
if ((player->effects & 0x01000000) == 0x01000000) {
|
||||
if ((player->effects & UNKNOWN_EFFECT_0x1000000) == UNKNOWN_EFFECT_0x1000000) {
|
||||
sp84[2] /= 3.0f;
|
||||
}
|
||||
calculate_orientation_matrix(sp9C, 0, 1, 0, arg7);
|
||||
@@ -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->unk_094 / 18) * 216) <= 5.0f) && ((player->effects & 2) == 2)) {
|
||||
if ((((player->speed / 18) * 216) <= 5.0f) && ((player->effects & 2) == 2)) {
|
||||
arg2[1] += ((y - camera->lookAt[1]) * 0.02);
|
||||
} else {
|
||||
arg2[1] += ((y - camera->lookAt[1]) * 0.5);
|
||||
@@ -383,7 +383,7 @@ void func_8001CCEC(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a
|
||||
mtxf_translate_vec3f_mat3(sp90, sp9C);
|
||||
x = player->pos[0] + sp90[0];
|
||||
z = player->pos[2] + sp90[2];
|
||||
if ((player->effects & 0x01000000) != 0x01000000) {
|
||||
if ((player->effects & UNKNOWN_EFFECT_0x1000000) != UNKNOWN_EFFECT_0x1000000) {
|
||||
var_f0 = player->pos[1] + sp90[1];
|
||||
// permute
|
||||
y = var_f0;
|
||||
@@ -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->unk_094 / 18) * 216) <= 5.0f) && ((player->effects & 2) == 2)) {
|
||||
if ((((player->speed / 18) * 216) <= 5.0f) && ((player->effects & 2) == 2)) {
|
||||
*arg4 = camera->pos[1] + (((y - camera->pos[1]) * 0.01));
|
||||
} else {
|
||||
*arg4 = camera->pos[1] + (((y - camera->pos[1]) * 0.15));
|
||||
@@ -582,7 +582,7 @@ void func_8001D944(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a
|
||||
arg2[0] = camera->lookAt[0];
|
||||
arg2[1] = camera->lookAt[1];
|
||||
arg2[2] = camera->lookAt[2];
|
||||
if ((player->effects & 0x01000000) == 0x01000000) {
|
||||
if ((player->effects & UNKNOWN_EFFECT_0x1000000) == UNKNOWN_EFFECT_0x1000000) {
|
||||
sp84[2] /= 3.0f;
|
||||
}
|
||||
calculate_orientation_matrix(sp9C, 0, 1, 0, arg7);
|
||||
@@ -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->unk_094 / 18) * 216) <= 5.0f) && ((player->effects & 2) == 2)) {
|
||||
if ((((player->speed / 18) * 216) <= 5.0f) && ((player->effects & 2) == 2)) {
|
||||
arg2[1] += ((y - camera->lookAt[1]) * 0.02);
|
||||
} else {
|
||||
arg2[1] += ((y - camera->lookAt[1]) * 0.5);
|
||||
@@ -603,7 +603,7 @@ void func_8001D944(Player* player, Camera* camera, Vec3f arg2, f32* arg3, f32* a
|
||||
mtxf_translate_vec3f_mat3(sp90, sp9C);
|
||||
x = player->pos[0] + sp90[0];
|
||||
z = player->pos[2] + sp90[2];
|
||||
if ((player->effects & 0x01000000) != 0x01000000) {
|
||||
if ((player->effects & UNKNOWN_EFFECT_0x1000000) != UNKNOWN_EFFECT_0x1000000) {
|
||||
var_f0 = player->pos[1] + sp90[1];
|
||||
// permute
|
||||
y = var_f0;
|
||||
@@ -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->unk_094 / 18) * 216) <= 5.0f) && ((player->effects & 2) == 2)) {
|
||||
if ((((player->speed / 18) * 216) <= 5.0f) && ((player->effects & 2) == 2)) {
|
||||
*arg4 = camera->pos[1] + (((y - camera->pos[1]) * 0.01));
|
||||
} else {
|
||||
*arg4 = camera->pos[1] + (((y - camera->pos[1]) * 0.15));
|
||||
@@ -704,7 +704,7 @@ void func_8001E45C(Camera* camera, Player* player, s8 arg2) {
|
||||
UNUSED s16 pad6;
|
||||
s16 temp;
|
||||
|
||||
if ((player->effects & 0x10) == 0x10) {
|
||||
if ((player->effects & UNKNOWN_EFFECT_0x10) == UNKNOWN_EFFECT_0x10) {
|
||||
var_a3 = 100;
|
||||
if (player->unk_078 == 0) {
|
||||
camera->unk_B0 = 0;
|
||||
@@ -826,7 +826,7 @@ void func_8001EA0C(Camera* camera, Player* player, s8 arg2) {
|
||||
UNUSED s16 pad6;
|
||||
s16 temp;
|
||||
|
||||
if ((player->effects & 0x10) == 0x10) {
|
||||
if ((player->effects & UNKNOWN_EFFECT_0x10) == UNKNOWN_EFFECT_0x10) {
|
||||
var_a3 = 100;
|
||||
if (player->unk_078 == 0) {
|
||||
camera->unk_B0 = 0;
|
||||
|
||||
+8
-9
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "code_800029B0.h"
|
||||
#include "memory.h"
|
||||
#include "waypoints.h"
|
||||
#include "path.h"
|
||||
#include "actors.h"
|
||||
#include "actor_types.h"
|
||||
#include "math_util.h"
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "menus.h"
|
||||
#include "data/other_textures.h"
|
||||
|
||||
extern s32 D_802BA038;
|
||||
extern s32 gDemoTimer;
|
||||
extern s16 D_802BA048;
|
||||
#if !ENABLE_CUSTOM_COURSE_ENGINE
|
||||
s16 gCurrentCourseId = 0;
|
||||
@@ -208,7 +208,7 @@ void setup_race(void) {
|
||||
gNumSpawnedShells = 0;
|
||||
D_800DC5B8 = 0;
|
||||
D_80152308 = 0;
|
||||
D_802BA038 = -1;
|
||||
gDemoTimer = -1;
|
||||
D_802BA048 = 0;
|
||||
func_802A74BC();
|
||||
set_perspective_and_aspect_ratio();
|
||||
@@ -216,15 +216,14 @@ void setup_race(void) {
|
||||
init_actors_and_load_textures();
|
||||
|
||||
if (gModeSelection != BATTLE) {
|
||||
D_8015F8D0[1] = (f32) (D_80164490->posY - 15);
|
||||
;
|
||||
D_8015F8D0[2] = D_80164490->posZ;
|
||||
D_8015F8D0[1] = (f32) (gCurrentTrackPath->posY - 15);
|
||||
D_8015F8D0[2] = gCurrentTrackPath->posZ;
|
||||
if (gCurrentCourseId == COURSE_TOADS_TURNPIKE) {
|
||||
D_8015F8D0[0] = (gIsMirrorMode != 0) ? D_80164490->posX + 138.0f : D_80164490->posX - 138.0f;
|
||||
D_8015F8D0[0] = (gIsMirrorMode != 0) ? gCurrentTrackPath->posX + 138.0f : gCurrentTrackPath->posX - 138.0f;
|
||||
} else if (gCurrentCourseId == COURSE_WARIO_STADIUM) {
|
||||
D_8015F8D0[0] = (gIsMirrorMode != 0) ? D_80164490->posX + 12.0f : D_80164490->posX - 12.0f;
|
||||
D_8015F8D0[0] = (gIsMirrorMode != 0) ? gCurrentTrackPath->posX + 12.0f : gCurrentTrackPath->posX - 12.0f;
|
||||
} else {
|
||||
D_8015F8D0[0] = D_80164490->posX;
|
||||
D_8015F8D0[0] = gCurrentTrackPath->posX;
|
||||
}
|
||||
}
|
||||
if (!gDemoMode) {
|
||||
|
||||
-7750
File diff suppressed because it is too large
Load Diff
@@ -1,413 +0,0 @@
|
||||
#ifndef CODE_80005FD0_H
|
||||
#define CODE_80005FD0_H
|
||||
|
||||
#include "vehicles.h"
|
||||
#include "camera.h"
|
||||
#include "waypoints.h"
|
||||
#include <assets/common_data.h>
|
||||
|
||||
struct struct_801642D8 {
|
||||
/* 0x0 */ u16 unk0;
|
||||
/* 0x2 */ s16 ffff;
|
||||
/* 0x4 */ s16 timer; // confirm?
|
||||
/* 0x6 */ s16 laps; // confirm?
|
||||
/* 0x8 */ s32 blank;
|
||||
/* 0xC */ s32 unkC;
|
||||
};
|
||||
|
||||
struct unexpiredActors {
|
||||
/* 0x00 */ s32 unk0;
|
||||
/* 0x04 */ s32 unk4;
|
||||
/* 0x08 */ s32 unk8;
|
||||
/* 0x0C */ u16 unkC;
|
||||
/* 0x0E */ u16 actorIndex;
|
||||
/* 0x10 */ s16 unk10;
|
||||
/* 0x12 */ // s16 compilerPadding;
|
||||
/* 0x14 */ u32 unk14;
|
||||
/* 0x18 */ s32 unk18;
|
||||
}; // size = 0x1C
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ f32 unk0;
|
||||
/* 0x04 */ f32 unk4;
|
||||
/* 0x08 */ f32 unk8;
|
||||
/* 0x0C */ f32 unkC;
|
||||
} Test; // size = 0x10
|
||||
|
||||
// Something related to CPU item usage
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 unk_00;
|
||||
/* 0x02 */ s16 actorIndex;
|
||||
/* 0x04 */ s16 unk_04;
|
||||
/* 0x06 */ s16 unk_06;
|
||||
/* 0x08 */ s16 unk_08;
|
||||
/* 0x0A */ s16 unk_0A;
|
||||
/* 0x0C */ s16 unk_0C;
|
||||
/* 0x0E */ s16 unk_0E;
|
||||
} D_801642D8_entry; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
s16 unk0;
|
||||
s16 unk2;
|
||||
s16 unk4;
|
||||
u16 unk6;
|
||||
} UnkStruct_46D0;
|
||||
|
||||
typedef struct {
|
||||
s16 x;
|
||||
s16 z;
|
||||
} Path2D;
|
||||
|
||||
/* Function Prototypes */
|
||||
s16 get_angle_between_waypoints(Vec3f, Vec3f);
|
||||
|
||||
s32 func_80006018(f32, f32, f32, f32, f32, f32, f32, f32);
|
||||
void adjust_position_by_angle(Vec3f, Vec3f, s16);
|
||||
s32 set_vehicle_render_distance_flags(Vec3f, f32, s32);
|
||||
void func_800065D0(s32, Player*);
|
||||
void set_places(void);
|
||||
|
||||
void func_800070F4(void);
|
||||
void func_800074D4(void);
|
||||
s32 func_80007BF8(u16, u16, u16, u16, u16);
|
||||
void func_80007D04(s32, Player*);
|
||||
void func_80007FA4(s32, Player*, f32);
|
||||
|
||||
void func_80008424(s32, f32, Player*);
|
||||
s32 func_800088D8(s32, s16, s16);
|
||||
void func_80008DC0(s32);
|
||||
s32 func_80008E58(s32, s32);
|
||||
void func_80008F38(s32);
|
||||
|
||||
void func_80009000(s32);
|
||||
void func_800090F0(s32, Player*);
|
||||
f32 func_80009258(s32, f32, f32);
|
||||
void func_8000929C(s32, Player*);
|
||||
void update_vehicles(void);
|
||||
void func_800098FC(s32, Player*);
|
||||
void func_800099EC(s32, Player*);
|
||||
void func_80009B60(s32);
|
||||
|
||||
void func_8000B140(s32);
|
||||
s32 func_8000B7E4(s32, u16);
|
||||
s32 func_8000B820(s32);
|
||||
f32 func_8000B874(f32, f32, u16, s32);
|
||||
void func_8000B95C(s32, u16, s32);
|
||||
void func_8000BA14(u16, f32, f32, s16);
|
||||
void func_8000BBD8(u16, f32, s16);
|
||||
s16 func_8000BD94(f32, f32, f32, s32);
|
||||
|
||||
s16 find_closest_waypoint_track_section(f32, f32, f32, u16, s32*);
|
||||
s16 func_8000C884(f32, f32, f32, s16, s32, u16);
|
||||
s16 find_closest_waypoint_with_previous_waypoint(f32, f32, f32, s16, s32);
|
||||
void func_8000CBA4(f32, f32, f32, s16*, s32);
|
||||
void func_8000CBF8(f32, f32, f32, s16*, s32);
|
||||
s16 func_8000CC88(f32, f32, f32, Player*, s32, s32*);
|
||||
s16 func_8000CD24(f32, f32, f32, s16, Player*, s32, s32);
|
||||
|
||||
s16 find_closest_vehicles_waypoint(f32, f32, f32, s16);
|
||||
s16 func_8000D24C(f32, f32, f32, s32*);
|
||||
s16 func_8000D2B4(f32, f32, f32, s16, s32);
|
||||
s16 func_8000D33C(f32, f32, f32, s16, s32);
|
||||
f32 func_8000D3B8(s32);
|
||||
void func_8000D438(s32, u16);
|
||||
s16 func_8000D6D0(Vec3f, s16*, f32, f32, s16, s16);
|
||||
s16 func_8000D940(Vec3f, s16*, f32, f32, s16);
|
||||
s16 update_vehicle_following_waypoint(Vec3f, s16*, f32);
|
||||
void set_bomb_kart_spawn_positions(void);
|
||||
void func_8000DF8C(s32);
|
||||
|
||||
s32 add_actor_in_unexpired_actor_list(s32, s16);
|
||||
s32 add_red_shell_in_unexpired_actor_list(s32);
|
||||
s32 add_green_shell_in_unexpired_actor_list(s32);
|
||||
s32 add_blue_shell_in_unexpired_actor_list(s32);
|
||||
void delete_actor_in_unexpired_actor_list(s32);
|
||||
void func_8000EEDC(void);
|
||||
void generate_player_smoke(void);
|
||||
|
||||
void func_8000F0E0(void);
|
||||
void func_8000F124(void);
|
||||
void func_8000F2BC(TrackWaypoint*, size_t);
|
||||
void func_8000F2DC(void);
|
||||
void func_8000F628(void);
|
||||
|
||||
void func_800100F0(s32);
|
||||
void func_80010218(s32);
|
||||
f32 func_80010480(s32, u16);
|
||||
void func_800107C4(s32);
|
||||
s16 func_80010CB0(s32, s32);
|
||||
void func_80010DBC(s32);
|
||||
void func_80010E6C(s32);
|
||||
f32 func_80010F40(f32, f32, f32, s32, s32);
|
||||
f32 func_80010FA0(f32, f32, f32, s32, s32);
|
||||
|
||||
s32 func_80011014(TrackWaypoint*, TrackWaypoint*, s32, s32);
|
||||
s32 process_path_data(TrackWaypoint*, TrackWaypoint*);
|
||||
s32 generate_2d_path(Path2D*, TrackWaypoint*, s32);
|
||||
void copy_courses_kart_ai_behaviour(void);
|
||||
void reset_kart_ai_behaviour_none(s32);
|
||||
void reset_kart_ai_behaviour(s32);
|
||||
void kart_ai_behaviour_start(s32, Player*);
|
||||
void kart_ai_behaviour_end(s32, Player*);
|
||||
void kart_ai_behaviour(s32);
|
||||
void func_80011EC0(s32, Player*, s32, u16);
|
||||
|
||||
void generate_train_waypoints(void);
|
||||
void generate_ferry_waypoints(void);
|
||||
void spawn_vehicle_on_road(VehicleStuff*);
|
||||
void spawn_course_vehicles(void);
|
||||
void set_vehicle_pos_waypoint(TrainCarStuff*, Path2D*, u16);
|
||||
void init_vehicles_trains(void);
|
||||
void sync_train_components(TrainCarStuff*, s16);
|
||||
void update_vehicle_trains(void);
|
||||
void func_80012DC0(s32, Player*);
|
||||
|
||||
void func_80013054(void);
|
||||
void check_ai_crossing_distance(s32);
|
||||
void init_vehicles_ferry(void);
|
||||
void update_vehicle_paddle_boats(void);
|
||||
void func_80013854(Player*);
|
||||
void initialize_toads_turnpike_vehicle(f32, f32, s32, s32, VehicleStuff*, TrackWaypoint*);
|
||||
f32 func_80013C74(s16, s16);
|
||||
void update_vehicle_follow_waypoint(VehicleStuff*);
|
||||
void func_80013F7C(s32, Player*, VehicleStuff*, f32, f32, s32, u32);
|
||||
|
||||
f32 func_800145A8(s16, f32, s16);
|
||||
void func_800146B8(s32, s32, VehicleStuff*);
|
||||
void init_vehicles_box_trucks(void);
|
||||
void update_vehicle_box_trucks(void);
|
||||
void func_800148C4(s32, Player*);
|
||||
void func_8001490C(s32);
|
||||
void init_vehicles_school_buses(void);
|
||||
void update_vehicle_school_bus(void);
|
||||
void func_80014A18(s32, Player*);
|
||||
void func_80014A60(s32);
|
||||
void init_vehicles_trucks(void);
|
||||
void update_vehicle_tanker_trucks(void);
|
||||
void func_80014B6C(s32, Player*);
|
||||
void func_80014BB4(s32);
|
||||
void init_vehicles_cars(void);
|
||||
void update_vehicle_cars(void);
|
||||
void func_80014CC0(s32, Player*);
|
||||
void func_80014D08(s32);
|
||||
void func_80014D30(s32, s32);
|
||||
void func_80014DE4(s32);
|
||||
f32 func_80014EE4(f32, s32);
|
||||
|
||||
void calculate_camera_up_vector(Camera*, s32);
|
||||
void func_8001530C(void);
|
||||
void func_80015314(s32, f32, s32);
|
||||
void func_80015390(Camera*, Player*, s32);
|
||||
void func_80015544(s32, f32, s32, s32);
|
||||
void func_8001577C(Camera*, UNUSED Player*, s32, s32);
|
||||
void func_80015A9C(s32, f32, s32, s16);
|
||||
void func_80015C94(Camera*, Player*, s32, s32);
|
||||
|
||||
void func_800162CC(s32, f32, s32, s16);
|
||||
void func_80016494(Camera*, Player*, s32, s32);
|
||||
void func_80016C3C(s32, f32, s32);
|
||||
|
||||
void func_80017720(s32, f32, s32, s16);
|
||||
void func_800178F4(Camera*, Player*, s32, s32);
|
||||
void func_80017F10(s32, f32, s32, s16);
|
||||
|
||||
void func_800180F0(Camera*, Player*, s32, s32);
|
||||
void func_80018718(s32, f32, s32, s16);
|
||||
void func_800188F4(Camera*, Player*, s32, s32);
|
||||
|
||||
void func_80019118(s32, f32, s32, s16);
|
||||
void func_8001933C(Camera*, UNUSED Player*, s32, s32);
|
||||
void func_8001968C(void);
|
||||
void func_8001969C(s32, f32, s32, s16);
|
||||
void func_80019760(Camera*, UNUSED Player*, s32, s32);
|
||||
void func_80019890(s32, s32);
|
||||
void func_80019B50(s32, u16);
|
||||
void func_80019C50(s32);
|
||||
void func_80019D2C(Camera*, Player*, s32);
|
||||
void func_80019DE4(void);
|
||||
void func_80019DF4(void);
|
||||
void func_80019E58(void);
|
||||
void func_80019ED0(void);
|
||||
void func_80019FB4(s32);
|
||||
|
||||
void func_8001A0A4(u16*, Camera*, Player*, s8, s32);
|
||||
void func_8001A0DC(u16*, Camera*, Player*, s8, s32);
|
||||
void func_8001A124(s32, s32);
|
||||
s32 func_8001A310(s32, s32);
|
||||
void func_8001A348(s32, f32, s32);
|
||||
void func_8001A3D8(s32, f32, s32);
|
||||
void func_8001A450(s32, s32, s32);
|
||||
void func_8001A518(s32, s32, s32);
|
||||
void func_8001A588(u16*, Camera*, Player*, s8, s32);
|
||||
void func_8001AAAC(s16, s16, s16);
|
||||
void func_8001AB00(void);
|
||||
void kart_ai_decisions_branch_item(s32, s16*, s32);
|
||||
void func_8001ABE0(s32, D_801642D8_entry*);
|
||||
void func_8001ABEC(struct struct_801642D8*);
|
||||
void kart_ai_use_item_strategy(s32);
|
||||
|
||||
void func_8001BE78(void);
|
||||
|
||||
void func_8001C05C(void);
|
||||
void func_8001C14C(void);
|
||||
void func_8001C3C4(s32);
|
||||
void func_8001C42C(void);
|
||||
|
||||
/* This is where I'd put my static data, if I had any */
|
||||
|
||||
extern Collision D_80162E70;
|
||||
extern s16 D_80162EB0; // Possibly a float.
|
||||
extern s16 D_80162EB2; // possibly [3]
|
||||
extern KartAIBehaviour* gCoursesKartAIBehaviour[];
|
||||
extern s16 D_80162F10[];
|
||||
extern s16 D_80162F50[];
|
||||
extern Vec3f D_80162FA0;
|
||||
extern Vec3f D_80162FB0;
|
||||
extern Vec3f D_80162FC0;
|
||||
extern s16 gTrainSmokeTimer;
|
||||
extern s16 D_80162FD0;
|
||||
extern f32 gCourseCompletionPercentByRank[]; // D_80162FD8
|
||||
extern s16 D_80162FF8[];
|
||||
extern s16 D_80163010[];
|
||||
extern f32 D_80163028[];
|
||||
extern s16 D_80163050[];
|
||||
extern f32 D_80163068[];
|
||||
extern f32 D_80163090[];
|
||||
extern s32 D_801630B8[];
|
||||
extern u16 D_801630E0;
|
||||
extern s16 D_801630E2;
|
||||
extern s16 D_801630E8[];
|
||||
extern s16 gFerrySmokeTimer;
|
||||
extern s32 D_80163100[];
|
||||
extern s32 D_80163128[];
|
||||
extern s32 D_80163150[];
|
||||
extern f32 D_80163178[];
|
||||
extern f32 D_801631A0[];
|
||||
extern s16 D_801631C8;
|
||||
extern s32 D_801631CC;
|
||||
extern TrackWaypoint* D_801631D0;
|
||||
extern TrackWaypoint* D_801631D4;
|
||||
extern s16* D_801631D8;
|
||||
extern u16 D_801631E0[];
|
||||
extern u16 D_801631F8[];
|
||||
extern f32 D_8016320C;
|
||||
extern f32 D_80163210[];
|
||||
extern s32 D_80163238;
|
||||
extern u16 D_80163240[];
|
||||
extern u16 D_80163258[];
|
||||
extern u16 D_80163270[];
|
||||
extern s32 D_80163288[];
|
||||
// Exact pointer type unknown
|
||||
extern KartAIBehaviour* sCurrentKartAIBehaviour;
|
||||
extern u16 gCurrentKartAIBehaviourId[];
|
||||
extern u16 gPreviousKartAIBehaviourId[];
|
||||
extern u16 gKartAIBehaviourState[];
|
||||
|
||||
enum { KART_AI_BEHAVIOUR_STATE_NONE, KART_AI_BEHAVIOUR_STATE_START, KART_AI_BEHAVIOUR_STATE_RUNNING };
|
||||
|
||||
extern s16 D_80163300[];
|
||||
extern u16 D_80163318[];
|
||||
extern u16 D_80163330[];
|
||||
extern u16 D_80163344[];
|
||||
extern u16 D_80163348[];
|
||||
extern u16 D_8016334C[];
|
||||
extern u16 gSpeedKartAIBehaviour[];
|
||||
|
||||
enum {
|
||||
SPEED_KART_AI_BEHAVIOUR_NORMAL,
|
||||
SPEED_KART_AI_BEHAVIOUR_FAST,
|
||||
SPEED_KART_AI_BEHAVIOUR_SLOW,
|
||||
SPEED_KART_AI_BEHAVIOUR_MAX
|
||||
};
|
||||
|
||||
extern s32 D_80163368[];
|
||||
extern s32 D_80163378;
|
||||
extern s32 D_8016337C;
|
||||
extern s16 D_80163380[];
|
||||
extern s16 D_80163398[];
|
||||
extern s16 D_801633B0[];
|
||||
extern s16 D_801633C8[];
|
||||
extern s16 D_801633E0[];
|
||||
extern s16 D_801633F8[];
|
||||
extern s16 D_80163410[];
|
||||
extern f32 D_80163418[];
|
||||
extern f32 D_80163428[];
|
||||
extern f32 D_80163438[];
|
||||
extern s32 D_80163448;
|
||||
extern f32 D_8016344C;
|
||||
extern f32 D_80163450[];
|
||||
extern s16 D_80163478;
|
||||
// 0 or 1, only 1 when when in extra (mirror) mode
|
||||
extern s16 D_8016347A;
|
||||
extern s16 D_8016347C;
|
||||
extern s16 D_8016347E;
|
||||
extern s32 D_80163480;
|
||||
extern s32 D_80163484;
|
||||
extern s32 D_80163488;
|
||||
extern s16 D_8016348C;
|
||||
extern s16 D_80163490[];
|
||||
extern s16 D_801634A8[];
|
||||
extern s16 D_801634C0[];
|
||||
extern s16 bStopAICrossing[];
|
||||
extern s16 D_801634EC;
|
||||
extern s32 D_801634F0;
|
||||
extern s32 D_801634F4;
|
||||
extern Test D_801634F8[];
|
||||
extern Path2D* gVehicle2DWaypoint;
|
||||
extern s32 gVehicle2DWaypointLength;
|
||||
extern u16 isCrossingTriggeredByIndex[];
|
||||
extern u16 sCrossingActiveTimer[];
|
||||
extern s32 D_80163DD8[];
|
||||
extern struct unexpiredActors gUnexpiredActorsList[];
|
||||
extern D_801642D8_entry D_801642D8[];
|
||||
extern s16 D_80164358;
|
||||
extern s16 D_8016435A;
|
||||
extern s16 D_8016435C;
|
||||
extern s16 gGPCurrentRacePlayerIdByRank[]; // D_80164360
|
||||
extern s16 D_80164378[];
|
||||
extern s32 gLapCountByPlayerId[]; // D_80164390
|
||||
extern s32 gGPCurrentRaceRankByPlayerId[]; // D_801643B8
|
||||
extern s32 D_801643E0[];
|
||||
extern s32 D_80164408[];
|
||||
extern u16 D_80164430;
|
||||
extern u16 gNearestWaypointByPlayerId[];
|
||||
extern s32 D_80164450[];
|
||||
extern s16 D_80164478[];
|
||||
extern s32 D_8016448C;
|
||||
extern f32 D_80164498[];
|
||||
extern f32 gLapCompletionPercentByPlayerId[]; // D_801644A8
|
||||
extern f32 gCourseCompletionPercentByPlayerId[]; // D_801644D0
|
||||
extern s16 D_801644F8[];
|
||||
extern f32 D_80164510[];
|
||||
extern s16 D_80164538[];
|
||||
extern s32 D_801645D0[];
|
||||
extern s32 D_801645E8[];
|
||||
extern f32 D_801645F8[];
|
||||
extern s32 D_80164608[];
|
||||
extern f32 D_80164618[];
|
||||
extern s32 D_80164628[];
|
||||
extern f32 D_80164638[];
|
||||
extern f32 D_80164648[];
|
||||
extern f32 D_80164658[];
|
||||
extern s16 D_80164670[];
|
||||
extern s16 D_80164678[];
|
||||
extern s16 D_80164680[];
|
||||
extern f32 D_80164688[];
|
||||
extern f32 D_80164698;
|
||||
extern f32 D_8016469C;
|
||||
extern f32 D_801646A0;
|
||||
extern s16 D_801646C0[];
|
||||
extern u32 D_801646C8;
|
||||
extern u16 D_801646CC;
|
||||
extern UnkStruct_46D0 D_801646D0[];
|
||||
|
||||
// See bss_80005FD0.s
|
||||
extern f32 gCourseCompletionPercentByRank[NUM_PLAYERS];
|
||||
extern s32 D_801643E0[];
|
||||
extern s32 D_8016448C;
|
||||
extern u16 D_801637BE;
|
||||
extern u16 D_80163E2A;
|
||||
|
||||
// extern Gfx D_0D0076F8[];
|
||||
|
||||
#endif
|
||||
+28
-21
@@ -61,6 +61,7 @@ UNUSED void func_8003DE4C(Player* player, Vec3f arg1) {
|
||||
arg1[1] = 0.0f;
|
||||
mtxf_translate_vec3f_mat3(arg1, player->orientationMatrix);
|
||||
}
|
||||
|
||||
// Stick to ground?
|
||||
void func_8003E048(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4, f32* arg5, f32* arg6, f32* arg7) {
|
||||
*arg5 += arg1[0] * player->collision.surfaceDistance[2] * 1;
|
||||
@@ -70,14 +71,15 @@ void func_8003E048(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4
|
||||
if (player->collision.orientationVector[1] <= 0.8829f) {
|
||||
arg3[0] = ((player->unk_206 / 182) * 0xB4);
|
||||
arg3[2] = (-(player->slopeAccel / 182) * 0xB4);
|
||||
decelerate_ai_player(player, 4.0f);
|
||||
decelerate_player(player, 4.0f);
|
||||
player->unk_DAC = 0.5f;
|
||||
if ((player->effects & BOOST_EFFECT) != 0) {
|
||||
remove_boost_effect(player);
|
||||
player->currentSpeed /= 2;
|
||||
player->unk_08C /= 2;
|
||||
}
|
||||
} else if ((((player->unk_094 / 18.0f) * 216.0f) > 20.0f) || ((player->effects & 0x10000) == 0x10000)) {
|
||||
} else if ((((player->speed / 18.0f) * 216.0f) > 20.0f) ||
|
||||
((player->effects & UNKNOWN_EFFECT_0x10000) == UNKNOWN_EFFECT_0x10000)) {
|
||||
arg3[0] = ((player->unk_206 / 182) * 0x32);
|
||||
arg3[2] = (-(player->slopeAccel / 182) * 0x3C);
|
||||
} else {
|
||||
@@ -96,8 +98,8 @@ void func_8003E37C(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4
|
||||
if ((player->collision.orientationVector[1] <= 0.7318f) || (player->surfaceType == CLIFF)) {
|
||||
arg3[0] = ((player->unk_206 / 182) * 0xB4);
|
||||
arg3[2] = (-(player->slopeAccel / 182) * 0xB4);
|
||||
if (((player->unk_094 / 18.0f) * 216.0f) >= 8.0f) {
|
||||
decelerate_ai_player(player, 5.0f);
|
||||
if (((player->speed / 18.0f) * 216.0f) >= 8.0f) {
|
||||
decelerate_player(player, 5.0f);
|
||||
}
|
||||
player->unk_DAC = 0.5f;
|
||||
if ((player->effects & BOOST_EFFECT) != 0) {
|
||||
@@ -105,7 +107,8 @@ void func_8003E37C(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4
|
||||
player->currentSpeed /= 2;
|
||||
player->unk_08C /= 2;
|
||||
}
|
||||
} else if ((((player->unk_094 / 18.0f) * 216.0f) > 20.0f) || ((player->effects & 0x10000) == 0x10000)) {
|
||||
} else if ((((player->speed / 18.0f) * 216.0f) > 20.0f) ||
|
||||
((player->effects & UNKNOWN_EFFECT_0x10000) == UNKNOWN_EFFECT_0x10000)) {
|
||||
arg3[0] = ((player->unk_206 / 182) * 0x32);
|
||||
arg3[2] = (-(player->slopeAccel / 182) * 0x32);
|
||||
} else {
|
||||
@@ -124,9 +127,10 @@ void func_8003E6EC(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4
|
||||
if (player->collision.orientationVector[1] <= 0.8829f) {
|
||||
arg3[0] = ((player->unk_206 / 182) * 0xB4);
|
||||
arg3[2] = (-(player->slopeAccel / 182) * 0xB4);
|
||||
decelerate_ai_player(player, 4.0f);
|
||||
decelerate_player(player, 4.0f);
|
||||
func_8003DC40(player);
|
||||
} else if ((((player->unk_094 / 18.0f) * 216.0f) > 20.0f) || ((player->effects & 0x10000) == 0x10000)) {
|
||||
} else if ((((player->speed / 18.0f) * 216.0f) > 20.0f) ||
|
||||
((player->effects & UNKNOWN_EFFECT_0x10000) == UNKNOWN_EFFECT_0x10000)) {
|
||||
arg3[0] = ((player->unk_206 / 182) * 0x32);
|
||||
arg3[2] = (-(player->slopeAccel / 182) * 0x3C);
|
||||
} else {
|
||||
@@ -145,10 +149,11 @@ void func_8003E9EC(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4
|
||||
if (player->collision.orientationVector[1] <= 0.8357f) {
|
||||
arg3[0] = ((player->unk_206 / 182) * 0x78);
|
||||
arg3[2] = (-(player->slopeAccel / 182) * 0xB4);
|
||||
decelerate_ai_player(player, 4.0f);
|
||||
decelerate_player(player, 4.0f);
|
||||
func_8003DC40(player);
|
||||
} else {
|
||||
if ((((player->unk_094 / 18.0f) * 216.0f) > 20.0f) || ((player->effects & 0x10000) == 0x10000)) {
|
||||
if ((((player->speed / 18.0f) * 216.0f) > 20.0f) ||
|
||||
((player->effects & UNKNOWN_EFFECT_0x10000) == UNKNOWN_EFFECT_0x10000)) {
|
||||
if ((player->tyres[BACK_LEFT].surfaceType == ASPHALT) ||
|
||||
(player->tyres[BACK_RIGHT].surfaceType == ASPHALT) ||
|
||||
(player->tyres[FRONT_RIGHT].surfaceType == ASPHALT) ||
|
||||
@@ -162,7 +167,7 @@ void func_8003E9EC(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4
|
||||
arg3[0] = 0.0f;
|
||||
arg3[2] = (-(player->slopeAccel / 182) * 0x32);
|
||||
}
|
||||
if ((player->effects & 0x10000) != 0) {
|
||||
if ((player->effects & UNKNOWN_EFFECT_0x10000) != 0) {
|
||||
arg3[0] = ((player->unk_206 / 182) * 0x78);
|
||||
arg3[2] = (-(player->slopeAccel / 182) * 0xB4);
|
||||
}
|
||||
@@ -179,9 +184,10 @@ void func_8003EE2C(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4
|
||||
if (player->collision.orientationVector[1] <= 0.8357f) {
|
||||
arg3[0] = ((player->unk_206 / 182) * 0x78);
|
||||
arg3[2] = (-(player->slopeAccel / 182) * 0xB4);
|
||||
decelerate_ai_player(player, 4.0f);
|
||||
decelerate_player(player, 4.0f);
|
||||
func_8003DC40(player);
|
||||
} else if ((((player->unk_094 / 18.0f) * 216.0f) > 20.0f) || ((player->effects & 0x10000) == 0x10000)) {
|
||||
} else if ((((player->speed / 18.0f) * 216.0f) > 20.0f) ||
|
||||
((player->effects & UNKNOWN_EFFECT_0x10000) == UNKNOWN_EFFECT_0x10000)) {
|
||||
arg3[0] = ((player->unk_206 / 182) * 0x32);
|
||||
arg3[2] = (-(player->slopeAccel / 182) * 0x3C);
|
||||
} else {
|
||||
@@ -203,10 +209,11 @@ void func_8003F138(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4
|
||||
if (player->collision.orientationVector[1] <= 0.8357f) {
|
||||
arg3[0] = ((player->unk_206 / 182) * 0xC8);
|
||||
arg3[2] = (-(player->slopeAccel / 182) * 0xC8);
|
||||
decelerate_ai_player(player, 4.0f);
|
||||
decelerate_player(player, 4.0f);
|
||||
player->unk_DAC = 0.5f;
|
||||
arg3[0] = 0;
|
||||
} else if ((((player->unk_094 / 18.0f) * 216.0f) > 20.0f) || ((player->effects & 0x10000) == 0x10000)) {
|
||||
} else if ((((player->speed / 18.0f) * 216.0f) > 20.0f) ||
|
||||
((player->effects & UNKNOWN_EFFECT_0x10000) == UNKNOWN_EFFECT_0x10000)) {
|
||||
arg3[0] = ((player->unk_206 / 182) * 0x78);
|
||||
arg3[2] = (-(player->slopeAccel / 182) * 0x78);
|
||||
arg3[0] = 0;
|
||||
@@ -261,7 +268,7 @@ void func_8003F46C(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4
|
||||
#else
|
||||
|
||||
#endif
|
||||
if (player->effects & 0x10000) {
|
||||
if (player->effects & UNKNOWN_EFFECT_0x10000) {
|
||||
player->unk_DAC = 0.5f;
|
||||
}
|
||||
}
|
||||
@@ -279,7 +286,7 @@ void func_8003F734(Player* player, Vec3f arg1, Vec3f arg2, f32* arg3, f32* arg4,
|
||||
*arg4 += arg1[0] * player->collision.surfaceDistance[0] * 1;
|
||||
*arg5 += arg1[1] * player->collision.surfaceDistance[0] * 0.1;
|
||||
*arg6 += arg1[2] * player->collision.surfaceDistance[0] * 1;
|
||||
if ((player->slopeAccel < 0) && (((player->unk_094 / 18.0f) * 216.0f) < 10.0f)) {
|
||||
if ((player->slopeAccel < 0) && (((player->speed / 18.0f) * 216.0f) < 10.0f)) {
|
||||
func_8002A5F4(arg1, *arg3, arg2, 2.5f, 0);
|
||||
} else {
|
||||
func_8002A5F4(arg1, *arg3, arg2, 0.5f, 0);
|
||||
@@ -289,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 & 0x10000)) && ((player->effects & 8) == 0)) {
|
||||
if ((!(player->effects & UNKNOWN_EFFECT_0x10000)) && ((player->effects & 8) == 0)) {
|
||||
arg2[1] *= -1e-05;
|
||||
}
|
||||
} else {
|
||||
@@ -302,7 +309,7 @@ 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 & 0x10000)) && ((player->effects & 8) == 0)) {
|
||||
if ((!(player->effects & UNKNOWN_EFFECT_0x10000)) && ((player->effects & 8) == 0)) {
|
||||
arg2[1] *= -1e-05;
|
||||
}
|
||||
}
|
||||
@@ -333,7 +340,7 @@ void func_8003FBAC(Player* player, Vec3f arg1, Vec3f arg2, f32* arg3, f32* arg4,
|
||||
*arg4 += arg1[0] * player->collision.surfaceDistance[1] * 1;
|
||||
*arg5 += arg1[1] * player->collision.surfaceDistance[1] * 0.1;
|
||||
*arg6 += arg1[2] * player->collision.surfaceDistance[1] * 1;
|
||||
if ((player->slopeAccel < 0) && (((player->unk_094 / 18.0f) * 216.0f) < 10.0f)) {
|
||||
if ((player->slopeAccel < 0) && (((player->speed / 18.0f) * 216.0f) < 10.0f)) {
|
||||
func_8002A5F4(arg1, *arg3, arg2, 1.5f, 0);
|
||||
} else {
|
||||
func_8002A5F4(arg1, *arg3, arg2, 0.5f, 0);
|
||||
@@ -343,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 & 0x10000)) && ((player->effects & 8) == 0)) {
|
||||
if ((!(player->effects & UNKNOWN_EFFECT_0x10000)) && ((player->effects & 8) == 0)) {
|
||||
arg2[1] *= -1e-05;
|
||||
}
|
||||
} else {
|
||||
@@ -356,7 +363,7 @@ 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 & 0x10000)) && ((player->effects & 8) == 0)) {
|
||||
if ((!(player->effects & UNKNOWN_EFFECT_0x10000)) && ((player->effects & 8) == 0)) {
|
||||
arg2[1] *= -1e-05;
|
||||
}
|
||||
}
|
||||
|
||||
+60
-57
@@ -18,7 +18,7 @@
|
||||
#include <defines.h>
|
||||
#include "math_util.h"
|
||||
#include "math_util_2.h"
|
||||
#include "code_80005FD0.h"
|
||||
#include "cpu_vehicles_camera_path.h"
|
||||
#include "render_player.h"
|
||||
#include "render_objects.h"
|
||||
#include "code_8006E9C0.h"
|
||||
@@ -785,7 +785,7 @@ void render_object_for_player(s32 cameraId) {
|
||||
render_object_leaf_particle(cameraId);
|
||||
|
||||
if (D_80165730 != 0) {
|
||||
func_80053E6C(cameraId);
|
||||
render_object_grand_prix_balloons(cameraId);
|
||||
}
|
||||
if (gModeSelection == BATTLE) {
|
||||
render_object_bomb_kart(cameraId);
|
||||
@@ -1321,7 +1321,7 @@ void func_80059D00(void) {
|
||||
}
|
||||
course_update_clouds(0);
|
||||
if (playerHUD[PLAYER_ONE].raceCompleteBool == 0) {
|
||||
func_8005C360((gPlayerOneCopy->unk_094 / 18.0f) * 216.0f);
|
||||
func_8005C360((gPlayerOneCopy->speed / 18.0f) * 216.0f);
|
||||
}
|
||||
func_8005D0FC(PLAYER_ONE);
|
||||
} else {
|
||||
@@ -2718,22 +2718,22 @@ void func_8005D18C(void) {
|
||||
}
|
||||
|
||||
void func_8005D1F4(s32 arg0) {
|
||||
s32 playerWaypoint;
|
||||
s32 bombWaypoint;
|
||||
s32 playerPathPoint;
|
||||
s32 bombPathPoint;
|
||||
s32 var_a2;
|
||||
s32 waypointDiff;
|
||||
s32 pathPointDiff;
|
||||
|
||||
if (gModeSelection == 2) {
|
||||
playerWaypoint = gNearestWaypointByPlayerId[arg0];
|
||||
playerPathPoint = gNearestPathPointByPlayerId[arg0];
|
||||
playerHUD[arg0].unk_74 = 0;
|
||||
for (var_a2 = 0; var_a2 < NUM_BOMB_KARTS_VERSUS; var_a2++) {
|
||||
if ((gBombKarts[var_a2].state == BOMB_STATE_EXPLODED) ||
|
||||
(gBombKarts[var_a2].state == BOMB_STATE_INACTIVE)) {
|
||||
continue;
|
||||
}
|
||||
bombWaypoint = gBombKarts[var_a2].waypointIndex;
|
||||
waypointDiff = bombWaypoint - playerWaypoint;
|
||||
if ((waypointDiff < -5) || (waypointDiff > 0x1E)) {
|
||||
bombPathPoint = gBombKarts[var_a2].pathPointIndex;
|
||||
pathPointDiff = bombPathPoint - playerPathPoint;
|
||||
if ((pathPointDiff < -5) || (pathPointDiff > 0x1E)) {
|
||||
continue;
|
||||
}
|
||||
playerHUD[arg0].unk_74 = 1;
|
||||
@@ -2930,7 +2930,7 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
|
||||
case DIRT:
|
||||
if ((arg1 == 0) &&
|
||||
((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) {
|
||||
if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) {
|
||||
if (((player->speed / 18.0f) * 216.0f) >= 10.0f) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType,
|
||||
(s8) var_t3);
|
||||
func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f);
|
||||
@@ -2954,7 +2954,7 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
|
||||
}
|
||||
player->unk_258[10 + arg1].unk_03A = random_int(0x0010U);
|
||||
}
|
||||
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) {
|
||||
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType,
|
||||
(s8) var_t3);
|
||||
func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f);
|
||||
@@ -2982,7 +2982,7 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
|
||||
case GRASS:
|
||||
if ((arg1 == 0) &&
|
||||
((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) {
|
||||
if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) {
|
||||
if (((player->speed / 18.0f) * 216.0f) >= 10.0f) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType,
|
||||
(s8) var_t3);
|
||||
func_8005D7D8(&player->unk_258[10 + arg1], 3, 1.0f);
|
||||
@@ -2991,7 +2991,7 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
|
||||
player->unk_258[10 + arg1].unk_03A -= arg1 * 8;
|
||||
player->unk_258[10 + arg1].unk_03C -= arg1 * 8;
|
||||
}
|
||||
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) {
|
||||
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType,
|
||||
(s8) var_t3);
|
||||
func_8005D7D8(&player->unk_258[10 + arg1], 3, 1.0f);
|
||||
@@ -3005,14 +3005,14 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
|
||||
case SAND_OFFROAD:
|
||||
if ((arg1 == 0) &&
|
||||
((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) {
|
||||
if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) {
|
||||
if (((player->speed / 18.0f) * 216.0f) >= 10.0f) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType,
|
||||
(s8) var_t3);
|
||||
func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f);
|
||||
func_8005DAD8(&player->unk_258[10 + arg1], 2, 1, 0x00A8);
|
||||
player->unk_258[10 + arg1].unk_03A = random_int(0x0010U);
|
||||
}
|
||||
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) {
|
||||
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType,
|
||||
(s8) var_t3);
|
||||
func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f);
|
||||
@@ -3023,14 +3023,14 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
|
||||
case SAND:
|
||||
if ((arg1 == 0) &&
|
||||
((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) {
|
||||
if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) {
|
||||
if (((player->speed / 18.0f) * 216.0f) >= 10.0f) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType,
|
||||
(s8) var_t3);
|
||||
func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f);
|
||||
func_8005DAD8(&player->unk_258[10 + arg1], 3, 1, 0x00A8);
|
||||
player->unk_258[10 + arg1].unk_03A = random_int(0x0010U);
|
||||
}
|
||||
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) {
|
||||
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType,
|
||||
(s8) var_t3);
|
||||
func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f);
|
||||
@@ -3041,14 +3041,14 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
|
||||
case WET_SAND:
|
||||
if ((arg1 == 0) &&
|
||||
((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) {
|
||||
if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) {
|
||||
if (((player->speed / 18.0f) * 216.0f) >= 10.0f) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType,
|
||||
(s8) var_t3);
|
||||
func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f);
|
||||
func_8005DAD8(&player->unk_258[10 + arg1], 4, 1, 0x00A8);
|
||||
player->unk_258[10 + arg1].unk_03A = random_int(0x0010U);
|
||||
}
|
||||
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) {
|
||||
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType,
|
||||
(s8) var_t3);
|
||||
func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f);
|
||||
@@ -3059,14 +3059,14 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
|
||||
case DIRT_OFFROAD:
|
||||
if ((arg1 == 0) &&
|
||||
((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) {
|
||||
if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) {
|
||||
if (((player->speed / 18.0f) * 216.0f) >= 10.0f) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType,
|
||||
(s8) var_t3);
|
||||
func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f);
|
||||
func_8005DAD8(&player->unk_258[10 + arg1], 5, 1, 0x00A8);
|
||||
player->unk_258[10 + arg1].unk_03A = random_int(0x0010U);
|
||||
}
|
||||
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) {
|
||||
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType,
|
||||
(s8) var_t3);
|
||||
func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f);
|
||||
@@ -3079,14 +3079,14 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
|
||||
case SNOW_OFFROAD:
|
||||
if ((arg1 == 0) &&
|
||||
((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) {
|
||||
if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) {
|
||||
if (((player->speed / 18.0f) * 216.0f) >= 10.0f) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType,
|
||||
(s8) var_t3);
|
||||
func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f);
|
||||
func_8005DAD8(&player->unk_258[10 + arg1], 6, 1, 0x00A8);
|
||||
player->unk_258[10 + arg1].unk_03A = random_int(0x0010U);
|
||||
}
|
||||
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) {
|
||||
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType,
|
||||
(s8) var_t3);
|
||||
func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f);
|
||||
@@ -3099,9 +3099,9 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
|
||||
case BRIDGE:
|
||||
if ((arg1 == 0) &&
|
||||
((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) {
|
||||
if (((((player->unk_094 / 18.0f) * 216.0f) >= 30.0f) &&
|
||||
if (((((player->speed / 18.0f) * 216.0f) >= 30.0f) &&
|
||||
((((player->unk_0C0 / 182) > 0x14) || ((player->unk_0C0 / 182) < (-0x14))))) ||
|
||||
((player->unk_22C - player->unk_094) >= 0.04)) {
|
||||
((player->previousSpeed - player->speed) >= 0.04)) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType,
|
||||
(s8) var_t3);
|
||||
func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f);
|
||||
@@ -3109,9 +3109,9 @@ void func_8005DAF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
|
||||
player->unk_258[10 + arg1].unk_03A = random_int(0x0010U);
|
||||
}
|
||||
} else if ((player->unk_258[10 + arg2].unk_01E > 0) &&
|
||||
(((((player->unk_094 / 18.0f) * 216.0f) >= 30.0f) &&
|
||||
(((((player->speed / 18.0f) * 216.0f) >= 30.0f) &&
|
||||
(((player->unk_0C0 / 182) >= 0x15) || ((player->unk_0C0 / 182) < -0x14))) ||
|
||||
((player->unk_22C - player->unk_094) >= 0.04))) {
|
||||
((player->previousSpeed - player->speed) >= 0.04))) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType,
|
||||
(s8) var_t3);
|
||||
func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f);
|
||||
@@ -3156,12 +3156,12 @@ void func_8005EA94(Player* player, s16 arg1, s32 arg2, s8 arg3, UNUSED s8 arg4)
|
||||
if (1) {}
|
||||
if (var_t0 == 0) {
|
||||
if ((arg1 == 0) && ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) {
|
||||
if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) {
|
||||
if (((player->speed / 18.0f) * 216.0f) >= 10.0f) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, var_t0, var_t1);
|
||||
func_8005D7D8(&player->unk_258[10 + arg1], 9, 0.8f);
|
||||
func_8005D800(&player->unk_258[10 + arg1], 0x00FFFFFF, 0x00AF);
|
||||
}
|
||||
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) {
|
||||
} else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, var_t0, var_t1);
|
||||
func_8005D7D8(&player->unk_258[10 + arg1], 9, 0.8f);
|
||||
func_8005D800(&player->unk_258[10 + arg1], 0x00FFFFFF, 0x00AF);
|
||||
@@ -3647,7 +3647,7 @@ void func_800608E0(Player* player, s16 arg1, UNUSED s32 arg2, s8 arg3, UNUSED s8
|
||||
func_8005D800(&player->unk_258[arg1], 0x00FFFFFF, 0x00CF);
|
||||
}
|
||||
func_80062B18(&sp50, &sp4C, &sp48, 0.0f, sp4C,
|
||||
((-player->unk_258[arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 10.0f) + -4.0f,
|
||||
((-player->unk_258[arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 10.0f) + -4.0f,
|
||||
-player->unk_258[arg1].unk_020, -player->unk_206 * 2);
|
||||
player->unk_258[arg1].unk_000[0] = player->pos[0] + sp50;
|
||||
player->unk_258[arg1].unk_000[2] = player->pos[2] + sp48;
|
||||
@@ -3832,8 +3832,8 @@ void func_80061754(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s32 arg3, U
|
||||
sp48 = random_int(2U);
|
||||
func_8005D794(player, &player->unk_258[0x1E + arg1], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0);
|
||||
func_8005D7D8(&player->unk_258[0x1E + arg1], 6, 1.0f);
|
||||
if ((player->effects & HIT_BY_ITEM_EFFECT) || ((player->effects) & 0x01000000) || ((player->effects) & 0x400) ||
|
||||
((player->effects) & BOO_EFFECT)) {
|
||||
if ((player->effects & HIT_BY_ITEM_EFFECT) || ((player->effects) & UNKNOWN_EFFECT_0x1000000) ||
|
||||
((player->effects) & 0x400) || ((player->effects) & BOO_EFFECT)) {
|
||||
func_8005D800(&player->unk_258[0x1E + arg1], 0x00FFFFFF, 0x00A0);
|
||||
player->unk_258[0x1E + arg1].unk_038 -= temp_s1;
|
||||
player->unk_258[0x1E + arg1].unk_03A -= temp_s1;
|
||||
@@ -4419,34 +4419,34 @@ void func_800635D4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) {
|
||||
if (player->unk_258[10 + arg1].unk_010 == 1) {
|
||||
if ((player->effects & LIGHTNING_EFFECT)) {
|
||||
func_80062B18(&sp44, &sp40, &sp3C, -2.0f, 0.0f,
|
||||
(-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16,
|
||||
(-player->unk_258[10 + arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 16,
|
||||
-player->unk_258[10 + arg1].unk_020, 2 * -player->unk_206);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->tyres[BACK_LEFT].pos[0] + sp44;
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->tyres[BACK_LEFT].pos[2] + sp3C;
|
||||
} else {
|
||||
player->unk_258[10 + arg1].unk_000[2] =
|
||||
player->tyres[BACK_LEFT].pos[2] +
|
||||
((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) *
|
||||
((-player->unk_258[10 + arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 16) *
|
||||
coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] =
|
||||
player->tyres[BACK_LEFT].pos[0] +
|
||||
((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) *
|
||||
((-player->unk_258[10 + arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 16) *
|
||||
sins(player->unk_258[10 + arg1].unk_020);
|
||||
}
|
||||
} else if ((player->effects & LIGHTNING_EFFECT)) {
|
||||
func_80062B18(&sp44, &sp40, &sp3C, 2.0f, 0.0f,
|
||||
(-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16,
|
||||
(-player->unk_258[10 + arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 16,
|
||||
-player->unk_258[10 + arg1].unk_020, 2 * -player->unk_206);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->tyres[BACK_RIGHT].pos[0] + sp44;
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->tyres[BACK_RIGHT].pos[2] + sp3C;
|
||||
} else {
|
||||
player->unk_258[10 + arg1].unk_000[2] =
|
||||
player->tyres[BACK_RIGHT].pos[2] +
|
||||
((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) *
|
||||
((-player->unk_258[10 + arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 16) *
|
||||
coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] =
|
||||
player->tyres[BACK_RIGHT].pos[0] +
|
||||
((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) *
|
||||
((-player->unk_258[10 + arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 16) *
|
||||
sins(player->unk_258[10 + arg1].unk_020);
|
||||
}
|
||||
|
||||
@@ -4557,20 +4557,20 @@ void func_80063D58(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) {
|
||||
if (player->unk_258[10 + arg1].unk_010 == 1) {
|
||||
player->unk_258[10 + arg1].unk_000[2] =
|
||||
player->tyres[BACK_LEFT].pos[2] +
|
||||
((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) *
|
||||
((-player->unk_258[10 + arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 20.0f) *
|
||||
coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] =
|
||||
player->tyres[BACK_LEFT].pos[0] +
|
||||
((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) *
|
||||
((-player->unk_258[10 + arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 20.0f) *
|
||||
sins(player->unk_258[10 + arg1].unk_020);
|
||||
} else {
|
||||
player->unk_258[10 + arg1].unk_000[2] =
|
||||
player->tyres[BACK_RIGHT].pos[2] +
|
||||
((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) *
|
||||
((-player->unk_258[10 + arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 20.0f) *
|
||||
coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] =
|
||||
player->tyres[BACK_RIGHT].pos[0] +
|
||||
((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) *
|
||||
((-player->unk_258[10 + arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 20.0f) *
|
||||
sins(player->unk_258[10 + arg1].unk_020);
|
||||
}
|
||||
|
||||
@@ -4601,11 +4601,11 @@ void func_80063FBC(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s32 arg3) {
|
||||
|
||||
if (player->unk_258[10 + arg1].unk_010 == 1) {
|
||||
func_80062B18(&sp3C, &sp34, &sp38, 3.0f, 0.0f,
|
||||
-5.5 - (player->unk_258[10 + arg1].unk_01E * (((player->unk_094 / 18.0f) * 216.0f) / 15.0f)),
|
||||
-5.5 - (player->unk_258[10 + arg1].unk_01E * (((player->speed / 18.0f) * 216.0f) / 15.0f)),
|
||||
-player->unk_258[10 + arg1].unk_020, 0);
|
||||
} else {
|
||||
func_80062B18(&sp3C, &sp34, &sp38, -3.0f, 0.0f,
|
||||
-5.5 - (player->unk_258[10 + arg1].unk_01E * (((player->unk_094 / 18.0f) * 216.0f) / 15.0f)),
|
||||
-5.5 - (player->unk_258[10 + arg1].unk_01E * (((player->speed / 18.0f) * 216.0f) / 15.0f)),
|
||||
-player->unk_258[10 + arg1].unk_020, 0);
|
||||
}
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->pos[0] + sp3C;
|
||||
@@ -4630,7 +4630,7 @@ void func_80064184(Player* player, s16 arg1, s8 arg2, UNUSED s8 arg3) {
|
||||
}
|
||||
|
||||
func_80062B18(&sp44, &sp40, &sp3C, 0.0f, sp40,
|
||||
-4.0f + ((-player->unk_258[arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 10.0f),
|
||||
-4.0f + ((-player->unk_258[arg1].unk_01E * (player->speed / 18.0f) * 216.0f) / 10.0f),
|
||||
-player->unk_258[arg1].unk_020, 2 * -player->unk_206);
|
||||
player->unk_258[arg1].unk_000[0] = player->pos[0] + sp44;
|
||||
player->unk_258[arg1].unk_000[2] = player->pos[2] + sp3C;
|
||||
@@ -5896,9 +5896,9 @@ void func_8006A7C0(Player* player, f32 arg1, f32 arg2, s8 arg3, s8 arg4) {
|
||||
UNUSED s32 stackPadding1;
|
||||
UNUSED s32 stackPadding2;
|
||||
|
||||
sp6C = (-(player->unk_094 / 18.0f) * 216.0f) / 10.0f;
|
||||
sp6C = (-(player->speed / 18.0f) * 216.0f) / 10.0f;
|
||||
if ((gPlayerBalloonStatus[arg3][arg4] & 2) != 2) {
|
||||
D_8018D650[arg3][arg4] += -0.003 + (-player->unk_094 * 0.0006);
|
||||
D_8018D650[arg3][arg4] += -0.003 + (-player->speed * 0.0006);
|
||||
if (D_8018D650[arg3][arg4] >= 0.05) {
|
||||
D_8018D650[arg3][arg4] = 0.05f;
|
||||
}
|
||||
@@ -5919,12 +5919,12 @@ void func_8006A7C0(Player* player, f32 arg1, f32 arg2, s8 arg3, s8 arg4) {
|
||||
D_8018D710[arg3][arg4] = 0.0f;
|
||||
}
|
||||
D_8018D620[arg3][arg4] = -player->rotation[1] - player->unk_0C0;
|
||||
move_s16_towards(&D_8018D890[arg3][arg4], player->unk_094 * 182.0f, 0.1f);
|
||||
move_s16_towards(&D_8018D890[arg3][arg4], player->speed * 182.0f, 0.1f);
|
||||
}
|
||||
if (D_8018D830[arg3][arg4] == 1) {
|
||||
D_8018D770[arg3][arg4] += D_8018D800[arg3][arg4] - player->unk_094;
|
||||
D_8018D770[arg3][arg4] += D_8018D800[arg3][arg4] - player->speed;
|
||||
} else {
|
||||
D_8018D770[arg3][arg4] += D_8018D800[arg3][arg4] + player->unk_094;
|
||||
D_8018D770[arg3][arg4] += D_8018D800[arg3][arg4] + player->speed;
|
||||
}
|
||||
if (D_8018D770[arg3][arg4] >= 0xB) {
|
||||
D_8018D770[arg3][arg4] = 0x000B;
|
||||
@@ -6296,7 +6296,8 @@ void func_8006C6AC(Player* player, s16 arg1, s8 arg2, s8 arg3) {
|
||||
if (player->unk_0DE & 1) {
|
||||
func_80060BCC(player, arg1, sp28, arg2_copy, arg3);
|
||||
} else if (!(player->effects & 8) && !(player->effects & 2)) {
|
||||
if (((player->effects & 0x10) == 0x10) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) {
|
||||
if (((player->effects & UNKNOWN_EFFECT_0x10) == UNKNOWN_EFFECT_0x10) &&
|
||||
((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) {
|
||||
func_8005DA30(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)) {
|
||||
@@ -6367,7 +6368,8 @@ void func_8006C9B8(Player* player, s16 arg1, s8 arg2, s8 arg3) {
|
||||
player->unk_044 &= ~0x0100;
|
||||
return;
|
||||
}
|
||||
if (((((player->unk_0CA & 0x1000) == 0x1000) || ((player->unk_0E0 < 2) && (player->effects & 0x01000000))) ||
|
||||
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)) {
|
||||
func_8006199C(player, arg1, sp28, arg2, arg3);
|
||||
@@ -6392,7 +6394,7 @@ void func_8006C9B8(Player* player, s16 arg1, s8 arg2, s8 arg3) {
|
||||
player->unk_044 &= ~0x0100;
|
||||
return;
|
||||
}
|
||||
if (((player->unk_046 & 0x20) == 0x20) && (((player->unk_094 / 18.0f) * 216.0f) >= 20.0f)) {
|
||||
if (((player->unk_046 & 0x20) == 0x20) && (((player->speed / 18.0f) * 216.0f) >= 20.0f)) {
|
||||
func_80061D4C(player, arg1, sp28, arg2, arg3);
|
||||
player->unk_046 &= ~0x0008;
|
||||
player->unk_044 &= ~0x0100;
|
||||
@@ -6459,7 +6461,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) &&
|
||||
((arg0->effects & 0x01000000) != 0x01000000)) {
|
||||
((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);
|
||||
}
|
||||
@@ -6471,7 +6473,8 @@ 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 & 0x01000000) != 0x01000000)) {
|
||||
((arg0->effects & 0x400) != 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);
|
||||
}
|
||||
@@ -6787,7 +6790,7 @@ void func_8006E058(void) {
|
||||
case TIME_TRIALS:
|
||||
func_8006E420(gPlayerOne, 0, 0);
|
||||
|
||||
if ((gPlayerTwo->type & 0x8000) == 0x8000) {
|
||||
if ((gPlayerTwo->type & PLAYER_EXISTS) == PLAYER_EXISTS) {
|
||||
func_8006E420(gPlayerTwo, 1, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
#include <mk64.h>
|
||||
|
||||
#include "code_800029B0.h"
|
||||
#include "code_80005FD0.h"
|
||||
#include "cpu_vehicles_camera_path.h"
|
||||
#include "code_80057C60.h"
|
||||
#include "code_8006E9C0.h"
|
||||
#include "code_80086E70.h"
|
||||
|
||||
+5
-7
@@ -1070,8 +1070,7 @@ void func_80089474(s32 objectIndex, s32 playerId, f32 arg2, f32 arg3, u32 soundB
|
||||
if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) {
|
||||
func_80072180();
|
||||
}
|
||||
if ((func_8008933C(player, objectIndex, arg2, arg3) >= 4.0) &&
|
||||
((player->type & PLAYER_KART_AI) != PLAYER_KART_AI)) {
|
||||
if ((func_8008933C(player, objectIndex, arg2, arg3) >= 4.0) && ((player->type & PLAYER_CPU) != PLAYER_CPU)) {
|
||||
func_800C9060(playerId, soundBits);
|
||||
}
|
||||
}
|
||||
@@ -1081,8 +1080,7 @@ void func_80089538(s32 objectIndex, s32 playerId, f32 arg2, f32 arg3, u32 soundB
|
||||
Player* player;
|
||||
|
||||
player = &gPlayerOne[playerId];
|
||||
if ((func_8008933C(player, objectIndex, arg2, arg3) >= 4.0) &&
|
||||
((player->type & PLAYER_KART_AI) != PLAYER_KART_AI)) {
|
||||
if ((func_8008933C(player, objectIndex, arg2, arg3) >= 4.0) && ((player->type & PLAYER_CPU) != PLAYER_CPU)) {
|
||||
func_800C9060((u8) playerId, soundBits);
|
||||
}
|
||||
}
|
||||
@@ -1144,7 +1142,7 @@ void func_80089820(s32 objectIndex, f32 arg1, f32 arg2, u32 arg3) {
|
||||
func_80072180();
|
||||
}
|
||||
if ((func_8008933C(player, objectIndex, arg1, arg2 * 1.1) >= 4.0) &&
|
||||
((player->type & PLAYER_KART_AI) != PLAYER_KART_AI)) {
|
||||
((player->type & PLAYER_CPU) != PLAYER_CPU)) {
|
||||
func_800C9060(var_s1, arg3);
|
||||
}
|
||||
}
|
||||
@@ -1183,7 +1181,7 @@ s32 func_80089B50(s32 objectIndex) {
|
||||
player = gPlayerOne;
|
||||
if (is_obj_flag_status_active(objectIndex, 0x00000200) != 0) {
|
||||
for (var_s1 = 0; var_s1 < D_8018D158; var_s1++, player++, test++) {
|
||||
if ((gObjectList[objectIndex].state != 0) && !(player->effects & 0x81000000) &&
|
||||
if ((gObjectList[objectIndex].state != 0) && !(player->effects & (BOO_EFFECT | UNKNOWN_EFFECT_0x1000000)) &&
|
||||
(player->type & PLAYER_EXISTS) && !(player->type & PLAYER_INVISIBLE_OR_BOMB) &&
|
||||
(has_collided_horizontally_with_player(objectIndex, player) != 0)) {
|
||||
if (!(player->effects & STAR_EFFECT)) {
|
||||
@@ -1210,7 +1208,7 @@ s32 func_80089CBC(s32 objectIndex, f32 arg1) {
|
||||
player = gPlayerOne;
|
||||
if (is_obj_flag_status_active(objectIndex, 0x00000200) != 0) {
|
||||
for (var_s1 = 0; var_s1 < D_8018D158; var_s1++, player++) {
|
||||
if ((gObjectList[objectIndex].state != 0) && !(player->effects & 0x81000000)) {
|
||||
if ((gObjectList[objectIndex].state != 0) && !(player->effects & (BOO_EFFECT | UNKNOWN_EFFECT_0x1000000))) {
|
||||
if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_INVISIBLE_OR_BOMB) &&
|
||||
(has_collided_with_player_and_within_height(objectIndex, player, arg1) != 0)) {
|
||||
if (!(player->effects & STAR_EFFECT)) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,448 @@
|
||||
#ifndef cpu_vehicles_camera_path_H
|
||||
#define cpu_vehicles_camera_path_H
|
||||
|
||||
#include "vehicles.h"
|
||||
#include "camera.h"
|
||||
#include "path.h"
|
||||
#include <assets/common_data.h>
|
||||
|
||||
struct unexpiredActors {
|
||||
/* 0x00 */ s32 unk0;
|
||||
/* 0x04 */ s32 unk4;
|
||||
/* 0x08 */ s32 unk8;
|
||||
/* 0x0C */ u16 unkC;
|
||||
/* 0x0E */ u16 actorIndex;
|
||||
/* 0x10 */ s16 unk10;
|
||||
/* 0x12 */ // s16 compilerPadding;
|
||||
/* 0x14 */ u32 unk14;
|
||||
/* 0x18 */ s32 unk18;
|
||||
}; // size = 0x1C
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ f32 current;
|
||||
/* 0x04 */ f32 target;
|
||||
/* 0x08 */ f32 step;
|
||||
/* 0x0C */ f32 unkC;
|
||||
} TrackPositionFactorInstruction; // size = 0x10
|
||||
|
||||
// Something related to CPU item usage
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 branch;
|
||||
/* 0x02 */ s16 actorIndex;
|
||||
/* 0x04 */ s16 timer; // confirm?
|
||||
/* 0x06 */ s16 numItemUse; // confirm?
|
||||
/* 0x08 */ s16 numDroppedBananaBunch;
|
||||
/* 0x0A */ s16 unk_0A;
|
||||
/* 0x0C */ s16 unk_0C;
|
||||
/* 0x0E */ s16 timeBeforeThrow;
|
||||
} CpuItemStrategyData; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
s16 unk0;
|
||||
s16 unk2;
|
||||
s16 unk4;
|
||||
u16 unk6;
|
||||
} UnkStruct_46D0;
|
||||
|
||||
typedef struct {
|
||||
s16 x;
|
||||
s16 z;
|
||||
} Path2D;
|
||||
|
||||
enum CpuItemStrategyEnum {
|
||||
CPU_STRATEGY_WAIT_NEXT_ITEM = 0,
|
||||
|
||||
CPU_STRATEGY_ITEM_BANANA,
|
||||
CPU_STRATEGY_HOLD_BANANA,
|
||||
CPU_STRATEGY_DROP_BANANA,
|
||||
|
||||
CPU_STRATEGY_ITEM_GREEN_SHELL,
|
||||
CPU_STRATEGY_HOLD_GREEN_SHELL,
|
||||
CPU_STRATEGY_THROW_GREEN_SHELL,
|
||||
|
||||
CPU_STRATEGY_ITEM_RED_SHELL,
|
||||
CPU_STRATEGY_HOLD_RED_SHELL,
|
||||
CPU_STRATEGY_THROW_RED_SHELL,
|
||||
|
||||
CPU_STRATEGY_ITEM_BANANA_BUNCH,
|
||||
CPU_STRATEGY_WAIT_INIT_BANANA_BUNCH,
|
||||
CPU_STRATEGY_DROP_BANANA_BUNCH,
|
||||
|
||||
CPU_STRATEGY_ITEM_FAKE_ITEM_BOX,
|
||||
CPU_STRATEGY_HOLD_FAKE_ITEM_BOX,
|
||||
CPU_STRATEGY_THROW_FAKE_ITEM_BOX,
|
||||
|
||||
CPU_STRATEGY_ITEM_THUNDERBOLT = 0x16,
|
||||
CPU_STRATEGY_END_THUNDERBOLT,
|
||||
|
||||
CPU_STRATEGY_ITEM_STAR = 0x19,
|
||||
CPU_STRATEGY_END_ITEM_STAR,
|
||||
|
||||
CPU_STRATEGY_ITEM_BOO,
|
||||
CPU_STRATEGY_WAIT_END_BOO,
|
||||
|
||||
CPU_STRATEGY_ITEM_MUSHROOM,
|
||||
CPU_STRATEGY_ITEM_DOUBLE_MUSHROOM,
|
||||
CPU_STRATEGY_ITEM_TRIPLE_MUSHROOM,
|
||||
CPU_STRATEGY_ITEM_SUPER_MUSHROOM,
|
||||
CPU_STRATEGY_USE_SUPER_MUSHROOM,
|
||||
|
||||
CPU_STRATEGY_THROW_BANANA,
|
||||
CPU_STRATEGY_HOLD_THROW_BANANA,
|
||||
CPU_STRATEGY_END_THROW_BANANA
|
||||
};
|
||||
|
||||
/* Function Prototypes */
|
||||
s16 get_angle_between_path(Vec3f, Vec3f);
|
||||
|
||||
s32 is_collide_with_vehicle(f32, f32, f32, f32, f32, f32, f32, f32);
|
||||
void adjust_position_by_angle(Vec3f, Vec3f, s16);
|
||||
s32 set_vehicle_render_distance_flags(Vec3f, f32, s32);
|
||||
void detect_wrong_player_direction(s32, Player*);
|
||||
void set_places(void);
|
||||
|
||||
void update_player_rankings(void);
|
||||
void set_places_end_course_with_time(void);
|
||||
s32 is_path_point_in_range(u16, u16, u16, u16, u16);
|
||||
void func_80007D04(s32, Player*);
|
||||
void func_80007FA4(s32, Player*, f32);
|
||||
|
||||
void regulate_cpu_speed(s32, f32, Player*);
|
||||
bool func_800088D8(s32, s16, s16);
|
||||
void set_current_path(s32);
|
||||
s32 update_player_path_selection(s32, s32);
|
||||
void update_player_completion(s32);
|
||||
|
||||
void yoshi_valley_cpu_path(s32);
|
||||
void update_cpu_path_completion(s32, Player*);
|
||||
f32 func_80009258(s32, f32, f32);
|
||||
void update_player_path_completion(s32, Player*);
|
||||
void update_vehicles(void);
|
||||
void play_cpu_sound_effect(s32, Player*);
|
||||
void update_player_timer_sound(s32, Player*);
|
||||
void update_player(s32);
|
||||
|
||||
void func_8000B140(s32);
|
||||
s32 are_in_curve(s32, u16);
|
||||
bool is_far_from_path(s32);
|
||||
f32 calculate_track_position_factor(f32, f32, u16, s32);
|
||||
void update_player_position_factor(s32, u16, s32);
|
||||
void calculate_track_offset_position(u16, f32, f32, s16);
|
||||
void set_track_offset_position(u16, f32, s16);
|
||||
s16 func_8000BD94(f32, f32, f32, s32);
|
||||
|
||||
s16 find_closest_pathPoint_track_section(f32, f32, f32, u16, s32*);
|
||||
s16 update_path_index_with_track(f32, f32, f32, s16, s32, u16);
|
||||
s16 update_path_index(f32, f32, f32, s16, s32);
|
||||
void tweak_path_index_wario_stadium(f32, f32, f32, s16*, s32);
|
||||
void adjust_path_at_start_line(f32, f32, f32, s16*, s32);
|
||||
s16 update_path_index_track_section(f32, f32, f32, Player*, s32, s32*);
|
||||
s16 update_player_path(f32, f32, f32, s16, Player*, s32, s32);
|
||||
|
||||
s16 find_closest_vehicles_pathPoint(f32, f32, f32, s16);
|
||||
s16 func_8000D24C(f32, f32, f32, s32*);
|
||||
s16 func_8000D2B4(f32, f32, f32, s16, s32);
|
||||
s16 func_8000D33C(f32, f32, f32, s16, s32);
|
||||
f32 cpu_track_position_factor(s32);
|
||||
void determine_ideal_cpu_position_offset(s32, u16);
|
||||
s16 func_8000D6D0(Vec3f, s16*, f32, f32, s16, s16);
|
||||
s16 func_8000D940(Vec3f, s16*, f32, f32, s16);
|
||||
s16 update_vehicle_following_path(Vec3f, s16*, f32);
|
||||
void set_bomb_kart_spawn_positions(void);
|
||||
void func_8000DF8C(s32);
|
||||
|
||||
s32 add_actor_in_unexpired_actor_list(s32, s16);
|
||||
s32 add_red_shell_in_unexpired_actor_list(s32);
|
||||
s32 add_green_shell_in_unexpired_actor_list(s32);
|
||||
s32 add_blue_shell_in_unexpired_actor_list(s32);
|
||||
void delete_actor_in_unexpired_actor_list(s32);
|
||||
void func_8000EEDC(void);
|
||||
void generate_player_smoke(void);
|
||||
|
||||
void func_8000F0E0(void);
|
||||
void func_8000F124(void);
|
||||
void clear_pathPoint(TrackPathPoint*, size_t);
|
||||
void init_course_path_point(void);
|
||||
void init_players(void);
|
||||
|
||||
void load_track_path(s32);
|
||||
void calculate_track_boundaries(s32);
|
||||
f32 calculate_track_curvature(s32, u16);
|
||||
void analize_track_section(s32);
|
||||
s16 calculate_angle_path(s32, s32);
|
||||
void analyse_angle_path(s32);
|
||||
void analisze_curved_path(s32);
|
||||
f32 func_80010F40(f32, f32, f32, s32, s32);
|
||||
f32 func_80010FA0(f32, f32, f32, s32, s32);
|
||||
|
||||
s32 func_80011014(TrackPathPoint*, TrackPathPoint*, s32, s32);
|
||||
s32 process_path_data(TrackPathPoint*, TrackPathPoint*);
|
||||
s32 generate_2d_path(Path2D*, TrackPathPoint*, s32);
|
||||
void copy_courses_cpu_behaviour(void);
|
||||
void reset_cpu_behaviour_none(s32);
|
||||
void reset_cpu_behaviour(s32);
|
||||
void cpu_behaviour_start(s32, Player*);
|
||||
void cpu_behaviour_end(s32, Player*);
|
||||
void cpu_behaviour(s32);
|
||||
void func_80011EC0(s32, Player*, s32, u16);
|
||||
|
||||
void generate_train_path(void);
|
||||
void generate_ferry_path(void);
|
||||
void spawn_vehicle_on_road(VehicleStuff*);
|
||||
void spawn_course_vehicles(void);
|
||||
void set_vehicle_pos_pathPoint(TrainCarStuff*, Path2D*, u16);
|
||||
void init_vehicles_trains(void);
|
||||
void sync_train_components(TrainCarStuff*, s16);
|
||||
void update_vehicle_trains(void);
|
||||
void handle_trains_interactions(s32, Player*);
|
||||
|
||||
void func_80013054(void);
|
||||
void check_ai_crossing_distance(s32);
|
||||
void init_vehicles_ferry(void);
|
||||
void update_vehicle_paddle_boats(void);
|
||||
void handle_paddleBoats_interactions(Player*);
|
||||
void initialize_toads_turnpike_vehicle(f32, f32, s32, s32, VehicleStuff*, TrackPathPoint*);
|
||||
f32 func_80013C74(s16, s16);
|
||||
void update_vehicle_follow_pathPoint(VehicleStuff*);
|
||||
void handle_vehicle_interactions(s32, Player*, VehicleStuff*, f32, f32, s32, u32);
|
||||
|
||||
f32 player_track_position_factor_vehicle(s16, f32, s16);
|
||||
void update_player_track_position_factor_from_vehicle(s32, s32, VehicleStuff*);
|
||||
void init_vehicles_box_trucks(void);
|
||||
void update_vehicle_box_trucks(void);
|
||||
void handle_box_trucks_interactions(s32, Player*);
|
||||
void update_player_track_position_factor_from_box_trucks(s32);
|
||||
void init_vehicles_school_buses(void);
|
||||
void update_vehicle_school_bus(void);
|
||||
void handle_school_buses_interactions(s32, Player*);
|
||||
void update_player_track_position_factor_from_buses(s32);
|
||||
void init_vehicles_trucks(void);
|
||||
void update_vehicle_tanker_trucks(void);
|
||||
void handle_tanker_trucks_interactions(s32, Player*);
|
||||
void update_player_track_position_factor_from_tanker_truck(s32);
|
||||
void init_vehicles_cars(void);
|
||||
void update_vehicle_cars(void);
|
||||
void handle_cars_interactions(s32, Player*);
|
||||
void update_player_track_position_factor_from_cars(s32);
|
||||
void func_80014D30(s32, s32);
|
||||
void func_80014DE4(s32);
|
||||
f32 func_80014EE4(f32, s32);
|
||||
|
||||
void calculate_camera_up_vector(Camera*, s32);
|
||||
void func_8001530C(void);
|
||||
void func_80015314(s32, f32, s32);
|
||||
void func_80015390(Camera*, Player*, s32);
|
||||
void func_80015544(s32, f32, s32, s32);
|
||||
void func_8001577C(Camera*, UNUSED Player*, s32, s32);
|
||||
void func_80015A9C(s32, f32, s32, s16);
|
||||
void func_80015C94(Camera*, Player*, s32, s32);
|
||||
|
||||
void func_800162CC(s32, f32, s32, s16);
|
||||
void func_80016494(Camera*, Player*, s32, s32);
|
||||
void func_80016C3C(s32, f32, s32);
|
||||
|
||||
void func_80017720(s32, f32, s32, s16);
|
||||
void func_800178F4(Camera*, Player*, s32, s32);
|
||||
void func_80017F10(s32, f32, s32, s16);
|
||||
|
||||
void func_800180F0(Camera*, Player*, s32, s32);
|
||||
void func_80018718(s32, f32, s32, s16);
|
||||
void func_800188F4(Camera*, Player*, s32, s32);
|
||||
|
||||
void func_80019118(s32, f32, s32, s16);
|
||||
void func_8001933C(Camera*, UNUSED Player*, s32, s32);
|
||||
void func_8001968C(void);
|
||||
void func_8001969C(s32, f32, s32, s16);
|
||||
void func_80019760(Camera*, UNUSED Player*, s32, s32);
|
||||
void func_80019890(s32, s32);
|
||||
void func_80019B50(s32, u16);
|
||||
void func_80019C50(s32);
|
||||
void func_80019D2C(Camera*, Player*, s32);
|
||||
void func_80019DE4(void);
|
||||
void func_80019DF4(void);
|
||||
void func_80019E58(void);
|
||||
void func_80019ED0(void);
|
||||
void func_80019FB4(s32);
|
||||
|
||||
void func_8001A0A4(u16*, Camera*, Player*, s8, s32);
|
||||
void func_8001A0DC(u16*, Camera*, Player*, s8, s32);
|
||||
void func_8001A124(s32, s32);
|
||||
s32 func_8001A310(s32, s32);
|
||||
void func_8001A348(s32, f32, s32);
|
||||
void func_8001A3D8(s32, f32, s32);
|
||||
void func_8001A450(s32, s32, s32);
|
||||
void func_8001A518(s32, s32, s32);
|
||||
void func_8001A588(u16*, Camera*, Player*, s8, s32);
|
||||
void func_8001AAAC(s16, s16, s16);
|
||||
void func_8001AB00(void);
|
||||
void cpu_decisions_branch_item(s32, s16*, s32);
|
||||
void func_8001ABE0(s32, CpuItemStrategyData*);
|
||||
void clear_expired_strategies(CpuItemStrategyData*);
|
||||
void cpu_use_item_strategy(s32);
|
||||
|
||||
void func_8001BE78(void);
|
||||
|
||||
void func_8001C05C(void);
|
||||
void func_8001C14C(void);
|
||||
void func_8001C3C4(s32);
|
||||
void func_8001C42C(void);
|
||||
|
||||
/* This is where I'd put my static data, if I had any */
|
||||
|
||||
extern Collision D_80162E70;
|
||||
extern s16 D_80162EB0; // Possibly a float.
|
||||
extern s16 D_80162EB2; // possibly [3]
|
||||
extern CPUBehaviour* gCoursesCPUBehaviour[];
|
||||
extern s16 D_80162F10[];
|
||||
extern s16 D_80162F50[];
|
||||
extern Vec3f gOffsetPosition;
|
||||
extern Vec3f D_80162FB0;
|
||||
extern Vec3f D_80162FC0;
|
||||
extern s16 gTrainSmokeTimer;
|
||||
extern s16 D_80162FD0;
|
||||
extern f32 gCourseCompletionPercentByRank[]; // D_80162FD8
|
||||
extern s16 D_80162FF8[];
|
||||
extern s16 D_80163010[];
|
||||
extern f32 cpu_TargetSpeed[];
|
||||
extern s16 gPreviousAngleSteering[];
|
||||
extern f32 gTrackPositionFactor[];
|
||||
extern f32 D_80163090[];
|
||||
extern bool gIsPlayerInCurve[];
|
||||
extern u16 gCurrentNearestPathPoint;
|
||||
extern s16 gIsPlayerNewPathPoint;
|
||||
extern s16 D_801630E8[];
|
||||
extern s16 gFerrySmokeTimer;
|
||||
extern s32 D_80163100[];
|
||||
extern s32 D_80163128[];
|
||||
extern s32 D_80163150[];
|
||||
extern f32 gPreviousPlayerAiOffsetX[];
|
||||
extern f32 gPreviousPlayerAiOffsetZ[];
|
||||
extern s16 sVehicleSoundRenderCounter;
|
||||
extern s32 D_801631CC;
|
||||
extern TrackPathPoint* gCurrentTrackLeftPath;
|
||||
extern TrackPathPoint* gCurrentTrackRightPath;
|
||||
extern s16* gCurrentTrackSectionTypesPath;
|
||||
extern u16 D_801631E0[];
|
||||
extern u16 D_801631F8[];
|
||||
extern f32 gCurrentCpuTargetSpeed;
|
||||
extern f32 gPreviousCpuTargetSpeed[];
|
||||
extern s32 D_80163238;
|
||||
extern u16 D_80163240[];
|
||||
extern u16 gWrongDirectionCounter[];
|
||||
extern u16 gIsPlayerWrongDirection[];
|
||||
extern s32 gPreviousLapProgressScore[];
|
||||
// Exact pointer type unknown
|
||||
extern CPUBehaviour* sCurrentCPUBehaviour;
|
||||
extern u16 gCurrentCPUBehaviourId[];
|
||||
extern u16 gPreviousCPUBehaviourId[];
|
||||
extern u16 cpu_BehaviourState[];
|
||||
|
||||
enum { cpu_BEHAVIOUR_STATE_NONE, cpu_BEHAVIOUR_STATE_START, cpu_BEHAVIOUR_STATE_RUNNING };
|
||||
|
||||
extern s16 sPlayerAngle[];
|
||||
extern u16 gPlayersTrackSectionId[];
|
||||
extern u16 D_80163330[];
|
||||
extern u16 D_80163344[];
|
||||
extern u16 D_80163348[];
|
||||
extern u16 D_8016334C[];
|
||||
extern u16 gSpeedCPUBehaviour[];
|
||||
|
||||
enum { SPEED_cpu_BEHAVIOUR_NORMAL, SPEED_cpu_BEHAVIOUR_FAST, SPEED_cpu_BEHAVIOUR_SLOW, SPEED_cpu_BEHAVIOUR_MAX };
|
||||
|
||||
extern s32 D_80163368[];
|
||||
extern s32 gIncrementUpdatePlayer;
|
||||
extern s32 D_8016337C;
|
||||
extern s16 gCurrentPlayerLookAhead[];
|
||||
extern s16 D_80163398[];
|
||||
extern s16 D_801633B0[];
|
||||
extern s16 D_801633C8[];
|
||||
extern s16 D_801633E0[];
|
||||
extern s16 D_801633F8[];
|
||||
extern s16 D_80163410[];
|
||||
extern f32 D_80163418[];
|
||||
extern f32 D_80163428[];
|
||||
extern f32 D_80163438[];
|
||||
extern s32 gPlayerPathIndex;
|
||||
extern f32 gPathStartZ;
|
||||
extern f32 gPreviousPlayerZ[];
|
||||
extern s16 gBestRankedHumanPlayer;
|
||||
// 0 or 1, only 1 when when in extra (mirror) mode
|
||||
extern s16 gIsInExtra;
|
||||
extern s16 D_8016347C;
|
||||
extern s16 D_8016347E;
|
||||
extern s32 D_80163480;
|
||||
extern s32 D_80163484;
|
||||
extern s32 D_80163488;
|
||||
extern s16 D_8016348C;
|
||||
extern s16 cpu_enteringPathIntersection[];
|
||||
extern s16 cpu_exitingPathIntersection[];
|
||||
extern s16 D_801634C0[];
|
||||
extern s16 bStopAICrossing[];
|
||||
extern s16 D_801634EC;
|
||||
extern s32 D_801634F0;
|
||||
extern s32 D_801634F4;
|
||||
extern TrackPositionFactorInstruction gPlayerTrackPositionFactorInstruction[];
|
||||
extern Path2D* gVehicle2DPathPoint;
|
||||
extern s32 gVehicle2DPathLength;
|
||||
extern u16 isCrossingTriggeredByIndex[];
|
||||
extern u16 sCrossingActiveTimer[];
|
||||
extern s32 D_80163DD8[];
|
||||
extern struct unexpiredActors gUnexpiredActorsList[];
|
||||
extern CpuItemStrategyData cpu_ItemStrategy[];
|
||||
extern s16 D_80164358;
|
||||
extern s16 D_8016435A;
|
||||
extern s16 D_8016435C;
|
||||
extern s16 gGPCurrentRacePlayerIdByRank[]; // D_80164360
|
||||
extern s16 D_80164378[];
|
||||
extern s32 gLapCountByPlayerId[]; // D_80164390
|
||||
extern s32 gGPCurrentRaceRankByPlayerId[]; // D_801643B8
|
||||
extern s32 gPreviousGPCurrentRaceRankByPlayerId[];
|
||||
extern s32 gGPCurrentRaceRankByPlayerIdDup[];
|
||||
extern u16 gSelectedPathCount;
|
||||
extern u16 gNearestPathPointByPlayerId[];
|
||||
extern s32 gNumPathPointsTraversed[];
|
||||
extern s16 gGetPlayerByCharacterId[];
|
||||
extern s32 D_8016448C;
|
||||
extern f32 D_80164498[];
|
||||
extern f32 gLapCompletionPercentByPlayerId[]; // D_801644A8
|
||||
extern f32 gCourseCompletionPercentByPlayerId[]; // D_801644D0
|
||||
extern s16 bInMultiPathSection[];
|
||||
extern f32 gPlayerPathY[];
|
||||
extern s16 D_80164538[];
|
||||
extern s32 D_801645D0[];
|
||||
extern s32 D_801645E8[];
|
||||
extern f32 D_801645F8[];
|
||||
extern s32 D_80164608[];
|
||||
extern f32 D_80164618[];
|
||||
extern s32 D_80164628[];
|
||||
extern f32 D_80164638[];
|
||||
extern f32 D_80164648[];
|
||||
extern f32 D_80164658[];
|
||||
extern s16 D_80164670[];
|
||||
extern s16 D_80164678[];
|
||||
extern s16 D_80164680[];
|
||||
extern f32 D_80164688[];
|
||||
extern f32 D_80164698;
|
||||
extern f32 D_8016469C;
|
||||
extern f32 D_801646A0;
|
||||
extern s16 D_801646C0[];
|
||||
extern u32 D_801646C8;
|
||||
extern u16 D_801646CC;
|
||||
extern UnkStruct_46D0 D_801646D0[];
|
||||
|
||||
// See bss_80005FD0.s
|
||||
extern f32 gCourseCompletionPercentByRank[NUM_PLAYERS];
|
||||
extern s32 gPreviousGPCurrentRaceRankByPlayerId[];
|
||||
extern s32 D_8016448C;
|
||||
extern u16 D_801637BE;
|
||||
extern u16 D_80163E2A;
|
||||
|
||||
#define SEVERE_WRONG_DIRECTION_MIN 136
|
||||
#define SEVERE_WRONG_DIRECTION_MAX 225
|
||||
#define SEVERE_CORRECT_DIRECTION_MIN 45
|
||||
#define SEVERE_CORRECT_DIRECTION_MAX 316
|
||||
#define WRONG_DIRECTION_FRAMES_LIMIT 5
|
||||
|
||||
// extern Gfx D_0D0076F8[];
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,112 @@
|
||||
s32 add_actor_in_unexpired_actor_list(s32 actorIndex, s16 arg1) {
|
||||
s32 i;
|
||||
s32 a2 = 0;
|
||||
|
||||
for (i = 0; i < NUM_PLAYERS; i++) {
|
||||
|
||||
if (gUnexpiredActorsList[i].unkC == 0) {
|
||||
gUnexpiredActorsList[i].unkC = 1;
|
||||
gUnexpiredActorsList[i].actorIndex = actorIndex;
|
||||
gUnexpiredActorsList[i].unk10 = arg1;
|
||||
gUnexpiredActorsList[i].unk14 = 0;
|
||||
a2 = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (a2 == 0) {
|
||||
return -2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 add_red_shell_in_unexpired_actor_list(s32 actorIndex) {
|
||||
struct Actor* actor = &gActorList[actorIndex];
|
||||
if (actor->type != ACTOR_RED_SHELL) {
|
||||
return -1;
|
||||
}
|
||||
return add_actor_in_unexpired_actor_list(actorIndex, 0);
|
||||
}
|
||||
|
||||
s32 add_green_shell_in_unexpired_actor_list(s32 actorIndex) {
|
||||
struct Actor* actor = &gActorList[actorIndex];
|
||||
if (actor->type != ACTOR_GREEN_SHELL) {
|
||||
return -1;
|
||||
}
|
||||
return add_actor_in_unexpired_actor_list(actorIndex, 1);
|
||||
}
|
||||
|
||||
s32 add_blue_shell_in_unexpired_actor_list(s32 arg0) {
|
||||
struct Actor* actor = &gActorList[arg0];
|
||||
if (actor->type != ACTOR_BLUE_SPINY_SHELL) {
|
||||
return -1;
|
||||
}
|
||||
return add_actor_in_unexpired_actor_list(arg0, 2);
|
||||
}
|
||||
|
||||
void delete_actor_in_unexpired_actor_list(s32 actorIndex) {
|
||||
struct unexpiredActors* phi;
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < NUM_PLAYERS; i++) {
|
||||
phi = &gUnexpiredActorsList[i];
|
||||
if (actorIndex == phi->actorIndex) {
|
||||
phi->unkC = 0;
|
||||
phi->actorIndex = 1000; // out of bounds
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_8000EEDC(void) {
|
||||
struct unexpiredActors* phi;
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < NUM_PLAYERS; i++) {
|
||||
phi = &gUnexpiredActorsList[i];
|
||||
phi->unkC = 0;
|
||||
phi->actorIndex = 1000; // out of bounds
|
||||
}
|
||||
}
|
||||
|
||||
void generate_player_smoke(void) {
|
||||
s32 someIndex;
|
||||
f32 var_f20;
|
||||
struct Actor* temp_s1;
|
||||
struct unexpiredActors* var_s0;
|
||||
|
||||
for (someIndex = 0; someIndex < NUM_PLAYERS; someIndex++) {
|
||||
var_s0 = &gUnexpiredActorsList[someIndex];
|
||||
if (var_s0->unkC == 1) {
|
||||
temp_s1 = &gActorList[var_s0->actorIndex];
|
||||
var_s0->unk14++;
|
||||
switch (var_s0->unk10) {
|
||||
case 0:
|
||||
if (var_s0->unk14 < 0xA) {
|
||||
var_f20 = 0.3f;
|
||||
} else {
|
||||
var_f20 = 0.9f;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (var_s0->unk14 < 0xA) {
|
||||
var_f20 = 0.15f;
|
||||
} else {
|
||||
var_f20 = 0.45f;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (var_s0->unk14 < 0xA) {
|
||||
var_f20 = 0.15f;
|
||||
} else {
|
||||
var_f20 = 0.45f;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
var_f20 = 1.0f;
|
||||
break;
|
||||
}
|
||||
if (!(var_s0->unk14 & 1)) {
|
||||
init_smoke_particle(temp_s1->pos, ((random_int(30) + 20) * var_f20) / 50.0f, var_s0->unk10);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
void copy_courses_cpu_behaviour(void) {
|
||||
s32 i;
|
||||
for (i = 0; i < NUM_COURSES - 1; i++) {
|
||||
gCoursesCPUBehaviour[i] = GET_COURSE_AIBehaviour;
|
||||
}
|
||||
}
|
||||
|
||||
void reset_cpu_behaviour_none(s32 playerIndex) {
|
||||
gCurrentCPUBehaviourId[playerIndex] = 0;
|
||||
gPreviousCPUBehaviourId[playerIndex] = 0;
|
||||
cpu_BehaviourState[playerIndex] = cpu_BEHAVIOUR_STATE_NONE;
|
||||
}
|
||||
|
||||
void reset_cpu_behaviour(s32 playerIndex) {
|
||||
gCurrentCPUBehaviourId[playerIndex] = 0;
|
||||
gPreviousCPUBehaviourId[playerIndex] = 0;
|
||||
cpu_BehaviourState[playerIndex] = cpu_BEHAVIOUR_STATE_START;
|
||||
}
|
||||
|
||||
void cpu_behaviour_start(s32 playerId, Player* player) {
|
||||
u16 playerPathPoint;
|
||||
s16 pathPointStart;
|
||||
s16 pathPointEnd;
|
||||
s32 behaviourType;
|
||||
UNUSED s32 test;
|
||||
|
||||
sCurrentCPUBehaviour = &gCoursesCPUBehaviour[gCurrentCourseId][gCurrentCPUBehaviourId[playerId]];
|
||||
|
||||
playerPathPoint = gNearestPathPointByPlayerId[playerId];
|
||||
|
||||
pathPointStart = sCurrentCPUBehaviour->pathPointStart;
|
||||
pathPointEnd = sCurrentCPUBehaviour->pathPointEnd;
|
||||
behaviourType = sCurrentCPUBehaviour->type;
|
||||
|
||||
if ((pathPointStart == -1) && (pathPointEnd == -1)) {
|
||||
sCurrentCPUBehaviour = &gCoursesCPUBehaviour[gCurrentCourseId][0];
|
||||
reset_cpu_behaviour_none(playerId);
|
||||
return;
|
||||
}
|
||||
if ((u32) playerPathPoint == (u32) pathPointStart) {
|
||||
cpu_BehaviourState[playerId] = cpu_BEHAVIOUR_STATE_RUNNING;
|
||||
gPreviousCPUBehaviourId[playerId] = gCurrentCPUBehaviourId[playerId];
|
||||
gCurrentCPUBehaviourId[playerId]++;
|
||||
switch (behaviourType) {
|
||||
case BEHAVIOUR_1:
|
||||
func_80011EC0(playerId, player, player->unk_07C >> 0x10, playerPathPoint);
|
||||
break;
|
||||
case BEHAVIOUR_HOP:
|
||||
kart_hop(player);
|
||||
player->effects &= ~0x10;
|
||||
D_801630E8[playerId] = 0;
|
||||
break;
|
||||
case BEHAVIOUR_DRIVE_CENTER:
|
||||
gPlayerTrackPositionFactorInstruction[playerId].target = 0.0f;
|
||||
break;
|
||||
case BEHAVIOUR_DRIVE_LEFT:
|
||||
gPlayerTrackPositionFactorInstruction[playerId].target = -0.6f;
|
||||
break;
|
||||
case BEHAVIOUR_DRIVE_OUTER:
|
||||
gPlayerTrackPositionFactorInstruction[playerId].target = 0.6f;
|
||||
break;
|
||||
case BEHAVIOUR_NORMAL_SPEED:
|
||||
gSpeedCPUBehaviour[playerId] = SPEED_cpu_BEHAVIOUR_NORMAL;
|
||||
break;
|
||||
case BEHAVIOUR_FAST_SPEED:
|
||||
gSpeedCPUBehaviour[playerId] = SPEED_cpu_BEHAVIOUR_FAST;
|
||||
break;
|
||||
case BEHAVIOUR_SLOW_SPEED:
|
||||
gSpeedCPUBehaviour[playerId] = SPEED_cpu_BEHAVIOUR_SLOW;
|
||||
break;
|
||||
case BEHAVIOUR_MAX_SPEED:
|
||||
gSpeedCPUBehaviour[playerId] = SPEED_cpu_BEHAVIOUR_MAX;
|
||||
break;
|
||||
case BEHAVIOUR_9:
|
||||
D_801633F8[playerId] = 1;
|
||||
D_801631E0[playerId] = false;
|
||||
gPlayers[playerId].effects &= ~UNKNOWN_EFFECT_0x1000;
|
||||
break;
|
||||
case BEHAVIOUR_10:
|
||||
D_801633F8[playerId] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cpu_behaviour_end(s32 playerIndex, Player* player) {
|
||||
u16 nearestPathPoint;
|
||||
u32 pathPointEnd;
|
||||
s32 behaviourType;
|
||||
|
||||
sCurrentCPUBehaviour = &gCoursesCPUBehaviour[gCurrentCourseId][gPreviousCPUBehaviourId[playerIndex]];
|
||||
nearestPathPoint = gNearestPathPointByPlayerId[playerIndex];
|
||||
behaviourType = sCurrentCPUBehaviour->type;
|
||||
pathPointEnd = sCurrentCPUBehaviour->pathPointEnd;
|
||||
if (nearestPathPoint >= pathPointEnd) {
|
||||
switch (behaviourType) {
|
||||
case BEHAVIOUR_1:
|
||||
player->effects &= ~0x10;
|
||||
D_801630E8[playerIndex] = 0;
|
||||
cpu_BehaviourState[playerIndex] = cpu_BEHAVIOUR_STATE_START;
|
||||
break;
|
||||
case BEHAVIOUR_DRIVE_CENTER:
|
||||
case BEHAVIOUR_DRIVE_LEFT:
|
||||
case BEHAVIOUR_DRIVE_OUTER:
|
||||
gPlayerTrackPositionFactorInstruction[playerIndex].target =
|
||||
gPlayerTrackPositionFactorInstruction[playerIndex].unkC;
|
||||
cpu_BehaviourState[playerIndex] = cpu_BEHAVIOUR_STATE_START;
|
||||
break;
|
||||
case BEHAVIOUR_HOP:
|
||||
case BEHAVIOUR_NORMAL_SPEED:
|
||||
case BEHAVIOUR_FAST_SPEED:
|
||||
case BEHAVIOUR_SLOW_SPEED:
|
||||
case BEHAVIOUR_9:
|
||||
case BEHAVIOUR_10:
|
||||
case BEHAVIOUR_MAX_SPEED:
|
||||
cpu_BehaviourState[playerIndex] = cpu_BEHAVIOUR_STATE_START;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cpu_behaviour(s32 playerIndex) {
|
||||
Player* player = gPlayerOne + playerIndex;
|
||||
|
||||
switch (cpu_BehaviourState[playerIndex]) {
|
||||
case cpu_BEHAVIOUR_STATE_NONE:
|
||||
break;
|
||||
case cpu_BEHAVIOUR_STATE_START:
|
||||
cpu_behaviour_start(playerIndex, player);
|
||||
break;
|
||||
case cpu_BEHAVIOUR_STATE_RUNNING:
|
||||
cpu_behaviour_end(playerIndex, player);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80011EC0(s32 arg0, Player* player, s32 arg2, UNUSED u16 arg3) {
|
||||
if ((((player->speed / 18.0f) * 216.0f) >= 45.0f) && (D_801630E8[arg0] == 0)) {
|
||||
switch (gCurrentTrackSectionTypesPath[sSomeNearestPathPoint]) {
|
||||
case RIGHT_LEANING_CURVE:
|
||||
case RIGHT_CURVE:
|
||||
if ((arg2 >= -9) && (D_80162FF8[arg0] == 0)) {
|
||||
if ((gTrackPositionFactor[arg0] > -0.8) && (gTrackPositionFactor[arg0] < 0.5)) {
|
||||
kart_hop(player);
|
||||
player->effects |= UNKNOWN_EFFECT_0x10;
|
||||
D_801630E8[arg0] = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
D_801630E8[arg0] = 2;
|
||||
break;
|
||||
case LEFT_LEANING_CURVE:
|
||||
case LEFT_CURVE:
|
||||
if ((arg2 < 0xA) && (D_80162FF8[arg0] == 0)) {
|
||||
if ((gTrackPositionFactor[arg0] > -0.5) && (gTrackPositionFactor[arg0] < 0.8)) {
|
||||
kart_hop(player);
|
||||
player->effects |= UNKNOWN_EFFECT_0x10;
|
||||
D_801630E8[arg0] = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
D_801630E8[arg0] = -2;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
D_801630E8[arg0] = 3;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,324 @@
|
||||
void set_bomb_kart_spawn_positions(void) {
|
||||
UNUSED Collision* var_s2;
|
||||
f32 startingXPos;
|
||||
f32 startingZPos;
|
||||
f32 startingYPos;
|
||||
s32 var_s3;
|
||||
TrackPathPoint* temp_v0;
|
||||
UNUSED BombKart* var_s0;
|
||||
BombKartSpawn* bombKartSpawn;
|
||||
|
||||
for (var_s3 = 0; var_s3 < NUM_BOMB_KARTS_VERSUS; var_s3++) {
|
||||
bombKartSpawn = &gBombKartSpawns[gCurrentCourseId][var_s3];
|
||||
switch (gCurrentCourseId) {
|
||||
case COURSE_YOSHI_VALLEY:
|
||||
startingXPos = bombKartSpawn->startingXPos;
|
||||
startingZPos = bombKartSpawn->startingZPos;
|
||||
startingYPos = get_surface_height(startingXPos, 2000.0f, startingZPos);
|
||||
break;
|
||||
case COURSE_AWARD_CEREMONY:
|
||||
temp_v0 = &gTrackPaths[3][bombKartSpawn->pathPointIndex];
|
||||
startingXPos = temp_v0->posX;
|
||||
startingYPos = temp_v0->posY;
|
||||
startingZPos = temp_v0->posZ;
|
||||
break;
|
||||
default:
|
||||
temp_v0 = &gTrackPaths[0][bombKartSpawn->pathPointIndex];
|
||||
startingXPos = temp_v0->posX;
|
||||
startingYPos = temp_v0->posY;
|
||||
startingZPos = temp_v0->posZ;
|
||||
break;
|
||||
}
|
||||
gBombKarts[var_s3].bombPos[0] = startingXPos;
|
||||
gBombKarts[var_s3].bombPos[1] = startingYPos;
|
||||
gBombKarts[var_s3].bombPos[2] = startingZPos;
|
||||
gBombKarts[var_s3].wheel1Pos[0] = startingXPos;
|
||||
gBombKarts[var_s3].wheel1Pos[1] = startingYPos;
|
||||
gBombKarts[var_s3].wheel1Pos[2] = startingZPos;
|
||||
gBombKarts[var_s3].wheel2Pos[0] = startingXPos;
|
||||
gBombKarts[var_s3].wheel2Pos[1] = startingYPos;
|
||||
gBombKarts[var_s3].wheel2Pos[2] = startingZPos;
|
||||
gBombKarts[var_s3].wheel3Pos[0] = startingXPos;
|
||||
gBombKarts[var_s3].wheel3Pos[1] = startingYPos;
|
||||
gBombKarts[var_s3].wheel3Pos[2] = startingZPos;
|
||||
gBombKarts[var_s3].wheel4Pos[0] = startingXPos;
|
||||
gBombKarts[var_s3].wheel4Pos[1] = startingYPos;
|
||||
gBombKarts[var_s3].wheel4Pos[2] = startingZPos;
|
||||
gBombKarts[var_s3].pathPointIndex = bombKartSpawn->pathPointIndex;
|
||||
gBombKarts[var_s3].unk_3C = bombKartSpawn->unk_04;
|
||||
gBombKarts[var_s3].bounceTimer = 0;
|
||||
gBombKarts[var_s3].circleTimer = 0;
|
||||
gBombKarts[var_s3].state = bombKartSpawn->startingState;
|
||||
gBombKarts[var_s3].unk_4A = 0;
|
||||
gBombKarts[var_s3].unk_4C = 1;
|
||||
gBombKarts[var_s3].yPos = startingYPos;
|
||||
check_bounding_collision(&D_80164038[var_s3], 2.0f, startingXPos, startingYPos, startingZPos);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8000DF8C(s32 bombKartId) {
|
||||
UNUSED s32 stackPadding0;
|
||||
f32 sp118;
|
||||
f32 var_f18;
|
||||
TrackPathPoint* temp_v0_2;
|
||||
f32 temp_f0_3;
|
||||
f32 sp108;
|
||||
UNUSED s32 stackPadding1;
|
||||
UNUSED s32 stackPadding2;
|
||||
UNUSED s32 stackPadding3;
|
||||
f32 temp_f14;
|
||||
UNUSED s32 stackPadding4;
|
||||
f32 temp_f16;
|
||||
UNUSED s32 stackPadding5;
|
||||
UNUSED s32 stackPadding6;
|
||||
UNUSED s32 stackPadding7;
|
||||
UNUSED s32 stackPadding8;
|
||||
UNUSED s32 stackPadding9;
|
||||
UNUSED s32 stackPaddingA;
|
||||
UNUSED s32 stackPaddingB;
|
||||
f32 temp_f0;
|
||||
f32 temp_f0_4;
|
||||
u16 spCA;
|
||||
f32 spC4;
|
||||
u16 spC2;
|
||||
f32 temp_f12;
|
||||
f32 temp_f12_3;
|
||||
f32 temp_f12_4;
|
||||
f32 temp_f14_2;
|
||||
f32 spAC;
|
||||
UNUSED s32 stackPaddingC;
|
||||
f32 temp_f16_2;
|
||||
f32 spA0;
|
||||
f32 temp_f2;
|
||||
f32 temp_f2_4;
|
||||
f32 sp94;
|
||||
UNUSED s32 stackPaddingD;
|
||||
f32 var_f20;
|
||||
f32 sp88;
|
||||
f32 var_f22;
|
||||
f32 var_f24;
|
||||
u16 sp7E;
|
||||
u16 sp7C;
|
||||
UNUSED u16 sp4C;
|
||||
u16 temp_t6;
|
||||
u16 temp_t7;
|
||||
u16 var_s1;
|
||||
s32 var_a0;
|
||||
UNUSED s32 stackPaddingE;
|
||||
TrackPathPoint* temp_v0_4;
|
||||
BombKart* bombKart;
|
||||
BombKart* bombKart2;
|
||||
Collision* temp_a0_4;
|
||||
Player* var_v0;
|
||||
|
||||
bombKart = &gBombKarts[bombKartId];
|
||||
|
||||
sp7E = bombKart->state;
|
||||
|
||||
if (sp7E == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (((bombKart->unk_4A != 1) || (gCurrentCourseId == COURSE_AWARD_CEREMONY))) {
|
||||
var_f22 = bombKart->bombPos[0];
|
||||
var_f20 = bombKart->bombPos[1];
|
||||
var_f24 = bombKart->bombPos[2];
|
||||
spCA = bombKart->pathPointIndex;
|
||||
spC4 = bombKart->unk_3C;
|
||||
spC2 = bombKart->someRot;
|
||||
sp7C = bombKart->bounceTimer;
|
||||
var_s1 = bombKart->circleTimer;
|
||||
if ((sp7E != 0) && (sp7E != 4)) {
|
||||
if (1) {}
|
||||
if (gCurrentCourseId == COURSE_AWARD_CEREMONY) {
|
||||
if (D_8016347E == 1) {
|
||||
var_v0 = gPlayerFour;
|
||||
temp_f0 = var_f22 - var_v0->pos[0];
|
||||
temp_f2 = var_f20 - var_v0->pos[1];
|
||||
temp_f12 = var_f24 - var_v0->pos[2];
|
||||
if ((((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) + (temp_f12 * temp_f12)) < 25.0f) {
|
||||
var_s1 = 0;
|
||||
sp7E = 4;
|
||||
var_v0->soundEffects |= 0x400000;
|
||||
var_v0->type &= ~0x2000;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
for (var_a0 = 0; var_a0 < gPlayerCount; var_a0++) {
|
||||
var_v0 = &gPlayers[var_a0];
|
||||
if (!(var_v0->effects & 0x80000000)) {
|
||||
temp_f0 = var_f22 - var_v0->pos[0];
|
||||
temp_f2 = var_f20 - var_v0->pos[1];
|
||||
temp_f12 = var_f24 - var_v0->pos[2];
|
||||
if ((((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) + (temp_f12 * temp_f12)) < 25.0f) {
|
||||
sp7E = 4;
|
||||
var_s1 = 0;
|
||||
if (gCurrentCourseId == COURSE_FRAPPE_SNOWLAND) {
|
||||
var_v0->soundEffects |= 0x01000000;
|
||||
} else {
|
||||
var_v0->soundEffects |= 0x400000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
switch (sp7E) {
|
||||
case 1:
|
||||
var_s1 = (var_s1 + 356) % 360;
|
||||
temp_t6 = (var_s1 * 0xFFFF) / 360;
|
||||
sp118 = coss(temp_t6) * 25.0;
|
||||
temp_f0_3 = sins(temp_t6) * 25.0;
|
||||
temp_v0_2 = &gTrackPaths[0][spCA];
|
||||
var_f22 = temp_v0_2->posX + sp118;
|
||||
var_f20 = bombKart->yPos + 3.5f;
|
||||
var_f24 = temp_v0_2->posZ + temp_f0_3;
|
||||
D_80162FB0[0] = var_f22;
|
||||
D_80162FB0[1] = var_f20;
|
||||
D_80162FB0[2] = var_f24;
|
||||
temp_t7 = (((var_s1 + 1) % 360) * 0xFFFF) / 360;
|
||||
sp118 = coss(temp_t7) * 25.0;
|
||||
temp_f0_3 = sins(temp_t7) * 25.0;
|
||||
D_80162FC0[0] = temp_v0_2->posX + sp118;
|
||||
D_80162FC0[1] = temp_v0_2->posY;
|
||||
D_80162FC0[2] = temp_v0_2->posZ + temp_f0_3;
|
||||
spC2 = (get_angle_between_two_vectors(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520;
|
||||
break;
|
||||
case 2:
|
||||
var_s1 = (var_s1 + 4) % 360;
|
||||
temp_t6 = (var_s1 * 0xFFFF) / 360;
|
||||
sp118 = coss(temp_t6) * 25.0;
|
||||
temp_f0_3 = sins(temp_t6) * 25.0;
|
||||
temp_v0_2 = &gTrackPaths[0][spCA];
|
||||
var_f22 = temp_v0_2->posX + sp118;
|
||||
var_f20 = bombKart->yPos + 3.5f;
|
||||
var_f24 = temp_v0_2->posZ + temp_f0_3;
|
||||
D_80162FB0[0] = var_f22;
|
||||
D_80162FB0[1] = var_f20;
|
||||
D_80162FB0[2] = var_f24;
|
||||
temp_t7 = (((var_s1 + 1) % 360) * 0xFFFF) / 360;
|
||||
sp118 = coss(temp_t7) * 25.0;
|
||||
temp_f0_3 = sins(temp_t7) * 25.0;
|
||||
D_80162FC0[0] = temp_v0_2->posX + sp118;
|
||||
D_80162FC0[1] = temp_v0_2->posY;
|
||||
D_80162FC0[2] = temp_v0_2->posZ + temp_f0_3;
|
||||
spC2 = (get_angle_between_two_vectors(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520;
|
||||
break;
|
||||
case 3:
|
||||
var_f20 = bombKart->yPos + 3.5f;
|
||||
spC2 = 0;
|
||||
break;
|
||||
|
||||
case 5:
|
||||
if ((D_8016347C == 0) || (gNearestPathPointByPlayerId[3] < 5)) {
|
||||
break;
|
||||
} else {
|
||||
spCA = func_8000D2B4(var_f22, var_f20, var_f24, spCA, 3);
|
||||
if ((spCA < 0) || (gPathCountByPathIndex[3] < spCA)) {
|
||||
spCA = 0;
|
||||
}
|
||||
if (((s32) spCA) < 0x1A) {
|
||||
temp_v0_2 = &gTrackPaths[3][(spCA + 1) % gPathCountByPathIndex[3]];
|
||||
D_80162FB0[0] = temp_v0_2->posX;
|
||||
D_80162FB0[1] = temp_v0_2->posY;
|
||||
D_80162FB0[2] = temp_v0_2->posZ;
|
||||
temp_v0_4 = &gTrackPaths[3][(spCA + 2) % gPathCountByPathIndex[3]];
|
||||
D_80162FC0[0] = temp_v0_4->posX;
|
||||
D_80162FC0[1] = temp_v0_4->posY;
|
||||
D_80162FC0[2] = temp_v0_4->posZ;
|
||||
spC2 = (get_angle_between_two_vectors(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520;
|
||||
} else {
|
||||
D_80162FB0[0] = var_f22;
|
||||
D_80162FB0[1] = var_f20;
|
||||
D_80162FB0[2] = var_f24;
|
||||
D_80162FC0[0] = -2409.197f;
|
||||
D_80162FC0[1] = 0.0f;
|
||||
D_80162FC0[2] = -355.254f;
|
||||
spC2 = (get_angle_between_two_vectors(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520;
|
||||
}
|
||||
temp_f14 = ((D_80162FB0[0] + D_80162FC0[0]) * 0.5f) - var_f22;
|
||||
temp_f16 = ((D_80162FB0[2] + D_80162FC0[2]) * 0.5f) - var_f24;
|
||||
temp_f0_4 = sqrtf((temp_f14 * temp_f14) + (temp_f16 * temp_f16));
|
||||
if (temp_f0_4 > 0.01f) {
|
||||
var_f22 += (bombKart->unk_3C * temp_f14) / temp_f0_4;
|
||||
var_f24 += (bombKart->unk_3C * temp_f16) / temp_f0_4;
|
||||
} else {
|
||||
var_f22 += temp_f14 / 5.0f;
|
||||
var_f24 += temp_f16 / 5.0f;
|
||||
}
|
||||
temp_a0_4 = &D_80164038[bombKartId];
|
||||
var_f20 = calculate_surface_height(var_f22, 2000.0f, var_f24, temp_a0_4->meshIndexZX) + 3.5f;
|
||||
if (var_f20 < (-1000.0)) {
|
||||
var_f20 = bombKart->bombPos[1];
|
||||
}
|
||||
check_bounding_collision(temp_a0_4, 10.0f, var_f22, var_f20, var_f24);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
temp_v0_2 = &gTrackPaths[0][spCA];
|
||||
D_80162FB0[0] = temp_v0_2->posX;
|
||||
D_80162FB0[1] = temp_v0_2->posY;
|
||||
D_80162FB0[2] = temp_v0_2->posZ;
|
||||
temp_v0_4 = &gTrackPaths[0][(spCA + 1) % gPathCountByPathIndex[0]];
|
||||
D_80162FC0[0] = temp_v0_4->posX;
|
||||
D_80162FC0[1] = temp_v0_4->posY;
|
||||
D_80162FC0[2] = temp_v0_4->posZ;
|
||||
var_f20 += 3.0f - (var_s1 * 0.3f);
|
||||
spC2 = (get_angle_between_two_vectors(D_80162FB0, D_80162FC0) * 0xFFFF) / 65520;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (sp7E == 4) {
|
||||
sp108 = 2.0f * var_s1;
|
||||
sp118 = coss(0xFFFF - spC2) * var_s1;
|
||||
var_f18 = sins(0xFFFF - spC2) * var_s1;
|
||||
var_s1++;
|
||||
temp_f2_4 = (var_f20 - 2.3f) + (sp108 / 3.0f);
|
||||
spAC = temp_f2_4;
|
||||
spA0 = temp_f2_4;
|
||||
sp94 = temp_f2_4;
|
||||
sp88 = temp_f2_4;
|
||||
if (var_s1 >= 31) {
|
||||
sp7E = 0;
|
||||
}
|
||||
} else {
|
||||
sp118 = coss(0xFFFF - spC2) * 1.5f;
|
||||
var_f18 = sins(0xFFFF - spC2) * 1.5f;
|
||||
temp_f16_2 = var_f20 - 2.3f;
|
||||
temp_f12_3 = (sp7C % 3) * 0.15f;
|
||||
temp_f14_2 = temp_f16_2 - temp_f12_3;
|
||||
temp_f12_4 = temp_f16_2 + temp_f12_3;
|
||||
spAC = temp_f14_2;
|
||||
sp94 = temp_f14_2;
|
||||
spA0 = temp_f12_4;
|
||||
sp88 = temp_f12_4;
|
||||
var_f20 += sins((sp7C * 0x13FFEC) / 360);
|
||||
sp7C = (sp7C + 1) % 18;
|
||||
}
|
||||
bombKart2 = bombKart;
|
||||
bombKart2->wheel1Pos[0] = (sp118 - var_f18) + var_f22;
|
||||
bombKart2->wheel1Pos[1] = spAC;
|
||||
bombKart2->wheel1Pos[2] = (var_f18 + sp118) + var_f24;
|
||||
bombKart2->wheel2Pos[0] = (var_f18 + sp118) + var_f22;
|
||||
bombKart2->wheel2Pos[1] = spA0;
|
||||
bombKart2->wheel2Pos[2] = (var_f18 - sp118) + var_f24;
|
||||
bombKart2->wheel3Pos[0] = ((-sp118) - var_f18) + var_f22;
|
||||
bombKart2->wheel3Pos[1] = sp94;
|
||||
bombKart2->wheel3Pos[2] = ((-var_f18) + sp118) + var_f24;
|
||||
bombKart2->wheel4Pos[0] = ((-sp118) + var_f18) + var_f22;
|
||||
bombKart2->wheel4Pos[1] = sp88;
|
||||
bombKart2->wheel4Pos[2] = ((-var_f18) - sp118) + var_f24;
|
||||
bombKart2->bombPos[0] = var_f22;
|
||||
bombKart2->bombPos[1] = var_f20;
|
||||
bombKart2->bombPos[2] = var_f24;
|
||||
bombKart2->pathPointIndex = spCA;
|
||||
bombKart2->unk_3C = spC4;
|
||||
bombKart2->someRot = spC2;
|
||||
bombKart2->state = sp7E;
|
||||
bombKart2->bounceTimer = sp7C;
|
||||
bombKart2->circleTimer = var_s1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
#include <ultra64.h>
|
||||
#include "cpu_vehicles_camera_path.h"
|
||||
#include <defines.h>
|
||||
#include <macros.h>
|
||||
|
||||
void func_8001AB00(void) {
|
||||
s32 var_v1;
|
||||
|
||||
for (var_v1 = 0; var_v1 < NUM_PLAYERS; var_v1++) {
|
||||
cpu_ItemStrategy[var_v1].branch = 0;
|
||||
cpu_ItemStrategy[var_v1].timer = 0;
|
||||
cpu_ItemStrategy[var_v1].actorIndex = -1;
|
||||
cpu_ItemStrategy[var_v1].numItemUse = 0;
|
||||
cpu_ItemStrategy[var_v1].numDroppedBananaBunch = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void cpu_decisions_branch_item(UNUSED s32 playerId, s16* branch, s32 itemId) {
|
||||
s32 value = -1;
|
||||
switch (itemId) {
|
||||
case ITEM_FAKE_ITEM_BOX:
|
||||
value = CPU_STRATEGY_ITEM_FAKE_ITEM_BOX;
|
||||
break;
|
||||
case ITEM_BOO:
|
||||
value = CPU_STRATEGY_ITEM_BOO;
|
||||
break;
|
||||
case ITEM_BANANA:
|
||||
value = CPU_STRATEGY_ITEM_BANANA;
|
||||
break;
|
||||
case ITEM_THUNDERBOLT:
|
||||
value = CPU_STRATEGY_ITEM_THUNDERBOLT;
|
||||
break;
|
||||
case ITEM_STAR:
|
||||
value = CPU_STRATEGY_ITEM_STAR;
|
||||
break;
|
||||
case ITEM_MUSHROOM:
|
||||
value = CPU_STRATEGY_ITEM_MUSHROOM;
|
||||
break;
|
||||
case ITEM_DOUBLE_MUSHROOM:
|
||||
break;
|
||||
case ITEM_TRIPLE_MUSHROOM:
|
||||
break;
|
||||
case ITEM_SUPER_MUSHROOM:
|
||||
break;
|
||||
}
|
||||
if (value >= 0) {
|
||||
*branch = value;
|
||||
}
|
||||
}
|
||||
|
||||
void func_8001ABE0(UNUSED s32 playerId, UNUSED CpuItemStrategyData* arg1) {
|
||||
}
|
||||
|
||||
void clear_expired_strategies(CpuItemStrategyData* arg0) {
|
||||
if ((arg0->actorIndex < 0) || (arg0->actorIndex >= 0x64)) {
|
||||
arg0->branch = 0;
|
||||
arg0->timer = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,228 @@
|
||||
void func_80007D04(s32 playerId, Player* player) {
|
||||
s16 temp_t1;
|
||||
s16 temp_t2;
|
||||
s32 var_v0;
|
||||
|
||||
temp_t1 = gNumPathPointsTraversed[gBestRankedHumanPlayer];
|
||||
temp_t2 = gNumPathPointsTraversed[playerId];
|
||||
|
||||
if (gGPCurrentRaceRankByPlayerId[playerId] < 2) {
|
||||
s16 val1 = gGPCurrentRaceRankByPlayerId[gBestRankedHumanPlayer];
|
||||
s16 val2 = temp_t2 - temp_t1;
|
||||
|
||||
if (val2 > 400 && val1 >= 6) {
|
||||
player->effects &= ~UNKNOWN_EFFECT_0x200000;
|
||||
player_accelerate(player);
|
||||
D_801634C0[playerId] = 4;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
player->effects |= UNKNOWN_EFFECT_0x200000;
|
||||
player_accelerate(player);
|
||||
D_801634C0[playerId] = 3;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (gCCSelection) { // WTF, FAKE ?
|
||||
case CC_EXTRA:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (gCCSelection) {
|
||||
case CC_50:
|
||||
var_v0 = 0;
|
||||
if (playerId == D_80163344[0]) {
|
||||
var_v0 = 0x14;
|
||||
}
|
||||
break;
|
||||
|
||||
case CC_100:
|
||||
var_v0 = 8;
|
||||
if (playerId == D_80163344[0]) {
|
||||
var_v0 = 0x18;
|
||||
}
|
||||
break;
|
||||
|
||||
case CC_150:
|
||||
var_v0 = 0x12;
|
||||
if (playerId == D_80163344[0]) {
|
||||
var_v0 = 0x24;
|
||||
}
|
||||
break;
|
||||
|
||||
case CC_EXTRA:
|
||||
var_v0 = 8;
|
||||
if (playerId == D_80163344[0]) {
|
||||
var_v0 = 0x18;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
var_v0 = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (temp_t2 < temp_t1) {
|
||||
player->effects |= UNKNOWN_EFFECT_0x200000;
|
||||
player_accelerate(player);
|
||||
D_801634C0[playerId] = 1;
|
||||
} else if (temp_t2 < (temp_t1 + var_v0 + 0x32)) {
|
||||
player->effects &= ~UNKNOWN_EFFECT_0x200000;
|
||||
player_accelerate(player);
|
||||
D_801634C0[playerId] = 3;
|
||||
} else if (D_801631E0[playerId] == false) {
|
||||
player->effects &= ~UNKNOWN_EFFECT_0x200000;
|
||||
player_accelerate(player);
|
||||
D_801634C0[playerId] = 2;
|
||||
} else {
|
||||
player->effects &= ~UNKNOWN_EFFECT_0x200000;
|
||||
decelerate_player(player, 1.0f);
|
||||
D_801634C0[playerId] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80007FA4(s32 playerId, Player* player, f32 arg2) {
|
||||
f32 temp_f0;
|
||||
f32 dist;
|
||||
f32 temp_f2;
|
||||
s32 test;
|
||||
|
||||
temp_f0 = D_80163418[playerId] - player->pos[0];
|
||||
temp_f2 = D_80163438[playerId] - player->pos[2];
|
||||
dist = (temp_f0 * temp_f0) + (temp_f2 * temp_f2);
|
||||
if (playerId == 3) {
|
||||
if ((dist < 25.0f) && (D_80163410[playerId] < 5)) {
|
||||
D_80163410[playerId] = 4;
|
||||
(arg2 < ((2.0 * 18.0) / 216.0)) ? func_80038BE4(player, 1) : decelerate_player(player, 1.0f);
|
||||
} else if ((dist < 3600.0f) && (D_80163410[playerId] < 4)) {
|
||||
D_80163410[playerId] = 3;
|
||||
(arg2 < ((5.0 * 18.0) / 216.0)) ? func_80038BE4(player, 1) : decelerate_player(player, 5.0f);
|
||||
} else {
|
||||
(arg2 < ((20.0 * 18.0) / 216.0)) ? func_80038BE4(player, 10) : decelerate_player(player, 1.0f);
|
||||
}
|
||||
} else {
|
||||
if ((dist < 25.0f) && (D_80163410[playerId] < 5)) {
|
||||
D_80163410[playerId] = 4;
|
||||
test = 2;
|
||||
(arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 1) : decelerate_player(player, 1.0f);
|
||||
} else if ((dist < 4900.0f) && (D_80163410[playerId] < 4)) {
|
||||
D_80163410[playerId] = 3;
|
||||
test = 5;
|
||||
(arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 1) : decelerate_player(player, 15.0f);
|
||||
} else if ((dist < 22500.0f) && (D_80163410[playerId] < 3)) {
|
||||
D_80163410[playerId] = 2;
|
||||
test = 20;
|
||||
(arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 5) : decelerate_player(player, 1.0f);
|
||||
} else if ((dist < 90000.0f) && (D_80163410[playerId] < 2)) {
|
||||
D_80163410[playerId] = 1;
|
||||
test = 30;
|
||||
(arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 6) : decelerate_player(player, 1.0f);
|
||||
} else if (D_80163410[playerId] == 0) {
|
||||
test = 35;
|
||||
(arg2 < (((test ^ 0) * 18.0) / 216.0)) ? func_80038BE4(player, 2) : decelerate_player(player, 1.0f);
|
||||
} else {
|
||||
decelerate_player(player, 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void regulate_cpu_speed(s32 playerId, f32 targetSpeed, Player* player) {
|
||||
f32 speed;
|
||||
f32 var_f0;
|
||||
UNUSED s32 thing;
|
||||
s32 var_a1;
|
||||
|
||||
speed = player->speed;
|
||||
if (!(player->effects & 0x80) && !(player->effects & 0x40) && !(player->effects & 0x20000) &&
|
||||
!(player->soundEffects & 0x400000) && !(player->soundEffects & 0x01000000) && !(player->soundEffects & 2) &&
|
||||
!(player->soundEffects & 4)) {
|
||||
if (gCurrentCourseId == COURSE_AWARD_CEREMONY) {
|
||||
func_80007FA4(playerId, player, speed);
|
||||
} else if ((bStopAICrossing[playerId] == true) && !(player->effects & (STAR_EFFECT | BOO_EFFECT))) {
|
||||
decelerate_player(player, 10.0f);
|
||||
if (player->currentSpeed == 0.0) {
|
||||
player->velocity[0] = 0.0f;
|
||||
player->velocity[2] = 0.0f;
|
||||
}
|
||||
} else {
|
||||
var_f0 = 3.3333333f;
|
||||
switch (gCCSelection) { /* irregular */
|
||||
case CC_100:
|
||||
case CC_EXTRA:
|
||||
break;
|
||||
case CC_50:
|
||||
var_f0 = 2.5f;
|
||||
break;
|
||||
case CC_150:
|
||||
var_f0 = 3.75f;
|
||||
break;
|
||||
}
|
||||
if (speed < var_f0) {
|
||||
player->effects &= ~UNKNOWN_EFFECT_0x200000;
|
||||
player_accelerate(player);
|
||||
} else if (player->type & PLAYER_CINEMATIC_MODE) {
|
||||
if (speed < targetSpeed) {
|
||||
player->effects &= ~UNKNOWN_EFFECT_0x200000;
|
||||
player_accelerate(player);
|
||||
} else {
|
||||
player->effects &= ~UNKNOWN_EFFECT_0x200000;
|
||||
decelerate_player(player, 1.0f);
|
||||
}
|
||||
} else if ((D_801631E0[playerId] == true) && (D_80163330[playerId] != 1)) {
|
||||
if (func_800088D8(playerId, gLapCountByPlayerId[playerId], gGPCurrentRaceRankByPlayerIdDup[playerId]) ==
|
||||
1) {
|
||||
player->effects |= UNKNOWN_EFFECT_0x200000;
|
||||
player_accelerate(player);
|
||||
} else {
|
||||
player->effects &= ~UNKNOWN_EFFECT_0x200000;
|
||||
decelerate_player(player, 1.0f);
|
||||
}
|
||||
} else {
|
||||
var_a1 = 1;
|
||||
switch (gSpeedCPUBehaviour[playerId]) { /* switch 1; irregular */
|
||||
case SPEED_cpu_BEHAVIOUR_FAST: /* switch 1 */
|
||||
player->effects &= ~UNKNOWN_EFFECT_0x200000;
|
||||
player_accelerate(player);
|
||||
break;
|
||||
case SPEED_cpu_BEHAVIOUR_MAX: /* switch 1 */
|
||||
player->effects |= UNKNOWN_EFFECT_0x200000;
|
||||
player_accelerate(player);
|
||||
break;
|
||||
case SPEED_cpu_BEHAVIOUR_SLOW: /* switch 1 */
|
||||
if (((speed / 18.0f) * 216.0f) > 20.0f) {
|
||||
targetSpeed = 1.6666666f;
|
||||
}
|
||||
var_a1 = 0;
|
||||
break;
|
||||
case SPEED_cpu_BEHAVIOUR_NORMAL: /* switch 1 */
|
||||
default: /* switch 1 */
|
||||
var_a1 = 0;
|
||||
break;
|
||||
}
|
||||
if (var_a1 != 1) {
|
||||
if (speed < targetSpeed) {
|
||||
if ((gDemoMode == 1) && (gCurrentCourseId != COURSE_AWARD_CEREMONY)) {
|
||||
player_accelerate(player);
|
||||
} else if (D_80163330[playerId] == 1) {
|
||||
func_80007D04(playerId, player);
|
||||
} else if (func_800088D8(playerId, gLapCountByPlayerId[playerId],
|
||||
gGPCurrentRaceRankByPlayerIdDup[playerId]) == true) {
|
||||
player->effects |= UNKNOWN_EFFECT_0x200000;
|
||||
player_accelerate(player);
|
||||
} else {
|
||||
player->effects &= ~UNKNOWN_EFFECT_0x200000;
|
||||
decelerate_player(player, 1.0f);
|
||||
}
|
||||
} else {
|
||||
player->effects &= ~UNKNOWN_EFFECT_0x200000;
|
||||
if (targetSpeed > 1.0f) {
|
||||
decelerate_player(player, 2.0f);
|
||||
} else {
|
||||
decelerate_player(player, 5.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,534 @@
|
||||
// @arg index from 0 to 3.
|
||||
|
||||
// Processes course path by index.
|
||||
// @arg index from 0 to 3.
|
||||
// Each course can have 1-4 course paths.
|
||||
void load_track_path(s32 pathIndex) {
|
||||
|
||||
TrackPathPoint* ptr;
|
||||
TrackPathPoint* pathDest;
|
||||
TrackPathPoint* path;
|
||||
s32 var_v0;
|
||||
s32 sp24;
|
||||
UNUSED s32 pad[2];
|
||||
s16 bInvalidPath;
|
||||
s32 i;
|
||||
|
||||
// cast required
|
||||
if ((s32) GET_COURSE_AIMaximumSeparation >= 0) {
|
||||
pathDest = gTrackPaths[pathIndex];
|
||||
bInvalidPath = 1;
|
||||
if (gCurrentCourseId != COURSE_AWARD_CEREMONY) {
|
||||
var_v0 = process_path_data(pathDest, GET_COURSE_PathTable2(pathIndex));
|
||||
gPathCountByPathIndex[pathIndex] = (u16) var_v0;
|
||||
} else {
|
||||
// Course path included in course_data which has already been loaded into memory.
|
||||
// This is how we get the addr to our path data.
|
||||
path = GET_COURSE_PathTable(pathIndex);
|
||||
ptr = path;
|
||||
|
||||
for (i = 0; i < 3000; i++, ptr++) {
|
||||
if ((u16) ptr->posX == 0x8000) {
|
||||
sp24 = i - 1;
|
||||
bInvalidPath = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If path data higher than 3000 something has gone wrong.
|
||||
// Skip processing the data.
|
||||
//! @todo Confirm this comment
|
||||
if (!bInvalidPath) {
|
||||
var_v0 = func_80011014(pathDest, path, sp24, pathIndex);
|
||||
gPathCountByPathIndex[pathIndex] = (u16) var_v0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void calculate_track_boundaries(s32 pathIndex) {
|
||||
f32 pathPointWidth;
|
||||
f32 x1;
|
||||
f32 y1;
|
||||
f32 z1;
|
||||
f32 x2;
|
||||
f32 y2;
|
||||
f32 z2;
|
||||
f32 x_dist;
|
||||
f32 z_dist;
|
||||
f32 neg_x_dist;
|
||||
f32 neg_z_dist;
|
||||
f32 xz_dist;
|
||||
s32 temp_f16;
|
||||
s32 pathPointIndex;
|
||||
TrackPathPoint* pathPoint;
|
||||
TrackPathPoint* nextPathPoint;
|
||||
TrackPathPoint* var_s1;
|
||||
TrackPathPoint* var_s2;
|
||||
|
||||
if (((s32) GET_COURSE_AIMaximumSeparation) >= 0) {
|
||||
pathPointWidth = GET_COURSE_AIMaximumSeparation;
|
||||
pathPoint = &gTrackPaths[pathIndex][0];
|
||||
var_s1 = &gTrackLeftPaths[pathIndex][0];
|
||||
var_s2 = &gTrackRightPaths[pathIndex][0];
|
||||
for (pathPointIndex = 0; pathPointIndex < gPathCountByPathIndex[pathIndex];
|
||||
pathPointIndex++, var_s1++, var_s2++) {
|
||||
x1 = pathPoint->posX;
|
||||
y1 = pathPoint->posY;
|
||||
z1 = pathPoint->posZ;
|
||||
pathPoint++;
|
||||
nextPathPoint = &gTrackPaths[pathIndex][(pathPointIndex + 1) % ((s32) gPathCountByPathIndex[pathIndex])];
|
||||
x2 = nextPathPoint->posX;
|
||||
y2 = nextPathPoint->posY;
|
||||
z2 = nextPathPoint->posZ;
|
||||
x_dist = x2 - x1;
|
||||
z_dist = z2 - z1;
|
||||
neg_x_dist = x1 - x2;
|
||||
neg_z_dist = z1 - z2;
|
||||
xz_dist = sqrtf((x_dist * x_dist) + (z_dist * z_dist));
|
||||
temp_f16 = (f32) ((y1 + y2) * 0.5);
|
||||
|
||||
// Calculate left boundary position
|
||||
// Uses perpendicular vector (Z, -X) normalized by segment length
|
||||
var_s1->posX = ((pathPointWidth * z_dist) / xz_dist) + x1;
|
||||
var_s1->posY = temp_f16;
|
||||
var_s1->posZ = ((pathPointWidth * neg_x_dist) / xz_dist) + z1;
|
||||
|
||||
// Calculate right boundary position
|
||||
// Uses opposite perpendicular vector (-Z, X)
|
||||
var_s2->posX = ((pathPointWidth * neg_z_dist) / xz_dist) + x1;
|
||||
var_s2->posY = temp_f16;
|
||||
var_s2->posZ = ((pathPointWidth * x_dist) / xz_dist) + z1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the track curvature using two sets of three path.
|
||||
* Returns a normalized value indicating curve direction and severity:
|
||||
* - Positive: Right turn
|
||||
* - Negative: Left turn
|
||||
* - Near zero: Straight section
|
||||
*
|
||||
* @param pathIndex Track path index
|
||||
* @param pathPointIndex Starting pathPoint for calculation
|
||||
* @return Normalized curvature value (-1 to 1)
|
||||
*/
|
||||
f32 calculate_track_curvature(s32 pathIndex, u16 pathPointIndex) {
|
||||
f32 secondVectorX;
|
||||
f32 secondVectorZ;
|
||||
UNUSED f32 pad;
|
||||
TrackPathPoint* pathPathPoints;
|
||||
f32 x1;
|
||||
f32 z1;
|
||||
f32 x2;
|
||||
f32 z2;
|
||||
f32 x3;
|
||||
f32 z3;
|
||||
f32 firstVectorX;
|
||||
f32 firstVectorZ;
|
||||
s32 pathPointCount;
|
||||
TrackPathPoint* pathPoint3;
|
||||
TrackPathPoint* pathPoint2;
|
||||
TrackPathPoint* pathPoint1;
|
||||
f32 secondLength;
|
||||
f32 firstLength;
|
||||
|
||||
if ((s32) GET_COURSE_AIMaximumSeparation < 0) {
|
||||
return 0.0f;
|
||||
}
|
||||
pathPointCount = gPathCountByPathIndex[pathIndex];
|
||||
pathPathPoints = gTrackPaths[pathIndex];
|
||||
|
||||
pathPoint1 = &pathPathPoints[pathPointIndex];
|
||||
pathPoint2 = &pathPathPoints[(pathPointIndex + 1) % pathPointCount];
|
||||
pathPoint3 = &pathPathPoints[(pathPointIndex + 2) % pathPointCount];
|
||||
|
||||
x1 = pathPoint1->posX;
|
||||
z1 = pathPoint1->posZ;
|
||||
x2 = pathPoint2->posX;
|
||||
z2 = pathPoint2->posZ;
|
||||
x3 = pathPoint3->posX;
|
||||
z3 = pathPoint3->posZ;
|
||||
|
||||
firstVectorX = (((x2 + x3) * 0.5) - x1);
|
||||
firstVectorZ = (((z2 + z3) * 0.5) - z1);
|
||||
|
||||
pathPoint1 = &pathPathPoints[(pathPointIndex + 3) % pathPointCount];
|
||||
pathPoint2 = &pathPathPoints[(pathPointIndex + 4) % pathPointCount];
|
||||
pathPoint3 = &pathPathPoints[(pathPointIndex + 5) % pathPointCount];
|
||||
|
||||
x1 = pathPoint1->posX;
|
||||
z1 = pathPoint1->posZ;
|
||||
x2 = pathPoint2->posX;
|
||||
z2 = pathPoint2->posZ;
|
||||
x3 = pathPoint3->posX;
|
||||
z3 = pathPoint3->posZ;
|
||||
|
||||
secondVectorX = (((x2 + x3) * 0.5) - x1);
|
||||
secondVectorZ = (((z2 + z3) * 0.5) - z1);
|
||||
|
||||
firstLength = sqrtf((firstVectorZ * firstVectorZ) + (firstVectorX * firstVectorX));
|
||||
secondLength = sqrtf((secondVectorX * secondVectorX) + (secondVectorZ * secondVectorZ));
|
||||
return -((firstVectorZ * secondVectorX) - (firstVectorX * secondVectorZ)) / (secondLength * firstLength);
|
||||
}
|
||||
|
||||
void analize_track_section(s32 pathIndex) {
|
||||
f64 sectionCurvature;
|
||||
UNUSED s32 pad;
|
||||
s32 k;
|
||||
s32 i;
|
||||
s32 j;
|
||||
s16* currentSection;
|
||||
s32 pathPointCount;
|
||||
s16* nextSection;
|
||||
|
||||
if ((s32) GET_COURSE_AIMaximumSeparation >= 0) {
|
||||
pathPointCount = gPathCountByPathIndex[pathIndex];
|
||||
currentSection = gTrackSectionTypes[pathIndex];
|
||||
for (i = 0; i < pathPointCount; i++, currentSection++) {
|
||||
sectionCurvature = calculate_track_curvature(pathIndex, i);
|
||||
*currentSection = STRAIGHT;
|
||||
if (sectionCurvature > 0.1) {
|
||||
*currentSection = RIGHT_CURVE;
|
||||
}
|
||||
if (sectionCurvature < -0.1) {
|
||||
*currentSection = LEFT_CURVE;
|
||||
}
|
||||
}
|
||||
currentSection = gTrackSectionTypes[pathIndex];
|
||||
for (i = 0; i < pathPointCount; i++, currentSection++) {
|
||||
if (*currentSection == STRAIGHT) {
|
||||
// Look ahead for next curved section
|
||||
for (j = 1; j < pathPointCount; j++) {
|
||||
nextSection = &gTrackSectionTypes[pathIndex][(i + j) % pathPointCount];
|
||||
switch (*nextSection) {
|
||||
case RIGHT_LEANING_CURVE:
|
||||
case RIGHT_CURVE:
|
||||
for (k = 0; k < j; k++) {
|
||||
gTrackSectionTypes[pathIndex][(i + k) % pathPointCount] = RIGHT_LEANING_CURVE;
|
||||
}
|
||||
i += j;
|
||||
currentSection += j;
|
||||
j = pathPointCount;
|
||||
break;
|
||||
case LEFT_LEANING_CURVE:
|
||||
case LEFT_CURVE:
|
||||
for (k = 0; k < j; k++) {
|
||||
gTrackSectionTypes[pathIndex][(i + k) % pathPointCount] = LEFT_LEANING_CURVE;
|
||||
}
|
||||
i += j;
|
||||
currentSection += j;
|
||||
j = pathPointCount;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Seemingly calculates the atan2 angle between a pathPoint and its forward neighbor
|
||||
s16 calculate_angle_path(s32 pathIndex, s32 pathPointIndex) {
|
||||
s16 ret;
|
||||
Vec3f sp30;
|
||||
Vec3f sp24;
|
||||
TrackPathPoint* temp_v0;
|
||||
|
||||
temp_v0 = &gTrackPaths[pathIndex][pathPointIndex];
|
||||
sp30[0] = temp_v0->posX;
|
||||
sp30[1] = temp_v0->posY;
|
||||
sp30[2] = temp_v0->posZ;
|
||||
temp_v0 = &gTrackPaths[pathIndex][(pathPointIndex + 1) % gPathCountByPathIndex[pathIndex]];
|
||||
sp24[0] = temp_v0->posX;
|
||||
sp24[1] = temp_v0->posY;
|
||||
sp24[2] = temp_v0->posZ;
|
||||
ret = get_angle_between_two_vectors(sp30, sp24);
|
||||
return -ret;
|
||||
}
|
||||
|
||||
// Populates gPathExpectedRotation
|
||||
void analyse_angle_path(s32 pathIndex) {
|
||||
s32 pathPointIndex;
|
||||
u16* angle;
|
||||
|
||||
if ((s32) GET_COURSE_AIMaximumSeparation >= 0) {
|
||||
for (angle = (u16*) &gPathExpectedRotation[pathIndex][0], pathPointIndex = 0;
|
||||
pathPointIndex < gPathCountByPathIndex[pathIndex]; pathPointIndex++, angle++) {
|
||||
*angle = calculate_angle_path(pathIndex, pathPointIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void analisze_curved_path(s32 pathIndex) {
|
||||
s16* trackCurveCount;
|
||||
s16 curveCount;
|
||||
s16 temp_t0;
|
||||
s32 pathPointCount;
|
||||
s16* trackSectionType;
|
||||
s32 i, j;
|
||||
|
||||
pathPointCount = gPathCountByPathIndex[pathIndex];
|
||||
trackSectionType = gTrackSectionTypes[pathIndex];
|
||||
trackCurveCount = gTrackConsecutiveCurveCounts[pathIndex];
|
||||
|
||||
for (i = 0; i < pathPointCount; i++) {
|
||||
curveCount = 0;
|
||||
for (j = 0; j < pathPointCount; j++) {
|
||||
temp_t0 = trackSectionType[(i + j) % pathPointCount];
|
||||
if ((temp_t0 == LEFT_LEANING_CURVE) || (temp_t0 == RIGHT_LEANING_CURVE)) {
|
||||
curveCount += 1;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
if (gCurrentCourseId == COURSE_AWARD_CEREMONY) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
*trackCurveCount = curveCount;
|
||||
trackCurveCount++;
|
||||
}
|
||||
}
|
||||
|
||||
f32 func_80010F40(f32 arg0, f32 arg1, f32 arg2, UNUSED s32 arg3, UNUSED s32 arg4) {
|
||||
arg1 = get_surface_height(arg0, 2000.0f, arg2);
|
||||
check_bounding_collision(&D_80162E70, 1.0f, arg0, arg1, arg2);
|
||||
return arg1;
|
||||
}
|
||||
|
||||
f32 func_80010FA0(f32 arg0, f32 arg1, f32 arg2, UNUSED s32 arg3, UNUSED s32 arg4) {
|
||||
arg1 = get_surface_height(arg0, (f32) ((f64) arg1 + 30.0), arg2);
|
||||
check_bounding_collision(&D_80162E70, 10.0f, arg0, arg1, arg2);
|
||||
return arg1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return's the number of items processed.
|
||||
*/
|
||||
s32 func_80011014(TrackPathPoint* pathDest, TrackPathPoint* path, s32 numPathPoints, UNUSED s32 pathIndex) {
|
||||
f32 temp_f24_2;
|
||||
f32 temp_f2_3;
|
||||
f32 var_f20_2;
|
||||
f32 x1;
|
||||
f32 z1;
|
||||
f32 x2;
|
||||
f32 z2;
|
||||
f32 x3;
|
||||
f32 z3;
|
||||
f32 x1_2;
|
||||
f32 z1_3;
|
||||
f32 temp_f20;
|
||||
f32 var_f30;
|
||||
f32 temp_f22;
|
||||
f32 temp_f16;
|
||||
s32 i;
|
||||
|
||||
f32 j;
|
||||
s32 var_s0;
|
||||
f32 var_f28;
|
||||
|
||||
TrackPathPoint* point1;
|
||||
TrackPathPoint* point2;
|
||||
TrackPathPoint* point3;
|
||||
f32 temp;
|
||||
UNUSED TrackPathPoint* dest;
|
||||
var_f30 = 0.0f;
|
||||
var_s0 = 0;
|
||||
temp_f20 = (f32) path[0].posX;
|
||||
temp_f22 = (f32) path[0].posZ;
|
||||
var_f28 = func_80010F40(temp_f20, 2000.0f, temp_f22, gCurrentCourseId, 0);
|
||||
|
||||
for (i = 0; i < numPathPoints; i++) {
|
||||
point1 = &path[i % numPathPoints];
|
||||
point2 = &path[(i + 1) % numPathPoints];
|
||||
point3 = &path[(s32) (i + 2) % numPathPoints];
|
||||
x1 = (f32) point1->posX;
|
||||
z1 = (f32) point1->posZ;
|
||||
x2 = (f32) point2->posX;
|
||||
z2 = (f32) point2->posZ;
|
||||
x3 = (f32) point3->posX;
|
||||
z3 = (f32) point3->posZ;
|
||||
|
||||
temp = 0.05 / (sqrtf(((x2 - x1) * (x2 - x1)) + ((z2 - z1) * (z2 - z1))) +
|
||||
(sqrtf(((x3 - x2) * (x3 - x2)) + ((z3 - z2) * (z3 - z2)))));
|
||||
|
||||
for (j = 0.0f; j <= 1.0; j += temp) {
|
||||
|
||||
temp_f2_3 = (f32) ((1.0 - j) * 0.5 * (1.0 - j));
|
||||
z1_3 = (f32) (((1.0 - j) * j) + 0.5);
|
||||
temp_f16 = (f32) (j * 0.5 * j);
|
||||
|
||||
temp_f24_2 = (temp_f2_3 * x1) + (z1_3 * x2) + (temp_f16 * x3);
|
||||
x1_2 = (temp_f2_3 * z1) + (z1_3 * z2) + (temp_f16 * z3);
|
||||
|
||||
var_f30 +=
|
||||
sqrtf(((temp_f24_2 - temp_f20) * (temp_f24_2 - temp_f20)) + ((x1_2 - temp_f22) * (x1_2 - temp_f22)));
|
||||
|
||||
temp_f20 = temp_f24_2;
|
||||
temp_f22 = x1_2;
|
||||
|
||||
if ((var_f30 > 20.0f) || ((i == 0) && (j == 0.0))) {
|
||||
if (gIsMirrorMode) {
|
||||
// temp_f12 = -temp_f24_2;
|
||||
pathDest->posX = (s16) -temp_f24_2;
|
||||
var_f20_2 = func_80010FA0(-temp_f24_2, var_f28, x1_2, gCurrentCourseId, var_s0);
|
||||
} else {
|
||||
pathDest->posX = (s16) temp_f24_2;
|
||||
var_f20_2 = func_80010FA0(temp_f24_2, var_f28, x1_2, gCurrentCourseId, var_s0);
|
||||
}
|
||||
|
||||
pathDest->posZ = (s16) temp_f22;
|
||||
pathDest->trackSectionId = get_track_section_id(D_80162E70.meshIndexZX);
|
||||
|
||||
if (var_f20_2 < -500.0) {
|
||||
var_f20_2 = var_f28;
|
||||
} else {
|
||||
|
||||
switch (gCurrentCourseId) {
|
||||
case COURSE_RAINBOW_ROAD:
|
||||
if (var_f20_2 < (var_f28 - 15.0)) {
|
||||
var_f20_2 = (f32) var_f28 - 15.0;
|
||||
}
|
||||
break;
|
||||
case COURSE_WARIO_STADIUM:
|
||||
if ((var_s0 >= 1140) && (var_s0 <= 1152)) {
|
||||
var_f20_2 = var_f28;
|
||||
} else {
|
||||
if (var_f20_2 < (var_f28 - 10.0)) {
|
||||
var_f20_2 = (f32) (var_f28 - 4.0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case COURSE_DK_JUNGLE:
|
||||
if ((var_s0 > 204) && (var_s0 < 220)) {
|
||||
var_f20_2 = var_f28;
|
||||
} else {
|
||||
if (var_f20_2 < (var_f28 - 10.0)) {
|
||||
var_f20_2 = (f32) (var_f28 - 4.0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (var_f20_2 < (var_f28 - 10.0)) {
|
||||
var_f20_2 = (f32) var_f28 - 10.0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
var_f28 = var_f20_2;
|
||||
pathDest->posY = (s16) (s32) var_f20_2;
|
||||
var_f30 = 0.0f;
|
||||
pathDest++;
|
||||
var_s0 += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return var_s0;
|
||||
}
|
||||
|
||||
// Returns number of path processed.
|
||||
s32 process_path_data(TrackPathPoint* dest, TrackPathPoint* src) {
|
||||
s16 temp_a0;
|
||||
s16 temp_a2;
|
||||
s16 temp_a3;
|
||||
s32 var_v0;
|
||||
s32 var_v1;
|
||||
u16 temp_t0;
|
||||
|
||||
var_v1 = 0;
|
||||
for (var_v0 = 0; var_v0 < 0x7D0; var_v0++) {
|
||||
temp_a0 = src->posX;
|
||||
temp_a2 = src->posY;
|
||||
temp_a3 = src->posZ;
|
||||
temp_t0 = src->trackSectionId;
|
||||
src++;
|
||||
if (((temp_a0 & 0xFFFF) == 0x8000) && ((temp_a2 & 0xFFFF) == 0x8000) && ((temp_a3 & 0xFFFF) == 0x8000)) {
|
||||
break;
|
||||
}
|
||||
if (gIsMirrorMode != 0) {
|
||||
dest->posX = -temp_a0;
|
||||
} else {
|
||||
dest->posX = temp_a0;
|
||||
}
|
||||
var_v1++;
|
||||
dest->posY = temp_a2;
|
||||
dest->posZ = temp_a3;
|
||||
dest->trackSectionId = temp_t0;
|
||||
dest++;
|
||||
}
|
||||
return var_v1;
|
||||
}
|
||||
|
||||
s32 generate_2d_path(Path2D* pathDest, TrackPathPoint* pathSrc, s32 numPathPoints) {
|
||||
f32 temp_f14_3;
|
||||
f32 temp_f16_2;
|
||||
UNUSED s32 pad;
|
||||
|
||||
f32 x1;
|
||||
f32 z1;
|
||||
f32 x2;
|
||||
f32 z2;
|
||||
f32 x3;
|
||||
f32 z3;
|
||||
|
||||
UNUSED s32 pad2;
|
||||
f32 temp_f24;
|
||||
|
||||
f32 spA8;
|
||||
f32 temp_f26;
|
||||
f32 spA0;
|
||||
|
||||
f32 temp_f2_3;
|
||||
|
||||
TrackPathPoint* point1;
|
||||
f32 j;
|
||||
TrackPathPoint* point2;
|
||||
TrackPathPoint* point3;
|
||||
s32 i;
|
||||
f32 temp_f6 = 0.0f;
|
||||
s32 nbElement;
|
||||
f32 sp7C;
|
||||
|
||||
spA8 = pathSrc[0].posX;
|
||||
spA0 = pathSrc[0].posZ;
|
||||
nbElement = 0;
|
||||
|
||||
for (i = 0; i < numPathPoints; i++) {
|
||||
point1 = &pathSrc[((i % numPathPoints))];
|
||||
point2 = &pathSrc[(((i + 1) % numPathPoints))];
|
||||
point3 = &pathSrc[(((i + 2) % numPathPoints))];
|
||||
x1 = point1->posX;
|
||||
z1 = point1->posZ;
|
||||
x2 = point2->posX;
|
||||
z2 = point2->posZ;
|
||||
x3 = point3->posX;
|
||||
z3 = point3->posZ;
|
||||
|
||||
sp7C = 0.05 / (sqrtf(((x2 - x1) * (x2 - x1)) + ((z2 - z1) * (z2 - z1))) +
|
||||
sqrtf(((x3 - x2) * (x3 - x2)) + ((z3 - z2) * (z3 - z2))));
|
||||
|
||||
for (j = 0.0f; j <= 1.0; j += sp7C) {
|
||||
temp_f2_3 = (1.0 - j) * 0.5 * (1.0 - j);
|
||||
temp_f14_3 = ((1.0 - j) * j) + 0.5;
|
||||
temp_f16_2 = j * 0.5 * j;
|
||||
|
||||
temp_f24 = (temp_f2_3 * x1) + (temp_f14_3 * x2) + (temp_f16_2 * x3);
|
||||
temp_f26 = (temp_f2_3 * z1) + (temp_f14_3 * z2) + (temp_f16_2 * z3);
|
||||
temp_f6 += sqrtf(((temp_f24 - spA8) * (temp_f24 - spA8)) + ((temp_f26 - spA0) * (temp_f26 - spA0)));
|
||||
spA8 = temp_f24;
|
||||
spA0 = temp_f26;
|
||||
if ((temp_f6 > 20.0f) || ((i == 0) && (j == 0.0))) {
|
||||
if (gIsMirrorMode) {
|
||||
pathDest->x = (s16) -spA8;
|
||||
} else {
|
||||
pathDest->x = (s16) spA8;
|
||||
}
|
||||
pathDest->z = spA0;
|
||||
nbElement += 1;
|
||||
pathDest++;
|
||||
temp_f6 = 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nbElement;
|
||||
}
|
||||
@@ -0,0 +1,849 @@
|
||||
#include <ultra64.h>
|
||||
#include <macros.h>
|
||||
#include <defines.h>
|
||||
#include <path.h>
|
||||
#include <course.h>
|
||||
#include "main.h"
|
||||
#include "cpu_vehicles_camera_path.h"
|
||||
|
||||
bool are_in_curve(UNUSED s32 arg0, u16 pathPointIndex) {
|
||||
s16 thing = gCurrentTrackConsecutiveCurveCountsPath[pathPointIndex];
|
||||
if (thing > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool is_far_from_path(s32 playerIndex) {
|
||||
f32 value = gTrackPositionFactor[playerIndex];
|
||||
if ((1.1f <= value) || (value <= -1.1f)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates a factor representing where the player is positioned between left and right track boundaries
|
||||
* Returns a value between -1.0 and 1.0:
|
||||
* -1.0 = On the left boundary
|
||||
* 0.0 = In the middle of the track
|
||||
* 1.0 = On the right boundary
|
||||
*
|
||||
* @param posX Player's X position
|
||||
* @param posZ Player's Z position
|
||||
* @param pathPointIndex Current pathPoint index
|
||||
* @param pathIndex Current path/track index
|
||||
* @return Position factor between track boundaries
|
||||
*/
|
||||
f32 calculate_track_position_factor(f32 posX, f32 posZ, u16 pathPointIndex, s32 pathIndex) {
|
||||
f32 leftX;
|
||||
f32 leftZ;
|
||||
f32 rightX;
|
||||
f32 rightZ;
|
||||
f32 boundarySquaredDistance;
|
||||
f32 positionFactor;
|
||||
TrackPathPoint* leftPathPoint;
|
||||
TrackPathPoint* rightPathPoint;
|
||||
|
||||
leftPathPoint = &gTrackLeftPaths[pathIndex][pathPointIndex];
|
||||
rightPathPoint = &gTrackRightPaths[pathIndex][pathPointIndex];
|
||||
|
||||
leftX = leftPathPoint->posX;
|
||||
leftZ = leftPathPoint->posZ;
|
||||
rightX = rightPathPoint->posX;
|
||||
rightZ = rightPathPoint->posZ;
|
||||
|
||||
boundarySquaredDistance = ((rightX - leftX) * (rightX - leftX)) + ((rightZ - leftZ) * (rightZ - leftZ));
|
||||
|
||||
// Avoid division by zero for very close or identical boundary points
|
||||
if (boundarySquaredDistance < 0.01f) {
|
||||
return 0.0f;
|
||||
}
|
||||
// Calculate normalized position factor using vector projection
|
||||
// Formula: 2 * (dot product of vectors) / (squared magnitude) - 1
|
||||
// This maps the position to a -1 to 1 range
|
||||
positionFactor =
|
||||
((2.0f * ((rightX - leftX) * (posX - leftX) + (rightZ - leftZ) * (posZ - leftZ))) / boundarySquaredDistance) -
|
||||
1.0f;
|
||||
return positionFactor;
|
||||
}
|
||||
|
||||
void update_player_position_factor(s32 playerId, u16 pathPointIndex, s32 pathIndex) {
|
||||
UNUSED Vec3f pad;
|
||||
gTrackPositionFactor[playerId] = 0.0f;
|
||||
if ((s32) GET_COURSE_AIMaximumSeparation >= 0) {
|
||||
if ((gPlayers[playerId].type & PLAYER_EXISTS) != 0) {
|
||||
gTrackPositionFactor[playerId] = calculate_track_position_factor(
|
||||
gPlayers[playerId].pos[0], gPlayers[playerId].pos[2], pathPointIndex, pathIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void calculate_track_offset_position(u16 pathPointIndex, f32 lerpFactor, f32 offsetDistance, s16 pathIndex) {
|
||||
UNUSED s32 pad[4];
|
||||
f32 pathPointOneX;
|
||||
f32 pathPointOneZ;
|
||||
f32 pathPointTwoX;
|
||||
f32 pathPointTwoZ;
|
||||
UNUSED s32 pad2;
|
||||
f32 xdiff;
|
||||
f32 zdiff;
|
||||
f32 segmentLength;
|
||||
UNUSED f32 temp_f12;
|
||||
UNUSED f32 temp_f2_2;
|
||||
UNUSED TrackPathPoint* path;
|
||||
TrackPathPoint* pathPointTwo;
|
||||
TrackPathPoint* pathPointOne;
|
||||
|
||||
pathPointOne = &gTrackPaths[pathIndex][pathPointIndex];
|
||||
pathPointOneX = pathPointOne->posX;
|
||||
pathPointOneZ = pathPointOne->posZ;
|
||||
pathPointTwo = &gTrackPaths[pathIndex][(pathPointIndex + 1) % gSelectedPathCount];
|
||||
pathPointTwoX = pathPointTwo->posX;
|
||||
pathPointTwoZ = pathPointTwo->posZ;
|
||||
|
||||
// Calculate vector between path
|
||||
zdiff = pathPointTwoZ - pathPointOneZ;
|
||||
xdiff = pathPointTwoX - pathPointOneX;
|
||||
if (xdiff && xdiff) {}
|
||||
|
||||
segmentLength = sqrtf((xdiff * xdiff) + (zdiff * zdiff));
|
||||
if (segmentLength < 0.01f) {
|
||||
gOffsetPosition[0] = pathPointTwoX;
|
||||
gOffsetPosition[2] = pathPointTwoZ;
|
||||
} else {
|
||||
gOffsetPosition[0] =
|
||||
((0.5f - (lerpFactor * 0.5f)) * (((offsetDistance * zdiff) / segmentLength) + pathPointOneX)) +
|
||||
((1.0f - (0.5f - (lerpFactor * 0.5f))) * (((offsetDistance * -zdiff) / segmentLength) + pathPointOneX));
|
||||
gOffsetPosition[2] =
|
||||
((0.5f - (lerpFactor * 0.5f)) * (((offsetDistance * -xdiff) / segmentLength) + pathPointOneZ)) +
|
||||
((1.0f - (0.5f - (lerpFactor * 0.5f))) * (((offsetDistance * xdiff) / segmentLength) + pathPointOneZ));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates an interpolated position between left and right track paths.
|
||||
*
|
||||
* @param currentPathPoint Index of the current pathPoint
|
||||
* @param trackOffset Value between 0.0 and 1.0 determining position between left (0.0) and right (1.0) path
|
||||
* @param pathIndex Index of the track/path segment
|
||||
*/
|
||||
void set_track_offset_position(u16 pathPointIndex, f32 trackOffset, s16 pathIndex) {
|
||||
TrackPathPoint* path1;
|
||||
TrackPathPoint* path2;
|
||||
f32 x1;
|
||||
f32 z1;
|
||||
f32 x3;
|
||||
f32 z3;
|
||||
f32 x2;
|
||||
f32 z2;
|
||||
f32 x4;
|
||||
f32 z4;
|
||||
f32 temp_f0;
|
||||
f32 temp_f12;
|
||||
|
||||
path1 = &gTrackLeftPaths[pathIndex][pathPointIndex];
|
||||
path2 = &gTrackRightPaths[pathIndex][pathPointIndex];
|
||||
|
||||
x1 = (f32) path1->posX;
|
||||
z1 = (f32) path1->posZ;
|
||||
|
||||
x2 = (f32) path2->posX;
|
||||
z2 = (f32) path2->posZ;
|
||||
|
||||
pathPointIndex += 1;
|
||||
pathPointIndex = pathPointIndex % gPathCountByPathIndex[pathIndex];
|
||||
|
||||
path1 = &gTrackLeftPaths[pathIndex][pathPointIndex];
|
||||
path2 = &gTrackRightPaths[pathIndex][pathPointIndex];
|
||||
|
||||
x3 = (f32) path1->posX;
|
||||
z3 = (f32) path1->posZ;
|
||||
|
||||
x4 = (f32) path2->posX;
|
||||
z4 = (f32) path2->posZ;
|
||||
|
||||
temp_f0 = 0.5f - (trackOffset / 2.0f);
|
||||
temp_f12 = 1.0f - temp_f0;
|
||||
gOffsetPosition[0] = ((temp_f0 * (x1 + x3)) / 2.0f) + ((temp_f12 * (x2 + x4)) / 2.0f);
|
||||
gOffsetPosition[2] = ((temp_f0 * (z1 + z3)) / 2.0f) + ((temp_f12 * (z2 + z4)) / 2.0f);
|
||||
}
|
||||
|
||||
s16 func_8000BD94(f32 posX, f32 posY, f32 posZ, s32 pathIndex) {
|
||||
f32 x_dist;
|
||||
f32 y_dist;
|
||||
f32 z_dist;
|
||||
f32 considerSquaredDistance;
|
||||
f32 minimumSquaredDistance;
|
||||
s32 considerPathPointIndex;
|
||||
s32 pathPathPointCount;
|
||||
s16 nearestPathPointIndex;
|
||||
TrackPathPoint* pathPathPoints;
|
||||
TrackPathPoint* considerPathPoint;
|
||||
|
||||
pathPathPoints = gTrackPaths[pathIndex];
|
||||
pathPathPointCount = gPathCountByPathIndex[pathIndex];
|
||||
considerPathPoint = &pathPathPoints[0];
|
||||
x_dist = (f32) considerPathPoint->posX - posX;
|
||||
y_dist = (f32) considerPathPoint->posY - posY;
|
||||
z_dist = (f32) considerPathPoint->posZ - posZ;
|
||||
minimumSquaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist);
|
||||
nearestPathPointIndex = 0;
|
||||
for (considerPathPointIndex = 1; considerPathPointIndex < pathPathPointCount;
|
||||
considerPathPoint++, considerPathPointIndex++) {
|
||||
x_dist = (f32) considerPathPoint->posX - posX;
|
||||
y_dist = (f32) considerPathPoint->posY - posY;
|
||||
z_dist = (f32) considerPathPoint->posZ - posZ;
|
||||
considerSquaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist);
|
||||
if (considerSquaredDistance < minimumSquaredDistance) {
|
||||
nearestPathPointIndex = considerPathPointIndex;
|
||||
minimumSquaredDistance = considerSquaredDistance;
|
||||
}
|
||||
}
|
||||
return nearestPathPointIndex;
|
||||
}
|
||||
|
||||
s16 find_closest_pathPoint_track_section(f32 posX, f32 posY, f32 posZ, u16 trackSectionId, s32* pathIndex) {
|
||||
TrackPathPoint* pathPathPoints;
|
||||
TrackPathPoint* considerPathPoint;
|
||||
f32 x_dist;
|
||||
f32 y_dist;
|
||||
f32 z_dist;
|
||||
f32 considerSquaredDistance;
|
||||
f32 minimumSquaredDistance;
|
||||
s32 considerPathPointIndex;
|
||||
s32 pathPathPointCount;
|
||||
s32 temp_t0;
|
||||
s32 var_a1;
|
||||
s32 var_t1;
|
||||
s32 considerPathIndex;
|
||||
s32 var_t4;
|
||||
s16 nearestPathPointIndex;
|
||||
|
||||
minimumSquaredDistance = 1000000.0f;
|
||||
temp_t0 = *pathIndex;
|
||||
nearestPathPointIndex = 0;
|
||||
var_t1 = 0;
|
||||
var_a1 = 0;
|
||||
pathPathPoints = gTrackPaths[temp_t0];
|
||||
pathPathPointCount = gPathCountByPathIndex[temp_t0];
|
||||
considerPathPoint = &pathPathPoints[0];
|
||||
for (considerPathPointIndex = 0; considerPathPointIndex < pathPathPointCount;
|
||||
considerPathPointIndex++, considerPathPoint++) {
|
||||
if ((considerPathPoint->trackSectionId == trackSectionId) || (gCurrentCourseId == COURSE_AWARD_CEREMONY)) {
|
||||
var_t1 = 1;
|
||||
x_dist = (f32) considerPathPoint->posX - posX;
|
||||
y_dist = (f32) considerPathPoint->posY - posY;
|
||||
z_dist = (f32) considerPathPoint->posZ - posZ;
|
||||
considerSquaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist);
|
||||
if (considerSquaredDistance < minimumSquaredDistance) {
|
||||
nearestPathPointIndex = considerPathPointIndex;
|
||||
var_a1 = 1;
|
||||
minimumSquaredDistance = considerSquaredDistance;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (var_t1 == 0) {
|
||||
for (considerPathIndex = 0; considerPathIndex < 4; considerPathIndex++) {
|
||||
if ((considerPathIndex != temp_t0) && (gSizePath[considerPathIndex] >= 2)) {
|
||||
pathPathPoints = gTrackPaths[considerPathIndex];
|
||||
considerPathPoint = &pathPathPoints[0];
|
||||
pathPathPointCount = gPathCountByPathIndex[considerPathIndex];
|
||||
for (considerPathPointIndex = 0; considerPathPointIndex < pathPathPointCount;
|
||||
considerPathPointIndex++, considerPathPoint++) {
|
||||
if (considerPathPoint->trackSectionId == trackSectionId) {
|
||||
x_dist = (f32) considerPathPoint->posX - posX;
|
||||
y_dist = (f32) considerPathPoint->posY - posY;
|
||||
z_dist = (f32) considerPathPoint->posZ - posZ;
|
||||
considerSquaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist);
|
||||
if (considerSquaredDistance < minimumSquaredDistance) {
|
||||
nearestPathPointIndex = considerPathPointIndex;
|
||||
var_t4 = considerPathIndex;
|
||||
var_a1 = 2;
|
||||
minimumSquaredDistance = considerSquaredDistance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (var_a1 == 0) {
|
||||
pathPathPoints = gTrackPaths[0];
|
||||
pathPathPointCount = gPathCountByPathIndex[0];
|
||||
considerPathPoint = &pathPathPoints[0];
|
||||
x_dist = (f32) considerPathPoint->posX - posX;
|
||||
y_dist = (f32) considerPathPoint->posY - posY;
|
||||
z_dist = (f32) considerPathPoint->posZ - posZ;
|
||||
minimumSquaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist);
|
||||
nearestPathPointIndex = 0;
|
||||
for (considerPathPointIndex = 1; considerPathPointIndex < pathPathPointCount;
|
||||
considerPathPoint++, considerPathPointIndex++) {
|
||||
x_dist = (f32) considerPathPoint->posX - posX;
|
||||
y_dist = (f32) considerPathPoint->posY - posY;
|
||||
z_dist = (f32) considerPathPoint->posZ - posZ;
|
||||
considerSquaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist);
|
||||
if (considerSquaredDistance < minimumSquaredDistance) {
|
||||
nearestPathPointIndex = considerPathPointIndex;
|
||||
var_t4 = 0;
|
||||
var_a1 = 2;
|
||||
minimumSquaredDistance = considerSquaredDistance;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (var_a1 == 2) {
|
||||
*pathIndex = var_t4;
|
||||
}
|
||||
return nearestPathPointIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to find the pathPoint nearest to (posX, posY, posZ)
|
||||
* Only consider path in the same segment as trackSectionId
|
||||
* Only considers path within 500 units of(posX, posY, posZ)
|
||||
* Looks 3 path behind and 6 path ahead of pathPointIndex
|
||||
**/
|
||||
s16 update_path_index_with_track(f32 posX, f32 posY, f32 posZ, s16 pathPointIndex, s32 pathIndex, u16 trackSectionId) {
|
||||
s16 nearestPathPointIndex;
|
||||
s16 searchIndex;
|
||||
s16 considerIndex;
|
||||
s32 pathPathPointCount;
|
||||
f32 x_dist;
|
||||
f32 y_dist;
|
||||
f32 z_dist;
|
||||
f32 minimumDistance;
|
||||
f32 squaredDistance;
|
||||
TrackPathPoint* pathPathPoints;
|
||||
TrackPathPoint* considerPathPoint;
|
||||
|
||||
nearestPathPointIndex = -1;
|
||||
minimumDistance = 500.0f * 500.0f;
|
||||
pathPathPointCount = gPathCountByPathIndex[pathIndex];
|
||||
pathPathPoints = gTrackPaths[pathIndex];
|
||||
for (searchIndex = pathPointIndex - 3; searchIndex < pathPointIndex + 7; searchIndex++) {
|
||||
// Its possible for searchIndex to be less than 0 or greater than the number of path in a given path
|
||||
// This is done to ensure we access gTrackPaths at a valid index
|
||||
considerIndex = (searchIndex + pathPathPointCount) % pathPathPointCount;
|
||||
considerPathPoint = &pathPathPoints[considerIndex];
|
||||
if (considerPathPoint->trackSectionId == trackSectionId) {
|
||||
x_dist = considerPathPoint->posX - posX;
|
||||
y_dist = considerPathPoint->posY - posY;
|
||||
z_dist = considerPathPoint->posZ - posZ;
|
||||
squaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist);
|
||||
if (squaredDistance < minimumDistance) {
|
||||
minimumDistance = squaredDistance;
|
||||
nearestPathPointIndex = considerIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nearestPathPointIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to find the pathPoint nearest to (posX, posY, posZ)
|
||||
* Only considers path within 400 units of (posX, posY, posZ)
|
||||
* Looks 3 path behind and 6 path ahead of pathPointIndex
|
||||
**/
|
||||
s16 update_path_index(f32 posX, f32 posY, f32 posZ, s16 pathPointIndex, s32 pathIndex) {
|
||||
s16 nearestPathPointIndex;
|
||||
s16 searchIndex;
|
||||
s16 considerIndex;
|
||||
bool pathPointFound;
|
||||
s32 pathPathPointCount;
|
||||
f32 x_dist;
|
||||
f32 y_dist;
|
||||
f32 z_dist;
|
||||
f32 minimumDistance;
|
||||
f32 squaredDistance;
|
||||
TrackPathPoint* pathPathPoints;
|
||||
TrackPathPoint* considerPathPoint;
|
||||
|
||||
pathPointFound = false;
|
||||
nearestPathPointIndex = -1;
|
||||
minimumDistance = 400.0f * 400.0f;
|
||||
pathPathPointCount = gPathCountByPathIndex[pathIndex];
|
||||
pathPathPoints = gTrackPaths[pathIndex];
|
||||
for (searchIndex = pathPointIndex - 3; searchIndex < pathPointIndex + 7; searchIndex++) {
|
||||
// Its possible for searchIndex to be less than 0 or greater than the number of path in a given path
|
||||
// This is done to ensure we access gTrackPaths at a valid index
|
||||
considerIndex = (searchIndex + pathPathPointCount) % pathPathPointCount;
|
||||
considerPathPoint = &pathPathPoints[considerIndex];
|
||||
x_dist = considerPathPoint->posX - posX;
|
||||
y_dist = considerPathPoint->posY - posY;
|
||||
z_dist = considerPathPoint->posZ - posZ;
|
||||
squaredDistance = (x_dist * x_dist) + (y_dist * y_dist) + (z_dist * z_dist);
|
||||
if (squaredDistance < minimumDistance) {
|
||||
minimumDistance = squaredDistance;
|
||||
nearestPathPointIndex = considerIndex;
|
||||
pathPointFound = true;
|
||||
}
|
||||
}
|
||||
if (pathPointFound == false) {
|
||||
for (searchIndex = pathPointIndex - 3; searchIndex < pathPointIndex + 7; searchIndex++) {
|
||||
considerIndex = ((searchIndex + pathPathPointCount) % pathPathPointCount);
|
||||
considerPathPoint = &pathPathPoints[considerIndex];
|
||||
/**
|
||||
* This fake match is done to stop the compiler from optimzing out considerPathPoint.
|
||||
* Maybe if no pathPoint was found some debugging info was printed out, but come
|
||||
* production time they removed the debug printing but not the loop?
|
||||
**/
|
||||
if (considerPathPoint && considerPathPoint) {};
|
||||
}
|
||||
}
|
||||
return nearestPathPointIndex;
|
||||
}
|
||||
|
||||
void tweak_path_index_wario_stadium(UNUSED f32 posX, f32 posY, UNUSED f32 posZ, s16* pathPointIndex, UNUSED s32 arg4) {
|
||||
s16 var_v0;
|
||||
|
||||
var_v0 = *pathPointIndex;
|
||||
if ((gCurrentCourseId == COURSE_WARIO_STADIUM) && (var_v0 >= 0x475) && (var_v0 < 0x480) && (posY < 0.0f)) {
|
||||
var_v0 = 0x0398;
|
||||
}
|
||||
*pathPointIndex = var_v0;
|
||||
}
|
||||
|
||||
void adjust_path_at_start_line(UNUSED f32 posX, UNUSED f32 posY, f32 posZ, s16* pathPointIndex, s32 pathIndex) {
|
||||
s16 pathPoint;
|
||||
pathPoint = *pathPointIndex;
|
||||
if (pathPoint == 0) {
|
||||
if (gPathStartZ < posZ) {
|
||||
pathPoint = gPathCountByPathIndex[pathIndex] - 1;
|
||||
}
|
||||
} else if (((pathPoint + 1) == gPathCountByPathIndex[pathIndex]) && (posZ <= gPathStartZ)) {
|
||||
pathPoint = 0;
|
||||
}
|
||||
*pathPointIndex = pathPoint;
|
||||
}
|
||||
|
||||
s16 update_path_index_track_section(f32 posX, f32 posY, f32 posZ, Player* player, s32 playerId, s32* pathIndex) {
|
||||
u16 trackSectionId;
|
||||
s16 ret;
|
||||
|
||||
trackSectionId = get_track_section_id(player->collision.meshIndexZX);
|
||||
if ((trackSectionId <= 0) || (trackSectionId >= 0x33)) {
|
||||
trackSectionId = gPlayersTrackSectionId[playerId];
|
||||
}
|
||||
gPlayersTrackSectionId[playerId] = trackSectionId;
|
||||
ret = find_closest_pathPoint_track_section(posX, posY, posZ, trackSectionId, pathIndex);
|
||||
gPathIndexByPlayerId[playerId] = *pathIndex;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates and validates a player's pathPoint position on the track
|
||||
* Handles different logic for human players vs AI, and includes recovery mechanisms
|
||||
*
|
||||
* @param posX Current X position
|
||||
* @param posY Current Y position
|
||||
* @param posZ Current Z position
|
||||
* @param pathPointIndex Current pathPoint index
|
||||
* @param player Pointer to player structure
|
||||
* @param playerId Player's ID
|
||||
* @param pathIndex Current track path index
|
||||
* @return New pathPoint index or -1 if invalid
|
||||
*/
|
||||
s16 update_player_path(f32 posX, f32 posY, f32 posZ, s16 pathPointIndex, Player* player, s32 playerId, s32 pathIndex) {
|
||||
s16 newPathPoint;
|
||||
UNUSED s16 stackPadding0;
|
||||
UNUSED s32 stackPadding1;
|
||||
UNUSED s32 stackPadding2;
|
||||
TrackPathPoint* temp_v1;
|
||||
|
||||
// Human player handling (non-AI controlled)
|
||||
if ((player->type & PLAYER_HUMAN) && !(player->type & PLAYER_CPU)) {
|
||||
newPathPoint = update_path_index_with_track(posX, posY, posZ, pathPointIndex, pathIndex,
|
||||
(u16) get_track_section_id(player->collision.meshIndexZX));
|
||||
if (newPathPoint == -1) {
|
||||
newPathPoint = update_path_index_track_section(posX, posY, posZ, player, playerId, &pathIndex);
|
||||
}
|
||||
} else { // AI or special case player handling
|
||||
if (D_801631E0[playerId] == true) {
|
||||
if (player->unk_0CA & 1) {
|
||||
temp_v1 = &gTrackPaths[pathIndex][pathPointIndex];
|
||||
player->pos[0] = (f32) temp_v1->posX;
|
||||
player->pos[1] = (f32) temp_v1->posY;
|
||||
player->pos[2] = (f32) temp_v1->posZ;
|
||||
player->unk_0CA &= ~0x0001;
|
||||
return pathPointIndex;
|
||||
}
|
||||
if (playerId == ((s32) D_80163488 % 8)) {
|
||||
check_bounding_collision(&player->collision, 10.0f, posX, posY, posZ);
|
||||
gPlayersTrackSectionId[playerId] = get_track_section_id(player->collision.meshIndexZX);
|
||||
newPathPoint = update_path_index_with_track(posX, posY, posZ, pathPointIndex, pathIndex,
|
||||
gPlayersTrackSectionId[playerId]);
|
||||
if (newPathPoint == -1) {
|
||||
newPathPoint = update_path_index(posX, posY, posZ, pathPointIndex, pathIndex);
|
||||
}
|
||||
if (newPathPoint == -1) {
|
||||
newPathPoint = find_closest_pathPoint_track_section(posX, posY, posZ,
|
||||
gPlayersTrackSectionId[playerId], &pathIndex);
|
||||
temp_v1 = &gTrackPaths[pathIndex][newPathPoint];
|
||||
player->pos[0] = (f32) temp_v1->posX;
|
||||
player->pos[1] = (f32) temp_v1->posY;
|
||||
player->pos[2] = (f32) temp_v1->posZ;
|
||||
}
|
||||
} else {
|
||||
newPathPoint = update_path_index(posX, posY, posZ, pathPointIndex, pathIndex);
|
||||
if (newPathPoint == -1) {
|
||||
newPathPoint = func_8000BD94(posX, posY, posZ, pathIndex);
|
||||
temp_v1 = &gTrackPaths[pathIndex][newPathPoint];
|
||||
posX = (f32) temp_v1->posX;
|
||||
posY = (f32) temp_v1->posY;
|
||||
posZ = (f32) temp_v1->posZ;
|
||||
player->pos[0] = posX;
|
||||
player->pos[1] = posY;
|
||||
player->pos[2] = posZ;
|
||||
check_bounding_collision(&player->collision, 10.0f, posX, posY, posZ);
|
||||
gPlayersTrackSectionId[playerId] = get_track_section_id(player->collision.meshIndexZX);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newPathPoint = update_path_index(posX, posY, posZ, pathPointIndex, pathIndex);
|
||||
if (newPathPoint == -1) {
|
||||
newPathPoint = update_path_index_track_section(posX, posY, posZ, player, playerId, &pathIndex);
|
||||
}
|
||||
}
|
||||
tweak_path_index_wario_stadium(posX, posY, posZ, &newPathPoint, pathIndex);
|
||||
}
|
||||
adjust_path_at_start_line(posX, posY, posZ, &newPathPoint, pathIndex);
|
||||
return newPathPoint;
|
||||
}
|
||||
|
||||
s16 find_closest_vehicles_pathPoint(f32 xPos, UNUSED f32 yPos, f32 zPos, s16 pathPointIndex) {
|
||||
f32 xdiff;
|
||||
f32 zdiff;
|
||||
f32 minimumDistance;
|
||||
f32 considerSquaredDistance;
|
||||
s16 realIndex;
|
||||
s16 minimumIndex;
|
||||
s16 considerIndex;
|
||||
Path2D* considerPathPoint;
|
||||
|
||||
minimumDistance = 250000.0f;
|
||||
minimumIndex = -1;
|
||||
for (realIndex = pathPointIndex - 2; realIndex < pathPointIndex + 7; realIndex++) {
|
||||
considerIndex = realIndex;
|
||||
if (realIndex < 0) {
|
||||
considerIndex = realIndex + gVehicle2DPathLength;
|
||||
}
|
||||
considerIndex %= gVehicle2DPathLength;
|
||||
considerPathPoint = &gVehicle2DPathPoint[considerIndex];
|
||||
xdiff = considerPathPoint->x - xPos;
|
||||
zdiff = considerPathPoint->z - zPos;
|
||||
considerSquaredDistance = (xdiff * xdiff) + (zdiff * zdiff);
|
||||
if (considerSquaredDistance < minimumDistance) {
|
||||
minimumDistance = considerSquaredDistance;
|
||||
minimumIndex = considerIndex;
|
||||
}
|
||||
}
|
||||
if (minimumIndex == -1) {
|
||||
minimumIndex = pathPointIndex;
|
||||
}
|
||||
return minimumIndex;
|
||||
}
|
||||
|
||||
s16 func_8000D24C(f32 posX, f32 posY, f32 posZ, s32* pathIndex) {
|
||||
UNUSED s32 pad;
|
||||
Collision sp24;
|
||||
|
||||
check_bounding_collision(&sp24, 10.0f, posX, posY, posZ);
|
||||
return find_closest_pathPoint_track_section(posX, posY, posZ, get_track_section_id(sp24.meshIndexZX), pathIndex);
|
||||
}
|
||||
|
||||
s16 func_8000D2B4(f32 posX, f32 posY, f32 posZ, s16 pathPointIndex, s32 pathIndex) {
|
||||
s16 pathPoint;
|
||||
|
||||
pathPoint = update_path_index(posX, posY, posZ, pathPointIndex, pathIndex);
|
||||
if (pathPoint == -1) {
|
||||
pathPoint = func_8000D24C(posX, posY, posZ, &pathIndex);
|
||||
}
|
||||
adjust_path_at_start_line(posX, posY, posZ, &pathPoint, pathIndex);
|
||||
return pathPoint;
|
||||
}
|
||||
|
||||
s16 func_8000D33C(f32 posX, f32 posY, f32 posZ, s16 pathPointIndex, s32 pathIndex) {
|
||||
s16 pathPoint;
|
||||
|
||||
pathPoint = update_path_index(posX, posY, posZ, pathPointIndex, pathIndex);
|
||||
if (pathPoint == -1) {
|
||||
pathPoint = func_8000D24C(posX, posY, posZ, &pathIndex);
|
||||
}
|
||||
return pathPoint;
|
||||
}
|
||||
|
||||
f32 cpu_track_position_factor(s32 playerId) {
|
||||
TrackPositionFactorInstruction* temp_v0;
|
||||
f32 target;
|
||||
f32 current;
|
||||
|
||||
temp_v0 = &gPlayerTrackPositionFactorInstruction[playerId];
|
||||
current = temp_v0->current;
|
||||
target = temp_v0->target;
|
||||
if (current < target) {
|
||||
current += temp_v0->step;
|
||||
if (target < current) {
|
||||
current = target;
|
||||
}
|
||||
} else if (target < current) {
|
||||
current -= temp_v0->step;
|
||||
if (current < target) {
|
||||
current = target;
|
||||
}
|
||||
}
|
||||
temp_v0->current = current;
|
||||
return current;
|
||||
}
|
||||
|
||||
void determine_ideal_cpu_position_offset(s32 playerId, u16 pathPoint) {
|
||||
UNUSED s32 stackPadding0;
|
||||
f32 sp48;
|
||||
f32 sp44;
|
||||
UNUSED s32 stackPadding1;
|
||||
UNUSED s32 stackPadding2;
|
||||
UNUSED s32 stackPadding3;
|
||||
f32 stackPadding4;
|
||||
f32 stackPadding5;
|
||||
f32 sp2C;
|
||||
s32 lookAheadDistance;
|
||||
s16 curveCount;
|
||||
u16 thing;
|
||||
|
||||
curveCount = gCurrentTrackConsecutiveCurveCountsPath[pathPoint];
|
||||
lookAheadDistance = 6;
|
||||
sp2C = cpu_track_position_factor(playerId);
|
||||
thing = pathPoint;
|
||||
|
||||
switch (gCurrentCourseId) {
|
||||
case COURSE_AWARD_CEREMONY:
|
||||
lookAheadDistance = 1;
|
||||
break;
|
||||
case COURSE_TOADS_TURNPIKE:
|
||||
lookAheadDistance = 7;
|
||||
break;
|
||||
case COURSE_YOSHI_VALLEY:
|
||||
break;
|
||||
default:
|
||||
if (curveCount < 6) {
|
||||
lookAheadDistance = 8;
|
||||
} else if (curveCount >= 0x15) {
|
||||
lookAheadDistance = 20;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (lookAheadDistance >= 8) {
|
||||
if ((gTrackPositionFactor[playerId] > 0.75f) && (gCurrentTrackSectionTypesPath[thing] == RIGHT_LEANING_CURVE)) {
|
||||
lookAheadDistance = 7;
|
||||
}
|
||||
if ((gTrackPositionFactor[playerId] < -0.75f) && (gCurrentTrackSectionTypesPath[thing] == LEFT_LEANING_CURVE)) {
|
||||
lookAheadDistance = 7;
|
||||
}
|
||||
}
|
||||
if (is_far_from_path(playerId) == true) {
|
||||
lookAheadDistance = 5;
|
||||
}
|
||||
if (gCurrentPlayerLookAhead[playerId] < lookAheadDistance) {
|
||||
gCurrentPlayerLookAhead[playerId]++;
|
||||
}
|
||||
if (lookAheadDistance < gCurrentPlayerLookAhead[playerId]) {
|
||||
gCurrentPlayerLookAhead[playerId]--;
|
||||
}
|
||||
pathPoint = (gCurrentPlayerLookAhead[playerId] + pathPoint) % gSelectedPathCount;
|
||||
set_track_offset_position(pathPoint, sp2C, gPlayerPathIndex);
|
||||
sp48 = gOffsetPosition[0];
|
||||
sp44 = gOffsetPosition[2];
|
||||
set_track_offset_position(((pathPoint + 1) % gSelectedPathCount) & 0xFFFF, sp2C, gPlayerPathIndex);
|
||||
stackPadding5 = gOffsetPosition[0];
|
||||
gOffsetPosition[0] = (sp48 + stackPadding5) * 0.5f;
|
||||
stackPadding4 = gOffsetPosition[2];
|
||||
gOffsetPosition[2] = (sp44 + stackPadding4) * 0.5f;
|
||||
}
|
||||
|
||||
s16 func_8000D6D0(Vec3f position, s16* pathPointIndex, f32 speed, f32 arg3, s16 pathIndex, s16 arg5) {
|
||||
f32 temp1;
|
||||
f32 temp2;
|
||||
f32 midX;
|
||||
UNUSED s16 stackPadding1;
|
||||
s16 pathPoint1;
|
||||
s16 pathPoint2;
|
||||
f32 pad3;
|
||||
f32 midY;
|
||||
f32 pad4;
|
||||
f32 midZ;
|
||||
f32 distance;
|
||||
f32 oldPosX;
|
||||
f32 oldPosY;
|
||||
f32 oldPosZ;
|
||||
f32 var_f2;
|
||||
f32 var_f12;
|
||||
f32 var_f14;
|
||||
s16 temp_v0;
|
||||
s32 temp_v1;
|
||||
f32 xdiff;
|
||||
f32 ydiff;
|
||||
f32 zdiff;
|
||||
Vec3f oldPos;
|
||||
TrackPathPoint* path;
|
||||
|
||||
path = gTrackPaths[pathIndex];
|
||||
oldPos[0] = position[0];
|
||||
oldPos[1] = position[1];
|
||||
oldPos[2] = position[2];
|
||||
oldPosX = position[0];
|
||||
oldPosY = position[1];
|
||||
oldPosZ = position[2];
|
||||
temp_v0 = func_8000D2B4(oldPosX, oldPosY, oldPosZ, *pathPointIndex, (s32) pathIndex);
|
||||
*pathPointIndex = temp_v0;
|
||||
temp_v1 = temp_v0 + arg5;
|
||||
pathPoint1 = temp_v1 % gPathCountByPathIndex[pathIndex];
|
||||
pathPoint2 = (temp_v1 + 1) % gPathCountByPathIndex[pathIndex];
|
||||
set_track_offset_position(pathPoint1, arg3, pathIndex);
|
||||
pad3 = gOffsetPosition[0];
|
||||
pad4 = gOffsetPosition[2];
|
||||
set_track_offset_position(pathPoint2, arg3, pathIndex);
|
||||
temp1 = gOffsetPosition[0];
|
||||
temp2 = gOffsetPosition[2];
|
||||
midY = (path[pathPoint1].posY + path[pathPoint2].posY) * 0.5f;
|
||||
midX = (pad3 + temp1) * 0.5f;
|
||||
midZ = (pad4 + temp2) * 0.5f;
|
||||
xdiff = midX - oldPosX;
|
||||
ydiff = midY - oldPosY;
|
||||
zdiff = midZ - oldPosZ;
|
||||
distance = sqrtf((xdiff * xdiff) + (ydiff * ydiff) + (zdiff * zdiff));
|
||||
if (distance > 0.01f) {
|
||||
var_f2 = ((xdiff * speed) / distance) + oldPosX;
|
||||
var_f12 = ((ydiff * speed) / distance) + oldPosY;
|
||||
var_f14 = ((zdiff * speed) / distance) + oldPosZ;
|
||||
} else {
|
||||
var_f2 = oldPosX;
|
||||
var_f12 = oldPosY;
|
||||
var_f14 = oldPosZ;
|
||||
}
|
||||
position[0] = var_f2;
|
||||
position[1] = var_f12;
|
||||
position[2] = var_f14;
|
||||
return get_angle_between_path(oldPos, position);
|
||||
}
|
||||
|
||||
s16 func_8000D940(Vec3f pos, s16* pathPointIndex, f32 speed, f32 arg3, s16 pathIndex) {
|
||||
UNUSED f32 pad;
|
||||
f32 thing1;
|
||||
f32 thing2;
|
||||
UNUSED s16 stackPadding1;
|
||||
s16 pathPoint1;
|
||||
s16 pathPoint2;
|
||||
UNUSED s16 stackPadding2;
|
||||
f32 pad2;
|
||||
f32 midX;
|
||||
f32 pad3;
|
||||
f32 midY;
|
||||
f32 midZ;
|
||||
f32 distance;
|
||||
f32 temp_f20;
|
||||
f32 temp_f22;
|
||||
f32 temp_f24;
|
||||
f32 var_f2;
|
||||
f32 var_f12;
|
||||
f32 var_f14;
|
||||
s16 temp_v0;
|
||||
f32 xdiff;
|
||||
f32 ydiff;
|
||||
f32 zdiff;
|
||||
s32 pathPointCount;
|
||||
Vec3f sp54;
|
||||
|
||||
sp54[0] = pos[0];
|
||||
sp54[1] = pos[1];
|
||||
sp54[2] = pos[2];
|
||||
pathPointCount = gPathCountByPathIndex[pathIndex];
|
||||
temp_f20 = pos[0];
|
||||
temp_f22 = pos[1];
|
||||
temp_f24 = pos[2];
|
||||
temp_v0 = func_8000D2B4(temp_f20, temp_f22, temp_f24, *pathPointIndex, (s32) pathIndex);
|
||||
*pathPointIndex = temp_v0;
|
||||
pathPoint1 = ((temp_v0 + pathPointCount) - 3) % pathPointCount;
|
||||
pathPoint2 = ((temp_v0 + pathPointCount) - 4) % pathPointCount;
|
||||
set_track_offset_position(pathPoint1, arg3, pathIndex);
|
||||
pad2 = gOffsetPosition[0];
|
||||
pad3 = gOffsetPosition[2];
|
||||
set_track_offset_position(pathPoint2, arg3, pathIndex);
|
||||
thing1 = gOffsetPosition[0];
|
||||
thing2 = gOffsetPosition[2];
|
||||
midY = (gTrackPaths[pathIndex][pathPoint1].posY + gTrackPaths[pathIndex][pathPoint2].posY) * 0.5f;
|
||||
midX = (pad2 + thing1) * 0.5f;
|
||||
midZ = (pad3 + thing2) * 0.5f;
|
||||
xdiff = midX - temp_f20;
|
||||
ydiff = midY - temp_f22;
|
||||
zdiff = midZ - temp_f24;
|
||||
distance = sqrtf((xdiff * xdiff) + (ydiff * ydiff) + (zdiff * zdiff));
|
||||
if (distance > 0.01f) {
|
||||
var_f2 = ((xdiff * speed) / distance) + temp_f20;
|
||||
var_f12 = ((ydiff * speed) / distance) + temp_f22;
|
||||
var_f14 = ((zdiff * speed) / distance) + temp_f24;
|
||||
} else {
|
||||
var_f2 = temp_f20;
|
||||
var_f12 = temp_f22;
|
||||
var_f14 = temp_f24;
|
||||
}
|
||||
pos[0] = var_f2;
|
||||
pos[1] = var_f12;
|
||||
pos[2] = var_f14;
|
||||
return get_angle_between_path(sp54, pos);
|
||||
}
|
||||
|
||||
s16 update_vehicle_following_path(Vec3f pos, s16* pathPointIndex, f32 speed) {
|
||||
f32 origXPos;
|
||||
f32 origYPos;
|
||||
f32 origZPos;
|
||||
UNUSED s32 stackPadding0;
|
||||
UNUSED s32 stackPadding1;
|
||||
UNUSED s32 stackPadding2;
|
||||
UNUSED s32 stackPadding3;
|
||||
UNUSED s32 stackPadding4;
|
||||
UNUSED s32 stackPadding5;
|
||||
UNUSED s32 stackPadding6;
|
||||
UNUSED s32 stackPadding7;
|
||||
UNUSED s32 stackPadding8;
|
||||
f32 farPathPointAverageX;
|
||||
f32 farPathPointAverageZ;
|
||||
f32 x_dist;
|
||||
f32 y_dist;
|
||||
f32 distance;
|
||||
f32 newX;
|
||||
f32 newZ;
|
||||
s16 newPathPointIndex;
|
||||
s16 farPathPoint1;
|
||||
s16 farPathPoint2;
|
||||
Path2D* temp_a0;
|
||||
Path2D* temp_a2;
|
||||
Vec3f sp38;
|
||||
|
||||
origXPos = pos[0];
|
||||
origYPos = pos[1];
|
||||
origZPos = pos[2];
|
||||
sp38[0] = pos[0];
|
||||
sp38[1] = pos[1];
|
||||
sp38[2] = pos[2];
|
||||
newPathPointIndex = find_closest_vehicles_pathPoint(origXPos, origYPos, origZPos, *pathPointIndex);
|
||||
*pathPointIndex = newPathPointIndex;
|
||||
farPathPoint1 = (newPathPointIndex + 3) % gVehicle2DPathLength;
|
||||
farPathPoint2 = (newPathPointIndex + 4) % gVehicle2DPathLength;
|
||||
temp_a0 = &gVehicle2DPathPoint[farPathPoint1];
|
||||
temp_a2 = &gVehicle2DPathPoint[farPathPoint2];
|
||||
farPathPointAverageX = (temp_a0->x + temp_a2->x) * 0.5f;
|
||||
farPathPointAverageZ = (temp_a0->z + temp_a2->z) * 0.5f;
|
||||
x_dist = farPathPointAverageX - origXPos;
|
||||
y_dist = farPathPointAverageZ - origZPos;
|
||||
distance = sqrtf((x_dist * x_dist) + (y_dist * y_dist));
|
||||
if (distance > 0.01f) {
|
||||
newX = ((x_dist * speed) / distance) + origXPos;
|
||||
newZ = ((y_dist * speed) / distance) + origZPos;
|
||||
} else {
|
||||
newX = origXPos;
|
||||
newZ = origZPos;
|
||||
}
|
||||
pos[0] = newX;
|
||||
pos[1] = origYPos;
|
||||
pos[2] = newZ;
|
||||
return get_angle_between_path(sp38, pos);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,38 +4,38 @@
|
||||
|
||||
#if !ENABLE_CUSTOM_COURSE_ENGINE
|
||||
// @warning Array contains an extra zero element at the end.
|
||||
KartAIBehaviour* gKartAIBehaviourLUT[] = {
|
||||
#include "assets/course_metadata/gKartAIBehaviourLUT.inc.c"
|
||||
CPUBehaviour* cpu_BehaviourLUT[] = {
|
||||
#include "assets/course_metadata/cpu_BehaviourLUT.inc.c"
|
||||
|
||||
};
|
||||
#else
|
||||
|
||||
#endif
|
||||
|
||||
TrackWaypoint nullPath = { 0x8000, 0x0000, 0x0000, 0x0000 };
|
||||
TrackPathPoint nullPath = { 0x8000, 0x0000, 0x0000, 0x0000 };
|
||||
|
||||
#if !ENABLE_CUSTOM_COURSE_ENGINE
|
||||
TrackWaypoint* gCoursePathTable[][4] = {
|
||||
TrackPathPoint* gCoursePathTable[][4] = {
|
||||
#include "assets/course_metadata/gCoursePathTableUnknown.inc.c"
|
||||
};
|
||||
|
||||
TrackWaypoint* gCoursePathTable2[][4] = {
|
||||
TrackPathPoint* gCoursePathTable2[][4] = {
|
||||
#include "assets/course_metadata/gCoursePathTable.inc.c"
|
||||
};
|
||||
|
||||
/// @warning Array contains an extra zero element at the end.
|
||||
s16 gKartAISteeringSensitivity[] = {
|
||||
#include "assets/course_metadata/gCPUSteeringSensitivity.inc.c"
|
||||
s16 cpu_SteeringSensitivity[] = {
|
||||
#include "assets/course_metadata/cpu_SteeringSensitivity.inc.c"
|
||||
};
|
||||
|
||||
// Possibly maximum cpu separation
|
||||
f32 gKartAICourseMaximumSeparation[] = {
|
||||
#include "assets/course_metadata/gKartAICourseMaximumSeparation.inc.c"
|
||||
f32 cpu_CourseMaximumSeparation[] = {
|
||||
#include "assets/course_metadata/cpu_CourseMaximumSeparation.inc.c"
|
||||
};
|
||||
|
||||
// Possibly minimum cpu separation
|
||||
f32 gKartAICourseMinimumSeparation[] = {
|
||||
#include "assets/course_metadata/gKartAICourseMinimumSeparation.inc.c"
|
||||
f32 cpu_CourseMinimumSeparation[] = {
|
||||
#include "assets/course_metadata/cpu_CourseMinimumSeparation.inc.c"
|
||||
};
|
||||
#else
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#ifndef PATH_SPAWN_METADATA_H
|
||||
#define PATH_SPAWN_METADATA_H
|
||||
|
||||
#include "waypoints.h"
|
||||
#include "path.h"
|
||||
#include <common_structs.h>
|
||||
#include <assets/common_data.h>
|
||||
#include "include/bomb_kart.h"
|
||||
|
||||
extern TrackWaypoint nullPath;
|
||||
extern TrackPathPoint nullPath;
|
||||
extern s16 D_800DCAF4[];
|
||||
extern s16 D_800DCB34[];
|
||||
extern BombKartSpawn gBombKartSpawns[][NUM_BOMB_KARTS_MAX];
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <ceremony_and_credits.h>
|
||||
#include <code_800029B0.h>
|
||||
#include <animation.h>
|
||||
#include <code_80005FD0.h>
|
||||
#include <cpu_vehicles_camera_path.h>
|
||||
#include <render_player.h>
|
||||
#include <player_controller.h>
|
||||
#include <code_8003DC40.h>
|
||||
@@ -65,7 +65,7 @@
|
||||
#include "buffers/trig_tables.h"
|
||||
#include <ultra64.h>
|
||||
#include <vehicles.h>
|
||||
#include <waypoints.h>
|
||||
#include <path.h>
|
||||
|
||||
#include <courses/all_course_data.h>
|
||||
#include <courses/all_course_packed.h>
|
||||
|
||||
+95
-94
@@ -7,8 +7,8 @@
|
||||
#include "code_800029B0.h"
|
||||
#include "math_util.h"
|
||||
#include "kart_attributes.h"
|
||||
#include "waypoints.h"
|
||||
#include "code_80005FD0.h"
|
||||
#include "path.h"
|
||||
#include "cpu_vehicles_camera_path.h"
|
||||
#include "render_player.h"
|
||||
#include "player_controller.h"
|
||||
#include "render_objects.h"
|
||||
@@ -167,7 +167,7 @@ void clean_effect(Player* player, s8 arg1) {
|
||||
if ((player->effects & 0x800000) == 0x800000) {
|
||||
func_8008D97C(player);
|
||||
}
|
||||
if ((player->effects & 0x1000000) == 0x1000000) {
|
||||
if ((player->effects & UNKNOWN_EFFECT_0x1000000) == UNKNOWN_EFFECT_0x1000000) {
|
||||
func_8008E884(player, arg1);
|
||||
}
|
||||
if ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) {
|
||||
@@ -182,10 +182,10 @@ void clean_effect(Player* player, s8 arg1) {
|
||||
if ((player->effects & 0x4000) == 0x4000) {
|
||||
func_8008F3E0(player);
|
||||
}
|
||||
if ((player->effects & 0x10000) == 0x10000) {
|
||||
if ((player->effects & UNKNOWN_EFFECT_0x10000) == UNKNOWN_EFFECT_0x10000) {
|
||||
func_8008F5A4(player, arg1);
|
||||
}
|
||||
if ((player->effects & 0x10000000) == 0x10000000) {
|
||||
if ((player->effects & UNKNOWN_EFFECT_0x10000000) == UNKNOWN_EFFECT_0x10000000) {
|
||||
func_8008FEDC(player, arg1);
|
||||
}
|
||||
player->unk_044 = (s16) (player->unk_044 & 0xFFFE);
|
||||
@@ -214,14 +214,14 @@ void func_8008C528(Player* player, s8 arg1) {
|
||||
func_800C90F4(arg1, (temp_v1 * 0x10) + 0x29008005);
|
||||
func_800C9060(arg1, SOUND_ACTION_EXPLOSION);
|
||||
} else {
|
||||
func_800098FC(arg1, player);
|
||||
play_cpu_sound_effect(arg1, player);
|
||||
}
|
||||
player->soundEffects = (s32) (player->soundEffects & ~4);
|
||||
}
|
||||
|
||||
void func_8008C62C(Player* player, s8 arg1) {
|
||||
|
||||
decelerate_ai_player(player, 5.0f);
|
||||
decelerate_player(player, 5.0f);
|
||||
player->unk_0A8 += (s16) 0xA0;
|
||||
player->unk_042 += (s16) 0x71C;
|
||||
if (player->unk_0A8 >= 0x2000) {
|
||||
@@ -285,7 +285,7 @@ void func_8008C73C(Player* player, s8 arg1) {
|
||||
((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) {
|
||||
func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008003);
|
||||
} else {
|
||||
func_800098FC(arg1, player);
|
||||
play_cpu_sound_effect(arg1, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -309,7 +309,7 @@ void func_8008C8C4(Player* player, s8 playerId) {
|
||||
if ((gIsPlayerTripleAButtonCombo[playerId] == true) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) {
|
||||
player->currentSpeed = (f32) (player->currentSpeed + 100.0f);
|
||||
}
|
||||
if ((gModeSelection == VERSUS) && ((player->type & PLAYER_KART_AI) == PLAYER_KART_AI) && (!gDemoMode) &&
|
||||
if ((gModeSelection == VERSUS) && ((player->type & PLAYER_CPU) == PLAYER_CPU) && (!gDemoMode) &&
|
||||
((player->unk_0CA & 2) == 0) && (gGPCurrentRaceRankByPlayerId[playerId] != 0)) {
|
||||
player->soundEffects = (s32) (player->soundEffects | REVERSE_SOUND_EFFECT);
|
||||
}
|
||||
@@ -323,15 +323,15 @@ void func_8008C9EC(Player* player, s8 arg1) {
|
||||
player->unk_206 = 0;
|
||||
player->slopeAccel = 0;
|
||||
if ((player->unk_046 & 0x40) == 0x40) {
|
||||
decelerate_ai_player(player, 100.0f);
|
||||
decelerate_player(player, 100.0f);
|
||||
} else {
|
||||
if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) {
|
||||
decelerate_ai_player(player, 1.0f);
|
||||
decelerate_player(player, 1.0f);
|
||||
} else {
|
||||
decelerate_ai_player(player, 4.0f);
|
||||
decelerate_player(player, 4.0f);
|
||||
}
|
||||
if (!(player->type & PLAYER_HUMAN)) {
|
||||
decelerate_ai_player(player, 30.0f);
|
||||
decelerate_player(player, 30.0f);
|
||||
}
|
||||
}
|
||||
if ((player->effects & 0x80) == 0x80) {
|
||||
@@ -379,8 +379,8 @@ void func_8008CDC0(Player* player, s8 arg1) {
|
||||
player->effects &= ~0x10;
|
||||
|
||||
if (((player->unk_07C >> 0x10) >= 0x14) || ((player->unk_07C >> 0x10) < -0x13) ||
|
||||
(((player->unk_094 / 18.0f) * 216.0f) <= 30.0f) || ((player->effects & 8) != 0) ||
|
||||
(((player->type & PLAYER_HUMAN) == 0) && ((player->effects & 0x1000) == 0))) {
|
||||
(((player->speed / 18.0f) * 216.0f) <= 30.0f) || ((player->effects & 8) != 0) ||
|
||||
(((player->type & PLAYER_HUMAN) == 0) && ((player->effects & UNKNOWN_EFFECT_0x1000) == 0))) {
|
||||
func_8008C73C(player, arg1);
|
||||
} else {
|
||||
player->effects |= 0x800;
|
||||
@@ -714,7 +714,7 @@ void apply_hit_sound_effect(Player* player, s8 arg1) {
|
||||
|
||||
player->effects |= HIT_EFFECT;
|
||||
if (((player->type) & 0x1000) != 0) {
|
||||
func_800098FC(arg1, player);
|
||||
play_cpu_sound_effect(arg1, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -727,7 +727,7 @@ void apply_hit_effect(Player* player, s8 arg1) {
|
||||
player->unk_08C = 0.0f;
|
||||
player->currentSpeed = 0.0f;
|
||||
// clang-format off
|
||||
if ((player->collision.surfaceDistance[2] >= 600.0f) || ((player->effects & 0x1000) != 0)) { D_8018D990[arg1] = 3; } // placed block on same line to match
|
||||
if ((player->collision.surfaceDistance[2] >= 600.0f) || ((player->effects & UNKNOWN_EFFECT_0x1000) != 0)) { D_8018D990[arg1] = 3; } // placed block on same line to match
|
||||
// clang-format on
|
||||
|
||||
switch (D_8018D990[arg1]) {
|
||||
@@ -854,7 +854,7 @@ void apply_hit_rotating_sound_effect(Player* player, s8 arg1) {
|
||||
((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) {
|
||||
func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008003);
|
||||
} else {
|
||||
func_800098FC(arg1, player);
|
||||
play_cpu_sound_effect(arg1, player);
|
||||
}
|
||||
if (gModeSelection == BATTLE) {
|
||||
func_8006B8B4(player, arg1);
|
||||
@@ -893,7 +893,7 @@ void apply_lightning_effect(Player* player, s8 arg1) {
|
||||
D_80165190[3][arg1] = 1;
|
||||
}
|
||||
}
|
||||
decelerate_ai_player(player, 1.0f);
|
||||
decelerate_player(player, 1.0f);
|
||||
} else {
|
||||
player->unk_0B0 += 1;
|
||||
player->unk_08C = (f32) ((f64) player->unk_08C * 0.6);
|
||||
@@ -949,7 +949,7 @@ void func_8008E4A4(Player* player, s8 arg1) {
|
||||
}
|
||||
|
||||
if (player->unk_0E0 == 3) {
|
||||
player->effects &= ~0x01000000;
|
||||
player->effects &= ~UNKNOWN_EFFECT_0x1000000;
|
||||
player->unk_0A8 = 0;
|
||||
player->unk_236 = 0;
|
||||
D_80165190[0][arg1] = 1;
|
||||
@@ -971,7 +971,7 @@ void func_8008E4A4(Player* player, s8 arg1) {
|
||||
player->unk_0A8 = 0;
|
||||
--player->unk_236;
|
||||
if (player->unk_236 == 0) {
|
||||
player->effects &= ~0x01000000;
|
||||
player->effects &= ~UNKNOWN_EFFECT_0x1000000;
|
||||
player->unk_236 = 0;
|
||||
D_80165190[0][arg1] = 1;
|
||||
D_80165190[1][arg1] = 1;
|
||||
@@ -997,7 +997,7 @@ void apply_reverse_sound_effect(Player* player, s8 arg1) {
|
||||
func_8008C310(player);
|
||||
|
||||
player->unk_0A8 = 0;
|
||||
player->effects |= 0x01000000;
|
||||
player->effects |= UNKNOWN_EFFECT_0x1000000;
|
||||
player->effects &= ~0x10;
|
||||
player->kartHopJerk = 0.0f;
|
||||
player->kartHopAcceleration = 0.0f;
|
||||
@@ -1010,19 +1010,19 @@ void apply_reverse_sound_effect(Player* player, s8 arg1) {
|
||||
|
||||
if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) &&
|
||||
((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) {
|
||||
if (((gModeSelection == VERSUS) && ((player->type & PLAYER_KART_AI) != 0)) && (!gDemoMode)) {
|
||||
if (((gModeSelection == VERSUS) && ((player->type & PLAYER_CPU) != 0)) && (!gDemoMode)) {
|
||||
func_800CA24C(arg1);
|
||||
}
|
||||
|
||||
if (1) {}
|
||||
|
||||
func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008005);
|
||||
if (((gModeSelection == VERSUS) && ((player->type & PLAYER_KART_AI) != 0)) && (!gDemoMode)) {
|
||||
if (((gModeSelection == VERSUS) && ((player->type & PLAYER_CPU) != 0)) && (!gDemoMode)) {
|
||||
func_800CA24C(arg1);
|
||||
}
|
||||
func_800C9060(arg1, SOUND_ACTION_EXPLOSION);
|
||||
} else {
|
||||
func_800098FC(arg1, player);
|
||||
play_cpu_sound_effect(arg1, player);
|
||||
}
|
||||
|
||||
player->soundEffects &= ~(REVERSE_SOUND_EFFECT | 0x80000);
|
||||
@@ -1034,7 +1034,7 @@ void apply_reverse_sound_effect(Player* player, s8 arg1) {
|
||||
}
|
||||
|
||||
void func_8008E884(Player* player, s8 arg1) {
|
||||
player->effects &= ~0x01000000;
|
||||
player->effects &= ~UNKNOWN_EFFECT_0x1000000;
|
||||
player->unk_0A8 = 0;
|
||||
player->unk_236 = 0;
|
||||
D_80165190[0][arg1] = 1;
|
||||
@@ -1121,7 +1121,7 @@ void apply_hit_by_item_sound_effect(Player* player, s8 arg1) {
|
||||
func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008005);
|
||||
func_800C9060(arg1, SOUND_ACTION_EXPLOSION);
|
||||
} else {
|
||||
func_800098FC(arg1, player);
|
||||
play_cpu_sound_effect(arg1, player);
|
||||
}
|
||||
|
||||
player->effects |= HIT_BY_ITEM_EFFECT;
|
||||
@@ -1315,7 +1315,7 @@ void func_8008F3F4(Player* player, UNUSED s8 arg1) {
|
||||
player->unk_0A8 = 0;
|
||||
--player->unk_236;
|
||||
if (player->unk_236 == 0) {
|
||||
player->effects &= ~0x00010000;
|
||||
player->effects &= ~UNKNOWN_EFFECT_0x10000;
|
||||
func_80090778(player);
|
||||
func_80090868(player);
|
||||
}
|
||||
@@ -1323,8 +1323,9 @@ void func_8008F3F4(Player* player, UNUSED s8 arg1) {
|
||||
}
|
||||
|
||||
void func_8008F494(Player* player, s8 arg1) {
|
||||
if ((((player->effects & 0x80) != 0) || ((player->effects & 0x40) != 0) || ((player->effects & 0x01000000)) ||
|
||||
((player->effects & HIT_BY_ITEM_EFFECT)) || ((player->effects & 0x400) != 0)) &&
|
||||
if ((((player->effects & UNKNOWN_EFFECT_0x80) != 0) || ((player->effects & UNKNOWN_EFFECT_0x40) != 0) ||
|
||||
((player->effects & UNKNOWN_EFFECT_0x1000000)) || ((player->effects & HIT_BY_ITEM_EFFECT)) ||
|
||||
((player->effects & 0x400) != 0)) &&
|
||||
(gModeSelection == BATTLE)) {
|
||||
player->unk_044 |= 0x8000;
|
||||
}
|
||||
@@ -1333,7 +1334,7 @@ void func_8008F494(Player* player, s8 arg1) {
|
||||
func_8008F86C(player, arg1);
|
||||
|
||||
player->unk_0A8 = 0;
|
||||
player->effects |= 0x10000;
|
||||
player->effects |= UNKNOWN_EFFECT_0x10000;
|
||||
player->effects &= ~0x10;
|
||||
player->unk_236 = 0x1E;
|
||||
player->unk_042 = 0;
|
||||
@@ -1353,7 +1354,7 @@ void func_8008F5A4(Player* player, s8 arg1) {
|
||||
|
||||
player->unk_206 = 0;
|
||||
player->slopeAccel = 0;
|
||||
player->effects &= ~0x10000;
|
||||
player->effects &= ~UNKNOWN_EFFECT_0x10000;
|
||||
player->unk_0A8 = 0;
|
||||
player->unk_0C0 = 0;
|
||||
player->unk_07C = 0;
|
||||
@@ -1569,94 +1570,94 @@ void func_8008FDF4(Player* player, UNUSED s8 arg1) {
|
||||
player->kartHopAcceleration = 0.0f;
|
||||
player->kartHopVelocity = D_800E37D0[player->characterId];
|
||||
player->soundEffects &= ~0x00100000;
|
||||
player->effects |= 0x10000000;
|
||||
player->effects |= UNKNOWN_EFFECT_0x10000000;
|
||||
}
|
||||
|
||||
void func_8008FE84(Player* player, UNUSED s8 arg1) {
|
||||
player->effects &= ~0x10;
|
||||
if ((player->effects & 8) != 8) {
|
||||
player->effects &= ~0x10000000;
|
||||
player->effects &= ~UNKNOWN_EFFECT_0x10000000;
|
||||
player->currentSpeed /= 2;
|
||||
player->unk_08C /= 2;
|
||||
}
|
||||
}
|
||||
|
||||
void func_8008FEDC(Player* player, UNUSED s8 arg1) {
|
||||
player->effects &= ~0x10000000;
|
||||
player->effects &= ~UNKNOWN_EFFECT_0x10000000;
|
||||
player->kartHopJerk = 0.0f;
|
||||
player->kartHopVelocity = 0.0f;
|
||||
player->kartHopAcceleration = 0.0f;
|
||||
}
|
||||
|
||||
void course_update_waypoint(Player* player, s8 playerId) {
|
||||
s16 waypoint;
|
||||
void course_update_path_point(Player* player, s8 playerId) {
|
||||
s16 pathPoint;
|
||||
|
||||
#if !ENABLE_CUSTOM_COURSE_ENGINE
|
||||
switch (gCurrentCourseId) {
|
||||
case COURSE_BOWSER_CASTLE:
|
||||
waypoint = gNearestWaypointByPlayerId[playerId];
|
||||
if ((waypoint >= 0x235) && (waypoint < 0x247)) {
|
||||
player->nearestWaypointId = 0x214;
|
||||
} else if ((waypoint >= 0x267) && (waypoint < 0x277)) {
|
||||
player->nearestWaypointId = 0x25B;
|
||||
pathPoint = gNearestPathPointByPlayerId[playerId];
|
||||
if ((pathPoint >= 0x235) && (pathPoint < 0x247)) {
|
||||
player->nearestPathPointId = 0x214;
|
||||
} else if ((pathPoint >= 0x267) && (pathPoint < 0x277)) {
|
||||
player->nearestPathPointId = 0x25B;
|
||||
} else {
|
||||
player->nearestWaypointId = gNearestWaypointByPlayerId[playerId];
|
||||
if (player->nearestWaypointId < 0) {
|
||||
player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId;
|
||||
player->nearestPathPointId = gNearestPathPointByPlayerId[playerId];
|
||||
if (player->nearestPathPointId < 0) {
|
||||
player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case COURSE_BANSHEE_BOARDWALK:
|
||||
waypoint = gNearestWaypointByPlayerId[playerId];
|
||||
if ((waypoint >= 0x12C) && (waypoint < 0x13C)) {
|
||||
player->nearestWaypointId = 0x12CU;
|
||||
pathPoint = gNearestPathPointByPlayerId[playerId];
|
||||
if ((pathPoint >= 0x12C) && (pathPoint < 0x13C)) {
|
||||
player->nearestPathPointId = 0x12CU;
|
||||
} else {
|
||||
player->nearestWaypointId = gNearestWaypointByPlayerId[playerId];
|
||||
if (player->nearestWaypointId < 0) {
|
||||
player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId;
|
||||
player->nearestPathPointId = gNearestPathPointByPlayerId[playerId];
|
||||
if (player->nearestPathPointId < 0) {
|
||||
player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case COURSE_YOSHI_VALLEY:
|
||||
case COURSE_RAINBOW_ROAD:
|
||||
player->nearestWaypointId = gCopyNearestWaypointByPlayerId[playerId];
|
||||
player->nearestPathPointId = gCopyNearestPathPointByPlayerId[playerId];
|
||||
break;
|
||||
case COURSE_FRAPPE_SNOWLAND:
|
||||
waypoint = gNearestWaypointByPlayerId[playerId];
|
||||
pathPoint = gNearestPathPointByPlayerId[playerId];
|
||||
#ifdef VERSION_EU
|
||||
if (((waypoint >= 0xF0) && (waypoint < 0x11E)) || ((gCopyNearestWaypointByPlayerId[playerId] >= 0xF0) &&
|
||||
(gCopyNearestWaypointByPlayerId[playerId] < 0x11E)))
|
||||
if (((pathPoint >= 0xF0) && (pathPoint < 0x11E)) || ((gCopyNearestPathPointByPlayerId[playerId] >= 0xF0) &&
|
||||
(gCopyNearestPathPointByPlayerId[playerId] < 0x11E)))
|
||||
#else
|
||||
if ((waypoint >= 0xF0) && (waypoint < 0x105))
|
||||
if ((pathPoint >= 0xF0) && (pathPoint < 0x105))
|
||||
#endif
|
||||
{
|
||||
player->nearestWaypointId = 0xF0U;
|
||||
player->nearestPathPointId = 0xF0U;
|
||||
} else {
|
||||
player->nearestWaypointId = gCopyNearestWaypointByPlayerId[playerId];
|
||||
if (player->nearestWaypointId < 0) {
|
||||
player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId;
|
||||
player->nearestPathPointId = gCopyNearestPathPointByPlayerId[playerId];
|
||||
if (player->nearestPathPointId < 0) {
|
||||
player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case COURSE_ROYAL_RACEWAY:
|
||||
waypoint = gNearestWaypointByPlayerId[playerId];
|
||||
if ((waypoint >= 0x258) && (waypoint < 0x2A4)) {
|
||||
player->nearestWaypointId = 0x258U;
|
||||
pathPoint = gNearestPathPointByPlayerId[playerId];
|
||||
if ((pathPoint >= 0x258) && (pathPoint < 0x2A4)) {
|
||||
player->nearestPathPointId = 0x258U;
|
||||
} else {
|
||||
player->nearestWaypointId = gCopyNearestWaypointByPlayerId[playerId];
|
||||
if (player->nearestWaypointId < 0) {
|
||||
player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId;
|
||||
player->nearestPathPointId = gCopyNearestPathPointByPlayerId[playerId];
|
||||
if (player->nearestPathPointId < 0) {
|
||||
player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case COURSE_DK_JUNGLE:
|
||||
waypoint = gNearestWaypointByPlayerId[playerId];
|
||||
if ((waypoint >= 0xB9) && (waypoint < 0x119)) {
|
||||
player->nearestWaypointId = 0xB9U;
|
||||
pathPoint = gNearestPathPointByPlayerId[playerId];
|
||||
if ((pathPoint >= 0xB9) && (pathPoint < 0x119)) {
|
||||
player->nearestPathPointId = 0xB9U;
|
||||
} else {
|
||||
player->nearestWaypointId = gNearestWaypointByPlayerId[playerId];
|
||||
if (player->nearestWaypointId < 0) {
|
||||
player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId;
|
||||
player->nearestPathPointId = gNearestPathPointByPlayerId[playerId];
|
||||
if (player->nearestPathPointId < 0) {
|
||||
player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1664,12 +1665,12 @@ void course_update_waypoint(Player* player, s8 playerId) {
|
||||
case COURSE_SKYSCRAPER:
|
||||
case COURSE_DOUBLE_DECK:
|
||||
case COURSE_BIG_DONUT:
|
||||
player->nearestWaypointId = 0U;
|
||||
player->nearestPathPointId = 0U;
|
||||
break;
|
||||
default:
|
||||
player->nearestWaypointId = gNearestWaypointByPlayerId[playerId];
|
||||
if (player->nearestWaypointId < 0) {
|
||||
player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId;
|
||||
player->nearestPathPointId = gNearestPathPointByPlayerId[playerId];
|
||||
if (player->nearestPathPointId < 0) {
|
||||
player->nearestPathPointId = gPathCountByPathIndex[0] + player->nearestPathPointId;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1680,7 +1681,7 @@ void course_update_waypoint(Player* player, s8 playerId) {
|
||||
|
||||
void func_80090178(Player* player, s8 playerId, Vec3f arg2, Vec3f arg3) {
|
||||
u16 test;
|
||||
TrackWaypoint* temp_v1;
|
||||
TrackPathPoint* temp_v1;
|
||||
f32 spF8[4] = { 0.0f, 0.0f, -700.0f, 700.0f };
|
||||
f32 spE8[4] = { 700.0f, -700.0f, 0.0f, 0.0f };
|
||||
f32 spD8[4] = { 0.0f, 0.0f, -650.0f, 650.0f };
|
||||
@@ -1700,14 +1701,14 @@ void func_80090178(Player* player, s8 playerId, Vec3f arg2, Vec3f arg3) {
|
||||
|
||||
switch (gCurrentCourseId) {
|
||||
case COURSE_YOSHI_VALLEY:
|
||||
test = player->nearestWaypointId;
|
||||
temp_v1 = &D_80164550[gCopyPathIndexByPlayerId[playerId]][test];
|
||||
test = player->nearestPathPointId;
|
||||
temp_v1 = &gTrackPaths[gCopyPathIndexByPlayerId[playerId]][test];
|
||||
arg2[0] = temp_v1->posX;
|
||||
arg2[1] = temp_v1->posY;
|
||||
arg2[2] = temp_v1->posZ;
|
||||
temp_v1 = &D_80164550[gCopyPathIndexByPlayerId[playerId]]
|
||||
[(player->nearestWaypointId + 5) %
|
||||
(gWaypointCountByPathIndex[gCopyPathIndexByPlayerId[playerId]] + 1)];
|
||||
temp_v1 = &gTrackPaths[gCopyPathIndexByPlayerId[playerId]]
|
||||
[(player->nearestPathPointId + 5) %
|
||||
(gPathCountByPathIndex[gCopyPathIndexByPlayerId[playerId]] + 1)];
|
||||
arg3[0] = temp_v1->posX;
|
||||
arg3[1] = temp_v1->posY;
|
||||
arg3[2] = temp_v1->posZ;
|
||||
@@ -1745,12 +1746,12 @@ void func_80090178(Player* player, s8 playerId, Vec3f arg2, Vec3f arg3) {
|
||||
arg3[2] = sp08[playerId];
|
||||
break;
|
||||
default:
|
||||
test = player->nearestWaypointId;
|
||||
temp_v1 = &D_80164550[0][test];
|
||||
test = player->nearestPathPointId;
|
||||
temp_v1 = &gTrackPaths[0][test];
|
||||
arg2[0] = temp_v1->posX;
|
||||
arg2[1] = temp_v1->posY;
|
||||
arg2[2] = temp_v1->posZ;
|
||||
temp_v1 = &D_80164550[0][(player->nearestWaypointId + 5) % (gWaypointCountByPathIndex[0] + 1)];
|
||||
temp_v1 = &gTrackPaths[0][(player->nearestPathPointId + 5) % (gPathCountByPathIndex[0] + 1)];
|
||||
arg3[0] = temp_v1->posX;
|
||||
arg3[1] = temp_v1->posY;
|
||||
arg3[2] = temp_v1->posZ;
|
||||
@@ -1801,7 +1802,7 @@ void func_80090868(Player* player) {
|
||||
player->unk_D98 = 1;
|
||||
player->unk_D9C = 0.0f;
|
||||
player->unk_DA0 = 0.5f;
|
||||
course_update_waypoint(player, playerIndex);
|
||||
course_update_path_point(player, playerIndex);
|
||||
player->unk_222 = 0;
|
||||
player->unk_0CA |= 2;
|
||||
player->unk_0C8 = 0;
|
||||
@@ -1825,7 +1826,7 @@ void func_80090970(Player* player, s8 playerId, s8 arg2) {
|
||||
UNUSED s32 stackPadding1;
|
||||
Vec3f sp44;
|
||||
Vec3f sp38;
|
||||
TrackWaypoint* waypoint;
|
||||
TrackPathPoint* pathPoint;
|
||||
UNUSED s32 stackPadding2;
|
||||
UNUSED s32 stackPadding3;
|
||||
|
||||
@@ -1866,7 +1867,7 @@ void func_80090970(Player* player, s8 playerId, s8 arg2) {
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (((player->type & PLAYER_HUMAN) == 0x4000) && ((player->type & PLAYER_KART_AI) == 0)) {
|
||||
if (((player->type & PLAYER_HUMAN) == 0x4000) && ((player->type & PLAYER_CPU) == 0)) {
|
||||
func_8009E088(playerId, 0xA);
|
||||
}
|
||||
if ((player->unk_0CA & 1) == 1) {
|
||||
@@ -1898,7 +1899,7 @@ void func_80090970(Player* player, s8 playerId, s8 arg2) {
|
||||
break;
|
||||
case 3:
|
||||
D_80165330[playerId] = 0;
|
||||
if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_KART_AI) == 0)) {
|
||||
if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_CPU) == 0)) {
|
||||
func_8009E020(playerId, 0x14);
|
||||
}
|
||||
func_80090178(player, playerId, sp44, sp38);
|
||||
@@ -1921,10 +1922,10 @@ void func_80090970(Player* player, s8 playerId, s8 arg2) {
|
||||
player->pos[0] = player->pos[0] + sins(-player->rotation[1]) * -10.0f;
|
||||
}
|
||||
if (player->unk_0C8 == 0x00FC) {
|
||||
waypoint = D_80164550[0];
|
||||
player->pos[0] = waypoint->posX;
|
||||
player->pos[1] = waypoint->posY;
|
||||
player->pos[2] = waypoint->posZ;
|
||||
pathPoint = gTrackPaths[0];
|
||||
player->pos[0] = pathPoint->posX;
|
||||
player->pos[1] = pathPoint->posY;
|
||||
player->pos[2] = pathPoint->posZ;
|
||||
}
|
||||
move_f32_towards(&player->pos[1], (player->unk_074 + player->boundingBoxSize) - 2.0f, 0.04f);
|
||||
player->unk_0C8++;
|
||||
@@ -2080,7 +2081,7 @@ void func_80091298(Player* player, s8 arg1) {
|
||||
player->kartGravity = gKartGravityTable[player->characterId];
|
||||
player->unk_0D4[0] = 0;
|
||||
player->type |= PLAYER_START_SEQUENCE;
|
||||
player->unk_094 = 0.0f;
|
||||
player->speed = 0.0f;
|
||||
player->unk_08C = 0.0f;
|
||||
player->currentSpeed = 0.0f;
|
||||
if (arg1 == 0) {
|
||||
|
||||
+1
-1
@@ -106,7 +106,7 @@ void func_8008FDA8(Player*, s8);
|
||||
void func_8008FDF4(Player*, s8);
|
||||
void func_8008FE84(Player*, s8);
|
||||
void func_8008FEDC(Player*, s8);
|
||||
void course_update_waypoint(Player*, s8);
|
||||
void course_update_path_point(Player*, s8);
|
||||
void func_80090178(Player*, s8, Vec3f, Vec3f);
|
||||
void func_80090778(Player*);
|
||||
void func_80090868(Player*);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "skybox_and_splitscreen.h"
|
||||
#include "code_8006E9C0.h"
|
||||
#include "podium_ceremony_actors.h"
|
||||
#include "code_80005FD0.h"
|
||||
#include "cpu_vehicles_camera_path.h"
|
||||
#include "collision.h"
|
||||
#include "code_80281C40.h"
|
||||
#include "code_800029B0.h"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "camera_junk.h"
|
||||
#include "player_controller.h"
|
||||
#include "code_80057C60.h"
|
||||
#include "code_80005FD0.h"
|
||||
#include "cpu_vehicles_camera_path.h"
|
||||
#include "code_80281C40.h"
|
||||
#include "math_util.h"
|
||||
|
||||
|
||||
@@ -79,6 +79,8 @@ void rsp_set_matrix_transformation_inverted_x_y_orientation(Vec3f, Vec3su, f32);
|
||||
void rsp_set_matrix_transl_rot_scale(Vec3f, Vec3f, f32);
|
||||
void rsp_set_matrix_gObjectList(s32);
|
||||
|
||||
#define DEGREES_CONVERSION_FACTOR 182
|
||||
|
||||
/* This is where I'd put my static data, if I had any */
|
||||
extern s8 D_801658FE;
|
||||
|
||||
|
||||
+6
-5
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "code_800029B0.h"
|
||||
#include "menu_items.h"
|
||||
#include "code_80005FD0.h"
|
||||
#include "cpu_vehicles_camera_path.h"
|
||||
#include "code_8006E9C0.h"
|
||||
#include "menus.h"
|
||||
#include "save.h"
|
||||
@@ -7227,7 +7227,7 @@ void func_800A34A8(MenuItem* arg0) {
|
||||
var_v1 = 0;
|
||||
} else {
|
||||
var_v1 = 0x0000000D;
|
||||
var_v0 = D_80164478[sp80[rank]];
|
||||
var_v0 = gGetPlayerByCharacterId[sp80[rank]];
|
||||
}
|
||||
if (var_v0 < gPlayerCount) {
|
||||
var_a0 = (s32) gGlobalTimer % 3;
|
||||
@@ -7254,7 +7254,7 @@ void func_800A34A8(MenuItem* arg0) {
|
||||
if (arg0->state < 9) {
|
||||
var_v0 = gGPCurrentRacePlayerIdByRank[rank];
|
||||
} else {
|
||||
var_v0 = D_80164478[sp80[rank]];
|
||||
var_v0 = gGetPlayerByCharacterId[sp80[rank]];
|
||||
}
|
||||
if (var_v0 < gPlayerCount) {
|
||||
var_a0 = (s32) gGlobalTimer % 3;
|
||||
@@ -7295,7 +7295,8 @@ void func_800A3A10(s8* arg0) {
|
||||
arg0[var_a1] = temp_a3;
|
||||
arg0[var_a1 - 1] = temp_t1;
|
||||
} else if (gGPPointsByCharacterId[temp_t1] == gGPPointsByCharacterId[temp_a3]) {
|
||||
if ((D_80164478[temp_t1] < gPlayerCount) && (D_80164478[temp_t1] < D_80164478[temp_a3])) {
|
||||
if ((gGetPlayerByCharacterId[temp_t1] < gPlayerCount) &&
|
||||
(gGetPlayerByCharacterId[temp_t1] < gGetPlayerByCharacterId[temp_a3])) {
|
||||
arg0[var_a1] = temp_a3;
|
||||
arg0[var_a1 - 1] = temp_t1;
|
||||
} else {
|
||||
@@ -10820,7 +10821,7 @@ void func_800AC458(MenuItem* arg0) {
|
||||
arg0->param1 = 0;
|
||||
if (gCourseIndexInCup == 3) {
|
||||
for (var_a1 = 0; var_a1 < 8; var_a1++) {
|
||||
if (D_80164478[gCharacterIdByGPOverallRank[var_a1]] < gPlayerCount) {
|
||||
if (gGetPlayerByCharacterId[gCharacterIdByGPOverallRank[var_a1]] < gPlayerCount) {
|
||||
func_800B536C(var_a1);
|
||||
break;
|
||||
}
|
||||
|
||||
+1
-1
@@ -654,7 +654,7 @@ void tkmk00decode(u8*, u8*, u8*, s32);
|
||||
/* This is where I'd put my static data, if I had any */
|
||||
|
||||
extern s32 D_800DDB24;
|
||||
extern s16 D_80164478[];
|
||||
extern s16 gGetPlayerByCharacterId[];
|
||||
|
||||
extern u16* gMenuTextureBuffer;
|
||||
extern u8* gMenuCompressedBuffer;
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
#include "actors.h"
|
||||
#include "audio/external.h"
|
||||
#include "code_800029B0.h"
|
||||
#include "code_80005FD0.h"
|
||||
#include "cpu_vehicles_camera_path.h"
|
||||
#include "menu_items.h"
|
||||
#include "code_800AF9B0.h"
|
||||
#include "save.h"
|
||||
|
||||
+380
-369
File diff suppressed because it is too large
Load Diff
+78
-78
@@ -64,7 +64,7 @@ void func_8002D028(Player*, s8);
|
||||
void func_8002D268(Player*, Camera*, s8, s8);
|
||||
|
||||
void func_8002E4C4(Player*);
|
||||
void control_kart_ai_movement(Player*, Camera*, s8, s8);
|
||||
void control_cpu_movement(Player*, Camera*, s8, s8);
|
||||
|
||||
void func_8002FCA8(Player*, s8);
|
||||
void func_8002FE84(Player*, f32);
|
||||
@@ -73,8 +73,8 @@ f32 func_80030150(Player*, s8);
|
||||
void func_80030A34(Player*);
|
||||
void detect_triple_a_combo_a_released(Player*);
|
||||
void detect_triple_a_combo_a_pressed(Player*);
|
||||
void player_speed(Player*);
|
||||
void decelerate_ai_player(Player*, f32);
|
||||
void player_accelerate(Player*);
|
||||
void decelerate_player(Player*, f32);
|
||||
void detect_triple_b_combo_b_released(Player*);
|
||||
void detect_triple_b_combo_b_pressed(Player*);
|
||||
void func_800323E4(Player*);
|
||||
@@ -91,7 +91,7 @@ void func_800339C4(Player*, s32*, s32, s32, f32);
|
||||
void func_80033A40(Player*, s32*, s32*, s32, s32, s32, f32);
|
||||
void func_80033AE0(Player*, struct Controller*, s8);
|
||||
|
||||
void func_8003680C(Player*, s16);
|
||||
void apply_cpu_turn(Player*, s16);
|
||||
void func_80036C5C(Player*);
|
||||
void func_80036CB4(Player*);
|
||||
void func_80036DB4(Player*, Vec3f, Vec3f);
|
||||
@@ -113,81 +113,81 @@ void func_80038C6C(Player*, Camera*, s8, s8);
|
||||
|
||||
/* This is where I'd put my static data, if I had any */
|
||||
|
||||
extern s16 gKartAIforMario[];
|
||||
extern s16 gKartAIforLuigi[];
|
||||
extern s16 gKartAIforYoshi[];
|
||||
extern s16 gKartAIforToad[];
|
||||
extern s16 gKartAIforDk[];
|
||||
extern s16 gKartAIforWario[];
|
||||
extern s16 gKartAIforPeach[];
|
||||
extern s16 gKartAIforBowser[];
|
||||
extern s16* gKartAIforPlayer[];
|
||||
extern s16 cpu_forMario[];
|
||||
extern s16 cpu_forLuigi[];
|
||||
extern s16 cpu_forYoshi[];
|
||||
extern s16 cpu_forToad[];
|
||||
extern s16 cpu_forDk[];
|
||||
extern s16 cpu_forWario[];
|
||||
extern s16 cpu_forPeach[];
|
||||
extern s16 cpu_forBowser[];
|
||||
extern s16* cpu_forPlayer[];
|
||||
|
||||
extern s16 gKartAIforMarioAndLuigi[];
|
||||
extern s16 gKartAIforMarioAndYoshi[];
|
||||
extern s16 gKartAIforMarioAndToad[];
|
||||
extern s16 gKartAIforMarioAndDk[];
|
||||
extern s16 gKartAIforMarioAndWario[];
|
||||
extern s16 gKartAIforMarioAndPeach[];
|
||||
extern s16 gKartAIforMarioAndBowser[];
|
||||
extern s16 gKartAIforLuigiAndMario[];
|
||||
extern s16 gKartAIforLuigiAndYoshi[];
|
||||
extern s16 gKartAIforLuigiAndToad[];
|
||||
extern s16 gKartAIforLuigiAndDk[];
|
||||
extern s16 gKartAIforLuigiAndWario[];
|
||||
extern s16 gKartAIforLuigiAndPeach[];
|
||||
extern s16 gKartAIforLuigiAndBowser[];
|
||||
extern s16 gKartAIforYoshiAndMario[];
|
||||
extern s16 gKartAIforYoshiAndLuigi[];
|
||||
extern s16 gKartAIforYoshiAndToad[];
|
||||
extern s16 gKartAIforYoshiAndDk[];
|
||||
extern s16 gKartAIforYoshiAndWario[];
|
||||
extern s16 gKartAIforYoshiAndPeach[];
|
||||
extern s16 gKartAIforYoshiAndBowser[];
|
||||
extern s16 gKartAIforToadAndMario[];
|
||||
extern s16 gKartAIforToadAndLuigi[];
|
||||
extern s16 gKartAIforToadAndYoshi[];
|
||||
extern s16 gKartAIforToadAndDk[];
|
||||
extern s16 gKartAIforToadAndWario[];
|
||||
extern s16 gKartAIforToadAndPeach[];
|
||||
extern s16 gKartAIforToadAndBowser[];
|
||||
extern s16 gKartAIforDkAndMario[];
|
||||
extern s16 gKartAIforDkAndLuigi[];
|
||||
extern s16 gKartAIforDkAndToad[];
|
||||
extern s16 gKartAIforDkAndYoshi[];
|
||||
extern s16 gKartAIforDkAndWario[];
|
||||
extern s16 gKartAIforDkAndPeach[];
|
||||
extern s16 gKartAIforDkAndBowser[];
|
||||
extern s16 gKartAIforWarioAndMario[];
|
||||
extern s16 gKartAIforWarioAndLuigi[];
|
||||
extern s16 gKartAIforWarioAndYoshi[];
|
||||
extern s16 gKartAIforWarioAndDk[];
|
||||
extern s16 gKartAIforWarioAndToad[];
|
||||
extern s16 gKartAIforWarioAndPeach[];
|
||||
extern s16 gKartAIforWarioAndBowser[];
|
||||
extern s16 gKartAIforPeachAndMario[];
|
||||
extern s16 gKartAIforPeachAndLuigi[];
|
||||
extern s16 gKartAIforPeachAndYoshi[];
|
||||
extern s16 gKartAIforPeachAndDk[];
|
||||
extern s16 gKartAIforPeachAndWario[];
|
||||
extern s16 gKartAIforPeachAndToad[];
|
||||
extern s16 gKartAIforPeachAndBowser[];
|
||||
extern s16 gKartAIforBowserAndMario[];
|
||||
extern s16 gKartAIforBowserAndLuigi[];
|
||||
extern s16 gKartAIforBowserAndYoshi[];
|
||||
extern s16 gKartAIforBowserAndDk[];
|
||||
extern s16 gKartAIforBowserAndWario[];
|
||||
extern s16 gKartAIforBowserAndToad[];
|
||||
extern s16 gKartAIforBowserAndPeach[];
|
||||
extern s16* gListKartAIforMario[];
|
||||
extern s16* gListKartAIforLuigi[];
|
||||
extern s16* gListKartAIforYoshi[];
|
||||
extern s16* gListKartAIforToad[];
|
||||
extern s16* gListKartAIforDk[];
|
||||
extern s16* gListKartAIforWario[];
|
||||
extern s16* gListKartAIforPeach[];
|
||||
extern s16* gListKartAIforBowser[];
|
||||
extern s16** gKartAIforTwoPlayer[];
|
||||
extern s16 cpu_forMarioAndLuigi[];
|
||||
extern s16 cpu_forMarioAndYoshi[];
|
||||
extern s16 cpu_forMarioAndToad[];
|
||||
extern s16 cpu_forMarioAndDk[];
|
||||
extern s16 cpu_forMarioAndWario[];
|
||||
extern s16 cpu_forMarioAndPeach[];
|
||||
extern s16 cpu_forMarioAndBowser[];
|
||||
extern s16 cpu_forLuigiAndMario[];
|
||||
extern s16 cpu_forLuigiAndYoshi[];
|
||||
extern s16 cpu_forLuigiAndToad[];
|
||||
extern s16 cpu_forLuigiAndDk[];
|
||||
extern s16 cpu_forLuigiAndWario[];
|
||||
extern s16 cpu_forLuigiAndPeach[];
|
||||
extern s16 cpu_forLuigiAndBowser[];
|
||||
extern s16 cpu_forYoshiAndMario[];
|
||||
extern s16 cpu_forYoshiAndLuigi[];
|
||||
extern s16 cpu_forYoshiAndToad[];
|
||||
extern s16 cpu_forYoshiAndDk[];
|
||||
extern s16 cpu_forYoshiAndWario[];
|
||||
extern s16 cpu_forYoshiAndPeach[];
|
||||
extern s16 cpu_forYoshiAndBowser[];
|
||||
extern s16 cpu_forToadAndMario[];
|
||||
extern s16 cpu_forToadAndLuigi[];
|
||||
extern s16 cpu_forToadAndYoshi[];
|
||||
extern s16 cpu_forToadAndDk[];
|
||||
extern s16 cpu_forToadAndWario[];
|
||||
extern s16 cpu_forToadAndPeach[];
|
||||
extern s16 cpu_forToadAndBowser[];
|
||||
extern s16 cpu_forDkAndMario[];
|
||||
extern s16 cpu_forDkAndLuigi[];
|
||||
extern s16 cpu_forDkAndToad[];
|
||||
extern s16 cpu_forDkAndYoshi[];
|
||||
extern s16 cpu_forDkAndWario[];
|
||||
extern s16 cpu_forDkAndPeach[];
|
||||
extern s16 cpu_forDkAndBowser[];
|
||||
extern s16 cpu_forWarioAndMario[];
|
||||
extern s16 cpu_forWarioAndLuigi[];
|
||||
extern s16 cpu_forWarioAndYoshi[];
|
||||
extern s16 cpu_forWarioAndDk[];
|
||||
extern s16 cpu_forWarioAndToad[];
|
||||
extern s16 cpu_forWarioAndPeach[];
|
||||
extern s16 cpu_forWarioAndBowser[];
|
||||
extern s16 cpu_forPeachAndMario[];
|
||||
extern s16 cpu_forPeachAndLuigi[];
|
||||
extern s16 cpu_forPeachAndYoshi[];
|
||||
extern s16 cpu_forPeachAndDk[];
|
||||
extern s16 cpu_forPeachAndWario[];
|
||||
extern s16 cpu_forPeachAndToad[];
|
||||
extern s16 cpu_forPeachAndBowser[];
|
||||
extern s16 cpu_forBowserAndMario[];
|
||||
extern s16 cpu_forBowserAndLuigi[];
|
||||
extern s16 cpu_forBowserAndYoshi[];
|
||||
extern s16 cpu_forBowserAndDk[];
|
||||
extern s16 cpu_forBowserAndWario[];
|
||||
extern s16 cpu_forBowserAndToad[];
|
||||
extern s16 cpu_forBowserAndPeach[];
|
||||
extern s16* gListCPUforMario[];
|
||||
extern s16* gListCPUforLuigi[];
|
||||
extern s16* gListCPUforYoshi[];
|
||||
extern s16* gListCPUforToad[];
|
||||
extern s16* gListCPUforDk[];
|
||||
extern s16* gListCPUforWario[];
|
||||
extern s16* gListCPUforPeach[];
|
||||
extern s16* gListCPUforBowser[];
|
||||
extern s16** cpu_forTwoPlayer[];
|
||||
|
||||
extern s16 D_801656F0;
|
||||
|
||||
|
||||
+8
-8
@@ -14,9 +14,9 @@
|
||||
#include "memory.h"
|
||||
#include "actors_extended.h"
|
||||
#include "actors.h"
|
||||
#include "waypoints.h"
|
||||
#include "path.h"
|
||||
#include "macros.h"
|
||||
#include "code_80005FD0.h"
|
||||
#include "cpu_vehicles_camera_path.h"
|
||||
#include "update_objects.h"
|
||||
#include "effects.h"
|
||||
#include "collision.h"
|
||||
@@ -1659,7 +1659,7 @@ bool collision_yoshi_egg(Player* player, struct YoshiValleyEgg* egg) {
|
||||
func_800C90F4(player - gPlayerOne, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D));
|
||||
} else {
|
||||
apply_hit_sound_effect(player, player - gPlayerOne);
|
||||
if ((gModeSelection == TIME_TRIALS) && ((player->type & PLAYER_KART_AI) == 0)) {
|
||||
if ((gModeSelection == TIME_TRIALS) && ((player->type & PLAYER_CPU) == 0)) {
|
||||
D_80162DF8 = 1;
|
||||
}
|
||||
}
|
||||
@@ -1736,7 +1736,7 @@ bool collision_tree(Player* player, struct Actor* actor) {
|
||||
actorPos[2] = actor->pos[2];
|
||||
if (((gCurrentCourseId == COURSE_MARIO_RACEWAY) || (gCurrentCourseId == COURSE_YOSHI_VALLEY) ||
|
||||
(gCurrentCourseId == COURSE_ROYAL_RACEWAY) || (gCurrentCourseId == COURSE_LUIGI_RACEWAY)) &&
|
||||
(player->unk_094 > 1.0f)) {
|
||||
(player->speed > 1.0f)) {
|
||||
spawn_leaf(actorPos, 0);
|
||||
}
|
||||
if (xz_dist < 0.1f) {
|
||||
@@ -2148,7 +2148,7 @@ void evaluate_collision_between_player_actor(Player* player, struct Actor* actor
|
||||
break;
|
||||
case ACTOR_RED_SHELL:
|
||||
temp_v1 = actor->rot[2];
|
||||
if (player->effects & 0x01000000) {
|
||||
if (player->effects & UNKNOWN_EFFECT_0x1000000) {
|
||||
break;
|
||||
}
|
||||
if (player->soundEffects & 2) {
|
||||
@@ -2199,7 +2199,7 @@ void evaluate_collision_between_player_actor(Player* player, struct Actor* actor
|
||||
if (!(player->effects & BOO_EFFECT) && !(player->type & PLAYER_INVISIBLE_OR_BOMB)) {
|
||||
if (query_collision_player_vs_actor_item(player, actor) == COLLISION) {
|
||||
func_800C98B8(actor->pos, actor->velocity, SOUND_ACTION_EXPLOSION);
|
||||
if ((gModeSelection == TIME_TRIALS) && !(player->type & PLAYER_KART_AI)) {
|
||||
if ((gModeSelection == TIME_TRIALS) && !(player->type & PLAYER_CPU)) {
|
||||
D_80162DF8 = 1;
|
||||
}
|
||||
if (player->effects & STAR_EFFECT) {
|
||||
@@ -2281,7 +2281,7 @@ void evaluate_collision_for_players_and_actors(void) {
|
||||
for (i = 0; i < NUM_PLAYERS; i++) {
|
||||
phi_s1 = &gPlayers[i];
|
||||
|
||||
if (((phi_s1->type & 0x8000) != 0) && ((phi_s1->effects & 0x4000000) == 0)) {
|
||||
if (((phi_s1->type & PLAYER_EXISTS) != 0) && ((phi_s1->effects & 0x4000000) == 0)) {
|
||||
func_802977E4(phi_s1);
|
||||
for (j = 0; j < ACTOR_LIST_SIZE; j++) {
|
||||
temp_a1 = &gActorList[j];
|
||||
@@ -2376,7 +2376,7 @@ void evaluate_collision_for_destructible_actors(void) {
|
||||
void func_802A1064(struct FakeItemBox* fake_item_box) {
|
||||
if ((u32) (fake_item_box - (struct FakeItemBox*) gActorList) <= (u32) ACTOR_LIST_SIZE) {
|
||||
if (((fake_item_box->flags & 0x8000) != 0) && (fake_item_box->type == ACTOR_FAKE_ITEM_BOX)) {
|
||||
fake_item_box->state = 1;
|
||||
fake_item_box->state = FAKE_ITEM_BOX_ON_GROUND;
|
||||
fake_item_box->targetY = func_802ABEAC(&fake_item_box->unk30, fake_item_box->pos) + 8.66f;
|
||||
fake_item_box->someTimer = 100;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#include "code_800029B0.h"
|
||||
#include "math_util.h"
|
||||
#include "memory.h"
|
||||
#include "waypoints.h"
|
||||
#include "code_80005FD0.h"
|
||||
#include "path.h"
|
||||
#include "cpu_vehicles_camera_path.h"
|
||||
#include "menu_items.h"
|
||||
#include "collision.h"
|
||||
#include "actors.h"
|
||||
@@ -116,7 +116,7 @@ void destroy_banana_in_banana_bunch(struct BananaActor* banana) {
|
||||
}
|
||||
|
||||
// Drop a banana from a banana bunch?
|
||||
void func_802B0648(struct BananaBunchParent* banana_bunch) {
|
||||
void drop_banana_in_banana_bunch(struct BananaBunchParent* banana_bunch) {
|
||||
s16 elderIndex;
|
||||
struct BananaActor* banana;
|
||||
|
||||
@@ -185,12 +185,12 @@ void func_802B0788(s16 rawStickY, struct BananaBunchParent* banana_bunch, Player
|
||||
elderBanana = (struct BananaActor*) &gActorList[banana->elderIndex];
|
||||
elderBanana->youngerIndex = -1;
|
||||
}
|
||||
if (player->unk_094 < 2.0f) {
|
||||
if (player->speed < 2.0f) {
|
||||
var_f0 = ((rawStickY - 30.0f) / 20.0f) + 1.5f;
|
||||
var_f12 = 4.0f;
|
||||
} else {
|
||||
var_f0 = ((rawStickY - 30.0f) / 20.0f) + 1.5f;
|
||||
var_f12 = (player->unk_094 * 0.75f) + 4.5f + var_f0;
|
||||
var_f12 = (player->speed * 0.75f) + 4.5f + var_f0;
|
||||
}
|
||||
vec3f_set(velocity, 0.0f, var_f0, var_f12);
|
||||
func_802B64C4(velocity, player->rotation[1] + player->unk_0C0);
|
||||
@@ -303,7 +303,7 @@ void update_actor_banana_bunch(struct BananaBunchParent* banana_bunch) {
|
||||
((controller->rawStickX < 0x28) && (controller->rawStickX >= -0x27))) {
|
||||
func_802B0788(controller->rawStickY, banana_bunch, owner);
|
||||
} else {
|
||||
func_802B0648(banana_bunch);
|
||||
drop_banana_in_banana_bunch(banana_bunch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ void func_802B039C(struct BananaActor*);
|
||||
void func_802B0464(s16);
|
||||
void func_802B04E8(struct BananaActor*, s16);
|
||||
void destroy_banana_in_banana_bunch(struct BananaActor*);
|
||||
void func_802B0648(struct BananaBunchParent*);
|
||||
void drop_banana_in_banana_bunch(struct BananaBunchParent*);
|
||||
void func_802B0788(s16, struct BananaBunchParent*, Player*);
|
||||
s32 func_802B09C0(s16);
|
||||
void update_actor_banana_bunch(struct BananaBunchParent*);
|
||||
|
||||
+32
-32
@@ -7,14 +7,14 @@
|
||||
#include <course.h>
|
||||
|
||||
#include "camera.h"
|
||||
#include "waypoints.h"
|
||||
#include "path.h"
|
||||
#include "staff_ghosts.h"
|
||||
#include "main.h"
|
||||
#include "code_800029B0.h"
|
||||
#include "code_80057C60.h"
|
||||
#include "update_objects.h"
|
||||
#include "menu_items.h"
|
||||
#include "code_80005FD0.h"
|
||||
#include "cpu_vehicles_camera_path.h"
|
||||
#include "spawn_players.h"
|
||||
#include "audio/external.h"
|
||||
#include "race_logic.h"
|
||||
@@ -40,7 +40,7 @@ u16 D_802BA032;
|
||||
|
||||
float D_802BA034;
|
||||
|
||||
s32 D_802BA038;
|
||||
s32 gDemoTimer;
|
||||
UNUSED s32 D_802BA03C;
|
||||
|
||||
s16 D_802BA040[4];
|
||||
@@ -81,7 +81,7 @@ void func_8028E028(void) {
|
||||
}
|
||||
func_800CA118((u8) gPlayerWinningIndex);
|
||||
D_800DC510 = 5;
|
||||
D_802BA038 = 10;
|
||||
gDemoTimer = 10;
|
||||
}
|
||||
|
||||
void update_player_battle_status(void) {
|
||||
@@ -132,14 +132,14 @@ void func_8028E298(void) {
|
||||
}
|
||||
temp_a2 = gPathIndexByPlayerId[i];
|
||||
|
||||
temp_v0 = ((2 - gPlayers[i].lapCount) * gWaypointCountByPathIndex[temp_a2]);
|
||||
temp_v0 += gWaypointCountByPathIndex[temp_a2] * (1.0f - gLapCompletionPercentByPlayerId[i]);
|
||||
temp_v0 = ((2 - gPlayers[i].lapCount) * gPathCountByPathIndex[temp_a2]);
|
||||
temp_v0 += gPathCountByPathIndex[temp_a2] * (1.0f - gLapCompletionPercentByPlayerId[i]);
|
||||
temp_v0 /= 15.0f;
|
||||
|
||||
gTimePlayerLastTouchedFinishLine[i] = gCourseTimer + temp_v0;
|
||||
}
|
||||
D_8016348C = 1;
|
||||
func_800070F4();
|
||||
update_player_rankings();
|
||||
}
|
||||
|
||||
void func_8028E3A0(void) {
|
||||
@@ -404,7 +404,7 @@ void func_8028E678(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_8028EC38(s32 arg0) {
|
||||
UNUSED void func_8028EC38(s32 arg0) {
|
||||
gGotoMode = arg0;
|
||||
D_800DC510 = 6;
|
||||
func_800CA330(25);
|
||||
@@ -412,7 +412,7 @@ void func_8028EC38(s32 arg0) {
|
||||
D_800DC5B4 = 1;
|
||||
D_800DC5B0 = 1;
|
||||
D_800DC5B8 = 0;
|
||||
D_802BA038 = 5;
|
||||
gDemoTimer = 5;
|
||||
}
|
||||
|
||||
void func_8028EC98(s32 arg0) {
|
||||
@@ -529,7 +529,7 @@ void func_8028EF28(void) {
|
||||
func_8028EEF0(i);
|
||||
|
||||
currentPosition = gPlayers[i].currentRank;
|
||||
gPlayers[i].type |= PLAYER_KART_AI;
|
||||
gPlayers[i].type |= PLAYER_CPU;
|
||||
|
||||
if (currentPosition < 4) {
|
||||
D_80150120 = 1;
|
||||
@@ -551,7 +551,7 @@ void func_8028EF28(void) {
|
||||
}
|
||||
|
||||
if (gModeSelection == VERSUS) {
|
||||
D_802BA038 = 180;
|
||||
gDemoTimer = 180;
|
||||
if (currentPosition == 0) {
|
||||
gPlayerWinningIndex = i;
|
||||
}
|
||||
@@ -566,7 +566,7 @@ void func_8028EF28(void) {
|
||||
D_800DC510 = 5;
|
||||
i = gPlayerPositionLUT[1];
|
||||
gPlayers[i].soundEffects |= 0x200000;
|
||||
gPlayers[i].type |= PLAYER_KART_AI;
|
||||
gPlayers[i].type |= PLAYER_CPU;
|
||||
func_800CA118((u8) i);
|
||||
break;
|
||||
case 3:
|
||||
@@ -584,7 +584,7 @@ void func_8028EF28(void) {
|
||||
*(gNmiUnknown2 + i * 3 + 2) = 99;
|
||||
}
|
||||
gPlayers[i].soundEffects |= 0x200000;
|
||||
gPlayers[i].type |= PLAYER_KART_AI;
|
||||
gPlayers[i].type |= PLAYER_CPU;
|
||||
func_800CA118((u8) i);
|
||||
}
|
||||
break;
|
||||
@@ -599,7 +599,7 @@ void func_8028EF28(void) {
|
||||
D_800DC510 = 5;
|
||||
i = gPlayerPositionLUT[3];
|
||||
gPlayers[i].soundEffects |= 0x200000;
|
||||
gPlayers[i].type |= PLAYER_KART_AI;
|
||||
gPlayers[i].type |= PLAYER_CPU;
|
||||
func_800CA118((u8) i);
|
||||
}
|
||||
break;
|
||||
@@ -625,7 +625,7 @@ void func_8028EF28(void) {
|
||||
}
|
||||
if ((D_802BA048 != 0) && (D_802BA048 != 100)) {
|
||||
D_802BA048 = 100;
|
||||
func_800074D4();
|
||||
set_places_end_course_with_time();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -656,7 +656,7 @@ void func_8028F474(void) {
|
||||
case 5:
|
||||
case 7:
|
||||
for (i = 0; i < NUM_PLAYERS; i++) {
|
||||
func_80009B60(i);
|
||||
update_player(i);
|
||||
}
|
||||
case 1:
|
||||
case 2:
|
||||
@@ -677,7 +677,7 @@ void func_8028F4E8(void) {
|
||||
D_800DC5B4 = 1;
|
||||
D_800DC5B0 = 1;
|
||||
D_800DC5B8 = 0;
|
||||
D_802BA038 = 5;
|
||||
gDemoTimer = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -791,7 +791,7 @@ void func_8028F970(void) {
|
||||
if (!(player->type & PLAYER_HUMAN)) {
|
||||
continue;
|
||||
}
|
||||
if (player->type & PLAYER_KART_AI) {
|
||||
if (player->type & PLAYER_CPU) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -862,27 +862,27 @@ void func_8028FBD4(void) {
|
||||
D_800DC5B4 = 1;
|
||||
D_800DC5B0 = 1;
|
||||
D_800DC5B8 = 0;
|
||||
D_802BA038 = 5;
|
||||
gDemoTimer = 5;
|
||||
}
|
||||
|
||||
#ifdef VERSION_EU
|
||||
#define D_802BA038_SIZE 1600
|
||||
#define gDemoTimer_SIZE 1600
|
||||
#else
|
||||
#define D_802BA038_SIZE 1920
|
||||
#define gDemoTimer_SIZE 1920
|
||||
#endif
|
||||
|
||||
void func_8028FC34(void) {
|
||||
if (D_802BA038 < 0) {
|
||||
D_802BA038 = D_802BA038_SIZE;
|
||||
void end_demo_update(void) {
|
||||
if (gDemoTimer < 0) {
|
||||
gDemoTimer = gDemoTimer_SIZE;
|
||||
return;
|
||||
}
|
||||
D_802BA038--;
|
||||
gDemoTimer--;
|
||||
if (gControllerFive->buttonPressed != 0) {
|
||||
func_8028FBD4();
|
||||
gMenuSelection = START_MENU;
|
||||
return;
|
||||
}
|
||||
if (D_802BA038 == 0) {
|
||||
if (gDemoTimer == 0) {
|
||||
func_8028FBD4();
|
||||
gMenuSelection = LOGO_INTRO_MENU;
|
||||
}
|
||||
@@ -894,7 +894,7 @@ void func_8028FCBC(void) {
|
||||
u32 phi_v0_4;
|
||||
|
||||
if (gDemoUseController) {
|
||||
func_8028FC34();
|
||||
end_demo_update();
|
||||
}
|
||||
switch (D_800DC510) {
|
||||
case 0:
|
||||
@@ -991,7 +991,7 @@ void func_8028FCBC(void) {
|
||||
|
||||
switch (gScreenModeSelection) {
|
||||
case SCREEN_MODE_1P:
|
||||
D_802BA038 = 690;
|
||||
gDemoTimer = 690;
|
||||
D_800DC510 = 5;
|
||||
func_8028E298();
|
||||
break;
|
||||
@@ -1007,7 +1007,7 @@ void func_8028FCBC(void) {
|
||||
}
|
||||
|
||||
func_8028E298();
|
||||
D_802BA038 = 600;
|
||||
gDemoTimer = 600;
|
||||
D_800DC510 = 5;
|
||||
}
|
||||
break;
|
||||
@@ -1020,7 +1020,7 @@ void func_8028FCBC(void) {
|
||||
func_8028F970();
|
||||
break;
|
||||
case TIME_TRIALS:
|
||||
D_802BA038 = 360;
|
||||
gDemoTimer = 360;
|
||||
if (D_8015F890 != 0) {
|
||||
D_800DC510 = 7;
|
||||
} else {
|
||||
@@ -1030,8 +1030,8 @@ void func_8028FCBC(void) {
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (D_802BA038 != 0) {
|
||||
D_802BA038--;
|
||||
if (gDemoTimer != 0) {
|
||||
gDemoTimer--;
|
||||
} else {
|
||||
switch (gModeSelection) {
|
||||
case GRAND_PRIX:
|
||||
|
||||
@@ -27,7 +27,7 @@ void func_8028F8BC(void);
|
||||
void func_8028F914(void);
|
||||
void func_8028F970(void);
|
||||
void func_8028FBD4(void);
|
||||
void func_8028FC34(void);
|
||||
void end_demo_update(void);
|
||||
void func_8028FCBC(void);
|
||||
void func_80290314(void);
|
||||
void func_80290338(void);
|
||||
|
||||
+31
-31
@@ -15,12 +15,12 @@
|
||||
#include "math_util.h"
|
||||
#include "math_util_2.h"
|
||||
#include "objects.h"
|
||||
#include "waypoints.h"
|
||||
#include "path.h"
|
||||
#include "bomb_kart.h"
|
||||
#include <assets/common_data.h>
|
||||
#include "render_player.h"
|
||||
#include "animation.h"
|
||||
#include "code_80005FD0.h"
|
||||
#include "cpu_vehicles_camera_path.h"
|
||||
#include "code_80057C60.h"
|
||||
#include "code_8006E9C0.h"
|
||||
#include "render_objects.h"
|
||||
@@ -1736,12 +1736,12 @@ void draw_hud_2d_texture(s32 x, s32 y, u32 width, u32 height, u8* texture) {
|
||||
gSPDisplayList(gDisplayListHead++, D_0D007EB8);
|
||||
}
|
||||
|
||||
void func_8004C450(s32 arg0, s32 arg1, u32 arg2, u32 arg3, u8* texture) {
|
||||
void func_8004C450(s32 x, s32 y, u32 width, u32 height, u8* texture) {
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D007F38);
|
||||
func_8004B614(D_801656C0, D_801656D0, D_801656E0, 0x80, 0x80, 0x80, 0xFF);
|
||||
load_texture_block_rgba16_mirror(texture, arg2, arg3);
|
||||
func_8004B97C(arg0 - (arg2 >> 1), arg1 - (arg3 >> 1), arg2, arg3, 1);
|
||||
load_texture_block_rgba16_mirror(texture, width, height);
|
||||
func_8004B97C(x - (width >> 1), y - (height >> 1), width, height, 1);
|
||||
gSPDisplayList(gDisplayListHead++, D_0D007EB8);
|
||||
}
|
||||
|
||||
@@ -2475,52 +2475,52 @@ void render_mini_map_finish_line(s32 arg0) {
|
||||
* characterId of 8 appears to be a type of null check or control flow alteration.
|
||||
*/
|
||||
#define EXPLICIT_AND 1
|
||||
void func_8004F168(s32 arg0, s32 playerId, s32 characterId) {
|
||||
void draw_minimap_character(s32 arg0, s32 playerId, s32 characterId) {
|
||||
f32 thing0;
|
||||
f32 thing1;
|
||||
s16 temp_a0;
|
||||
s16 temp_a1;
|
||||
s16 x;
|
||||
s16 y;
|
||||
Player* player = &gPlayerOne[playerId];
|
||||
|
||||
if (player->type & (1 << 15)) {
|
||||
thing0 = player->pos[0] * gMiniMapMarkerScale;
|
||||
thing1 = player->pos[2] * gMiniMapMarkerScale;
|
||||
temp_a0 = ((gMiniMapFinishLineX[arg0] + D_8018D2F0) - (D_8018D2B0 / 2)) + gMiniMapX + (s16) (thing0);
|
||||
temp_a1 = ((gMiniMapFinishLineY[arg0] + D_8018D2F8) - (D_8018D2B8 / 2)) + gMiniMapY + (s16) (thing1);
|
||||
x = ((gMiniMapFinishLineX[arg0] + D_8018D2F0) - (D_8018D2B0 / 2)) + gMiniMapX + (s16) (thing0);
|
||||
y = ((gMiniMapFinishLineY[arg0] + D_8018D2F8) - (D_8018D2B8 / 2)) + gMiniMapY + (s16) (thing1);
|
||||
if (characterId != 8) {
|
||||
if ((gGPCurrentRaceRankByPlayerId[playerId] == 0) && (gModeSelection != 3) && (gModeSelection != 1)) {
|
||||
#if EXPLICIT_AND == 1
|
||||
func_80046424(temp_a0, temp_a1, (player->rotation[1] + 0x8000) & 0xFFFF, 1.0f,
|
||||
func_80046424(x, y, (player->rotation[1] + 0x8000) & 0xFFFF, 1.0f,
|
||||
(u8*) common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon,
|
||||
8, 8, 8, 8);
|
||||
#else
|
||||
func_80046424(temp_a0, temp_a1, player->rotation[1] + 0x8000, 1.0f,
|
||||
func_80046424(x, y, player->rotation[1] + 0x8000, 1.0f,
|
||||
(u8*) common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon,
|
||||
8, 8, 8, 8);
|
||||
#endif
|
||||
} else {
|
||||
#if EXPLICIT_AND == 1
|
||||
func_800463B0(temp_a0, temp_a1, (player->rotation[1] + 0x8000) & 0xFFFF, 1.0f,
|
||||
func_800463B0(x, y, (player->rotation[1] + 0x8000) & 0xFFFF, 1.0f,
|
||||
(u8*) common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon,
|
||||
8, 8, 8, 8);
|
||||
#else
|
||||
func_800463B0(temp_a0, temp_a1, player->rotation[1] + 0x8000, 1.0f,
|
||||
func_800463B0(x, y, player->rotation[1] + 0x8000, 1.0f,
|
||||
(u8*) common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon,
|
||||
8, 8, 8, 8);
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
if (gGPCurrentRaceRankByPlayerId[playerId] == 0) {
|
||||
func_8004C450(temp_a0, temp_a1, 8, 8, (u8*) common_texture_minimap_progress_dot);
|
||||
func_8004C450(x, y, 8, 8, (u8*) common_texture_minimap_progress_dot);
|
||||
} else {
|
||||
draw_hud_2d_texture(temp_a0, temp_a1, 8, 8, (u8*) common_texture_minimap_progress_dot);
|
||||
draw_hud_2d_texture(x, y, 8, 8, (u8*) common_texture_minimap_progress_dot);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#undef EXPLICIT_AND
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/render_objects/func_8004F168.s")
|
||||
GLOBAL_ASM("asm/non_matchings/render_objects/draw_minimap_character.s")
|
||||
#endif
|
||||
|
||||
// WTF is up with the gPlayerOne access in this function?
|
||||
@@ -2533,35 +2533,35 @@ void func_8004F3E4(s32 arg0) {
|
||||
case GRAND_PRIX:
|
||||
for (idx = D_8018D158 - 1; idx >= 0; idx--) {
|
||||
playerId = gGPCurrentRacePlayerIdByRank[idx];
|
||||
if ((gPlayerOne + playerId)->type & PLAYER_KART_AI) {
|
||||
func_8004F168(arg0, playerId, 8);
|
||||
if ((gPlayerOne + playerId)->type & PLAYER_CPU) {
|
||||
draw_minimap_character(arg0, playerId, 8);
|
||||
}
|
||||
}
|
||||
for (idx = D_8018D158 - 1; idx >= 0; idx--) {
|
||||
playerId = gGPCurrentRacePlayerIdByRank[idx];
|
||||
if (((gPlayerOne + playerId)->type & PLAYER_KART_AI) != PLAYER_KART_AI) {
|
||||
func_8004F168(arg0, playerId, (gPlayerOne + playerId)->characterId);
|
||||
if (((gPlayerOne + playerId)->type & PLAYER_CPU) != PLAYER_CPU) {
|
||||
draw_minimap_character(arg0, playerId, (gPlayerOne + playerId)->characterId);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TIME_TRIALS:
|
||||
for (idx = 0; idx < 8; idx++) {
|
||||
if (((gPlayerOne + idx)->type & PLAYER_INVISIBLE_OR_BOMB) == PLAYER_INVISIBLE_OR_BOMB) {
|
||||
func_8004F168(arg0, idx, 8);
|
||||
draw_minimap_character(arg0, idx, 8);
|
||||
}
|
||||
}
|
||||
func_8004F168(arg0, 0, gPlayerOne->characterId);
|
||||
draw_minimap_character(arg0, 0, gPlayerOne->characterId);
|
||||
break;
|
||||
case VERSUS:
|
||||
for (idx = gPlayerCountSelection1 - 1; idx >= 0; idx--) {
|
||||
playerId = gGPCurrentRacePlayerIdByRank[idx];
|
||||
func_8004F168(arg0, playerId, (gPlayerOne + playerId)->characterId);
|
||||
draw_minimap_character(arg0, playerId, (gPlayerOne + playerId)->characterId);
|
||||
}
|
||||
break;
|
||||
case BATTLE:
|
||||
for (idx = 0; idx < gPlayerCountSelection1; idx++) {
|
||||
if (!((gPlayerOne + idx)->type & PLAYER_UNKNOWN_0x40)) {
|
||||
func_8004F168(arg0, idx, (gPlayerOne + idx)->characterId);
|
||||
draw_minimap_character(arg0, idx, (gPlayerOne + idx)->characterId);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2843,11 +2843,11 @@ s32 func_80050644(u16 arg0, s32* arg1, s32* arg2) {
|
||||
}
|
||||
|
||||
void func_800507D8(u16 bombIndex, s32* arg1, s32* arg2) {
|
||||
s32 temp_v0 = gBombKarts[bombIndex].waypointIndex;
|
||||
s32 temp_v0 = gBombKarts[bombIndex].pathPointIndex;
|
||||
s32 var_v1 = 0;
|
||||
|
||||
if (temp_v0 != 0) {
|
||||
var_v1 = (s32) (temp_v0 * 0x3A0) / (s32) D_80164430;
|
||||
var_v1 = (s32) (temp_v0 * 0x3A0) / (s32) gSelectedPathCount;
|
||||
}
|
||||
if (var_v1 < 0x104) {
|
||||
*arg1 = var_v1;
|
||||
@@ -3073,12 +3073,12 @@ void func_800514BC(void) {
|
||||
for (var_s0 = var_s3 - 1, var_s1 = 0; var_s1 < var_s3; var_s1++, var_s0--) {
|
||||
temp_a0 = gGPCurrentRacePlayerIdByRank[var_s0];
|
||||
player = &gPlayerOne[temp_a0];
|
||||
if ((player->type & 0x8000) && ((temp_a0 != 0) || (gPlayerCountSelection1 != 1))) {
|
||||
if ((player->type & PLAYER_EXISTS) && ((temp_a0 != 0) || (gPlayerCountSelection1 != 1))) {
|
||||
func_80050E34(temp_a0, var_s0);
|
||||
}
|
||||
}
|
||||
if (gModeSelection == 1) {
|
||||
func_80050E34(0, D_80164408[0]);
|
||||
func_80050E34(0, gGPCurrentRaceRankByPlayerIdDup[0]);
|
||||
} else if (gPlayerCountSelection1 == 1) {
|
||||
func_80050E34(0, gGPCurrentRaceRankByPlayerId[0]);
|
||||
}
|
||||
@@ -3745,7 +3745,7 @@ void func_80053D74(s32 objectIndex, UNUSED s32 arg1, s32 vertexIndex) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_80053E6C(s32 arg0) {
|
||||
void render_object_grand_prix_balloons(s32 arg0) {
|
||||
s32 var_s1;
|
||||
s32 objectIndex;
|
||||
|
||||
@@ -3761,7 +3761,7 @@ void func_80053E6C(s32 arg0) {
|
||||
func_80053D74(objectIndex, arg0, 0);
|
||||
}
|
||||
}
|
||||
rsp_load_texture(D_8018D4C0, 0x40, 0x20);
|
||||
rsp_load_texture(D_8018D4C0, 64, 32);
|
||||
for (var_s1 = 0; var_s1 < D_80165738; var_s1++) {
|
||||
objectIndex = gObjectParticle3[var_s1];
|
||||
if ((objectIndex != NULL_OBJECT_ID) && (gObjectList[objectIndex].state >= 2)) {
|
||||
|
||||
@@ -295,7 +295,7 @@ void func_8004EE54(s32);
|
||||
|
||||
void func_8004EF9C(s32);
|
||||
void render_mini_map_finish_line(s32);
|
||||
void func_8004F168(s32, s32, s32);
|
||||
void draw_minimap_character(s32, s32, s32);
|
||||
void func_8004F3E4(s32);
|
||||
s32 func_8004F674(s32*, s32);
|
||||
void print_timer(s32, s32, s32);
|
||||
@@ -346,7 +346,7 @@ void func_800534E8(s32);
|
||||
void render_object_thwomps_model(s32);
|
||||
void render_object_thwomps(s32);
|
||||
void func_80053D74(s32, s32, s32);
|
||||
void func_80053E6C(s32);
|
||||
void render_object_grand_prix_balloons(s32);
|
||||
|
||||
void render_object_train_smoke_particle(s32, s32);
|
||||
void render_object_trains_smoke_particles(s32);
|
||||
|
||||
+42
-42
@@ -17,7 +17,7 @@
|
||||
#include "code_80057C60.h"
|
||||
#include "effects.h"
|
||||
#include "buffers.h"
|
||||
#include "waypoints.h"
|
||||
#include "path.h"
|
||||
#include "player_controller.h"
|
||||
#include "render_objects.h"
|
||||
#include <assets/common_data.h>
|
||||
@@ -1091,12 +1091,12 @@ void change_player_color_effect_cmy(UNUSED Player* player, s8 arg1, s32 arg2, f3
|
||||
bool is_player_under_light_luigi_raceway(Player* player, s8 arg1) {
|
||||
switch (gCurrentCourseId) {
|
||||
case COURSE_LUIGI_RACEWAY:
|
||||
if (((gNearestWaypointByPlayerId[arg1] >= 0x14F) && (gNearestWaypointByPlayerId[arg1] < 0x158)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x15E) && (gNearestWaypointByPlayerId[arg1] < 0x164)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x169) && (gNearestWaypointByPlayerId[arg1] < 0x170)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x174) && (gNearestWaypointByPlayerId[arg1] < 0x17A)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x17E) &&
|
||||
(gNearestWaypointByPlayerId[arg1] < 0x184))) { // under a light in the tunnel
|
||||
if (((gNearestPathPointByPlayerId[arg1] >= 0x14F) && (gNearestPathPointByPlayerId[arg1] < 0x158)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x15E) && (gNearestPathPointByPlayerId[arg1] < 0x164)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x169) && (gNearestPathPointByPlayerId[arg1] < 0x170)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x174) && (gNearestPathPointByPlayerId[arg1] < 0x17A)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x17E) &&
|
||||
(gNearestPathPointByPlayerId[arg1] < 0x184))) { // under a light in the tunnel
|
||||
change_player_color_effect_rgb(player, arg1, COLOR_LIGHT, 0.3f);
|
||||
change_player_color_effect_cmy(player, arg1, 0xE0, 0.3f);
|
||||
D_80164B80[arg1] = 0;
|
||||
@@ -1112,20 +1112,20 @@ bool is_player_under_light_luigi_raceway(Player* player, s8 arg1) {
|
||||
void render_light_environment_on_player(Player* player, s8 arg1) {
|
||||
switch (gCurrentCourseId) {
|
||||
case COURSE_BOWSER_CASTLE:
|
||||
if (((gNearestWaypointByPlayerId[arg1] >= 0x15) && (gNearestWaypointByPlayerId[arg1] < 0x2A)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x14D) && (gNearestWaypointByPlayerId[arg1] < 0x15C)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x1D1) && (gNearestWaypointByPlayerId[arg1] < 0x1E4)) ||
|
||||
if (((gNearestPathPointByPlayerId[arg1] >= 0x15) && (gNearestPathPointByPlayerId[arg1] < 0x2A)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x14D) && (gNearestPathPointByPlayerId[arg1] < 0x15C)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x1D1) && (gNearestPathPointByPlayerId[arg1] < 0x1E4)) ||
|
||||
(player->collision.surfaceDistance[2] >= 500.0f)) { // over lava
|
||||
change_player_color_effect_rgb(player, arg1, COLOR_LAVA, 0.3f);
|
||||
change_player_color_effect_cmy(player, arg1, 0x004040, 0.3f);
|
||||
D_80164B80[arg1] = 0;
|
||||
} else if (((gNearestWaypointByPlayerId[arg1] >= 0xF1) && (gNearestWaypointByPlayerId[arg1] < 0xF5)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0xFB) && (gNearestWaypointByPlayerId[arg1] < 0xFF)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x105) && (gNearestWaypointByPlayerId[arg1] < 0x109)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x10F) && (gNearestWaypointByPlayerId[arg1] < 0x113)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x145) && (gNearestWaypointByPlayerId[arg1] < 0x14A)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x15E) &&
|
||||
(gNearestWaypointByPlayerId[arg1] < 0x163))) { // under a lamp
|
||||
} else if (((gNearestPathPointByPlayerId[arg1] >= 0xF1) && (gNearestPathPointByPlayerId[arg1] < 0xF5)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0xFB) && (gNearestPathPointByPlayerId[arg1] < 0xFF)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x105) && (gNearestPathPointByPlayerId[arg1] < 0x109)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x10F) && (gNearestPathPointByPlayerId[arg1] < 0x113)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x145) && (gNearestPathPointByPlayerId[arg1] < 0x14A)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x15E) &&
|
||||
(gNearestPathPointByPlayerId[arg1] < 0x163))) { // under a lamp
|
||||
change_player_color_effect_rgb(player, arg1, COLOR_LIGHT, 0.3f);
|
||||
change_player_color_effect_cmy(player, arg1, 0xE0, 0.3f);
|
||||
D_80164B80[arg1] = 0;
|
||||
@@ -1136,25 +1136,25 @@ void render_light_environment_on_player(Player* player, s8 arg1) {
|
||||
}
|
||||
break;
|
||||
case COURSE_BANSHEE_BOARDWALK:
|
||||
if (((gNearestWaypointByPlayerId[arg1] >= 0xD) && (gNearestWaypointByPlayerId[arg1] < 0x15)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x29) && (gNearestWaypointByPlayerId[arg1] < 0x39)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x46) && (gNearestWaypointByPlayerId[arg1] < 0x4E)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x5F) && (gNearestWaypointByPlayerId[arg1] < 0x67)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x7B) && (gNearestWaypointByPlayerId[arg1] < 0x86)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x9D) && (gNearestWaypointByPlayerId[arg1] < 0xA6)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0xB9) && (gNearestWaypointByPlayerId[arg1] < 0xC3)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0xB9) && (gNearestWaypointByPlayerId[arg1] < 0xC3)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0xD7) && (gNearestWaypointByPlayerId[arg1] < 0xE1)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x10E) && (gNearestWaypointByPlayerId[arg1] < 0x119)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x154) && (gNearestWaypointByPlayerId[arg1] < 0x15F)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x1EF) && (gNearestWaypointByPlayerId[arg1] < 0x1F7)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x202) && (gNearestWaypointByPlayerId[arg1] < 0x209)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x216) && (gNearestWaypointByPlayerId[arg1] < 0x21D)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x230) && (gNearestWaypointByPlayerId[arg1] < 0x23A)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x24C) && (gNearestWaypointByPlayerId[arg1] < 0x256)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x288) && (gNearestWaypointByPlayerId[arg1] < 0x269)) ||
|
||||
((gNearestWaypointByPlayerId[arg1] >= 0x274) &&
|
||||
(gNearestWaypointByPlayerId[arg1] < 0x27E))) { // under a lamp
|
||||
if (((gNearestPathPointByPlayerId[arg1] >= 0xD) && (gNearestPathPointByPlayerId[arg1] < 0x15)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x29) && (gNearestPathPointByPlayerId[arg1] < 0x39)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x46) && (gNearestPathPointByPlayerId[arg1] < 0x4E)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x5F) && (gNearestPathPointByPlayerId[arg1] < 0x67)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x7B) && (gNearestPathPointByPlayerId[arg1] < 0x86)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x9D) && (gNearestPathPointByPlayerId[arg1] < 0xA6)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0xB9) && (gNearestPathPointByPlayerId[arg1] < 0xC3)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0xB9) && (gNearestPathPointByPlayerId[arg1] < 0xC3)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0xD7) && (gNearestPathPointByPlayerId[arg1] < 0xE1)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x10E) && (gNearestPathPointByPlayerId[arg1] < 0x119)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x154) && (gNearestPathPointByPlayerId[arg1] < 0x15F)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x1EF) && (gNearestPathPointByPlayerId[arg1] < 0x1F7)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x202) && (gNearestPathPointByPlayerId[arg1] < 0x209)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x216) && (gNearestPathPointByPlayerId[arg1] < 0x21D)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x230) && (gNearestPathPointByPlayerId[arg1] < 0x23A)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x24C) && (gNearestPathPointByPlayerId[arg1] < 0x256)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x288) && (gNearestPathPointByPlayerId[arg1] < 0x269)) ||
|
||||
((gNearestPathPointByPlayerId[arg1] >= 0x274) &&
|
||||
(gNearestPathPointByPlayerId[arg1] < 0x27E))) { // under a lamp
|
||||
change_player_color_effect_rgb(player, arg1, COLOR_LIGHT, 0.3f);
|
||||
change_player_color_effect_cmy(player, arg1, 0x0000E0, 0.3f);
|
||||
D_80164B80[arg1] = 0;
|
||||
@@ -1298,11 +1298,11 @@ void render_player_shadow(Player* player, s8 playerId, s8 screenId) {
|
||||
spB0 = -coss(temp_t9 << 7) * 2;
|
||||
spAC = -sins(temp_t9 << 7) * 2;
|
||||
|
||||
if (((player->effects & 0x01000000) == 0x01000000) || ((player->effects & 0x400) == 0x400) ||
|
||||
((player->effects & 0x80000) == 0x80000) || ((player->effects & 0x800000) == 0x800000) ||
|
||||
((player->effects & 0x400) == 0x400) || ((player->unk_0CA & 2) == 2) ||
|
||||
((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) || ((player->effects & 0x10000) == 0x10000) ||
|
||||
((player->effects & 8) == 8)) {
|
||||
if (((player->effects & UNKNOWN_EFFECT_0x1000000) == UNKNOWN_EFFECT_0x1000000) ||
|
||||
((player->effects & 0x400) == 0x400) || ((player->effects & 0x80000) == 0x80000) ||
|
||||
((player->effects & 0x800000) == 0x800000) || ((player->effects & 0x400) == 0x400) ||
|
||||
((player->unk_0CA & 2) == 2) || ((player->effects & HIT_BY_ITEM_EFFECT) == HIT_BY_ITEM_EFFECT) ||
|
||||
((player->effects & UNKNOWN_EFFECT_0x10000) == UNKNOWN_EFFECT_0x10000) || ((player->effects & 8) == 8)) {
|
||||
|
||||
var_f2 = (f32) (1.0 - ((f64) player->collision.surfaceDistance[2] * 0.02));
|
||||
if (var_f2 < 0.0f) {
|
||||
@@ -1753,7 +1753,7 @@ void func_80026A48(Player* player, s8 arg1) {
|
||||
return;
|
||||
}
|
||||
|
||||
temp_f0 = ((player->unk_094 * (1.0f + player->unk_104)) / 18.0f) * 216.0f;
|
||||
temp_f0 = ((player->speed * (1.0f + player->unk_104)) / 18.0f) * 216.0f;
|
||||
if ((temp_f0 <= 1.0f) || (gIsPlayerTripleBButtonCombo[arg1] == true)) {
|
||||
player->unk_240 = 0;
|
||||
} else {
|
||||
|
||||
+120
-128
@@ -6,7 +6,7 @@
|
||||
#include "code_800029B0.h"
|
||||
#include "kart_attributes.h"
|
||||
#include "memory.h"
|
||||
#include "waypoints.h"
|
||||
#include "path.h"
|
||||
#include "buffers.h"
|
||||
#include "kart_dma.h"
|
||||
#include "camera.h"
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "collision.h"
|
||||
#include "render_courses.h"
|
||||
#include "staff_ghosts.h"
|
||||
#include "code_80005FD0.h"
|
||||
#include "cpu_vehicles_camera_path.h"
|
||||
#include "render_player.h"
|
||||
#include "podium_ceremony_actors.h"
|
||||
#include "main.h"
|
||||
@@ -37,8 +37,8 @@ s32 D_801652E0[8];
|
||||
s16 D_80165300[8];
|
||||
// Shadows values from gPathIndexByPlayerId, but is an array
|
||||
u16 gCopyPathIndexByPlayerId[8];
|
||||
// Shadows values from gNearestWaypointByPlayerId, but is an array
|
||||
s16 gCopyNearestWaypointByPlayerId[8];
|
||||
// Shadows values from gNearestPathPointByPlayerId, but is an array
|
||||
s16 gCopyNearestPathPointByPlayerId[8];
|
||||
s16 D_80165330[8];
|
||||
s16 D_80165340;
|
||||
UNUSED s32 D_80165348[29];
|
||||
@@ -58,7 +58,7 @@ s32 gCountBChangement[8];
|
||||
bool gIsPlayerTripleBButtonCombo[8];
|
||||
s32 gTimerBoostTripleBCombo[8];
|
||||
|
||||
s16 chooseKartAIPlayers[7];
|
||||
s16 cpu_chooseCharacters[7];
|
||||
|
||||
s16 D_8016556E;
|
||||
s16 D_80165570;
|
||||
@@ -118,7 +118,7 @@ void spawn_player(Player* player, s8 playerIndex, f32 startingRow, f32 startingC
|
||||
player->oldPos[0] = startingRow;
|
||||
player->oldPos[1] = ret;
|
||||
|
||||
D_80164510[playerIndex] = ret;
|
||||
gPlayerPathY[playerIndex] = ret;
|
||||
|
||||
player->rotation[0] = 0;
|
||||
player->oldPos[2] = startingColumn;
|
||||
@@ -141,7 +141,7 @@ void spawn_player(Player* player, s8 playerIndex, f32 startingRow, f32 startingC
|
||||
player->lapCount = -1;
|
||||
player->unk_08C = 0.0f;
|
||||
player->unk_090 = 0.0f;
|
||||
player->unk_094 = 0.0f;
|
||||
player->speed = 0.0f;
|
||||
player->unk_074 = 0.0f;
|
||||
player->type = playerType;
|
||||
player->unk_0CA = 0;
|
||||
@@ -193,7 +193,7 @@ void spawn_player(Player* player, s8 playerIndex, f32 startingRow, f32 startingC
|
||||
player->unk_10C = 0;
|
||||
player->unk_200 = 0;
|
||||
player->unk_204 = 0;
|
||||
player->nearestWaypointId = 0;
|
||||
player->nearestPathPointId = 0;
|
||||
player->unk_228 = 0;
|
||||
player->unk_22A = 0;
|
||||
player->unk_234 = 0;
|
||||
@@ -223,7 +223,7 @@ void spawn_player(Player* player, s8 playerIndex, f32 startingRow, f32 startingC
|
||||
player->unk_088 = 0.0f;
|
||||
player->unk_08C = 0.0f;
|
||||
player->unk_090 = 0.0f;
|
||||
player->unk_094 = 0.0f;
|
||||
player->speed = 0.0f;
|
||||
player->unk_098 = 0.0f;
|
||||
player->currentSpeed = 0.0f;
|
||||
player->unk_0A0 = 0.0f;
|
||||
@@ -243,7 +243,7 @@ void spawn_player(Player* player, s8 playerIndex, f32 startingRow, f32 startingC
|
||||
player->unk_210 = 0.0f;
|
||||
player->unk_218 = 0.0f;
|
||||
player->unk_21C = 0.0f;
|
||||
player->unk_22C = 0.0f;
|
||||
player->previousSpeed = 0.0f;
|
||||
player->unk_230 = 0.0f;
|
||||
player->unk_23C = 0.0f;
|
||||
|
||||
@@ -494,16 +494,16 @@ void spawn_players_gp_one_player(f32* arg0, f32* arg1, f32 arg2) {
|
||||
} while (rand == gCharacterSelections[0]);
|
||||
|
||||
// Randomize gPlayerTwo
|
||||
chooseKartAIPlayers[0] = rand;
|
||||
cpu_chooseCharacters[0] = rand;
|
||||
|
||||
// Chooses arr[0] as a fallback to prevent duplicating characters.
|
||||
// If it doesn't find the if, it will grab the final index as a fallback.
|
||||
for (i = 1; i < 7; i++) {
|
||||
u16* arr = (u16*) gKartAIforPlayer[gCharacterSelections[0]];
|
||||
u16* arr = (u16*) cpu_forPlayer[gCharacterSelections[0]];
|
||||
if (rand == arr[i]) {
|
||||
chooseKartAIPlayers[i] = arr[0];
|
||||
cpu_chooseCharacters[i] = arr[0];
|
||||
} else {
|
||||
chooseKartAIPlayers[i] = arr[i];
|
||||
cpu_chooseCharacters[i] = arr[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -511,39 +511,39 @@ void spawn_players_gp_one_player(f32* arg0, f32* arg1, f32 arg2) {
|
||||
D_8016556E = 0;
|
||||
if (gDemoMode == 1) {
|
||||
spawn_player(gPlayerOneCopy, 0, arg0[D_80165270[0]], arg1[D_80165270[0]], arg2, 32768.0f,
|
||||
gCharacterSelections[0], PLAYER_HUMAN_AND_KART_AI);
|
||||
spawn_player(gPlayerTwo, 1, arg0[D_80165270[1]], arg1[D_80165270[1]], arg2, 32768.0f, chooseKartAIPlayers[0],
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerThree, 2, arg0[D_80165270[2]], arg1[D_80165270[2]], arg2, 32768.0f, chooseKartAIPlayers[1],
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerFour, 3, arg0[D_80165270[3]], arg1[D_80165270[3]], arg2, 32768.0f, chooseKartAIPlayers[2],
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerFive, 4, arg0[D_80165270[4]], arg1[D_80165270[4]], arg2, 32768.0f, chooseKartAIPlayers[3],
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerSix, 5, arg0[D_80165270[5]], arg1[D_80165270[5]], arg2, 32768.0f, chooseKartAIPlayers[4],
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerSeven, 6, arg0[D_80165270[6]], arg1[D_80165270[6]], arg2, 32768.0f, chooseKartAIPlayers[5],
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerEight, 7, arg0[D_80165270[7]], arg1[D_80165270[7]], arg2, 32768.0f, chooseKartAIPlayers[6],
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
gCharacterSelections[0], PLAYER_HUMAN_AND_CPU);
|
||||
spawn_player(gPlayerTwo, 1, arg0[D_80165270[1]], arg1[D_80165270[1]], arg2, 32768.0f, cpu_chooseCharacters[0],
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerThree, 2, arg0[D_80165270[2]], arg1[D_80165270[2]], arg2, 32768.0f, cpu_chooseCharacters[1],
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerFour, 3, arg0[D_80165270[3]], arg1[D_80165270[3]], arg2, 32768.0f, cpu_chooseCharacters[2],
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerFive, 4, arg0[D_80165270[4]], arg1[D_80165270[4]], arg2, 32768.0f, cpu_chooseCharacters[3],
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerSix, 5, arg0[D_80165270[5]], arg1[D_80165270[5]], arg2, 32768.0f, cpu_chooseCharacters[4],
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerSeven, 6, arg0[D_80165270[6]], arg1[D_80165270[6]], arg2, 32768.0f, cpu_chooseCharacters[5],
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerEight, 7, arg0[D_80165270[7]], arg1[D_80165270[7]], arg2, 32768.0f, cpu_chooseCharacters[6],
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
D_80164A28 = 0;
|
||||
} else {
|
||||
spawn_player(gPlayerOneCopy, 0, arg0[D_80165270[0]], arg1[D_80165270[0]] + 250.0f, arg2, 32768.0f,
|
||||
gCharacterSelections[0], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_HUMAN);
|
||||
spawn_player(gPlayerTwo, 1, arg0[D_80165270[1]], arg1[D_80165270[1]] + 250.0f, arg2, 32768.0f,
|
||||
chooseKartAIPlayers[0], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
cpu_chooseCharacters[0], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerThree, 2, arg0[D_80165270[3]], arg1[D_80165270[2]] + 250.0f, arg2, 32768.0f,
|
||||
chooseKartAIPlayers[1], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
cpu_chooseCharacters[1], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerFour, 3, arg0[D_80165270[2]], arg1[D_80165270[3]] + 250.0f, arg2, 32768.0f,
|
||||
chooseKartAIPlayers[2], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
cpu_chooseCharacters[2], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerFive, 4, arg0[D_80165270[5]], arg1[D_80165270[4]] + 250.0f, arg2, 32768.0f,
|
||||
chooseKartAIPlayers[3], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
cpu_chooseCharacters[3], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerSix, 5, arg0[D_80165270[4]], arg1[D_80165270[5]] + 250.0f, arg2, 32768.0f,
|
||||
chooseKartAIPlayers[4], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
cpu_chooseCharacters[4], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerSeven, 6, arg0[D_80165270[7]], arg1[D_80165270[6]] + 250.0f, arg2, 32768.0f,
|
||||
chooseKartAIPlayers[5], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
cpu_chooseCharacters[5], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerEight, 7, arg0[D_80165270[6]], arg1[D_80165270[7]] + 250.0f, arg2, 32768.0f,
|
||||
chooseKartAIPlayers[6], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
cpu_chooseCharacters[6], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
D_80164A28 = 1;
|
||||
}
|
||||
func_80039AE4();
|
||||
@@ -551,22 +551,22 @@ void spawn_players_gp_one_player(f32* arg0, f32* arg1, f32 arg2) {
|
||||
|
||||
void spawn_players_versus_one_player(f32* arg0, f32* arg1, f32 arg2) {
|
||||
spawn_player(gPlayerFour, 3, arg0[2], arg1[2], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerFive, 4, arg0[3], arg1[3], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerSix, 5, arg0[4], arg1[4], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerSeven, 6, arg0[5], arg1[5], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerEight, 7, arg0[6], arg1[6], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
if (gDemoMode == 1) {
|
||||
spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_HUMAN_AND_KART_AI);
|
||||
PLAYER_HUMAN_AND_CPU);
|
||||
spawn_player(gPlayerTwo, 1, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerThree, 2, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
} else if (D_8015F890 != 1) {
|
||||
spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN);
|
||||
@@ -575,14 +575,14 @@ void spawn_players_versus_one_player(f32* arg0, f32* arg1, f32 arg2) {
|
||||
PLAYER_EXISTS | PLAYER_HUMAN | PLAYER_START_SEQUENCE | PLAYER_INVISIBLE_OR_BOMB);
|
||||
} else {
|
||||
spawn_player(gPlayerTwo, 1, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
}
|
||||
if (D_80162DD6 == 0) {
|
||||
spawn_player(gPlayerThree, 2, arg0[0], arg1[0], arg2, 32768.0f, D_80162DE4,
|
||||
PLAYER_EXISTS | PLAYER_HUMAN | PLAYER_START_SEQUENCE | PLAYER_INVISIBLE_OR_BOMB);
|
||||
} else {
|
||||
spawn_player(gPlayerThree, 2, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
}
|
||||
} else {
|
||||
spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, D_80162DE8,
|
||||
@@ -592,14 +592,14 @@ void spawn_players_versus_one_player(f32* arg0, f32* arg1, f32 arg2) {
|
||||
PLAYER_EXISTS | PLAYER_HUMAN | PLAYER_START_SEQUENCE | PLAYER_INVISIBLE_OR_BOMB);
|
||||
} else {
|
||||
spawn_player(gPlayerTwo, 1, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
}
|
||||
if (D_80162DD6 == 0) {
|
||||
spawn_player(gPlayerThree, 2, arg0[0], arg1[0], arg2, 32768.0f, D_80162DE4,
|
||||
PLAYER_EXISTS | PLAYER_HUMAN | PLAYER_START_SEQUENCE | PLAYER_INVISIBLE_OR_BOMB);
|
||||
} else {
|
||||
spawn_player(gPlayerThree, 2, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
}
|
||||
}
|
||||
D_80164A28 = 0;
|
||||
@@ -622,41 +622,41 @@ void spawn_players_gp_two_player(f32* arg0, f32* arg1, f32 arg2) {
|
||||
goto getRand;
|
||||
}
|
||||
|
||||
chooseKartAIPlayers[0] = rand;
|
||||
cpu_chooseCharacters[0] = rand;
|
||||
|
||||
for (i = 1; i < 6; i++) {
|
||||
u16* arr = (u16*) gKartAIforTwoPlayer[gCharacterSelections[0]][gCharacterSelections[1]];
|
||||
u16* arr = (u16*) cpu_forTwoPlayer[gCharacterSelections[0]][gCharacterSelections[1]];
|
||||
if (rand == arr[i]) {
|
||||
chooseKartAIPlayers[i] = arr[0];
|
||||
cpu_chooseCharacters[i] = arr[0];
|
||||
} else {
|
||||
chooseKartAIPlayers[i] = arr[i];
|
||||
cpu_chooseCharacters[i] = arr[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
spawn_player(gPlayerThree, 2, arg0[D_80165270[2]], arg1[D_80165270[2]], arg2, 32768.0f, chooseKartAIPlayers[0],
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerFour, 3, arg0[D_80165270[3]], arg1[D_80165270[3]], arg2, 32768.0f, chooseKartAIPlayers[1],
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerFive, 4, arg0[D_80165270[4]], arg1[D_80165270[4]], arg2, 32768.0f, chooseKartAIPlayers[2],
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerSix, 5, arg0[D_80165270[5]], arg1[D_80165270[5]], arg2, 32768.0f, chooseKartAIPlayers[3],
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerSeven, 6, arg0[D_80165270[6]], arg1[D_80165270[6]], arg2, 32768.0f, chooseKartAIPlayers[4],
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerEight, 7, arg0[D_80165270[7]], arg1[D_80165270[7]], arg2, 32768.0f, chooseKartAIPlayers[5],
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerThree, 2, arg0[D_80165270[2]], arg1[D_80165270[2]], arg2, 32768.0f, cpu_chooseCharacters[0],
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerFour, 3, arg0[D_80165270[3]], arg1[D_80165270[3]], arg2, 32768.0f, cpu_chooseCharacters[1],
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerFive, 4, arg0[D_80165270[4]], arg1[D_80165270[4]], arg2, 32768.0f, cpu_chooseCharacters[2],
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerSix, 5, arg0[D_80165270[5]], arg1[D_80165270[5]], arg2, 32768.0f, cpu_chooseCharacters[3],
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerSeven, 6, arg0[D_80165270[6]], arg1[D_80165270[6]], arg2, 32768.0f, cpu_chooseCharacters[4],
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerEight, 7, arg0[D_80165270[7]], arg1[D_80165270[7]], arg2, 32768.0f, cpu_chooseCharacters[5],
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
|
||||
if (gDemoMode == 1) {
|
||||
spawn_player(gPlayerOneCopy, 0, arg0[D_80165270[0]], arg1[D_80165270[0]], arg2, 32768.0f,
|
||||
gCharacterSelections[0], PLAYER_HUMAN_AND_KART_AI);
|
||||
gCharacterSelections[0], PLAYER_HUMAN_AND_CPU);
|
||||
} else {
|
||||
spawn_player(gPlayerOneCopy, 0, arg0[D_80165270[0]], arg1[D_80165270[0]], arg2, 32768.0f,
|
||||
gCharacterSelections[0], PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN);
|
||||
}
|
||||
if (gDemoMode == 1) {
|
||||
spawn_player(gPlayerTwo, 1, arg0[D_80165270[1]], arg1[D_80165270[1]], arg2, 32768.0f, gCharacterSelections[1],
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
} else {
|
||||
spawn_player(gPlayerTwo, 1, arg0[D_80165270[1]], arg1[D_80165270[1]], arg2, 32768.0f, gCharacterSelections[1],
|
||||
PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN);
|
||||
@@ -668,27 +668,26 @@ void spawn_players_gp_two_player(f32* arg0, f32* arg1, f32 arg2) {
|
||||
|
||||
void spawn_players_versus_two_player(f32* arg0, f32* arg1, f32 arg2) {
|
||||
spawn_player(gPlayerThree, 2, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerFour, 3, arg0[2], arg1[2], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerFive, 4, arg0[3], arg1[3], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerSix, 5, arg0[4], arg1[4], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerSeven, 6, arg0[5], arg1[5], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerEight, 7, arg0[6], arg1[6], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
if (gDemoMode == 1) {
|
||||
spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_HUMAN_AND_KART_AI);
|
||||
PLAYER_HUMAN_AND_CPU);
|
||||
} else {
|
||||
spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN);
|
||||
}
|
||||
if (gDemoMode == 1) {
|
||||
spawn_player(gPlayerTwo, 1, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[1],
|
||||
PLAYER_HUMAN_AND_KART_AI);
|
||||
spawn_player(gPlayerTwo, 1, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[1], PLAYER_HUMAN_AND_CPU);
|
||||
} else {
|
||||
spawn_player(gPlayerTwo, 1, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[1],
|
||||
PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN);
|
||||
@@ -713,10 +712,10 @@ void spawn_players_2p_battle(f32* arg0, f32* arg1, f32 arg2) {
|
||||
PLAYER_START_SEQUENCE | PLAYER_HUMAN);
|
||||
spawn_player(gPlayerFour, 3, arg0[3], arg1[3], arg2, 32768.0f, gCharacterSelections[3],
|
||||
PLAYER_START_SEQUENCE | PLAYER_HUMAN);
|
||||
spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
D_80164A28 = 0;
|
||||
func_80039AE4();
|
||||
}
|
||||
@@ -729,19 +728,16 @@ void func_8003B318(f32* arg0, f32* arg1, f32 arg2) {
|
||||
spawn_player(gPlayerThree, 2, arg0[2], arg1[2], arg2, 32768.0f, gCharacterSelections[2],
|
||||
PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN);
|
||||
if (gDemoMode == 1) {
|
||||
spawn_player(gPlayerOne, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_HUMAN_AND_KART_AI);
|
||||
spawn_player(gPlayerTwo, 1, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[1],
|
||||
PLAYER_HUMAN_AND_KART_AI);
|
||||
spawn_player(gPlayerThree, 2, arg0[2], arg1[2], arg2, 32768.0f, gCharacterSelections[2],
|
||||
PLAYER_HUMAN_AND_KART_AI);
|
||||
spawn_player(gPlayerOne, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], PLAYER_HUMAN_AND_CPU);
|
||||
spawn_player(gPlayerTwo, 1, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[1], PLAYER_HUMAN_AND_CPU);
|
||||
spawn_player(gPlayerThree, 2, arg0[2], arg1[2], arg2, 32768.0f, gCharacterSelections[2], PLAYER_HUMAN_AND_CPU);
|
||||
}
|
||||
|
||||
spawn_player(gPlayerFour, 3, arg0[3], arg1[3], arg2, 32768.0f, 3, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerFour, 3, arg0[3], arg1[3], arg2, 32768.0f, 3, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
D_80164A28 = 0;
|
||||
func_80039AE4();
|
||||
}
|
||||
@@ -762,11 +758,11 @@ void spawn_players_3p_battle(f32* arg0, f32* arg1, f32 arg2) {
|
||||
spawn_player(gPlayerThree, 2, arg0[2], arg1[2], arg2, -16384.0f, gCharacterSelections[2],
|
||||
PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN);
|
||||
}
|
||||
spawn_player(gPlayerFour, 3, arg0[3], arg1[3], arg2, 32768.0f, 3, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerFour, 3, arg0[3], arg1[3], arg2, 32768.0f, 3, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
D_80164A28 = 0;
|
||||
func_80039AE4();
|
||||
}
|
||||
@@ -781,19 +777,15 @@ void func_8003B870(f32* arg0, f32* arg1, f32 arg2) {
|
||||
spawn_player(gPlayerFour, 3, arg0[3], arg1[3], arg2, 32768.0f, gCharacterSelections[3],
|
||||
PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN);
|
||||
if (gDemoMode == 1) {
|
||||
spawn_player(gPlayerOne, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_HUMAN_AND_KART_AI);
|
||||
spawn_player(gPlayerTwo, 1, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[1],
|
||||
PLAYER_HUMAN_AND_KART_AI);
|
||||
spawn_player(gPlayerThree, 2, arg0[2], arg1[2], arg2, 32768.0f, gCharacterSelections[2],
|
||||
PLAYER_HUMAN_AND_KART_AI);
|
||||
spawn_player(gPlayerFour, 3, arg0[3], arg1[3], arg2, 32768.0f, gCharacterSelections[3],
|
||||
PLAYER_HUMAN_AND_KART_AI);
|
||||
spawn_player(gPlayerOne, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], PLAYER_HUMAN_AND_CPU);
|
||||
spawn_player(gPlayerTwo, 1, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[1], PLAYER_HUMAN_AND_CPU);
|
||||
spawn_player(gPlayerThree, 2, arg0[2], arg1[2], arg2, 32768.0f, gCharacterSelections[2], PLAYER_HUMAN_AND_CPU);
|
||||
spawn_player(gPlayerFour, 3, arg0[3], arg1[3], arg2, 32768.0f, gCharacterSelections[3], PLAYER_HUMAN_AND_CPU);
|
||||
}
|
||||
spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
D_80164A28 = 0;
|
||||
func_80039AE4();
|
||||
}
|
||||
@@ -818,27 +810,27 @@ void spawn_players_4p_battle(f32* arg0, f32* arg1, f32 arg2) {
|
||||
spawn_player(gPlayerFour, 3, arg0[3], arg1[3], arg2, 16384.0f, gCharacterSelections[3],
|
||||
PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN);
|
||||
}
|
||||
spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_KART_AI);
|
||||
spawn_player(gPlayerFive, 4, arg0[4], arg1[4], arg2, 32768.0f, 4, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerSix, 5, arg0[5], arg1[5], arg2, 32768.0f, 5, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerSeven, 6, arg0[6], arg1[6], arg2, 32768.0f, 6, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
spawn_player(gPlayerEight, 7, arg0[0], arg1[0], arg2, 32768.0f, 7, PLAYER_START_SEQUENCE | PLAYER_CPU);
|
||||
D_80164A28 = 0;
|
||||
func_80039AE4();
|
||||
}
|
||||
|
||||
void func_8003BE30(void) {
|
||||
spawn_player(gPlayerOne, 0, -2770.774f, -345.187f, -34.6f, 0.0f, gCharacterIdByGPOverallRank[0],
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerTwo, 1, -3691.506f, -6.822f, -6.95f, 36400.0f, gCharacterIdByGPOverallRank[1],
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerThree, 2, -3475.028f, -998.485f, -8.059f, 45500.0f, gCharacterIdByGPOverallRank[2],
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
if (D_802874D8.unk1D >= 3) {
|
||||
spawn_player(gPlayerFour, 3, -3025.772f, 110.039f, -23.224f, 28210.0f, D_802874D8.unk1E,
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
} else {
|
||||
spawn_player(gPlayerFour, 3, -3025.772f, 110.039f, -23.224f, 28210.0f, gCharacterIdByGPOverallRank[3],
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
}
|
||||
spawn_player(gPlayerFive, 4, -2770.774f, -345.187f, -34.6f, 0.0f, 0, 0x7000);
|
||||
spawn_player(gPlayerSix, 5, -3691.506f, -6.822f, -6.95f, 36400.0f, 0, 0x7000);
|
||||
@@ -871,10 +863,10 @@ void func_8003C0F0(void) {
|
||||
case COURSE_RAINBOW_ROAD:
|
||||
case COURSE_WARIO_STADIUM:
|
||||
case COURSE_DK_JUNGLE:
|
||||
func_8000F2DC();
|
||||
sp5E = (f32) D_80164550[0][0].posX;
|
||||
sp5C = (f32) D_80164550[0][0].posZ;
|
||||
sp5A = (f32) D_80164550[0][0].posY;
|
||||
init_course_path_point();
|
||||
sp5E = (f32) gTrackPaths[0][0].posX;
|
||||
sp5C = (f32) gTrackPaths[0][0].posZ;
|
||||
sp5A = (f32) gTrackPaths[0][0].posY;
|
||||
if (gCurrentCourseId == COURSE_TOADS_TURNPIKE) {
|
||||
sp5E = 0;
|
||||
}
|
||||
@@ -1143,25 +1135,25 @@ void func_8003C0F0(void) {
|
||||
spawn_player(gPlayerOneCopy, 0, D_80165210[0], D_80165230[0], sp5A, 32768.0f, gCharacterSelections[0],
|
||||
PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN);
|
||||
spawn_player(gPlayerTwo, 1, D_80165210[1], D_80165230[1], sp5A, 32768.0f, 1,
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerThree, 2, D_80165210[2], D_80165230[2], sp5A, 32768.0f, 2,
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerFour, 3, D_80165210[3], D_80165230[3], sp5A, 32768.0f, 3,
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerFive, 4, D_80165210[4], D_80165230[4], sp5A, 32768.0f, 4,
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerSix, 5, D_80165210[5], D_80165230[5], sp5A, 32768.0f, 5,
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerSeven, 6, D_80165210[6], D_80165230[6], sp5A, 32768.0f, 6,
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
spawn_player(gPlayerEight, 7, D_80165210[7], D_80165230[7], sp5A, 32768.0f, 7,
|
||||
PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE);
|
||||
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
|
||||
D_80164A28 = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (gModeSelection != BATTLE) {
|
||||
func_8000F628();
|
||||
init_players();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -34,7 +34,7 @@ extern s32 D_801652C0[];
|
||||
extern s32 D_801652E0[];
|
||||
extern s16 D_80165300[];
|
||||
extern u16 gCopyPathIndexByPlayerId[];
|
||||
extern s16 gCopyNearestWaypointByPlayerId[];
|
||||
extern s16 gCopyNearestPathPointByPlayerId[];
|
||||
extern s16 D_80165330[];
|
||||
extern s16 D_80165340;
|
||||
extern Player* D_801653C0[];
|
||||
@@ -50,7 +50,7 @@ extern s32 gFrameSinceLastBCombo[];
|
||||
extern s32 gCountBChangement[];
|
||||
extern bool gIsPlayerTripleBButtonCombo[];
|
||||
extern s32 gTimerBoostTripleBCombo[];
|
||||
extern s16 chooseKartAIPlayers[];
|
||||
extern s16 cpu_chooseCharacters[];
|
||||
extern s16 D_8016556E;
|
||||
extern s16 D_80165570;
|
||||
extern s16 D_80165572;
|
||||
|
||||
+2
-2
@@ -243,7 +243,7 @@ void func_8000546C(void) {
|
||||
s16 phi_v0 = 0;
|
||||
|
||||
if (D_80162DB0 >= 0x1000) {
|
||||
gPlayerOne->type = PLAYER_CINEMATIC_MODE | PLAYER_START_SEQUENCE | PLAYER_KART_AI;
|
||||
gPlayerOne->type = PLAYER_CINEMATIC_MODE | PLAYER_START_SEQUENCE | PLAYER_CPU;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -473,7 +473,7 @@ void func_8000599C(void) {
|
||||
// sets player to AI? (unconfirmed)
|
||||
void func_80005AE8(Player* ply) {
|
||||
if (((ply->type & PLAYER_INVISIBLE_OR_BOMB) != 0) && (ply != gPlayerOne)) {
|
||||
ply->type = PLAYER_CINEMATIC_MODE | PLAYER_START_SEQUENCE | PLAYER_KART_AI;
|
||||
ply->type = PLAYER_CINEMATIC_MODE | PLAYER_START_SEQUENCE | PLAYER_CPU;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+26
-26
@@ -12,9 +12,9 @@
|
||||
#include "math_util_2.h"
|
||||
#include "render_objects.h"
|
||||
#include "objects.h"
|
||||
#include "waypoints.h"
|
||||
#include "path.h"
|
||||
#include "code_800029B0.h"
|
||||
#include "code_80005FD0.h"
|
||||
#include "cpu_vehicles_camera_path.h"
|
||||
#include "code_80057C60.h"
|
||||
#include "code_8006E9C0.h"
|
||||
#include "code_80086E70.h"
|
||||
@@ -205,7 +205,7 @@ void func_80072120(s32* arg0, s32 arg1) {
|
||||
void func_80072180(void) {
|
||||
if (gModeSelection == TIME_TRIALS) {
|
||||
if (((gPlayerOne->type & PLAYER_EXISTS) != 0) &&
|
||||
((gPlayerOne->type & (PLAYER_INVISIBLE_OR_BOMB | PLAYER_KART_AI)) == 0)) {
|
||||
((gPlayerOne->type & (PLAYER_INVISIBLE_OR_BOMB | PLAYER_CPU)) == 0)) {
|
||||
D_80162DF8 = 1;
|
||||
}
|
||||
}
|
||||
@@ -2673,7 +2673,7 @@ void func_80078288(s32 objectIndex) {
|
||||
break;
|
||||
case 1:
|
||||
if (gGamestate != 9) {
|
||||
sp3A = ((gPlayerOneCopy->unk_094 / 18) * 216) / 2;
|
||||
sp3A = ((gPlayerOneCopy->speed / 18) * 216) / 2;
|
||||
sp3E = (random_int(0x000FU) - sp3A) + 0x2D;
|
||||
sp3C = random_int(0x012CU) + 0x1E;
|
||||
temp_t6 = camera1->rot[1] + ((s32) (random_int(0x3000U) - 0x1800) / (s16) ((sp3A / 15) + 1));
|
||||
@@ -3698,7 +3698,7 @@ u8 gen_random_item(s16 rank, s16 isCpu) {
|
||||
if (isCpu == 0) {
|
||||
curve = segmented_to_virtual((void*) common_grand_prix_human_item_curve);
|
||||
} else {
|
||||
curve = segmented_to_virtual((void*) common_grand_prix_kart_ai_item_curve);
|
||||
curve = segmented_to_virtual((void*) common_grand_prix_cpu_item_curve);
|
||||
}
|
||||
randomItem = *((rank * 100) + curve + sRandomItemIndex);
|
||||
}
|
||||
@@ -3710,7 +3710,7 @@ u8 gen_random_item_human(UNUSED s16 arg0, s16 rank) {
|
||||
return gen_random_item(rank, false);
|
||||
}
|
||||
|
||||
u8 kart_ai_gen_random_item(UNUSED s32 arg0, s16 rank) {
|
||||
u8 cpu_gen_random_item(UNUSED s32 arg0, s16 rank) {
|
||||
return gen_random_item(rank, true);
|
||||
}
|
||||
|
||||
@@ -4050,8 +4050,8 @@ void func_8007BD04(s32 playerId) {
|
||||
|
||||
objectIndex = indexObjectList2[0];
|
||||
if (gObjectList[objectIndex].state == 0) {
|
||||
if (((s32) gNearestWaypointByPlayerId[playerId] >= 0xA0) &&
|
||||
((s32) gNearestWaypointByPlayerId[playerId] < 0xAB)) {
|
||||
if (((s32) gNearestPathPointByPlayerId[playerId] >= 0xA0) &&
|
||||
((s32) gNearestPathPointByPlayerId[playerId] < 0xAB)) {
|
||||
set_obj_origin_pos(objectIndex, xOrientation * -1650.0, -200.0f, -1650.0f);
|
||||
init_object(objectIndex, 1);
|
||||
}
|
||||
@@ -4398,14 +4398,14 @@ void func_8007CA70(void) {
|
||||
if (D_8018CFF0 == 0) {
|
||||
playerId = func_8007C9F8();
|
||||
D_8018D018 = playerId;
|
||||
test = &gNearestWaypointByPlayerId[playerId];
|
||||
test = &gNearestPathPointByPlayerId[playerId];
|
||||
if ((*test >= 0xC9) && (*test < 0xD2)) {
|
||||
func_8007C7B4(0, (s32) playerId);
|
||||
}
|
||||
}
|
||||
if (D_8018CFF0 != 0) {
|
||||
playerId = D_8018D018;
|
||||
test = &gNearestWaypointByPlayerId[playerId];
|
||||
test = &gNearestPathPointByPlayerId[playerId];
|
||||
if ((*test >= 0xB5) && (*test < 0xBE)) {
|
||||
func_8007C91C(0);
|
||||
}
|
||||
@@ -4416,14 +4416,14 @@ void func_8007CA70(void) {
|
||||
if (D_8018D048 == 0) {
|
||||
playerId = func_8007C9F8();
|
||||
D_8018D110 = playerId;
|
||||
test = &gNearestWaypointByPlayerId[playerId];
|
||||
test = &gNearestPathPointByPlayerId[playerId];
|
||||
if ((*test >= 0x1FF) && (*test < 0x208)) {
|
||||
func_8007C7B4(5, (s32) playerId);
|
||||
}
|
||||
}
|
||||
if (D_8018D048 != 0) {
|
||||
playerId = D_8018D110;
|
||||
test = &gNearestWaypointByPlayerId[playerId];
|
||||
test = &gNearestPathPointByPlayerId[playerId];
|
||||
if ((*test >= 0x1EB) && (*test < 0x1F4)) {
|
||||
func_8007C91C(5);
|
||||
}
|
||||
@@ -5490,11 +5490,11 @@ s32 func_8007F75C(s32 playerId) {
|
||||
s32 objectIndex;
|
||||
s32 temp_s7;
|
||||
s32 var_s6;
|
||||
s32 waypoint;
|
||||
s32 pathPoint;
|
||||
|
||||
waypoint = gNearestWaypointByPlayerId[playerId];
|
||||
pathPoint = gNearestPathPointByPlayerId[playerId];
|
||||
var_s6 = 0;
|
||||
if ((waypoint >= 0xAA) && (waypoint < 0xB5)) {
|
||||
if ((pathPoint >= 0xAA) && (pathPoint < 0xB5)) {
|
||||
temp_s7 = random_int(0x0032U) + 0x32;
|
||||
for (someIndex = 0; someIndex < gNumActiveThwomps; someIndex++) {
|
||||
objectIndex = indexObjectList1[someIndex];
|
||||
@@ -5503,7 +5503,7 @@ s32 func_8007F75C(s32 playerId) {
|
||||
func_8007F660(objectIndex, playerId, temp_s7);
|
||||
}
|
||||
}
|
||||
} else if ((waypoint >= 0xD7) && (waypoint < 0xE2)) {
|
||||
} else if ((pathPoint >= 0xD7) && (pathPoint < 0xE2)) {
|
||||
for (someIndex = 0; someIndex < gNumActiveThwomps; someIndex++) {
|
||||
objectIndex = indexObjectList1[someIndex];
|
||||
if (gObjectList[objectIndex].unk_0D5 == 3) {
|
||||
@@ -5538,7 +5538,7 @@ void func_8007F8D8(void) {
|
||||
}
|
||||
if (var_s4 != 0) {
|
||||
for (var_s0 = 0; var_s0 < 4; var_s0++, player++) {
|
||||
if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_KART_AI)) {
|
||||
if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_CPU)) {
|
||||
if (func_8007F75C(var_s0) != 0) {
|
||||
break;
|
||||
}
|
||||
@@ -5591,7 +5591,7 @@ void func_8007FB48(s32 objectIndex) {
|
||||
func_80086FD4(objectIndex);
|
||||
break;
|
||||
case 2:
|
||||
gObjectList[objectIndex].velocity[0] = player->unk_094 * xOrientation * 1.25;
|
||||
gObjectList[objectIndex].velocity[0] = player->speed * xOrientation * 1.25;
|
||||
if (gObjectList[objectIndex].unk_048 >= gObjectList[objectIndex].unk_0B0) {
|
||||
if (gObjectList[objectIndex].unk_0B0 == gObjectList[objectIndex].unk_048) {
|
||||
if (D_8018D400 & 1) {
|
||||
@@ -5985,7 +5985,7 @@ void func_80080B28(s32 objectIndex, s32 playerId) {
|
||||
temp_f0 = func_80088F54(objectIndex, temp_s0);
|
||||
if ((temp_f0 <= 9.0) && !(temp_s0->effects & 0x04000000) &&
|
||||
(has_collided_horizontally_with_player(objectIndex, temp_s0) != 0)) {
|
||||
if ((temp_s0->type & 0x8000) && !(temp_s0->type & 0x100)) {
|
||||
if ((temp_s0->type & PLAYER_EXISTS) && !(temp_s0->type & 0x100)) {
|
||||
if (!(temp_s0->effects & 0x200)) {
|
||||
func_80089474(objectIndex, playerId, 1.4f, 1.1f, SOUND_ARG_LOAD(0x19, 0x00, 0xA0, 0x4C));
|
||||
} else if (func_80072354(objectIndex, 0x00000040) != 0) {
|
||||
@@ -6003,9 +6003,9 @@ void func_80080B28(s32 objectIndex, s32 playerId) {
|
||||
}
|
||||
}
|
||||
} else if ((temp_f0 <= 17.5) && (func_80072320(objectIndex, 1) != 0) &&
|
||||
(is_within_horizontal_distance_of_player(objectIndex, temp_s0, (temp_s0->unk_094 * 0.5) + 7.0) !=
|
||||
(is_within_horizontal_distance_of_player(objectIndex, temp_s0, (temp_s0->speed * 0.5) + 7.0) !=
|
||||
0)) {
|
||||
if ((temp_s0->type & 0x8000) && !(temp_s0->type & 0x100)) {
|
||||
if ((temp_s0->type & PLAYER_EXISTS) && !(temp_s0->type & 0x100)) {
|
||||
if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) {
|
||||
func_80072180();
|
||||
}
|
||||
@@ -6396,7 +6396,7 @@ void func_80081D34(s32 objectIndex) {
|
||||
for (var_s2 = 0; var_s2 < D_8018D158; var_s2++, player++, var_s4++) {
|
||||
if ((is_obj_flag_status_active(objectIndex, 0x00000200) != 0) && !(player->effects & 0x80000000) &&
|
||||
(has_collided_with_player(objectIndex, player) != 0)) {
|
||||
if ((player->type & 0x8000) && !(player->type & 0x100)) {
|
||||
if ((player->type & PLAYER_EXISTS) && !(player->type & 0x100)) {
|
||||
var_s5 = 1;
|
||||
object = &gObjectList[objectIndex];
|
||||
if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) {
|
||||
@@ -6408,8 +6408,8 @@ void func_80081D34(s32 objectIndex) {
|
||||
player->soundEffects |= 2;
|
||||
}
|
||||
object->direction_angle[1] = var_s4->rot[1];
|
||||
object->velocity[1] = (player->unk_094 / 2) + 3.0;
|
||||
object->unk_034 = player->unk_094 + 1.0;
|
||||
object->velocity[1] = (player->speed / 2) + 3.0;
|
||||
object->unk_034 = player->speed + 1.0;
|
||||
if (object->velocity[1] >= 5.0) {
|
||||
object->velocity[1] = 5.0f;
|
||||
}
|
||||
@@ -7656,7 +7656,7 @@ void update_hot_air_balloon(void) {
|
||||
}
|
||||
|
||||
void func_80085878(s32 objectIndex, s32 arg1) {
|
||||
TrackWaypoint* temp_v0;
|
||||
TrackPathPoint* temp_v0;
|
||||
Object* object;
|
||||
|
||||
object = &gObjectList[objectIndex];
|
||||
@@ -7668,7 +7668,7 @@ void func_80085878(s32 objectIndex, s32 arg1) {
|
||||
set_object_flag_status_true(objectIndex, 0x04000200);
|
||||
object->unk_084[8] = (arg1 * 0x12C) + 0x1F4;
|
||||
set_obj_origin_pos(objectIndex, 0.0f, -15.0f, 0.0f);
|
||||
temp_v0 = &D_80164490[(u16) object->unk_084[8]];
|
||||
temp_v0 = &gCurrentTrackPath[(u16) object->unk_084[8]];
|
||||
set_obj_origin_offset(objectIndex, temp_v0->posX, temp_v0->posY, temp_v0->posZ);
|
||||
set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
|
||||
object->unk_034 = 4.0f;
|
||||
|
||||
@@ -204,7 +204,7 @@ void func_8007ABFC(s32, bool);
|
||||
void consume_item(s32);
|
||||
u8 gen_random_item(s16, s16);
|
||||
u8 gen_random_item_human(s16, s16);
|
||||
u8 kart_ai_gen_random_item(s32, s16);
|
||||
u8 cpu_gen_random_item(s32, s16);
|
||||
s16 func_8007AFB0(s32, s32);
|
||||
s32 func_8007B040(s32, s32);
|
||||
void func_8007B254(s32, s32);
|
||||
|
||||
Reference in New Issue
Block a user