Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
MontyMole_StoneThrower.inc.c
Go to the documentation of this file.
1#include "MontyMole.h"
2
4
6
8
9EvtScript N(EVS_NpcDefeat_MontyMole_Stone) = {
13 Call(SetSelfVar, 0, 5)
22 Return
23 End
24};
25
26MobileAISettings N(AISettings_MontyMole_StoneThrower) = {
27 .moveSpeed = 1.7f,
28 .moveTime = 90,
29 .alertRadius = 110.0f,
30 .playerSearchInterval = 2,
31 .chaseSpeed = 7.5f,
32 .chaseRadius = 110.0f,
33 .unk_AI_2C = 1,
34};
35
36EvtScript N(EVS_NpcAI_MontyMole_StoneThrower) = {
39 Label(0)
40 Call(RandInt, 15, LVar0)
41 Add(LVar0, 15)
42 Wait(LVar0)
43 Call(N(MontyMoleAI_Main), Ref(N(AISettings_MontyMole_StoneThrower)))
44 Return
45 End
46};
47
48NpcSettings N(NpcSettings_MontyMole_StoneThrower) = {
49 .height = 20,
50 .radius = 24,
51 .level = ACTOR_LEVEL_MONTY_MOLE,
52 .ai = &N(EVS_NpcAI_MontyMole_StoneThrower),
53 .onHit = &EnemyNpcHit,
54 .onDefeat = &EnemyNpcDefeat,
55 .actionFlags = AI_ACTION_08,
56};
57
58MobileAISettings N(AISettings_MontyMole_Stone) = {
59 .moveSpeed = 8.3f,
60 .alertRadius = 2.5f,
61 .alertOffsetDist = 0.4f,
62 .playerSearchInterval = -1,
63};
64
65EvtScript N(EVS_NpcAI_MontyMole_Stone) = {
66 Call(SetSelfVar, 0, 0)
67 Call(SetSelfVar, 1, 0)
68 Call(SetSelfVar, 2, 17)
69 Call(SetSelfVar, 3, 17)
70 Call(N(ProjectileAI_Main), Ref(N(AISettings_MontyMole_Stone)))
71 Return
72 End
73};
74
75EvtScript N(EVS_NpcHit_MontyMole_Stone_DoNothing) = {
76 Return
77 End
78};
79
80EvtScript N(EVS_NpcHit_MontyMole_Stone) = {
81 Call(N(GetEncounterEnemyIsOwner))
82 IfEq(LVar0, 0)
83 Return
84 EndIf
85 Call(BindNpcAI, NPC_SELF, Ref(N(EVS_NpcHit_MontyMole_Stone_DoNothing)))
91 Call(SetSelfVar, 0, 3)
92 Call(N(ProjectileAI_Reflect))
93 IfEq(LVar0, 0)
94 Return
95 EndIf
98 Call(SetSelfVar, 0, 4)
100 PlayEffect(EFFECT_WALKING_DUST, 2, LVar0, LVar1, LVar2, 0, 0)
102 Call(SetSelfVar, 0, 0)
108 Call(BindNpcAI, NPC_SELF, Ref(N(EVS_NpcAI_MontyMole_Stone)))
109 Return
110 End
111};
112
113NpcSettings N(NpcSettings_MontyMole_Stone) = {
114 .height = 12,
115 .radius = 12,
116 .ai = &N(EVS_NpcAI_MontyMole_Stone),
117 .onHit = &N(EVS_NpcHit_MontyMole_Stone),
118 .onDefeat = &N(EVS_NpcDefeat_MontyMole_Stone),
119 .actionFlags = AI_ACTION_08,
120};
121
122#define MONTY_MOLE_STONE_HITBOX(npcID) \
123{ \
124 .id = npcID, \
125 .settings = &N(NpcSettings_MontyMole_Stone), \
126 .pos = { NPC_DISPOSE_LOCATION }, \
127 .yaw = 90, \
128 .flags = ENEMY_FLAG_IGNORE_ENTITY_COLLISION | ENEMY_FLAG_FLYING | ENEMY_FLAG_NO_DROPS, \
129 .drops = NO_DROPS, \
130 .territory = { \
131 .wander = { \
132 .isFlying = TRUE, \
133 .moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED, \
134 .wanderShape = SHAPE_CYLINDER, \
135 .centerPos = { NPC_DISPOSE_LOCATION }, \
136 .wanderSize = { 0 }, \
137 .detectShape = SHAPE_CYLINDER, \
138 .detectPos = { 0, 0, 0 }, \
139 .detectSize = { 0 }, \
140 } \
141 }, \
142 .animations = { \
143 .idle = ANIM_MontyMole_Anim0F, \
144 .walk = ANIM_MontyMole_Anim0F, \
145 .run = ANIM_MontyMole_Anim0F, \
146 .chase = ANIM_MontyMole_Anim0F, \
147 .anim_4 = ANIM_MontyMole_Anim0F, \
148 .anim_5 = ANIM_MontyMole_Anim0F, \
149 .death = ANIM_MontyMole_Anim0F, \
150 .hit = ANIM_MontyMole_Anim0F, \
151 .anim_8 = ANIM_MontyMole_Anim0F, \
152 .anim_9 = ANIM_MontyMole_Anim0F, \
153 .anim_A = ANIM_MontyMole_Anim0F, \
154 .anim_B = ANIM_MontyMole_Anim0F, \
155 .anim_C = ANIM_MontyMole_Anim0F, \
156 .anim_D = ANIM_MontyMole_Anim0F, \
157 .anim_E = ANIM_MontyMole_Anim0F, \
158 .anim_F = ANIM_MontyMole_Anim0F, \
159 }, \
160}
Bytecode EvtScript[]
@ ENCOUNTER_TRIGGER_JUMP
Definition enums.h:269
@ ENCOUNTER_TRIGGER_HAMMER
Definition enums.h:271
@ ENCOUNTER_TRIGGER_SPIN
Definition enums.h:270
@ ENEMY_FLAG_FLED
Definition enums.h:4525
@ NPC_SELF
Definition enums.h:2526
@ OUTCOME_ENEMY_FLED
Definition enums.h:1905
@ OUTCOME_PLAYER_WON
Definition enums.h:1902
@ OUTCOME_PLAYER_FLED
Definition enums.h:1904
@ AI_ACTION_08
Definition enums.h:4615
@ NPC_FLAG_IGNORE_PLAYER_COLLISION
Definition enums.h:3006
@ NPC_FLAG_FLIP_INSTANTLY
Definition enums.h:3019
@ NPC_FLAG_INVISIBLE
Definition enums.h:2999
s16 height
Definition npc.h:145
f32 moveSpeed
Definition npc.h:93
ApiStatus EnableNpcShadow(Evt *script, b32 isInitialCall)
ApiStatus GetNpcPos(Evt *script, b32 isInitialCall)
EvtScript EnemyNpcDefeat
Definition encounter.c:158
ApiStatus SetEnemyFlagBits(Evt *script, b32 isInitialCall)
ApiStatus BindNpcAI(Evt *script, b32 isInitialCall)
EvtScript EnemyNpcHit
Definition encounter.c:131
ApiStatus RemoveNpc(Evt *script, b32 isInitialCall)
ApiStatus SetNpcPos(Evt *script, b32 isInitialCall)
ApiStatus GetOwnerEncounterTrigger(Evt *script, b32 isInitialCall)
ApiStatus RandInt(Evt *script, b32 isInitialCall)
ApiStatus OnPlayerFled(Evt *script, b32 isInitialCall)
ApiStatus SetBattleAsScripted(Evt *script, b32 isInitialCall)
ApiStatus SetSelfVar(Evt *script, b32 isInitialCall)
ApiStatus SetNpcFlagBits(Evt *script, b32 isInitialCall)
ApiStatus GetBattleOutcome(Evt *script, b32 isInitialCall)
#define Switch(LVAR)
Marks the start of a switch statement.
Definition macros.h:311
#define Ref(sym)
Address/pointer constant.
Definition macros.h:60
#define CaseEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR. It also marks the end of any pre...
Definition macros.h:319
#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 EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
Definition macros.h:352
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:227
#define CaseOrEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR.
Definition macros.h:341
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define CaseDefault
Marks the start of a switch case that executes unconditionally. It also marks the end of any previous...
Definition macros.h:337
#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 PlayEffect(args...)
Definition macros.h:807
#define EndSwitch
Marks the end of a switch statement and any case.
Definition macros.h:362
#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 LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217