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;
55static s32 NumEnemiesBeingBlown;
56static s32 IsHurricaneActive;
88s32 N(DefaultAnims)[] = {
100s32 N(DefenseTable)[] = {
105s32 N(StatusTable)[] = {
134 .posOffset = { 0, 0, 0 },
135 .targetOffset = { 12, 30 },
137 .idleAnimations = N(DefaultAnims),
138 .defenseTable = N(DefenseTable),
140 .elementImmunityFlags = 0,
141 .projectileTargetOffset = { 0, 0 },
146 .posOffset = { 0, 0, 0 },
147 .targetOffset = { 0, 0 },
150 .defenseTable = N(DefenseTable),
152 .elementImmunityFlags = 0,
153 .projectileTargetOffset = { 0, 0 },
163 .partsData = N(ActorParts),
164 .initScript = &N(EVS_Init),
165 .statusTable = N(StatusTable),
168 .hurricaneChance = 0,
170 .upAndAwayChance = 0,
172 .powerBounceChance = 80,
175 .healthBarOffset = { 0, 0 },
176 .statusIconOffset = { -10, 30 },
177 .statusTextOffset = { 13, 31 },
373 SpinyFlipTargetingDone =
FALSE;
376 if (!SpinyFlipTargetingDone) {
426 switch (
script->functionTemp[0]) {
461 TargetMarkRotation = 0;
470 AimMoveAngle = -1.0f;
473 SpinyFlipTargetingDone =
TRUE;
480 if (AimingTime != 0) {
483 AimingTime = (s32)(80 *
DT);
491 if (stickMagnitude > 80) {
495 if (stickMagnitude < 35) {
501 D_8023D2A0 = stickMagnitude;
502 D_8023D2A8 = D_8023D2A4;
507 if (
partner->state.speed != 0.0f) {
508 partner->state.speed += (D_8023D2AC / 8.5) / 3.0;
510 partner->state.speed += (D_8023D2AC / 8.5) / 2.0;
512 AimMoveAngle = stickAngle;
516 if (!(stickMagnitude < 31)) {
517 AimMoveAngle = stickAngle;
527 if (AimMoveAngle >= 0.0f) {
550 if (AimingTime == 60) {
553 if (AimingTime == 30) {
556 if (AimingTime != 0) {
587 TargetMarkRotation -= 10;
588 TargetMarkRotation =
clamp_angle(TargetMarkRotation);
595 switch (
script->functionTemp[0]) {
599 if (HudStickPosX > 50) {
607 switch (
script->functionTemp[0]) {
687 if (effect !=
NULL) {
704 script->functionTemp[0] = 0;
707 switch (
script->functionTemp[0]) {
711 script->functionTemp[0] = 1;
717 battleStatus->cloudNineEffect->data.endingDecals->scale += 0.2;
747 NumEnemiesBeingBlown = 0;
748 IsHurricaneActive =
FALSE;
750 for (i = 0; i <
partner->targetListLength; i++) {
751 EnemyHurricaneChances[i] = 0;
757 for (i = 0; i <
partner->targetListLength; i++) {
764 if (hurricaneChance > 0) {
766 if (hurricaneChance > 100) {
767 hurricaneChance = 100;
770 hurricaneChance = hurricaneChance * 150 / 100;
771 if (hurricaneChance > 150) {
772 hurricaneChance = 150;
783 EnemyHurricaneChances[
targetIdx] = hurricaneChance;
794 for (i = 0; i <
partner->targetListLength; i++) {
801 }
else if (EnemyHurricaneChances[
targetIdx] != 0) {
812 s32* hurricaneChance = &EnemyHurricaneChances[
targetIdx];
815 script->varTable[0] = *hurricaneChance;
817 if (*hurricaneChance == -1) {
821 if (*hurricaneChance == 0) {
827 *hurricaneChance = -1;
830 *hurricaneChance = 0;
1363#define HURRICANE_PARTNER_MOVE_TIME 140
1364#define HURRICANE_UNUSED_TIME 152
1366#define HURRICANE_PARTNER_MOVE_TIME 165
1367#define HURRICANE_UNUSED_TIME 177
1395 script->functionTemp[0] = 0;
1398 switch (
script->functionTemp[0]) {
1402 partner->state.moveArcAmplitude = 0;
1403 IsHurricaneActive =
TRUE;
1423 sSavedHurricaneIntensity = 0;
1429 sBreathSizeIncrease = 0;
1433 script->functionTemp[2] = 0;
1434 script->functionTemp[0] = 1;
1439 for (i = 0; i <
partner->targetListLength; i++) {
1456 for (i = 0; i <
partner->targetListLength; i++) {
1468 IsHurricaneActive =
FALSE;
1481 y =
partner->curPos.y + 15.0f;
1494 if (
script->functionTemp[2] != 0) {
1497 script->functionTemp[2] = 0;
1509 y =
partner->curPos.y + 15.0f;
1517 if (
script->functionTemp[2] == 0) {
1520 script->functionTemp[2] = 1;
1523 script->functionTemp[1] = 1;
1568 if (totalPower > 5000.0f) {
1569 totalPower = 5000.0f;
1590 if (sSavedHurricaneIntensity > 1000) {
1591 sSavedHurricaneIntensity = 1000;
1623 if (sMaxPower > 5000) {
1663 script->functionTemp[0] = 0;
1668 switch (
script->functionTemp[0]) {
1674 target->state.speed = 5.5f;
1675 NumEnemiesBeingBlown++;
1678 script->functionTemp[0] = 1;
1685 target->state.moveTime += 6;
1689 if (
target->state.curPos.x > 240.0f) {
1690 NumEnemiesBeingBlown--;
1702 if (NumEnemiesBeingBlown == 0) {
1708API_CALLABLE(N(IsHurricaneActive)) {
1709 script->varTable[0] = IsHurricaneActive;
1747 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
@ FX_BUFF_DATA_CLOUD_NINE
EffectInstanceDataPtr data
struct PartnerBuffFXData * partnerBuff
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)
void hud_element_set_render_pos(s32 id, s32 x, s32 y)
s32 hud_element_create(HudScript *anim)
Creates a new HUD element and returns its ID.
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