Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
FlyingMagikoopa.inc.c
Go to the documentation of this file.
1#include "FlyingMagikoopa.h"
2
4
5MobileAISettings N(AISettings_FlyingMagikoopa) = {
6 .moveSpeed = 1.5f,
7 .moveTime = 60,
8 .waitTime = 30,
9 .alertRadius = 100.0f,
10 .alertOffsetDist = 20.0f,
11 .playerSearchInterval = 3,
12 .chaseSpeed = 5.0f,
13 .chaseTurnRate = 60,
14 .chaseUpdateInterval = 10,
15 .chaseRadius = 150.0f,
16 .chaseOffsetDist = 20.0f,
17 .unk_AI_2C = 1,
18};
19
20EvtScript N(EVS_NpcAI_FlyingMagikoopa) = {
21 Call(N(FlyingMagikoopaAI_Main), Ref(N(AISettings_FlyingMagikoopa)))
22 Return
23 End
24};
25
26EvtScript N(EVS_NpcDefeat_FlyingMagikoopa) = {
37 Return
38 End
39};
40
41NpcSettings N(NpcSettings_FlyingMagikoopa) = {
42 .height = 33,
43 .radius = 32,
44 .level = ACTOR_LEVEL_FLYING_MAGIKOOPA,
45 .ai = &N(EVS_NpcAI_FlyingMagikoopa),
46 .onHit = &EnemyNpcHit,
47 .onDefeat = &N(EVS_NpcDefeat_FlyingMagikoopa),
48};
49
50AnimID N(ExtraAnims_FlyingMagikoopa)[] = {
51 ANIM_FlyingMagikoopa_Anim00,
52 ANIM_FlyingMagikoopa_Anim01,
53 ANIM_FlyingMagikoopa_Anim01,
54 ANIM_FlyingMagikoopa_Anim01,
55 ANIM_FlyingMagikoopa_Anim02,
56 ANIM_FlyingMagikoopa_Anim03,
57 ANIM_FlyingMagikoopa_Anim04,
59};
60
61EvtScript N(EVS_NpcAuxAI_FlyingMagikoopa_AltHitbox) = {
62 Call(SetSelfVar, 1, 10)
63 Call(SetSelfVar, 2, 40)
64 Return
65 End
66};
67
68EvtScript N(EVS_NpcAuxAI_FlyingMagikoopa_Hitbox) = {
69 Call(SetSelfVar, 1, 0)
70 Call(SetSelfVar, 2, 55)
71 Return
72 End
73};
74
75EvtScript N(EVS_NpcAI_FlyingMagikoopa_Hitbox) = {
76 Call(N(MagikoopaAI_SpellMain))
77 Return
78 End
79};
80
81EvtScript N(EVS_NpcHit_FlyingMagikoopa_Hitbox) = {
82 Call(N(FlyingMagikoopaAI_OnHitInit))
83 IfEq(LVar0, 0)
84 Return
85 EndIf
86 Call(N(FlyingMagikoopaAI_OnHit))
88 Return
89 End
90};
91
92EvtScript N(EVS_NpcDefeat_FlyingMagikoopa_Hitbox) = {
104 Return
105 End
106};
107
108NpcSettings N(NpcSettings_FlyingMagikoopa_AltHitbox) = {
109 .defaultAnim = ANIM_Magikoopa_Anim00,
110 .otherAI = &N(EVS_NpcAuxAI_FlyingMagikoopa_AltHitbox),
111 .ai = &N(EVS_NpcAI_FlyingMagikoopa_Hitbox),
112 .onHit = &N(EVS_NpcHit_FlyingMagikoopa_Hitbox),
113 .onDefeat = &N(EVS_NpcDefeat_FlyingMagikoopa_Hitbox),
114};
115
116NpcSettings N(NpcSettings_FlyingMagikoopa_Hitbox) = {
117 .defaultAnim = ANIM_FlyingMagikoopa_Anim00,
118 .otherAI = &N(EVS_NpcAuxAI_FlyingMagikoopa_Hitbox),
119 .ai = &N(EVS_NpcAI_FlyingMagikoopa_Hitbox),
120 .onHit = &N(EVS_NpcHit_FlyingMagikoopa_Hitbox),
121 .onDefeat = &N(EVS_NpcDefeat_FlyingMagikoopa_Hitbox),
122};
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
s16 height
Definition npc.h:145
AnimID defaultAnim
Definition npc.h:144
ApiStatus SetEnemyFlagBits(Evt *script, b32 isInitialCall)
EvtScript EnemyNpcHit
Definition encounter.c:131
ApiStatus RemoveNpc(Evt *script, b32 isInitialCall)
ApiStatus DoNpcDefeat(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 EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#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 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 Exec(EVT_SOURCE)
Launches a new thread.
Definition macros.h:455
#define Return
Kills the current EVT thread.
Definition macros.h:217
#define ANIM_LIST_END
Terminates an extraAnimationList.
Definition types.h:22