Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
jungle_fuzzy.inc.c
Go to the documentation of this file.
1#include "common.h"
2#include "effects.h"
3#include "battle/battle.h"
4#include "script_api/battle.h"
5#include "sprite/player.h"
6#include "sprite/npc/Fuzzy.h"
8
9#define NAMESPACE A(jungle_fuzzy)
10
11extern s32 N(DefaultAnims)[];
12extern EvtScript N(EVS_Init);
13extern EvtScript N(EVS_Idle);
14extern EvtScript N(EVS_TakeTurn);
17
18enum N(ActorPartIDs) {
19 PRT_MAIN = 1,
20};
21
22enum N(ActorVars) {
24};
25
26enum N(ActorParams) {
27 DMG_LEECH = 2,
28};
29
30s32 N(DefenseTable)[] = {
32 ELEMENT_FIRE, 0,
34};
35
36s32 N(StatusTable)[] = {
59};
60
62 {
64 .index = PRT_MAIN,
65 .posOffset = { 0, 0, 0 },
66 .targetOffset = { 0, 20 },
67 .opacity = 255,
68 .idleAnimations = N(DefaultAnims),
69 .defenseTable = N(DefenseTable),
70 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
71 .elementImmunityFlags = 0,
72 .projectileTargetOffset = { 0, -10 },
73 },
74};
75
76ActorBlueprint NAMESPACE = {
77 .flags = 0,
80 .maxHP = 7,
81 .partCount = ARRAY_COUNT(N(ActorParts)),
82 .partsData = N(ActorParts),
83 .initScript = &N(EVS_Init),
84 .statusTable = N(StatusTable),
85 .escapeChance = 30,
86 .airLiftChance = 85,
87 .hurricaneChance = 80,
88 .spookChance = 75,
89 .upAndAwayChance = 95,
90 .spinSmashReq = 0,
91 .powerBounceChance = 100,
92 .coinReward = 1,
93 .size = { 33, 28 },
94 .healthBarOffset = { 0, 0 },
95 .statusIconOffset = { -10, 20 },
96 .statusTextOffset = { 10, 20 },
97};
98
99s32 N(DefaultAnims)[] = {
110};
111
112EvtScript N(EVS_Init) = {
117 Return
118 End
119};
120
121EvtScript N(EVS_Idle) = {
122 Return
123 End
124};
125
129 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
139 Else
142 EndIf
158 Return
170 Return
193 Return
206 Wait(10)
210 Else
214 Wait(10)
218 EndIf
219 Return
229 Return
238 Return
247 Return
248 End
249};
250
260 Wait(20)
263 Thread
264 Wait(30)
266 Wait(30)
267 Loop(4)
269 Wait(11)
270 EndLoop
274 Wait(130)
282 Thread
289 Wait(1)
299 CaseEq(0)
301 CaseEq(1)
306 Return
307 End
308};
309
310#include "common/SpawnEnemyDrainFX.inc.c"
311
322 Add(LVar0, 50)
323 Set(LVar1, 0)
325 Goto(100)
326 EndIf
331 Add(LVar0, 50)
332 Set(LVar1, 0)
337 Label(100)
341 Wait(1)
343 Wait(5)
348 Set(LVarA, LVar0)
351 Sub(LVar0, 5)
352 Set(LVar1, 0)
353 Sub(LVar2, 5)
361 Sub(LVar0, 20)
366 Sub(LVar0, 15)
371 Wait(4)
372 Wait(5)
375 EndIf
376 Wait(5)
391 Return
397 Else
398 Set(LFlag0, TRUE)
399 EndIf
402 Call(AddGoalPos, ACTOR_SELF, -3, -12, -15)
408 Return
409 EndIf
412 Wait(10)
413 Loop(2)
416 Wait(21)
418 Call(SetActorRotation, ACTOR_SELF, 0, 0, 330)
421 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
422 Wait(1)
423 Call(SetActorScale, ACTOR_SELF, Float(0.9), Float(1.2), Float(1.0))
424 Wait(1)
425 Call(SetActorScale, ACTOR_SELF, Float(0.8), Float(1.3), Float(1.0))
426 Wait(1)
427 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.4), Float(1.0))
428 Wait(1)
429 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.5), Float(1.0))
430 Wait(2)
431 Call(SetActorScale, ACTOR_SELF, Float(0.6), Float(1.6), Float(1.0))
432 Wait(10)
433 Wait(2)
437 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
439 Wait(30)
440 EndLoop
441 Else
446 Call(SetupMashMeter, 1, 23, 0, 0, 0, 0)
447 Wait(10)
450 Set(LVarD, 0)
451 Loop(5)
457 Loop(21)
459 IfEq(LVar1, 1)
460 Set(LFlag0, TRUE)
462 EndIf
463 Wait(1)
464 EndLoop
468 EndIf
470 Call(SetActorRotation, ACTOR_SELF, 0, 0, 330)
473 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
475 Loop(1)
477 IfEq(LVar1, 1)
478 Set(LFlag0, TRUE)
480 EndIf
481 Wait(1)
482 EndLoop
486 EndIf
487 Call(SetActorScale, ACTOR_SELF, Float(0.9), Float(1.2), Float(1.0))
489 Loop(1)
491 IfEq(LVar1, 1)
492 Set(LFlag0, TRUE)
494 EndIf
495 Wait(1)
496 EndLoop
500 EndIf
501 Call(SetActorScale, ACTOR_SELF, Float(0.8), Float(1.3), Float(1.0))
503 Loop(1)
505 IfEq(LVar1, 1)
506 Set(LFlag0, TRUE)
508 EndIf
509 Wait(1)
510 EndLoop
514 EndIf
515 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.4), Float(1.0))
517 Loop(1)
519 IfEq(LVar1, 1)
520 Set(LFlag0, TRUE)
522 EndIf
523 Wait(1)
524 EndLoop
528 EndIf
529 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.5), Float(1.0))
531 Loop(2)
533 IfEq(LVar1, 1)
534 Set(LFlag0, TRUE)
536 EndIf
537 Wait(1)
538 EndLoop
542 EndIf
543 Call(SetActorScale, ACTOR_SELF, Float(0.6), Float(1.6), Float(1.0))
545 Loop(10)
547 IfEq(LVar1, 1)
548 Set(LFlag0, TRUE)
550 EndIf
551 Wait(1)
552 EndLoop
556 EndIf
558 Loop(2)
560 IfEq(LVar1, 1)
561 Set(LFlag0, TRUE)
563 EndIf
564 Wait(1)
565 EndLoop
569 EndIf
573 IfNe(LVar3, 0)
577 Add(LVar1, 10)
579 Thread
580 Wait(15)
584 Add(LVar0, 20)
585 Add(LVar1, 20)
588 Add(LVar0, LVar3)
590 Else
591 Add(LVarD, 1)
592 IfGt(LVarD, 1)
595 EndIf
596 EndIf
599 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
602 IfEq(LVar1, 0)
605 EndIf
607 Loop(35)
609 IfEq(LVar1, 1)
610 Set(LFlag0, TRUE)
612 EndIf
613 Wait(1)
614 EndLoop
617 EndIf
618 EndLoop
622 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
624 EndIf
628 Thread
629 Call(SetActorScale, ACTOR_SELF, Float(1.6), Float(0.6), Float(1.0))
631 Wait(1)
632 Call(SetActorRotation, ACTOR_SELF, 0, 0, 330)
633 Wait(1)
634 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.5), Float(1.0))
635 Call(SetActorRotation, ACTOR_SELF, 0, 0, 300)
636 Wait(1)
637 Call(SetActorRotation, ACTOR_SELF, 0, 0, 270)
638 Wait(1)
639 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(0.7), Float(1.0))
640 Call(SetActorRotation, ACTOR_SELF, 0, 0, 240)
641 Wait(1)
642 Call(SetActorRotation, ACTOR_SELF, 0, 0, 210)
643 Wait(1)
644 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.4), Float(1.0))
645 Call(SetActorRotation, ACTOR_SELF, 0, 0, 180)
646 Wait(2)
647 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(0.7), Float(1.0))
648 Wait(2)
649 Call(SetActorScale, ACTOR_SELF, Float(1.2), Float(0.5), Float(1.0))
652 Add(LVar0, 40)
653 Set(LVar1, 0)
657 Call(SetActorScale, ACTOR_SELF, Float(1.4), Float(0.2), Float(1.0))
658 Wait(1)
659 Thread
660 Wait(1)
661 Call(SetActorScale, ACTOR_SELF, Float(1.2), Float(0.5), Float(1.0))
662 Call(SetActorRotation, ACTOR_SELF, 0, 0, 150)
663 Wait(1)
664 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
665 Call(SetActorRotation, ACTOR_SELF, 0, 0, 120)
666 Wait(1)
668 Wait(1)
670 Wait(1)
672 Wait(1)
677 Add(LVar0, 30)
680 Wait(5)
692 Return
693 End
694};
695
703 Label(0)
706 Mod(LVar5, 4)
708 CaseEq(0)
709 Set(LFlag1, TRUE)
710 CaseEq(1)
711 Set(LFlag2, TRUE)
712 CaseEq(2)
713 Set(LFlag3, TRUE)
714 CaseEq(3)
715 Set(LFlag4, TRUE)
719 Goto(0)
720 EndIf
721 Set(LVarA, -1)
722 Set(LVarB, -1)
725 CaseEq(0)
727 Set(LVarA, 1)
728 EndIf
729 CaseEq(1)
731 Set(LVarA, 0)
732 EndIf
734 IfEq(LVarA, -1)
735 Set(LVarA, 2)
736 Else
737 Set(LVarB, 2)
738 EndIf
739 EndIf
740 CaseEq(2)
742 Set(LVarA, 1)
743 EndIf
745 IfEq(LVarA, -1)
746 Set(LVarA, 3)
747 Else
748 Set(LVarB, 3)
749 EndIf
750 EndIf
751 CaseEq(3)
753 Set(LVarA, 2)
754 EndIf
756 IfNe(LVarB, -1)
757 Call(RandInt, 1000, LVar0)
758 IfLt(LVar0, 500)
759 Set(LVarA, LVarB)
760 EndIf
761 EndIf
762 Return
763 End
764};
765
767 Set(LVar9, 0)
770 Label(0)
779 IfNe(LVar3, 2)
780 Add(LVar9, 1)
781 EndIf
782 EndIf
788 IfLt(LVar3, 2)
789 Add(LVar9, 1)
790 EndIf
791 EndIf
795 Goto(0)
796 EndIf
797 Return
798 End
799};
800
805 Return
806 EndIf
808 IfEq(LVar0, 2)
810 Return
811 EndIf
813 IfEq(LVarA, -1)
815 Return
816 EndIf
819 CaseEq(1)
820 Call(RandInt, 1000, LVar0)
821 IfLt(LVar0, 400)
823 Return
824 EndIf
825 CaseEq(2)
826 Call(RandInt, 1000, LVar0)
827 IfLt(LVar0, 150)
829 Return
830 EndIf
831 CaseEq(3)
832 Call(RandInt, 1000, LVar0)
833 IfLt(LVar0, 70)
835 Return
836 EndIf
839 Return
840 End
841};
842
844
846 ACTOR_BY_POS(NAMESPACE, N(SummonPos), 0),
847};
BSS s32 PopupMenu_SelectedIndex
@ AC_DIFFICULTY_3
Definition action_cmd.h:45
Bytecode EvtScript[]
#define STATUS_FLAGS_IMMOBILIZED
Definition enums.h:2834
@ BTL_CAM_XADJ_AVG
Definition enums.h:4899
@ ACTION_COMMAND_STOP_LEECH
Definition enums.h:3478
@ BS_FLAGS1_NICE_HIT
Definition enums.h:3575
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3574
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3570
@ BS_FLAGS1_4000
Definition enums.h:3582
@ BTL_MSG_ACTION_TIP_MASH_BUTTON
Definition enums.h:4107
@ ELEMENT_FIRE
Definition enums.h:2116
@ ELEMENT_END
Definition enums.h:2114
@ ELEMENT_NORMAL
Definition enums.h:2115
@ ITER_NO_MORE
Definition enums.h:2030
@ ITER_NEXT
Definition enums.h:2025
@ ACTOR_EVENT_FLAGS_NONE
Definition enums.h:3370
@ ACTOR_DECORATION_SWEAT
Definition enums.h:2045
@ 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_HIT_STATIC
Definition enums.h:1957
@ 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_REPOSITION
Definition enums.h:4840
@ BTL_CAM_ENEMY_APPROACH
Definition enums.h:4884
@ TARGET_FLAG_PRIMARY_ONLY
Definition enums.h:1863
@ TARGET_FLAG_2
Definition enums.h:1850
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6407
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6406
@ STATUS_FLAG_STATIC
Definition enums.h:2813
@ STATUS_FLAG_STONE
Definition enums.h:2820
@ SOUND_STAR_BOUNCE_A
Definition enums.h:975
@ SOUND_RECOVER_HEART
Definition enums.h:1406
@ SOUND_FUZZY_SHAKE
Definition enums.h:1408
@ SOUND_LEECH
Definition enums.h:1288
@ SOUND_FUZZY_RUMBLE
Definition enums.h:1407
@ SOUND_FUZZY_DIVIDE
Definition enums.h:1409
@ SOUND_HEART_BOUNCE
Definition enums.h:925
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_SELF
Definition enums.h:2084
@ 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
@ DAMAGE_TYPE_UNBLOCKABLE
Definition enums.h:2875
@ DAMAGE_TYPE_IGNORE_DEFENSE
Definition enums.h:2877
@ DAMAGE_TYPE_SHOCK
Definition enums.h:2856
@ DAMAGE_TYPE_TRIGGER_LUCKY
Definition enums.h:2881
EvtScript EVS_Enemy_Knockback
EvtScript EVS_Enemy_HopToPos
EvtScript EVS_Enemy_ScareAway
EvtScript EVS_Enemy_Hit
EvtScript EVS_Enemy_Death
EvtScript EVS_Enemy_SpinSmashHit
EvtScript EVS_Enemy_ShockHit
EvtScript EVS_Enemy_HopHome
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)
#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 LFlag4
Definition macros.h:171
#define IfNe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR != RVAR.
Definition macros.h:272
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Mod(VAR, INT_VALUE)
Definition macros.h:380
#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 Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#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 LFlag1
Definition macros.h:168
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:227
#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 LVarB
Definition macros.h:159
#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 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 LFlag0
Definition macros.h:167
#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 LVarD
Definition macros.h:161
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define LFlag2
Definition macros.h:169
#define LVar9
Definition macros.h:157
#define NPC_DISPOSE_LOCATION
Definition macros.h:162
#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 LFlag3
Definition macros.h:170
#define Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245
#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
#define ACTOR_BY_POS(_name, _pos, _priority, args...)
Definition battle.h:230
@ AVAR_SpearGuy_Generation
Definition battle.h:101
FormationRow Formation[]
Definition battle.h:167
#define AC_LEECH_MAX_TIME
Definition stop_leech.h:17