Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
HurtPlant.inc.c
Go to the documentation of this file.
1#include "HurtPlant.h"
2#include "sprite/player.h"
3
4EvtScript N(EVS_NpcAI_HurtPlant) = {
6 Call(SetNpcAnimation, NPC_SELF, ANIM_HurtPlant_Anim01)
7 Call(SetSelfVar, 0, 0)
8 Label(0)
10 IfEq(LVar0, 0)
11 Wait(1)
12 Goto(0)
13 EndIf
18 Call(SetNpcAnimation, NPC_SELF, ANIM_HurtPlant_Anim08)
19 Wait(15)
21 Wait(10)
22 Call(SetPlayerAnimation, ANIM_Mario1_Flail)
23 Wait(5)
24 Call(SetNpcAnimation, NPC_SELF, ANIM_HurtPlant_Anim02)
28 Return
29 End
30};
31
32EvtScript N(EVS_NpcInteract_HurtPlant) = {
33 Call(SetSelfVar, 0, 1)
34 Return
35 End
36};
37
38EvtScript N(EVS_NpcDefeat_HurtPlant) = {
44 Call(BindNpcAI, NPC_SELF, Ref(N(EVS_NpcAI_HurtPlant)))
49 Return
50 End
51};
52
53NpcSettings N(NpcSettings_HurtPlant) = {
54 .height = 20,
55 .radius = 28,
56 .level = ACTOR_LEVEL_HURT_PLANT,
57 .onInteract = &N(EVS_NpcInteract_HurtPlant),
58 .ai = &N(EVS_NpcAI_HurtPlant),
59 .onDefeat = &N(EVS_NpcDefeat_HurtPlant),
60};
61
62AnimID N(ExtraAnims_HurtPlant)[] = {
63 ANIM_HurtPlant_Anim00,
64 ANIM_HurtPlant_Anim01,
65 ANIM_HurtPlant_Anim02,
66 ANIM_HurtPlant_Anim08,
68};
69
70#define HURT_PLANT_FLAGS \
71 BASE_PASSIVE_FLAGS | ENEMY_FLAG_USE_INSPECT_ICON | ENEMY_FLAG_DO_NOT_AUTO_FACE_PLAYER
Bytecode EvtScript[]
u32 AnimID
@ 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_HURT_PLANT_SHRIEK
Definition enums.h:1446
@ 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
@ EVT_GROUP_NEVER_PAUSE
Definition evt.h:142
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 SetNpcAnimation(Evt *script, b32 isInitialCall)
ApiStatus SetEnemyFlagBits(Evt *script, b32 isInitialCall)
ApiStatus BindNpcAI(Evt *script, b32 isInitialCall)
ApiStatus RemoveNpc(Evt *script, b32 isInitialCall)
ApiStatus DoNpcDefeat(Evt *script, b32 isInitialCall)
ApiStatus NpcFacePlayer(Evt *script, b32 isInitialCall)
ApiStatus SetSelfVar(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 End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#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 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
#define ANIM_LIST_END
Terminates an extraAnimationList.
Definition types.h:22