diff options
| author | coco875 <59367621+coco875@users.noreply.github.com> | 2024-04-06 19:35:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-06 11:35:13 -0600 |
| commit | 2b66867af1975759dc7acfb3bbc2c9063ffa4353 (patch) | |
| tree | bf8da88f60fc335b9b0529e6ade2f1676e3da610 /src | |
| parent | c4d596d297182d81488c7d09769666de450140bb (diff) | |
Rename cpu behaviour related symbols (#586)
* Rename cpu related symbols
Diffstat (limited to 'src')
| -rw-r--r-- | src/actors/kiwano_fruit/update.inc.c | 2 | ||||
| -rw-r--r-- | src/code_80005FD0.c | 226 | ||||
| -rw-r--r-- | src/code_80005FD0.h | 43 | ||||
| -rw-r--r-- | src/code_80086E70.c | 6 | ||||
| -rw-r--r-- | src/common_textures.h | 59 | ||||
| -rw-r--r-- | src/data/common_textures.c | 420 | ||||
| -rw-r--r-- | src/data/path_spawn_data.c | 34 | ||||
| -rw-r--r-- | src/data/path_spawn_data.h | 6 | ||||
| -rw-r--r-- | src/effects.c | 10 | ||||
| -rw-r--r-- | src/main.h | 4 | ||||
| -rw-r--r-- | src/player_controller.c | 210 | ||||
| -rw-r--r-- | src/player_controller.h | 154 | ||||
| -rw-r--r-- | src/racing/actors.c | 4 | ||||
| -rw-r--r-- | src/racing/race_logic.c | 10 | ||||
| -rw-r--r-- | src/render_objects.c | 4 | ||||
| -rw-r--r-- | src/spawn_players.c | 186 | ||||
| -rw-r--r-- | src/spawn_players.h | 2 | ||||
| -rw-r--r-- | src/staff_ghosts.c | 4 | ||||
| -rw-r--r-- | src/update_objects.c | 8 | ||||
| -rw-r--r-- | src/update_objects.h | 2 |
20 files changed, 720 insertions, 674 deletions
diff --git a/src/actors/kiwano_fruit/update.inc.c b/src/actors/kiwano_fruit/update.inc.c index 41c94607e..dd1ba9b31 100644 --- a/src/actors/kiwano_fruit/update.inc.c +++ b/src/actors/kiwano_fruit/update.inc.c @@ -18,7 +18,7 @@ void update_actor_kiwano_fruit(struct KiwanoFruit *fruit) { s32 nearestWaypoint; player = &gPlayers[fruit->targetPlayer]; - if (((player->type & PLAYER_CPU) != 0) || (player->unk_110.unk34 == 0)) { + if (((player->type & PLAYER_KART_AI) != 0) || (player->unk_110.unk34 == 0)) { fruit->state = 0; return; } diff --git a/src/code_80005FD0.c b/src/code_80005FD0.c index 87e87345c..49449daeb 100644 --- a/src/code_80005FD0.c +++ b/src/code_80005FD0.c @@ -36,7 +36,7 @@ Collision D_80162E70; s16 D_80162EB0; // Possibly a float. s16 D_80162EB2; // possibly [3] -UnkCommonTextureStruct0 *D_80162EB8[20]; +KartAIBehaviour *gCoursesKartAIBehaviour[NUM_COURSES-1]; // more padding? s32 D_80162F08[2]; @@ -91,17 +91,17 @@ u16 D_80163240[12]; u16 D_80163258[12]; u16 D_80163270[12]; s32 D_80163288[10]; -UnkCommonTextureStruct0 *D_801632B0; -u16 D_801632B8[12]; -u16 D_801632D0[12]; -u16 D_801632E8[12]; +KartAIBehaviour *sCurrentKartAIBehaviour; +u16 gCurrentKartAIBehaviourId[12]; +u16 gPreviousKartAIBehaviourId[12]; +u16 gKartAIBehaviourState[12]; s16 D_80163300[12]; u16 D_80163318[12]; u16 D_80163330[10]; u16 D_80163344[2]; u16 D_80163348[2]; u16 D_8016334C[2]; -u16 D_80163350[12]; +u16 gSpeedKartAIBehaviour[12]; s32 D_80163368[4]; s32 D_80163378; s32 D_8016337C; @@ -1111,22 +1111,22 @@ void func_80008424(s32 playerId, f32 arg1, Player *player) { } } else { var_a1 = 1; - switch (D_80163350[playerId]) { /* switch 1; irregular */ - case 1: /* switch 1 */ + switch (gSpeedKartAIBehaviour[playerId]) { /* switch 1; irregular */ + case SPEED_KART_AI_BEHAVIOUR_FAST: /* switch 1 */ player->effects &= ~0x00200000; player_speed(player); break; - case 3: /* switch 1 */ + case SPEED_KART_AI_BEHAVIOUR_MAX: /* switch 1 */ player->effects |= 0x200000; player_speed(player); break; - case 2: /* switch 1 */ + case SPEED_KART_AI_BEHAVIOUR_SLOW: /* switch 1 */ if (((var_f2 / 18.0f) * 216.0f) > 20.0f) { arg1 = 1.6666666f; } var_a1 = 0; break; - case 0: /* switch 1 */ + case SPEED_KART_AI_BEHAVIOUR_NORMAL: /* switch 1 */ default: /* switch 1 */ var_a1 = 0; break; @@ -1521,7 +1521,7 @@ void func_8000929C(s32 playerId, Player *player) { } D_80163240[playerId] = 1; func_80008F38(playerId); - func_80011AE4(playerId); + reset_kart_ai_behaviour(playerId); D_801642D8[playerId].unk_06 = 0; if ((D_8016348C == 0) && !(player->type & 0x800)) { gTimePlayerLastTouchedFinishLine[playerId] = func_80009258(playerId, someTemp0, tempPos2); @@ -1683,7 +1683,7 @@ void func_80009B60(s32 playerId) { f32 athing = 1.5f; player = &gPlayers[playerId]; - if ((s32) D_800DCA4C[gCurrentCourseId] >= 0) { + if ((s32) gKartAICourseMaximumWaypointSeparation[gCurrentCourseId] >= 0) { D_80163100[playerId] += 1; if (playerId == 0) { D_80163378++; @@ -1736,15 +1736,15 @@ void func_80009B60(s32 playerId) { player->unk_044 &= ~0x0001; } func_8000929C(playerId, player); - if ((gCurrentCourseId != 0x0014) && ((D_80163240[playerId] == 1) || (playerId == 0))) { + if ((gCurrentCourseId != COURSE_AWARD_CEREMONY) && ((D_80163240[playerId] == 1) || (playerId == 0))) { set_places(); } if (player->type & 0x1000) { - if ((D_801630E2 == 1) && (gCurrentCourseId != 0x0014)) { - func_80011E38(playerId); + if ((D_801630E2 == 1) && (gCurrentCourseId != COURSE_AWARD_CEREMONY)) { + kart_ai_behaviour(playerId); } if ((playerId & 1) != (D_80163378 & 1)) { - cpu_use_item_strategy(playerId); + kart_ai_use_item_strategy(playerId); } func_800099EC(playerId, player); D_80162FD0 = 0; @@ -1974,7 +1974,7 @@ void func_80009B60(s32 playerId) { } break; } - if ((D_801632E8[playerId] == 2) && ((D_80163068[playerId] > 0.9f) || (D_80163068[playerId] < -0.9f))) { + if ((gKartAIBehaviourState[playerId] == KART_AI_BEHAVIOUR_STATE_RUNNING) && ((D_80163068[playerId] > 0.9f) || (D_80163068[playerId] < -0.9f))) { D_801630E8[playerId] = 0; player->effects &= ~0x10; } @@ -2194,7 +2194,7 @@ f32 func_8000B874(f32 posX, f32 posZ, u16 waypointIndex, s32 pathIndex) { void func_8000B95C(s32 playerId, u16 waypointIndex, s32 pathIndex) { UNUSED Vec3f pad; D_80163068[playerId] = 0.0f; - if ((s32) D_800DCA4C[gCurrentCourseId] >= 0) { + if ((s32) gKartAICourseMaximumWaypointSeparation[gCurrentCourseId] >= 0) { if ((gPlayers[playerId].type & 0x8000) != 0) { D_80163068[playerId] = func_8000B874(gPlayers[playerId].pos[0], gPlayers[playerId].pos[2], waypointIndex, pathIndex); } @@ -3553,12 +3553,12 @@ void func_8000F628(void) { D_80163068[i] = 0.0f; D_80163090[i] = 0.0f; var_s5 = &D_801634F8[i]; - var_s5->unkC = D_800DCAA0[gCurrentCourseId] * (f32) (((i + 1) % 3) - 1); + var_s5->unkC = gKartAICourseMinimumWaypointSeparation[gCurrentCourseId] * (f32) (((i + 1) % 3) - 1); var_s5->unk4 = var_s5->unkC; var_s5->unk0 = 0.0f; var_s5->unk8 = 0.015f; - func_80011AB8(i); - D_80163350[i] = 0; + reset_kart_ai_behaviour_none(i); + gSpeedKartAIBehaviour[i] = 0; D_801644F8[i] = 0; D_80163398[i] = 0; D_801633B0[i] = 0; @@ -3658,7 +3658,7 @@ void func_8000F628(void) { } } } - func_80011A5C(); + copy_courses_kart_ai_behaviour(); } // @arg index from 0 to 3. @@ -3678,7 +3678,7 @@ void func_800100F0(s32 pathIndex) { s32 i; // cast required - if ((s32)D_800DCA4C[gCurrentCourseId] >= 0) { + if ((s32)gKartAICourseMaximumWaypointSeparation[gCurrentCourseId] >= 0) { pathDest = D_80164550[pathIndex]; bInvalidPath = 1; if (gCurrentCourseId != COURSE_AWARD_CEREMONY) { @@ -3729,8 +3729,8 @@ void func_80010218(s32 pathIndex) { TrackWaypoint *var_s1; TrackWaypoint *var_s2; - if (((s32) D_800DCA4C[gCurrentCourseId]) >= 0) { - waypointWidth = D_800DCA4C[gCurrentCourseId]; + if (((s32) gKartAICourseMaximumWaypointSeparation[gCurrentCourseId]) >= 0) { + waypointWidth = gKartAICourseMaximumWaypointSeparation[gCurrentCourseId]; waypoint = &D_80164550[pathIndex][0]; var_s1 = &D_80164560[pathIndex][0]; var_s2 = &D_80164570[pathIndex][0]; @@ -3779,7 +3779,7 @@ f32 func_80010480(s32 pathIndex, u16 waypointIndex) { f32 root2; f32 root1; - if ((s32) D_800DCA4C[gCurrentCourseId] < 0) { + if ((s32) gKartAICourseMaximumWaypointSeparation[gCurrentCourseId] < 0) { return 0.0f; } waypointCount = gWaypointCountByPathIndex[pathIndex]; @@ -3821,7 +3821,7 @@ void func_800107C4(s32 pathIndex) { s32 var_a3; s16 *wut; - if ((s32) D_800DCA4C[gCurrentCourseId] >= 0) { + if ((s32) gKartAICourseMaximumWaypointSeparation[gCurrentCourseId] >= 0) { var_a3 = gWaypointCountByPathIndex[pathIndex]; var_t4 = &D_80164580[pathIndex][0]; for(var_s0 = 0; var_s0 < var_a3; var_s0++, var_t4++) { @@ -3889,7 +3889,7 @@ void func_80010DBC(s32 pathIndex) { s32 waypointIndex; u16 *angle; - if ((s32) D_800DCA4C[gCurrentCourseId] >= 0) { + if ((s32) gKartAICourseMaximumWaypointSeparation[gCurrentCourseId] >= 0) { for (angle = &D_80164590[pathIndex][0], waypointIndex = 0; waypointIndex < gWaypointCountByPathIndex[pathIndex]; waypointIndex++, angle++) { *angle = func_80010CB0(pathIndex, waypointIndex); } @@ -4166,121 +4166,121 @@ s32 func_8001168C(PathNoY *pathDest, TrackWaypoint *pathSrc, s32 numWaypoints) { return count; } -void func_80011A5C(void) { +void copy_courses_kart_ai_behaviour(void) { s32 i; - for (i = 0; i < 20; i++) { - D_80162EB8[i] = segmented_to_virtual_dupe_2(D_800DC720[i]); + for (i = 0; i < NUM_COURSES-1; i++) { + gCoursesKartAIBehaviour[i] = segmented_to_virtual_dupe_2(gKartAIBehaviourLUT[i]); } } -void func_80011AB8(s32 index) { - D_801632B8[index] = 0; - D_801632D0[index] = 0; - D_801632E8[index] = 0; +void reset_kart_ai_behaviour_none(s32 playerIndex) { + gCurrentKartAIBehaviourId[playerIndex] = 0; + gPreviousKartAIBehaviourId[playerIndex] = 0; + gKartAIBehaviourState[playerIndex] = KART_AI_BEHAVIOUR_STATE_NONE; } -void func_80011AE4(s32 index) { - D_801632B8[index] = 0; - D_801632D0[index] = 0; - D_801632E8[index] = 1; +void reset_kart_ai_behaviour(s32 playerIndex) { + gCurrentKartAIBehaviourId[playerIndex] = 0; + gPreviousKartAIBehaviourId[playerIndex] = 0; + gKartAIBehaviourState[playerIndex] = KART_AI_BEHAVIOUR_STATE_START; } -void func_80011B14(s32 playerId, Player *player) { - u16 sp2E; - s16 temp_t1; - s16 temp_t2; - s32 temp_t3; +void kart_ai_behaviour_start(s32 playerId, Player *player) { + u16 playerWaypoint; + s16 waypointStart; + s16 waypointEnd; + s32 behaviourType; s32 test; - D_801632B0 = D_80162EB8[gCurrentCourseId] + D_801632B8[playerId]; + sCurrentKartAIBehaviour = &gCoursesKartAIBehaviour[gCurrentCourseId][gCurrentKartAIBehaviourId[playerId]]; - sp2E = gNearestWaypointByPlayerId[playerId]; + playerWaypoint = gNearestWaypointByPlayerId[playerId]; - temp_t1 = D_801632B0->waypointId1; - temp_t2 = D_801632B0->waypointId2; - temp_t3 = D_801632B0->unk4; + waypointStart = sCurrentKartAIBehaviour->waypointStart; + waypointEnd = sCurrentKartAIBehaviour->waypointEnd; + behaviourType = sCurrentKartAIBehaviour->type; - if ((temp_t1 == -1) && (temp_t2 == -1)) { - D_801632B0 = D_80162EB8[gCurrentCourseId]; - func_80011AB8(playerId); + if ((waypointStart == -1) && (waypointEnd == -1)) { + sCurrentKartAIBehaviour = &gCoursesKartAIBehaviour[gCurrentCourseId][0]; + reset_kart_ai_behaviour_none(playerId); return; } - if ((u32)sp2E == temp_t1) { - D_801632E8[playerId] = 2; - D_801632D0[playerId] = D_801632B8[playerId]; - D_801632B8[playerId] += 1; - switch (temp_t3) { - case 1: - func_80011EC0(playerId, player, player->unk_07C >> 0x10, sp2E); + if ((u32)playerWaypoint == waypointStart) { + gKartAIBehaviourState[playerId] = KART_AI_BEHAVIOUR_STATE_RUNNING; + gPreviousKartAIBehaviourId[playerId] = gCurrentKartAIBehaviourId[playerId]; + gCurrentKartAIBehaviourId[playerId]++; + switch (behaviourType) { + case BEHAVIOUR_1: + func_80011EC0(playerId, player, player->unk_07C >> 0x10, playerWaypoint); break; - case 2: - func_8002AA50(player); + case BEHAVIOUR_HOP: + kart_hop(player); player->effects &= ~0x10; D_801630E8[playerId] = 0; break; - case 3: + case BEHAVIOUR_3: D_801634F8[playerId].unk4 = 0.0f; break; - case 4: + case BEHAVIOUR_4: D_801634F8[playerId].unk4 = -0.6f; break; - case 5: + case BEHAVIOUR_5: D_801634F8[playerId].unk4 = 0.6f; break; - case 6: - D_80163350[playerId] = 0; + case BEHAVIOUR_NORMAL_SPEED: + gSpeedKartAIBehaviour[playerId] = SPEED_KART_AI_BEHAVIOUR_NORMAL; break; - case 7: - D_80163350[playerId] = 1; + case BEHAVIOUR_FAST_SPEED: + gSpeedKartAIBehaviour[playerId] = SPEED_KART_AI_BEHAVIOUR_FAST; break; - case 8: - D_80163350[playerId] = 2; + case BEHAVIOUR_SLOW_SPEED: + gSpeedKartAIBehaviour[playerId] = SPEED_KART_AI_BEHAVIOUR_SLOW; break; - case 11: - D_80163350[playerId] = 3; + case BEHAVIOUR_MAX_SPEED: + gSpeedKartAIBehaviour[playerId] = SPEED_KART_AI_BEHAVIOUR_MAX; break; - case 9: + case BEHAVIOUR_9: D_801633F8[playerId] = 1; D_801631E0[playerId] = 0; gPlayers[playerId].effects &= ~0x1000; break; - case 10: + case BEHAVIOUR_10: D_801633F8[playerId] = 0; break; } } } -void func_80011D48(s32 playerIndex, Player *player) { +void kart_ai_behaviour_end(s32 playerIndex, Player *player) { u16 nearestWaypoint; - u32 thing; - s32 temp_a2; + u32 waypointEnd; + s32 behaviourType; - D_801632B0 = &D_80162EB8[gCurrentCourseId][D_801632D0[playerIndex]]; + sCurrentKartAIBehaviour = &gCoursesKartAIBehaviour[gCurrentCourseId][gPreviousKartAIBehaviourId[playerIndex]]; nearestWaypoint = gNearestWaypointByPlayerId[playerIndex]; - temp_a2 = D_801632B0->unk4; - thing = D_801632B0->waypointId2; - if (nearestWaypoint >= thing) { - switch (temp_a2) { - case 1: + behaviourType = sCurrentKartAIBehaviour->type; + waypointEnd = sCurrentKartAIBehaviour->waypointEnd; + if (nearestWaypoint >= waypointEnd) { + switch (behaviourType) { + case BEHAVIOUR_1: player->effects &= ~0x10; D_801630E8[playerIndex] = 0; - D_801632E8[playerIndex] = 1; + gKartAIBehaviourState[playerIndex] = KART_AI_BEHAVIOUR_STATE_START; break; - case 3: - case 4: - case 5: + case BEHAVIOUR_3: + case BEHAVIOUR_4: + case BEHAVIOUR_5: D_801634F8[playerIndex].unk4 = D_801634F8[playerIndex].unkC; - D_801632E8[playerIndex] = 1; + gKartAIBehaviourState[playerIndex] = KART_AI_BEHAVIOUR_STATE_START; break; - case 2: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - D_801632E8[playerIndex] = 1; + 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: + gKartAIBehaviourState[playerIndex] = KART_AI_BEHAVIOUR_STATE_START; break; default: break; @@ -4288,17 +4288,17 @@ void func_80011D48(s32 playerIndex, Player *player) { } } -void func_80011E38(s32 playerIndex) { +void kart_ai_behaviour(s32 playerIndex) { Player *player = gPlayerOne + playerIndex; - switch(D_801632E8[playerIndex]) { - case 0: + switch(gKartAIBehaviourState[playerIndex]) { + case KART_AI_BEHAVIOUR_STATE_NONE: break; - case 1: - func_80011B14(playerIndex, player); + case KART_AI_BEHAVIOUR_STATE_START: + kart_ai_behaviour_start(playerIndex, player); break; - case 2: - func_80011D48(playerIndex, player); + case KART_AI_BEHAVIOUR_STATE_RUNNING: + kart_ai_behaviour_end(playerIndex, player); break; } } @@ -4310,7 +4310,7 @@ void func_80011EC0(s32 arg0, Player *player, s32 arg2, u16 arg3) { case 2: if ((arg2 >= -9) && (D_80162FF8[arg0] == 0)) { if ((D_80163068[arg0] > -0.8) && (D_80163068[arg0] < 0.5)) { - func_8002AA50(player); + kart_hop(player); player->effects |= 0x10; D_801630E8[arg0] = 1; break; @@ -4322,7 +4322,7 @@ void func_80011EC0(s32 arg0, Player *player, s32 arg2, u16 arg3) { case 3: if ((arg2 < 0xA) && (D_80162FF8[arg0] == 0)) { if ((D_80163068[arg0] > -0.5) && (D_80163068[arg0] < 0.8)) { - func_8002AA50(player); + kart_hop(player); player->effects |= 0x10; D_801630E8[arg0] = -1; break; @@ -5074,7 +5074,7 @@ void func_80013F7C(s32 playerId, Player *player, VehicleStuff *vehicle, f32 arg3 f32 spBC; if (((D_801631E0[playerId] != 1) || (( - ((player->type & PLAYER_HUMAN) != 0)) && !(player->type & PLAYER_CPU))) && !(player->effects & 0x01000000)) { + ((player->type & PLAYER_HUMAN) != 0)) && !(player->type & PLAYER_KART_AI))) && !(player->effects & 0x01000000)) { spC4 = player->pos[0]; spC0 = player->pos[1]; @@ -5095,7 +5095,7 @@ void func_80013F7C(s32 playerId, Player *player, VehicleStuff *vehicle, f32 arg3 } } } - if ((player->type & PLAYER_HUMAN) && !(player->type & PLAYER_CPU)) { + if ((player->type & PLAYER_HUMAN) && !(player->type & PLAYER_KART_AI)) { if (((temp_f12) > -300.0) && ((temp_f12) < 300.0) && ( (temp_f22 > -20.0)) && (temp_f22 < 20.0) && (((temp_f14) > -300.0)) && ((temp_f14) < 300.0)) { if ((D_801631C8 > 0) && (vehicle->someFlags == 0)) { @@ -6999,7 +6999,7 @@ void func_8001AB00(void) { } } -void cpu_decisions_branch_item(s32 arg0, s16 *arg1, s32 arg2) { +void kart_ai_decisions_branch_item(s32 arg0, s16 *arg1, s32 arg2) { s32 value = -1; switch (arg2) { case ITEM_FAKE_ITEM_BOX: @@ -7044,11 +7044,11 @@ void func_8001ABEC(struct struct_801642D8 *arg0) { } #ifdef NON_MATCHING -// By the looks of this function is probably something like `cpu_player_use_item` +// By the looks of this function is probably something like `kart_ai_use_item_strategy` // The use of several different actor types might make getting a match hard(er), // might have to get creative/ugly with just a single generic `Actor` variable. // https://decomp.me/scratch/FOlbG -void cpu_use_item_strategy(s32 playerId) { +void kart_ai_use_item_strategy(s32 playerId) { s32 var_v0; Player *player; TrackWaypoint *waypoint; @@ -7066,7 +7066,7 @@ void cpu_use_item_strategy(s32 playerId) { case 0: temp_s0->actorIndex = -1; if ((((playerId * 0x14) + 0x64) < D_80164450[playerId]) && (temp_s0->unk_04 >= 0x259) && (temp_s0->unk_06 < 3) && (gLapCountByPlayerId[playerId] < 3)) { - cpu_decisions_branch_item(playerId, &temp_s0->unk_00, gen_random_item_cpu((s16)gLapCountByPlayerId[playerId], gGPCurrentRaceRankByPlayerId[playerId])); + kart_ai_decisions_branch_item(playerId, &temp_s0->unk_00, kart_ai_gen_random_item((s16)gLapCountByPlayerId[playerId], gGPCurrentRaceRankByPlayerId[playerId])); } else { func_8001ABE0(playerId, temp_s0); } @@ -7497,7 +7497,7 @@ void cpu_use_item_strategy(s32 playerId) { } } #else -GLOBAL_ASM("asm/non_matchings/code_80005FD0/cpu_use_item_strategy.s") +GLOBAL_ASM("asm/non_matchings/code_80005FD0/kart_ai_use_item_strategy.s") #endif void func_8001BE78(void) { diff --git a/src/code_80005FD0.h b/src/code_80005FD0.h index ffa7d4f23..28adaa219 100644 --- a/src/code_80005FD0.h +++ b/src/code_80005FD0.h @@ -144,12 +144,12 @@ f32 func_80010FA0(f32, f32, f32, s32, s32); s32 func_80011014(TrackWaypoint *, TrackWaypoint *, s32, s32); s32 process_path_data(TrackWaypoint*, TrackWaypoint*); s32 func_8001168C(PathNoY*, TrackWaypoint*, s32); -void func_80011A5C(void); -void func_80011AB8(s32); -void func_80011AE4(s32); -void func_80011B14(s32, Player*); -void func_80011D48(s32, Player*); -void func_80011E38(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 func_800120C8(void); @@ -241,10 +241,10 @@ 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 kart_ai_decisions_branch_item(s32, s16*, s32); void func_8001ABE0(s32, D_801642D8_entry*); void func_8001ABEC(struct struct_801642D8*); -void cpu_use_item_strategy(s32); +void kart_ai_use_item_strategy(s32); void func_8001BE78(void); @@ -258,7 +258,7 @@ void func_8001C42C(void); extern Collision D_80162E70; extern s16 D_80162EB0; // Possibly a float. extern s16 D_80162EB2; // possibly [3] -extern UnkCommonTextureStruct0 *D_80162EB8[]; +extern KartAIBehaviour *gCoursesKartAIBehaviour[]; extern s16 D_80162F10[]; extern s16 D_80162F50[]; extern Vec3f D_80162FA0; @@ -298,17 +298,32 @@ extern u16 D_80163258[]; extern u16 D_80163270[]; extern s32 D_80163288[]; // Exact pointer type unknown -extern UnkCommonTextureStruct0 *D_801632B0; -extern u16 D_801632B8[]; -extern u16 D_801632D0[]; -extern u16 D_801632E8[]; +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 D_80163350[]; +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; diff --git a/src/code_80086E70.c b/src/code_80086E70.c index 869fd78d1..af7e2339d 100644 --- a/src/code_80086E70.c +++ b/src/code_80086E70.c @@ -1041,7 +1041,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_CPU) != PLAYER_CPU)) { + if ((func_8008933C(player, objectIndex, arg2, arg3) >= 4.0) && ((player->type & PLAYER_KART_AI) != PLAYER_KART_AI)) { func_800C9060(playerId, soundBits); } } @@ -1051,7 +1051,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_CPU) != PLAYER_CPU)) { + if ((func_8008933C(player, objectIndex, arg2, arg3) >= 4.0) && ((player->type & PLAYER_KART_AI) != PLAYER_KART_AI)) { func_800C9060((u8) playerId, soundBits); } } @@ -1109,7 +1109,7 @@ void func_80089820(s32 objectIndex, f32 arg1, f32 arg2, u32 arg3) { if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) { func_80072180(); } - if ((func_8008933C(player, objectIndex, arg1, arg2 * 1.1) >= 4.0) && ((player->type & PLAYER_CPU) != PLAYER_CPU)) { + if ((func_8008933C(player, objectIndex, arg1, arg2 * 1.1) >= 4.0) && ((player->type & PLAYER_KART_AI) != PLAYER_KART_AI)) { func_800C9060(var_s1, arg3); } } diff --git a/src/common_textures.h b/src/common_textures.h index 469d6f01f..b21cc2dd9 100644 --- a/src/common_textures.h +++ b/src/common_textures.h @@ -5,10 +5,25 @@ #include <PR/gbi.h> typedef struct { - /* 0x0 */ s16 waypointId1; - /* 0x2 */ s16 waypointId2; - /* 0x4 */ s32 unk4; -} UnkCommonTextureStruct0; // size = 0x8 + /* 0x0 */ s16 waypointStart; + /* 0x2 */ s16 waypointEnd; + /* 0x4 */ s32 type; +} KartAIBehaviour; // size = 0x8 + +enum { + BEHAVIOUR_NONE = 0, + BEHAVIOUR_1, + BEHAVIOUR_HOP, + BEHAVIOUR_3, + BEHAVIOUR_4, + BEHAVIOUR_5, + BEHAVIOUR_NORMAL_SPEED, + BEHAVIOUR_FAST_SPEED, + BEHAVIOUR_SLOW_SPEED, + BEHAVIOUR_9, + BEHAVIOUR_10, + BEHAVIOUR_MAX_SPEED +}; /** @cond */ @@ -210,7 +225,7 @@ extern Gfx D_0D008108[]; extern Gfx D_0D008120[]; extern Gfx D_0D008138[]; extern u8 common_grand_prix_human_item_curve[][100]; -extern u8 common_grand_prix_cpu_item_curve[][100]; +extern u8 common_grand_prix_kart_ai_item_curve[][100]; extern u8 common_versus_2_player_item_curve[][100]; extern u8 common_versus_3_player_item_curve[][100]; extern u8 common_versus_4_player_item_curve[][100]; @@ -232,23 +247,23 @@ extern Gfx D_0D008E48[]; extern Gfx D_0D008E70[]; extern Mtx D_0D008E98; extern Vtx D_0D008ED8[]; -extern UnkCommonTextureStruct0 D_0D008F18[]; -extern UnkCommonTextureStruct0 D_0D008F28[]; -extern UnkCommonTextureStruct0 D_0D008F80[]; -extern UnkCommonTextureStruct0 D_0D008FB8[]; -extern UnkCommonTextureStruct0 D_0D009058[]; -extern UnkCommonTextureStruct0 D_0D0090B8[]; -extern UnkCommonTextureStruct0 D_0D0090F8[]; -extern UnkCommonTextureStruct0 D_0D009158[]; -extern UnkCommonTextureStruct0 D_0D009188[]; -extern UnkCommonTextureStruct0 D_0D0091E8[]; -extern UnkCommonTextureStruct0 D_0D009210[]; -extern UnkCommonTextureStruct0 D_0D009238[]; -extern UnkCommonTextureStruct0 D_0D009260[]; -extern UnkCommonTextureStruct0 D_0D009280[]; -extern UnkCommonTextureStruct0 D_0D0092C8[]; -extern UnkCommonTextureStruct0 D_0D009310[]; -extern UnkCommonTextureStruct0 D_0D0093C0[]; +extern KartAIBehaviour common_kart_ai_behaviour_battle_courses[]; +extern KartAIBehaviour common_kart_ai_behaviour_mario_raceway[]; +extern KartAIBehaviour common_kart_ai_behaviour_choco_mountain[]; +extern KartAIBehaviour common_kart_ai_behaviour_bowser_castle[]; +extern KartAIBehaviour common_kart_ai_behaviour_banshee_boardwalk[]; +extern KartAIBehaviour common_kart_ai_behaviour_yoshi_valley[]; +extern KartAIBehaviour common_kart_ai_behaviour_frappe_snowland[]; +extern KartAIBehaviour common_kart_ai_behaviour_koopa_beach[]; +extern KartAIBehaviour common_kart_ai_behaviour_royal_raceway[]; +extern KartAIBehaviour common_kart_ai_behaviour_luigi_raceway[]; +extern KartAIBehaviour common_kart_ai_behaviour_moo_moo_farm[]; +extern KartAIBehaviour common_kart_ai_behaviour_toad_turnpike[]; +extern KartAIBehaviour common_kart_ai_behaviour_kalamari_desert[]; +extern KartAIBehaviour common_kart_ai_behaviour_sherbet_land[]; +extern KartAIBehaviour common_kart_ai_behaviour_rainbow_road[]; +extern KartAIBehaviour common_kart_ai_behaviour_wario_stadium[]; +extern KartAIBehaviour common_kart_ai_behaviour_dk_jungle[]; extern f32 D_0D009418[][4]; extern f32 D_0D009568[][4]; extern f32 D_0D0096B8[][4]; diff --git a/src/data/common_textures.c b/src/data/common_textures.c index b67c00d4a..c4a9fe5a1 100644 --- a/src/data/common_textures.c +++ b/src/data/common_textures.c @@ -1881,7 +1881,7 @@ u8 common_grand_prix_human_item_curve[8][100] = { }, }; -u8 common_grand_prix_cpu_item_curve[8][100] = { +u8 common_grand_prix_kart_ai_item_curve[8][100] = { { ITEM_BANANA, ITEM_BANANA, ITEM_BANANA, ITEM_BANANA, ITEM_BANANA, ITEM_BANANA, ITEM_BANANA, ITEM_BANANA, ITEM_BANANA, ITEM_BANANA, ITEM_BANANA, ITEM_BANANA, ITEM_BANANA, ITEM_BANANA, ITEM_BANANA, ITEM_BANANA, ITEM_BANANA, ITEM_BANANA, ITEM_BANANA, ITEM_BANANA, @@ -2257,215 +2257,215 @@ Vtx D_0D008ED8[] = { {{{ -1, 3, -1}, 3, {65535, 3}, {0x00, 0x01, 0x00, 0x00}}}, }; -UnkCommonTextureStruct0 D_0D008F18[] = { - { 1, 3, 2, }, - { -1, -1, 0, }, -}; - -UnkCommonTextureStruct0 D_0D008F28[] = { - { 1, 2, 6, }, - { 11, 30, 1, }, - { 55, 74, 1, }, - { 90, 105, 1, }, - { 139, 155, 1, }, - { 177, 205, 1, }, - { 225, 242, 1, }, - { 292, 313, 1, }, - { 352, 373, 1, }, - { 452, 465, 1, }, - { -1, -1, 0, }, -}; - -UnkCommonTextureStruct0 D_0D008F80[] = { - { 1, 2, 6, }, - { 10, 25, 1, }, - { 190, 210, 1, }, - { 270, 290, 1, }, - { 410, 440, 1, }, - { 540, 550, 1, }, - { -1, -1, 0, }, -}; - -UnkCommonTextureStruct0 D_0D008FB8[] = { - { 1, 2, 6, }, - { 60, 80, 1, }, - { 125, 140, 1, }, - { 170, 185, 1, }, - { 230, 240, 1, }, - { 275, 285, 1, }, - { 310, 320, 1, }, - { 321, 349, 3, }, - { 350, 360, 1, }, - { 385, 415, 1, }, - { 450, 468, 1, }, - { 470, 477, 9, }, - { 480, 485, 11, }, - { 543, 546, 9, }, - { 548, 550, 11, }, - { 565, 568, 2, }, - { 630, 631, 6, }, - { 635, 640, 10, }, - { 645, 655, 1, }, - { -1, -1, 0, }, -}; - -UnkCommonTextureStruct0 D_0D009058[] = { - { 1, 2, 6, }, - { 15, 30, 1, }, - { 55, 65, 1, }, - { 125, 150, 1, }, - { 265, 270, 1, }, - { 275, 285, 1, }, - { 305, 320, 2, }, - { 330, 340, 1, }, - { 375, 385, 1, }, - { 547, 570, 1, }, - { 582, 600, 1, }, - { -1, -1, 0, }, -}; - -UnkCommonTextureStruct0 D_0D0090B8[] = { - { 1, 2, 6, }, - { 70, 94, 1, }, - { 120, 133, 1, }, - { 150, 170, 1, }, - { 249, 265, 1, }, - { 360, 395, 1, }, - { 635, 655, 1, }, - { -1, -1, 0, }, -}; - -UnkCommonTextureStruct0 D_0D0090F8[] = { - { 1, 2, 6, }, - { 15, 30, 1, }, - { 41, 63, 1, }, - { 115, 155, 1, }, - { 200, 215, 1, }, - { 240, 241, 9, }, - { 264, 265, 10, }, - { 270, 290, 1, }, - { 345, 375, 1, }, - { 493, 544, 1, }, - { 583, 605, 1, }, - { -1, -1, 0, }, -}; - -UnkCommonTextureStruct0 D_0D009158[] = { - { 1, 2, 6, }, - { 75, 100, 1, }, - { 135, 150, 1, }, - { 355, 390, 1, }, - { 505, 525, 1, }, - { -1, -1, 0, }, -}; - -UnkCommonTextureStruct0 D_0D009188[] = { - { 1, 2, 6, }, - { 65, 80, 1, }, - { 165, 166, 9, }, - { 180, 210, 1, }, - { 220, 221, 10, }, - { 250, 275, 1, }, - { 360, 380, 1, }, - { 440, 480, 1, }, - { 600, 601, 9, }, - { 689, 690, 10, }, - { 695, 725, 1, }, - { -1, -1, 0, }, -}; - -UnkCommonTextureStruct0 D_0D0091E8[] = { - { 1, 2, 6, }, - { 128, 275, 1, }, - { 320, 345, 1, }, - { 465, 565, 1, }, - { -1, -1, 0, }, -}; - -UnkCommonTextureStruct0 D_0D009210[] = { - { 1, 2, 6, }, - { 75, 100, 1, }, - { 175, 210, 1, }, - { 275, 300, 1, }, - { -1, -1, 0, }, -}; - -UnkCommonTextureStruct0 D_0D009238[] = { - { 1, 2, 6, }, - { 106, 188, 1, }, - { 220, 386, 1, }, - { 583, 765, 1, }, - { -1, -1, 0, }, -}; - -UnkCommonTextureStruct0 D_0D009260[] = { - { 1, 2, 6, }, - { 245, 262, 1, }, - { 585, 606, 1, }, - { -1, -1, 0, }, -}; - -UnkCommonTextureStruct0 D_0D009280[] = { - { 1, 2, 6, }, - { 7, 38, 1, }, - { 36, 54, 1, }, - { 129, 150, 1, }, - { 380, 410, 1, }, - { 425, 445, 1, }, - { 456, 500, 1, }, - { 594, 625, 1, }, - { -1, -1, 0, }, -}; - -UnkCommonTextureStruct0 D_0D0092C8[] = { - { 1, 2, 6, }, - { 4, 5, 9, }, - { 129, 130, 10, }, - { 555, 560, 9, }, - { 827, 832, 10, }, - { 810, 845, 1, }, - { 910, 993, 1, }, - { 1390, 1600, 1, }, - { -1, -1, 0, }, -}; - -UnkCommonTextureStruct0 D_0D009310[] = { - { 1, 2, 6, }, - { 80, 120, 1, }, - { 200, 250, 1, }, - { 252, 253, 9, }, - { 273, 295, 1, }, - { 300, 315, 1, }, - { 333, 384, 1, }, - { 400, 401, 10, }, - { 405, 435, 1, }, - { 445, 475, 1, }, - { 485, 525, 1, }, - { 585, 615, 1, }, - { 685, 735, 1, }, - { 783, 820, 1, }, - { 956, 984, 1, }, - { 1005, 1050, 1, }, - { 1063, 1088, 1, }, - { 1130, 1131, 9, }, - { 1169, 1170, 10, }, - { 1195, 1240, 1, }, - { 1262, 1300, 1, }, - { -1, -1, 0, }, -}; - -UnkCommonTextureStruct0 D_0D0093C0[] = { - { 1, 2, 6, }, - { 20, 40, 1, }, - { 190, 191, 9, }, - { 259, 260, 10, }, - { 315, 335, 1, }, - { 353, 370, 1, }, - { 398, 430, 1, }, - { 458, 485, 1, }, - { 510, 535, 1, }, - { 580, 660, 3, }, - { -1, -1, 0, }, +KartAIBehaviour common_kart_ai_behaviour_battle_courses[] = { + { 1, 3, BEHAVIOUR_HOP, }, + { -1, -1, BEHAVIOUR_NONE, }, +}; + +KartAIBehaviour common_kart_ai_behaviour_mario_raceway[] = { + { 1, 2, BEHAVIOUR_NORMAL_SPEED, }, + { 11, 30, BEHAVIOUR_1, }, + { 55, 74, BEHAVIOUR_1, }, + { 90, 105, BEHAVIOUR_1, }, + { 139, 155, BEHAVIOUR_1, }, + { 177, 205, BEHAVIOUR_1, }, + { 225, 242, BEHAVIOUR_1, }, + { 292, 313, BEHAVIOUR_1, }, + { 352, 373, BEHAVIOUR_1, }, + { 452, 465, BEHAVIOUR_1, }, + { -1, -1, BEHAVIOUR_NONE, }, +}; + +KartAIBehaviour common_kart_ai_behaviour_choco_mountain[] = { + { 1, 2, BEHAVIOUR_NORMAL_SPEED, }, + { 10, 25, BEHAVIOUR_1, }, + { 190, 210, BEHAVIOUR_1, }, + { 270, 290, BEHAVIOUR_1, }, + { 410, 440, BEHAVIOUR_1, }, + { 540, 550, BEHAVIOUR_1, }, + { -1, -1, BEHAVIOUR_NONE, }, +}; + +KartAIBehaviour common_kart_ai_behaviour_bowser_castle[] = { + { 1, 2, BEHAVIOUR_NORMAL_SPEED, }, + { 60, 80, BEHAVIOUR_1, }, + { 125, 140, BEHAVIOUR_1, }, + { 170, 185, BEHAVIOUR_1, }, + { 230, 240, BEHAVIOUR_1, }, + { 275, 285, BEHAVIOUR_1, }, + { 310, 320, BEHAVIOUR_1, }, + { 321, 349, BEHAVIOUR_3, }, + { 350, 360, BEHAVIOUR_1, }, + { 385, 415, BEHAVIOUR_1, }, + { 450, 468, BEHAVIOUR_1, }, + { 470, 477, BEHAVIOUR_9, }, + { 480, 485, BEHAVIOUR_MAX_SPEED, }, + { 543, 546, BEHAVIOUR_9, }, + { 548, 550, BEHAVIOUR_MAX_SPEED, }, + { 565, 568, BEHAVIOUR_HOP, }, + { 630, 631, BEHAVIOUR_NORMAL_SPEED, }, + { 635, 640, BEHAVIOUR_10, }, + { 645, 655, BEHAVIOUR_1, }, + { -1, -1, BEHAVIOUR_NONE, }, +}; + +KartAIBehaviour common_kart_ai_behaviour_banshee_boardwalk[] = { + { 1, 2, BEHAVIOUR_NORMAL_SPEED, }, + { 15, 30, BEHAVIOUR_1, }, + { 55, 65, BEHAVIOUR_1, }, + { 125, 150, BEHAVIOUR_1, }, + { 265, 270, BEHAVIOUR_1, }, + { 275, 285, BEHAVIOUR_1, }, + { 305, 320, BEHAVIOUR_HOP, }, + { 330, 340, BEHAVIOUR_1, }, + { 375, 385, BEHAVIOUR_1, }, + { 547, 570, BEHAVIOUR_1, }, + { 582, 600, BEHAVIOUR_1, }, + { -1, -1, BEHAVIOUR_NONE, }, +}; + +KartAIBehaviour common_kart_ai_behaviour_yoshi_valley[] = { + { 1, 2, BEHAVIOUR_NORMAL_SPEED, }, + { 70, 94, BEHAVIOUR_1, }, + { 120, 133, BEHAVIOUR_1, }, + { 150, 170, BEHAVIOUR_1, }, + { 249, 265, BEHAVIOUR_1, }, + { 360, 395, BEHAVIOUR_1, }, + { 635, 655, BEHAVIOUR_1, }, + { -1, -1, BEHAVIOUR_NONE, }, +}; + +KartAIBehaviour common_kart_ai_behaviour_frappe_snowland[] = { + { 1, 2, BEHAVIOUR_NORMAL_SPEED, }, + { 15, 30, BEHAVIOUR_1, }, + { 41, 63, BEHAVIOUR_1, }, + { 115, 155, BEHAVIOUR_1, }, + { 200, 215, BEHAVIOUR_1, }, + { 240, 241, BEHAVIOUR_9, }, + { 264, 265, BEHAVIOUR_10, }, + { 270, 290, BEHAVIOUR_1, }, + { 345, 375, BEHAVIOUR_1, }, + { 493, 544, BEHAVIOUR_1, }, + { 583, 605, BEHAVIOUR_1, }, + { -1, -1, BEHAVIOUR_NONE, }, +}; + +KartAIBehaviour common_kart_ai_behaviour_koopa_beach[] = { + { 1, 2, BEHAVIOUR_NORMAL_SPEED, }, + { 75, 100, BEHAVIOUR_1, }, + { 135, 150, BEHAVIOUR_1, }, + { 355, 390, BEHAVIOUR_1, }, + { 505, 525, BEHAVIOUR_1, }, + { -1, -1, BEHAVIOUR_NONE, }, +}; + +KartAIBehaviour common_kart_ai_behaviour_royal_raceway[] = { + { 1, 2, BEHAVIOUR_NORMAL_SPEED, }, + { 65, 80, BEHAVIOUR_1, }, + { 165, 166, BEHAVIOUR_9, }, + { 180, 210, BEHAVIOUR_1, }, + { 220, 221, BEHAVIOUR_10, }, + { 250, 275, BEHAVIOUR_1, }, + { 360, 380, BEHAVIOUR_1, }, + { 440, 480, BEHAVIOUR_1, }, + { 600, 601, BEHAVIOUR_9, }, + { 689, 690, BEHAVIOUR_10, }, + { 695, 725, BEHAVIOUR_1, }, + { -1, -1, BEHAVIOUR_NONE, }, +}; + +KartAIBehaviour common_kart_ai_behaviour_luigi_raceway[] = { + { 1, 2, BEHAVIOUR_NORMAL_SPEED, }, + { 128, 275, BEHAVIOUR_1, }, + { 320, 345, BEHAVIOUR_1, }, + { 465, 565, BEHAVIOUR_1, }, + { -1, -1, BEHAVIOUR_NONE, }, +}; + +KartAIBehaviour common_kart_ai_behaviour_moo_moo_farm[] = { + { 1, 2, BEHAVIOUR_NORMAL_SPEED, }, + { 75, 100, BEHAVIOUR_1, }, + { 175, 210, BEHAVIOUR_1, }, + { 275, 300, BEHAVIOUR_1, }, + { -1, -1, BEHAVIOUR_NONE, }, +}; + +KartAIBehaviour common_kart_ai_behaviour_toad_turnpike[] = { + { 1, 2, BEHAVIOUR_NORMAL_SPEED, }, + { 106, 188, BEHAVIOUR_1, }, + { 220, 386, BEHAVIOUR_1, }, + { 583, 765, BEHAVIOUR_1, }, + { -1, -1, BEHAVIOUR_NONE, }, +}; + +KartAIBehaviour common_kart_ai_behaviour_kalamari_desert[] = { + { 1, 2, BEHAVIOUR_NORMAL_SPEED, }, + { 245, 262, BEHAVIOUR_1, }, + { 585, 606, BEHAVIOUR_1, }, + { -1, -1, BEHAVIOUR_NONE, }, +}; + +KartAIBehaviour common_kart_ai_behaviour_sherbet_land[] = { + { 1, 2, BEHAVIOUR_NORMAL_SPEED, }, + { 7, 38, BEHAVIOUR_1, }, + { 36, 54, BEHAVIOUR_1, }, + { 129, 150, BEHAVIOUR_1, }, + { 380, 410, BEHAVIOUR_1, }, + { 425, 445, BEHAVIOUR_1, }, + { 456, 500, BEHAVIOUR_1, }, + { 594, 625, BEHAVIOUR_1, }, + { -1, -1, BEHAVIOUR_NONE, }, +}; + +KartAIBehaviour common_kart_ai_behaviour_rainbow_road[] = { + { 1, 2, BEHAVIOUR_NORMAL_SPEED, }, + { 4, 5, BEHAVIOUR_9, }, + { 129, 130, BEHAVIOUR_10, }, + { 555, 560, BEHAVIOUR_9, }, + { 827, 832, BEHAVIOUR_10, }, + { 810, 845, BEHAVIOUR_1, }, + { 910, 993, BEHAVIOUR_1, }, + { 1390, 1600, BEHAVIOUR_1, }, + { -1, -1, BEHAVIOUR_NONE, }, +}; + +KartAIBehaviour common_kart_ai_behaviour_wario_stadium[] = { + { 1, 2, BEHAVIOUR_NORMAL_SPEED, }, + { 80, 120, BEHAVIOUR_1, }, + { 200, 250, BEHAVIOUR_1, }, + { 252, 253, BEHAVIOUR_9, }, + { 273, 295, BEHAVIOUR_1, }, + { 300, 315, BEHAVIOUR_1, }, + { 333, 384, BEHAVIOUR_1, }, + { 400, 401, BEHAVIOUR_10, }, + { 405, 435, BEHAVIOUR_1, }, + { 445, 475, BEHAVIOUR_1, }, + { 485, 525, BEHAVIOUR_1, }, + { 585, 615, BEHAVIOUR_1, }, + { 685, 735, BEHAVIOUR_1, }, + { 783, 820, BEHAVIOUR_1, }, + { 956, 984, BEHAVIOUR_1, }, + { 1005, 1050, BEHAVIOUR_1, }, + { 1063, 1088, BEHAVIOUR_1, }, + { 1130, 1131, BEHAVIOUR_9, }, + { 1169, 1170, BEHAVIOUR_10, }, + { 1195, 1240, BEHAVIOUR_1, }, + { 1262, 1300, BEHAVIOUR_1, }, + { -1, -1, BEHAVIOUR_NONE, }, +}; + +KartAIBehaviour common_kart_ai_behaviour_dk_jungle[] = { + { 1, 2, BEHAVIOUR_NORMAL_SPEED, }, + { 20, 40, BEHAVIOUR_1, }, + { 190, 191, BEHAVIOUR_9, }, + { 259, 260, BEHAVIOUR_10, }, + { 315, 335, BEHAVIOUR_1, }, + { 353, 370, BEHAVIOUR_1, }, + { 398, 430, BEHAVIOUR_1, }, + { 458, 485, BEHAVIOUR_1, }, + { 510, 535, BEHAVIOUR_1, }, + { 580, 660, BEHAVIOUR_3, }, + { -1, -1, BEHAVIOUR_NONE, }, }; // unknown float data diff --git a/src/data/path_spawn_data.c b/src/data/path_spawn_data.c index 8f9f1be68..6d893603f 100644 --- a/src/data/path_spawn_data.c +++ b/src/data/path_spawn_data.c @@ -2,13 +2,29 @@ #include "courses/all_course_data.h" #include "ending/ceremony_data.h" -UnkCommonTextureStruct0 *D_800DC720[] = { - D_0D008F28, D_0D008F80, D_0D008FB8, D_0D009058, - D_0D0090B8, D_0D0090F8, D_0D009158, D_0D009188, - D_0D0091E8, D_0D009210, D_0D009238, D_0D009260, - D_0D009280, D_0D0092C8, D_0D009310, D_0D008F18, - D_0D008F18, D_0D008F18, D_0D0093C0, D_0D008F18, - D_0D008F18, NULL, +KartAIBehaviour *gKartAIBehaviourLUT[NUM_COURSES+1] = { + common_kart_ai_behaviour_mario_raceway, + common_kart_ai_behaviour_choco_mountain, + common_kart_ai_behaviour_bowser_castle, + common_kart_ai_behaviour_banshee_boardwalk, + common_kart_ai_behaviour_yoshi_valley, + common_kart_ai_behaviour_frappe_snowland, + common_kart_ai_behaviour_koopa_beach, + common_kart_ai_behaviour_royal_raceway, + common_kart_ai_behaviour_luigi_raceway, + common_kart_ai_behaviour_moo_moo_farm, + common_kart_ai_behaviour_toad_turnpike, + common_kart_ai_behaviour_kalamari_desert, + common_kart_ai_behaviour_sherbet_land, + common_kart_ai_behaviour_rainbow_road, + common_kart_ai_behaviour_wario_stadium, + common_kart_ai_behaviour_battle_courses, /* COURSE_BLOCK_FORT */ + common_kart_ai_behaviour_battle_courses, /* COURSE_SKYSCRAPER */ + common_kart_ai_behaviour_battle_courses, /* COURSE_DOUBLE_DECK */ + common_kart_ai_behaviour_dk_jungle, + common_kart_ai_behaviour_battle_courses, /* COURSE_BIG_DONUT */ + common_kart_ai_behaviour_battle_courses, /* COURSE_AWARD_CEREMONY */ + NULL, /* NUM_COURSES */ }; TrackWaypoint nullPath = { 0x8000, 0x0000, 0x0000, 0x0000 }; @@ -67,7 +83,7 @@ s16 D_800DCA20[] = { 0x0035, 0x0035, 0x0035, 0x0028, 0x0035, 0x0000, }; -f32 D_800DCA4C[] = { +f32 gKartAICourseMaximumWaypointSeparation[] = { 50.0, 35.0, 35.0, 40.0, 35.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, @@ -76,7 +92,7 @@ f32 D_800DCA4C[] = { 40.0, }; -f32 D_800DCAA0[] = { +f32 gKartAICourseMinimumWaypointSeparation[] = { 0.3, 0.3, 0.2, 0.4, 0.0, 0.3, 0.5, 0.4, 0.7, 0.5, 0.5, 0.3, diff --git a/src/data/path_spawn_data.h b/src/data/path_spawn_data.h index eb394c262..458239037 100644 --- a/src/data/path_spawn_data.h +++ b/src/data/path_spawn_data.h @@ -15,13 +15,13 @@ struct _struct_D_800DD9D0_0x10 { /* 0x0A */ char padA[6]; }; // size 0x10 -extern UnkCommonTextureStruct0 *D_800DC720[]; +extern KartAIBehaviour *gKartAIBehaviourLUT[NUM_COURSES+1]; extern TrackWaypoint nullPath; extern TrackWaypoint *gCoursePathTable[][4]; extern TrackWaypoint *D_800DC8D0[][4]; extern s16 D_800DCA20[]; -extern f32 D_800DCA4C[]; -extern f32 D_800DCAA0[]; +extern f32 gKartAICourseMaximumWaypointSeparation[]; +extern f32 gKartAICourseMinimumWaypointSeparation[]; extern s16 D_800DCAF4[]; extern s16 D_800DCB34[]; extern s16 *D_800DCBB4[]; diff --git a/src/effects.c b/src/effects.c index 9a4fc17a0..af29bab8d 100644 --- a/src/effects.c +++ b/src/effects.c @@ -342,7 +342,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_CPU) == PLAYER_CPU) && (!gDemoMode) && ((player->unk_0CA & 2) == 0) && (gGPCurrentRaceRankByPlayerId[playerId] != 0)) { + if ((gModeSelection == VERSUS) && ((player->type & PLAYER_KART_AI) == PLAYER_KART_AI) && (!gDemoMode) && ((player->unk_0CA & 2) == 0) && (gGPCurrentRaceRankByPlayerId[playerId] != 0)) { player->soundEffects = (s32) (player->soundEffects | REVERSE_SOUND_EFFECT); } } @@ -1035,7 +1035,7 @@ void apply_reverse_sound_effect(Player *player, s8 arg1) player->unk_0E0 = 0; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - if (((gModeSelection == VERSUS) && ((player->type & PLAYER_CPU) != 0)) && (!gDemoMode)) { + if (((gModeSelection == VERSUS) && ((player->type & PLAYER_KART_AI) != 0)) && (!gDemoMode)) { func_800CA24C(arg1); } @@ -1043,7 +1043,7 @@ void apply_reverse_sound_effect(Player *player, s8 arg1) } func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008005); - if (((gModeSelection == VERSUS) && ((player->type & PLAYER_CPU) != 0)) && (!gDemoMode)) { + if (((gModeSelection == VERSUS) && ((player->type & PLAYER_KART_AI) != 0)) && (!gDemoMode)) { func_800CA24C(arg1); } func_800C9060(arg1, SOUND_ACTION_EXPLOSION); @@ -1884,7 +1884,7 @@ void func_80090970(Player *player, s8 playerId, s8 arg2) { } break; case 1: - if (((player->type & PLAYER_HUMAN) == 0x4000) && ((player->type & PLAYER_CPU) == 0)) { + if (((player->type & PLAYER_HUMAN) == 0x4000) && ((player->type & PLAYER_KART_AI) == 0)) { func_8009E088(playerId, 0xA); } if ((player->unk_0CA & 1) == 1) { @@ -1916,7 +1916,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_CPU) == 0)) { + if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_KART_AI) == 0)) { func_8009E020(playerId, 0x14); } func_80090178(player, playerId, sp44, sp38); diff --git a/src/main.h b/src/main.h index c1fa48de3..eca35b4a5 100644 --- a/src/main.h +++ b/src/main.h @@ -22,12 +22,12 @@ //! @todo Verify with proper documentation // functions called by mtxShadow multiply by 8 -// 8 CPU Players * 4 real players in coop +// 8 Kart AI Players * 4 real players in coop #define MTX_SHADOW_POOL_SIZE 8 * 4 //! @todo Verify with proper documentation // functions called by mtxKart multiply by 8 -// 8 CPU Players * 4 real players in coop +// 8 Kart AI Players * 4 real players in coop #define MTX_KART_POOL_SIZE 8 * 4 #define MTX_EFFECT_POOL_SIZE 660 diff --git a/src/player_controller.c b/src/player_controller.c index 334f9ea5e..08b852f68 100644 --- a/src/player_controller.c +++ b/src/player_controller.c @@ -23,310 +23,310 @@ extern s32 D_8018D168; -s16 gCPUforMario[] = { +s16 gKartAIforMario[] = { LUIGI, YOSHI, TOAD, DK, WARIO, PEACH, BOWSER, 0 }; -s16 gCPUforLuigi[] = { +s16 gKartAIforLuigi[] = { MARIO, YOSHI, TOAD, DK, WARIO, PEACH, BOWSER, 0 }; -s16 gCPUforYoshi[] = { +s16 gKartAIforYoshi[] = { MARIO, LUIGI, TOAD, DK, WARIO, PEACH, BOWSER, 0 }; -s16 gCPUforToad[] = { +s16 gKartAIforToad[] = { MARIO, LUIGI, YOSHI, DK, WARIO, PEACH, BOWSER, 0 }; -s16 gCPUforDk[] = { +s16 gKartAIforDk[] = { MARIO, LUIGI, YOSHI, TOAD, WARIO, PEACH, BOWSER, 0 }; -s16 gCPUforWario[] = { +s16 gKartAIforWario[] = { MARIO, LUIGI, YOSHI, TOAD, DK, PEACH, BOWSER, 0 }; -s16 gCPUforPeach[] = { +s16 gKartAIforPeach[] = { MARIO, LUIGI, YOSHI, TOAD, DK, WARIO, BOWSER, 0 }; -s16 gCPUforBowser[] = { +s16 gKartAIforBowser[] = { MARIO, LUIGI, YOSHI, TOAD, DK, WARIO, PEACH, 0 }; -s16 *gCPUforPlayer[] = { - gCPUforMario, gCPUforLuigi, gCPUforYoshi, gCPUforToad, - gCPUforDk, gCPUforWario, gCPUforPeach, gCPUforBowser +s16 *gKartAIforPlayer[] = { + gKartAIforMario, gKartAIforLuigi, gKartAIforYoshi, gKartAIforToad, + gKartAIforDk, gKartAIforWario, gKartAIforPeach, gKartAIforBowser }; -s16 gCPUforMarioAndLuigi[] = { +s16 gKartAIforMarioAndLuigi[] = { YOSHI, TOAD, DK, WARIO, PEACH, BOWSER }; -s16 gCPUforMarioAndYoshi[] = { +s16 gKartAIforMarioAndYoshi[] = { LUIGI, TOAD, DK, WARIO, PEACH, BOWSER }; -s16 gCPUforMarioAndToad[] = { +s16 gKartAIforMarioAndToad[] = { LUIGI, YOSHI, DK, WARIO, PEACH, BOWSER }; -s16 gCPUforMarioAndDk[] = { +s16 gKartAIforMarioAndDk[] = { LUIGI, YOSHI, TOAD, WARIO, PEACH, BOWSER }; -s16 gCPUforMarioAndWario[] = { +s16 gKartAIforMarioAndWario[] = { LUIGI, YOSHI, TOAD, DK, PEACH, BOWSER }; -s16 gCPUforMarioAndPeach[] = { +s16 gKartAIforMarioAndPeach[] = { LUIGI, YOSHI, TOAD, DK, WARIO, BOWSER }; -s16 gCPUforMarioAndBowser[] = { +s16 gKartAIforMarioAndBowser[] = { LUIGI, YOSHI, TOAD, DK, WARIO, PEACH }; -s16 gCPUforLuigiAndMario[] = { +s16 gKartAIforLuigiAndMario[] = { YOSHI, TOAD, DK, WARIO, PEACH, BOWSER }; -s16 gCPUforLuigiAndYoshi[] = { +s16 gKartAIforLuigiAndYoshi[] = { MARIO, TOAD, DK, WARIO, PEACH, BOWSER }; -s16 gCPUforLuigiAndToad[] = { +s16 gKartAIforLuigiAndToad[] = { MARIO, YOSHI, DK, WARIO, PEACH, BOWSER }; -s16 gCPUforLuigiAndDk[] = { +s16 gKartAIforLuigiAndDk[] = { MARIO, YOSHI, TOAD, WARIO, PEACH, BOWSER }; -s16 gCPUforLuigiAndWario[] = { +s16 gKartAIforLuigiAndWario[] = { MARIO, YOSHI, TOAD, DK, PEACH, BOWSER }; -s16 gCPUforLuigiAndPeach[] = { +s16 gKartAIforLuigiAndPeach[] = { MARIO, YOSHI, TOAD, DK, WARIO, BOWSER }; -s16 gCPUforLuigiAndBowser[] = { +s16 gKartAIforLuigiAndBowser[] = { MARIO, YOSHI, TOAD, DK, WARIO, PEACH }; -s16 gCPUforYoshiAndMario[] = { +s16 gKartAIforYoshiAndMario[] = { LUIGI, TOAD, DK, WARIO, PEACH, BOWSER }; -s16 gCPUforYoshiAndLuigi[] = { +s16 gKartAIforYoshiAndLuigi[] = { MARIO, TOAD, DK, WARIO, PEACH, BOWSER }; -s16 gCPUforYoshiAndToad[] = { +s16 gKartAIforYoshiAndToad[] = { MARIO, LUIGI, DK, WARIO, PEACH, BOWSER }; -s16 gCPUforYoshiAndDk[] = { +s16 gKartAIforYoshiAndDk[] = { MARIO, LUIGI, TOAD, WARIO, PEACH, BOWSER }; -s16 gCPUforYoshiAndWario[] = { +s16 gKartAIforYoshiAndWario[] = { MARIO, LUIGI, TOAD, DK, PEACH, BOWSER }; -s16 gCPUforYoshiAndPeach[] = { +s16 gKartAIforYoshiAndPeach[] = { MARIO, LUIGI, TOAD, DK, WARIO, BOWSER }; -s16 gCPUforYoshiAndBowser[] = { +s16 gKartAIforYoshiAndBowser[] = { MARIO, LUIGI, TOAD, DK, WARIO, PEACH }; -s16 gCPUforToadAndMario[] = { +s16 gKartAIforToadAndMario[] = { LUIGI, YOSHI, DK, WARIO, PEACH, BOWSER }; -s16 gCPUforToadAndLuigi[] = { +s16 gKartAIforToadAndLuigi[] = { MARIO, YOSHI, DK, WARIO, PEACH, BOWSER }; -s16 gCPUforToadAndYoshi[] = { +s16 gKartAIforToadAndYoshi[] = { MARIO, LUIGI, DK, WARIO, PEACH, BOWSER }; -s16 gCPUforToadAndDk[] = { +s16 gKartAIforToadAndDk[] = { MARIO, LUIGI, YOSHI, WARIO, PEACH, BOWSER }; -s16 gCPUforToadAndWario[] = { +s16 gKartAIforToadAndWario[] = { MARIO, LUIGI, YOSHI, DK, PEACH, BOWSER }; -s16 gCPUforToadAndPeach[] = { +s16 gKartAIforToadAndPeach[] = { MARIO, LUIGI, YOSHI, DK, WARIO, BOWSER }; -s16 gCPUforToadAndBowser[] = { +s16 gKartAIforToadAndBowser[] = { MARIO, LUIGI, YOSHI, DK, WARIO, PEACH }; -s16 gCPUforDkAndMario[] = { +s16 gKartAIforDkAndMario[] = { LUIGI, YOSHI, TOAD, WARIO, PEACH, BOWSER }; -s16 gCPUforDkAndLuigi[] = { +s16 gKartAIforDkAndLuigi[] = { MARIO, YOSHI, TOAD, WARIO, PEACH, BOWSER }; -s16 gCPUforDkAndToad[] = { +s16 gKartAIforDkAndToad[] = { MARIO, LUIGI, TOAD, WARIO, PEACH, BOWSER }; -s16 gCPUforDkAndYoshi[] = { +s16 gKartAIforDkAndYoshi[] = { MARIO, LUIGI, YOSHI, WARIO, PEACH, BOWSER }; -s16 gCPUforDkAndWario[] = { +s16 gKartAIforDkAndWario[] = { MARIO, LUIGI, YOSHI, TOAD, PEACH, BOWSER }; -s16 gCPUforDkAndPeach[] = { +s16 gKartAIforDkAndPeach[] = { MARIO, LUIGI, YOSHI, TOAD, WARIO, BOWSER }; -s16 gCPUforDkAndBowser[] = { +s16 gKartAIforDkAndBowser[] = { MARIO, LUIGI, YOSHI, TOAD, WARIO, PEACH }; -s16 gCPUforWarioAndMario[] = { +s16 gKartAIforWarioAndMario[] = { LUIGI, YOSHI, TOAD, DK, PEACH, BOWSER }; -s16 gCPUforWarioAndLuigi[] = { +s16 gKartAIforWarioAndLuigi[] = { MARIO, YOSHI, TOAD, DK, PEACH, BOWSER }; -s16 gCPUforWarioAndYoshi[] = { +s16 gKartAIforWarioAndYoshi[] = { MARIO, LUIGI, TOAD, DK, PEACH, BOWSER }; -s16 gCPUforWarioAndDk[] = { +s16 gKartAIforWarioAndDk[] = { MARIO, LUIGI, YOSHI, TOAD, PEACH, BOWSER }; -s16 gCPUforWarioAndToad[] = { +s16 gKartAIforWarioAndToad[] = { MARIO, LUIGI, YOSHI, DK, PEACH, BOWSER }; -s16 gCPUforWarioAndPeach[] = { +s16 gKartAIforWarioAndPeach[] = { MARIO, LUIGI, YOSHI, TOAD, DK, BOWSER }; -s16 gCPUforWarioAndBowser[] = { +s16 gKartAIforWarioAndBowser[] = { MARIO, LUIGI, YOSHI, TOAD, DK, PEACH }; -s16 gCPUforPeachAndMario[] = { +s16 gKartAIforPeachAndMario[] = { LUIGI, YOSHI, TOAD, DK, WARIO, BOWSER }; -s16 gCPUforPeachAndLuigi[] = { +s16 gKartAIforPeachAndLuigi[] = { MARIO, YOSHI, TOAD, DK, WARIO, BOWSER }; -s16 gCPUforPeachAndYoshi[] = { +s16 gKartAIforPeachAndYoshi[] = { MARIO, LUIGI, TOAD, DK, WARIO, BOWSER }; -s16 gCPUforPeachAndDk[] = { +s16 gKartAIforPeachAndDk[] = { MARIO, LUIGI, YOSHI, TOAD, WARIO, BOWSER }; -s16 gCPUforPeachAndWario[] = { +s16 gKartAIforPeachAndWario[] = { MARIO, LUIGI, YOSHI, TOAD, DK, BOWSER }; -s16 gCPUforPeachAndToad[] = { +s16 gKartAIforPeachAndToad[] = { MARIO, LUIGI, YOSHI, DK, WARIO, BOWSER }; -s16 gCPUforPeachAndBowser[] = { +s16 gKartAIforPeachAndBowser[] = { MARIO, LUIGI, YOSHI, TOAD, DK, WARIO }; -s16 gCPUforBowserAndMario[] = { +s16 gKartAIforBowserAndMario[] = { LUIGI, YOSHI, TOAD, DK, WARIO, PEACH }; -s16 gCPUforBowserAndLuigi[] = { +s16 gKartAIforBowserAndLuigi[] = { MARIO, YOSHI, TOAD, DK, WARIO, PEACH }; -s16 gCPUforBowserAndYoshi[] = { +s16 gKartAIforBowserAndYoshi[] = { MARIO, LUIGI, TOAD, DK, WARIO, PEACH }; -s16 gCPUforBowserAndDk[] = { +s16 gKartAIforBowserAndDk[] = { MARIO, LUIGI, YOSHI, TOAD, WARIO, PEACH }; -s16 gCPUforBowserAndWario[] = { +s16 gKartAIforBowserAndWario[] = { MARIO, LUIGI, YOSHI, TOAD, DK, PEACH }; -s16 gCPUforBowserAndToad[] = { +s16 gKartAIforBowserAndToad[] = { MARIO, LUIGI, YOSHI, DK, WARIO, PEACH }; -s16 gCPUforBowserAndPeach[] = { +s16 gKartAIforBowserAndPeach[] = { MARIO, LUIGI, YOSHI, TOAD, DK, WARIO }; -s16 *gListCPUforMario[] = { - gCPUforMarioAndLuigi, gCPUforMarioAndLuigi, gCPUforMarioAndYoshi, gCPUforMarioAndToad, - gCPUforMarioAndDk, gCPUforMarioAndWario, gCPUforMarioAndPeach, gCPUforMarioAndBowser +s16 *gListKartAIforMario[] = { + gKartAIforMarioAndLuigi, gKartAIforMarioAndLuigi, gKartAIforMarioAndYoshi, gKartAIforMarioAndToad, + gKartAIforMarioAndDk, gKartAIforMarioAndWario, gKartAIforMarioAndPeach, gKartAIforMarioAndBowser }; -s16 *gListCPUforLuigi[] = { - gCPUforLuigiAndMario, gCPUforLuigiAndMario, gCPUforLuigiAndYoshi, gCPUforLuigiAndToad, - gCPUforLuigiAndDk, gCPUforLuigiAndWario, gCPUforLuigiAndPeach, gCPUforLuigiAndBowser +s16 *gListKartAIforLuigi[] = { + gKartAIforLuigiAndMario, gKartAIforLuigiAndMario, gKartAIforLuigiAndYoshi, gKartAIforLuigiAndToad, + gKartAIforLuigiAndDk, gKartAIforLuigiAndWario, gKartAIforLuigiAndPeach, gKartAIforLuigiAndBowser }; -s16 *gListCPUforYoshi[] = { - gCPUforYoshiAndMario, gCPUforYoshiAndLuigi, gCPUforYoshiAndLuigi, gCPUforYoshiAndToad, - gCPUforYoshiAndDk, gCPUforYoshiAndWario, gCPUforYoshiAndPeach, gCPUforYoshiAndBowser +s16 *gListKartAIforYoshi[] = { + gKartAIforYoshiAndMario, gKartAIforYoshiAndLuigi, gKartAIforYoshiAndLuigi, gKartAIforYoshiAndToad, + gKartAIforYoshiAndDk, gKartAIforYoshiAndWario, gKartAIforYoshiAndPeach, gKartAIforYoshiAndBowser }; -s16 *gListCPUforToad[] = { - gCPUforToadAndMario, gCPUforToadAndLuigi, gCPUforToadAndYoshi, gCPUforToadAndYoshi, - gCPUforToadAndDk, gCPUforToadAndWario, gCPUforToadAndPeach, gCPUforToadAndBowser +s16 *gListKartAIforToad[] = { + gKartAIforToadAndMario, gKartAIforToadAndLuigi, gKartAIforToadAndYoshi, gKartAIforToadAndYoshi, + gKartAIforToadAndDk, gKartAIforToadAndWario, gKartAIforToadAndPeach, gKartAIforToadAndBowser }; -s16 *gListCPUforDk[] = { - gCPUforDkAndMario, gCPUforDkAndLuigi, gCPUforDkAndToad, gCPUforDkAndYoshi, - gCPUforDkAndYoshi, gCPUforDkAndWario, gCPUforDkAndPeach, gCPUforDkAndBowser +s16 *gListKartAIforDk[] = { + gKartAIforDkAndMario, gKartAIforDkAndLuigi, gKartAIforDkAndToad, gKartAIforDkAndYoshi, + gKartAIforDkAndYoshi, gKartAIforDkAndWario, gKartAIforDkAndPeach, gKartAIforDkAndBowser }; -s16 *gListCPUforWario[] = { - gCPUforWarioAndMario, gCPUforWarioAndLuigi, gCPUforWarioAndYoshi, gCPUforWarioAndToad, - gCPUforWarioAndDk, gCPUforWarioAndDk, gCPUforWarioAndPeach, gCPUforWarioAndBowser +s16 *gListKartAIforWario[] = { + gKartAIforWarioAndMario, gKartAIforWarioAndLuigi, gKartAIforWarioAndYoshi, gKartAIforWarioAndToad, + gKartAIforWarioAndDk, gKartAIforWarioAndDk, gKartAIforWarioAndPeach, gKartAIforWarioAndBowser }; -s16 *gListCPUforPeach[] = { - gCPUforPeachAndMario, gCPUforPeachAndLuigi, gCPUforPeachAndYoshi, gCPUforPeachAndToad, - gCPUforPeachAndDk, gCPUforPeachAndWario, gCPUforPeachAndDk, gCPUforPeachAndBowser +s16 *gListKartAIforPeach[] = { + gKartAIforPeachAndMario, gKartAIforPeachAndLuigi, gKartAIforPeachAndYoshi, gKartAIforPeachAndToad, + gKartAIforPeachAndDk, gKartAIforPeachAndWario, gKartAIforPeachAndDk, gKartAIforPeachAndBowser }; -s16 *gListCPUforBowser[] = { - gCPUforBowserAndMario, gCPUforBowserAndLuigi, gCPUforBowserAndYoshi, gCPUforBowserAndToad, - gCPUforBowserAndDk, gCPUforBowserAndWario, gCPUforBowserAndPeach, gCPUforBowserAndPeach +s16 *gListKartAIforBowser[] = { + gKartAIforBowserAndMario, gKartAIforBowserAndLuigi, gKartAIforBowserAndYoshi, gKartAIforBowserAndToad, + gKartAIforBowserAndDk, gKartAIforBowserAndWario, gKartAIforBowserAndPeach, gKartAIforBowserAndPeach }; -s16 **gCPUforTwoPlayer[] = { - gListCPUforMario, gListCPUforLuigi, gListCPUforYoshi, gListCPUforToad, - gListCPUforDk, gListCPUforWario, gListCPUforPeach, gListCPUforBowser +s16 **gKartAIforTwoPlayer[] = { + gListKartAIforMario, gListKartAIforLuigi, gListKartAIforYoshi, gListKartAIforToad, + gListKartAIforDk, gListKartAIforWario, gListKartAIforPeach, gListKartAIforBowser }; // func_80027D00 @@ -665,7 +665,7 @@ void func_80028864(Player *player, Camera *camera, s8 arg2, s8 arg3) { func_8002D268(player, camera, arg3, arg2); } } else { - control_cpu_movement(player, camera, arg3, arg2); + control_kart_ai_movement(player, camera, arg3, arg2); } } else if ((player->type & PLAYER_STAGING) == PLAYER_STAGING) { func_8002D028(player, arg2); @@ -1308,7 +1308,7 @@ void func_8002A8A4(Player *player, s8 arg1) { } } -void func_8002AA50(Player *player) { +void kart_hop(Player *player) { player->kartHopJerk = gKartHopJerkTable[player->characterId]; player->kartHopAcceleration = 0.0f; player->kartHopVelocity = gKartHopInitialVelocityTable[player->characterId]; @@ -1504,7 +1504,7 @@ void func_8002B218(Player *player) { for (someIndex = 0; someIndex < 10; someIndex++) { if (player->unk_006 == sp38[someIndex]) { player->effects |= 0x10; - func_8002AA50(player); + kart_hop(player); player->unk_204 = 0; break; } @@ -1957,13 +1957,13 @@ void func_8002C4F8(Player *player, s8 arg1) { } else if ((player->effects & 8) != 8) { player->unk_0CA &= ~0x0100; } - if ((player->type & PLAYER_CPU) && ((func_802ABDF4(player->unk_110.unk3A) != 0) || (player->unk_0CA & 1))) { + if ((player->type & PLAYER_KART_AI) && ((func_802ABDF4(player->unk_110.unk3A) != 0) || (player->unk_0CA & 1))) { if (!(player->unk_0CA & 2) && !(player->unk_0CA & 8) && !(player->effects & 0x1000)) { func_80090778(player); func_80090868(player); } } - if ((player->type & PLAYER_CPU) && (player->surfaceType == OUT_OF_BOUNDS) && !(player->effects & 8)) { + if ((player->type & PLAYER_KART_AI) && (player->surfaceType == OUT_OF_BOUNDS) && !(player->effects & 8)) { func_80090778(player); func_80090868(player); } @@ -2460,7 +2460,7 @@ void func_8002D268(Player *player, UNUSED Camera *camera, s8 arg2, s8 playerId) player->pos[2] = spF4; } player->pos[1] = spF8; - if ((player->type & PLAYER_HUMAN) && (!(player->type & PLAYER_CPU))) { + if ((player->type & PLAYER_HUMAN) && (!(player->type & PLAYER_KART_AI))) { func_8002BB9C(player, &spFC, &spF4, arg2, playerId, sp98); } player->unk_064[0] = sp178[0]; @@ -2752,7 +2752,7 @@ void func_8002E594(Player *player, UNUSED Camera *camera, s8 arg2, s8 playerId) func_8002C4F8(player, playerId); } -void control_cpu_movement(Player *player, UNUSED Camera *camera, s8 arg2, s8 playerId) { +void control_kart_ai_movement(Player *player, UNUSED Camera *camera, s8 arg2, s8 playerId) { Vec3f spF4 = {0.0f, 0.0f, 1.0f}; UNUSED Vec3f spE8 = {0.0f, 0.0f, 0.0f}; Vec3f spDC = {0.0f, 0.0f, 0.0f}; @@ -4604,7 +4604,7 @@ void func_80037BB4(Player *player, Vec3f arg1) { if (((player->effects & 0x20000000) != 0x20000000) || (player->unk_228 >= 0x64)) { player->rotation[1] += player->unk_078; } - if (!(player->type & PLAYER_CPU)) { + if (!(player->type & PLAYER_KART_AI)) { if (gModeSelection == BATTLE) { func_800378E8(player, sp20, arg1); } else { @@ -4617,7 +4617,7 @@ void func_80037BB4(Player *player, Vec3f arg1) { if (((player->effects & 0x20000000) != 0x20000000) || (player->unk_228 >= 0x64)) { player->rotation[1] += player->unk_078; } - if (!(player->type & PLAYER_CPU)) { + if (!(player->type & PLAYER_KART_AI)) { if (gModeSelection == BATTLE) { func_80037A4C(player, sp20, arg1); } else { @@ -4643,7 +4643,7 @@ void func_80037CFC(Player *player, struct Controller *controller, s8 arg2) { ((player->effects & 2) != 2) && ((player->effects & 0x10) != 0x10) && (controller->buttonPressed & R_TRIG)) { - func_8002AA50(player); + kart_hop(player); if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { func_800C9060(arg2, 0x19008000); } @@ -4736,7 +4736,7 @@ void func_80037CFC(Player *player, struct Controller *controller, s8 arg2) { void func_800381AC(Player *player, struct Controller *controller, s8 arg2) { if (((player->type & PLAYER_EXISTS) == PLAYER_EXISTS) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && - ((player->type & PLAYER_CPU) != PLAYER_CPU)) { + ((player->type & PLAYER_KART_AI) != PLAYER_KART_AI)) { if ((player->type & PLAYER_START_SEQUENCE) != PLAYER_START_SEQUENCE) { if (((player->unk_0CA & 2) == 2) || ((player->unk_0CA & 8) == 8)) { if (controller->button & A_BUTTON) { diff --git a/src/player_controller.h b/src/player_controller.h index e43cb3f4f..84cbe7418 100644 --- a/src/player_controller.h +++ b/src/player_controller.h @@ -36,7 +36,7 @@ void func_8002A5F4(Vec3f, f32, Vec3f, f32, f32); void func_8002A704(Player*, s8); void func_8002A79C(Player*, s8); void func_8002A8A4(Player*, s8); -void func_8002AA50(Player*); +void kart_hop(Player*); void func_8002AAC0(Player*); void func_8002AB70(Player*); void func_8002AE20(void); @@ -64,7 +64,7 @@ void func_8002D028(Player*, s8); void func_8002D268(Player*, Camera*, s8, s8); void func_8002E4C4(Player*); -void control_cpu_movement(Player*,Camera*, s8, s8); +void control_kart_ai_movement(Player*,Camera*, s8, s8); void func_8002FCA8(Player*, s8); void func_8002FE84(Player*, f32); @@ -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 gCPUforMario[]; -extern s16 gCPUforLuigi[]; -extern s16 gCPUforYoshi[]; -extern s16 gCPUforToad[]; -extern s16 gCPUforDk[]; -extern s16 gCPUforWario[]; -extern s16 gCPUforPeach[]; -extern s16 gCPUforBowser[]; -extern s16 *gCPUforPlayer[]; - -extern s16 gCPUforMarioAndLuigi[]; -extern s16 gCPUforMarioAndYoshi[]; -extern s16 gCPUforMarioAndToad[]; -extern s16 gCPUforMarioAndDk[]; -extern s16 gCPUforMarioAndWario[]; -extern s16 gCPUforMarioAndPeach[]; -extern s16 gCPUforMarioAndBowser[]; -extern s16 gCPUforLuigiAndMario[]; -extern s16 gCPUforLuigiAndYoshi[]; -extern s16 gCPUforLuigiAndToad[]; -extern s16 gCPUforLuigiAndDk[]; -extern s16 gCPUforLuigiAndWario[]; -extern s16 gCPUforLuigiAndPeach[]; -extern s16 gCPUforLuigiAndBowser[]; -extern s16 gCPUforYoshiAndMario[]; -extern s16 gCPUforYoshiAndLuigi[]; -extern s16 gCPUforYoshiAndToad[]; -extern s16 gCPUforYoshiAndDk[]; -extern s16 gCPUforYoshiAndWario[]; -extern s16 gCPUforYoshiAndPeach[]; -extern s16 gCPUforYoshiAndBowser[]; -extern s16 gCPUforToadAndMario[]; -extern s16 gCPUforToadAndLuigi[]; -extern s16 gCPUforToadAndYoshi[]; -extern s16 gCPUforToadAndDk[]; -extern s16 gCPUforToadAndWario[]; -extern s16 gCPUforToadAndPeach[]; -extern s16 gCPUforToadAndBowser[]; -extern s16 gCPUforDkAndMario[]; -extern s16 gCPUforDkAndLuigi[]; -extern s16 gCPUforDkAndToad[]; -extern s16 gCPUforDkAndYoshi[]; -extern s16 gCPUforDkAndWario[]; -extern s16 gCPUforDkAndPeach[]; -extern s16 gCPUforDkAndBowser[]; -extern s16 gCPUforWarioAndMario[]; -extern s16 gCPUforWarioAndLuigi[]; -extern s16 gCPUforWarioAndYoshi[]; -extern s16 gCPUforWarioAndDk[]; -extern s16 gCPUforWarioAndToad[]; -extern s16 gCPUforWarioAndPeach[]; -extern s16 gCPUforWarioAndBowser[]; -extern s16 gCPUforPeachAndMario[]; -extern s16 gCPUforPeachAndLuigi[]; -extern s16 gCPUforPeachAndYoshi[]; -extern s16 gCPUforPeachAndDk[]; -extern s16 gCPUforPeachAndWario[]; -extern s16 gCPUforPeachAndToad[]; -extern s16 gCPUforPeachAndBowser[]; -extern s16 gCPUforBowserAndMario[]; -extern s16 gCPUforBowserAndLuigi[]; -extern s16 gCPUforBowserAndYoshi[]; -extern s16 gCPUforBowserAndDk[]; -extern s16 gCPUforBowserAndWario[]; -extern s16 gCPUforBowserAndToad[]; -extern s16 gCPUforBowserAndPeach[]; -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 **gCPUforTwoPlayer[]; +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 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 D_801656F0; diff --git a/src/racing/actors.c b/src/racing/actors.c index 8d95c2096..c18491452 100644 --- a/src/racing/actors.c +++ b/src/racing/actors.c @@ -1626,7 +1626,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_CPU) == 0)) { + if ((gModeSelection == TIME_TRIALS) && ((player->type & PLAYER_KART_AI) == 0)) { D_80162DF8 = 1; } } @@ -2138,7 +2138,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_CPU)) { + if ((gModeSelection == TIME_TRIALS) && !(player->type & PLAYER_KART_AI)) { D_80162DF8 = 1; } if (player->effects & STAR_EFFECT) { diff --git a/src/racing/race_logic.c b/src/racing/race_logic.c index c7d1fa35b..04f8ce945 100644 --- a/src/racing/race_logic.c +++ b/src/racing/race_logic.c @@ -534,7 +534,7 @@ void func_8028EF28(void) { func_8028EEF0(i); currentPosition = gPlayers[i].currentRank; - gPlayers[i].type |= PLAYER_CPU; + gPlayers[i].type |= PLAYER_KART_AI; if (currentPosition < 4) { D_80150120 = 1; @@ -573,7 +573,7 @@ void func_8028EF28(void) { D_800DC510 = 5; i = gPlayerPositionLUT[1]; gPlayers[i].soundEffects |= 0x200000; - gPlayers[i].type |= PLAYER_CPU; + gPlayers[i].type |= PLAYER_KART_AI; func_800CA118((u8)i); break; case 3: @@ -591,7 +591,7 @@ void func_8028EF28(void) { *(gNmiUnknown2 + i * 3 + 2) = 99; } gPlayers[i].soundEffects |= 0x200000; - gPlayers[i].type |= PLAYER_CPU; + gPlayers[i].type |= PLAYER_KART_AI; func_800CA118((u8)i); } break; @@ -606,7 +606,7 @@ void func_8028EF28(void) { D_800DC510 = 5; i = gPlayerPositionLUT[3]; gPlayers[i].soundEffects |= 0x200000; - gPlayers[i].type |= PLAYER_CPU; + gPlayers[i].type |= PLAYER_KART_AI; func_800CA118((u8)i); } break; @@ -801,7 +801,7 @@ void func_8028F970(void) { struct Controller *controller = &gControllers[i]; if (!(player->type & PLAYER_HUMAN)) { continue; } - if (player->type & PLAYER_CPU) { continue; } + if (player->type & PLAYER_KART_AI) { continue; } if (gActiveScreenMode != SCREEN_MODE_3P_4P_SPLITSCREEN) { if ((controller->buttonPressed & L_TRIG) && !(controller->button & R_TRIG)) { diff --git a/src/render_objects.c b/src/render_objects.c index 8cef03f3c..bc4a86a58 100644 --- a/src/render_objects.c +++ b/src/render_objects.c @@ -2373,13 +2373,13 @@ void func_8004F3E4(s32 arg0) { case GRAND_PRIX: for (idx = D_8018D158 - 1; idx >= 0; idx--) { playerId = gGPCurrentRacePlayerIdByRank[idx]; - if ((gPlayerOne + playerId)->type & PLAYER_CPU) { + if ((gPlayerOne + playerId)->type & PLAYER_KART_AI) { func_8004F168(arg0, playerId, 8); } } for (idx = D_8018D158 - 1; idx >= 0; idx--) { playerId = gGPCurrentRacePlayerIdByRank[idx]; - if (((gPlayerOne + playerId)->type & PLAYER_CPU) != PLAYER_CPU) { + if (((gPlayerOne + playerId)->type & PLAYER_KART_AI) != PLAYER_KART_AI) { func_8004F168(arg0, playerId, (gPlayerOne + playerId)->characterId); } } diff --git a/src/spawn_players.c b/src/spawn_players.c index e76677a37..2c3719357 100644 --- a/src/spawn_players.c +++ b/src/spawn_players.c @@ -55,7 +55,7 @@ s32 gCountBChangement[8]; bool gIsPlayerTripleBButtonCombo[8]; s32 gTimerBoostTripleBCombo[8]; -s16 chooseCPUPlayers[7]; +s16 chooseKartAIPlayers[7]; s16 D_8016556E; s16 D_80165570; @@ -495,78 +495,78 @@ void spawn_players_gp_one_player(f32 *arg0, f32 *arg1, f32 arg2) { } while(rand == gCharacterSelections[0]); // Randomize gPlayerTwo - chooseCPUPlayers[0] = rand; + chooseKartAIPlayers[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 *) gCPUforPlayer[gCharacterSelections[0]]; + u16* arr = (u16 *) gKartAIforPlayer[gCharacterSelections[0]]; if (rand == arr[i]) { - chooseCPUPlayers[i] = arr[0]; + chooseKartAIPlayers[i] = arr[0]; } else { - chooseCPUPlayers[i] = arr[i]; + chooseKartAIPlayers[i] = arr[i]; } } } 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_CPU); - spawn_player(gPlayerTwo, 1, arg0[D_80165270[1]], arg1[D_80165270[1]], arg2, 32768.0f, chooseCPUPlayers[0], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerThree, 2, arg0[D_80165270[2]], arg1[D_80165270[2]], arg2, 32768.0f, chooseCPUPlayers[1], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerFour, 3, arg0[D_80165270[3]], arg1[D_80165270[3]], arg2, 32768.0f, chooseCPUPlayers[2], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerFive, 4, arg0[D_80165270[4]], arg1[D_80165270[4]], arg2, 32768.0f, chooseCPUPlayers[3], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerSix, 5, arg0[D_80165270[5]], arg1[D_80165270[5]], arg2, 32768.0f, chooseCPUPlayers[4], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerSeven, 6, arg0[D_80165270[6]], arg1[D_80165270[6]], arg2, 32768.0f, chooseCPUPlayers[5], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerEight, 7, arg0[D_80165270[7]], arg1[D_80165270[7]], arg2, 32768.0f, chooseCPUPlayers[6], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); + 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); 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, chooseCPUPlayers[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, chooseCPUPlayers[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, chooseCPUPlayers[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, chooseCPUPlayers[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, chooseCPUPlayers[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, chooseCPUPlayers[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, chooseCPUPlayers[6], PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_CPU); + 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); + 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); + 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); + 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); + 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); + 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); + 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); D_80164A28 = 1; } func_80039AE4(); } 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_CPU); - spawn_player(gPlayerFive, 4, arg0[3], arg1[3], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_CPU); - spawn_player(gPlayerSix, 5, arg0[4], arg1[4], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_CPU); - spawn_player(gPlayerSeven, 6, arg0[5], arg1[5], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_CPU); - spawn_player(gPlayerEight, 7, arg0[6], arg1[6], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerFour, 3, arg0[2], arg1[2], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_KART_AI); + spawn_player(gPlayerFive, 4, arg0[3], arg1[3], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_KART_AI); + spawn_player(gPlayerSix, 5, arg0[4], arg1[4], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_KART_AI); + spawn_player(gPlayerSeven, 6, arg0[5], arg1[5], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_KART_AI); + spawn_player(gPlayerEight, 7, arg0[6], arg1[6], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_KART_AI); if (gDemoMode == 1) { - spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], PLAYER_HUMAN_AND_CPU); - spawn_player(gPlayerTwo, 1, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_CPU); - spawn_player(gPlayerThree, 2, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], PLAYER_HUMAN_AND_KART_AI); + spawn_player(gPlayerTwo, 1, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_KART_AI); + spawn_player(gPlayerThree, 2, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_KART_AI); } 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); if (D_80162DD4 == 0) { spawn_player(gPlayerTwo, 1, arg0[0], arg1[0], arg2, 32768.0f, D_80162DE0, 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_CPU); + spawn_player(gPlayerTwo, 1, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_KART_AI); } 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_CPU); + spawn_player(gPlayerThree, 2, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_KART_AI); } } else { spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, D_80162DE8, PLAYER_EXISTS | PLAYER_HUMAN | PLAYER_START_SEQUENCE | PLAYER_INVISIBLE_OR_BOMB); if (D_80162DD8 == 0) { spawn_player(gPlayerTwo, 1, arg0[0], arg1[0], arg2, 32768.0f, D_80162DE0, 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_CPU); + spawn_player(gPlayerTwo, 1, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_KART_AI); } 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_CPU); + spawn_player(gPlayerThree, 2, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_KART_AI); } } D_80164A28 = 0; @@ -587,32 +587,32 @@ getRand: if (gCharacterSelections[1] == rand) goto getRand; - chooseCPUPlayers[0] = rand; + chooseKartAIPlayers[0] = rand; for (i = 1; i < 6; i++) { - u16* arr = (u16 *) gCPUforTwoPlayer[gCharacterSelections[0]][gCharacterSelections[1]]; + u16* arr = (u16 *) gKartAIforTwoPlayer[gCharacterSelections[0]][gCharacterSelections[1]]; if (rand == arr[i]) { - chooseCPUPlayers[i] = arr[0]; + chooseKartAIPlayers[i] = arr[0]; } else { - chooseCPUPlayers[i] = arr[i]; + chooseKartAIPlayers[i] = arr[i]; } } } - spawn_player(gPlayerThree, 2, arg0[D_80165270[2]], arg1[D_80165270[2]], arg2, 32768.0f, chooseCPUPlayers[0], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerFour, 3, arg0[D_80165270[3]], arg1[D_80165270[3]], arg2, 32768.0f, chooseCPUPlayers[1], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerFive, 4, arg0[D_80165270[4]], arg1[D_80165270[4]], arg2, 32768.0f, chooseCPUPlayers[2], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerSix, 5, arg0[D_80165270[5]], arg1[D_80165270[5]], arg2, 32768.0f, chooseCPUPlayers[3], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerSeven, 6, arg0[D_80165270[6]], arg1[D_80165270[6]], arg2, 32768.0f, chooseCPUPlayers[4], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerEight, 7, arg0[D_80165270[7]], arg1[D_80165270[7]], arg2, 32768.0f, chooseCPUPlayers[5], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); + 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); if (gDemoMode == 1) { - spawn_player(gPlayerOneCopy, 0, arg0[D_80165270[0]], arg1[D_80165270[0]], arg2, 32768.0f, gCharacterSelections[0], PLAYER_HUMAN_AND_CPU); + spawn_player(gPlayerOneCopy, 0, arg0[D_80165270[0]], arg1[D_80165270[0]], arg2, 32768.0f, gCharacterSelections[0], PLAYER_HUMAN_AND_KART_AI); } 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_CPU | PLAYER_START_SEQUENCE); + 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); } 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); } @@ -622,19 +622,19 @@ getRand: } 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_CPU); - spawn_player(gPlayerFour, 3, arg0[2], arg1[2], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_CPU); - spawn_player(gPlayerFive, 4, arg0[3], arg1[3], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_CPU); - spawn_player(gPlayerSix, 5, arg0[4], arg1[4], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_CPU); - spawn_player(gPlayerSeven, 6, arg0[5], arg1[5], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_CPU); - spawn_player(gPlayerEight, 7, arg0[6], arg1[6], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_CPU); + spawn_player(gPlayerThree, 2, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_KART_AI); + spawn_player(gPlayerFour, 3, arg0[2], arg1[2], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_KART_AI); + spawn_player(gPlayerFive, 4, arg0[3], arg1[3], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_KART_AI); + spawn_player(gPlayerSix, 5, arg0[4], arg1[4], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_KART_AI); + spawn_player(gPlayerSeven, 6, arg0[5], arg1[5], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_KART_AI); + spawn_player(gPlayerEight, 7, arg0[6], arg1[6], arg2, 32768.0f, gCharacterSelections[0], PLAYER_START_SEQUENCE | PLAYER_KART_AI); if (gDemoMode == 1) { - spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], PLAYER_HUMAN_AND_CPU); + spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0], PLAYER_HUMAN_AND_KART_AI); } 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_CPU); + spawn_player(gPlayerTwo, 1, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[1], PLAYER_HUMAN_AND_KART_AI); } else { spawn_player(gPlayerTwo, 1, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[1], PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN); } @@ -652,10 +652,10 @@ void spawn_players_2p_battle(f32 *arg0, f32 *arg1, f32 arg2) { } spawn_player(gPlayerThree, 2, arg0[2], arg1[2], arg2, 32768.0f, gCharacterSelections[2], 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_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); + 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); D_80164A28 = 0; func_80039AE4(); } @@ -665,16 +665,16 @@ void func_8003B318(f32 *arg0, f32 *arg1, f32 arg2) { spawn_player(gPlayerTwo, 1, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[1], PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN); 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_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(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, 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); + 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); D_80164A28 = 0; func_80039AE4(); } @@ -689,11 +689,11 @@ void spawn_players_3p_battle(f32 *arg0, f32 *arg1, f32 arg2) { spawn_player(gPlayerTwo, 1, arg0[1], arg1[1], arg2, 0.0f, gCharacterSelections[1], PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN); 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_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); + 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); D_80164A28 = 0; func_80039AE4(); } @@ -704,15 +704,15 @@ void func_8003B870(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); 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_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(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(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); + 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); D_80164A28 = 0; func_80039AE4(); } @@ -729,22 +729,22 @@ void spawn_players_4p_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, 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_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); + 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); 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_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerTwo, 1, -3691.506f, -6.822f, -6.95f, 36400.0f, gCharacterIdByGPOverallRank[1], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerThree, 2, -3475.028f, -998.485f, -8.059f, 45500.0f, gCharacterIdByGPOverallRank[2], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); + spawn_player(gPlayerOne, 0, -2770.774f, -345.187f, -34.6f, 0.0f, gCharacterIdByGPOverallRank[0], PLAYER_EXISTS | PLAYER_KART_AI | 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); + spawn_player(gPlayerThree, 2, -3475.028f, -998.485f, -8.059f, 45500.0f, gCharacterIdByGPOverallRank[2], PLAYER_EXISTS | PLAYER_KART_AI | 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_CPU | PLAYER_START_SEQUENCE); + spawn_player(gPlayerFour, 3, -3025.772f, 110.039f, -23.224f, 28210.0f, D_802874D8.unk1E, PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); } else { - spawn_player(gPlayerFour, 3, -3025.772f, 110.039f, -23.224f, 28210.0f, gCharacterIdByGPOverallRank[3], PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); + spawn_player(gPlayerFour, 3, -3025.772f, 110.039f, -23.224f, 28210.0f, gCharacterIdByGPOverallRank[3], PLAYER_EXISTS | PLAYER_KART_AI | 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); @@ -1048,13 +1048,13 @@ void func_8003C0F0(void) { D_80165230[6] = 150.0f; D_80165230[7] = 170.0f; 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_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerThree, 2, D_80165210[2], D_80165230[2], sp5A, 32768.0f, 2, PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerFour, 3, D_80165210[3], D_80165230[3], sp5A, 32768.0f, 3, PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerFive, 4, D_80165210[4], D_80165230[4], sp5A, 32768.0f, 4, PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerSix, 5, D_80165210[5], D_80165230[5], sp5A, 32768.0f, 5, PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerSeven, 6, D_80165210[6], D_80165230[6], sp5A, 32768.0f, 6, PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); - spawn_player(gPlayerEight, 7, D_80165210[7], D_80165230[7], sp5A, 32768.0f, 7, PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE); + spawn_player(gPlayerTwo, 1, D_80165210[1], D_80165230[1], sp5A, 32768.0f, 1, PLAYER_EXISTS | PLAYER_KART_AI | 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); + spawn_player(gPlayerFour, 3, D_80165210[3], D_80165230[3], sp5A, 32768.0f, 3, PLAYER_EXISTS | PLAYER_KART_AI | 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); + spawn_player(gPlayerSix, 5, D_80165210[5], D_80165230[5], sp5A, 32768.0f, 5, PLAYER_EXISTS | PLAYER_KART_AI | 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); + spawn_player(gPlayerEight, 7, D_80165210[7], D_80165230[7], sp5A, 32768.0f, 7, PLAYER_EXISTS | PLAYER_KART_AI | PLAYER_START_SEQUENCE); D_80164A28 = 0; break; } diff --git a/src/spawn_players.h b/src/spawn_players.h index d7cae3ad3..504e2b057 100644 --- a/src/spawn_players.h +++ b/src/spawn_players.h @@ -50,7 +50,7 @@ extern s32 gFrameSinceLastBCombo[]; extern s32 gCountBChangement[]; extern s32 gIsPlayerTripleBButtonCombo[]; extern s32 gTimerBoostTripleBCombo[]; -extern s16 chooseCPUPlayers[]; +extern s16 chooseKartAIPlayers[]; extern s16 D_8016556E; extern s16 D_80165570; extern s16 D_80165572; diff --git a/src/staff_ghosts.c b/src/staff_ghosts.c index 8fe043e87..ff52c60b3 100644 --- a/src/staff_ghosts.c +++ b/src/staff_ghosts.c @@ -238,7 +238,7 @@ void func_8000546C(void) { s16 phi_v0 = 0; if (D_80162DB0 >= 0x1000) { - gPlayerOne->type = PLAYER_CINEMATIC_MODE | PLAYER_START_SEQUENCE | PLAYER_CPU; + gPlayerOne->type = PLAYER_CINEMATIC_MODE | PLAYER_START_SEQUENCE | PLAYER_KART_AI; return; } @@ -469,7 +469,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_CPU; + ply->type = PLAYER_CINEMATIC_MODE | PLAYER_START_SEQUENCE | PLAYER_KART_AI; } } diff --git a/src/update_objects.c b/src/update_objects.c index d11747c04..3fc0503f4 100644 --- a/src/update_objects.c +++ b/src/update_objects.c @@ -190,7 +190,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_CPU)) == 0)) { + ((gPlayerOne->type & (PLAYER_INVISIBLE_OR_BOMB | PLAYER_KART_AI)) == 0)) { D_80162DF8 = 1; } } @@ -3638,7 +3638,7 @@ u8 gen_random_item(s16 rank, s16 isCpu) curve = segmented_to_virtual((void *) common_grand_prix_human_item_curve); } else { - curve = segmented_to_virtual((void *) common_grand_prix_cpu_item_curve); + curve = segmented_to_virtual((void *) common_grand_prix_kart_ai_item_curve); } randomItem = *((rank * 100) + curve + sRandomItemIndex); } @@ -3649,7 +3649,7 @@ u8 gen_random_item_human(UNUSED s16 arg0, s16 rank) { return gen_random_item(rank, FALSE); } -u8 gen_random_item_cpu(UNUSED s32 arg0, s16 rank) { +u8 kart_ai_gen_random_item(UNUSED s32 arg0, s16 rank) { return gen_random_item(rank, TRUE); } @@ -5469,7 +5469,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_CPU)) { + if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_KART_AI)) { if (func_8007F75C(var_s0) != 0) break; } } diff --git a/src/update_objects.h b/src/update_objects.h index 890029484..11d317917 100644 --- a/src/update_objects.h +++ b/src/update_objects.h @@ -202,7 +202,7 @@ void func_8007ABFC(s32, s32); void consume_item(s32); u8 gen_random_item(s16, s16); u8 gen_random_item_human(s16, s16); -u8 gen_random_item_cpu(s32, s16); +u8 kart_ai_gen_random_item(s32, s16); s16 func_8007AFB0(s32, s32); s32 func_8007B040(s32, s32); void func_8007B254(s32, s32); |
