Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
Merlar.inc.c
Go to the documentation of this file.
1#include "Merlar.h"
2
3API_CALLABLE(N(AddMerlarHoverMotion)) {
4 Npc* npc;
5
6 if (isInitialCall) {
7 script->functionTempF[1] = 0.0f;
8 script->functionTempPtr[2] = get_npc_safe(script->owner2.npcID);
9 }
10 npc = script->functionTempPtr[2];
11 npc->verticalRenderOffset = sin_deg(script->functionTempF[1]) * 5.0f;
12 script->functionTempF[1] = clamp_angle(script->functionTempF[1] + 4.5f);
13 return ApiStatus_BLOCK;
14}
15
16EvtScript N(EVS_NpcAuxAI_Merlar) = {
17 Return
18 End
19};
20
21NpcSettings N(NpcSettings_Merlar) = {
22 .height = 60,
23 .radius = 60,
24 .level = ACTOR_LEVEL_NONE,
25 .otherAI = &N(EVS_NpcAuxAI_Merlar),
26};
27
28EvtScript N(EVS_NpcAux_Merlar) = {
29 Return
30 End
31};
32
33EvtScript N(EVS_NpcIdle_Merlar) = {
34 Call(N(AddMerlarHoverMotion))
35 Return
36 End
37};
Bytecode EvtScript[]
#define sin_deg
#define clamp_angle
#define ApiStatus_BLOCK
Definition evt.h:116
Npc * get_npc_safe(s32 npcID)
Definition npc.c:1010
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define Return
Kills the current EVT thread.
Definition macros.h:217
s8 verticalRenderOffset