3#include "sprite/npc/Koopatrol.h"
6#define NAMESPACE A(koopatrol)
20 AVAL_State_Normal = 0,
21 AVAL_State_Toppled = 1,
22 AVAL_State_Charged = 2,
24 AVAR_AncestorColumn = 2,
25 AVAR_FlippedTurns = 9,
30 DMG_CHARGED_TOSS = 10,
33s32 N(DefaultAnims)[] = {
46s32 N(ShuffleAnims)[] = {
59s32 N(ToppledAnims)[] = {
72s32 N(ChargedAnims)[] = {
85s32 N(DefenseTable)[] = {
91s32 N(ToppledDefense)[] = {
96s32 N(ChargedDefense)[] = {
102s32 N(StatusTable)[] = {
127s32 N(ChargedStatusTable)[] = {
154 .posOffset = { 0, 0, 0 },
155 .targetOffset = { 0, 32 },
157 .idleAnimations = N(DefaultAnims),
158 .defenseTable = N(DefenseTable),
160 .elementImmunityFlags = 0,
161 .projectileTargetOffset = { 0, -12 },
167 .type = ACTOR_TYPE_KOOPATROL,
168 .level = ACTOR_LEVEL_KOOPATROL,
171 .partsData = N(ActorParts),
172 .initScript = &N(EVS_Init),
173 .statusTable = N(StatusTable),
176 .hurricaneChance = 65,
178 .upAndAwayChance = 95,
180 .powerBounceChance = 85,
183 .healthBarOffset = { 0, 0 },
184 .statusIconOffset = { -15, 32 },
185 .statusTextOffset = { 5, 32 },
232 Call(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20)
236 Call(N(SetAbsoluteStatusOffsets), -15, 32, 5, 32)
238 CaseEq(AVAL_State_Toppled)
241 Call(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20)
242 CaseEq(AVAL_State_Charged)
245 Call(N(SetAbsoluteStatusOffsets), -15, 22, 5, 22)
280 CaseEq(AVAL_State_Toppled)
308 CaseEq(AVAL_State_Toppled)
331s32 N(FlipPosOffsets)[] = { 9, 16, 22, 26, 30, 32, 33, 32, 30, 26, 22, 16, 9, 0, 4, 6, 7, 6, 4, 0, 2, 0 };
349 CaseEq(AVAL_State_Charged)
378 CaseEq(AVAL_State_Charged)
395 CaseEq(AVAL_State_Charged)
489 CaseEq(AVAL_State_Toppled)
493 CaseEq(AVAL_State_Charged)
542 CaseEq(AVAL_State_Charged)
560 CaseEq(AVAL_State_Toppled)
564 CaseEq(AVAL_State_Charged)
580 CaseEq(AVAL_State_Toppled)
592 CaseEq(AVAL_State_Toppled)
596 CaseEq(AVAL_State_Charged)
607 CaseEq(AVAL_State_Toppled)
610 CaseEq(AVAL_State_Charged)
622 CaseEq(AVAL_State_Toppled)
625 CaseEq(AVAL_State_Charged)
729 Call(SetBattleCamDist, 300)
730 Call(SetBattleCamOffsetY, 20)
731 Call(MoveBattleCamOver, 10)
818 Call(MoveBattleCamOver, 20)
826 Call(MoveBattleCamOver, 20)
836 Call(N(StartRumbleWithParams), 128, 10)
990 Call(InitTargetIterator)
996 CaseOrEq(ACTOR_TYPE_BOMBSHELL_BLASTER)
1010 Call(InitTargetIterator)
1061 Call(MoveBattleCamOver, 20)
1080 Call(MoveBattleCamOver, 15)
1092 Call(SummonEnemy,
Ref(N(BackupFormation)), FALSE)
1099 Call(SetAnimation,
LVar0, 1, ANIM_Koopatrol_Anim06)
1102 Call(SetAnimation,
LVar0, 1, ANIM_Koopatrol_Anim08)
1104 Call(SetAnimation,
LVar0, 1, ANIM_Koopatrol_Anim01)
1111 Call(SetActorVar,
LVar0, AVAR_Generation, 1)
1113 Call(SetActorVar,
LVar0, AVAR_Generation, 2)
1141EvtScript N(EVS_CountActiveSummoners) = {
1144 Call(InitTargetIterator)
1149 CaseEq(ACTOR_TYPE_KOOPATROL)
1195 CaseEq(AVAL_State_Normal)
1218 ExecWait(N(EVS_Attack_ChargedToss))
1230 ExecWait(N(EVS_Attack_ChargedToss))
1237 ExecWait(N(EVS_GetAvailableColumn))
1242 ExecWait(N(EVS_Attack_ChargedToss))
1249 ExecWait(N(EVS_CountActiveSummoners))
1276 ExecWait(N(EVS_Attack_ChargedToss))
1301 ExecWait(N(EVS_Attack_ChargedToss))
1313 ExecWait(N(EVS_GetAvailableColumn))
1318 ExecWait(N(EVS_CountActiveSummoners))
1341 ExecWait(N(EVS_Attack_ChargedToss))
1343 CaseEq(AVAL_State_Toppled)
1346 CaseEq(AVAL_State_Charged)
1347 ExecWait(N(EVS_Attack_ChargedToss))
#define STATUS_FLAGS_IMMOBILIZED
@ BS_FLAGS1_TRIGGER_EVENTS
@ BS_FLAGS1_INCLUDE_POWER_UPS
@ ACTOR_EVENT_FLAG_ATTACK_CHARGED
Actor has charged an attack that can be removed with Star Beam.
@ ACTOR_EVENT_FLAG_FLIPABLE
Actor can be flipped; triggered by jump and quake attacks.
@ ACTOR_EVENT_FLAG_SPIKY_TOP
Player takes spike damage from jump attacks.
@ STATUS_TURN_MOD_DEFAULT
@ STATUS_TURN_MOD_PARALYZE
@ BTL_CAM_ACTOR_TARGET_MIDPOINT
@ TARGET_FLAG_PRIMARY_ONLY
@ STATUS_FLAG_ATTACK_BOOST
@ STATUS_FLAG_DEFENSE_BOOST
@ SOUND_KOOPA_LAUNCH_SHELL
@ ACTOR_FLAG_FLIPPED
Actor has been flipped over.
@ ACTOR_PART_FLAG_PRIMARY_TARGET
@ DAMAGE_TYPE_TRIGGER_LUCKY
EvtScript EVS_Enemy_ReturnHome
EvtScript EVS_Enemy_Knockback
EvtScript EVS_Enemy_ScareAway
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.
#define Switch(LVAR)
Marks the start of a switch statement.
#define Ref(sym)
Address/pointer constant.
#define IfGe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR >= RVAR.
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
#define CaseEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR. It also marks the end of any pre...
#define Sub(VAR, INT_VALUE)
#define IfNe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR != RVAR.
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
#define UseBuf(INT_PTR)
Loads a s32 pointer for use with subsequent EVT_BUF_READ commands.
#define Mod(VAR, INT_VALUE)
#define Add(VAR, INT_VALUE)
#define EndLoop
Marks the end of a loop.
#define EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
#define Goto(LABEL_ID)
Moves execution to the given label.
#define BufRead1(VAR)
Consumes the next s32 from the buffer and stores it in the given variable.
#define IfGt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR <= RVAR.
#define IfLt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR < RVAR.
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
#define CaseOrEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR.
#define EndIf
Marks the end of an if statement or an else block.
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
#define BreakLoop
Breaks out of the innermost loop.
#define Thread
Marks the start of a thread block.
#define EndThread
Marks the end of a thread block.
#define IfFlag(LVAR, RVAR)
Marks the beginning of an if statement that only executes if the RVAR flag is set on LVAR,...
#define IfNotFlag(LVAR, RVAR)
Marks the beginning of an if statement that only executes if the RVAR flag is unset on LVAR,...
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
#define NPC_DISPOSE_LOCATION
#define PlayEffect(args...)
#define EndSwitch
Marks the end of a switch statement and any case.
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
#define Loop(TIMES)
Marks the beginning of a loop.
#define SetConst(VAR, CONST)
Sets the given variable to a given value, skipping the evt_get_variable call.
#define Return
Kills the current EVT thread.
#define ACTOR_BY_POS(_name, _pos, _priority, args...)
@ BTL_VAR_KoopatrolSummonCount_2
@ BTL_VAL_HyperSync_Active
@ BTL_VAR_KoopatrolSummonCount_0
@ BTL_VAR_KoopatrolSummonCount_1
@ BTL_VAR_KoopatrolSummonCount_3