Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
ghost_bow.inc.c
Go to the documentation of this file.
1#include "battle/battle.h"
2#include "script_api/battle.h"
3#include "sprite/npc/BattleBow.h"
4
5#define NAMESPACE A(bow_clone)
6
7extern EvtScript N(EVS_Init);
8extern EvtScript N(EVS_Idle);
9extern EvtScript N(EVS_TakeTurn);
11
12s32 N(DefaultAnims)[] = {
23};
24
25s32 N(DefenseTable)[] = {
28};
29
30s32 N(StatusTable)[] = {
53};
54
56 {
58 .index = PRT_MAIN,
59 .posOffset = { 0, 0, 0 },
60 .targetOffset = { 0, 24 },
61 .opacity = 255,
62 .idleAnimations = N(DefaultAnims),
63 .defenseTable = N(DefenseTable),
64 .eventFlags = 0,
65 .elementImmunityFlags = 0,
66 .projectileTargetOffset = { 0, -10 },
67 },
68 {
70 .index = PRT_TARGET,
71 .posOffset = { 0, 50, 0 },
72 .targetOffset = { 0, -26 },
73 .opacity = 255,
74 .idleAnimations = NULL,
75 .defenseTable = N(DefenseTable),
76 .eventFlags = 0,
77 .elementImmunityFlags = 0,
78 .projectileTargetOffset = { 0, -10 },
79 },
80};
81
82ActorBlueprint NAMESPACE = {
83 .flags = ACTOR_FLAG_FLYING,
85 .level = ACTOR_LEVEL_GHOST_BOW,
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 = { 36, 29 },
100 .healthBarOffset = { 0, 0 },
101 .statusIconOffset = { -10, 20 },
102 .statusTextOffset = { 10, 20 },
103};
104
105EvtScript N(EVS_Init) = {
109 Return
110 End
111};
112
113EvtScript N(EVS_Idle) = {
114 Return
115 End
116};
117
130 Return
131 Else
135 EndIf
148 Wait(10)
152 Return
165 Return
171 Return
177 Set(LVar2, 14)
182 Return
195 Wait(10)
199 Return
209 Return
218 Return
223 Return
224 End
225};
226
230 Wait(10)
232 Thread
233 Set(LVar0, 200)
234 Loop(20)
235 Sub(LVar0, 10)
237 Wait(1)
238 EndLoop
240 Wait(10)
244 Thread
248 Call(AddGoalPos, ACTOR_SELF, 4, -4, 0)
249 Else
250 Call(AddGoalPos, ACTOR_SELF, 10, -10, 0)
251 EndIf
255 Wait(15)
261 Set(LVar0, 55)
262 Loop(20)
263 Add(LVar0, 10)
265 Wait(1)
266 EndLoop
269 Wait(10)
271 Wait(15)
276 Set(LVarA, LVar0)
280 Wait(2)
282 Set(LVar0, 0)
283 Loop(20)
284 Add(LVar0, -45)
286 Wait(1)
287 EndLoop
291 EndIf
294 Wait(30)
297 Wait(10)
299 Thread
300 Set(LVar0, 200)
301 Loop(20)
302 Sub(LVar0, 10)
304 Wait(1)
305 EndLoop
307 Wait(10)
315 Set(LVar0, 55)
316 Loop(20)
317 Add(LVar0, 10)
319 Wait(1)
320 EndLoop
324 Return
327 Set(LVarA, 0)
331 Set(LVar8, 4)
333 Set(LVar8, 5)
335 Set(LVar8, 6)
337 Set(LVar7, LVar8)
338 Loop(LVar7)
340 Add(LVarA, 1)
344 Set(LFlag0, TRUE)
347 Else
349 EndIf
350 Else
355 Else
357 EndIf
358 EndIf
359 Wait(2)
361 Thread
362 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(0.5))
363 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.5))
364 Call(ShakeCam, CAM_BATTLE, 0, 1, Float(0.5))
365 Call(ShakeCam, CAM_BATTLE, 0, 1, Float(0.2))
370 Wait(2)
373 Wait(2)
376 Wait(2)
379 Wait(8)
382 IfEq(LVar1, 0)
384 EndIf
385 EndLoop
389 Wait(10)
391 Thread
392 Set(LVar0, 200)
393 Loop(20)
394 Sub(LVar0, 10)
396 Wait(1)
397 EndLoop
399 Wait(10)
407 Set(LVar0, 55)
408 Loop(20)
409 Add(LVar0, 10)
411 Wait(1)
412 EndLoop
418 Return
419 End
420};
421
BSS s32 PopupMenu_SelectedIndex
Bytecode EvtScript[]
@ BTL_CAM_XADJ_AVG
Definition enums.h:4899
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3570
@ ELEMENT_END
Definition enums.h:2114
@ ELEMENT_NORMAL
Definition enums.h:2115
@ ACTOR_DECORATION_SEEING_STARS
Definition enums.h:2046
@ STATUS_KEY_PARALYZE
Definition enums.h:2201
@ STATUS_TURN_MOD_DEFAULT
Definition enums.h:2227
@ STATUS_TURN_MOD_PARALYZE
Definition enums.h:2234
@ STATUS_KEY_FROZEN
Definition enums.h:2203
@ STATUS_TURN_MOD_SLEEP
Definition enums.h:2228
@ STATUS_TURN_MOD_DIZZY
Definition enums.h:2232
@ STATUS_KEY_STATIC
Definition enums.h:2207
@ STATUS_END
Definition enums.h:2196
@ STATUS_TURN_MOD_POISON
Definition enums.h:2233
@ STATUS_KEY_FEAR
Definition enums.h:2199
@ STATUS_TURN_MOD_STOP
Definition enums.h:2237
@ STATUS_KEY_SLEEP
Definition enums.h:2202
@ STATUS_KEY_STONE
Definition enums.h:2208
@ STATUS_KEY_STOP
Definition enums.h:2204
@ STATUS_TURN_MOD_FROZEN
Definition enums.h:2230
@ STATUS_KEY_SHRINK
Definition enums.h:2206
@ STATUS_KEY_DIZZY
Definition enums.h:2200
@ STATUS_KEY_POISON
Definition enums.h:2205
@ STATUS_TURN_MOD_STATIC
Definition enums.h:2229
@ STATUS_TURN_MOD_FEAR
Definition enums.h:2231
@ STATUS_KEY_NORMAL
Definition enums.h:2197
@ STATUS_TURN_MOD_SHRINK
Definition enums.h:2235
@ STATUS_KEY_DEFAULT
Definition enums.h:2198
@ HIT_RESULT_NO_DAMAGE
Definition enums.h:1952
@ HIT_RESULT_HIT
Definition enums.h:1950
@ HIT_RESULT_LUCKY
Definition enums.h:1955
@ HIT_RESULT_MISS
Definition enums.h:1956
@ BTL_CAM_DEFAULT
Definition enums.h:4823
@ BTL_CAM_INTERRUPT
Definition enums.h:4822
@ BTL_CAM_ACTOR_FAR
Definition enums.h:4836
@ EASING_COS_IN_OUT
Definition enums.h:520
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6407
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6406
@ PARTNER_RANK_NORMAL
Definition enums.h:2018
@ PARTNER_RANK_SUPER
Definition enums.h:2019
@ PARTNER_RANK_ULTRA
Definition enums.h:2020
@ STATUS_FLAG_SHRINK
Definition enums.h:2819
@ DMG_SRC_NEXT_SLAP_RIGHT
Definition enums.h:1999
@ DMG_SRC_LAST_SLAP_RIGHT
Definition enums.h:2001
@ DMG_SRC_NEXT_SLAP_LEFT
Definition enums.h:1998
@ DMG_SRC_LAST_SLAP_LEFT
Definition enums.h:2000
@ SOUND_BOW_SMACK
Definition enums.h:1334
@ SOUND_BOO_VANISH_A
Definition enums.h:692
@ SOUND_BOO_APPEAR_A
Definition enums.h:694
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_SELF
Definition enums.h:2084
@ ACTOR_FLAG_FLYING
Quake Hammer can't hit.
Definition enums.h:3329
@ BTL_CAM_YADJ_TARGET
Definition enums.h:4904
@ EVENT_HIT
Definition enums.h:2132
@ EVENT_SCARE_AWAY
Definition enums.h:2174
@ EVENT_BURN_HIT
Definition enums.h:2136
@ EVENT_IMMUNE
Definition enums.h:2146
@ EVENT_BURN_DEATH
Definition enums.h:2157
@ EVENT_ZERO_DAMAGE
Definition enums.h:2144
@ EVENT_SHOCK_DEATH
Definition enums.h:2159
@ EVENT_SPIN_SMASH_HIT
Definition enums.h:2133
@ EVENT_SPIN_SMASH_DEATH
Definition enums.h:2154
@ EVENT_HIT_COMBO
Definition enums.h:2131
@ EVENT_AIR_LIFT_FAILED
Definition enums.h:2152
@ EVENT_BEGIN_AIR_LIFT
Definition enums.h:2175
@ EVENT_DEATH
Definition enums.h:2153
@ EVENT_SHOCK_HIT
Definition enums.h:2165
@ EVENT_RECOVER_STATUS
Definition enums.h:2167
@ EVENT_BLOW_AWAY
Definition enums.h:2143
@ ACTOR_PART_FLAG_PRIMARY_TARGET
Definition enums.h:3362
@ ACTOR_PART_FLAG_SKIP_MOVEMENT_ALLOC
Definition enums.h:3366
@ ACTOR_PART_FLAG_NO_TARGET
Cannot be targeted.
Definition enums.h:3360
@ ACTOR_PART_FLAG_INVISIBLE
Definition enums.h:3350
@ CAM_BATTLE
Definition enums.h:1801
@ DAMAGE_TYPE_SHOCK
Definition enums.h:2856
@ DAMAGE_TYPE_TRIGGER_LUCKY
Definition enums.h:2881
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 ShakeCam(Evt *script, b32 isInitialCall)
#define Else
Marks the end of an if statement and the start of the else block.
Definition macros.h:295
#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 Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#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 Sub(VAR, INT_VALUE)
Definition macros.h:377
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Add(VAR, INT_VALUE)
Definition macros.h:376
#define EndLoop
Marks the end of a loop.
Definition macros.h:248
#define EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
Definition macros.h:352
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define Float(DOUBLE)
Definition macros.h:51
#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 ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define LVar7
Definition macros.h:155
#define BreakLoop
Breaks out of the innermost loop.
Definition macros.h:251
#define Thread
Marks the start of a thread block.
Definition macros.h:544
#define EndThread
Marks the end of a thread block.
Definition macros.h:547
#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:288
#define LVar8
Definition macros.h:156
#define LVar2
Definition macros.h:150
#define LVar1
Definition macros.h:149
#define LFlag0
Definition macros.h:167
#define LVarA
Definition macros.h:158
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define LVar9
Definition macros.h:157
#define A(sym)
Definition macros.h:36
#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 Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245
#define LVar0
Definition macros.h:148
#define SetConst(VAR, CONST)
Sets the given variable to a given value, skipping the evt_get_variable call.
Definition macros.h:370
#define Return
Kills the current EVT thread.
Definition macros.h:217
#define ACTOR_BY_POS(_name, _pos, _priority, args...)
Definition battle.h:230
FormationRow Formation[]
Definition battle.h:167