Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
MontyMole_GroundAmbush.inc.c
Go to the documentation of this file.
1#include "MontyMole.h"
2
3EvtScript N(EVS_NpcAuxAI_MontyMole_GroundAmbush) = {
8 Sub(LVar1, 30)
10 Return
11 End
12};
13
14EvtScript N(EVS_NpcAuxAI_MontyMole_GroundAmbush_Hole) = {
17 Sub(LVar1, 30)
19 Call(SetNpcAnimation, NPC_SELF, ANIM_MontyMole_Anim12)
20 Return
21 End
22};
23
24MobileAISettings N(AISettings_MontyMole_GroundAmbush) = {
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_GroundAmbush) = {
41 IfEq(LVar0, 100)
43 Label(10)
46 IfNe(LVar3, 1)
47 Wait(1)
48 Goto(10)
49 EndIf
51 Add(LVar0, 1)
53 Add(LVar2, 30)
55 Wait(1)
58 Call(SetNpcAnimation, NPC_SELF, ANIM_MontyMole_Anim0E)
60 Add(LVar5, 30)
68 Call(BasicAI_Main, Ref(N(AISettings_MontyMole_GroundAmbush)))
69 Return
70 End
71};
72
73NpcSettings N(NpcSettings_MontyMole_GroundAmbush) = {
74 .height = 24,
75 .radius = 22,
76 .level = ACTOR_LEVEL_MONTY_MOLE,
77 .otherAI = &N(EVS_NpcAuxAI_MontyMole_GroundAmbush),
78 .ai = &N(EVS_NpcAI_MontyMole_GroundAmbush),
79 .onHit = &EnemyNpcHit,
80 .onDefeat = &EnemyNpcDefeat,
81 .actionFlags = AI_ACTION_JUMP_WHEN_SEE_PLAYER,
82};
83
84NpcSettings N(NpcSettings_MontyMole_GroundAmbush_Hole) = {
85 .height = 24,
86 .radius = 22,
87 .level = ACTOR_LEVEL_MONTY_MOLE,
88 .otherAI = &N(EVS_NpcAuxAI_MontyMole_GroundAmbush_Hole),
89 .actionFlags = AI_ACTION_JUMP_WHEN_SEE_PLAYER,
90};
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_INACTIVE
Definition enums.h:3000
@ NPC_FLAG_GRAVITY
Definition enums.h:3007
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 LVar6
Definition macros.h:154
#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 LVar5
Definition macros.h:153
#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 NPC_DISPOSE_LOCATION
Definition macros.h:158
#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 LVar4
Definition macros.h:152
#define LVar3
Definition macros.h:151
#define LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217