Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
MBush.inc.c
Go to the documentation of this file.
1#include "MBush.h"
2#include "sprite/player.h"
3
4EvtScript N(EVS_NpcAI_MBush) = {
6 Call(SetNpcAnimation, NPC_SELF, ANIM_MBush_Anim00)
7 Call(SetSelfVar, 0, 0)
8 Label(0)
10 IfEq(LVar0, 0)
11 Wait(1)
12 Goto(0)
13 EndIf
22 Add(LVar0, 2)
24 Wait(1)
25 Sub(LVar0, 3)
27 Wait(1)
28 Add(LVar0, 2)
30 Wait(1)
31 Sub(LVar0, 3)
33 Wait(1)
34 Add(LVar0, 2)
36 Wait(1)
37 Thread
38 Wait(10)
39 Call(SetNpcAnimation, NPC_SELF, ANIM_MBush_Anim03)
41 Thread
42 Wait(6)
43 Call(InterpPlayerYaw, 90, 0)
48 Add(LVar0, 25)
49 Sub(LVar2, 5)
51 Wait(4)
52 Call(SetNpcAnimation, NPC_SELF, ANIM_MBush_Anim07)
53 Wait(2)
54 Call(SetPlayerAnimation, ANIM_Mario1_Flail)
58}; // fallthrough :(
59
60EvtScript N(EVS_NpcInteract_MBush) = {
61 Call(SetSelfVar, 0, 1)
62 Return
63 End
64};
65
66EvtScript N(EVS_NpcDefeat_MBush) = {
72 Call(SetNpcAnimation, NPC_SELF, ANIM_MBush_Anim05)
78 Call(SetNpcAnimation, NPC_SELF, ANIM_MBush_Anim00)
80 Call(BindNpcAI, NPC_SELF, Ref(N(EVS_NpcAI_MBush)))
85 Return
86 End
87};
88
89NpcSettings N(NpcSettings_MBush) = {
90 .height = 30,
91 .radius = 30,
92 .level = ACTOR_LEVEL_M_BUSH,
93 .onInteract = &N(EVS_NpcInteract_MBush),
94 .ai = &N(EVS_NpcAI_MBush),
95 .onDefeat = &N(EVS_NpcDefeat_MBush),
96};
97
98#define MBUSH_FLAGS \
99 BASE_PASSIVE_FLAGS | ENEMY_FLAG_USE_INSPECT_ICON | ENEMY_FLAG_DO_NOT_AUTO_FACE_PLAYER
Bytecode EvtScript[]
@ ENEMY_FLAG_FLED
Definition enums.h:4525
@ NPC_SELF
Definition enums.h:2526
@ TIME_FREEZE_PARTIAL
Definition enums.h:3465
@ TIME_FREEZE_NONE
Definition enums.h:3464
@ SOUND_SEARCH_BUSH
Definition enums.h:773
@ OUTCOME_ENEMY_FLED
Definition enums.h:1905
@ OUTCOME_PLAYER_WON
Definition enums.h:1902
@ OUTCOME_PLAYER_FLED
Definition enums.h:1904
@ SOUND_SPACE_DEFAULT
Definition enums.h:1737
@ NPC_FLAG_IGNORE_PLAYER_COLLISION
Definition enums.h:3006
@ EVT_GROUP_NEVER_PAUSE
Definition evt.h:142
s16 height
Definition npc.h:145
ApiStatus PlaySoundAtNpc(Evt *script, b32 isInitialCall)
ApiStatus SetTimeFreezeMode(Evt *script, b32 isInitialCall)
ApiStatus StartBattle(Evt *script, b32 isInitialCall)
ApiStatus SetPlayerAnimation(Evt *script, b32 isInitialCall)
ApiStatus DisablePlayerInput(Evt *script, b32 isInitialCall)
Disables player and partner input, and disables the status menu.
ApiStatus EnableNpcShadow(Evt *script, b32 isInitialCall)
ApiStatus GetNpcPos(Evt *script, b32 isInitialCall)
ApiStatus SetNpcAnimation(Evt *script, b32 isInitialCall)
ApiStatus SetEnemyFlagBits(Evt *script, b32 isInitialCall)
ApiStatus BindNpcAI(Evt *script, b32 isInitialCall)
ApiStatus RemoveNpc(Evt *script, b32 isInitialCall)
ApiStatus NpcJump1(Evt *script, b32 isInitialCall)
ApiStatus DoNpcDefeat(Evt *script, b32 isInitialCall)
ApiStatus SetNpcPos(Evt *script, b32 isInitialCall)
ApiStatus SetSelfVar(Evt *script, b32 isInitialCall)
ApiStatus SetNpcFlagBits(Evt *script, b32 isInitialCall)
ApiStatus InterpPlayerYaw(Evt *script, b32 isInitialCall)
ApiStatus GetPlayerPos(Evt *script, b32 isInitialCall)
ApiStatus GetBattleOutcome(Evt *script, b32 isInitialCall)
ApiStatus GetSelfVar(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 Sub(VAR, INT_VALUE)
Definition macros.h:377
#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 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 Thread
Marks the start of a thread block.
Definition macros.h:544
#define EndThread
Marks the end of a thread block.
Definition macros.h:547
#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 SetGroup(GROUP)
Sets the current thread's group. Group value meanings are currently not known.
Definition macros.h:519
#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