Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
forest_fuzzy.inc.c
Go to the documentation of this file.
1#include "battle/battle.h"
2#include "script_api/battle.h"
3#include "sprite/npc/Fuzzy.h"
4#include "sprite/player.h"
5
6#define NAMESPACE A(forest_fuzzy)
7
8extern s32 N(DefaultAnims)[];
9extern EvtScript N(EVS_Init);
10extern EvtScript N(EVS_Idle);
11extern EvtScript N(EVS_TakeTurn);
14
15enum N(ActorPartIDs) {
16 PRT_MAIN = 1,
17};
18
19enum N(ActorVars) {
21};
22
23enum N(ActorParams) {
24 DMG_LEECH = 1,
25};
26
27s32 N(DefenseTable)[] = {
30};
31
32s32 N(StatusTable)[] = {
55};
56
58 {
60 .index = PRT_MAIN,
61 .posOffset = { 0, 0, 0 },
62 .targetOffset = { 0, 20 },
63 .opacity = 255,
64 .idleAnimations = N(DefaultAnims),
65 .defenseTable = N(DefenseTable),
66 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
67 .elementImmunityFlags = 0,
68 .projectileTargetOffset = { 0, -10 },
69 },
70};
71
72ActorBlueprint NAMESPACE = {
73 .flags = 0,
76 .maxHP = 6,
77 .partCount = ARRAY_COUNT(N(ActorParts)),
78 .partsData = N(ActorParts),
79 .initScript = &N(EVS_Init),
80 .statusTable = N(StatusTable),
81 .escapeChance = 40,
82 .airLiftChance = 90,
83 .hurricaneChance = 90,
84 .spookChance = 85,
85 .upAndAwayChance = 95,
86 .spinSmashReq = 0,
87 .powerBounceChance = 100,
88 .coinReward = 1,
89 .size = { 33, 28 },
90 .healthBarOffset = { 0, 0 },
91 .statusIconOffset = { -10, 20 },
92 .statusTextOffset = { 10, 20 },
93};
94
95s32 N(DefaultAnims)[] = {
106};
107
108EvtScript N(EVS_Init) = {
113 Return
114 End
115};
116
117EvtScript N(EVS_Idle) = {
118 Return
119 End
120};
121
125 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
135 Else
138 EndIf
154 Return
166 Return
189 Return
202 Wait(10)
206 Else
210 Wait(10)
214 EndIf
215 Return
225 Return
234 Return
243 Return
244 End
245};
246
256 Wait(20)
259 Thread
260 Wait(30)
262 Wait(30)
263 Loop(4)
265 Wait(11)
266 EndLoop
270 Wait(130)
278 Thread
285 Wait(1)
295 CaseEq(0)
297 CaseEq(1)
302 Return
303 End
304};
305
306#include "common/SpawnEnemyDrainFX.inc.c"
307
318 Add(LVar0, 50)
319 Set(LVar1, 0)
321 Goto(100)
322 EndIf
327 Add(LVar0, 50)
328 Set(LVar1, 0)
333 Label(100)
337 Wait(1)
339 Wait(5)
344 Set(LVarA, LVar0)
347 Sub(LVar0, 5)
348 Set(LVar1, 0)
349 Sub(LVar2, 5)
357 Sub(LVar0, 20)
362 Sub(LVar0, 15)
367 Wait(4)
368 Wait(5)
371 EndIf
372 Wait(5)
387 Return
393 Else
394 Set(LFlag0, TRUE)
395 EndIf
398 Call(AddGoalPos, ACTOR_SELF, -3, -12, -15)
404 Return
405 EndIf
406 Wait(10)
411 Wait(21)
413 Call(SetActorRotation, ACTOR_SELF, 0, 0, 330)
416 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
417 Wait(1)
418 Call(SetActorScale, ACTOR_SELF, Float(0.9), Float(1.2), Float(1.0))
419 Wait(1)
420 Call(SetActorScale, ACTOR_SELF, Float(0.8), Float(1.3), Float(1.0))
421 Wait(1)
422 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.4), Float(1.0))
423 Wait(1)
424 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.5), Float(1.0))
425 Wait(2)
426 Call(SetActorScale, ACTOR_SELF, Float(0.6), Float(1.6), Float(1.0))
427 Wait(10)
428 Wait(2)
435 IfNe(LVar3, 0)
439 Add(LVar1, 10)
441 Thread
442 Wait(15)
446 Add(LVar0, 20)
447 Add(LVar1, 20)
450 Add(LVar0, LVar3)
452 EndIf
453 Thread
454 Call(SetActorScale, ACTOR_SELF, Float(1.6), Float(0.6), Float(1.0))
456 Wait(1)
457 Call(SetActorRotation, ACTOR_SELF, 0, 0, 330)
458 Wait(1)
459 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.5), Float(1.0))
460 Call(SetActorRotation, ACTOR_SELF, 0, 0, 300)
461 Wait(1)
462 Call(SetActorRotation, ACTOR_SELF, 0, 0, 270)
463 Wait(1)
464 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(0.7), Float(1.0))
465 Call(SetActorRotation, ACTOR_SELF, 0, 0, 240)
466 Wait(1)
467 Call(SetActorRotation, ACTOR_SELF, 0, 0, 210)
468 Wait(1)
469 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.4), Float(1.0))
470 Call(SetActorRotation, ACTOR_SELF, 0, 0, 180)
471 Wait(2)
472 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(0.7), Float(1.0))
473 Wait(2)
474 Call(SetActorScale, ACTOR_SELF, Float(1.2), Float(0.5), Float(1.0))
477 Add(LVar0, 40)
478 Set(LVar1, 0)
482 Call(SetActorScale, ACTOR_SELF, Float(1.4), Float(0.2), Float(1.0))
483 Wait(1)
484 Thread
485 Wait(1)
486 Call(SetActorScale, ACTOR_SELF, Float(1.2), Float(0.5), Float(1.0))
487 Call(SetActorRotation, ACTOR_SELF, 0, 0, 150)
488 Wait(1)
489 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
490 Call(SetActorRotation, ACTOR_SELF, 0, 0, 120)
491 Wait(1)
493 Wait(1)
495 Wait(1)
497 Wait(1)
502 Add(LVar0, 30)
505 Wait(5)
517 Return
518 End
519};
520
522 // find which columns are occupied
529 Label(0)
532 Mod(LVar5, 4)
534 CaseEq(0)
535 Set(LFlag1, TRUE)
536 CaseEq(1)
537 Set(LFlag2, TRUE)
538 CaseEq(2)
539 Set(LFlag3, TRUE)
540 CaseEq(3)
541 Set(LFlag4, TRUE)
545 Goto(0)
546 EndIf
547 // check adjacent positions to self
548 Set(LVarA, -1)
549 Set(LVarB, -1)
552 CaseEq(0)
554 Set(LVarA, 1)
555 EndIf
556 CaseEq(1)
558 Set(LVarA, 0)
559 EndIf
561 IfEq(LVarA, -1)
562 Set(LVarA, 2)
563 Else
564 Set(LVarB, 2)
565 EndIf
566 EndIf
567 CaseEq(2)
569 Set(LVarA, 1)
570 EndIf
572 IfEq(LVarA, -1)
573 Set(LVarA, 3)
574 Else
575 Set(LVarB, 3)
576 EndIf
577 EndIf
578 CaseEq(3)
580 Set(LVarA, 2)
581 EndIf
583 // if both positions are open, choose one at random
584 IfNe(LVarB, -1)
585 Call(RandInt, 1000, LVar0)
586 IfLt(LVar0, 500)
587 Set(LVarA, LVarB)
588 EndIf
589 EndIf
590 Return
591 End
592};
593
595 Set(LVar9, 0)
598 Label(0)
607 IfNe(LVar3, 2)
608 Add(LVar9, 1)
609 EndIf
610 EndIf
616 IfLt(LVar3, 2)
617 Add(LVar9, 1)
618 EndIf
619 EndIf
623 Goto(0)
624 EndIf
625 Return
626 End
627};
628
633 Return
634 EndIf
636 IfEq(LVar0, 2)
638 Return
639 EndIf
641 IfEq(LVarA, -1)
643 Return
644 EndIf
645 // lower chance to summon when more summoners are in battle
648 CaseEq(1)
649 Call(RandInt, 1000, LVar0)
650 IfLt(LVar0, 300)
652 Return
653 EndIf
654 CaseEq(2)
655 Call(RandInt, 1000, LVar0)
656 IfLt(LVar0, 150)
658 Return
659 EndIf
660 CaseEq(3)
661 Call(RandInt, 1000, LVar0)
662 IfLt(LVar0, 100)
664 Return
665 EndIf
668 Return
669 End
670};
671
673
675 ACTOR_BY_POS(NAMESPACE, N(SummonPos), 0),
676};
BSS s32 PopupMenu_SelectedIndex
Bytecode EvtScript[]
#define STATUS_FLAGS_IMMOBILIZED
Definition enums.h:2834
@ BTL_CAM_XADJ_AVG
Definition enums.h:4899
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3574
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3570
@ 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
@ 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_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 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 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 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