Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
paragoomba.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/npc/Goomba.h"
6#include "sprite/npc/Paragoomba.h"
7
8#define NAMESPACE A(paragoomba)
9
10extern s32 N(DefaultAnims)[];
11extern s32 N(LeftWingAnims)[];
12extern s32 N(RightWingAnims)[];
13extern EvtScript N(EVS_Init);
14extern EvtScript N(EVS_Idle);
15extern EvtScript N(EVS_TakeTurn);
17extern EvtScript N(EVS_KnockDown);
18
21
22enum N(ActorPartIDs) {
23 PRT_MAIN = 1, // body after being downed (must use same name as Goomba part #1)
24 PRT_FLYING = 2, // body while flying
25 PRT_DUMMY_WING_L = 3, // temporary wing while being downed
26 PRT_DUMMY_WING_R = 4, // temporary wing while being downed
27};
28
29enum N(ActorParams) {
30 DMG_AIR_KICK = 1,
31};
32
33s32 N(DownedDefense)[] = {
36};
37
38s32 N(FlyingDefense)[] = {
41};
42
43s32 N(DownedStatusTable)[] = {
50 STATUS_KEY_FEAR, 100,
54 STATUS_KEY_STOP, 100,
66};
67
68s32 N(FlyingStatusTable)[] = {
79 STATUS_KEY_STOP, 100,
91};
92
94 {
96 .index = PRT_MAIN,
97 .posOffset = { 0, 0, 0 },
98 .targetOffset = { 0, 20 },
99 .opacity = 255,
100 .idleAnimations = A(downed_goomba_DefaultAnims),
101 .defenseTable = N(DownedDefense),
102 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
103 .elementImmunityFlags = 0,
104 .projectileTargetOffset = { 0, -10 },
105 },
106 {
108 .index = PRT_FLYING,
109 .posOffset = { 0, 0, 0 },
110 .targetOffset = { 0, 24 },
111 .opacity = 255,
112 .idleAnimations = N(DefaultAnims),
113 .defenseTable = N(FlyingDefense),
114 .eventFlags = ACTOR_EVENT_FLAG_GROUNDABLE,
115 .elementImmunityFlags = 0,
116 .projectileTargetOffset = { 0, -10 },
117 },
118 {
120 .index = PRT_DUMMY_WING_L,
121 .posOffset = { 0, 0, 0 },
122 .targetOffset = { -16, 24 },
123 .opacity = 255,
124 .idleAnimations = N(LeftWingAnims),
125 .defenseTable = N(DownedDefense),
126 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
127 .elementImmunityFlags = 0,
128 .projectileTargetOffset = { 0, -10 },
129 },
130 {
132 .index = PRT_DUMMY_WING_R,
133 .posOffset = { 0, 0, 0 },
134 .targetOffset = { -16, 24 },
135 .opacity = 255,
136 .idleAnimations = N(RightWingAnims),
137 .defenseTable = N(DownedDefense),
138 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
139 .elementImmunityFlags = 0,
140 .projectileTargetOffset = { 0, -10 },
141 },
142};
143
144ActorBlueprint NAMESPACE = {
145 .flags = ACTOR_FLAG_FLYING,
146 .type = ACTOR_TYPE_PARAGOOMBA,
147 .level = ACTOR_LEVEL_PARAGOOMBA,
148 .maxHP = 2,
149 .partCount = ARRAY_COUNT(N(ActorParts)),
150 .partsData = N(ActorParts),
151 .initScript = &N(EVS_Init),
152 .statusTable = N(FlyingStatusTable),
153 .escapeChance = 90,
154 .airLiftChance = 100,
155 .hurricaneChance = 100,
156 .spookChance = 100,
157 .upAndAwayChance = 95,
158 .spinSmashReq = 0,
159 .powerBounceChance = 100,
160 .coinReward = 1,
161 .size = { 36, 26 },
162 .healthBarOffset = { 0, 0 },
163 .statusIconOffset = { -10, 20 },
164 .statusTextOffset = { 10, 20 },
165};
166
167s32 N(DefaultAnims)[] = {
178};
179
180s32 N(ShuffleAnims)[] = {
191};
192
193s32 N(LeftWingAnims)[] = {
196};
197
198s32 N(RightWingAnims)[] = {
201};
202
203EvtScript N(EVS_Init) = {
207 Return
208 End
209};
210
211EvtScript N(EVS_Idle) = {
212 Label(10)
213 Call(RandInt, 80, LVar0)
214 Add(LVar0, 80)
215 Loop(LVar0)
216 Label(0)
219 Wait(1)
220 Goto(0)
221 EndIf
222 Wait(1)
223 EndLoop
225 Add(LVar0, 5)
230 Loop(20)
231 Label(1)
234 Wait(1)
235 Goto(1)
236 EndIf
237 Wait(1)
238 EndLoop
240 Sub(LVar0, 5)
245 Loop(40)
246 Label(2)
249 Wait(1)
250 Goto(2)
251 EndIf
252 Wait(1)
253 EndLoop
254 Goto(10)
255 Return
256 End
257};
258
265 Return
266 End
267};
268
284 EndIf
285 EndIf
300 Return
328 Return
341 Wait(10)
345 Return
347 Call(SetActorPos, ACTOR_SELF, 20, 0, 0)
363 Return
372 Return
377 Return
378 End
379};
380
391 Call(AddGoalPos, ACTOR_SELF, 50, 0, 0)
398 Set(LVarA, LVar0)
399 Wait(10)
415 Sub(LVar0, 80)
416 Set(LVar1, 20)
421 Thread
422 Loop(4)
424 Wait(4)
425 EndLoop
430 Wait(10)
433 EndIf
434 Wait(10)
446 Return
449 Wait(10)
469 Wait(2)
476 Call(AddGoalPos, ACTOR_SELF, 50, 10, 0)
481 Wait(5)
489 Return
490 End
491};
492
493#include "common/StartRumbleWithParams.inc.c"
494
509 Else
511 EndIf
514 Set(LVar1, 0)
518 Call(N(StartRumbleWithParams), 100, 10)
519 Thread
520 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(0.3))
527 Add(LVar4, 10)
528 Add(LVar5, 5)
530 EndIf
535 Loop(10)
538 Wait(1)
541 Wait(1)
542 EndLoop
546 Mod(LVar0, 4)
558 Return
559 End
560};
561
562// downed paragoombas are handled via a special nested goomba import
563#define NESTED_GOOMBA_INCLUDE
564#define NAMESPACE A(downed_goomba)
565#include "goomba.inc.c"
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_EVENT_FLAGS_NONE
Definition enums.h:3370
@ 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_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_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_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 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 A(sym)
Definition macros.h:36
#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