Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
MontyMole_WallAmbush.inc.c
Go to the documentation of this file.
1#include "MontyMole.h"
2
3EvtScript N(EVS_NpcAuxAI_MontyMole_WallAmbush) = {
7 Sub(LVar2, 50)
10 End
11};
12
13EvtScript N(EVS_NpcAuxAI_MontyMole_WallAmbush_Hole) = {
17 Sub(LVar2, 50)
19 Call(SetNpcAnimation, NPC_SELF, ANIM_MontyMole_Anim13)
20 Return
21 End
22};
23
24MobileAISettings N(AISettings_MontyMole_WallAmbush) = {
25 .moveSpeed = 1.8f,
26 .moveTime = 30,
27 .waitTime = 30,
28 .alertRadius = 90.0f,
29 .alertOffsetDist = 70.0f,
30 .playerSearchInterval = 2,
31 .chaseSpeed = 3.0f,
32 .chaseTurnRate = 90,
33 .chaseUpdateInterval = 25,
34 .chaseRadius = 120.0f,
35 .chaseOffsetDist = 70.0f,
36 .unk_AI_2C = 1,
37};
38
39EvtScript N(EVS_NpcAI_MontyMole_WallAmbush) = {
41 IfEq(LVar0, 100)
43 Label(10)
45 Add(LVar2, 130)
47 IfNe(LVar3, 1)
48 Wait(1)
49 Goto(10)
50 EndIf
52 Add(LVar0, 1)
54 Add(LVar2, 30)
55 Add(LVar3, 50)
57 Wait(1)
61 Call(SetNpcAnimation, NPC_SELF, ANIM_MontyMole_Anim0E)
63 Sub(LVar2, 30)
64 Add(LVar3, 80)
72 EndIf
73 Call(BasicAI_Main, Ref(N(AISettings_MontyMole_WallAmbush)))
74 Return
75 End
76};
77
78NpcSettings N(NpcSettings_MontyMole_WallAmbush) = {
79 .height = 24,
80 .radius = 22,
81 .level = ACTOR_LEVEL_MONTY_MOLE,
82 .otherAI = &N(EVS_NpcAuxAI_MontyMole_WallAmbush),
83 .ai = &N(EVS_NpcAI_MontyMole_WallAmbush),
84 .onHit = &EnemyNpcHit,
85 .onDefeat = &EnemyNpcDefeat,
86 .actionFlags = AI_ACTION_JUMP_WHEN_SEE_PLAYER,
87};
88
89NpcSettings N(NpcSettings_MontyMole_WallAmbush_Hole) = {
90 .height = 24,
91 .radius = 22,
92 .level = ACTOR_LEVEL_MONTY_MOLE,
93 .otherAI = &N(EVS_NpcAuxAI_MontyMole_WallAmbush_Hole),
94 .actionFlags = AI_ACTION_JUMP_WHEN_SEE_PLAYER,
95};
Bytecode EvtScript[]
@ ENEMY_FLAG_DISABLE_AI
Definition enums.h:4526
@ ENEMY_FLAG_BEGIN_WITH_CHASING
Definition enums.h:4551
@ NPC_SELF
Definition enums.h:2526
@ SOUND_MOLE_POP
Definition enums.h:1119
@ AI_ACTION_JUMP_WHEN_SEE_PLAYER
Definition enums.h:4612
@ SOUND_SPACE_DEFAULT
Definition enums.h:1737
@ NPC_FLAG_IGNORE_WORLD_COLLISION
Definition enums.h:3004
@ NPC_FLAG_INACTIVE
Definition enums.h:3000
@ NPC_FLAG_IGNORE_CAMERA_FOR_YAW
Definition enums.h:3016
s16 height
Definition npc.h:145
f32 moveSpeed
Definition npc.h:93
ApiStatus PlaySoundAtNpc(Evt *script, b32 isInitialCall)
ApiStatus EnableNpcShadow(Evt *script, b32 isInitialCall)
ApiStatus GetNpcPos(Evt *script, b32 isInitialCall)
ApiStatus SetNpcAnimation(Evt *script, b32 isInitialCall)
EvtScript EnemyNpcDefeat
Definition encounter.c:158
ApiStatus SetSelfEnemyFlagBits(Evt *script, b32 isInitialCall)
EvtScript EnemyNpcHit
Definition encounter.c:131
ApiStatus SetNpcPos(Evt *script, b32 isInitialCall)
ApiStatus NpcJump0(Evt *script, b32 isInitialCall)
ApiStatus NpcFacePlayer(Evt *script, b32 isInitialCall)
ApiStatus SetNpcJumpscale(Evt *script, b32 isInitialCall)
ApiStatus IsPlayerWithin(Evt *script, b32 isInitialCall)
ApiStatus GetSelfNpcID(Evt *script, b32 isInitialCall)
ApiStatus SetNpcFlagBits(Evt *script, b32 isInitialCall)
ApiStatus func_800445D4(Evt *script, b32 isInitialCall)
#define Ref(sym)
Address/pointer constant.
Definition macros.h:60
#define Sub(VAR, INT_VALUE)
Definition macros.h:377
#define IfNe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR != RVAR.
Definition macros.h:272
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Add(VAR, INT_VALUE)
Definition macros.h:376
#define Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define Float(DOUBLE)
Definition macros.h:51
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:227
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define LVar2
Definition macros.h:150
#define LVar1
Definition macros.h:149
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:269
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define LVar3
Definition macros.h:151
#define LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217