Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
ghost_parakarry.inc.c
Go to the documentation of this file.
1#include "battle/battle.h"
2#include "script_api/battle.h"
3#include "sprite/npc/BattleParakarry.h"
4
5#define NAMESPACE A(parakarry_clone)
6
7extern EvtScript N(EVS_Init);
8extern EvtScript N(EVS_Idle);
9extern EvtScript N(EVS_TakeTurn);
10extern EvtScript N(EVS_HandleEvent);
11
12s32 N(DefaultAnims)[] = {
23};
24
25s32 N(DefenseTable)[] = {
28};
29
30s32 N(StatusTable)[] = {
53};
54
55ActorPartBlueprint N(ActorParts)[] = {
56 {
58 .index = PRT_MAIN,
59 .posOffset = { 0, 0, 0 },
60 .targetOffset = { -3, 32 },
61 .opacity = 255,
62 .idleAnimations = N(DefaultAnims),
63 .defenseTable = N(DefenseTable),
64 .eventFlags = 0,
65 .elementImmunityFlags = 0,
66 .projectileTargetOffset = { 0, -16 },
67 },
68 {
70 .index = PRT_TARGET,
71 .posOffset = { 0, 50, 0 },
72 .targetOffset = { -3, -18 },
73 .opacity = 255,
74 .idleAnimations = NULL,
75 .defenseTable = N(DefenseTable),
76 .eventFlags = 0,
77 .elementImmunityFlags = 0,
78 .projectileTargetOffset = { 0, -16 },
79 },
80};
81
82ActorBlueprint NAMESPACE = {
83 .flags = ACTOR_FLAG_FLYING,
86 .maxHP = 15,
87 .partCount = ARRAY_COUNT(N(ActorParts)),
88 .partsData = N(ActorParts),
89 .initScript = &N(EVS_Init),
90 .statusTable = N(StatusTable),
91 .escapeChance = 50,
92 .airLiftChance = 80,
93 .hurricaneChance = 70,
94 .spookChance = 50,
95 .upAndAwayChance = 95,
96 .spinSmashReq = 0,
97 .powerBounceChance = 90,
98 .coinReward = 2,
99 .size = { 38, 38 },
100 .healthBarOffset = { 0, 0 },
101 .statusIconOffset = { -10, 20 },
102 .statusTextOffset = { 10, 20 },
103};
104
105EvtScript N(EVS_Init) = {
106 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn)))
107 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
108 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
109 Return
110 End
111};
112
113EvtScript N(EVS_Idle) = {
114 Return
115 End
116};
117
118EvtScript N(EVS_HandleEvent) = {
127 SetConst(LVar0, PRT_MAIN)
130 Return
131 Else
132 SetConst(LVar0, PRT_MAIN)
135 EndIf
138 SetConst(LVar0, PRT_MAIN)
143 SetConst(LVar0, PRT_MAIN)
148 Wait(10)
149 SetConst(LVar0, PRT_MAIN)
152 Return
154 SetConst(LVar0, PRT_MAIN)
159 SetConst(LVar0, PRT_MAIN)
162 SetConst(LVar0, PRT_MAIN)
165 Return
167 SetConst(LVar0, PRT_MAIN)
170 Return
173 SetConst(LVar0, PRT_MAIN)
175 Set(LVar2, 22)
177 SetConst(LVar0, PRT_MAIN)
180 Return
184 SetConst(LVar0, PRT_MAIN)
190 SetConst(LVar0, PRT_MAIN)
193 Wait(10)
194 SetConst(LVar0, PRT_MAIN)
197 Return
199 SetConst(LVar0, PRT_MAIN)
203 SetConst(LVar0, PRT_MAIN)
207 Return
209 SetConst(LVar0, PRT_MAIN)
217 Else
219 EndIf
220 EndIf
221 SetConst(LVar0, PRT_MAIN)
224 Return
229 Return
230 End
231};
232
242 Call(AddGoalPos, ACTOR_SELF, 20, 0, 0)
246 Wait(3)
251 Call(AddGoalPos, ACTOR_SELF, 0, 10, 0)
253 Wait(2)
254 Thread
255 Wait(3)
258 Call(AddGoalPos, ACTOR_SELF, 40, 15, 0)
269 Set(LVarA, LVar0)
270 Thread
271 Wait(5)
275 Call(AddGoalPos, ACTOR_SELF, -40, 10, 0)
279 EndIf
280 Wait(20)
282 Wait(15)
291 Return
296 Wait(1)
300 Wait(2)
301#if VERSION_JP
303#else
305#endif
307 Wait(2)
310 Wait(2)
320 Call(AddGoalPos, ACTOR_SELF, 50, 0, 0)
323 Thread
324 Wait(4)
327 Call(AddGoalPos, ACTOR_SELF, 30, 0, 0)
330 Wait(6)
340 Return
341 End
342};
343
344EvtScript N(EVS_TakeTurn) = {
346 Return
347 End
348};
349
BSS s32 PopupMenu_SelectedIndex
Bytecode EvtScript[]
#define STATUS_FLAGS_IMMOBILIZED
Definition enums.h:2868
@ BTL_CAM_XADJ_AVG
Definition enums.h:4485
@ ACTOR_SOUND_FLY
Definition enums.h:2068
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3608
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3604
@ ELEMENT_END
Definition enums.h:2147
@ ELEMENT_NORMAL
Definition enums.h:2148
@ STATUS_KEY_PARALYZE
Definition enums.h:2806
@ STATUS_TURN_MOD_DEFAULT
Definition enums.h:2832
@ STATUS_TURN_MOD_PARALYZE
Definition enums.h:2839
@ STATUS_KEY_FROZEN
Definition enums.h:2808
@ STATUS_TURN_MOD_SLEEP
Definition enums.h:2833
@ STATUS_TURN_MOD_DIZZY
Definition enums.h:2837
@ STATUS_TURN_MOD_UNUSED
Definition enums.h:2836
@ STATUS_KEY_STATIC
Definition enums.h:2812
@ STATUS_END
Definition enums.h:2801
@ STATUS_TURN_MOD_POISON
Definition enums.h:2838
@ STATUS_TURN_MOD_STOP
Definition enums.h:2842
@ STATUS_KEY_SLEEP
Definition enums.h:2807
@ STATUS_KEY_UNUSED
Definition enums.h:2804
@ STATUS_KEY_STONE
Definition enums.h:2813
@ STATUS_KEY_STOP
Definition enums.h:2809
@ STATUS_TURN_MOD_FROZEN
Definition enums.h:2835
@ STATUS_KEY_SHRINK
Definition enums.h:2811
@ STATUS_KEY_DIZZY
Definition enums.h:2805
@ STATUS_KEY_POISON
Definition enums.h:2810
@ STATUS_TURN_MOD_STATIC
Definition enums.h:2834
@ STATUS_KEY_NORMAL
Definition enums.h:2802
@ STATUS_TURN_MOD_SHRINK
Definition enums.h:2840
@ STATUS_KEY_DEFAULT
Definition enums.h:2803
@ HIT_RESULT_NO_DAMAGE
Definition enums.h:1978
@ HIT_RESULT_HIT
Definition enums.h:1976
@ HIT_RESULT_LUCKY
Definition enums.h:1981
@ HIT_RESULT_MISS
Definition enums.h:1982
@ BTL_CAM_DEFAULT
Definition enums.h:4409
@ BTL_CAM_INTERRUPT
Definition enums.h:4408
@ BTL_CAM_ENEMY_APPROACH
Definition enums.h:4470
@ EASING_COS_IN_OUT
Definition enums.h:520
@ EASING_QUARTIC_OUT
Definition enums.h:516
@ EASING_QUADRATIC_OUT
Definition enums.h:514
@ EASING_LINEAR
Definition enums.h:510
@ IDLE_SCRIPT_ENABLE
Definition enums.h:5999
@ IDLE_SCRIPT_DISABLE
Definition enums.h:5998
@ PARTNER_RANK_NORMAL
Definition enums.h:2051
@ PARTNER_RANK_SUPER
Definition enums.h:2052
@ PARTNER_RANK_ULTRA
Definition enums.h:2053
@ STATUS_FLAG_SHRINK
Definition enums.h:2853
@ SOUND_PARAKARRY_PREDIVE
Definition enums.h:1318
@ SOUND_NONE
Definition enums.h:550
@ SOUND_PARAKARRY_DIVE
Definition enums.h:1319
@ ACTOR_PLAYER
Definition enums.h:2118
@ ACTOR_SELF
Definition enums.h:2117
@ ACTOR_FLAG_FLYING
Quake Hammer can't hit.
Definition enums.h:3363
@ BTL_CAM_YADJ_TARGET
Definition enums.h:4490
@ ACTOR_BLUR_ENABLE
Definition enums.h:6005
@ ACTOR_BLUR_DISABLE
Definition enums.h:6004
@ EVENT_HIT
Definition enums.h:2165
@ EVENT_SCARE_AWAY
Definition enums.h:2207
@ EVENT_BURN_HIT
Definition enums.h:2169
@ EVENT_IMMUNE
Definition enums.h:2179
@ EVENT_BURN_DEATH
Definition enums.h:2190
@ EVENT_ZERO_DAMAGE
Definition enums.h:2177
@ EVENT_SHOCK_DEATH
Definition enums.h:2192
@ EVENT_SPIN_SMASH_HIT
Definition enums.h:2166
@ EVENT_SPIN_SMASH_DEATH
Definition enums.h:2187
@ EVENT_HIT_COMBO
Definition enums.h:2164
@ EVENT_AIR_LIFT_FAILED
Definition enums.h:2185
@ EVENT_BEGIN_AIR_LIFT
Definition enums.h:2208
@ EVENT_DEATH
Definition enums.h:2186
@ EVENT_SHOCK_HIT
Definition enums.h:2198
@ EVENT_RECOVER_STATUS
Definition enums.h:2200
@ EVENT_BLOW_AWAY
Definition enums.h:2176
@ ACTOR_PART_FLAG_PRIMARY_TARGET
Definition enums.h:3396
@ ACTOR_PART_FLAG_SKIP_MOVEMENT_ALLOC
Definition enums.h:3400
@ ACTOR_PART_FLAG_NO_TARGET
Cannot be targeted.
Definition enums.h:3394
@ ACTOR_PART_FLAG_INVISIBLE
Definition enums.h:3384
@ DAMAGE_TYPE_SHOCK
Definition enums.h:2890
@ DAMAGE_TYPE_TRIGGER_LUCKY
Definition enums.h:2915
EvtScript EVS_Enemy_ScareAway
EvtScript EVS_Enemy_Hit
EvtScript EVS_Enemy_Death
EvtScript EVS_Enemy_SpinSmashHit
EvtScript EVS_Enemy_AirLift
EvtScript EVS_Enemy_BlowAway
EvtScript EVS_Enemy_Recover
EvtScript EVS_Enemy_BurnHit
EvtScript EVS_Enemy_NoDamageHit
ApiStatus PlaySound(Evt *script, b32 isInitialCall)
#define Else
Marks the end of an if statement and the start of the else block.
Definition macros.h:296
#define Switch(LVAR)
Marks the start of a switch statement.
Definition macros.h:312
#define Ref(sym)
Address/pointer constant.
Definition macros.h:61
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:366
#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:320
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:214
#define EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
Definition macros.h:353
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define Float(DOUBLE)
Definition macros.h:52
#define CaseOrEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR.
Definition macros.h:342
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:299
#define CaseDefault
Marks the start of a switch case that executes unconditionally. It also marks the end of any previous...
Definition macros.h:338
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:476
#define Thread
Marks the start of a thread block.
Definition macros.h:545
#define EndThread
Marks the end of a thread block.
Definition macros.h:548
#define IfFlag(LVAR, RVAR)
Marks the beginning of an if statement that only executes if the RVAR flag is set on LVAR,...
Definition macros.h:289
#define LVar2
Definition macros.h:151
#define LVar1
Definition macros.h:150
#define LVarA
Definition macros.h:159
#define IfNotFlag(LVAR, RVAR)
Marks the beginning of an if statement that only executes if the RVAR flag is unset on LVAR,...
Definition macros.h:293
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:255
#define LVar9
Definition macros.h:158
#define A(sym)
Definition macros.h:36
#define EndSwitch
Marks the end of a switch statement and any case.
Definition macros.h:363
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:270
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:577
#define LVar0
Definition macros.h:149
#define SetConst(VAR, CONST)
Sets the given variable to a given value, skipping the evt_get_variable call.
Definition macros.h:371
#define Return
Kills the current EVT thread.
Definition macros.h:218
#define ACTOR_BY_POS(_name, _pos, _priority, args...)
Definition battle.h:230
FormationRow Formation[]
Definition battle.h:167