Mario Kart 64
Loading...
Searching...
No Matches
actor_utils.inc.c
Go to the documentation of this file.
2 s32 i;
3 s32 a2 = 0;
4
5 for (i = 0; i < NUM_PLAYERS; i++) {
6
7 if (gUnexpiredActorsList[i].unkC == 0) {
9 gUnexpiredActorsList[i].actorIndex = actorIndex;
12 a2 = 1;
13 break;
14 }
15 }
16 if (a2 == 0) {
17 return -2;
18 }
19 return 0;
20}
21
23 struct Actor* actor = &gActorList[actorIndex];
24 if (actor->type != ACTOR_RED_SHELL) {
25 return -1;
26 }
27 return add_actor_in_unexpired_actor_list(actorIndex, 0);
28}
29
31 struct Actor* actor = &gActorList[actorIndex];
32 if (actor->type != ACTOR_GREEN_SHELL) {
33 return -1;
34 }
35 return add_actor_in_unexpired_actor_list(actorIndex, 1);
36}
37
39 struct Actor* actor = &gActorList[arg0];
40 if (actor->type != ACTOR_BLUE_SPINY_SHELL) {
41 return -1;
42 }
44}
45
47 struct unexpiredActors* phi;
48 s32 i;
49
50 for (i = 0; i < NUM_PLAYERS; i++) {
51 phi = &gUnexpiredActorsList[i];
52 if (actorIndex == phi->actorIndex) {
53 phi->unkC = 0;
54 phi->actorIndex = 1000; // out of bounds
55 }
56 }
57}
58
59void func_8000EEDC(void) {
60 struct unexpiredActors* phi;
61 s32 i;
62
63 for (i = 0; i < NUM_PLAYERS; i++) {
64 phi = &gUnexpiredActorsList[i];
65 phi->unkC = 0;
66 phi->actorIndex = 1000; // out of bounds
67 }
68}
69
71 s32 someIndex;
72 f32 var_f20;
73 struct Actor* temp_s1;
74 struct unexpiredActors* var_s0;
75
76 for (someIndex = 0; someIndex < NUM_PLAYERS; someIndex++) {
77 var_s0 = &gUnexpiredActorsList[someIndex];
78 if (var_s0->unkC == 1) {
79 temp_s1 = &gActorList[var_s0->actorIndex];
80 var_s0->unk14++;
81 switch (var_s0->unk10) {
82 case 0:
83 if (var_s0->unk14 < 0xA) {
84 var_f20 = 0.3f;
85 } else {
86 var_f20 = 0.9f;
87 }
88 break;
89 case 1:
90 if (var_s0->unk14 < 0xA) {
91 var_f20 = 0.15f;
92 } else {
93 var_f20 = 0.45f;
94 }
95 break;
96 case 2:
97 if (var_s0->unk14 < 0xA) {
98 var_f20 = 0.15f;
99 } else {
100 var_f20 = 0.45f;
101 }
102 break;
103 default:
104 var_f20 = 1.0f;
105 break;
106 }
107 if (!(var_s0->unk14 & 1)) {
108 init_smoke_particle(temp_s1->pos, ((random_int(30) + 20) * var_f20) / 50.0f, var_s0->unk10);
109 }
110 }
111 }
112}
@ ACTOR_BLUE_SPINY_SHELL
Definition actor_types.h:80
@ ACTOR_RED_SHELL
Definition actor_types.h:46
@ ACTOR_GREEN_SHELL
Definition actor_types.h:45
void func_8000EEDC(void)
Definition actor_utils.inc.c:59
s32 add_red_shell_in_unexpired_actor_list(s32 actorIndex)
Definition actor_utils.inc.c:22
void generate_player_smoke(void)
Definition actor_utils.inc.c:70
s32 add_green_shell_in_unexpired_actor_list(s32 actorIndex)
Definition actor_utils.inc.c:30
s32 add_blue_shell_in_unexpired_actor_list(s32 arg0)
Definition actor_utils.inc.c:38
s32 add_actor_in_unexpired_actor_list(s32 actorIndex, s16 arg1)
Definition actor_utils.inc.c:1
void delete_actor_in_unexpired_actor_list(s32 actorIndex)
Definition actor_utils.inc.c:46
struct Actor gActorList[ACTOR_LIST_SIZE]
Definition code_800029B0.c:150
struct unexpiredActors gUnexpiredActorsList[8]
Definition cpu_vehicles_camera_path.c:151
#define NUM_PLAYERS
Definition defines.h:104
u16 random_int(u16 arg0)
Definition math_util.c:1064
Definition actor_types.h:120
s16 type
Definition actor_types.h:121
Vec3f pos
Definition actor_types.h:129
Definition cpu_vehicles_camera_path.h:9
u16 actorIndex
Definition cpu_vehicles_camera_path.h:14
u16 unkC
Definition cpu_vehicles_camera_path.h:13
s16 unk10
Definition cpu_vehicles_camera_path.h:15
u32 unk14
Definition cpu_vehicles_camera_path.h:17
signed int s32
Definition ultratypes.h:15
signed short int s16
Definition ultratypes.h:13
float f32
Definition ultratypes.h:34
void init_smoke_particle(Vec3f arg0, UNUSED f32 arg1, s16 arg2)
Definition update_objects.c:2191