This commit is contained in:
Ethan 2024-05-17 15:04:06 +09:00
parent f2ef0713ff
commit 6e07fb5c73
No known key found for this signature in database
GPG Key ID: 9BCC97FDA5482E7A
12 changed files with 1794 additions and 185 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,14 @@
#include "sprite/npc/Buzzar.h"
#include "battle/action_cmd/break_free.h"
#include "battle/action_cmd/whirlwind.h"
#include "sprite/player.h"
API_CALLABLE(b_area_iwa_iwa_01_whacka_iwa_01_IsHitEightTimes) {
script->varTable[0] = 0;
if (evt_get_variable(NULL, GB_IWA00_Whacka_HitCount) >= 8) {
script->varTable[0] = 1;
}
return ApiStatus_DONE2;
}

View File

@ -0,0 +1,14 @@
#include "sprite/npc/Buzzar.h"
#include "battle/action_cmd/break_free.h"
#include "battle/action_cmd/whirlwind.h"
#include "sprite/player.h"
API_CALLABLE(b_area_iwa_iwa_02_whacka_iwa_02_IsHitEightTimes) {
script->varTable[0] = 0;
if (evt_get_variable(NULL, GB_IWA00_Whacka_HitCount) >= 8) {
script->varTable[0] = 1;
}
return ApiStatus_DONE2;
}

View File

@ -0,0 +1,17 @@
#include "sprite/npc/Buzzar.h"
#include "battle/action_cmd/break_free.h"
#include "battle/action_cmd/whirlwind.h"
#include "sprite/player.h"
#define NAMESPACE A(buzzar)
API_CALLABLE(b_area_iwa_buzzar_StartRumbleWithParams) {
Bytecode* args = script->ptrReadPos;
s32 var0 = evt_get_variable(script, *args++);
s32 var1 = evt_get_variable(script, *args++);
start_rumble(var0, var1);
return ApiStatus_DONE2;
}

View File

@ -0,0 +1,14 @@
#include "sprite/npc/Buzzar.h"
#include "battle/action_cmd/break_free.h"
#include "battle/action_cmd/whirlwind.h"
#include "sprite/player.h"
API_CALLABLE(b_area_iwa_whacka_IsHitEightTimes) {
script->varTable[0] = 0;
if (evt_get_variable(NULL, GB_IWA00_Whacka_HitCount) >= 8) {
script->varTable[0] = 1;
}
return ApiStatus_DONE2;
}

View File

@ -12,10 +12,6 @@ extern EvtScript N(EVS_Idle);
extern EvtScript N(EVS_TakeTurn); extern EvtScript N(EVS_TakeTurn);
extern EvtScript N(EVS_HandleEvent); extern EvtScript N(EVS_HandleEvent);
enum N(ActorPartIDs) {
PRT_MAIN = 1,
};
enum N(ActorVars) { enum N(ActorVars) {
AVAR_Toppled = 0, AVAR_Toppled = 0,
AVAR_ToppleTurns = 1, AVAR_ToppleTurns = 1,
@ -66,7 +62,7 @@ s32 N(StatusTable)[] = {
ActorPartBlueprint N(ActorParts)[] = { ActorPartBlueprint N(ActorParts)[] = {
{ {
.flags = ACTOR_PART_FLAG_PRIMARY_TARGET, .flags = ACTOR_PART_FLAG_PRIMARY_TARGET,
.index = PRT_MAIN, .index = 1,
.posOffset = { 0, 0, 0 }, .posOffset = { 0, 0, 0 },
.targetOffset = { 0, 22 }, .targetOffset = { 0, 22 },
.opacity = 255, .opacity = 255,
@ -148,7 +144,7 @@ EvtScript N(EVS_Idle) = {
EvtScript N(EVS_FlipOver) = { EvtScript N(EVS_FlipOver) = {
Call(SetActorVar, ACTOR_SELF, AVAR_Toppled, 1) Call(SetActorVar, ACTOR_SELF, AVAR_Toppled, 1)
Call(SetActorVar, ACTOR_SELF, AVAR_ToppleTurns, 2) Call(SetActorVar, ACTOR_SELF, AVAR_ToppleTurns, 2)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim07) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim07)
Call(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) Call(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0)
Thread Thread
Set(LVar0, 0) Set(LVar0, 0)
@ -171,12 +167,12 @@ EvtScript N(EVS_FlipOver) = {
Call(SetActorPos, ACTOR_SELF, LVar0, 0, LVar2) Call(SetActorPos, ACTOR_SELF, LVar0, 0, LVar2)
Call(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) Call(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0)
Call(SetActorRotation, ACTOR_SELF, 0, 0, 0) Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim03) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim03)
Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(ToppledAnims))) Call(SetIdleAnimations, ACTOR_SELF, 1, Ref(N(ToppledAnims)))
Call(SetDefenseTable, ACTOR_SELF, PRT_MAIN, Ref(N(ToppledDefenseTable))) Call(SetDefenseTable, ACTOR_SELF, 1, Ref(N(ToppledDefenseTable)))
Call(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 15) Call(SetTargetOffset, ACTOR_SELF, 1, 0, 15)
Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -7) Call(SetProjectileTargetOffset, ACTOR_SELF, 1, 0, -7)
Call(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) Call(SetPartEventBits, ACTOR_SELF, 1, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE)
Call(N(SetSpinSmashable), FALSE) Call(N(SetSpinSmashable), FALSE)
Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE)
Return Return
@ -201,7 +197,7 @@ EvtScript N(EVS_HandleEvent) = {
Else Else
SetConst(LVar1, ANIM_Cleft_Anim08) SetConst(LVar1, ANIM_Cleft_Anim08)
EndIf EndIf
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
ExecWait(EVS_Enemy_Hit) ExecWait(EVS_Enemy_Hit)
EndSwitch EndSwitch
EndCaseGroup EndCaseGroup
@ -211,37 +207,37 @@ EvtScript N(EVS_HandleEvent) = {
CaseFlag(DAMAGE_TYPE_BLAST) CaseFlag(DAMAGE_TYPE_BLAST)
ExecWait(N(EVS_FlipOver)) ExecWait(N(EVS_FlipOver))
CaseDefault CaseDefault
Call(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, TRUE) Call(SetPartEventBits, ACTOR_SELF, 1, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, TRUE)
Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0) Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0)
IfEq(LVar0, 1) IfEq(LVar0, 1)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim09) SetConst(LVar1, ANIM_Cleft_Anim09)
SetConst(LVar2, -1) SetConst(LVar2, -1)
ExecWait(EVS_Enemy_BurnHit) ExecWait(EVS_Enemy_BurnHit)
Else Else
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim08) SetConst(LVar1, ANIM_Cleft_Anim08)
SetConst(LVar2, -1) SetConst(LVar2, -1)
ExecWait(EVS_Enemy_BurnHit) ExecWait(EVS_Enemy_BurnHit)
EndIf EndIf
Call(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, FALSE) Call(SetPartEventBits, ACTOR_SELF, 1, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, FALSE)
EndSwitch EndSwitch
CaseEq(EVENT_BURN_DEATH) CaseEq(EVENT_BURN_DEATH)
Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0) Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0)
IfEq(LVar0, 1) IfEq(LVar0, 1)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim09) SetConst(LVar1, ANIM_Cleft_Anim09)
SetConst(LVar2, -1) SetConst(LVar2, -1)
ExecWait(EVS_Enemy_BurnHit) ExecWait(EVS_Enemy_BurnHit)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim09) SetConst(LVar1, ANIM_Cleft_Anim09)
ExecWait(EVS_Enemy_Death) ExecWait(EVS_Enemy_Death)
Else Else
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim08) SetConst(LVar1, ANIM_Cleft_Anim08)
SetConst(LVar2, -1) SetConst(LVar2, -1)
ExecWait(EVS_Enemy_BurnHit) ExecWait(EVS_Enemy_BurnHit)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim08) SetConst(LVar1, ANIM_Cleft_Anim08)
ExecWait(EVS_Enemy_Death) ExecWait(EVS_Enemy_Death)
EndIf EndIf
@ -253,44 +249,44 @@ EvtScript N(EVS_HandleEvent) = {
Else Else
SetConst(LVar1, ANIM_Cleft_Anim08) SetConst(LVar1, ANIM_Cleft_Anim08)
EndIf EndIf
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
ExecWait(EVS_Enemy_SpinSmashHit) ExecWait(EVS_Enemy_SpinSmashHit)
CaseEq(EVENT_SPIN_SMASH_DEATH) CaseEq(EVENT_SPIN_SMASH_DEATH)
Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0) Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0)
IfEq(LVar0, 1) IfEq(LVar0, 1)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim09) SetConst(LVar1, ANIM_Cleft_Anim09)
ExecWait(EVS_Enemy_SpinSmashHit) ExecWait(EVS_Enemy_SpinSmashHit)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim09) SetConst(LVar1, ANIM_Cleft_Anim09)
ExecWait(EVS_Enemy_Death) ExecWait(EVS_Enemy_Death)
Else Else
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim08) SetConst(LVar1, ANIM_Cleft_Anim08)
ExecWait(EVS_Enemy_SpinSmashHit) ExecWait(EVS_Enemy_SpinSmashHit)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim08) SetConst(LVar1, ANIM_Cleft_Anim08)
ExecWait(EVS_Enemy_Death) ExecWait(EVS_Enemy_Death)
EndIf EndIf
Return Return
CaseEq(EVENT_SHOCK_HIT) CaseEq(EVENT_SHOCK_HIT)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim08) SetConst(LVar1, ANIM_Cleft_Anim08)
ExecWait(EVS_Enemy_ShockHit) ExecWait(EVS_Enemy_ShockHit)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim08) SetConst(LVar1, ANIM_Cleft_Anim08)
ExecWait(EVS_Enemy_Knockback) ExecWait(EVS_Enemy_Knockback)
Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim07) SetConst(LVar1, ANIM_Cleft_Anim07)
ExecWait(EVS_Enemy_ReturnHome) ExecWait(EVS_Enemy_ReturnHome)
Call(SetActorJumpGravity, ACTOR_SELF, Float(1.6)) Call(SetActorJumpGravity, ACTOR_SELF, Float(1.6))
Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
CaseEq(EVENT_SHOCK_DEATH) CaseEq(EVENT_SHOCK_DEATH)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim08) SetConst(LVar1, ANIM_Cleft_Anim08)
ExecWait(EVS_Enemy_ShockHit) ExecWait(EVS_Enemy_ShockHit)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim08) SetConst(LVar1, ANIM_Cleft_Anim08)
ExecWait(EVS_Enemy_Death) ExecWait(EVS_Enemy_Death)
Return Return
@ -298,7 +294,7 @@ EvtScript N(EVS_HandleEvent) = {
CaseEq(EVENT_SPIKE_TAUNT) CaseEq(EVENT_SPIKE_TAUNT)
Call(GetStatusFlags, ACTOR_SELF, LVar0) Call(GetStatusFlags, ACTOR_SELF, LVar0)
IfNotFlag(LVar0, STATUS_FLAGS_IMMOBILIZED) IfNotFlag(LVar0, STATUS_FLAGS_IMMOBILIZED)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim18) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim18)
EndIf EndIf
Wait(10) Wait(10)
Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
@ -321,25 +317,25 @@ EvtScript N(EVS_HandleEvent) = {
Else Else
SetConst(LVar1, ANIM_Cleft_Anim02) SetConst(LVar1, ANIM_Cleft_Anim02)
EndIf EndIf
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
ExecWait(EVS_Enemy_NoDamageHit) ExecWait(EVS_Enemy_NoDamageHit)
EndCaseGroup EndCaseGroup
CaseEq(EVENT_DEATH) CaseEq(EVENT_DEATH)
Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0) Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0)
IfEq(LVar0, 1) IfEq(LVar0, 1)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim09) SetConst(LVar1, ANIM_Cleft_Anim09)
ExecWait(EVS_Enemy_Hit) ExecWait(EVS_Enemy_Hit)
Wait(10) Wait(10)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim09) SetConst(LVar1, ANIM_Cleft_Anim09)
ExecWait(EVS_Enemy_Death) ExecWait(EVS_Enemy_Death)
Else Else
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim08) SetConst(LVar1, ANIM_Cleft_Anim08)
ExecWait(EVS_Enemy_Hit) ExecWait(EVS_Enemy_Hit)
Wait(10) Wait(10)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim08) SetConst(LVar1, ANIM_Cleft_Anim08)
ExecWait(EVS_Enemy_Death) ExecWait(EVS_Enemy_Death)
EndIf EndIf
@ -347,34 +343,34 @@ EvtScript N(EVS_HandleEvent) = {
CaseEq(EVENT_RECOVER_STATUS) CaseEq(EVENT_RECOVER_STATUS)
Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0) Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0)
IfEq(LVar0, 0) IfEq(LVar0, 0)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim02) SetConst(LVar1, ANIM_Cleft_Anim02)
ExecWait(EVS_Enemy_Recover) ExecWait(EVS_Enemy_Recover)
EndIf EndIf
CaseEq(EVENT_SCARE_AWAY) CaseEq(EVENT_SCARE_AWAY)
Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0) Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0)
IfEq(LVar0, 1) IfEq(LVar0, 1)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim03) SetConst(LVar1, ANIM_Cleft_Anim03)
ExecWait(EVS_Enemy_NoDamageHit) ExecWait(EVS_Enemy_NoDamageHit)
Else Else
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim07) SetConst(LVar1, ANIM_Cleft_Anim07)
SetConst(LVar2, ANIM_Cleft_Anim08) SetConst(LVar2, ANIM_Cleft_Anim08)
ExecWait(EVS_Enemy_ScareAway) ExecWait(EVS_Enemy_ScareAway)
Return Return
EndIf EndIf
CaseEq(EVENT_BEGIN_AIR_LIFT) CaseEq(EVENT_BEGIN_AIR_LIFT)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim0F) SetConst(LVar1, ANIM_Cleft_Anim0F)
ExecWait(EVS_Enemy_AirLift) ExecWait(EVS_Enemy_AirLift)
CaseEq(EVENT_BLOW_AWAY) CaseEq(EVENT_BLOW_AWAY)
Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0) Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0)
IfEq(LVar0, 1) IfEq(LVar0, 1)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim0F) SetConst(LVar1, ANIM_Cleft_Anim0F)
Else Else
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Cleft_Anim08) SetConst(LVar1, ANIM_Cleft_Anim08)
EndIf EndIf
ExecWait(EVS_Enemy_BlowAway) ExecWait(EVS_Enemy_BlowAway)
@ -390,20 +386,20 @@ EvtScript N(EVS_HandleEvent) = {
EvtScript N(EVS_TryGettingUp) = { EvtScript N(EVS_TryGettingUp) = {
Call(UseIdleAnimation, ACTOR_SELF, FALSE) Call(UseIdleAnimation, ACTOR_SELF, FALSE)
Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE) Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) Call(AddActorDecoration, ACTOR_SELF, 1, 0, ACTOR_DECORATION_SWEAT)
Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(3.0)) Call(SetAnimationRate, ACTOR_SELF, 1, Float(3.0))
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim03) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim03)
Wait(20) Wait(20)
Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(1.0)) Call(SetAnimationRate, ACTOR_SELF, 1, Float(1.0))
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim05) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim05)
Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) Call(RemoveActorDecoration, ACTOR_SELF, 1, 0)
Call(GetActorVar, ACTOR_SELF, AVAR_ToppleTurns, LVar0) Call(GetActorVar, ACTOR_SELF, AVAR_ToppleTurns, LVar0)
IfGt(LVar0, 0) IfGt(LVar0, 0)
Sub(LVar0, 1) Sub(LVar0, 1)
Call(SetActorVar, ACTOR_SELF, AVAR_ToppleTurns, LVar0) Call(SetActorVar, ACTOR_SELF, AVAR_ToppleTurns, LVar0)
Else Else
Call(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) Call(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim03) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim03)
Thread Thread
Wait(3) Wait(3)
Loop(5) Loop(5)
@ -425,12 +421,12 @@ EvtScript N(EVS_TryGettingUp) = {
Call(SetActorRotation, ACTOR_SELF, 0, 0, 0) Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
Call(SetActorPos, ACTOR_SELF, LVar0, 0, LVar2) Call(SetActorPos, ACTOR_SELF, LVar0, 0, LVar2)
Call(SetActorVar, ACTOR_SELF, AVAR_Toppled, 0) Call(SetActorVar, ACTOR_SELF, AVAR_Toppled, 0)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim02)
Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(UprightAnims))) Call(SetIdleAnimations, ACTOR_SELF, 1, Ref(N(UprightAnims)))
Call(SetDefenseTable, ACTOR_SELF, PRT_MAIN, Ref(N(UprightDefenseTable))) Call(SetDefenseTable, ACTOR_SELF, 1, Ref(N(UprightDefenseTable)))
Call(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 22) Call(SetTargetOffset, ACTOR_SELF, 1, 0, 22)
Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -10) Call(SetProjectileTargetOffset, ACTOR_SELF, 1, 0, -10)
Call(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) Call(SetPartEventBits, ACTOR_SELF, 1, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE)
Wait(1) Wait(1)
Call(N(SetSpinSmashable), TRUE) Call(N(SetSpinSmashable), TRUE)
Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, FALSE) Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, FALSE)
@ -458,15 +454,15 @@ EvtScript N(EVS_Attack_Tackle) = {
Wait(5) Wait(5)
PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0)
EndThread EndThread
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim10) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim10)
Wait(10) Wait(10)
Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim11) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim11)
Call(SetGoalToTarget, ACTOR_SELF) Call(SetGoalToTarget, ACTOR_SELF)
Call(AddGoalPos, ACTOR_SELF, 50, 0, -5) Call(AddGoalPos, ACTOR_SELF, 50, 0, -5)
Call(SetActorSpeed, ACTOR_SELF, Float(4.0)) Call(SetActorSpeed, ACTOR_SELF, Float(4.0))
Call(RunToGoal, ACTOR_SELF, 0, FALSE) Call(RunToGoal, ACTOR_SELF, 0, FALSE)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim00) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim00)
Wait(8) Wait(8)
Call(PlaySoundAtActor, ACTOR_SELF, SOUND_CLEFT_TACKLE) Call(PlaySoundAtActor, ACTOR_SELF, SOUND_CLEFT_TACKLE)
Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_NONE, SOUND_NONE) Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_NONE, SOUND_NONE)
@ -481,7 +477,7 @@ EvtScript N(EVS_Attack_Tackle) = {
Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
EndThread EndThread
EndIf EndIf
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim11) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim11)
Call(SetGoalToTarget, ACTOR_SELF) Call(SetGoalToTarget, ACTOR_SELF)
Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
Sub(LVar0, 100) Sub(LVar0, 100)
@ -489,29 +485,29 @@ EvtScript N(EVS_Attack_Tackle) = {
Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
Call(SetActorSpeed, ACTOR_SELF, Float(8.0)) Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
Call(RunToGoal, ACTOR_SELF, 0, FALSE) Call(RunToGoal, ACTOR_SELF, 0, FALSE)
Call(SetPartRotation, ACTOR_SELF, PRT_MAIN, 0, 0, 45) Call(SetPartRotation, ACTOR_SELF, 1, 0, 0, 45)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim08) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim08)
Wait(15) Wait(15)
Wait(8) Wait(8)
Call(ResetAllActorSounds, ACTOR_SELF) Call(ResetAllActorSounds, ACTOR_SELF)
Call(UseBattleCamPreset, BTL_CAM_DEFAULT) Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
Call(YieldTurn) Call(YieldTurn)
Call(SetPartRotation, ACTOR_SELF, PRT_MAIN, 0, 0, 0) Call(SetPartRotation, ACTOR_SELF, 1, 0, 0, 0)
Call(SetActorYaw, ACTOR_SELF, 180) Call(SetActorYaw, ACTOR_SELF, 180)
Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) Call(AddActorDecoration, ACTOR_SELF, 1, 0, ACTOR_DECORATION_SWEAT)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim07) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim07)
Call(SetGoalToHome, ACTOR_SELF) Call(SetGoalToHome, ACTOR_SELF)
Call(SetActorSpeed, ACTOR_SELF, Float(8.0)) Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
Call(RunToGoal, ACTOR_SELF, 0, FALSE) Call(RunToGoal, ACTOR_SELF, 0, FALSE)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim02)
Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) Call(RemoveActorDecoration, ACTOR_SELF, 1, 0)
Call(SetActorYaw, ACTOR_SELF, 0) Call(SetActorYaw, ACTOR_SELF, 0)
Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE) Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
Call(UseIdleAnimation, ACTOR_SELF, TRUE) Call(UseIdleAnimation, ACTOR_SELF, TRUE)
Return Return
EndCaseGroup EndCaseGroup
EndSwitch EndSwitch
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim11) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim11)
Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
Add(LVar0, 20) Add(LVar0, 20)
Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
@ -521,7 +517,7 @@ EvtScript N(EVS_Attack_Tackle) = {
Wait(2) Wait(2)
Call(SetGoalToTarget, ACTOR_SELF) Call(SetGoalToTarget, ACTOR_SELF)
Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_TACKLE, BS_FLAGS1_TRIGGER_EVENTS) Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_TACKLE, BS_FLAGS1_TRIGGER_EVENTS)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim02)
Call(UseBattleCamPreset, BTL_CAM_DEFAULT) Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
Switch(LVar0) Switch(LVar0)
CaseOrEq(HIT_RESULT_HIT) CaseOrEq(HIT_RESULT_HIT)
@ -533,14 +529,14 @@ EvtScript N(EVS_Attack_Tackle) = {
Call(SetActorJumpGravity, ACTOR_SELF, Float(2.4)) Call(SetActorJumpGravity, ACTOR_SELF, Float(2.4))
Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
Call(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) Call(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim02)
Wait(5) Wait(5)
Call(YieldTurn) Call(YieldTurn)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim07) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim07)
Call(SetActorSpeed, ACTOR_SELF, Float(8.0)) Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
Call(SetGoalToHome, ACTOR_SELF) Call(SetGoalToHome, ACTOR_SELF)
Call(RunToGoal, ACTOR_SELF, 0, FALSE) Call(RunToGoal, ACTOR_SELF, 0, FALSE)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim02)
EndCaseGroup EndCaseGroup
EndSwitch EndSwitch
Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE) Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)

View File

@ -11,12 +11,6 @@ extern EvtScript N(EVS_Idle);
extern EvtScript N(EVS_TakeTurn); extern EvtScript N(EVS_TakeTurn);
extern EvtScript N(EVS_HandleEvent); extern EvtScript N(EVS_HandleEvent);
enum N(ActorPartIDs) {
PRT_MAIN = 1,
PRT_TARGET = 2,
PRT_ROCK = 3,
};
enum N(ActorVars) { enum N(ActorVars) {
AVAR_IN_Hole_Small = 0, AVAR_IN_Hole_Small = 0,
}; };
@ -58,7 +52,7 @@ s32 N(StatusTable)[] = {
ActorPartBlueprint N(ActorParts)[] = { ActorPartBlueprint N(ActorParts)[] = {
{ {
.flags = ACTOR_PART_FLAG_NO_TARGET, .flags = ACTOR_PART_FLAG_NO_TARGET,
.index = PRT_MAIN, .index = 1,
.posOffset = { 0, 0, 0 }, .posOffset = { 0, 0, 0 },
.targetOffset = { -2, 16 }, .targetOffset = { -2, 16 },
.opacity = 255, .opacity = 255,
@ -70,7 +64,7 @@ ActorPartBlueprint N(ActorParts)[] = {
}, },
{ {
.flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_PRIMARY_TARGET | ACTOR_PART_FLAG_SKIP_MOVEMENT_ALLOC, .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_PRIMARY_TARGET | ACTOR_PART_FLAG_SKIP_MOVEMENT_ALLOC,
.index = PRT_TARGET, .index = 2,
.posOffset = { 0, 0, -15 }, .posOffset = { 0, 0, -15 },
.targetOffset = { -2, 12 }, .targetOffset = { -2, 12 },
.opacity = 255, .opacity = 255,
@ -82,7 +76,7 @@ ActorPartBlueprint N(ActorParts)[] = {
}, },
{ {
.flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION,
.index = PRT_ROCK, .index = 3,
.posOffset = { 0, 0, 0 }, .posOffset = { 0, 0, 0 },
.targetOffset = { 0, 0 }, .targetOffset = { 0, 0 },
.opacity = 255, .opacity = 255,
@ -149,7 +143,7 @@ s32 N(LeapAnims)[] = {
ActorPartBlueprint N(HoleParts)[] = { ActorPartBlueprint N(HoleParts)[] = {
{ {
.flags = ACTOR_PART_FLAG_DAMAGE_IMMUNE | ACTOR_PART_FLAG_NO_TARGET, .flags = ACTOR_PART_FLAG_DAMAGE_IMMUNE | ACTOR_PART_FLAG_NO_TARGET,
.index = PRT_MAIN, .index = 1,
.posOffset = { 0, 0, 0 }, .posOffset = { 0, 0, 0 },
.targetOffset = { 0, 0 }, .targetOffset = { 0, 0 },
.opacity = 255, .opacity = 255,
@ -164,7 +158,7 @@ ActorPartBlueprint N(HoleParts)[] = {
EvtScript N(EVS_Hole_Init) = { EvtScript N(EVS_Hole_Init) = {
Call(GetActorVar, ACTOR_SELF, AVAR_IN_Hole_Small, LVar0) Call(GetActorVar, ACTOR_SELF, AVAR_IN_Hole_Small, LVar0)
IfEq(LVar0, TRUE) IfEq(LVar0, TRUE)
Call(SetPartScale, ACTOR_SELF, PRT_MAIN, Float(0.4), Float(0.4), Float(0.4)) Call(SetPartScale, ACTOR_SELF, 1, Float(0.4), Float(0.4), Float(0.4))
EndIf EndIf
Return Return
End End
@ -242,31 +236,31 @@ EvtScript N(EVS_HandleEvent) = {
IfFlag(LVarE, DAMAGE_TYPE_SMASH) IfFlag(LVarE, DAMAGE_TYPE_SMASH)
ChildThread ChildThread
Wait(8) Wait(8)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim07) Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim07)
EndChildThread EndChildThread
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_MontyMole_Anim06) SetConst(LVar1, ANIM_MontyMole_Anim06)
ExecWait(EVS_Enemy_Hit) ExecWait(EVS_Enemy_Hit)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim08) Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim08)
Wait(10) Wait(10)
Else Else
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_MontyMole_Anim05) SetConst(LVar1, ANIM_MontyMole_Anim05)
ExecWait(EVS_Enemy_Hit) ExecWait(EVS_Enemy_Hit)
EndIf EndIf
EndCaseGroup EndCaseGroup
CaseEq(EVENT_BURN_HIT) CaseEq(EVENT_BURN_HIT)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_MontyMole_Anim0A) SetConst(LVar1, ANIM_MontyMole_Anim0A)
SetConst(LVar2, ANIM_MontyMole_Anim0B) SetConst(LVar2, ANIM_MontyMole_Anim0B)
ExecWait(EVS_Enemy_BurnHit) ExecWait(EVS_Enemy_BurnHit)
CaseEq(EVENT_BURN_DEATH) CaseEq(EVENT_BURN_DEATH)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_MontyMole_Anim0A) SetConst(LVar1, ANIM_MontyMole_Anim0A)
SetConst(LVar2, ANIM_MontyMole_Anim0B) SetConst(LVar2, ANIM_MontyMole_Anim0B)
ExecWait(EVS_Enemy_BurnHit) ExecWait(EVS_Enemy_BurnHit)
ExecWait(N(EVS_CreateEmptyHole)) ExecWait(N(EVS_CreateEmptyHole))
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_MontyMole_Anim0C) SetConst(LVar1, ANIM_MontyMole_Anim0C)
ExecWait(EVS_Enemy_Death) ExecWait(EVS_Enemy_Death)
Return Return
@ -275,51 +269,51 @@ EvtScript N(EVS_HandleEvent) = {
Call(GetLastElement, LVar0) Call(GetLastElement, LVar0)
IfFlag(LVar0, DAMAGE_TYPE_SMASH) IfFlag(LVar0, DAMAGE_TYPE_SMASH)
Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG)
Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(2.0)) Call(SetAnimationRate, ACTOR_SELF, 1, Float(2.0))
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim11) Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim11)
Wait(80) Wait(80)
Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE)
Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(1.0)) Call(SetAnimationRate, ACTOR_SELF, 1, Float(1.0))
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim10) Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim10)
Wait(20) Wait(20)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim14) Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim14)
Wait(20) Wait(20)
Else Else
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_MontyMole_Anim01) SetConst(LVar1, ANIM_MontyMole_Anim01)
ExecWait(EVS_Enemy_NoDamageHit) ExecWait(EVS_Enemy_NoDamageHit)
EndIf EndIf
EndCaseGroup EndCaseGroup
CaseEq(EVENT_DEATH) CaseEq(EVENT_DEATH)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_MontyMole_Anim05) SetConst(LVar1, ANIM_MontyMole_Anim05)
ExecWait(EVS_Enemy_Hit) ExecWait(EVS_Enemy_Hit)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim06) Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim06)
Wait(10) Wait(10)
ExecWait(N(EVS_CreateEmptyHole)) ExecWait(N(EVS_CreateEmptyHole))
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_MontyMole_Anim09) SetConst(LVar1, ANIM_MontyMole_Anim09)
ExecWait(EVS_Enemy_Death) ExecWait(EVS_Enemy_Death)
Return Return
CaseEq(EVENT_RECOVER_STATUS) CaseEq(EVENT_RECOVER_STATUS)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim06) Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim06)
Wait(8) Wait(8)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim07) Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim07)
Wait(5) Wait(5)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim08) Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim08)
Wait(8) Wait(8)
CaseEq(EVENT_SCARE_AWAY) CaseEq(EVENT_SCARE_AWAY)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim06) Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim06)
Wait(15) Wait(15)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim07) Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim07)
Wait(15) Wait(15)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim08) Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim08)
Wait(15) Wait(15)
Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_TARGET_ONLY | ACTOR_FLAG_NO_DMG_APPLY, TRUE) Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_TARGET_ONLY | ACTOR_FLAG_NO_DMG_APPLY, TRUE)
Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(EmptyHoleAnims))) Call(SetIdleAnimations, ACTOR_SELF, 1, Ref(N(EmptyHoleAnims)))
Return Return
CaseEq(EVENT_BEGIN_AIR_LIFT) CaseEq(EVENT_BEGIN_AIR_LIFT)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_MontyMole_Anim05) SetConst(LVar1, ANIM_MontyMole_Anim05)
ExecWait(EVS_Enemy_AirLift) ExecWait(EVS_Enemy_AirLift)
CaseEq(EVENT_BLOW_AWAY) CaseEq(EVENT_BLOW_AWAY)
@ -327,27 +321,27 @@ EvtScript N(EVS_HandleEvent) = {
Call(GetStatusFlags, ACTOR_SELF, LVar0) Call(GetStatusFlags, ACTOR_SELF, LVar0)
IfFlag(LVar0, STATUS_FLAGS_IMMOBILIZED) IfFlag(LVar0, STATUS_FLAGS_IMMOBILIZED)
Call(SetActorDispOffset, ACTOR_SELF, 0, -5, 0) Call(SetActorDispOffset, ACTOR_SELF, 0, -5, 0)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim19) Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim19)
Else Else
IfFlag(LVar0, STATUS_FLAG_SHRINK) IfFlag(LVar0, STATUS_FLAG_SHRINK)
Call(SetActorDispOffset, ACTOR_SELF, 0, -9, 0) Call(SetActorDispOffset, ACTOR_SELF, 0, -9, 0)
Else Else
Call(SetActorDispOffset, ACTOR_SELF, 0, -23, 0) Call(SetActorDispOffset, ACTOR_SELF, 0, -23, 0)
EndIf EndIf
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim09) Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim09)
EndIf EndIf
Wait(1000) Wait(1000)
Return Return
CaseEq(EVENT_AIR_LIFT_FAILED) CaseEq(EVENT_AIR_LIFT_FAILED)
Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG)
Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(2.0)) Call(SetAnimationRate, ACTOR_SELF, 1, Float(2.0))
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim11) Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim11)
Wait(40) Wait(40)
Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE)
Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(1.0)) Call(SetAnimationRate, ACTOR_SELF, 1, Float(1.0))
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim10) Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim10)
Wait(20) Wait(20)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim14) Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim14)
Wait(20) Wait(20)
CaseEq(EVENT_UP_AND_AWAY) CaseEq(EVENT_UP_AND_AWAY)
ExecWait(N(EVS_CreateEmptyHole)) ExecWait(N(EVS_CreateEmptyHole))
@ -374,21 +368,21 @@ EvtScript N(EVS_TakeTurn) = {
Wait(20) Wait(20)
Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE)
EndChildThread EndChildThread
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim04) Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim04)
Wait(37) Wait(37)
Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
Add(LVar1, 20) Add(LVar1, 20)
Call(SetPartPos, ACTOR_SELF, PRT_ROCK, LVar0, LVar1, LVar2) Call(SetPartPos, ACTOR_SELF, 3, LVar0, LVar1, LVar2)
Wait(1) Wait(1)
Call(SetPartFlagBits, ACTOR_SELF, PRT_ROCK, ACTOR_PART_FLAG_INVISIBLE, FALSE) Call(SetPartFlagBits, ACTOR_SELF, 3, ACTOR_PART_FLAG_INVISIBLE, FALSE)
Call(GetStatusFlags, ACTOR_SELF, LVar0) Call(GetStatusFlags, ACTOR_SELF, LVar0)
IfFlag(LVar0, STATUS_FLAG_SHRINK) IfFlag(LVar0, STATUS_FLAG_SHRINK)
Call(SetPartScale, ACTOR_SELF, PRT_ROCK, Float(0.4), Float(0.4), Float(0.4)) Call(SetPartScale, ACTOR_SELF, 3, Float(0.4), Float(0.4), Float(0.4))
Else Else
Call(SetPartScale, ACTOR_SELF, PRT_ROCK, Float(1.0), Float(1.0), Float(1.0)) Call(SetPartScale, ACTOR_SELF, 3, Float(1.0), Float(1.0), Float(1.0))
EndIf EndIf
Call(PlaySoundAtPart, ACTOR_SELF, PRT_ROCK, SOUND_MOLE_THROW) Call(PlaySoundAtPart, ACTOR_SELF, 3, SOUND_MOLE_THROW)
Call(SetPartSounds, ACTOR_SELF, PRT_ROCK, ACTOR_SOUND_FLY, SOUND_NONE, SOUND_NONE) Call(SetPartSounds, ACTOR_SELF, 3, ACTOR_SOUND_FLY, SOUND_NONE, SOUND_NONE)
Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 2, BS_FLAGS1_TRIGGER_EVENTS) Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 2, BS_FLAGS1_TRIGGER_EVENTS)
Switch(LVar0) Switch(LVar0)
CaseOrEq(HIT_RESULT_MISS) CaseOrEq(HIT_RESULT_MISS)
@ -399,11 +393,11 @@ EvtScript N(EVS_TakeTurn) = {
Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
Sub(LVar0, 100) Sub(LVar0, 100)
Set(LVar1, -5) Set(LVar1, -5)
Call(SetPartMoveSpeed, ACTOR_SELF, PRT_ROCK, Float(12.0)) Call(SetPartMoveSpeed, ACTOR_SELF, 3, Float(12.0))
Call(SetPartJumpGravity, ACTOR_SELF, PRT_ROCK, Float(0.1)) Call(SetPartJumpGravity, ACTOR_SELF, 3, Float(0.1))
Call(SetAnimation, ACTOR_SELF, PRT_ROCK, ANIM_MontyMole_Anim0F) Call(SetAnimation, ACTOR_SELF, 3, ANIM_MontyMole_Anim0F)
Call(FlyPartTo, ACTOR_SELF, PRT_ROCK, LVar0, LVar1, LVar2, 0, 30, EASING_LINEAR) Call(FlyPartTo, ACTOR_SELF, 3, LVar0, LVar1, LVar2, 0, 30, EASING_LINEAR)
Call(SetPartFlagBits, ACTOR_SELF, PRT_ROCK, ACTOR_PART_FLAG_INVISIBLE, TRUE) Call(SetPartFlagBits, ACTOR_SELF, 3, ACTOR_PART_FLAG_INVISIBLE, TRUE)
IfEq(LVarA, HIT_RESULT_LUCKY) IfEq(LVarA, HIT_RESULT_LUCKY)
Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
EndIf EndIf
@ -416,10 +410,10 @@ EvtScript N(EVS_TakeTurn) = {
Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
Call(SetGoalToTarget, ACTOR_SELF) Call(SetGoalToTarget, ACTOR_SELF)
Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
Call(SetPartMoveSpeed, ACTOR_SELF, PRT_ROCK, Float(12.0)) Call(SetPartMoveSpeed, ACTOR_SELF, 3, Float(12.0))
Call(SetPartJumpGravity, ACTOR_SELF, PRT_ROCK, Float(0.1)) Call(SetPartJumpGravity, ACTOR_SELF, 3, Float(0.1))
Call(SetAnimation, ACTOR_SELF, PRT_ROCK, ANIM_MontyMole_Anim0F) Call(SetAnimation, ACTOR_SELF, 3, ANIM_MontyMole_Anim0F)
Call(FlyPartTo, ACTOR_SELF, PRT_ROCK, LVar0, LVar1, LVar2, 0, 20, EASING_LINEAR) Call(FlyPartTo, ACTOR_SELF, 3, LVar0, LVar1, LVar2, 0, 20, EASING_LINEAR)
Wait(2) Wait(2)
Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, DMG_TOSS, BS_FLAGS1_TRIGGER_EVENTS) Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, DMG_TOSS, BS_FLAGS1_TRIGGER_EVENTS)
Switch(LVar0) Switch(LVar0)
@ -428,13 +422,13 @@ EvtScript N(EVS_TakeTurn) = {
Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
Sub(LVar0, 55) Sub(LVar0, 55)
Set(LVar1, 0) Set(LVar1, 0)
Call(SetPartMoveSpeed, ACTOR_SELF, PRT_ROCK, Float(6.0)) Call(SetPartMoveSpeed, ACTOR_SELF, 3, Float(6.0))
Call(SetPartJumpGravity, ACTOR_SELF, PRT_ROCK, Float(0.1)) Call(SetPartJumpGravity, ACTOR_SELF, 3, Float(0.1))
Call(FlyPartTo, ACTOR_SELF, PRT_ROCK, LVar0, LVar1, LVar2, 0, 25, EASING_LINEAR) Call(FlyPartTo, ACTOR_SELF, 3, LVar0, LVar1, LVar2, 0, 25, EASING_LINEAR)
Call(SetPartMoveSpeed, ACTOR_SELF, PRT_ROCK, Float(4.0)) Call(SetPartMoveSpeed, ACTOR_SELF, 3, Float(4.0))
Sub(LVar0, 20) Sub(LVar0, 20)
Call(FlyPartTo, ACTOR_SELF, PRT_ROCK, LVar0, LVar1, LVar2, 0, 21, EASING_LINEAR) Call(FlyPartTo, ACTOR_SELF, 3, LVar0, LVar1, LVar2, 0, 21, EASING_LINEAR)
Call(SetPartFlagBits, ACTOR_SELF, PRT_ROCK, ACTOR_PART_FLAG_INVISIBLE, TRUE) Call(SetPartFlagBits, ACTOR_SELF, 3, ACTOR_PART_FLAG_INVISIBLE, TRUE)
EndCaseGroup EndCaseGroup
EndSwitch EndSwitch
Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE) Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)

View File

@ -11,13 +11,6 @@ extern EvtScript N(EVS_HandleEvent);
extern EvtScript N(EVS_MakeWhackaBump); extern EvtScript N(EVS_MakeWhackaBump);
extern EvtScript N(EVS_Death); extern EvtScript N(EVS_Death);
enum N(ActorPartIDs) {
PRT_MAIN = 1,
};
enum N(ActorVars) {
AVAR_SpawnedBump = 0,
};
s32 N(DefaultAnims)[] = { s32 N(DefaultAnims)[] = {
STATUS_KEY_NORMAL, ANIM_Whacka_Idle, STATUS_KEY_NORMAL, ANIM_Whacka_Idle,
@ -65,7 +58,7 @@ s32 N(StatusTable)[] = {
ActorPartBlueprint N(ActorParts)[] = { ActorPartBlueprint N(ActorParts)[] = {
{ {
.flags = ACTOR_PART_FLAG_PRIMARY_TARGET, .flags = ACTOR_PART_FLAG_PRIMARY_TARGET,
.index = PRT_MAIN, .index = 1,
.posOffset = { 0, 0, 0 }, .posOffset = { 0, 0, 0 },
.targetOffset = { 0, 30 }, .targetOffset = { 0, 30 },
.opacity = 255, .opacity = 255,
@ -113,11 +106,11 @@ EvtScript N(EVS_Init) = {
Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn))) Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn)))
Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle))) Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent))) Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
Call(SetActorVar, ACTOR_SELF, AVAR_SpawnedBump, FALSE) Call(SetActorVar, ACTOR_SELF, 0, FALSE)
Call(N(IsHitEightTimes)) Call(N(IsHitEightTimes))
IfEq(LVar0, 0) IfEq(LVar0, 0)
Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_INVISIBLE | ACTOR_FLAG_NO_ATTACK | ACTOR_FLAG_NO_DMG_APPLY, TRUE) Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_INVISIBLE | ACTOR_FLAG_NO_ATTACK | ACTOR_FLAG_NO_DMG_APPLY, TRUE)
Call(SetPartFlagBits, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_NO_TARGET, TRUE) Call(SetPartFlagBits, ACTOR_SELF, 1, ACTOR_PART_FLAG_NO_TARGET, TRUE)
EndIf EndIf
Return Return
End End
@ -138,11 +131,11 @@ EvtScript N(EVS_HandleEvent) = {
Switch(LVar0) Switch(LVar0)
CaseEq(EVENT_HIT_COMBO) CaseEq(EVENT_HIT_COMBO)
Call(PlaySoundAtActor, ACTOR_SELF, SOUND_HIT_WHACKA) Call(PlaySoundAtActor, ACTOR_SELF, SOUND_HIT_WHACKA)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_Hit) ExecWait(EVS_Enemy_Hit)
CaseEq(EVENT_HIT) CaseEq(EVENT_HIT)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Hurt) SetConst(LVar1, ANIM_Whacka_Hurt)
ExecWait(N(EVS_MakeWhackaBump)) ExecWait(N(EVS_MakeWhackaBump))
ExecWait(EVS_Enemy_Hit) ExecWait(EVS_Enemy_Hit)
@ -152,7 +145,7 @@ EvtScript N(EVS_HandleEvent) = {
Return Return
EndIf EndIf
CaseEq(EVENT_BURN_HIT) CaseEq(EVENT_BURN_HIT)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
SetConst(LVar2, ANIM_Whacka_Idle) SetConst(LVar2, ANIM_Whacka_Idle)
ExecWait(N(EVS_MakeWhackaBump)) ExecWait(N(EVS_MakeWhackaBump))
@ -163,7 +156,7 @@ EvtScript N(EVS_HandleEvent) = {
Return Return
EndIf EndIf
CaseEq(EVENT_BURN_DEATH) CaseEq(EVENT_BURN_DEATH)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
SetConst(LVar2, ANIM_Whacka_Idle) SetConst(LVar2, ANIM_Whacka_Idle)
ExecWait(N(EVS_MakeWhackaBump)) ExecWait(N(EVS_MakeWhackaBump))
@ -172,13 +165,13 @@ EvtScript N(EVS_HandleEvent) = {
ExecWait(N(EVS_Death)) ExecWait(N(EVS_Death))
Return Return
Else Else
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_Death) ExecWait(EVS_Enemy_Death)
Return Return
EndIf EndIf
CaseEq(EVENT_SPIN_SMASH_HIT) CaseEq(EVENT_SPIN_SMASH_HIT)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_SpinSmashHit) ExecWait(EVS_Enemy_SpinSmashHit)
Call(RandInt, 100, LVar0) Call(RandInt, 100, LVar0)
@ -187,42 +180,42 @@ EvtScript N(EVS_HandleEvent) = {
Return Return
EndIf EndIf
CaseEq(EVENT_SPIN_SMASH_DEATH) CaseEq(EVENT_SPIN_SMASH_DEATH)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_SpinSmashHit) ExecWait(EVS_Enemy_SpinSmashHit)
IfGe(100, 100) IfGe(100, 100)
ExecWait(N(EVS_Death)) ExecWait(N(EVS_Death))
Return Return
Else Else
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_Death) ExecWait(EVS_Enemy_Death)
Return Return
EndIf EndIf
CaseEq(EVENT_SHOCK_HIT) CaseEq(EVENT_SHOCK_HIT)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_ShockHit) ExecWait(EVS_Enemy_ShockHit)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_Knockback) ExecWait(EVS_Enemy_Knockback)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_ReturnHome) ExecWait(EVS_Enemy_ReturnHome)
CaseEq(EVENT_SHOCK_DEATH) CaseEq(EVENT_SHOCK_DEATH)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_ShockHit) ExecWait(EVS_Enemy_ShockHit)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_Death) ExecWait(EVS_Enemy_Death)
Return Return
CaseEq(EVENT_ZERO_DAMAGE) CaseEq(EVENT_ZERO_DAMAGE)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_NoDamageHit) ExecWait(EVS_Enemy_NoDamageHit)
CaseEq(EVENT_IMMUNE) CaseEq(EVENT_IMMUNE)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_NoDamageHit) ExecWait(EVS_Enemy_NoDamageHit)
Call(RandInt, 100, LVar0) Call(RandInt, 100, LVar0)
@ -231,7 +224,7 @@ EvtScript N(EVS_HandleEvent) = {
Return Return
EndIf EndIf
CaseEq(EVENT_AIR_LIFT_FAILED) CaseEq(EVENT_AIR_LIFT_FAILED)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_NoDamageHit) ExecWait(EVS_Enemy_NoDamageHit)
Call(RandInt, 100, LVar0) Call(RandInt, 100, LVar0)
@ -240,7 +233,7 @@ EvtScript N(EVS_HandleEvent) = {
Return Return
EndIf EndIf
CaseEq(EVENT_DEATH) CaseEq(EVENT_DEATH)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Hurt) SetConst(LVar1, ANIM_Whacka_Hurt)
ExecWait(N(EVS_MakeWhackaBump)) ExecWait(N(EVS_MakeWhackaBump))
ExecWait(EVS_Enemy_Hit) ExecWait(EVS_Enemy_Hit)
@ -249,27 +242,27 @@ EvtScript N(EVS_HandleEvent) = {
ExecWait(N(EVS_Death)) ExecWait(N(EVS_Death))
Return Return
Else Else
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_Death) ExecWait(EVS_Enemy_Death)
Return Return
EndIf EndIf
CaseEq(EVENT_RECOVER_STATUS) CaseEq(EVENT_RECOVER_STATUS)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_Recover) ExecWait(EVS_Enemy_Recover)
CaseEq(EVENT_SCARE_AWAY) CaseEq(EVENT_SCARE_AWAY)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
SetConst(LVar2, ANIM_Whacka_Idle) SetConst(LVar2, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_ScareAway) ExecWait(EVS_Enemy_ScareAway)
Return Return
CaseEq(EVENT_BEGIN_AIR_LIFT) CaseEq(EVENT_BEGIN_AIR_LIFT)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_AirLift) ExecWait(EVS_Enemy_AirLift)
CaseEq(EVENT_BLOW_AWAY) CaseEq(EVENT_BLOW_AWAY)
SetConst(LVar0, PRT_MAIN) SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_BlowAway) ExecWait(EVS_Enemy_BlowAway)
Return Return
@ -292,11 +285,11 @@ EvtScript N(EVS_TakeTurn) = {
}; };
EvtScript N(EVS_MakeWhackaBump) = { EvtScript N(EVS_MakeWhackaBump) = {
Call(SetActorVar, ACTOR_SELF, AVAR_SpawnedBump, TRUE) Call(SetActorVar, ACTOR_SELF, 0, TRUE)
Call(PlaySoundAtActor, ACTOR_SELF, SOUND_HIT_WHACKA) Call(PlaySoundAtActor, ACTOR_SELF, SOUND_HIT_WHACKA)
Thread Thread
Wait(15) Wait(15)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Whacka_Idle) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Whacka_Idle)
Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
Add(LVar0, 5) Add(LVar0, 5)
Add(LVar1, 20) Add(LVar1, 20)
@ -311,13 +304,13 @@ EvtScript N(EVS_Death) = {
Call(UseIdleAnimation, ACTOR_SELF, FALSE) Call(UseIdleAnimation, ACTOR_SELF, FALSE)
Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE) Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG)
Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Whacka_Burrow) Call(SetAnimation, ACTOR_SELF, 1, ANIM_Whacka_Burrow)
Wait(40) Wait(40)
Call(GetActorVar, ACTOR_SELF, AVAR_SpawnedBump, LVar0) Call(GetActorVar, ACTOR_SELF, 0, LVar0)
IfNe(LVar0, FALSE) IfNe(LVar0, FALSE)
Call(SetBattleFlagBits2, BS_FLAGS2_DROP_WHACKA_BUMP, TRUE) Call(SetBattleFlagBits2, BS_FLAGS2_DROP_WHACKA_BUMP, TRUE)
EndIf EndIf
Call(SetPartFlagBits, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_NO_TARGET, TRUE) Call(SetPartFlagBits, ACTOR_SELF, 1, ACTOR_PART_FLAG_NO_TARGET, TRUE)
Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_INVISIBLE | ACTOR_FLAG_NO_ATTACK | ACTOR_FLAG_NO_DMG_APPLY, TRUE) Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_INVISIBLE | ACTOR_FLAG_NO_ATTACK | ACTOR_FLAG_NO_DMG_APPLY, TRUE)
Call(RemoveActor, ACTOR_SELF) Call(RemoveActor, ACTOR_SELF)
Return Return

View File

@ -0,0 +1,310 @@
#include "battle/battle.h"
#include "script_api/battle.h"
#include "sprite/npc/Whacka.h"
#define NAMESPACE A(whacka)
extern EvtScript N(EVS_Init);
extern EvtScript N(EVS_Idle);
extern EvtScript N(EVS_TakeTurn);
extern EvtScript N(EVS_HandleEvent);
extern EvtScript N(EVS_MakeWhackaBump);
extern EvtScript N(EVS_Death);
API_CALLABLE(N(IsHitEightTimes));
s32 N(DefaultAnims)[] = {
STATUS_KEY_NORMAL, ANIM_Whacka_Idle,
STATUS_KEY_STONE, ANIM_Whacka_Still,
STATUS_KEY_SLEEP, ANIM_Whacka_Idle,
STATUS_KEY_POISON, ANIM_Whacka_Idle,
STATUS_KEY_STOP, ANIM_Whacka_Still,
STATUS_KEY_STATIC, ANIM_Whacka_Idle,
STATUS_KEY_PARALYZE, ANIM_Whacka_Still,
STATUS_KEY_DIZZY, ANIM_Whacka_Idle,
STATUS_KEY_FEAR, ANIM_Whacka_Idle,
STATUS_END,
};
s32 N(DefenseTable)[] = {
ELEMENT_NORMAL, 0,
ELEMENT_END,
};
s32 N(StatusTable)[] = {
STATUS_KEY_NORMAL, 0,
STATUS_KEY_DEFAULT, 0,
STATUS_KEY_SLEEP, 0,
STATUS_KEY_POISON, 0,
STATUS_KEY_FROZEN, 0,
STATUS_KEY_DIZZY, 0,
STATUS_KEY_FEAR, 0,
STATUS_KEY_STATIC, 0,
STATUS_KEY_PARALYZE, 0,
STATUS_KEY_SHRINK, 0,
STATUS_KEY_STOP, 0,
STATUS_TURN_MOD_DEFAULT, 0,
STATUS_TURN_MOD_SLEEP, 0,
STATUS_TURN_MOD_POISON, 0,
STATUS_TURN_MOD_FROZEN, 0,
STATUS_TURN_MOD_DIZZY, 0,
STATUS_TURN_MOD_FEAR, 0,
STATUS_TURN_MOD_STATIC, 0,
STATUS_TURN_MOD_PARALYZE, 0,
STATUS_TURN_MOD_SHRINK, 0,
STATUS_TURN_MOD_STOP, 0,
STATUS_END,
};
ActorPartBlueprint N(ActorParts)[] = {
{
.flags = ACTOR_PART_FLAG_PRIMARY_TARGET,
.index = 1,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 30 },
.opacity = 255,
.idleAnimations = N(DefaultAnims),
.defenseTable = N(DefenseTable),
.eventFlags = ACTOR_EVENT_FLAGS_NONE,
.elementImmunityFlags = 0,
.projectileTargetOffset = { 0, -5 },
},
};
ActorBlueprint NAMESPACE = {
.flags = ACTOR_FLAG_NO_SHADOW | ACTOR_FLAG_NO_HEALTH_BAR,
.type = ACTOR_TYPE_WHACKA,
.level = ACTOR_LEVEL_WHACKA,
.maxHP = 99,
.partCount = ARRAY_COUNT(N(ActorParts)),
.partsData = N(ActorParts),
.initScript = &N(EVS_Init),
.statusTable = N(StatusTable),
.escapeChance = 0,
.airLiftChance = 0,
.hurricaneChance = 0,
.spookChance = 0,
.upAndAwayChance = 0,
.spinSmashReq = 4,
.powerBounceChance = 50,
.coinReward = 0,
.size = { 47, 32 },
.healthBarOffset = { 0, 0 },
.statusIconOffset = { -20, 40 },
.statusTextOffset = { 10, 30 },
};
EvtScript N(EVS_Init) = {
Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn)))
Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
Call(SetActorVar, ACTOR_SELF, 0, FALSE)
Call(N(IsHitEightTimes))
IfEq(LVar0, 0)
Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_INVISIBLE | ACTOR_FLAG_NO_ATTACK | ACTOR_FLAG_NO_DMG_APPLY, TRUE)
Call(SetPartFlagBits, ACTOR_SELF, 1, ACTOR_PART_FLAG_NO_TARGET, TRUE)
EndIf
Return
End
};
EvtScript N(EVS_Idle) = {
Label(0)
Wait(1)
Goto(0)
Return
End
};
EvtScript N(EVS_HandleEvent) = {
Call(UseIdleAnimation, ACTOR_SELF, FALSE)
Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
Call(GetLastEvent, ACTOR_SELF, LVar0)
Switch(LVar0)
CaseEq(EVENT_HIT_COMBO)
Call(PlaySoundAtActor, ACTOR_SELF, SOUND_HIT_WHACKA)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_Hit)
CaseEq(EVENT_HIT)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Hurt)
ExecWait(N(EVS_MakeWhackaBump))
ExecWait(EVS_Enemy_Hit)
Call(RandInt, 100, LVar0)
IfLe(LVar0, 100)
ExecWait(N(EVS_Death))
Return
EndIf
CaseEq(EVENT_BURN_HIT)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
SetConst(LVar2, ANIM_Whacka_Idle)
ExecWait(N(EVS_MakeWhackaBump))
ExecWait(EVS_Enemy_Hit)
Call(RandInt, 100, LVar0)
IfLe(LVar0, 100)
ExecWait(N(EVS_Death))
Return
EndIf
CaseEq(EVENT_BURN_DEATH)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
SetConst(LVar2, ANIM_Whacka_Idle)
ExecWait(N(EVS_MakeWhackaBump))
ExecWait(EVS_Enemy_Hit)
IfGe(100, 100)
ExecWait(N(EVS_Death))
Return
Else
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_Death)
Return
EndIf
CaseEq(EVENT_SPIN_SMASH_HIT)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_SpinSmashHit)
Call(RandInt, 100, LVar0)
IfLe(LVar0, 100)
ExecWait(N(EVS_Death))
Return
EndIf
CaseEq(EVENT_SPIN_SMASH_DEATH)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_SpinSmashHit)
IfGe(100, 100)
ExecWait(N(EVS_Death))
Return
Else
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_Death)
Return
EndIf
CaseEq(EVENT_SHOCK_HIT)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_ShockHit)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_Knockback)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_ReturnHome)
CaseEq(EVENT_SHOCK_DEATH)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_ShockHit)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_Death)
Return
CaseEq(EVENT_ZERO_DAMAGE)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_NoDamageHit)
CaseEq(EVENT_IMMUNE)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_NoDamageHit)
Call(RandInt, 100, LVar0)
IfLe(LVar0, 100)
ExecWait(N(EVS_Death))
Return
EndIf
CaseEq(EVENT_AIR_LIFT_FAILED)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_NoDamageHit)
Call(RandInt, 100, LVar0)
IfLe(LVar0, 100)
ExecWait(N(EVS_Death))
Return
EndIf
CaseEq(EVENT_DEATH)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Hurt)
ExecWait(N(EVS_MakeWhackaBump))
ExecWait(EVS_Enemy_Hit)
Wait(10)
IfGe(100, 100)
ExecWait(N(EVS_Death))
Return
Else
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_Death)
Return
EndIf
CaseEq(EVENT_RECOVER_STATUS)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_Recover)
CaseEq(EVENT_SCARE_AWAY)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
SetConst(LVar2, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_ScareAway)
Return
CaseEq(EVENT_BEGIN_AIR_LIFT)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_AirLift)
CaseEq(EVENT_BLOW_AWAY)
SetConst(LVar0, 1)
SetConst(LVar1, ANIM_Whacka_Idle)
ExecWait(EVS_Enemy_BlowAway)
Return
CaseDefault
EndSwitch
Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
Call(UseIdleAnimation, ACTOR_SELF, TRUE)
Return
End
};
EvtScript N(EVS_TakeTurn) = {
Call(RandInt, 100, LVar0)
IfLe(LVar0, 100)
ExecWait(N(EVS_Death))
Return
EndIf
Return
End
};
EvtScript N(EVS_MakeWhackaBump) = {
Call(SetActorVar, ACTOR_SELF, 0, TRUE)
Call(PlaySoundAtActor, ACTOR_SELF, SOUND_HIT_WHACKA)
Thread
Wait(15)
Call(SetAnimation, ACTOR_SELF, 1, ANIM_Whacka_Idle)
Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
Add(LVar0, 5)
Add(LVar1, 20)
Add(LVar2, 10)
Call(MakeItemEntity, ITEM_WHACKAS_BUMP, LVar0, LVar1, LVar2, ITEM_SPAWN_MODE_FALL_SPAWN_ALWAYS, 0)
EndThread
Return
End
};
EvtScript N(EVS_Death) = {
Call(UseIdleAnimation, ACTOR_SELF, FALSE)
Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG)
Call(SetAnimation, ACTOR_SELF, 1, ANIM_Whacka_Burrow)
Wait(40)
Call(GetActorVar, ACTOR_SELF, 0, LVar0)
IfNe(LVar0, FALSE)
Call(SetBattleFlagBits2, BS_FLAGS2_DROP_WHACKA_BUMP, TRUE)
EndIf
Call(SetPartFlagBits, ACTOR_SELF, 1, ACTOR_PART_FLAG_NO_TARGET, TRUE)
Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_INVISIBLE | ACTOR_FLAG_NO_ATTACK | ACTOR_FLAG_NO_DMG_APPLY, TRUE)
Call(RemoveActor, ACTOR_SELF)
Return
End
};

View File

@ -47,5 +47,5 @@ Formation N(WhackaFormation) = {
// needs to match stage name used while defining NAMESPACE above // needs to match stage name used while defining NAMESPACE above
// the actor include redefines NAMESPACE based on current AREA, so we need to insert the stage name via prefix // the actor include redefines NAMESPACE based on current AREA, so we need to insert the stage name via prefix
#define NAME_PREFIX iwa_01_ #define NAME_PREFIX iwa_01_
#include "battle/common/actor/whacka.inc.c" #include "battle/common/actor/whacka2.inc.c"
#define NAME_PREFIX #define NAME_PREFIX

View File

@ -42,5 +42,5 @@ Formation N(WhackaFormation) = {
// needs to match stage name used while defining NAMESPACE above // needs to match stage name used while defining NAMESPACE above
// the actor include redefines NAMESPACE based on current AREA, so we need to insert the stage name via prefix // the actor include redefines NAMESPACE based on current AREA, so we need to insert the stage name via prefix
#define NAME_PREFIX iwa_02_ #define NAME_PREFIX iwa_02_
#include "battle/common/actor/whacka.inc.c" #include "battle/common/actor/whacka2.inc.c"
#define NAME_PREFIX #define NAME_PREFIX

View File

@ -6104,21 +6104,23 @@ segments:
type: code type: code
start: 0x4D01F0 start: 0x4D01F0
vram_class: battle_area vram_class: battle_area
subalign: 4
subsegments: subsegments:
- [auto, c, area] - [auto, c, area]
- [auto, c, actor/cleft] - [auto, c, more_funcs]
- [auto, c, actor/monty_mole] - [auto, c, whacka_funcs]
- [auto, c, actor/buzzar] - [auto, c, iwa_01_funcs]
- [auto, c, actor/whacka] - [auto, c, iwa_02_funcs]
- [auto, c, stage/iwa_01] # - [auto, c, actor/cleft]
- [auto, c, stage/iwa_01b] # - [auto, c, actor/monty_mole]
- [auto, c, stage/iwa_02] # - [auto, c, actor/buzzar]
# - [auto, c, actor/whacka]
# - [auto, c, stage/iwa_01]
# - [auto, c, stage/iwa_01b]
# - [auto, c, stage/iwa_02]
- dir: battle/area/sbk - dir: battle/area/sbk
type: code type: code
start: 0x4DA5E0 start: 0x4DA5E0
vram_class: battle_area vram_class: battle_area
subalign: 16 # BSS alignment hack
subsegments: subsegments:
- [auto, c, actor/pokey] - [auto, c, actor/pokey]
- [auto, c, actor/bandit] - [auto, c, actor/bandit]
@ -6596,7 +6598,6 @@ segments:
type: code type: code
start: 0x660750 start: 0x660750
vram_class: battle_area vram_class: battle_area
subalign: 16 # BSS alignment hack
subsegments: subsegments:
- [auto, c, actor/crystal_king] - [auto, c, actor/crystal_king]
- [auto, c, actor/crystal_bit] - [auto, c, actor/crystal_bit]