Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
paragloomba.inc.c
Go to the documentation of this file.
1#include "battle/battle.h"
2#include "script_api/battle.h"
3#include "sprite/npc/Paragoomba.h"
4#include "sprite/npc/Goomba.h"
5#include "effects.h"
6
7#define NAMESPACE A(paragloomba)
8
13extern EvtScript N(EVS_KnockDown);
18
19extern s32 N(DownedAnims)[];
20extern s32 N(FlyingAnims)[];
21extern s32 N(LeftWingAnims)[];
22extern s32 N(RightWingAnims)[];
23
24enum N(ActorPartIDs) {
25 PRT_MAIN = 1, // body after being downed
26 PRT_FLYING = 2, // body while flying
27 PRT_DUMMY_WING_L = 3, // temporary wing while being downed
28 PRT_DUMMY_WING_R = 4, // temporary wing while being downed
29};
30
31enum N(ActorParams) {
32 DMG_SKY_DIVE = 2,
33 DMG_HEADBONK = 2,
34};
35
36s32 N(DownedDefense)[] = {
39};
40
41s32 N(FlyingDefense)[] = {
44};
45
46s32 N(DownedFlyingStatusTable)[] = {
53 STATUS_KEY_FEAR, 100,
69};
70
71s32 N(FlyingStatusTable)[] = {
94};
95
97 {
99 .index = PRT_MAIN,
100 .posOffset = { 0, 0, 0 },
101 .targetOffset = { 0, 20 },
102 .opacity = 255,
103 .idleAnimations = N(DownedAnims),
104 .defenseTable = N(DownedDefense),
105 .eventFlags = 0,
106 .elementImmunityFlags = 0,
107 .projectileTargetOffset = { 0, -10 },
108 },
109 {
111 .index = PRT_FLYING,
112 .posOffset = { 0, 0, 0 },
113 .targetOffset = { 0, 24 },
114 .opacity = 255,
115 .idleAnimations = N(FlyingAnims),
116 .defenseTable = N(FlyingDefense),
117 .eventFlags = ACTOR_EVENT_FLAG_GROUNDABLE,
118 .elementImmunityFlags = 0,
119 .projectileTargetOffset = { 0, -10 },
120 },
121 {
123 .index = PRT_DUMMY_WING_L,
124 .posOffset = { 0, 0, 0 },
125 .targetOffset = { -16, 24 },
126 .opacity = 255,
127 .idleAnimations = N(LeftWingAnims),
128 .defenseTable = N(DownedDefense),
129 .eventFlags = 0,
130 .elementImmunityFlags = 0,
131 .projectileTargetOffset = { 0, -10 },
132 },
133 {
135 .index = PRT_DUMMY_WING_R,
136 .posOffset = { 0, 0, 0 },
137 .targetOffset = { -16, 24 },
138 .opacity = 255,
139 .idleAnimations = N(RightWingAnims),
140 .defenseTable = N(DownedDefense),
141 .eventFlags = 0,
142 .elementImmunityFlags = 0,
143 .projectileTargetOffset = { 0, -10 },
144 },
145};
146
147ActorBlueprint NAMESPACE = {
148 .flags = ACTOR_FLAG_FLYING,
151 .maxHP = 7,
152 .partCount = ARRAY_COUNT(N(ActorParts)),
153 .partsData = N(ActorParts),
154 .initScript = &N(EVS_Flying_Init),
155 .statusTable = N(FlyingStatusTable),
156 .escapeChance = 65,
157 .airLiftChance = 95,
158 .hurricaneChance = 90,
159 .spookChance = 80,
160 .upAndAwayChance = 95,
161 .spinSmashReq = 0,
162 .powerBounceChance = 100,
163 .coinReward = 1,
164 .size = { 36, 26 },
165 .healthBarOffset = { 0, 0 },
166 .statusIconOffset = { -10, 20 },
167 .statusTextOffset = { 10, 20 },
168};
169
170s32 N(FlyingAnims)[] = {
181};
182
183s32 N(FlyingShuffleAnims)[] = {
194};
195
196s32 N(LeftWingAnims)[] = {
199};
200
201s32 N(RightWingAnims)[] = {
204};
205
210 Return
211 End
212};
213
215 Label(10)
216 Call(RandInt, 80, LVar0)
217 Add(LVar0, 80)
218 Loop(LVar0)
219 Label(0)
222 Wait(1)
223 Goto(0)
224 EndIf
225 Wait(1)
226 EndLoop
228 Add(LVar0, 5)
233 Loop(20)
234 Label(1)
237 Wait(1)
238 Goto(1)
239 EndIf
240 Wait(1)
241 EndLoop
243 Sub(LVar0, 5)
248 Loop(40)
249 Label(2)
252 Wait(1)
253 Goto(2)
254 EndIf
255 Wait(1)
256 EndLoop
257 Goto(10)
258 Return
259 End
260};
261
268 Return
269 End
270};
271
287 EndIf
288 EndIf
303 Return
331 Return
344 Wait(10)
348 Return
350 Call(SetActorPos, ACTOR_SELF, 20, 0, 0)
366 Return
375 Return
380 Return
381 End
382};
383
394 Call(AddGoalPos, ACTOR_SELF, 50, 0, 0)
401 Set(LVarA, LVar0)
402 Wait(10)
418 Sub(LVar0, 80)
419 Set(LVar1, 20)
424 Thread
425 Loop(4)
427 Wait(4)
428 EndLoop
433 Wait(10)
436 EndIf
437 Wait(10)
449 Return
452 Wait(10)
472 Wait(2)
479 Call(AddGoalPos, ACTOR_SELF, 50, 10, 0)
484 Wait(5)
492 Return
493 End
494};
495
496#include "common/StartRumbleWithParams.inc.c"
497
512 Else
514 EndIf
517 Set(LVar1, 0)
521 Call(N(StartRumbleWithParams), 100, 10)
522 Thread
523 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(0.3))
527 IfEq(LVar3, 15)
530 Add(LVar4, 10)
531 Add(LVar5, 5)
533 EndIf
538 Loop(10)
541 Wait(1)
544 Wait(1)
545 EndLoop
549 Mod(LVar0, 4)
561 Return
562 End
563};
564
565s32 N(DownedAnims)[] = {
576};
577
578s32 N(DownedShuffleAnims)[] = {
589};
590
595 Return
596 End
597};
598
600 Label(10)
601 Call(RandInt, 80, LVar0)
602 Add(LVar0, 80)
603 Loop(LVar0)
604 Label(0)
607 Wait(1)
608 Goto(0)
609 EndIf
610 Wait(1)
611 EndLoop
613 Add(LVar0, 5)
619 Loop(20)
620 Label(1)
623 Wait(1)
624 Goto(1)
625 EndIf
626 Wait(1)
627 EndLoop
629 Sub(LVar0, 5)
635 Loop(80)
636 Label(2)
639 Wait(1)
640 Goto(2)
641 EndIf
642 Wait(1)
643 EndLoop
644 Goto(10)
645 Return
646 End
647};
648
652 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
674 Return
686 Return
701 Wait(5)
712 Return
725 Wait(10)
729 Return
747 Return
756 Return
762 Return
763 End
764};
765
766#include "common/CalculateArcsinDeg.inc.c"
767
777 Call(AddGoalPos, ACTOR_SELF, 50, 0, 0)
782 Wait(1)
784 Wait(5)
791 Set(LVarA, LVar0)
794 Sub(LVar0, 10)
795 Set(LVar1, 10)
796 Add(LVar2, 3)
799 Thread
801 Set(LVar0, 0)
802 Loop(16)
806 Set(LVar1, LVar4)
807 Set(LVar2, LVar5)
808 Set(LVar3, LVar6)
809 Wait(1)
810 EndLoop
812 Thread
813 Wait(6)
818 Call(SetActorScale, ACTOR_SELF, Float(1.1), Float(0.8), Float(1.0))
820 Wait(1)
821 Call(SetActorScale, ACTOR_SELF, Float(1.3), Float(0.5), Float(1.0))
823 Wait(1)
824 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
827 Wait(5)
830 EndIf
831 Wait(5)
836 Add(LVar0, 20)
837 Set(LVar1, 0)
840 Thread
841 Wait(4)
842 Set(LVar0, 180)
843 Loop(4)
844 Sub(LVar0, 45)
846 Wait(1)
847 EndLoop
852 Wait(5)
863 Wait(5)
870 Return
875 Thread
877 Set(LVar0, 0)
878 Loop(16)
882 Set(LVar1, LVar4)
883 Set(LVar2, LVar5)
884 Set(LVar3, LVar6)
885 Wait(1)
886 EndLoop
888 Thread
889 Wait(6)
894 Call(SetActorScale, ACTOR_SELF, Float(1.1), Float(0.8), Float(1.0))
895 Wait(1)
896 Call(SetActorScale, ACTOR_SELF, Float(1.3), Float(0.5), Float(1.0))
897 Wait(1)
904 Call(SetActorScale, ACTOR_SELF, Float(1.1), Float(0.8), Float(1.0))
905 Wait(1)
906 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
907 Wait(1)
912 Add(LVar0, 40)
913 Set(LVar1, 0)
917 Add(LVar0, 30)
920 Add(LVar0, 20)
924 Wait(3)
936 Return
937 End
938};
BSS s32 PopupMenu_SelectedIndex
Bytecode EvtScript[]
#define STATUS_FLAGS_IMMOBILIZED
Definition enums.h:2834
@ BTL_CAM_XADJ_AVG
Definition enums.h:4899
@ ACTOR_SOUND_FLY
Definition enums.h:2035
@ ACTOR_SOUND_JUMP
Definition enums.h:2036
@ 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
@ ACTOR_EVENT_FLAG_GROUNDABLE
Actor can be knocked down from flight; triggered by jump attacks.
Definition enums.h:3382
@ ACTOR_DECORATION_SWEAT
Definition enums.h:2045
@ PHASE_FIRST_STRIKE
Definition enums.h:2059
@ ENCOUNTER_TRIGGER_HAMMER
Definition enums.h:271
@ 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_ENEMY_DIVE
Definition enums.h:4887
@ BTL_CAM_ENEMY_APPROACH
Definition enums.h:4884
@ EASING_SIN_OUT
Definition enums.h:521
@ EASING_QUADRATIC_OUT
Definition enums.h:514
@ EASING_LINEAR
Definition enums.h:510
@ IDLE_SCRIPT_RESTART
Definition enums.h:6408
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6407
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6406
@ SOUND_PARAGOOMBA_FLY
Definition enums.h:1509
@ SOUND_NONE
Definition enums.h:547
@ SOUND_PARAGOOMBA_PREDIVE
Definition enums.h:1510
@ SOUND_FALL_QUICK
Definition enums.h:1090
@ SOUND_PARAGOOMBA_DIVE
Definition enums.h:1029
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_SELF
Definition enums.h:2084
@ ACTOR_FLAG_FLYING
Quake Hammer can't hit.
Definition enums.h:3329
@ ACTOR_FLAG_TYPE_CHANGED
Indicates actors type has changed, triggers recheck for if HP bar should be shown based on tattle sta...
Definition enums.h:3332
@ 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_BEGIN_FIRST_STRIKE
Definition enums.h:2173
@ EVENT_STAR_BEAM
Definition enums.h:2140
@ EVENT_END_FIRST_STRIKE
Definition enums.h:2171
@ EVENT_IMMUNE
Definition enums.h:2146
@ EVENT_FALL_TRIGGER
Definition enums.h:2134
@ 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_15
Definition enums.h:2137
@ 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_NO_SHADOW
Definition enums.h:3352
@ ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION
Definition enums.h:3361
@ 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_TRIGGER_LUCKY
Definition enums.h:2881
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 LVar6
Definition macros.h:154
#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 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 Float(DOUBLE)
Definition macros.h:51
#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 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 LVarA
Definition macros.h:158
#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