Paper Mario DX
Paper Mario (N64) modding
Loading...
Searching...
No Matches
UnkAngleFunc005.inc.c
Go to the documentation of this file.
1
#include "common.h"
2
#include "
npc.h
"
3
4
API_CALLABLE(N(
UnkAngleFunc005
)) {
5
Npc
* npc =
get_npc_safe
(
script
->owner2.npcID);
6
7
switch
(
script
->functionTemp[1]) {
8
case
0:
9
npc->
duration
=
rand_int
(180) + 30;
10
npc->
pos
.
z
= -430.0f;
11
npc->
pos
.
y
=
rand_int
(50) + 40.0f;
12
npc->
moveSpeed
= (2.0f *
rand_float
()) + 2.0f;
13
if
(
rand_int
(100) < 50) {
14
npc->
pos
.
x
= 270.0f;
15
npc->
yaw
= 270.0f;
16
}
else
{
17
npc->
pos
.
x
= -270.0f;
18
npc->
yaw
= 90.0f;
19
}
20
script
->functionTemp[1] = 1;
21
break
;
22
case
1:
23
npc->
duration
--;
24
if
(npc->
duration
== 0) {
25
script
->functionTemp[1] = 2;
26
}
27
break
;
28
case
2:
29
npc_move_heading
(npc, npc->
moveSpeed
, npc->
yaw
);
30
if
(npc->
pos
.
x
< -280.0f || npc->
pos
.
x
> 280.0f) {
31
script
->functionTemp[1] = 0;
32
}
33
break
;
34
}
35
return
ApiStatus_DONE2
;
36
}
PopupMenu_SelectedIndex
BSS s32 PopupMenu_SelectedIndex
Definition
8a860_len_3f30.c:84
Vec3f::z
f32 z
Definition
common_structs.h:103
Vec3f::x
f32 x
Definition
common_structs.h:101
Vec3f::y
f32 y
Definition
common_structs.h:102
rand_int
#define rand_int
Definition
effect_shims.h:53
ApiStatus_DONE2
#define ApiStatus_DONE2
Definition
evt.h:118
rand_float
f32 rand_float(void)
Definition
43F0.c:503
npc.h
npc_move_heading
void npc_move_heading(Npc *npc, f32 speed, f32 yaw)
Definition
npc.c:985
get_npc_safe
Npc * get_npc_safe(s32 npcID)
Definition
npc.c:1009
Npc
Definition
common_structs.h:214
Npc::yaw
f32 yaw
Definition
common_structs.h:218
Npc::pos
Vec3f pos
Definition
common_structs.h:237
Npc::moveSpeed
f32 moveSpeed
Definition
common_structs.h:221
Npc::duration
s16 duration
Definition
common_structs.h:251
src
world
common
todo
UnkAngleFunc005.inc.c
Generated by
1.10.0