3#include "sprite/npc/Magikoopa.h"
4#include "sprite/npc/FlyingMagikoopa.h"
7#define NAMESPACE A(magikoopa)
9extern s32 N(GroundAnims)[];
10extern s32 N(FlyingAnims)[];
11extern s32 N(BroomAnims)[];
18extern EvtScript N(EVS_Flying_HandleEvent);
27 AVAR_HitTypeFlags = 0,
28 AVAL_HitType_Combo = 1,
30 AVAR_ShouldKnockDown = 2,
31 AVAR_HealAllCount = 3,
32 AVAR_HealOneCount = 4,
33 AVAR_AttackBoostCount = 5,
34 AVAR_DefenseBoostCount = 6,
35 AVAR_ElectrifyCount = 7,
36 AVAR_TransparifyCount = 8,
37 AVAR_CloneActorID = 9,
38 AVAR_MadeCloneLastTurn = 10,
40 AVAL_LastMove_None = -1,
41 AVAL_LastMove_HealOne = 0,
42 AVAL_LastMove_HealAll = 1,
43 AVAL_LastMove_MagicBlast = 2,
44 AVAL_LastMove_MakeClone = 3,
45 AVAL_LastMove_BoostAttack = 4,
46 AVAL_LastMove_BoostDefense = 5,
47 AVAL_LastMove_Electrify = 6,
48 AVAL_LastMove_Transparify = 7,
56 DEFENSE_BOOST_AMT = 1,
58 TRANSPARIFY_TURNS = 2,
62 MAX_DEFENSE_BOOST = 3,
65 HEAL_THRESHOLD_1 = 25,
66 HEAL_THRESHOLD_2 = 20,
67 HEAL_THRESHOLD_3 = 15,
71 HEAL_ONE_CHANCE = 500,
72 HEAL_ALL_CHANCE = 500,
75s32 N(DefenseTable)[] = {
80s32 N(FlyingDefense)[] = {
85s32 N(StatusTable)[] = {
110s32 N(FlyingStatusTable)[] = {
139 .posOffset = { 0, 0, 0 },
140 .targetOffset = { 2, 35 },
142 .idleAnimations = N(GroundAnims),
143 .defenseTable = N(DefenseTable),
145 .elementImmunityFlags = 0,
146 .projectileTargetOffset = { -5, -12 },
154 .posOffset = { 0, 0, 0 },
155 .targetOffset = { 2, 35 },
157 .idleAnimations = N(GroundAnims),
158 .defenseTable = N(FlyingDefense),
160 .elementImmunityFlags = 0,
161 .projectileTargetOffset = { -5, -12 },
166 .posOffset = { 0, 0, 0 },
167 .targetOffset = { -10, 35 },
169 .idleAnimations = N(FlyingAnims),
170 .defenseTable = N(FlyingDefense),
172 .elementImmunityFlags = 0,
173 .projectileTargetOffset = { 0, -8 },
178 .posOffset = { 0, 0, 0 },
179 .targetOffset = { 0, 0 },
181 .idleAnimations = N(BroomAnims),
182 .defenseTable = N(FlyingDefense),
184 .elementImmunityFlags = 0,
185 .projectileTargetOffset = { 0, 0 },
191 .type = ACTOR_TYPE_MAGIKOOPA,
192 .level = ACTOR_LEVEL_MAGIKOOPA,
195 .partsData = N(ActorParts),
196 .initScript = &N(EVS_Init),
197 .statusTable = N(StatusTable),
200 .hurricaneChance = 70,
202 .upAndAwayChance = 95,
204 .powerBounceChance = 80,
207 .healthBarOffset = { 0, 0 },
208 .statusIconOffset = { -10, 20 },
209 .statusTextOffset = { 10, 32 },
214 .type = ACTOR_TYPE_FLYING_MAGIKOOPA,
215 .level = ACTOR_LEVEL_FLYING_MAGIKOOPA,
218 .partsData = N(FlyingParts),
219 .initScript = &N(EVS_Flying_Init),
220 .statusTable = N(FlyingStatusTable),
223 .hurricaneChance = 75,
225 .upAndAwayChance = 95,
227 .powerBounceChance = 80,
230 .healthBarOffset = { 0, 0 },
231 .statusIconOffset = { -25, 20 },
232 .statusTextOffset = { 1, 34 },
235s32 N(GroundAnims)[] = {
248s32 N(FlyingAnims)[] = {
261s32 N(BroomAnims)[] = {
300#include "common/GetSelectedMoveID.inc.c"
362 Call(N(StartRumbleWithParams), 150, 10)
390 Call(N(SetAbsoluteStatusOffsets), -10, 20, 10, 32)
413 Call(MoveBattleCamOver, 15)
757 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim01)
761 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim01)
769 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim04)
775 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim02)
816 Call(SetActorVar,
ACTOR_SELF, AVAR_LastMove, AVAL_LastMove_HealOne)
823 Call(MoveBattleCamOver, 15)
829 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim02)
868 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim01)
879 Call(FreezeBattleState, TRUE)
880 Call(HealActor,
LVarB, HEAL_AMT_ONE, FALSE)
881 Call(FreezeBattleState, FALSE)
883 Call(WaitForBuffDone)
885 Call(MoveBattleCamOver, 10)
896 Call(SetActorVar,
ACTOR_SELF, AVAR_LastMove, AVAL_LastMove_HealAll)
903 Call(MoveBattleCamOver, 15)
909 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim02)
948 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim01)
952 Call(InitTargetIterator)
972 Call(FreezeBattleState, TRUE)
973 Call(HealActor,
LVar0, HEAL_AMT_ALL, TRUE)
974 Call(FreezeBattleState, FALSE)
981 Call(WaitForBuffDone)
984 Call(MoveBattleCamOver, 10)
994 Call(SetActorVar,
ACTOR_SELF, AVAR_LastMove, AVAL_LastMove_MagicBlast)
1014 Call(MoveBattleCamOver, 1)
1017 Call(MoveBattleCamOver, 10)
1022 Call(SetAnimation,
LVarA, 1, ANIM_Magikoopa_Anim02)
1028 Call(SetAnimation,
ACTOR_SELF, PRT_GROUND, ANIM_Magikoopa_Anim02)
1041 Call(SetAnimation,
LVarA, 1, ANIM_FlyingMagikoopa_Anim02)
1047 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim02)
1070 Call(SetAnimation,
LVarA, 1, ANIM_Magikoopa_Anim03)
1072 Call(SetAnimation,
ACTOR_SELF, PRT_GROUND, ANIM_Magikoopa_Anim03)
1075 Call(SetAnimation,
LVarA, 1, ANIM_FlyingMagikoopa_Anim03)
1077 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim03)
1138 Call(SetAnimation,
LVarA, 1, ANIM_Magikoopa_Anim03)
1140 Call(SetAnimation,
ACTOR_SELF, PRT_GROUND, ANIM_Magikoopa_Anim03)
1143 Call(SetAnimation,
LVarA, 1, ANIM_FlyingMagikoopa_Anim03)
1145 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim03)
1210 Call(InitTargetIterator)
1285s32 N(CloneDefense)[] = {
1290s32 N(FlyingCloneDefense)[] = {
1295s32 N(CloneStatusTable)[] = {
1320s32 N(FlyingCloneStatusTable)[] = {
1348 .index = PRT_GROUND,
1349 .posOffset = { 0, 0, 0 },
1350 .targetOffset = { 2, 35 },
1352 .idleAnimations = N(GroundAnims),
1353 .defenseTable = N(CloneDefense),
1355 .elementImmunityFlags = 0,
1356 .projectileTargetOffset = { -5, -12 },
1363 .index = PRT_GROUND,
1364 .posOffset = { 0, 0, 0 },
1365 .targetOffset = { -10, 35 },
1367 .idleAnimations = N(FlyingAnims),
1368 .defenseTable = N(FlyingCloneDefense),
1370 .elementImmunityFlags = 0,
1371 .projectileTargetOffset = { 0, -8 },
1377 .type = ACTOR_TYPE_MAGICLONE,
1378 .level = ACTOR_LEVEL_MAGICLONE,
1381 .partsData = N(CloneParts),
1382 .initScript = &N(EVS_Clone_Init),
1383 .statusTable = N(CloneStatusTable),
1386 .hurricaneChance = 0,
1388 .upAndAwayChance = 0,
1390 .powerBounceChance = 75,
1393 .healthBarOffset = { 0, 0 },
1394 .statusIconOffset = { -10, 20 },
1395 .statusTextOffset = { 10, 32 },
1400 .type = ACTOR_TYPE_FLYING_MAGICLONE,
1401 .level = ACTOR_LEVEL_FLYING_MAGICLONE,
1404 .partsData = N(FlyingCloneParts),
1405 .initScript = &N(EVS_FlyingClone_Init),
1406 .statusTable = N(FlyingCloneStatusTable),
1409 .hurricaneChance = 0,
1411 .upAndAwayChance = 0,
1413 .powerBounceChance = 75,
1416 .healthBarOffset = { 0, 0 },
1417 .statusIconOffset = { -25, 20 },
1418 .statusTextOffset = { 1, 34 },
1438 Call(SetActorVar,
ACTOR_SELF, AVAR_LastMove, AVAL_LastMove_MakeClone)
1445 Call(SummonEnemy,
Ref(N(CloneFormation)), FALSE)
1447 Call(SummonEnemy,
Ref(N(FlyingCloneFormation)), FALSE)
1458 Call(MoveBattleCamOver, 25)
1462 Call(SetAnimation,
ACTOR_SELF, PRT_GROUND, ANIM_Magikoopa_Anim02)
1463 Call(SetAnimation,
LVarA, 1, ANIM_Magikoopa_Anim02)
1467 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim02)
1468 Call(SetAnimation,
LVarA, 1, ANIM_FlyingMagikoopa_Anim02)
1483 Call(MoveBattleCamOver, 30)
1490 ExecWait(N(EVS_GetAvailableColumn))
1495 ExecWait(N(EVS_GetAvailableColumn))
1514 Call(SetAnimation,
ACTOR_SELF, PRT_GROUND, ANIM_Magikoopa_Anim01)
1515 Call(SetAnimation,
LVar9, 1, ANIM_Magikoopa_Anim01)
1517 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim01)
1518 Call(SetAnimation,
LVar9, 1, ANIM_FlyingMagikoopa_Anim01)
1526#include "common/battle/CheckMagikoopaCastTarget.inc.c"
1532 Call(InitTargetIterator)
1567 Call(SetActorVar,
ACTOR_SELF, AVAR_LastMove, AVAL_LastMove_BoostAttack)
1574 Call(MoveBattleCamOver, 15)
1578 Call(SetAnimation,
ACTOR_SELF, PRT_GROUND, ANIM_Magikoopa_Anim02)
1580 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim02)
1617 Call(SetAnimation,
ACTOR_SELF, PRT_GROUND, ANIM_Magikoopa_Anim01)
1619 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim01)
1627 Call(FreezeBattleState, TRUE)
1628 Call(BoostAttack,
LVar8, ATTACK_BOOST_AMT)
1629 Call(FreezeBattleState, FALSE)
1631 Call(WaitForBuffDone)
1641EvtScript N(EVS_Move_TryBoostDefense) = {
1645 Call(InitTargetIterator)
1680 Call(SetActorVar,
ACTOR_SELF, AVAR_LastMove, AVAL_LastMove_BoostDefense)
1687 Call(MoveBattleCamOver, 15)
1691 Call(SetAnimation,
ACTOR_SELF, PRT_GROUND, ANIM_Magikoopa_Anim02)
1693 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim02)
1730 Call(SetAnimation,
ACTOR_SELF, PRT_GROUND, ANIM_Magikoopa_Anim01)
1732 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim01)
1740 Call(FreezeBattleState, TRUE)
1741 Call(BoostDefense,
LVar8, DEFENSE_BOOST_AMT)
1742 Call(FreezeBattleState, FALSE)
1744 Call(WaitForBuffDone)
1758 Call(InitTargetIterator)
1793 Call(SetActorVar,
ACTOR_SELF, AVAR_LastMove, AVAL_LastMove_Electrify)
1800 Call(MoveBattleCamOver, 15)
1804 Call(SetAnimation,
ACTOR_SELF, PRT_GROUND, ANIM_Magikoopa_Anim02)
1806 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim02)
1843 Call(SetAnimation,
ACTOR_SELF, PRT_GROUND, ANIM_Magikoopa_Anim01)
1845 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim01)
1858 Call(FreezeBattleState, TRUE)
1859 Call(ElectrifyActor,
LVar8, ELECTRIFY_TURNS)
1860 Call(FreezeBattleState, FALSE)
1862 Call(WaitForBuffDone)
1876 Call(InitTargetIterator)
1911 Call(SetActorVar,
ACTOR_SELF, AVAR_LastMove, AVAL_LastMove_Transparify)
1918 Call(MoveBattleCamOver, 15)
1922 Call(SetAnimation,
ACTOR_SELF, PRT_GROUND, ANIM_Magikoopa_Anim02)
1924 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim02)
1961 Call(SetAnimation,
ACTOR_SELF, PRT_GROUND, ANIM_Magikoopa_Anim01)
1963 Call(SetAnimation,
ACTOR_SELF, PRT_FLYING, ANIM_FlyingMagikoopa_Anim01)
1971 Call(FreezeBattleState, TRUE)
1972 Call(VanishActor,
LVar8, TRANSPARIFY_TURNS)
1973 Call(FreezeBattleState, FALSE)
1975 Call(WaitForBuffDone)
1986 #define LBL_LOOP_COUNT_INJURED_1 0
1987 #define LBL_LOOP_COUNT_INJURED_2 1
1988 #define LBL_LOOP_COUNT_INJURED_3 2
1989 #define LBL_TRY_HEALING 10
1990 #define LBL_LOOP_CHOOSE_BEST_HEAL 11
1991 #define LBL_TRY_MOVES 20
1992 #define LBL_CHOOSE_MOVE 123
2005 Call(InitTargetIterator)
2040 Call(InitTargetIterator)
2075 Call(InitTargetIterator)
2149 Call(InitTargetIterator)
2200 ExecWait(N(EVS_GetAvailableColumn))
2211 CaseEq(AVAL_LastMove_BoostAttack)
2225 CaseEq(AVAL_LastMove_BoostDefense)
2280 ExecWait(N(EVS_Move_TryBoostAttack))
2285 ExecWait(N(EVS_Move_TryBoostDefense))
2293 ExecWait(N(EVS_Move_TryTransparent))
#define STATUS_FLAGS_IMMOBILIZED
@ BS_FLAGS1_PARTNER_ACTING
@ BS_FLAGS1_TRIGGER_EVENTS
@ BS_FLAGS1_INCLUDE_POWER_UPS
@ BS_FLAGS1_EXECUTING_MOVE
@ ACTOR_EVENT_FLAG_RIDING_BROOMSTICK
Actor is on Magikoopa Broomstick, effect seems to be redundant.
@ ACTOR_EVENT_FLAG_ATTACK_CHARGED
Actor has charged an attack that can be removed with Star Beam.
@ ACTOR_EVENT_FLAG_ILLUSORY
Player attacks pass through and miss.
@ STATUS_TURN_MOD_DEFAULT
@ STATUS_TURN_MOD_PARALYZE
@ TARGET_FLAG_PRIMARY_ONLY
@ STATUS_FLAG_TRANSPARENT
@ SOUND_MAGIKOOPA_ELECTRIFY
@ SOUND_MAGIKOOPA_POWER_UP
@ ACTOR_FLAG_FLYING
Quake Hammer can't hit.
@ ACTOR_FLAG_TYPE_CHANGED
Indicates actors type has changed, triggers recheck for if HP bar should be shown based on tattle sta...
@ ACTOR_FLAG_NO_ATTACK
Skip attack turn.
@ EVENT_BEGIN_FIRST_STRIKE
@ ACTOR_PART_FLAG_PRIMARY_TARGET
@ ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION
@ ACTOR_PART_FLAG_NO_TARGET
Cannot be targeted.
@ ACTOR_PART_FLAG_INVISIBLE
@ DAMAGE_TYPE_TRIGGER_LUCKY
@ DAMAGE_TYPE_MULTIPLE_POPUPS
EvtScript EVS_Enemy_Death
EvtScript EVS_Enemy_SpinSmashHit
EvtScript EVS_Enemy_AirLift
EvtScript EVS_ForceNextTarget
EvtScript EVS_Enemy_BlowAway
EvtScript EVS_Enemy_Recover
EvtScript EVS_Enemy_BurnHit
EvtScript EVS_Enemy_NoDamageHit
#define LBL_LOOP_COUNT_INJURED_1
#define LBL_LOOP_CHOOSE_BEST_HEAL
#define LBL_LOOP_COUNT_INJURED_2
#define LBL_LOOP_COUNT_INJURED_3
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 DivF(VAR, FLOAT_VALUE)
#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 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 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 CaseDefault
Marks the start of a switch case that executes unconditionally. It also marks the end of any previous...
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
#define IfLe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR > RVAR.
#define Thread
Marks the start of a thread block.
#define EndThread
Marks the end of a thread block.
#define SetF(VAR, FLOAT_VALUE)
Sets the given variable to a given value, but supports Floats.
#define IfFlag(LVAR, RVAR)
Marks the beginning of an if statement that only executes if the RVAR flag is set on LVAR,...
#define BitwiseAndConst(VAR, CONST)
VAR &= CONST, but CONST is treated as-is rather than dereferenced with evt_get_variable.
#define MulF(VAR, FLOAT_VALUE)
#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 BitwiseOrConst(VAR, CONST)
VAR |= CONST, but CONST is treated as-is rather than dereferenced with evt_get_variable.
#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...)
@ AVAR_DryBones_Collapsed
@ BTL_VAR_Magikoopa_LastIndexBoosted