Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
ActorJumpToPos.inc.c
Go to the documentation of this file.
1#include "common.h"
2
3API_CALLABLE(N(ActorJumpToPos)) {
4 Actor* actor = get_actor(script->owner1.actorID);
5 Vec3f* temp_f0 = &actor->state.curPos;
6
7 if (isInitialCall) {
8 script->functionTemp[0] = 0;
9 }
10 if (script->functionTemp[0] == 0) {
11 actor->state.curPos.x = actor->curPos.x;
12 actor->state.curPos.y = actor->curPos.y;
13 actor->state.curPos.z = actor->curPos.z;
14 script->functionTemp[0] = 1;
15 }
16
17 if (actor->state.vel > 0.0f) {
19 }
20 if (actor->state.vel < 0.0f) {
22 }
23
24 actor->state.curPos.y += actor->state.vel;
25 actor->state.vel = actor->state.vel - actor->state.acceleration;
26 add_xz_vec3f(temp_f0, actor->state.speed, actor->state.angle);
27 actor->curPos.x = actor->state.curPos.x;
28 actor->curPos.y = actor->state.curPos.y;
29 actor->curPos.z = actor->state.curPos.z;
30
31 if (actor->curPos.y < 0.0f) {
32 actor->curPos.y = 0.0f;
33 play_movement_dust_effects(2, actor->curPos.x, actor->curPos.y, actor->curPos.z, actor->yaw);
35 return ApiStatus_DONE1;
36 }
37
38 return ApiStatus_BLOCK;
39}
ActorState state
Vec3f curPos
@ SOUND_LAND_SOFTLY
Definition enums.h:765
@ ACTOR_SELF
Definition enums.h:2084
#define ApiStatus_DONE1
Definition evt.h:117
#define ApiStatus_BLOCK
Definition evt.h:116
void add_xz_vec3f(Vec3f *vector, f32 speed, f32 angleDeg)
Definition 190B20.c:1139
void set_actor_anim(s32 actorID, s32 partID, AnimID animID)
Definition 190B20.c:1005
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
void sfx_play_sound(s32 soundID)
Definition sfx.c:517