Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
DryBones.inc.c
Go to the documentation of this file.
1#include "DryBones.h"
2
5
6EvtScript N(EVS_NpcDefeat_ThrownBone) = {
10 Call(SetSelfVar, 0, 5)
19 Return
20 End
21};
22
23MobileAISettings N(AISettings_DryBones) = {
24 .moveSpeed = 2.0f,
25 .moveTime = 20,
26 .waitTime = 3,
27 .alertRadius = 120.0f,
28 .alertOffsetDist = 120.0f,
29 .playerSearchInterval = 2,
30 .chaseSpeed = 1.0f,
31 .chaseRadius = 150.0f,
32 .chaseOffsetDist = 150.0f,
33 .unk_AI_2C = 1,
34};
35
36EvtScript N(EVS_NpcAI_DryBones) = {
37 Call(SetSelfVar, 0, 0)
38 Call(SetSelfVar, 1, 15)
39 Call(SetSelfVar, 2, 10)
40 Call(SetSelfVar, 3, 2)
41 Call(N(RangedAttackAI_Main), Ref(N(AISettings_DryBones)))
42 Return
43 End
44};
45
46NpcSettings N(NpcSettings_DryBones) = {
47 .height = 32,
48 .radius = 24,
49 .level = ACTOR_LEVEL_DRY_BONES,
50 .ai = &N(EVS_NpcAI_DryBones),
51 .onHit = &EnemyNpcHit,
52 .onDefeat = &EnemyNpcDefeat,
53};
54
55MobileAISettings N(AISettings_ThrownBone) = {
56 .moveSpeed = 7.5f,
57 .alertRadius = 1.1f,
58 .alertOffsetDist = 0.18f,
59 .playerSearchInterval = -1,
60};
61
62EvtScript N(EVS_NpcAI_ThrownBone) = {
63 Call(SetSelfVar, 0, 0)
64 Call(SetSelfVar, 1, 3)
65 Call(SetSelfVar, 2, 15)
66 Call(SetSelfVar, 3, 15)
67 Call(N(ProjectileAI_Main), Ref(N(AISettings_ThrownBone)))
68 Return
69 End
70};
71
72EvtScript N(EVS_NoAI_ThrownBone) = {
73 Return
74 End
75};
76
77EvtScript N(EVS_NpcHit_ThrownBone) = {
78 Call(N(GetEncounterEnemyIsOwner))
79 IfEq(LVar0, 0)
80 Return
81 EndIf
82 Call(BindNpcAI, NPC_SELF, Ref(N(EVS_NoAI_ThrownBone)))
87 Call(SetSelfVar, 0, 3)
88 Call(N(ProjectileAI_Reflect))
89 IfEq(LVar0, 0)
90 Return
91 EndIf
95 Call(SetSelfVar, 0, 4)
97 PlayEffect(EFFECT_WALKING_DUST, 2, LVar0, LVar1, LVar2, 0, 0)
99 Call(SetSelfVar, 0, 0)
105 Call(BindNpcAI, NPC_SELF, Ref(N(EVS_NpcAI_ThrownBone)))
106 Return
107 End
108};
109
110NpcSettings N(NpcSettings_ThrownBone) = {
111 .height = 12,
112 .radius = 12,
113 .ai = &N(EVS_NpcAI_ThrownBone),
114 .onHit = &N(EVS_NpcHit_ThrownBone),
115 .onDefeat = &N(EVS_NpcDefeat_ThrownBone),
116 .actionFlags = AI_ACTION_08,
117};
Bytecode EvtScript[]
@ 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