3#include "sprite/player.h"
8#define EVT_EXIT_PIPE_HORIZONTAL(entry, collider, script) \
10 SetGroup(EVT_GROUP_EXIT_MAP) \
12 Set(LVarB, collider) \
13 Set(LVarC, Ref(script)) \
14 ExecWait(N(EVS_Pipe_ExitHorizontal)) \
19#define EVT_EXIT_PIPE_VERTICAL(entry, collider, script) \
21 SetGroup(EVT_GROUP_EXIT_MAP) \
23 Set(LVarB, collider) \
24 Set(LVarC, Ref(script)) \
25 ExecWait(N(EVS_Pipe_ExitVertical)) \
30#define EVT_ENTER_PIPE_HORIZONTAL(collider, bindExitsScript) \
31 Set(LVarA, Ref(bindExitsScript)) \
32 Set(LVarB, collider) \
33 Exec(N(EVS_Pipe_EnterHorizontal))
35#define EVT_ENTER_PIPE_VERTICAL(bindExitsScript) \
36 Set(LVarA, Ref(bindExitsScript)) \
37 Exec(N(EVS_Pipe_EnterVertical))
42API_CALLABLE(N(Pipe_SetAnimFlag)) {
47API_CALLABLE(N(Pipe_GetCurrentFloor)) {
52API_CALLABLE(N(Pipe_AwaitDownInput)) {
56 if (collisionStatus->
curFloor != script->varTable[11]) {
57 script->varTable[0] = FALSE;
64 if (stickX != 0 || stickY != 0) {
65 if (
atan2(0.0f, 0.0f, stickX, stickY) < 60.0f) {
66 script->varTable[0] = TRUE;
74API_CALLABLE(N(Pipe_GetEntryPos)) {
86API_CALLABLE(N(Pipe_GetCameraYaw)) {
91API_CALLABLE(N(Pipe_GetPointAheadOfPlayer)) {
94 f32 x = playerStatus->
pos.
x;
95 f32 y = playerStatus->
pos.
y;
96 f32 z = playerStatus->
pos.
z;
109extern EvtScript N(EVS_Pipe_ExitVertical_Impl);
123 Call(N(Pipe_GetEntryPos))
157 Call(N(Pipe_GetCurrentFloor))
173 Call(N(Pipe_GetEntryPos))
205 Call(N(Pipe_GetPointAheadOfPlayer),
Float(1.0))
231 Call(N(Pipe_AwaitDownInput))
247 ExecWait(N(EVS_Pipe_ExitVertical_Impl))
252EvtScript N(EVS_Pipe_ExitVertical_Impl) = {
253 Call(N(Pipe_SetAnimFlag))
258 Call(N(Pipe_GetEntryPos))
261 Call(N(Pipe_GetEntryPos))
264 Call(N(Pipe_GetCameraYaw))
308 Call(N(Pipe_SetAnimFlag))
312 Call(N(Pipe_GetEntryPos))
337 Call(N(Pipe_GetPointAheadOfPlayer),
Float(1.0))
@ IMGFX_ANIM_VERTICAL_PIPE_CURL
@ IMGFX_ANIM_HORIZONTAL_PIPE_CURL
@ COLLIDER_FLAGS_UPPER_MASK
@ MODIFY_COLLIDER_FLAGS_SET_BITS
@ IMGFX_FLAG_REVERSE_ANIM
s32 evt_get_variable(Evt *script, Bytecode var)
f32 evt_set_float_variable(Evt *script, Bytecode var, f32 value)
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
f32 evt_get_float_variable(Evt *script, Bytecode var)
void add_vec2D_polar(f32 *x, f32 *y, f32 r, f32 theta)
ApiStatus GetPartnerInUse(Evt *script, b32 isInitialCall)
ApiStatus SetPlayerImgFXFlags(Evt *script, b32 isInitialCall)
ApiStatus PlaySound(Evt *script, b32 isInitialCall)
ApiStatus SetPlayerPos(Evt *script, b32 isInitialCall)
Sets the player position.
ApiStatus GetEntryID(Evt *script, b32 isInitialCall)
Returns the entryID of the Entry that the player entered the map from.
ApiStatus DisablePartnerAI(Evt *script, b32 isInitialCall)
ApiStatus IsPlayerOnValidFloor(Evt *script, b32 isInitialCall)
ApiStatus SetPlayerAnimation(Evt *script, b32 isInitialCall)
ApiStatus UpdatePlayerImgFX(Evt *script, b32 isInitialCall)
ApiStatus PanToTarget(Evt *script, b32 isInitialCall)
ApiStatus DisablePlayerInput(Evt *script, b32 isInitialCall)
Disables player and partner input, and disables the status menu.
ApiStatus HidePlayerShadow(Evt *script, b32 isInitialCall)
Hides the player's shadow if hide is TRUE, shows it if FALSE.
ApiStatus EnableNpcShadow(Evt *script, b32 isInitialCall)
ApiStatus GetCurrentPartnerID(Evt *script, b32 isInitialCall)
ApiStatus GetPlayerActionState(Evt *script, b32 isInitialCall)
ApiStatus EnablePartnerAI(Evt *script, b32 isInitialCall)
ApiStatus InterpNpcYaw(Evt *script, b32 isInitialCall)
ApiStatus SetNpcPos(Evt *script, b32 isInitialCall)
ApiStatus PlayerMoveTo(Evt *script, b32 isInitialCall)
ApiStatus DisablePlayerPhysics(Evt *script, b32 isInitialCall)
Disables player physics if disable is TRUE, enables it if FALSE.
ApiStatus SetNpcFlagBits(Evt *script, b32 isInitialCall)
ApiStatus InterpPlayerYaw(Evt *script, b32 isInitialCall)
ApiStatus SetPlayerFlagBits(Evt *script, b32 isInitialCall)
ApiStatus InterruptUsePartner(Evt *script, b32 isInitialCall)
ApiStatus GetPlayerPos(Evt *script, b32 isInitialCall)
ApiStatus UseSettingsFrom(Evt *script, b32 isInitialCall)
ApiStatus SetPanTarget(Evt *script, b32 isInitialCall)
ApiStatus SetCamSpeed(Evt *script, b32 isInitialCall)
ApiStatus ModifyColliderFlags(Evt *script, b32 isInitialCall)
Set flags for collider + siblings + children.
#define Else
Marks the end of an if statement and the start of the else block.
#define IfGe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR >= RVAR.
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
#define Sub(VAR, INT_VALUE)
#define IfNe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR != RVAR.
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
#define Add(VAR, INT_VALUE)
#define EndLoop
Marks the end of a loop.
#define Goto(LABEL_ID)
Moves execution to the given label.
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
#define EndIf
Marks the end of an if statement or an else block.
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
#define Thread
Marks the start of a thread block.
#define EndThread
Marks the end of a thread block.
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
#define SetGroup(GROUP)
Sets the current thread's group. Group value meanings are currently not known.
#define NPC_DISPOSE_LOCATION
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
#define Loop(TIMES)
Marks the beginning of a loop.
#define Exec(EVT_SOURCE)
Launches a new thread.
#define Return
Kills the current EVT thread.
MapSettings * get_current_map_settings(void)
Fields other than main, entryList, entryCount, background, and tattle are initialised when the map lo...
PlayerStatus * gPlayerStatusPtr
CollisionStatus gCollisionStatus
GameStatus * gGameStatusPtr
PlayerStatus gPlayerStatus