Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
hyper_cleft.inc.c
Go to the documentation of this file.
1#include "battle/battle.h"
2#include "script_api/battle.h"
3#include "sprite/npc/Cleft.h"
4
5#define NAMESPACE A(hyper_cleft)
6
7extern s32 N(UprightAnims)[];
8extern EvtScript N(EVS_Init);
9extern EvtScript N(EVS_Idle);
10extern EvtScript N(EVS_TakeTurn);
16
17enum N(ActorPartIDs) {
18 PRT_MAIN = 1,
19};
20
21enum N(ActorVars) {
22 AVAR_State = 0,
29};
30
31enum N(ActorParams) {
32 DMG_TACKLE = 3,
33 DMG_CHARGED = 8,
34};
35
36s32 N(UprightDefenseTable)[] = {
38 ELEMENT_FIRE, 99,
40};
41
42s32 N(ToppledDefenseTable)[] = {
44 ELEMENT_FIRE, 99,
46};
47
48s32 N(StatusTable)[] = {
71};
72
74 {
76 .index = PRT_MAIN,
77 .posOffset = { 0, 0, 0 },
78 .targetOffset = { 0, 22 },
79 .opacity = 255,
80 .idleAnimations = N(UprightAnims),
81 .defenseTable = N(UprightDefenseTable),
82 .eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP,
83 .elementImmunityFlags = 0,
84 .projectileTargetOffset = { 0, -10 },
85 },
86};
87
88ActorBlueprint NAMESPACE = {
89 .flags = 0,
92 .maxHP = 4,
93 .partCount = ARRAY_COUNT(N(ActorParts)),
94 .partsData = N(ActorParts),
95 .initScript = &N(EVS_Init),
96 .statusTable = N(StatusTable),
97 .escapeChance = 70,
98 .airLiftChance = 30,
99 .hurricaneChance = 30,
100 .spookChance = 30,
101 .upAndAwayChance = 95,
102 .spinSmashReq = 0,
103 .powerBounceChance = 95,
104 .coinReward = 2,
105 .size = { 44, 36 },
106 .healthBarOffset = { 0, 0 },
107 .statusIconOffset = { -10, 20 },
108 .statusTextOffset = { 10, 20 },
109};
110
111s32 N(HyperAnims)[] = {
122};
123
124EvtScript N(EVS_Init) = {
131 Return
132 End
133};
134
144 Return
145 End
146};
147
149
159 Wait(20)
162 Add(LVar1, 10)
165 Wait(30)
172 Call(N(StartRumbleWithParams), 200, 10)
173 Thread
174 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(1.5))
178 Thread
179 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(1.0))
187 Return
188 EndIf
193 Loop(20)
195 Wait(1)
197 Wait(1)
198 EndLoop
206 Set(LVarA, LVar0)
207 Thread
208 Loop(0)
210 Add(LVar0, 30)
214 EndIf
215 Wait(1)
216 EndLoop
220 EndIf
221 Wait(15)
224 Thread
225 Loop(30)
228 Wait(1)
229 EndLoop
233 Call(AddGoalPos, ACTOR_SELF, -200, 0, 0)
236 Wait(15)
241 Call(SetActorPos, ACTOR_SELF, 300, 0, 0)
253 Return
256 Thread
257 Loop(25)
260 Wait(1)
261 EndLoop
268 Wait(2)
275 Thread
277 Set(LVar0, 0)
278 Loop(60)
279 Add(LVar0, 18)
281 Wait(1)
282 EndLoop
288 Sub(LVar0, 50)
291 Sub(LVar0, 40)
294 Sub(LVar0, 30)
297 Wait(20)
314 Return
315 End
316};
317
323 Return
324 EndIf
328 Return
329 EndIf
333 Return
334 EndIf
339 IfEq(LVar0, 0)
340 Call(RandInt, 1000, LVar0)
341 IfLt(LVar0, 750)
344 Else
347 EndIf
348 Else
349 Call(RandInt, 1000, LVar0)
350 IfLt(LVar0, 500)
353 Else
356 EndIf
357 EndIf
360 Return
363 Return
365 Return
366 End
367};
368
369// everything below this point is copied from the basic Cleft actor
370
371s32 N(UprightAnims)[] = {
382};
383
384s32 N(ToppledAnims)[] = {
395};
396
402 Return
403 End
404};
405
406EvtScript N(EVS_Idle) = {
407 Return
408 End
409};
410
412
418 Thread
419 Set(LVar0, 0)
420 Loop(5)
421 Add(LVar0, -36)
423 Wait(1)
424 EndLoop
428 Sub(LVar1, 6)
431 Call(N(StartRumbleWithParams), 200, 10)
432 Thread
433 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(1.0))
435 PlayEffect(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 40, 8, Float(0.0), 20, 0)
451 Return
452 End
453};
454
470 Else
472 EndIf
488 SetConst(LVar2, -1)
490 Else
493 SetConst(LVar2, -1)
495 EndIf
503 SetConst(LVar2, -1)
508 Else
511 SetConst(LVar2, -1)
516 EndIf
517 Return
522 Else
524 EndIf
536 Else
543 EndIf
544 Return
577 Return
587 EndIf
591 Else
593 EndIf
600 EndIf
601 Wait(10)
605 Add(LVar0, -3)
606 Add(LVar1, 10)
607 Else
608 Add(LVar0, -8)
609 Add(LVar1, 27)
610 EndIf
612 Wait(20)
619 Else
621 EndIf
631 Wait(10)
635 Else
639 Wait(10)
643 EndIf
644 Return
651 EndIf
658 Else
663 Return
664 EndIf
674 Else
677 EndIf
679 Return
684 Return
685 End
686};
687
694 Wait(20)
699 IfGt(LVar0, 0)
700 Sub(LVar0, 1)
702 Else
705 Thread
706 Wait(3)
707 Loop(5)
708 Add(LVar0, 36)
710 Wait(1)
711 EndLoop
714 Sub(LVar1, 6)
718 Call(N(StartRumbleWithParams), 200, 10)
719 Thread
720 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(1.0))
732 Wait(1)
735 EndIf
738 Return
739 End
740};
741
751 Thread
753 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0)
754 Wait(10)
755 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0)
756 Wait(5)
757 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0)
760 Wait(10)
764 Call(AddGoalPos, ACTOR_SELF, 50, 0, -5)
768 Wait(8)
775 Set(LVarA, LVar0)
777 Thread
778 Wait(10)
781 EndIf
785 Sub(LVar0, 100)
786 Set(LVar1, 0)
792 Wait(15)
793 Wait(8)
809 Return
814 Add(LVar0, 20)
819 Wait(2)
829 Add(LVar0, 15)
830 Set(LVar1, 0)
835 Wait(5)
846 Return
847 End
848};
849
854 Else
856 EndIf
857 Return
858 End
859};
BSS s32 PopupMenu_SelectedIndex
Bytecode EvtScript[]
#define STATUS_FLAGS_IMMOBILIZED
Definition enums.h:2834
@ BTL_CAM_XADJ_AVG
Definition enums.h:4899
@ ACTOR_SOUND_WALK
Definition enums.h:2034
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3574
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3570
@ ELEMENT_FIRE
Definition enums.h:2116
@ ELEMENT_END
Definition enums.h:2114
@ ELEMENT_NORMAL
Definition enums.h:2115
@ ACTOR_EVENT_FLAG_ATTACK_CHARGED
Actor has charged an attack that can be removed with Star Beam.
Definition enums.h:3389
@ ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION
Blast and fire attacks trigger an explosion.
Definition enums.h:3377
@ ACTOR_EVENT_FLAG_SPIKY_TOP
Player takes spike damage from jump attacks.
Definition enums.h:3373
@ ACTOR_DECORATION_SWEAT
Definition enums.h:2045
@ PHASE_ENEMY_BEGIN
Definition enums.h:2068
@ PHASE_PLAYER_BEGIN
Definition enums.h:2066
@ PHASE_ENEMY_END
Definition enums.h:2067
@ PHASE_FIRST_STRIKE
Definition enums.h:2059
@ 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
Definition enums.h:4835
@ BTL_CAM_ENEMY_APPROACH
Definition enums.h:4884
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6407
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6406
@ STATUS_FLAG_SHRINK
Definition enums.h:2819
@ SOUND_POWER_UP
Definition enums.h:1050
@ SOUND_HYPER_CLEFT_CHARGE
Definition enums.h:1052
@ SOUND_NONE
Definition enums.h:547
@ SOUND_CLEFT_TACKLE
Definition enums.h:1495
@ SOUND_HYPER_CLEFT_LAND
Definition enums.h:1051
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_SELF
Definition enums.h:2084
@ ACTOR_FLAG_FLIPPED
Actor has been flipped over.
Definition enums.h:3330
@ 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_STAR_BEAM
Definition enums.h:2140
@ 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_SPIKE_TAUNT
Definition enums.h:2148
@ 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
@ CAM_BATTLE
Definition enums.h:1801
@ DAMAGE_TYPE_BLAST
Definition enums.h:2860
@ DAMAGE_TYPE_TRIGGER_LUCKY
Definition enums.h:2881
EvtScript EVS_Enemy_ReturnHome
EvtScript EVS_Enemy_Knockback
EvtScript EVS_Enemy_ScareAway
EvtScript EVS_Enemy_Hit
EvtScript EVS_Enemy_Death
EvtScript EVS_Enemy_SpinSmashHit
EvtScript EVS_Enemy_ShockHit
EvtScript EVS_Enemy_AirLift
EvtScript EVS_Enemy_BlowAway
EvtScript EVS_Enemy_Recover
EvtScript EVS_Enemy_BurnHit
EvtScript EVS_Enemy_NoDamageHit
ApiStatus RandInt(Evt *script, b32 isInitialCall)
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 IfGt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR <= RVAR.
Definition macros.h:278
#define IfLt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR < RVAR.
Definition macros.h:275
#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 LVar5
Definition macros.h:153
#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 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 CaseFlag(RVAR)
Marks the start of a switch case that executes only if the RVAR flag is set on LVAR,...
Definition macros.h:349
#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 LVar2
Definition macros.h:150
#define LVar1
Definition macros.h:149
#define LVarA
Definition macros.h:158
#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:292
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#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 Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245
#define LVar4
Definition macros.h:152
#define LVar3
Definition macros.h:151
#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
@ BTL_VAL_HyperSync_Active
Definition battle.h:86
@ BTL_VAL_HyperSync_Done
Definition battle.h:85
@ BTL_VAL_HyperSync_None
Definition battle.h:84
@ BTL_VAR_HyperSync
Definition battle.h:83