5#include "sprite/npc/BattleKooper.h"
10#define NAMESPACE battle_partner_kooper
26extern EvtScript N(shellTossOnFirstStrike);
42API_CALLABLE(N(SlowDown)) {
63 partnerActorMovement->
speed = partnerActorMovement->
speed / 1.5;
69 if (partnerActorMovement->
speed < 1.0) {
76API_CALLABLE(N(SetTargetsYaw)) {
86 script->functionTemp[0] = 0;
90 if (script->functionTemp[0] == 0) {
97 if (targetActor != NULL) {
103 targetActor->
yaw += 33;
105 targetActor->
yaw = 0;
114 if (actor->
state.varTable[0] != 0) {
119 targetActor->
yaw = 0.0f;
128API_CALLABLE(N(AverageTargetDizzyChance)) {
133 s32 targetActorBlueprintBaseStatusChance;
144 targetActorBlueprintBaseStatusChance = 0;
148 targetActorBlueprintBaseStatusChance = 0;
151 if (targetActorBlueprintBaseStatusChance > 0) {
152 chanceTotal += targetActorBlueprintBaseStatusChance;
158 script->varTable[0] = chanceTotal / nTargets;
160 script->varTable[0] = 0;
166API_CALLABLE(N(GetFireShellSpeedAndDamage)) {
167 s32 mashResult = script->varTable[0];
171 if (mashResult <= 35) {
174 }
else if (mashResult <= 60) {
177 }
else if (mashResult <= 80) {
180 }
else if (mashResult < 100) {
188 script->varTable[14] = speedRating;
189 script->varTable[15] = damage;
194s32 N(DefaultAnims)[] = {
205s32 N(DefenseTable)[] = {
210s32 N(StatusTable)[] = {
239 .posOffset = { 0, 0, 0 },
240 .targetOffset = { 8, 27 },
242 .idleAnimations = N(DefaultAnims),
243 .defenseTable = N(DefenseTable),
245 .elementImmunityFlags = 0,
246 .projectileTargetOffset = { 0, 0 },
252 .type = ACTOR_TYPE_KOOPER,
253 .level = ACTOR_LEVEL_KOOPER,
256 .partsData = N(ActorParts),
257 .initScript = &N(EVS_Init),
258 .statusTable = N(StatusTable),
261 .hurricaneChance = 0,
263 .upAndAwayChance = 0,
265 .powerBounceChance = 80,
268 .healthBarOffset = { 0, 0 },
269 .statusIconOffset = { -10, 30 },
270 .statusTextOffset = { 10, 30 },
289 Call(CloseActionCommandInfo)
411 Call(ShowActionHud, TRUE)
416 Call(LoadStarPowerScript)
475 Call(PartnerYieldTurn)
504 Call(PartnerYieldTurn)
550 Call(action_command_hammer_init)
551 Call(InitTargetIterator)
570 Call(action_command_hammer_start, 0, 50 *
DT - 3, 3)
571 Call(SetActionQuality, 0)
637 Call(MoveBattleCamOver, 15)
707 Call(action_command_hammer_init)
720 Call(InitTargetIterator)
740 Call(action_command_hammer_start, 0, 47, 3)
741 Call(SetActionQuality, 0)
808 Call(MoveBattleCamOver, 15)
886 Call(action_command_dizzy_shell_init)
887 Call(SetupMashMeter, 1, 100, 0, 0, 0, 0)
888 Call(InitTargetIterator)
901 Call(MoveBattleCamOver, 75 *
DT)
905 Call(battle_partner_kooper_AverageTargetDizzyChance)
907 Call(SetActionQuality, 0)
950 Call(MoveBattleCamOver, 15)
974 Call(N(SetTargetsYaw))
1043 Call(PartnerYieldTurn)
1058 Call(action_command_fire_shell_init)
1059 Call(SetupMashMeter, 5, 35, 60, 80, 99, 100)
1060 Call(InitTargetIterator)
1073 Call(MoveBattleCamOver, 75 *
DT)
1077 Call(action_command_fire_shell_start, 0,
LVarC, 3)
1088 Call(SetActorPaletteSwapParams,
ACTOR_PARTNER, -1, SPR_PAL_BattleKooper, SPR_PAL_BattleKooper, 1, 10, 1000, 10, 0, 0)
1101 Set(
LVar7, SPR_PAL_BattleKooper_Red4)
1104 Call(SetActorPaletteSwapParams,
ACTOR_PARTNER, -1,
LVar6,
LVar7, 1, 10, 1000, 10, 0, 0)
1110 Set(
LVar7, SPR_PAL_BattleKooper_Red3)
1113 Call(SetActorPaletteSwapParams,
ACTOR_PARTNER, -1,
LVar6,
LVar7, 1, 10, 1000, 10, 0, 0)
1119 Set(
LVar7, SPR_PAL_BattleKooper_Red2)
1122 Call(SetActorPaletteSwapParams,
ACTOR_PARTNER, -1,
LVar6,
LVar7, 1, 10, 1000, 10, 0, 0)
1128 Set(
LVar7, SPR_PAL_BattleKooper_Red1)
1131 Call(SetActorPaletteSwapParams,
ACTOR_PARTNER, -1,
LVar6,
LVar7, 1, 10, 1000, 10, 0, 0)
1140 Call(SetActorPaletteSwapParams,
ACTOR_PARTNER, -1,
LVar6,
LVar7, 1, 10, 1000, 10, 0, 0)
1167 Call(N(GetFireShellSpeedAndDamage))
1172 Call(MoveBattleCamOver, 50)
1178 Call(MoveBattleCamOver, 30)
1183 Call(MoveBattleCamOver, 15)
1276 Call(PartnerYieldTurn)
1293 Call(InitTargetIterator)
1295 Call(MoveBattleCamOver, 15)
struct SelectableTarget targetData[24]
@ ACTION_COMMAND_FIRE_SHELL
@ ACTION_COMMAND_DIZZY_SHELL
@ BS_FLAGS1_TRIGGER_EVENTS
@ BS_FLAGS1_INCLUDE_POWER_UPS
@ ACTOR_PAL_ADJUST_BLEND_PALETTES_VARYING_INTERVALS
@ ACTOR_EVENT_FLAG_ILLUSORY
Player attacks pass through and miss.
@ ACTOR_DECORATION_GREY_SMOKE_TRAIL
@ ACTOR_DECORATION_RED_FLAMES
@ ACTOR_DECORATION_WHIRLWIND
@ ACTOR_DECORATION_FIRE_SMOKE_TRAIL
@ BTL_MENU_TYPE_STAR_POWERS
#define SUPPRESS_EVENTS_KOOPER_DAMAGE
@ STATUS_TURN_MOD_DEFAULT
@ STATUS_TURN_MOD_PARALYZE
@ HIT_RESULT_NICE_NO_DAMAGE
@ BTL_CAM_PARTNER_CLOSE_UP
@ BTL_CAM_PARTNER_MISTAKE
@ SOUND_PARAKARRY_AIR_RAID_1
@ SOUND_DIZZY_SHELL_LAUNCH
@ SOUND_PARAKARRY_AIR_RAID_2
@ SOUND_KOOPER_SHELL_SPINUP
@ SOUND_FIRE_SHELL_LAUNCH
#define SUPPRESS_EVENTS_KOOPER_TEST
@ DAMAGE_TYPE_STATUS_ALWAYS_HITS
@ DAMAGE_TYPE_MULTIPLE_POPUPS
void add_xz_vec3f(Vec3f *vector, f32 speed, f32 angleDeg)
ActorPart * get_actor_part(Actor *actor, s32 partID)
Actor * get_actor(s32 actorID)
s32 lookup_status_chance(s32 *, s32)
void play_movement_dust_effects(s32 var0, f32 xPos, f32 yPos, f32 zPos, f32 angleDeg)
EvtScript EVS_Partner_Hit
EvtScript EVS_Partner_Recover
EvtScript EVS_Partner_BurnContact
EvtScript EVS_Partner_Drop
EvtScript EVS_Partner_NoDamageHit
EvtScript EVS_Partner_ShockHit
EvtScript EVS_Partner_BurnHit
EvtScript EVS_Partner_Celebrate
EvtScript EVS_Partner_SpikeContact
EvtScript EVS_Partner_RunAway
#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 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 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 CaseGe(RVAR)
Marks the start of a switch case that executes only if LVAR >= RVAR. It also marks the end of any pre...
#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 DMG_STATUS_ALWAYS(typeFlag, duration)
#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 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 SetF(VAR, FLOAT_VALUE)
Sets the given variable to a given value, but supports Floats.
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
#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 CaseLt(RVAR)
Marks the start of a switch case that executes only if LVAR < RVAR. It also marks the end of any prev...
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
#define CaseGt(RVAR)
Marks the start of a switch case that executes only if LVAR <= RVAR. It also marks the end of any pre...
#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.
struct Actor * partnerActor
BattleStatus gBattleStatus