Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
SpearGuy_Wander.inc.c
Go to the documentation of this file.
1#include "SpearGuy.h"
2
4
5AnimID N(ExtraAnims_SpearGuy)[] = {
6 ANIM_SpearGuy_Anim00,
7 ANIM_SpearGuy_Anim03,
8 ANIM_SpearGuy_Anim05,
9 ANIM_SpearGuy_Anim06,
10 ANIM_SpearGuy_Anim07,
11 ANIM_SpearGuy_Anim0F,
12 ANIM_SpearGuy_Anim10,
13 ANIM_SpearGuy_Anim1A,
14 ANIM_SpearGuy_Anim1B,
16};
17
18AnimID N(ExtraAnims_SpearGuy_Hitbox)[] = {
19 ANIM_SpearGuy_Anim00,
21};
22
23EvtScript N(EVS_NpcDefeat_SpearGuy_Hitbox) = {
35 Return
36 End
37};
38
39MobileAISettings N(AISettings_SpearGuy_Wander) = {
40 .moveSpeed = 1.7f,
41 .moveTime = 100,
42 .waitTime = 1,
43 .alertRadius = 100.0f,
44 .alertOffsetDist = 30.0f,
45 .playerSearchInterval = 1,
46 .chaseSpeed = 3.5f,
47 .chaseTurnRate = 20,
48 .chaseUpdateInterval = 1,
49 .chaseRadius = 120.0f,
50 .unk_AI_2C = 1,
51};
52
53EvtScript N(EVS_NpcAI_SpearGuy_Wander) = {
54 Call(SetSelfVar, 0, 0)
55 Call(SetSelfVar, 1, 5)
56 Call(SetSelfVar, 2, 12)
57 Call(SetSelfVar, 3, 9)
58 Call(N(SpearGuyAI_Main), Ref(N(AISettings_SpearGuy_Wander)))
59 Return
60 End
61};
62
63NpcSettings N(NpcSettings_SpearGuy_Wander) = {
64 .height = 23,
65 .radius = 22,
66 .level = ACTOR_LEVEL_SPEAR_GUY,
67 .ai = &N(EVS_NpcAI_SpearGuy_Wander),
68 .onHit = &EnemyNpcHit,
69 .onDefeat = &EnemyNpcDefeat,
70};
71
72EvtScript N(EVS_NpcAI_SpearGuy_Hitbox) = {
74 Call(SetSelfVar, 0, 4)
75 Call(SetSelfVar, 1, 22)
76 Call(SetSelfVar, 2, 40)
77 Call(SetSelfVar, 3, 28)
78 Call(SetSelfVar, 4, 1)
79 Call(SetSelfVar, 15, 0)
80 Call(N(MeleeHitbox_Main))
81 Return
82 End
83};
84
85NpcSettings N(NpcSettings_SpearGuy_Hitbox) = {
86 .height = 8,
87 .radius = 20,
88 .level = ACTOR_LEVEL_SPEAR_GUY,
89 .ai = &N(EVS_NpcAI_SpearGuy_Hitbox),
90 .onDefeat = &N(EVS_NpcDefeat_SpearGuy_Hitbox),
91 .actionFlags = AI_ACTION_08,
92};
Bytecode EvtScript[]
u32 AnimID
@ 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
s16 height
Definition npc.h:145
f32 moveSpeed
Definition npc.h:93
ApiStatus EnableNpcShadow(Evt *script, b32 isInitialCall)
EvtScript EnemyNpcDefeat
Definition encounter.c:158
ApiStatus SetEnemyFlagBits(Evt *script, b32 isInitialCall)
EvtScript EnemyNpcHit
Definition encounter.c:131
ApiStatus RemoveNpc(Evt *script, b32 isInitialCall)
ApiStatus SetNpcPos(Evt *script, b32 isInitialCall)
ApiStatus OnPlayerFled(Evt *script, b32 isInitialCall)
ApiStatus SetSelfVar(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 NPC_DISPOSE_LOCATION
Definition macros.h:158
#define EndSwitch
Marks the end of a switch statement and any case.
Definition macros.h:362
#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