6#include "sprite/npc/BattleBow.h"
7#include "sprite/player.h"
9#define NAMESPACE battle_partner_bow
33API_CALLABLE(N(IsOuttaSightActive)) {
40API_CALLABLE(N(GetBowSize)) {
44 f32 partnerTargetActorSize = (partnerTargetActor->
size.
y + partnerTargetActor->
size.
x) / 2;
46 partnerTargetActorSize = (partnerTargetActorSize * 150.0f) / 100.0f;
47 script->varTable[0] = partnerTargetActorSize;
52API_CALLABLE(N(ApplyOuttaSight)) {
67API_CALLABLE(N(ModifyBowPos)) {
75 deltaX *= scalingFactor;
76 script->varTable[0] += deltaX;
78 deltaY *= scalingFactor;
79 script->varTable[1] += deltaY;
85API_CALLABLE(N(IsPartnerImmobile)) {
99 script->varTable[0] = isImmobile;
103API_CALLABLE(N(RestorePlayerIdleAnimations)) {
112API_CALLABLE(N(AverageSpookChance)) {
137 if (spookChance > 0) {
138 chanceTotal += spookChance;
144 script->varTable[0] = chanceTotal / nTargets;
146 script->varTable[0] = 0;
152s32 N(DefaultAnims)[] = {
163s32 N(DefenseTable)[] = {
168s32 N(StatusTable)[] = {
197 .posOffset = { 0, 0, 0 },
198 .targetOffset = { 9, 19 },
200 .idleAnimations = N(DefaultAnims),
201 .defenseTable = N(DefenseTable),
203 .elementImmunityFlags = 0,
204 .projectileTargetOffset = { 0, 0 },
210 .type = ACTOR_TYPE_BOW,
211 .level = ACTOR_LEVEL_BOW,
214 .partsData = N(ActorParts),
215 .initScript = &N(EVS_Init),
216 .statusTable = N(StatusTable),
219 .hurricaneChance = 0,
221 .upAndAwayChance = 0,
223 .powerBounceChance = 80,
226 .healthBarOffset = { 0, 0 },
227 .statusIconOffset = { -10, 22 },
228 .statusTextOffset = { 10, 22 },
247 Call(CloseActionCommandInfo)
361 Call(N(IsOuttaSightActive))
371 Call(ShowActionHud, TRUE)
375 Call(LoadStarPowerScript)
401 Call(PartnerYieldTurn)
430 Call(PartnerYieldTurn)
459 Call(PartnerYieldTurn)
470 Call(action_command_smack_init)
471 Call(SetActionHudPrepareTime, 0)
475 Call(SetupMashMeter, 4, 40, 70, 99, 100, 0)
479 Call(SetupMashMeter, 5, 35, 60, 80, 99, 100)
483 Call(SetupMashMeter, 5, 35, 60, 80, 99, 100)
492 Call(action_command_smack_start, 0,
LVar0, 3, 0)
497 Call(InitTargetIterator)
507 Call(SetBattleCamDist, 180)
508 Call(MoveBattleCamOver, 30)
509 Call(SetBattleCamOffsetY, 9)
510 Call(DisableBattleCamClampX)
520 Call(UseBattleCamPresetImmediately, 19)
527 Call(InitTargetIterator)
541 Call(CloseActionCommandInfo)
583 Call(MoveBattleCamOver, 5)
585 Call(AddBattleCamDist, 25)
586 Call(MoveBattleCamOver, 5)
613 Call(MoveBattleCamOver, 5)
615 Call(AddBattleCamDist, 25)
616 Call(MoveBattleCamOver, 5)
659 Call(SetBattleCamTarget, -129, 28, 0)
660 Call(SetBattleCamOffsetY, 15)
661 Call(SetBattleCamDist, 260)
662 Call(MoveBattleCamOver, 40)
698 Call(N(ModifyBowPos), -10, 20)
702 Call(N(IsPartnerImmobile))
715 Call(MoveBattleCamOver, 30)
716 Call(N(ApplyOuttaSight))
743 Call(PartnerYieldTurn)
745 Call(MoveBattleCamOver, 40)
748 Call(N(RestorePlayerIdleAnimations))
756 Call(action_command_spook_init)
757 Call(SetupMashMeter, 1, 100, 0, 0, 0, 0)
758 Call(SetActionHudPrepareTime, 20)
763 Call(SetBattleCamOffsetY, 4)
764 Call(AddBattleCamDist, -150)
765 Call(MoveBattleCamOver, 20)
766 Call(DisableBattleCamClampX)
774 Call(UseBattleCamPresetImmediately, 19)
797 Call(N(AverageSpookChance))
798 Call(action_command_spook_start, 0, 87 *
DT, 3,
LVar0)
807 Call(AddBattleCamDist, -20)
808 Call(MoveBattleCamOver, 20)
814 Call(AddBattleCamDist, -20)
815 Call(MoveBattleCamOver, 20)
821 Call(AddBattleCamDist, -20)
822 Call(MoveBattleCamOver, 20)
828 Call(AddBattleCamDist, -20)
829 Call(MoveBattleCamOver, 20)
835 Call(AddBattleCamDist, -20)
836 Call(MoveBattleCamOver, 20)
842 Call(AddBattleCamDist, -20)
843 Call(MoveBattleCamOver, 20)
849 Call(AddBattleCamDist, -20)
850 Call(MoveBattleCamOver, 20)
856 Call(AddBattleCamDist, -20)
857 Call(MoveBattleCamOver, 20)
870 Call(MoveBattleCamOver, 5)
928 Call(InitTargetIterator)
994 Call(action_command_smack_init)
995 Call(SetActionHudPrepareTime, 0)
996 Call(SetupMashMeter, 5, 35, 60, 80, 99, 100)
1004 Call(action_command_smack_start, 0,
LVar0, 3, 1)
1009 Call(InitTargetIterator)
1018 Call(SetBattleCamDist, 180)
1019 Call(MoveBattleCamOver, 30)
1020 Call(SetBattleCamOffsetY, 9)
1021 Call(DisableBattleCamClampX)
1031 Call(UseBattleCamPresetImmediately, 19)
1038 Call(InitTargetIterator)
1053 Call(CloseActionCommandInfo)
1100 Call(MoveBattleCamOver, 5)
1102 Call(AddBattleCamDist, 25)
1103 Call(MoveBattleCamOver, 5)
1153 Call(MoveBattleCamOver, 5)
1155 Call(AddBattleCamDist, 25)
1156 Call(MoveBattleCamOver, 5)
1222 ExecWait(N(EVS_ReturnHome_Success))
struct ActorBlueprint * actorBlueprint
struct ActorPart * partsTable
struct SelectableTarget targetData[24]
@ BS_FLAGS1_TRIGGER_EVENTS
@ BS_FLAGS1_INCLUDE_POWER_UPS
@ ACTOR_EVENT_FLAG_ILLUSORY
Player attacks pass through and miss.
@ ACTOR_DECORATION_SEEING_STARS
@ BTL_MENU_TYPE_STAR_POWERS
@ BS_FLAGS2_PLAYER_TURN_USED
@ STATUS_TURN_MOD_DEFAULT
@ STATUS_TURN_MOD_PARALYZE
@ HIT_RESULT_NICE_NO_DAMAGE
@ BTL_CAM_PARTNER_MISTAKE
@ SUPPRESS_EVENT_SPIKY_TOP
@ SUPPRESS_EVENT_ALT_SPIKY
@ SUPPRESS_EVENT_SPIKY_FRONT
@ SUPPRESS_EVENT_BURN_CONTACT
@ DMG_SRC_NEXT_SLAP_RIGHT
@ DMG_SRC_LAST_SLAP_RIGHT
@ DMG_SRC_NEXT_FAN_SMACK_LEFT
@ DMG_SRC_LAST_FAN_SMACK_LEFT
@ DMG_SRC_NEXT_FAN_SMACK_RIGHT
@ DMG_SRC_LAST_FAN_SMACK_RIGHT
@ ACTOR_FLAG_FLYING
Quake Hammer can't hit.
@ ACTOR_FLAG_NO_INACTIVE_ANIM
@ ACTOR_FLAG_USING_IDLE_ANIM
@ DAMAGE_TYPE_STATUS_ALWAYS_HITS
@ DAMAGE_TYPE_MULTIPLE_POPUPS
s32 evt_get_variable(Evt *script, Bytecode var)
ActorPart * get_actor_part(Actor *actor, s32 partID)
Actor * get_actor(s32 actorID)
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_SpikeContact
EvtScript EVS_Partner_RunAway
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 Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
#define AddF(VAR, FLOAT_VALUE)
#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 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 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 CaseLe(RVAR)
Marks the start of a switch case that executes only if LVAR > RVAR. It also marks the end of any prev...
#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 SubF(VAR, FLOAT_VALUE)
#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 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
struct Actor * playerActor
BattleStatus gBattleStatus