Paper Mario DX
Paper Mario (N64) modding
Loading...
Searching...
No Matches
UnkActorPosFunc.inc.c
Go to the documentation of this file.
1
#include "
battle/battle.h
"
2
3
API_CALLABLE(N(UnkActorPosFunc)) {
4
Actor
* actor =
get_actor
(script->owner1.actorID);
5
ActorState
* actorState = &actor->
state
;
6
7
if
(isInitialCall) {
8
actor->
state
.
curPos
.
x
= actor->
curPos
.
x
;
9
actor->
state
.
curPos
.
y
= actor->
curPos
.
y
;
10
actor->
state
.
curPos
.
z
= actor->
curPos
.
z
;
11
}
12
13
add_xz_vec3f
(&actorState->
curPos
, actor->
state
.
speed
, actor->
state
.
angle
);
14
if
(actor->
state
.
speed
< 4.0f) {
15
play_movement_dust_effects
(0, actor->
state
.
curPos
.
x
, actor->
state
.
curPos
.
y
, actor->
state
.
curPos
.
z
, actor->
state
.
angle
);
16
}
else
{
17
play_movement_dust_effects
(1, actor->
state
.
curPos
.
x
, actor->
state
.
curPos
.
y
, actor->
state
.
curPos
.
z
, actor->
state
.
angle
);
18
}
19
20
actorState->
speed
/= 1.5;
21
actor->
curPos
.
x
= actorState->
curPos
.
x
;
22
actor->
curPos
.
y
= actorState->
curPos
.
y
;
23
actor->
curPos
.
z
= actorState->
curPos
.
z
;
24
25
if
(actorState->
speed
< 1.0) {
26
return
ApiStatus_DONE2
;
27
}
28
return
ApiStatus_BLOCK
;
29
}
Actor::state
ActorState state
Definition
common_structs.h:1858
Vec3f::z
f32 z
Definition
common_structs.h:102
Actor::curPos
Vec3f curPos
Definition
common_structs.h:1866
ActorState::speed
f32 speed
Definition
common_structs.h:1829
ActorState::curPos
Vec3f curPos
Definition
common_structs.h:1821
Vec3f::x
f32 x
Definition
common_structs.h:100
Vec3f::y
f32 y
Definition
common_structs.h:101
ActorState::angle
f32 angle
Definition
common_structs.h:1831
Actor
Definition
common_structs.h:1854
ActorState
Definition
common_structs.h:1820
ApiStatus_DONE2
#define ApiStatus_DONE2
Definition
evt.h:118
ApiStatus_BLOCK
#define ApiStatus_BLOCK
Definition
evt.h:116
add_xz_vec3f
void add_xz_vec3f(Vec3f *vector, f32 speed, f32 angleDeg)
Definition
190B20.c:1139
get_actor
Actor * get_actor(s32 actorID)
Definition
actor_api.c:155
play_movement_dust_effects
void play_movement_dust_effects(s32 var0, f32 xPos, f32 yPos, f32 zPos, f32 angleDeg)
Definition
190B20.c:1166
battle.h
src
common
UnkActorPosFunc.inc.c
Generated by
1.10.0