5#include "sprite/npc/BattleLakilester.h"
10#include "sprite/player.h"
12#define NAMESPACE battle_partner_lakilester
33static s32 sSavedHurricaneIntensity;
34static s32 sBreathSizeIncrease;
38static s32 TargetMarkRotation;
47static f32 AimMoveAngle;
50static s32 HudStickPosX;
51static s32 HudStickPosY;
52static b32 SpinyFlipTargetingDone;
54static s32 NumEnemiesBeingBlown;
55static s32 IsHurricaneActive;
87s32 N(DefaultAnims)[] = {
99s32 N(DefenseTable)[] = {
104s32 N(StatusTable)[] = {
133 .posOffset = { 0, 0, 0 },
134 .targetOffset = { 12, 30 },
136 .idleAnimations = N(DefaultAnims),
137 .defenseTable = N(DefenseTable),
139 .elementImmunityFlags = 0,
140 .projectileTargetOffset = { 0, 0 },
145 .posOffset = { 0, 0, 0 },
146 .targetOffset = { 0, 0 },
149 .defenseTable = N(DefenseTable),
151 .elementImmunityFlags = 0,
152 .projectileTargetOffset = { 0, 0 },
162 .partsData = N(ActorParts),
163 .initScript = &N(EVS_Init),
164 .statusTable = N(StatusTable),
167 .hurricaneChance = 0,
169 .upAndAwayChance = 0,
171 .powerBounceChance = 80,
174 .healthBarOffset = { 0, 0 },
175 .statusIconOffset = { -10, 30 },
176 .statusTextOffset = { 13, 31 },
372 SpinyFlipTargetingDone =
false;
375 if (!SpinyFlipTargetingDone) {
418 switch (
script->functionTemp[0]) {
453 TargetMarkRotation = 0;
462 AimMoveAngle = -1.0f;
465 SpinyFlipTargetingDone =
true;
472 if (AimingTime != 0) {
475 AimingTime = (
s32)(80 *
DT);
483 if (stickMagnitude > 80) {
487 if (stickMagnitude < 35) {
493 D_8023D2A0 = stickMagnitude;
494 D_8023D2A8 = D_8023D2A4;
499 if (
partner->state.speed != 0.0f) {
500 partner->state.speed += (D_8023D2AC / 8.5) / 3.0;
502 partner->state.speed += (D_8023D2AC / 8.5) / 2.0;
504 AimMoveAngle = stickAngle;
508 if (!(stickMagnitude < 31)) {
509 AimMoveAngle = stickAngle;
519 if (AimMoveAngle >= 0.0f) {
542 if (AimingTime == 60) {
545 if (AimingTime == 30) {
548 if (AimingTime != 0) {
579 TargetMarkRotation -= 10;
580 TargetMarkRotation =
clamp_angle(TargetMarkRotation);
587 switch (
script->functionTemp[0]) {
591 if (HudStickPosX > 50) {
599 switch (
script->functionTemp[0]) {
667 script->varTable[0] =
true;
669 script->varTable[0] =
false;
679 if (effect !=
nullptr) {
696 script->functionTemp[0] = 0;
699 switch (
script->functionTemp[0]) {
703 script->functionTemp[0] = 1;
709 battleStatus->cloudNineEffect->data.endingDecals->scale += 0.2;
739 NumEnemiesBeingBlown = 0;
740 IsHurricaneActive =
false;
742 for (i = 0; i <
partner->targetListLength; i++) {
743 EnemyHurricaneChances[i] = 0;
749 for (i = 0; i <
partner->targetListLength; i++) {
756 if (hurricaneChance > 0) {
758 if (hurricaneChance > 100) {
759 hurricaneChance = 100;
762 hurricaneChance = hurricaneChance * 150 / 100;
763 if (hurricaneChance > 150) {
764 hurricaneChance = 150;
775 EnemyHurricaneChances[
targetIdx] = hurricaneChance;
786 for (i = 0; i <
partner->targetListLength; i++) {
793 }
else if (EnemyHurricaneChances[
targetIdx] != 0) {
804 s32* hurricaneChance = &EnemyHurricaneChances[
targetIdx];
807 script->varTable[0] = *hurricaneChance;
809 if (*hurricaneChance == -1) {
813 if (*hurricaneChance == 0) {
819 *hurricaneChance = -1;
822 *hurricaneChance = 0;
1355#define HURRICANE_PARTNER_MOVE_TIME 140
1356#define HURRICANE_UNUSED_TIME 152
1358#define HURRICANE_PARTNER_MOVE_TIME 165
1359#define HURRICANE_UNUSED_TIME 177
1387 script->functionTemp[0] = 0;
1390 switch (
script->functionTemp[0]) {
1394 partner->state.moveArcAmplitude = 0;
1395 IsHurricaneActive =
true;
1415 sSavedHurricaneIntensity = 0;
1421 sBreathSizeIncrease = 0;
1425 script->functionTemp[2] = 0;
1426 script->functionTemp[0] = 1;
1431 for (i = 0; i <
partner->targetListLength; i++) {
1448 for (i = 0; i <
partner->targetListLength; i++) {
1460 IsHurricaneActive =
false;
1473 y =
partner->curPos.y + 15.0f;
1486 if (
script->functionTemp[2] != 0) {
1489 script->functionTemp[2] = 0;
1501 y =
partner->curPos.y + 15.0f;
1509 if (
script->functionTemp[2] == 0) {
1512 script->functionTemp[2] = 1;
1515 script->functionTemp[1] = 1;
1560 if (totalPower > 5000.0f) {
1561 totalPower = 5000.0f;
1582 if (sSavedHurricaneIntensity > 1000) {
1583 sSavedHurricaneIntensity = 1000;
1615 if (sMaxPower > 5000) {
1655 script->functionTemp[0] = 0;
1660 switch (
script->functionTemp[0]) {
1666 target->state.speed = 5.5f;
1667 NumEnemiesBeingBlown++;
1670 script->functionTemp[0] = 1;
1677 target->state.moveTime += 6;
1681 if (
target->state.curPos.x > 240.0f) {
1682 NumEnemiesBeingBlown--;
1694 if (NumEnemiesBeingBlown == 0) {
1700API_CALLABLE(N(IsHurricaneActive)) {
1701 script->varTable[0] = IsHurricaneActive;
1739 Call(N(IsHurricaneActive))
BSS s32 PopupMenu_SelectedIndex
HudScript HES_StickNeutral
#define HURRICANE_UNUSED_TIME
HudScript HES_StickTapRight
#define HURRICANE_PARTNER_MOVE_TIME
struct ActorBlueprint * actorBlueprint
#define sfx_play_sound_at_position
EffectInstanceDataPtr data
struct PartnerBuffFXData * partnerBuff
@ FX_BUFF_DATA_CLOUD_NINE
struct HuffPuffBreathFXData * huffPuffBreath
#define STATUS_FLAGS_IMMOBILIZED
@ ACTION_COMMAND_HURRICANE
@ ACTION_COMMAND_THREE_CHANCES
@ ACTION_COMMAND_SPINY_SURGE
@ BS_FLAGS1_STAR_POINTS_DROPPED
@ BS_FLAGS1_FORCE_IMMUNE_HIT
@ BS_FLAGS1_TRIGGER_EVENTS
@ BS_FLAGS1_SHOW_PLAYER_DECORATIONS
@ BS_FLAGS1_INCLUDE_POWER_UPS
@ BTL_MSG_CLOUD_NINE_BEGIN
@ ACTOR_EVENT_FLAG_ILLUSORY
Player attacks pass through and miss.
@ BTL_MENU_TYPE_STAR_POWERS
@ STATUS_TURN_MOD_DEFAULT
@ STATUS_TURN_MOD_PARALYZE
@ HIT_RESULT_NICE_NO_DAMAGE
@ BTL_CAM_PARTNER_MISTAKE
@ SUPPRESS_EVENT_SPIKY_FRONT
@ SUPPRESS_EVENT_BURN_CONTACT
@ SOUND_LAKILESTER_HURRICANE_WIND
@ SOUND_LAKILESTER_HURRICANE_EXHALE
@ SOUND_LAKILESTER_HURRICANE_INHALE
@ SOUND_LAKILESTER_MAKE_CLOUD_NINE
@ SOUND_LAKILESTER_THROW_SPINY_B
@ SOUND_LAKILESTER_THROW_SPINY_A
@ ACTOR_FLAG_FLYING
Quake Hammer can't hit.
@ ACTOR_FLAG_NO_INACTIVE_ANIM
@ ACTOR_FLAG_SHOW_STATUS_ICONS
@ ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION
@ ACTOR_PART_FLAG_INVISIBLE
@ DAMAGE_TYPE_SPINY_SURGE
@ DAMAGE_TYPE_MULTIPLE_POPUPS
void btl_set_popup_duration(s32 duration)
void get_screen_coords(s32 camID, f32 x, f32 y, f32 z, s32 *screenX, s32 *screenY, s32 *screenZ)
void dispatch_event_actor(Actor *, s32)
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
ActorPart * get_actor_part(Actor *actor, s32 partID)
void set_actor_anim(s32 actorID, s32 partID, AnimID animID)
Actor * get_actor(s32 actorID)
void set_goal_pos_to_part(ActorState *state, s32 actorID, s32 partID)
void add_vec2D_polar(f32 *x, f32 *y, f32 r, f32 theta)
void hud_element_create_transform_A(s32 id)
void hud_element_set_scale(s32 index, f32 scale)
void hud_element_set_script(s32 id, HudScript *anim)
void hud_element_set_render_depth(s32 id, s32 z)
void hud_element_set_transform_rotation(s32 id, f32 x, f32 y, f32 z)
HudElemID hud_element_create(HudScript *anim)
Creates a new HUD element and returns its ID.
void hud_element_set_render_pos(s32 id, s32 x, s32 y)
void hud_element_free(s32 id)
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_RunAwayFail
EvtScript EVS_Partner_SpikeContact
EvtScript EVS_Partner_LakilesterHit
EvtScript EVS_Partner_RunAway
void sfx_stop_sound(s32 soundID)
ApiStatus RandInt(Evt *script, b32 isInitialCall)
#define NPC_DISPOSE_POS_Z
#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 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 EndChildThread
Marks the end of a child thread block.
#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 NPC_DISPOSE_POS_X
#define Goto(LABEL_ID)
Moves execution to the given label.
#define NPC_DISPOSE_POS_Y
#define IfGt(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 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 BreakSwitch
Marks the end of a switch case.
#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 ChildThread
Marks the start of a child thread block.
#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 EffectInstance * cloudNineEffect
struct Actor * partnerActor
struct EffectInstance * buffEffect
@ ACV_THREE_CHANCES_CLOUD_NINE
GameStatus * gGameStatusPtr
BattleStatus gBattleStatus