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
3API_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}
ActorState state
Vec3f curPos
#define ApiStatus_DONE2
Definition evt.h:118
#define ApiStatus_BLOCK
Definition evt.h:116
void add_xz_vec3f(Vec3f *vector, f32 speed, f32 angleDeg)
Definition 190B20.c:1139
Actor * get_actor(s32 actorID)
Definition actor_api.c:155
void play_movement_dust_effects(s32 var0, f32 xPos, f32 yPos, f32 zPos, f32 angleDeg)
Definition 190B20.c:1166