Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
HammerBros_Wander.inc.c
Go to the documentation of this file.
1#include "HammerBros.h"
2
4
6
7EvtScript N(EVS_NpcDefeat_HammerBros_Hammer) = {
11 Call(SetSelfVar, 0, 5)
20 Return
21 End
22};
23
24MobileAISettings N(AISettings_HammerBros) = {
25 .moveSpeed = 1.5f,
26 .moveTime = 30,
27 .waitTime = 30,
28 .alertRadius = 120.0f,
29 .alertOffsetDist = 20.0f,
30 .playerSearchInterval = 5,
31 .chaseSpeed = 3.0f,
32 .chaseTurnRate = 90,
33 .chaseUpdateInterval = 3,
34 .chaseRadius = 140.0f,
35 .chaseOffsetDist = 20.0f,
36};
37
38EvtScript N(EVS_NpcAI_HammerBros) = {
39 Call(SetSelfVar, 0, 70)
40 Call(SetSelfVar, 1, 3)
41 Call(SetSelfVar, 2, 3)
42 Call(SetSelfVar, 3, 6)
43 Call(N(RangedAttackAI_Main), Ref(N(AISettings_HammerBros)))
44 Return
45 End
46};
47
48NpcSettings N(NpcSettings_HammerBros_Wander) = {
49 .height = 36,
50 .radius = 24,
51 .level = ACTOR_LEVEL_HAMMER_BROS,
52 .ai = &N(EVS_NpcAI_HammerBros),
53 .onHit = &EnemyNpcHit,
54 .onDefeat = &EnemyNpcDefeat,
55};
56
57MobileAISettings N(AISettings_HammerBros_Hammer) = {
58 .moveSpeed = 5.4f,
59 .alertRadius = 13.0f,
60 .alertOffsetDist = 1.4f,
61 .playerSearchInterval = -1,
62};
63
64EvtScript N(EVS_NpcAI_HammerBros_Hammer) = {
65 Call(SetSelfVar, 0, 0)
66 Call(SetSelfVar, 1, 3)
67 Call(SetSelfVar, 2, 20)
68 Call(N(ProjectileAI_Main), Ref(N(AISettings_HammerBros_Hammer)))
69 Return
70 End
71};
72
73EvtScript N(EVS_NoAI_HammerBros_Hammer) = {
74 Return
75 End
76};
77
78EvtScript N(EVS_NpcHit_HammerBros_Hammer) = {
79 Call(N(GetEncounterEnemyIsOwner))
80 IfEq(LVar0, 0)
81 Return
82 EndIf
83 Call(BindNpcAI, NPC_SELF, Ref(N(EVS_NoAI_HammerBros_Hammer)))
88 Call(SetSelfVar, 0, 3)
89 Call(N(ProjectileAI_Reflect))
90 IfEq(LVar0, 0)
91 Return
92 EndIf
96 Call(SetSelfVar, 0, 4)
98 PlayEffect(EFFECT_WALKING_DUST, 2, LVar0, LVar1, LVar2, 0, 0)
100 Call(SetSelfVar, 0, 0)
106 Call(BindNpcAI, NPC_SELF, Ref(N(EVS_NpcAI_HammerBros_Hammer)))
107 Return
108 End
109};
110
111NpcSettings N(NpcSettings_HammerBros_Hammer) = {
112 .height = 12,
113 .radius = 12,
114 .ai = &N(EVS_NpcAI_HammerBros_Hammer),
115 .onHit = &N(EVS_NpcHit_HammerBros_Hammer),
116 .onDefeat = &N(EVS_NpcDefeat_HammerBros_Hammer),
117 .actionFlags = AI_ACTION_08,
118};
119
120AnimID N(ExtraAnims_HammerBros_Hammer)[] = {
121 ANIM_HammerBros_Anim0D,
123};
Bytecode EvtScript[]
u32 AnimID
@ ENCOUNTER_TRIGGER_JUMP
Definition enums.h:269
@ ENCOUNTER_TRIGGER_HAMMER
Definition enums.h:271
@ ENCOUNTER_TRIGGER_PARTNER
Definition enums.h:273
@ 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
s16 height
Definition npc.h:145
f32 moveSpeed
Definition npc.h:93
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 OnPlayerFled(Evt *script, b32 isInitialCall)
ApiStatus SetBattleAsScripted(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 EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
Definition macros.h:352
#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 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
#define ANIM_LIST_END
Terminates an extraAnimationList.
Definition types.h:22