Disassemble KMR 3 Battle (#600)

* Work.

* D_80000000

* The rest of KMR_03

* Comments
This commit is contained in:
JoshDuMan 2022-01-03 01:54:01 -08:00 committed by GitHub
parent 76c7e51f4a
commit f44eb0bb88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
41 changed files with 7807 additions and 1027 deletions

View File

@ -61,6 +61,7 @@ ApiStatus CloseActionCommandInfo(Evt* script, s32 isInitialCall);
ApiStatus LoadBattleSection(Evt* script, s32 isInitialCall);
ApiStatus GetBattlePhase(Evt* script, s32 isInitialCall);
ApiStatus GetLastElement(Evt* script, s32 isInitialCall);
ApiStatus func_80269E80(Evt* script, s32 isInitialCall);
ApiStatus SetGoalToHome(Evt* script, s32 isInitialCall);
ApiStatus SetIdleGoalToHome(Evt* script, s32 isInitialCall);
ApiStatus SetGoalToIndex(Evt* script, s32 isInitialCall);
@ -104,6 +105,7 @@ ApiStatus SetActorDispOffset(Evt* script, s32 isInitialCall);
ApiStatus GetPartDispOffset(Evt* script, s32 isInitialCall);
ApiStatus SetPartDispOffset(Evt* script, s32 isInitialCall);
ApiStatus AddPartDispOffset(Evt* script, s32 isInitialCall);
ApiStatus func_8026BF48(Evt* script, s32 isInitialCall);
ApiStatus GetActorVar(Evt* script, s32 isInitialCall);
ApiStatus SetActorVar(Evt* script, s32 isInitialCall);
ApiStatus AddActorVar(Evt* script, s32 isInitialCall);
@ -139,6 +141,7 @@ ApiStatus SetPartEventBits(Evt* script, s32 isInitialCall);
ApiStatus GetPartEventFlags(Evt* script, s32 isInitialCall);
ApiStatus HPBarToHome(Evt* script, s32 isInitialCall);
ApiStatus HPBarToCurrent(Evt* script, s32 isInitialCall);
ApiStatus func_8026D940(Evt* script, s32 isInitialCall);
ApiStatus SummonEnemy(Evt* script, s32 isInitialCall);
ApiStatus GetOwnerID(Evt* script, s32 isInitialCall);
ApiStatus SetOwnerID(Evt* script, s32 isInitialCall);
@ -232,7 +235,9 @@ ApiStatus EnemyFollowupAfflictTarget(Evt* script, s32 isInitialCall);
ApiStatus EnemyTestTarget(Evt* script, s32 isInitialCall);
ApiStatus DispatchDamageEvent(Evt* script, s32 isInitialCall);
ApiStatus DispatchEvent(Evt* script, s32 isInitialCall);
ApiStatus func_8027D2D8(Evt* script, s32 isInitialCall);
ApiStatus SetTargetOffset(Evt* script, s32 isInitialCall);
ApiStatus func_8027D4C8(Evt* script, s32 isInitialCall);
ApiStatus EnableActorBlur(Evt* script, s32 isInitialCall);
ApiStatus AfflictActor(Evt* script, s32 isInitialCall);
ApiStatus GetEncounterState(Evt* script, s32 isInitialCall);

View File

@ -1,10 +1,5 @@
#include "common.h"
#include "battle/battle.h"
#include "script_api/battle.h"
#include "message_ids.h"
#include "sprite/npc/goomba.h"
#include "sprite/npc/paragoomba.h"
#include "sprite/npc/spiked_goomba.h"
#define NAMESPACE b_area_kmr_part_1

View File

@ -1,12 +0,0 @@
#include "common.h"
#define NAMESPACE b_area_kmr_part_3
#include "common/BattleAreaAngleStuff.inc.c"
#define NAMESPACE dup_b_area_kmr_part_3
#include "common/StartRumbleWithParams.inc.c"
#define NAMESPACE b_area_kmr_part_3
#define NAMESPACE dup_b_area_kmr_part_3
#include "common/BattleAreaAngleStuff.inc.c"

View File

@ -1,8 +0,0 @@
#include "common.h"
#define NAMESPACE b_area_kmr_part_3
#include "common/StartRumbleWithParams.inc.c"
#define NAMESPACE dup2_b_area_kmr_part_3
#include "common/BattleAreaAngleStuff.inc.c"

View File

@ -1,5 +0,0 @@
#include "common.h"
#define NAMESPACE b_area_kmr_part_3
#include "common/UnkBattleFunc1.inc.c"

View File

@ -1,38 +0,0 @@
#include "common.h"
#include "hud_element.h"
#define NAMESPACE b_area_kmr_part_3
#define NAMESPACE dup_b_area_kmr_part_3
#include "common/UnkBattleFunc1.inc.c"
#define NAMESPACE b_area_kmr_part_3
ApiStatus func_802189DC_447E1C(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
f32 posX = evt_get_float_variable(script, *args++);
f32 posY = evt_get_float_variable(script, *args++);
s32 icon = create_hud_element(D_80104A28);
set_hud_element_render_pos(icon, posX, posY);
set_hud_element_scale(icon, 1.5f);
clear_hud_element_flags(icon, 0x200002);
evt_set_variable(script, *args++, icon);
load_tattle_flags(0x8B);
return ApiStatus_DONE2;
}
#include "common/FreeIcon.inc.c"
#define NAMESPACE dup2_b_area_kmr_part_3
#include "common/UnkBattleFunc1.inc.c"
#define NAMESPACE b_area_kmr_part_3
#define NAMESPACE dup3_b_area_kmr_part_3
#include "common/BattleAreaAngleStuff.inc.c"
#define NAMESPACE b_area_kmr_part_3
#include "common/Dist3D.inc.c"
#include "common/UnkBackgroundFunc3.inc.c"
#include "common/SetBackgroundAlpha.inc.c"

View File

@ -1,7 +0,0 @@
#include "common.h"
#define NAMESPACE b_area_kmr_part_3
#define NAMESPACE dup_b_area_kmr_part_3
#include "common/UnkAngleFunc2.inc.c"
#define NAMESPACE b_area_kmr_part_3

View File

@ -1,7 +0,0 @@
#include "common.h"
#define NAMESPACE b_area_kmr_part_3
#define NAMESPACE dup2_b_area_kmr_part_3
#include "common/UnkAngleFunc2.inc.c"
#define NAMESPACE b_area_kmr_part_3

View File

@ -1,7 +0,0 @@
#include "common.h"
#define NAMESPACE b_area_kmr_part_3
#define NAMESPACE dup3_b_area_kmr_part_3
#include "common/UnkAngleFunc2.inc.c"
#define NAMESPACE b_area_kmr_part_3

View File

@ -1,7 +0,0 @@
#include "common.h"
#define NAMESPACE b_area_kmr_part_3
#include "common/UnkAngleFunc2.inc.c"
#include "common/UnkFogFunc.inc.c"

View File

@ -1,5 +0,0 @@
#include "common.h"
#define NAMESPACE b_area_kmr_part_3
#include "common/UnkFogFunc2.inc.c"

View File

@ -1,11 +0,0 @@
#include "common.h"
#define NAMESPACE b_area_kmr_part_3
INCLUDE_ASM(s32, "battle/area_kmr_part_3/448E80", func_80219A40_448E80);
#include "common/Set80071270_0_16.inc.c"
#include "common/UnkFloatFunc2.inc.c"
INCLUDE_ASM(s32, "battle/area_kmr_part_3/448E80", func_80219D60_4491A0);

View File

@ -0,0 +1,523 @@
#include "common.h"
#include "battle/battle.h"
#include "script_api/battle.h"
#include "sprite/npc/jr_troopa.h"
#define NAMESPACE b_area_kmr_part_3_egg_jr_troopa
s32 N(idleAnimations_80224380)[] = {
STATUS_NORMAL, NPC_ANIM_jr_troopa_default_idle,
STATUS_SLEEP, NPC_ANIM_jr_troopa_default_sleep,
STATUS_STONE, NPC_ANIM_jr_troopa_default_still,
STATUS_POISON, NPC_ANIM_jr_troopa_default_still,
STATUS_STOP, NPC_ANIM_jr_troopa_default_still,
STATUS_STATIC, NPC_ANIM_jr_troopa_default_still,
STATUS_PARALYZE, NPC_ANIM_jr_troopa_default_still,
STATUS_END,
};
s32 N(idleAnimations_802243BC)[] = {
STATUS_NORMAL, NPC_ANIM_jr_troopa_default_idle,
STATUS_SLEEP, NPC_ANIM_jr_troopa_default_still,
STATUS_STONE, NPC_ANIM_jr_troopa_default_still,
STATUS_POISON, NPC_ANIM_jr_troopa_default_still,
STATUS_STOP, NPC_ANIM_jr_troopa_default_still,
STATUS_STATIC, NPC_ANIM_jr_troopa_default_still,
STATUS_PARALYZE, NPC_ANIM_jr_troopa_default_still,
STATUS_END,
};
s32 N(idleAnimations_802243F8)[] = {
STATUS_NORMAL, NPC_ANIM_jr_troopa_default_idle_shell,
STATUS_STOP, NPC_ANIM_jr_troopa_default_still_shell,
STATUS_END,
};
s32 N(defenseTable_8022440C)[] = {
ELEMENT_NORMAL, 1,
ELEMENT_END,
};
s32 N(statusTable_80224418)[] = {
STATUS_NORMAL, 100,
STATUS_DEFAULT, 100,
STATUS_SLEEP, 80,
STATUS_POISON, 0,
STATUS_FROZEN, 0,
STATUS_DIZZY, 50,
STATUS_FEAR, 0,
STATUS_STATIC, 0,
STATUS_PARALYZE, 100,
STATUS_SHRINK, 100,
STATUS_STOP, 100,
STATUS_DEFAULT_TURN_MOD, 0,
STATUS_SLEEP_TURN_MOD, -1,
STATUS_POISON_TURN_MOD, 0,
STATUS_FROZEN_TURN_MOD, 0,
STATUS_DIZZY_TURN_MOD, -1,
STATUS_FEAR_TURN_MOD, 0,
STATUS_STATIC_TURN_MOD, 0,
STATUS_PARALYZE_TURN_MOD, -1,
STATUS_SHRINK_TURN_MOD, -1,
STATUS_STOP_TURN_MOD, -2,
STATUS_END,
};
ActorPartDesc N(partsTable_802244C4)[] = {
{
.flags = ACTOR_PART_FLAG_MULTI_TARGET,
.index = 1,
.posOffset = { 0, 0, 0 },
.targetOffset = { -6, 18 },
.opacity = 255,
.idleAnimations = N(idleAnimations_80224380),
.defenseTable = N(defenseTable_8022440C),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = 0,
.unk_1C = 1532,
},
};
extern EvtSource N(init_80224A94);
ActorDesc NAMESPACE = {
.flags = 0,
.type = ACTOR_TYPE_JR_TROOPA2,
.level = 44,
.maxHP = 15,
.partCount = ARRAY_COUNT(N(partsTable_802244C4)),
.partsData = N(partsTable_802244C4),
.script = N(init_80224A94),
.statusTable = N(statusTable_80224418),
.escapeChance = 0,
.airLiftChance = 0,
.spookChance = 0,
.baseStatusChance = 0,
.upAndAwayChance = 0,
.spinSmashReq = 0,
.powerBounceChance = 80,
.coinReward = 0,
.size = { 32, 32 },
.hpBarOffset = { 0, 0 },
.statusIconOffset = { -15, 30 },
.statusMessageOffset = { 10, 20 },
};
EvtSource N(80224510) = {
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(UseBattleCamPreset, 7)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(SetBattleCamOffsetZ, 38)
EVT_CALL(SetBattleCamZoom, 256)
EVT_CALL(MoveBattleCamOver, 15)
EVT_RETURN
EVT_END
};
EvtSource N(802245A8) = {
EVT_CALL(func_802535B4, 1)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(MoveBattleCamOver, 12)
EVT_RETURN
EVT_END
};
EvtSource N(802245E8) = {
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(UseBattleCamPreset, 55)
EVT_CALL(MoveBattleCamOver, 30)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_RETURN
EVT_END
};
s32 N(idleAnimations_8022464C)[] = {
STATUS_NORMAL, NPC_ANIM_jr_troopa_default_dead,
STATUS_END,
};
EvtSource N(80224658) = {
EVT_SET(LW(10), LW(0))
EVT_CALL(func_8027D32C, -127)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, LW(10), LW(1))
EVT_WAIT_FRAMES(10)
EVT_CALL(func_80269E80, LW(5))
EVT_SWITCH(LW(5))
EVT_CASE_OR_EQ(10)
EVT_CASE_OR_EQ(14)
EVT_CASE_OR_EQ(12)
EVT_CASE_OR_EQ(16)
EVT_CASE_OR_EQ(11)
EVT_CASE_OR_EQ(15)
EVT_CASE_OR_EQ(13)
EVT_CASE_OR_EQ(17)
EVT_CASE_OR_EQ(2)
EVT_END_CASE_GROUP
EVT_CASE_DEFAULT
EVT_SET(LW(2), 0)
EVT_LOOP(24)
EVT_CALL(SetActorYaw, ACTOR_SELF, LW(2))
EVT_ADD(LW(2), 30)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_END_SWITCH
EVT_LABEL(0)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(1), 10)
EVT_ADD(LW(2), 10)
EVT_CALL(PlayEffect, 0x1, LW(0), LW(1), LW(2), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlaySound, SOUND_DEATH)
EVT_CALL(DropStarPoints, -127)
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_CALL(UseBattleCamPreset, 14)
EVT_CALL(SetBattleCamZoom, 260)
EVT_CALL(SetBattleCamOffsetZ, 15)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(MoveBattleCamOver, 30)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20E5)
EVT_CALL(SetAnimation, ACTOR_SELF, LW(10), 0x210027)
EVT_WAIT_FRAMES(12)
EVT_CALL(SetAnimation, ACTOR_SELF, LW(10), 0x210014)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, LW(10), EVT_ADDR(N(idleAnimations_8022464C)))
EVT_WAIT_FRAMES(60)
EVT_CALL(SetActorFlagBits, ACTOR_SELF, 4194304, 1)
EVT_RETURN
EVT_END
};
EvtSource N(80224964) = {
EVT_WAIT_FRAMES(10)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_CLOSE_SHELL)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(1), 10)
EVT_ADD(LW(2), 5)
EVT_CALL(PlayEffect, 0x7, 0, LW(0), LW(1), LW(2), -4, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x7, 0, LW(0), LW(1), LW(2), 4, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_hide_shell)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_802243F8)))
EVT_WAIT_FRAMES(10)
EVT_RETURN
EVT_END
};
extern EvtSource N(takeTurn_80225314);
extern EvtSource N(idle_80224B24);
extern EvtSource N(handleEvent_80224B58);
extern EvtSource N(nextTurn_80225B4C);
EvtSource N(init_80224A94) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_80225314)))
EVT_CALL(BindIdle, ACTOR_SELF, EVT_ADDR(N(idle_80224B24)))
EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_ADDR(N(handleEvent_80224B58)))
EVT_CALL(BindNextTurn, -127, EVT_ADDR(N(nextTurn_80225B4C)))
EVT_CALL(SetActorVar, -127, 0, 0)
EVT_CALL(SetActorVar, -127, 1, 0)
EVT_RETURN
EVT_END
};
EvtSource N(idle_80224B24) = {
EVT_LABEL(0)
EVT_WAIT_FRAMES(1)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
extern EvtSource N(802250E4);
extern EvtSource N(802251CC);
EvtSource N(handleEvent_80224B58) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_EQ(9)
EVT_EXEC_WAIT(N(802250E4))
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoNormalHit)
EVT_CASE_EQ(10)
EVT_EXEC_WAIT(N(802250E4))
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoNormalHit)
EVT_EXEC_WAIT(N(802251CC))
EVT_CASE_EQ(32)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoNormalHit)
EVT_WAIT_FRAMES(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_hurt_crazy)
EVT_EXEC_WAIT(N(80224658))
EVT_RETURN
EVT_CASE_EQ(14)
EVT_SET(LW(0), 1)
EVT_SET(LW(1), 2162728)
EVT_SET(LW(2), 2162729)
EVT_EXEC_WAIT(DoBurnHit)
EVT_CASE_EQ(36)
EVT_SET(LW(0), 1)
EVT_SET(LW(1), 2162728)
EVT_SET(LW(2), 2162729)
EVT_EXEC_WAIT(DoBurnHit)
EVT_WAIT_FRAMES(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_burn_dead)
EVT_EXEC_WAIT(N(80224658))
EVT_RETURN
EVT_CASE_EQ(11)
EVT_EXEC_WAIT(N(802250E4))
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_EXEC_WAIT(N(802251CC))
EVT_CASE_EQ(33)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_hurt_crazy)
EVT_EXEC_WAIT(N(80224658))
EVT_RETURN
EVT_CASE_EQ(47)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoJumpBack)
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_run)
EVT_EXEC_WAIT(DoReturnHome)
EVT_EXEC_WAIT(N(80224964))
EVT_CASE_EQ(38)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoJumpBack)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetHomePos, -127, LW(0), LW(1), LW(2))
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_hurt_crazy)
EVT_EXEC_WAIT(N(80224658))
EVT_RETURN
EVT_CASE_OR_EQ(23)
EVT_CASE_OR_EQ(25)
EVT_CASE_OR_EQ(31)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_idle_shell)
EVT_EXEC_WAIT(DoImmune)
EVT_END_CASE_GROUP
EVT_CASE_EQ(53)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_idle)
EVT_EXEC_WAIT(DoReturnHome)
EVT_CALL(HPBarToHome, ACTOR_SELF)
EVT_CASE_EQ(49)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_idle)
EVT_EXEC_WAIT(DoRecover)
EVT_CASE_DEFAULT
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(802250E4) = {
EVT_CALL(GetActorVar, -127, 1, LW(0))
EVT_IF_EQ(LW(0), 0)
EVT_CALL(GetLastDamage, -127, LW(1))
EVT_CALL(GetBattleFlags, LW(2))
EVT_IF_NOT_FLAG(LW(2), 0x80000)
EVT_IF_NE(LW(1), 0)
EVT_CALL(SetActorVar, -127, 1, 1)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x351000)
EVT_CALL(FreezeBattleCam, 1)
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtSource N(802251CC) = {
EVT_CALL(GetActorVar, -127, 1, LW(0))
EVT_IF_EQ(LW(0), 1)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x351000)
EVT_CALL(SetActorVar, -127, 1, 2)
EVT_EXEC_WAIT(N(80224510))
EVT_CALL(MoveBattleCamOver, 30)
EVT_WAIT_FRAMES(30)
EVT_CALL(ActorSpeak, 786730, -127, 1, 2162717, 2162717)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_talk_point)
EVT_CALL(EndActorSpeech, -127, 1, -1, -1)
EVT_EXEC_WAIT(N(80224964))
EVT_EXEC_WAIT(N(802245A8))
EVT_ELSE
EVT_CALL(SetActorVar, -127, 1, 0)
EVT_END_IF
EVT_END_IF
EVT_CALL(FreezeBattleCam, 0)
EVT_RETURN
EVT_END
};
EvtSource N(takeTurn_80225314) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_OPEN_SHELL)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_idle)
EVT_WAIT_FRAMES(20)
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(UseBattleCamPreset, 63)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(MoveBattleCamOver, 20)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_run)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_idle)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_jump)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(10), 0, 0, 2, 16)
EVT_SWITCH(LW(10))
EVT_CASE_OR_EQ(5)
EVT_CASE_OR_EQ(6)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_jump_still)
EVT_THREAD
EVT_WAIT_FRAMES(8)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_jump_land)
EVT_END_THREAD
EVT_CALL(GetActorPos, ACTOR_PLAYER, LW(0), LW(1), LW(2))
EVT_SET(LW(1), 0)
EVT_ADD(LW(2), 5)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE)
EVT_IF_EQ(LW(10), 5)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
EVT_END_IF
EVT_WAIT_FRAMES(2)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 20)
EVT_SET(LW(1), 0)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_idle)
EVT_WAIT_FRAMES(10)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(MoveBattleCamOver, 25)
EVT_CALL(SetActorYaw, ACTOR_SELF, 180)
EVT_CALL(AddActorDecoration, ACTOR_SELF, 1, 0, 2)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_sprint_crazy)
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_idle)
EVT_CALL(RemoveActorDecoration, ACTOR_SELF, 1, 0)
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_EXEC_WAIT(N(80224964))
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0))
EVT_THREAD
EVT_WAIT_FRAMES(3)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_jump_still)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_jump_land)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE)
EVT_WAIT_FRAMES(2)
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(0), 0, 0, 0, 2, 32)
EVT_SWITCH(LW(0))
EVT_CASE_DEFAULT
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(ResetAllActorSounds, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 40)
EVT_SET(LW(1), 0)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 30)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 20)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_idle)
EVT_WAIT_FRAMES(10)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_run)
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_idle)
EVT_EXEC_WAIT(N(80224964))
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(nextTurn_80225B4C) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(GetBattlePhase, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_EQ(10)
EVT_CALL(GetActorVar, -127, 0, LW(0))
EVT_IF_EQ(LW(0), 0)
EVT_CALL(SetActorVar, -127, 0, 1)
EVT_WAIT_FRAMES(15)
EVT_EXEC_WAIT(N(80224510))
EVT_WAIT_FRAMES(10)
EVT_CALL(ActorSpeak, 786728, -127, 1, 2162714, 2162715)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_sprint_crazy)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20B9)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(1), 16)
EVT_CALL(PlayEffect, 0x13, 0, LW(0), LW(1), LW(2), 1, 30, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x13, 1, LW(0), LW(1), LW(2), 1, 30, 0, 0, 0, 0, 0, 0, 0)
EVT_WAIT_FRAMES(30)
EVT_EXEC_WAIT(N(80224964))
EVT_WAIT_FRAMES(30)
EVT_CALL(ActorSpeak, 786729, -127, 1, 2162711, 2162692)
EVT_WAIT_FRAMES(10)
EVT_EXEC_WAIT(N(802245A8))
EVT_ELSE
EVT_END_IF
EVT_CASE_EQ(12)
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,478 @@
#include "common.h"
#include "battle/battle.h"
#include "script_api/battle.h"
#include "sprite/npc/jr_troopa.h"
#include "sprite/npc/para_jr_troopa.h"
#define NAMESPACE b_area_kmr_part_3_jr_troopa
s32 N(idleAnimations_802229F0)[] = {
STATUS_NORMAL, NPC_ANIM_jr_troopa_default_idle,
STATUS_STONE, NPC_ANIM_jr_troopa_default_still,
STATUS_SLEEP, NPC_ANIM_jr_troopa_default_still,
STATUS_POISON, NPC_ANIM_jr_troopa_default_still,
STATUS_STOP, NPC_ANIM_jr_troopa_default_still,
STATUS_STATIC, NPC_ANIM_jr_troopa_default_still,
STATUS_PARALYZE, NPC_ANIM_jr_troopa_default_still,
STATUS_END,
};
s32 N(defenseTable_80222A2C)[] = {
ELEMENT_NORMAL, 0,
ELEMENT_END,
};
s32 N(statusTable_80222A38)[] = {
STATUS_NORMAL, 100,
STATUS_DEFAULT, 100,
STATUS_SLEEP, 100,
STATUS_POISON, 0,
STATUS_FROZEN, 0,
STATUS_DIZZY, 50,
STATUS_FEAR, 0,
STATUS_STATIC, 0,
STATUS_PARALYZE, 100,
STATUS_SHRINK, 100,
STATUS_STOP, 100,
STATUS_DEFAULT_TURN_MOD, 0,
STATUS_SLEEP_TURN_MOD, -1,
STATUS_POISON_TURN_MOD, 0,
STATUS_FROZEN_TURN_MOD, 0,
STATUS_DIZZY_TURN_MOD, -1,
STATUS_FEAR_TURN_MOD, 0,
STATUS_STATIC_TURN_MOD, 0,
STATUS_PARALYZE_TURN_MOD, -1,
STATUS_SHRINK_TURN_MOD, -1,
STATUS_STOP_TURN_MOD, -2,
STATUS_END,
};
ActorPartDesc N(partsTable_80222AE4)[] = {
{
.flags = ACTOR_PART_FLAG_MULTI_TARGET,
.index = 1,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 30 },
.opacity = 255,
.idleAnimations = N(idleAnimations_802229F0),
.defenseTable = N(defenseTable_80222A2C),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = 0,
.unk_1C = 0,
},
};
extern EvtSource N(init_80223180);
ActorDesc NAMESPACE = {
.flags = 0,
.type = ACTOR_TYPE_JR_TROOPA1,
.level = 41,
.maxHP = 5,
.partCount = ARRAY_COUNT(N(partsTable_80222AE4)),
.partsData = N(partsTable_80222AE4),
.script = N(init_80223180),
.statusTable = N(statusTable_80222A38),
.escapeChance = 0,
.airLiftChance = 0,
.spookChance = 0,
.baseStatusChance = 0,
.upAndAwayChance = 0,
.spinSmashReq = 0,
.powerBounceChance = 80,
.coinReward = 0,
.size = { 24, 32 },
.hpBarOffset = { 0, 0 },
.statusIconOffset = { -15, 30 },
.statusMessageOffset = { 10, 20 },
};
EvtSource N(80222B30) = {
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(UseBattleCamPreset, 7)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(SetBattleCamOffsetZ, 38)
EVT_CALL(SetBattleCamZoom, 256)
EVT_CALL(MoveBattleCamOver, 15)
EVT_RETURN
EVT_END
};
EvtSource N(80222BC8) = {
EVT_CALL(func_802535B4, 1)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(MoveBattleCamOver, 12)
EVT_RETURN
EVT_END
};
EvtSource N(80222C08) = {
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(UseBattleCamPreset, 55)
EVT_CALL(MoveBattleCamOver, 30)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_RETURN
EVT_END
};
s32 N(idleAnimations_80222C6C)[] = {
STATUS_NORMAL, NPC_ANIM_jr_troopa_default_dead,
STATUS_END,
};
EvtSource N(80222C78) = {
EVT_SET(LW(10), LW(0))
EVT_CALL(func_8027D32C, -127)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, LW(10), LW(1))
EVT_WAIT_FRAMES(10)
EVT_CALL(func_80269E80, LW(5))
EVT_SWITCH(LW(5))
EVT_CASE_OR_EQ(10)
EVT_CASE_OR_EQ(14)
EVT_CASE_OR_EQ(12)
EVT_CASE_OR_EQ(16)
EVT_CASE_OR_EQ(11)
EVT_CASE_OR_EQ(15)
EVT_CASE_OR_EQ(13)
EVT_CASE_OR_EQ(17)
EVT_CASE_OR_EQ(2)
EVT_END_CASE_GROUP
EVT_CASE_DEFAULT
EVT_SET(LW(2), 0)
EVT_LOOP(24)
EVT_CALL(SetActorYaw, ACTOR_SELF, LW(2))
EVT_ADD(LW(2), 30)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_END_SWITCH
EVT_LABEL(0)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(1), 10)
EVT_ADD(LW(2), 10)
EVT_CALL(PlayEffect, 0x1, LW(0), LW(1), LW(2), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlaySound, SOUND_DEATH)
EVT_CALL(DropStarPoints, -127)
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_CALL(UseBattleCamPreset, 14)
EVT_CALL(SetBattleCamZoom, 260)
EVT_CALL(SetBattleCamOffsetZ, 15)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(MoveBattleCamOver, 30)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20E5)
EVT_CALL(SetAnimation, ACTOR_SELF, LW(10), 0x210027)
EVT_WAIT_FRAMES(12)
EVT_CALL(SetAnimation, ACTOR_SELF, LW(10), 0x210014)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, LW(10), EVT_ADDR(N(idleAnimations_80222C6C)))
EVT_WAIT_FRAMES(30)
EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE)
EVT_CALL(UseBattleCamPreset, 2)
EVT_WAIT_FRAMES(15)
EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, FALSE)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_10002)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 30)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 60)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 90)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 120)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 150)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 180)
EVT_WAIT_FRAMES(5)
EVT_CALL(ActorSpeak, 721076, 256, 0, 10289160, 10289153)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 150)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 120)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 90)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 60)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 30)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetActorFlagBits, ACTOR_SELF, 4194304, 1)
EVT_RETURN
EVT_END
};
extern EvtSource N(takeTurn_802234A4);
extern EvtSource N(handleEvent_80223290);
extern EvtSource N(nextTurn_80223D2C);
EvtSource N(init_80223180) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_802234A4)))
EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_ADDR(N(handleEvent_80223290)))
EVT_CALL(BindNextTurn, -127, EVT_ADDR(N(nextTurn_80223D2C)))
EVT_CALL(SetActorVar, -127, 0, 0)
EVT_CALL(SetActorVar, -127, 1, 0)
EVT_CALL(SetActorVar, -127, 2, 0)
EVT_CALL(SetActorVar, -127, 3, 0)
EVT_CALL(SetActorVar, -127, 4, 1)
EVT_CALL(SetActorVar, -127, 5, 0)
EVT_RETURN
EVT_END
};
EvtSource N(8022325C) = {
EVT_LABEL(0)
EVT_WAIT_FRAMES(1)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtSource N(handleEvent_80223290) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(GetActorVar, -127, 2, LW(0))
EVT_IF_EQ(LW(0), 0)
EVT_CALL(GetLastDamage, -127, LW(1))
EVT_IF_NE(LW(1), 0)
EVT_CALL(SetActorVar, -127, 2, 1)
EVT_END_IF
EVT_END_IF
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(9)
EVT_CASE_OR_EQ(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoNormalHit)
EVT_END_CASE_GROUP
EVT_CASE_EQ(32)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoNormalHit)
EVT_WAIT_FRAMES(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_hurt_crazy)
EVT_EXEC_WAIT(N(80222C78))
EVT_RETURN
EVT_CASE_OR_EQ(23)
EVT_CASE_OR_EQ(25)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_jr_troopa_default_idle)
EVT_EXEC_WAIT(DoImmune)
EVT_END_CASE_GROUP
EVT_CASE_DEFAULT
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(takeTurn_802234A4) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(AddActorVar, -127, 0, 1)
EVT_CALL(GetActorHP, -127, LW(0))
EVT_CALL(GetEnemyMaxHP, -127, LW(1))
EVT_SUB(LW(1), LW(0))
EVT_IF_EQ(LW(1), 3)
EVT_CALL(GetActorVar, -127, 5, LW(0))
EVT_IF_EQ(LW(0), 0)
EVT_CALL(SetActorVar, -127, 5, 1)
EVT_EXEC_WAIT(N(80222B30))
EVT_CALL(MoveBattleCamOver, 20)
EVT_WAIT_FRAMES(20)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(ActorSpeak, 721073, -127, 1, 2162710, 2162691)
EVT_END_IF
EVT_END_IF
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(UseBattleCamPreset, 63)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_run)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_idle)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_jump)
EVT_CALL(SetActorSounds, -127, 2, 8418, 0)
EVT_CALL(GetActorVar, -127, 4, LW(1))
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), 0, 0, LW(1), 16)
EVT_SWITCH(LW(0))
EVT_CASE_EQ(6)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 40)
EVT_SET(LW(1), 0)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 30)
EVT_CALL(ResetAllActorSounds, ACTOR_SELF)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 20)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
EVT_SUB(LW(0), 10)
EVT_CALL(JumpToGoal, ACTOR_SELF, 4, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_idle)
EVT_WAIT_FRAMES(8)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_idle)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_run)
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_idle)
EVT_RETURN
EVT_END_SWITCH
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0))
EVT_THREAD
EVT_WAIT_FRAMES(3)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_jump_still)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_jump_land)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE)
EVT_WAIT_FRAMES(2)
EVT_CALL(GetActorVar, -127, 4, LW(1))
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(0), 0, 0, 0, LW(1), 32)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(0)
EVT_CASE_OR_EQ(2)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(ResetAllActorSounds, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 40)
EVT_SET(LW(1), 0)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 30)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 20)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_idle)
EVT_WAIT_FRAMES(10)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_run)
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_idle)
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(nextTurn_80223D2C) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(GetBattlePhase, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_EQ(10)
EVT_CALL(GetActorVar, -127, 1, LW(0))
EVT_IF_EQ(LW(0), 0)
EVT_CALL(SetActorVar, -127, 1, 1)
EVT_WAIT_FRAMES(15)
EVT_CALL(func_802535B4, 0)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_10002)
EVT_THREAD
EVT_SET(LW(1), 0)
EVT_WAIT_FRAMES(8)
EVT_LOOP(5)
EVT_WAIT_FRAMES(1)
EVT_SUB(LW(1), 36)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, LW(1))
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_shadowboxing)
EVT_CALL(ActorSpeak, 721071, 256, 0, 10289160, 10289153)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_idle)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_NOD_YES)
EVT_WAIT_FRAMES(10)
EVT_THREAD
EVT_SET(LW(1), 180)
EVT_WAIT_FRAMES(4)
EVT_LOOP(5)
EVT_WAIT_FRAMES(1)
EVT_ADD(LW(1), 36)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, LW(1))
EVT_END_LOOP
EVT_END_THREAD
EVT_WAIT_FRAMES(10)
EVT_CALL(func_802535B4, 1)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(MoveBattleCamOver, 4)
EVT_END_IF
EVT_END_IF
EVT_CASE_EQ(12)
EVT_CALL(GetActorVar, -127, 2, LW(0))
EVT_IF_EQ(LW(0), 1)
EVT_CALL(SetActorVar, -127, 2, 2)
EVT_EXEC_WAIT(N(80222C08))
EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, FALSE)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_10002)
EVT_THREAD
EVT_SET(LW(1), 0)
EVT_LOOP(5)
EVT_WAIT_FRAMES(1)
EVT_SUB(LW(1), 36)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, LW(1))
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE)
EVT_CALL(ActorSpeak, 721072, 256, 0, 10289160, 10289153)
EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE)
EVT_CALL(SetAnimation, ACTOR_PLAYER, 0, ANIM_THUMBS_UP)
EVT_WAIT_FRAMES(20)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 0)
EVT_WAIT_FRAMES(4)
EVT_CALL(UseIdleAnimation, ACTOR_PLAYER, TRUE)
EVT_END_IF
EVT_CALL(GetActorVar, -127, 3, LW(0))
EVT_IF_EQ(LW(0), 0)
EVT_CALL(GetActorHP, -127, LW(0))
EVT_IF_LE(LW(0), 1)
EVT_CALL(SetActorVar, -127, 3, 1)
EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE)
EVT_CALL(ActorSpeak, 721074, 256, 0, 10289160, 10289153)
EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE)
EVT_EXEC_WAIT(N(80222B30))
EVT_CALL(ActorSpeak, 721075, -127, 1, 2162710, 2162691)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20B9)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_sprint_crazy)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(1), 16)
EVT_CALL(PlayEffect, 0x13, 0, LW(0), LW(1), LW(2), 1, 30, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x13, 1, LW(0), LW(1), LW(2), 1, 30, 0, 0, 0, 0, 0, 0, 0)
EVT_WAIT_FRAMES(30)
EVT_WAIT_FRAMES(20)
EVT_CALL(SetActorVar, -127, 4, 2)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_jr_troopa_default_idle)
EVT_WAIT_FRAMES(20)
EVT_END_IF
EVT_END_IF
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,596 @@
#include "common.h"
#include "hud_element.h"
#include "battle/battle.h"
#include "script_api/battle.h"
#include "sprite/npc/jr_troopa.h"
#include "sprite/npc/mage_jr_troopa.h"
#define NAMESPACE b_area_kmr_part_3_mage_jr_troopa
s32 N(idleAnimations_8022A550)[] = {
STATUS_NORMAL, NPC_ANIM_mage_jr_troopa_default_idle,
STATUS_SLEEP, NPC_ANIM_mage_jr_troopa_default_sleep,
STATUS_STONE, NPC_ANIM_mage_jr_troopa_default_still,
STATUS_POISON, NPC_ANIM_mage_jr_troopa_default_still,
STATUS_STOP, NPC_ANIM_mage_jr_troopa_default_still,
STATUS_STATIC, NPC_ANIM_mage_jr_troopa_default_still,
STATUS_PARALYZE, NPC_ANIM_mage_jr_troopa_default_still,
STATUS_DIZZY, NPC_ANIM_mage_jr_troopa_default_dizzy,
STATUS_END,
};
s32 N(idleAnimations_8022A594)[] = {
STATUS_NORMAL, NPC_ANIM_mage_jr_troopa_default_idle,
STATUS_SLEEP, NPC_ANIM_mage_jr_troopa_default_still,
STATUS_STONE, NPC_ANIM_mage_jr_troopa_default_still,
STATUS_POISON, NPC_ANIM_mage_jr_troopa_default_still,
STATUS_STOP, NPC_ANIM_mage_jr_troopa_default_still,
STATUS_STATIC, NPC_ANIM_mage_jr_troopa_default_still,
STATUS_PARALYZE, NPC_ANIM_mage_jr_troopa_default_still,
STATUS_DIZZY, NPC_ANIM_mage_jr_troopa_default_dizzy,
STATUS_END,
};
s32 N(idleAnimations_8022A5D8)[] = {
STATUS_NORMAL, NPC_ANIM_jr_troopa_default_idle,
STATUS_SLEEP, NPC_ANIM_jr_troopa_default_sleep,
STATUS_STONE, NPC_ANIM_jr_troopa_default_still,
STATUS_POISON, NPC_ANIM_jr_troopa_default_still,
STATUS_STOP, NPC_ANIM_jr_troopa_default_still,
STATUS_STATIC, NPC_ANIM_jr_troopa_default_still,
STATUS_PARALYZE, NPC_ANIM_jr_troopa_default_still,
STATUS_DIZZY, NPC_ANIM_jr_troopa_default_dizzy,
STATUS_END,
};
s32 N(idleAnimations_8022A61C)[] = {
STATUS_NORMAL, NPC_ANIM_jr_troopa_default_dead,
STATUS_END,
};
s32 N(defenseTable_8022A628)[] = {
ELEMENT_NORMAL, 1,
ELEMENT_END,
};
s32 N(statusTable_8022A634)[] = {
STATUS_NORMAL, 100,
STATUS_DEFAULT, 100,
STATUS_SLEEP, 35,
STATUS_POISON, 0,
STATUS_FROZEN, 0,
STATUS_DIZZY, 45,
STATUS_FEAR, 0,
STATUS_STATIC, 0,
STATUS_PARALYZE, 45,
STATUS_SHRINK, 60,
STATUS_STOP, 60,
STATUS_DEFAULT_TURN_MOD, 0,
STATUS_SLEEP_TURN_MOD, -2,
STATUS_POISON_TURN_MOD, 0,
STATUS_FROZEN_TURN_MOD, 0,
STATUS_DIZZY_TURN_MOD, -1,
STATUS_FEAR_TURN_MOD, 0,
STATUS_STATIC_TURN_MOD, 0,
STATUS_PARALYZE_TURN_MOD, -1,
STATUS_SHRINK_TURN_MOD, -1,
STATUS_STOP_TURN_MOD, -2,
STATUS_END,
};
ActorPartDesc N(partsTable_8022A6E0)[] = {
{
.flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_MULTI_TARGET,
.index = 1,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 28 },
.opacity = 255,
.idleAnimations = N(idleAnimations_8022A550),
.defenseTable = N(defenseTable_8022A628),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = 0,
.unk_1C = -263,
},
{
.flags = ACTOR_PART_FLAG_NO_TARGET,
.index = 2,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 30 },
.opacity = 255,
.idleAnimations = N(idleAnimations_8022A5D8),
.defenseTable = N(defenseTable_8022A628),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = 0,
.unk_1C = 0,
},
};
extern EvtSource N(init_8022ACE4);
ActorDesc NAMESPACE = {
.flags = 0,
.type = ACTOR_TYPE_JR_TROOPA5,
.level = 65,
.maxHP = 50,
.partCount = ARRAY_COUNT(N(partsTable_8022A6E0)),
.partsData = N(partsTable_8022A6E0),
.script = N(init_8022ACE4),
.statusTable = N(statusTable_8022A634),
.escapeChance = 0,
.airLiftChance = 0,
.spookChance = 0,
.baseStatusChance = 0,
.upAndAwayChance = 0,
.spinSmashReq = 0,
.powerBounceChance = 75,
.coinReward = 0,
.size = { 24, 32 },
.hpBarOffset = { 0, 0 },
.statusIconOffset = { -20, 35 },
.statusMessageOffset = { 10, 25 },
};
EvtSource N(8022A750) = {
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(2))
EVT_IF_FLAG(LW(2), 0x35D000)
EVT_RETURN
EVT_END_IF
EVT_CALL(GetBattleFlags, LW(2))
EVT_IF_FLAG(LW(2), 0x80000)
EVT_CALL(GetMenuSelection, LW(0), LW(1), LW(2))
EVT_IF_EQ(LW(2), 183)
EVT_CALL(SetActorVar, -127, 3, 1)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x263)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(1), 30)
EVT_CALL(ShowEmote, 0, EMOTE_QUESTION, -45, 30, 2, LW(0), LW(1), LW(2), 5)
EVT_WAIT_FRAMES(30)
EVT_END_IF
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtSource N(8022A880) = {
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20B9)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(3))
EVT_IF_NOT_FLAG(LW(3), 0x80000)
EVT_ADD(LW(1), 16)
EVT_ELSE
EVT_ADD(LW(1), 6)
EVT_END_IF
EVT_CALL(PlayEffect, 0x13, 0, LW(0), LW(1), LW(2), 1, 30, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x13, 1, LW(0), LW(1), LW(2), 1, 30, 0, 0, 0, 0, 0, 0, 0)
EVT_THREAD
EVT_SET(LW(0), 0)
EVT_LOOP(32)
EVT_WAIT_FRAMES(1)
EVT_ADD(LW(0), 45)
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, LW(0), 0)
EVT_END_LOOP
EVT_END_THREAD
EVT_WAIT_FRAMES(32)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x300)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(1), 15)
EVT_CALL(PlayEffect, 0x52, 4, LW(0), LW(1), LW(2), 1, 40, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x7, 0, LW(0), LW(1), LW(2), -4, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x7, 0, LW(0), LW(1), LW(2), -4, 4, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x7, 0, LW(0), LW(1), LW(2), 4, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x7, 0, LW(0), LW(1), LW(2), 4, 4, 0, 0, 0, 0, 0, 0, 0)
EVT_RETURN
EVT_END
};
EvtSource N(8022ABA8) = {
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(UseBattleCamPreset, 7)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(SetBattleCamOffsetZ, 38)
EVT_CALL(SetBattleCamZoom, 256)
EVT_CALL(MoveBattleCamOver, 15)
EVT_RETURN
EVT_END
};
EvtSource N(8022AC40) = {
EVT_CALL(func_802535B4, 1)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(MoveBattleCamOver, 12)
EVT_RETURN
EVT_END
};
EvtSource N(8022AC80) = {
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(UseBattleCamPreset, 55)
EVT_CALL(MoveBattleCamOver, 30)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_RETURN
EVT_END
};
extern EvtSource N(takeTurn_8022B4F0);
extern EvtSource N(idle_8022ADA4);
extern EvtSource N(handleEvent_8022ADD8);
extern EvtSource N(nextTurn_8022BB44);
EvtSource N(init_8022ACE4) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_8022B4F0)))
EVT_CALL(BindIdle, ACTOR_SELF, EVT_ADDR(N(idle_8022ADA4)))
EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_ADDR(N(handleEvent_8022ADD8)))
EVT_CALL(BindNextTurn, -127, EVT_ADDR(N(nextTurn_8022BB44)))
EVT_CALL(SetActorVar, -127, 0, 0)
EVT_CALL(SetActorVar, -127, 1, 0)
EVT_CALL(SetActorVar, -127, 2, 0)
EVT_CALL(SetActorVar, -127, 3, 0)
EVT_RETURN
EVT_END
};
EvtSource N(idle_8022ADA4) = {
EVT_LABEL(0)
EVT_WAIT_FRAMES(1)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
extern EvtSource N(8022C2A4);
extern EvtSource N(8022BF1C);
EvtSource N(handleEvent_8022ADD8) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_EQ(9)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_mage_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoNormalHit)
EVT_CASE_EQ(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_mage_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoNormalHit)
EVT_EXEC_WAIT(N(8022A750))
EVT_EXEC_WAIT(N(8022C2A4))
EVT_CASE_EQ(32)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_mage_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoNormalHit)
EVT_WAIT_FRAMES(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_mage_jr_troopa_default_still)
EVT_EXEC_WAIT(N(8022BF1C))
EVT_RETURN
EVT_CASE_EQ(14)
EVT_SET(LW(0), 1)
EVT_SET(LW(1), 2359306)
EVT_SET(LW(2), 2359307)
EVT_EXEC_WAIT(DoBurnHit)
EVT_CASE_EQ(36)
EVT_SET(LW(0), 1)
EVT_SET(LW(1), 2359306)
EVT_SET(LW(2), 2359307)
EVT_EXEC_WAIT(DoBurnHit)
EVT_WAIT_FRAMES(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_mage_jr_troopa_default_burn_dead)
EVT_EXEC_WAIT(N(8022BF1C))
EVT_RETURN
EVT_CASE_EQ(11)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_mage_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_CASE_EQ(33)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_mage_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_mage_jr_troopa_default_hurt)
EVT_EXEC_WAIT(N(8022BF1C))
EVT_RETURN
EVT_CASE_EQ(47)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_mage_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_mage_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoJumpBack)
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CALL(ResetAllActorSounds, ACTOR_SELF)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_mage_jr_troopa_default_run)
EVT_EXEC_WAIT(DoReturnHome)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6005859375))
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CASE_EQ(38)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_mage_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_mage_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoJumpBack)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_mage_jr_troopa_default_still)
EVT_EXEC_WAIT(N(8022BF1C))
EVT_RETURN
EVT_CASE_OR_EQ(23)
EVT_CASE_OR_EQ(25)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_mage_jr_troopa_default_idle)
EVT_EXEC_WAIT(DoImmune)
EVT_EXEC_WAIT(N(8022A750))
EVT_EXEC_WAIT(N(8022C2A4))
EVT_END_CASE_GROUP
EVT_CASE_EQ(58)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x35D000)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_mage_jr_troopa_default_hanging)
EVT_WAIT_FRAMES(1000)
EVT_END_IF
EVT_CASE_EQ(31)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x35D000)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_mage_jr_troopa_default_hanging)
EVT_WAIT_FRAMES(20)
EVT_EXEC_WAIT(N(8022ABA8))
EVT_CALL(ActorSpeak, 1900955, -127, 1, 2359310, 2359299)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_mage_jr_troopa_default_idle)
EVT_EXEC_WAIT(N(8022AC40))
EVT_END_IF
EVT_CASE_EQ(42)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_mage_jr_troopa_default_hurt)
EVT_WAIT_FRAMES(20)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_mage_jr_troopa_default_run)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_mage_jr_troopa_default_idle)
EVT_CASE_EQ(53)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_mage_jr_troopa_default_idle)
EVT_EXEC_WAIT(DoReturnHome)
EVT_CALL(HPBarToHome, ACTOR_SELF)
EVT_CASE_EQ(49)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_mage_jr_troopa_default_idle)
EVT_EXEC_WAIT(DoRecover)
EVT_CASE_DEFAULT
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(takeTurn_8022B4F0) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_mage_jr_troopa_default_attack)
EVT_WAIT_FRAMES(8)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_SPELL_CAST1)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x80000)
EVT_SET(LW(3), 0)
EVT_SET(LW(4), 36)
EVT_SETF(LW(5), EVT_FLOAT(1.0))
EVT_ELSE
EVT_SET(LW(3), 0)
EVT_SET(LW(4), 14)
EVT_SETF(LW(5), EVT_FLOAT(0.400390625))
EVT_END_IF
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), LW(3))
EVT_ADD(LW(1), LW(4))
EVT_CALL(PlayEffect, 0x13, 0, LW(0), LW(1), LW(2), LW(5), 30, 0, 0, 0, 0, 0, 0, 0)
EVT_WAIT_FRAMES(30)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_mage_jr_troopa_default_attack2)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(10), DAMAGE_TYPE_NO_CONTACT, 0, 1, 16)
EVT_SWITCH(LW(10))
EVT_CASE_OR_EQ(6)
EVT_CASE_OR_EQ(5)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_SPELL_CAST2)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LW(3), LW(4), LW(5))
EVT_SUB(LW(3), 120)
EVT_ADD(LW(4), 20)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x80000)
EVT_SET(LW(6), -8)
EVT_SET(LW(7), 20)
EVT_SETF(LW(8), EVT_FLOAT(1.0))
EVT_ELSE
EVT_SET(LW(6), -3)
EVT_SET(LW(7), 8)
EVT_SETF(LW(8), EVT_FLOAT(0.400390625))
EVT_END_IF
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), LW(6))
EVT_ADD(LW(1), LW(7))
EVT_CALL(PlayEffect, 0x12, 0, LW(0), LW(1), LW(2), LW(3), LW(4), LW(5), 30, 0, 0, 0, 0, 0)
EVT_WAIT_FRAMES(35)
EVT_IF_EQ(LW(10), 5)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
EVT_END_IF
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_SPELL_CAST2)
EVT_CALL(GetActorPos, ACTOR_PLAYER, LW(3), LW(4), LW(5))
EVT_ADD(LW(4), 20)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x80000)
EVT_SET(LW(6), -8)
EVT_SET(LW(7), 20)
EVT_SETF(LW(8), EVT_FLOAT(1.0))
EVT_ELSE
EVT_SET(LW(6), -3)
EVT_SET(LW(7), 8)
EVT_SETF(LW(8), EVT_FLOAT(0.400390625))
EVT_END_IF
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), LW(6))
EVT_ADD(LW(1), LW(7))
EVT_CALL(PlayEffect, 0x12, 0, LW(0), LW(1), LW(2), LW(3), LW(4), LW(5), 15, 0, 0, 0, 0, 0)
EVT_WAIT_FRAMES(15)
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(0), (DAMAGE_TYPE_MAGIC | DAMAGE_TYPE_NO_CONTACT), 0, 0, 8, 32)
EVT_SWITCH(LW(0))
EVT_CASE_EQ(0)
EVT_CALL(GetActorVar, -127, 1, LW(0))
EVT_IF_EQ(LW(0), 0)
EVT_CALL(GetLastDamage, 0, LW(1))
EVT_IF_NE(LW(1), 0)
EVT_CALL(SetActorVar, -127, 1, 1)
EVT_END_IF
EVT_END_IF
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(nextTurn_8022BB44) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(GetBattlePhase, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_EQ(12)
EVT_CALL(GetActorVar, -127, 0, LW(0))
EVT_IF_EQ(LW(0), 1)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_NOT_FLAG(LW(1), 0x35D000)
EVT_CALL(SetActorVar, -127, 0, 2)
EVT_CALL(GetActorVar, -127, 3, LW(0))
EVT_IF_EQ(LW(0), 0)
EVT_EXEC_WAIT(N(8022ABA8))
EVT_WAIT_FRAMES(20)
EVT_END_IF
EVT_CALL(ActorSpeak, 1179869, -127, 1, 2359310, 2359299)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_mage_jr_troopa_default_idle)
EVT_EXEC_WAIT(N(8022AC40))
EVT_WAIT_FRAMES(20)
EVT_END_IF
EVT_ELSE
EVT_WAIT_FRAMES(20)
EVT_END_IF
EVT_CALL(SetActorVar, -127, 3, 0)
EVT_RETURN
EVT_CASE_EQ(11)
EVT_CALL(GetActorVar, -127, 1, LW(0))
EVT_IF_EQ(LW(0), 1)
EVT_CALL(SetActorVar, -127, 1, 2)
EVT_EXEC_WAIT(N(8022ABA8))
EVT_WAIT_FRAMES(20)
EVT_CALL(ActorSpeak, 1179870, -127, 1, 2359310, 2359299)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_mage_jr_troopa_default_idle)
EVT_EXEC_WAIT(N(8022AC40))
EVT_WAIT_FRAMES(10)
EVT_END_IF
EVT_RETURN
EVT_CASE_EQ(10)
EVT_CALL(GetActorVar, -127, 0, LW(0))
EVT_IF_EQ(LW(0), 0)
EVT_CALL(SetActorVar, -127, 0, 1)
EVT_WAIT_FRAMES(15)
EVT_EXEC_WAIT(N(8022ABA8))
EVT_WAIT_FRAMES(10)
EVT_CALL(ActorSpeak, 1179867, -127, 2, 2162714, 2162715)
EVT_WAIT_FRAMES(8)
EVT_EXEC_WAIT(N(8022A880))
EVT_CALL(SetPartFlagBits, -127, 2, 1, 1)
EVT_CALL(SetPartFlagBits, -127, 1, 1, 0)
EVT_WAIT_FRAMES(15)
EVT_CALL(ActorSpeak, 1179868, -127, 1, 2359310, 2359299)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_mage_jr_troopa_default_idle)
EVT_WAIT_FRAMES(10)
EVT_EXEC_WAIT(N(8022AC40))
EVT_END_IF
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(8022BF1C) = {
EVT_CALL(func_8027D32C, -127)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(func_80269E80, LW(5))
EVT_SWITCH(LW(5))
EVT_CASE_OR_EQ(10)
EVT_CASE_OR_EQ(14)
EVT_CASE_OR_EQ(12)
EVT_CASE_OR_EQ(16)
EVT_CASE_OR_EQ(11)
EVT_CASE_OR_EQ(15)
EVT_CASE_OR_EQ(13)
EVT_CASE_OR_EQ(17)
EVT_CASE_OR_EQ(2)
EVT_END_CASE_GROUP
EVT_CASE_DEFAULT
EVT_SET(LW(2), 0)
EVT_LOOP(24)
EVT_CALL(SetActorYaw, ACTOR_SELF, LW(2))
EVT_ADD(LW(2), 30)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_END_SWITCH
EVT_LABEL(0)
EVT_THREAD
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(1), 10)
EVT_ADD(LW(2), 10)
EVT_LOOP(3)
EVT_CALL(PlayEffect, 0x1, LW(0), LW(1), LW(2), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_WAIT_FRAMES(3)
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(SetPartFlagBits, -127, 1, 1, 1)
EVT_CALL(SetPartFlagBits, -127, 2, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_jr_troopa_default_dead_still)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 5)
EVT_CALL(SetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_WAIT_FRAMES(15)
EVT_CALL(PlaySound, SOUND_DEATH)
EVT_CALL(DropStarPoints, -127)
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_CALL(UseBattleCamPreset, 14)
EVT_CALL(SetBattleCamZoom, 260)
EVT_CALL(SetBattleCamOffsetZ, 15)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(MoveBattleCamOver, 30)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20E5)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_jr_troopa_default_dead)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 2, EVT_ADDR(N(idleAnimations_8022A61C)))
EVT_WAIT_FRAMES(60)
EVT_CALL(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_DMG_APPLY, 1)
EVT_RETURN
EVT_END
};
EvtSource N(8022C2A4) = {
EVT_CALL(GetActorVar, -127, 3, LW(0))
EVT_IF_EQ(LW(0), 1)
EVT_WAIT_FRAMES(10)
EVT_EXEC_WAIT(N(8022ABA8))
EVT_CALL(ActorSpeak, 1900954, -127, 1, 2359310, 2359299)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_mage_jr_troopa_default_idle)
EVT_CALL(GetActorVar, -127, 0, LW(0))
EVT_IF_NE(LW(0), 1)
EVT_EXEC_WAIT(N(8022AC40))
EVT_END_IF
EVT_END_IF
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,615 @@
#include "common.h"
#include "battle/battle.h"
#include "script_api/battle.h"
#include "sprite/npc/jr_troopa.h"
#include "sprite/npc/para_jr_troopa.h"
#define NAMESPACE b_area_kmr_part_3_para_jr_troopa
s32 N(idleAnimations_80225DC0)[] = {
STATUS_NORMAL, NPC_ANIM_para_jr_troopa_default_idle,
STATUS_SLEEP, NPC_ANIM_para_jr_troopa_default_sleep,
STATUS_STONE, NPC_ANIM_para_jr_troopa_default_still,
STATUS_POISON, NPC_ANIM_para_jr_troopa_default_still,
STATUS_STOP, NPC_ANIM_para_jr_troopa_default_still,
STATUS_STATIC, NPC_ANIM_para_jr_troopa_default_still,
STATUS_PARALYZE, NPC_ANIM_para_jr_troopa_default_still,
STATUS_DIZZY, NPC_ANIM_para_jr_troopa_default_dizzy,
STATUS_END,
};
s32 N(idleAnimations_80225E04)[] = {
STATUS_NORMAL, NPC_ANIM_jr_troopa_default_idle,
STATUS_SLEEP, NPC_ANIM_jr_troopa_default_sleep,
STATUS_STONE, NPC_ANIM_jr_troopa_default_still,
STATUS_POISON, NPC_ANIM_jr_troopa_default_still,
STATUS_STOP, NPC_ANIM_jr_troopa_default_still,
STATUS_STATIC, NPC_ANIM_jr_troopa_default_still,
STATUS_PARALYZE, NPC_ANIM_jr_troopa_default_still,
STATUS_DIZZY, NPC_ANIM_jr_troopa_default_dizzy,
STATUS_END,
};
s32 N(idleAnimations_80225E48)[] = {
STATUS_NORMAL, NPC_ANIM_jr_troopa_default_dead,
STATUS_END,
};
s32 N(defenseTable_80225E54)[] = {
ELEMENT_NORMAL, 1,
ELEMENT_END,
};
s32 N(statusTable_80225E60)[] = {
STATUS_NORMAL, 100,
STATUS_DEFAULT, 100,
STATUS_SLEEP, 50,
STATUS_POISON, 0,
STATUS_FROZEN, 0,
STATUS_DIZZY, 50,
STATUS_FEAR, 0,
STATUS_STATIC, 0,
STATUS_PARALYZE, 50,
STATUS_SHRINK, 80,
STATUS_STOP, 80,
STATUS_DEFAULT_TURN_MOD, 0,
STATUS_SLEEP_TURN_MOD, -1,
STATUS_POISON_TURN_MOD, 0,
STATUS_FROZEN_TURN_MOD, 0,
STATUS_DIZZY_TURN_MOD, -1,
STATUS_FEAR_TURN_MOD, 0,
STATUS_STATIC_TURN_MOD, 0,
STATUS_PARALYZE_TURN_MOD, -1,
STATUS_SHRINK_TURN_MOD, -1,
STATUS_STOP_TURN_MOD, -2,
STATUS_END,
};
ActorPartDesc N(partsTable_80225F0C)[] = {
{
.flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_MULTI_TARGET,
.index = 1,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 35 },
.opacity = 255,
.idleAnimations = N(idleAnimations_80225DC0),
.defenseTable = N(defenseTable_80225E54),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = 0,
.unk_1C = 250,
},
{
.flags = ACTOR_PART_FLAG_NO_TARGET,
.index = 2,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 30 },
.opacity = 255,
.idleAnimations = N(idleAnimations_80225E04),
.defenseTable = N(defenseTable_80225E54),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = 0,
.unk_1C = 0,
},
};
extern EvtSource N(init_80226510);
ActorDesc NAMESPACE = {
.flags = ACTOR_FLAG_FLYING,
.type = ACTOR_TYPE_JR_TROOPA3,
.level = 52,
.maxHP = 40,
.partCount = ARRAY_COUNT(N(partsTable_80225F0C)),
.partsData = N(partsTable_80225F0C),
.script = N(init_80226510),
.statusTable = N(statusTable_80225E60),
.escapeChance = 0,
.airLiftChance = 0,
.spookChance = 0,
.baseStatusChance = 0,
.upAndAwayChance = 0,
.spinSmashReq = 0,
.powerBounceChance = 80,
.coinReward = 0,
.size = { 60, 35 },
.hpBarOffset = { 0, 0 },
.statusIconOffset = { -25, 35 },
.statusMessageOffset = { 10, 25 },
};
EvtSource N(80225F7C) = {
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(2))
EVT_IF_FLAG(LW(2), 0x35D000)
EVT_RETURN
EVT_END_IF
EVT_CALL(GetBattleFlags, LW(2))
EVT_IF_FLAG(LW(2), 0x80000)
EVT_CALL(GetMenuSelection, LW(0), LW(1), LW(2))
EVT_IF_EQ(LW(2), 183)
EVT_CALL(SetActorVar, -127, 1, 1)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x263)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(1), 30)
EVT_CALL(ShowEmote, 0, EMOTE_QUESTION, -45, 30, 2, LW(0), LW(1), LW(2), 5)
EVT_WAIT_FRAMES(30)
EVT_END_IF
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtSource N(802260AC) = {
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20B9)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(3))
EVT_IF_NOT_FLAG(LW(3), 0x80000)
EVT_ADD(LW(1), 16)
EVT_ELSE
EVT_ADD(LW(1), 6)
EVT_END_IF
EVT_CALL(PlayEffect, 0x13, 0, LW(0), LW(1), LW(2), 1, 30, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x13, 1, LW(0), LW(1), LW(2), 1, 30, 0, 0, 0, 0, 0, 0, 0)
EVT_THREAD
EVT_SET(LW(0), 0)
EVT_LOOP(32)
EVT_WAIT_FRAMES(1)
EVT_ADD(LW(0), 45)
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, LW(0), 0)
EVT_END_LOOP
EVT_END_THREAD
EVT_WAIT_FRAMES(32)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x300)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(1), 15)
EVT_CALL(PlayEffect, 0x52, 4, LW(0), LW(1), LW(2), 1, 40, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x7, 0, LW(0), LW(1), LW(2), -4, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x7, 0, LW(0), LW(1), LW(2), -4, 4, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x7, 0, LW(0), LW(1), LW(2), 4, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x7, 0, LW(0), LW(1), LW(2), 4, 4, 0, 0, 0, 0, 0, 0, 0)
EVT_RETURN
EVT_END
};
EvtSource N(802263D4) = {
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(UseBattleCamPreset, 7)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(SetBattleCamOffsetZ, 38)
EVT_CALL(SetBattleCamZoom, 256)
EVT_CALL(MoveBattleCamOver, 15)
EVT_RETURN
EVT_END
};
EvtSource N(8022646C) = {
EVT_CALL(func_802535B4, 1)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(MoveBattleCamOver, 12)
EVT_RETURN
EVT_END
};
EvtSource N(802264AC) = {
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(UseBattleCamPreset, 55)
EVT_CALL(MoveBattleCamOver, 30)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_RETURN
EVT_END
};
extern EvtSource N(takeTurn_80226F58);
extern EvtSource N(idle_802265A0);
extern EvtSource N(handleEvent_802266B0);
extern EvtSource N(nextTurn_80227724);
EvtSource N(init_80226510) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_80226F58)))
EVT_CALL(BindIdle, ACTOR_SELF, EVT_ADDR(N(idle_802265A0)))
EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_ADDR(N(handleEvent_802266B0)))
EVT_CALL(BindNextTurn, -127, EVT_ADDR(N(nextTurn_80227724)))
EVT_CALL(SetActorVar, -127, 0, 0)
EVT_CALL(SetActorVar, -127, 1, 0)
EVT_RETURN
EVT_END
};
#include "common/UnkBattleFunc1.inc.c"
EvtSource N(idle_802265A0) = {
EVT_LABEL(0)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(10))
EVT_IF_FLAG(LW(10), 0x41000)
EVT_CALL(SetTargetOffset, -127, 1, -12, 28)
EVT_CALL(func_8027D4C8, -127, 1, 4, -6)
EVT_CALL(N(UnkBattleFunc1), -25, 27, -1, 27)
EVT_ELSE
EVT_CALL(SetTargetOffset, -127, 1, -5, 33)
EVT_CALL(func_8027D4C8, -127, 1, 0, -6)
EVT_CALL(N(UnkBattleFunc1), -22, 30, 2, 28)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
extern EvtSource N(802279B0);
extern EvtSource N(80227D38);
extern EvtSource N(80227E1C);
EvtSource N(handleEvent_802266B0) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(9)
EVT_CASE_OR_EQ(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoNormalHit)
EVT_EXEC_WAIT(N(80225F7C))
EVT_EXEC_WAIT(N(80227E1C))
EVT_END_CASE_GROUP
EVT_CASE_EQ(32)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoNormalHit)
EVT_WAIT_FRAMES(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(N(802279B0))
EVT_RETURN
EVT_CASE_EQ(14)
EVT_SET(LW(0), 1)
EVT_SET(LW(1), 2424840)
EVT_SET(LW(2), 2424841)
EVT_EXEC_WAIT(DoBurnHit)
EVT_CASE_EQ(36)
EVT_SET(LW(0), 1)
EVT_SET(LW(1), 2424840)
EVT_SET(LW(2), 2424841)
EVT_EXEC_WAIT(DoBurnHit)
EVT_WAIT_FRAMES(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_para_jr_troopa_default_burn_dead)
EVT_EXEC_WAIT(N(802279B0))
EVT_RETURN
EVT_CASE_EQ(11)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_CASE_EQ(33)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(N(802279B0))
EVT_RETURN
EVT_CASE_EQ(47)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoJumpBack)
EVT_EXEC_WAIT(N(80227D38))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_idle)
EVT_CASE_EQ(38)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoJumpBack)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_para_jr_troopa_default_idle)
EVT_EXEC_WAIT(N(802279B0))
EVT_RETURN
EVT_CASE_EQ(23)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_para_jr_troopa_default_idle)
EVT_EXEC_WAIT(DoImmune)
EVT_CASE_EQ(25)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_para_jr_troopa_default_idle)
EVT_EXEC_WAIT(DoImmune)
EVT_EXEC_WAIT(N(80225F7C))
EVT_EXEC_WAIT(N(80227E1C))
EVT_CASE_EQ(42)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_hurt)
EVT_WAIT_FRAMES(20)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_run)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_idle)
EVT_CASE_EQ(58)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x35D000)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_hanging)
EVT_WAIT_FRAMES(1000)
EVT_END_IF
EVT_CASE_EQ(31)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x35D000)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_para_jr_troopa_default_hanging)
EVT_EXEC_WAIT(DoImmune)
EVT_EXEC_WAIT(N(802263D4))
EVT_CALL(ActorSpeak, 1900955, -127, 1, 2424844, 2424844)
EVT_EXEC_WAIT(N(8022646C))
EVT_END_IF
EVT_CASE_EQ(53)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_para_jr_troopa_default_idle)
EVT_EXEC_WAIT(DoReturnHome)
EVT_CALL(HPBarToHome, ACTOR_SELF)
EVT_CASE_EQ(49)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_para_jr_troopa_default_idle)
EVT_EXEC_WAIT(DoRecover)
EVT_CASE_DEFAULT
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(80226D4C) = {
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 40)
EVT_SET(LW(1), 0)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 30)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 20)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
EVT_SUB(LW(0), 10)
EVT_CALL(JumpToGoal, ACTOR_SELF, 4, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_idle)
EVT_WAIT_FRAMES(8)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_idle)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_run)
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_idle)
EVT_RETURN
EVT_END
};
EvtSource N(takeTurn_80226F58) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(UseBattleCamPreset, 63)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_run)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -4, 0)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(10), 0, 0, 5, 16)
EVT_SWITCH(LW(10))
EVT_CASE_OR_EQ(6)
EVT_CASE_OR_EQ(5)
EVT_WAIT_FRAMES(10)
EVT_CALL(UseBattleCamPreset, 66)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(SetActorSounds, -127, 2, 8416, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_run)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_CALL(SetActorSounds, -127, 1, 0, 0)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_SUB(LW(0), 80)
EVT_SET(LW(1), 20)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_attack)
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, 0)
EVT_IF_EQ(LW(10), 5)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
EVT_END_IF
EVT_WAIT_FRAMES(10)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(MoveBattleCamOver, 20)
EVT_CALL(ResetAllActorSounds, ACTOR_SELF)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_run)
EVT_CALL(SetActorYaw, ACTOR_SELF, 180)
EVT_CALL(AddActorDecoration, ACTOR_SELF, 1, 0, 2)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_idle)
EVT_CALL(RemoveActorDecoration, ACTOR_SELF, 1, 0)
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_RETURN
EVT_END_CASE_GROUP
EVT_CASE_DEFAULT
EVT_WAIT_FRAMES(10)
EVT_CALL(UseBattleCamPreset, 66)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(SetActorSounds, -127, 2, 8416, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_run)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_CALL(SetActorSounds, -127, 1, 0, 0)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_attack)
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, 0)
EVT_END_SWITCH
EVT_WAIT_FRAMES(2)
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(0), 0, 0, 0, 5, 32)
EVT_SET(LW(15), LW(0))
EVT_SWITCH(LW(15))
EVT_CASE_OR_EQ(0)
EVT_CASE_OR_EQ(2)
EVT_CASE_OR_EQ(10)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 10, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_run)
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, 0)
EVT_WAIT_FRAMES(10)
EVT_CALL(ResetAllActorSounds, ACTOR_SELF)
EVT_CALL(YieldTurn)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_run)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_idle)
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(nextTurn_80227724) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(GetBattlePhase, LW(15))
EVT_SWITCH(LW(15))
EVT_CASE_EQ(10)
EVT_CALL(GetActorVar, -127, 0, LW(0))
EVT_IF_EQ(LW(0), 0)
EVT_CALL(SetActorVar, -127, 0, 1)
EVT_WAIT_FRAMES(15)
EVT_CALL(UseBattleCamPreset, 14)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(SetBattleCamOffsetZ, 35)
EVT_CALL(MoveBattleCamOver, 30)
EVT_WAIT_FRAMES(30)
EVT_CALL(ActorSpeak, 917536, -127, 2, 2162714, 2162715)
EVT_WAIT_FRAMES(8)
EVT_EXEC_WAIT(N(802260AC))
EVT_CALL(SetPartFlagBits, -127, 2, 1, 1)
EVT_CALL(SetPartFlagBits, -127, 1, 1, 0)
EVT_WAIT_FRAMES(30)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 20)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), 60, LW(2))
EVT_CALL(FlyToGoal, ACTOR_SELF, 45, 0, 0)
EVT_CALL(ForceHomePos, ACTOR_SELF, LW(0), 60, LW(2))
EVT_CALL(HPBarToHome, ACTOR_SELF)
EVT_WAIT_FRAMES(8)
EVT_CALL(ActorSpeak, 917537, -127, 1, 2424844, 2424834)
EVT_WAIT_FRAMES(10)
EVT_EXEC_WAIT(N(8022646C))
EVT_END_IF
EVT_CASE_EQ(12)
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(802279B0) = {
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_IF_EQ(LW(1), 0)
EVT_GOTO(0)
EVT_END_IF
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x301)
EVT_CALL(SetActorSounds, -127, 2, 0, 0)
EVT_CALL(func_8027D32C, -127)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), 0, LW(2))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2001953125))
EVT_CALL(FallToGoal, -127, 10)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.80078125))
EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
EVT_CALL(HPBarToCurrent, ACTOR_SELF)
EVT_CALL(func_8027D2D8, -127)
EVT_LABEL(0)
EVT_THREAD
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(1), 10)
EVT_ADD(LW(2), 10)
EVT_LOOP(3)
EVT_CALL(PlayEffect, 0x1, LW(0), LW(1), LW(2), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_WAIT_FRAMES(3)
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(SetPartFlagBits, -127, 1, 1, 1)
EVT_CALL(SetPartFlagBits, -127, 2, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_jr_troopa_default_dead_still)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 5)
EVT_CALL(SetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_WAIT_FRAMES(15)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_DEATH)
EVT_CALL(DropStarPoints, -127)
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_CALL(UseBattleCamPreset, 14)
EVT_CALL(SetBattleCamZoom, 260)
EVT_CALL(SetBattleCamOffsetZ, 15)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(MoveBattleCamOver, 30)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20E5)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_jr_troopa_default_dead)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 2, EVT_ADDR(N(idleAnimations_80225E48)))
EVT_WAIT_FRAMES(60)
EVT_CALL(SetActorFlagBits, ACTOR_SELF, 4194304, 1)
EVT_RETURN
EVT_END
};
EvtSource N(80227D38) = {
EVT_CALL(ResetAllActorSounds, ACTOR_SELF)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_para_jr_troopa_default_run)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2001953125))
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(GetActorPos, ACTOR_SELF, LW(3), LW(4), LW(5))
EVT_SUB(LW(4), LW(1))
EVT_MULF(LW(4), EVT_FLOAT(0.30078125))
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, LW(4), 0)
EVT_RETURN
EVT_END
};
EvtSource N(80227E1C) = {
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x35D000)
EVT_CALL(GetActorVar, -127, 1, LW(0))
EVT_IF_EQ(LW(0), 1)
EVT_CALL(SetActorVar, -127, 1, 0)
EVT_WAIT_FRAMES(15)
EVT_EXEC_WAIT(N(802263D4))
EVT_WAIT_FRAMES(10)
EVT_CALL(ActorSpeak, 1900954, -127, 1, 2424844, 2424834)
EVT_WAIT_FRAMES(10)
EVT_EXEC_WAIT(N(8022646C))
EVT_END_IF
EVT_END_IF
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,988 @@
#include "common.h"
#include "battle/battle.h"
#include "script_api/battle.h"
#include "sprite/npc/paragoomba.h"
#include "sprite/npc/goomba.h"
#define NAMESPACE b_area_kmr_part_3_paragoomba1
s32 N(defenseTable_8021C1B0)[] = {
ELEMENT_NORMAL, 0,
ELEMENT_END,
};
s32 N(defenseTable_8021C1BC)[] = {
ELEMENT_NORMAL, 0,
ELEMENT_END,
};
s32 N(statusTable_8021C1C8)[] = {
STATUS_NORMAL, 0,
STATUS_DEFAULT, 0,
STATUS_SLEEP, 100,
STATUS_POISON, 100,
STATUS_FROZEN, 100,
STATUS_DIZZY, 100,
STATUS_FEAR, 100,
STATUS_STATIC, 100,
STATUS_PARALYZE, 100,
STATUS_SHRINK, 100,
STATUS_STOP, 100,
STATUS_DEFAULT_TURN_MOD, 0,
STATUS_SLEEP_TURN_MOD, 0,
STATUS_POISON_TURN_MOD, 0,
STATUS_FROZEN_TURN_MOD, 0,
STATUS_DIZZY_TURN_MOD, 0,
STATUS_FEAR_TURN_MOD, 0,
STATUS_STATIC_TURN_MOD, 0,
STATUS_PARALYZE_TURN_MOD, 0,
STATUS_SHRINK_TURN_MOD, 0,
STATUS_STOP_TURN_MOD, 0,
STATUS_END,
};
s32 N(statusTable_8021C274)[] = {
STATUS_NORMAL, 0,
STATUS_DEFAULT, 0,
STATUS_SLEEP, 100,
STATUS_POISON, 80,
STATUS_FROZEN, 100,
STATUS_DIZZY, 100,
STATUS_FEAR, 80,
STATUS_STATIC, 80,
STATUS_PARALYZE, 100,
STATUS_SHRINK, 100,
STATUS_STOP, 100,
STATUS_DEFAULT_TURN_MOD, 0,
STATUS_SLEEP_TURN_MOD, 0,
STATUS_POISON_TURN_MOD, 0,
STATUS_FROZEN_TURN_MOD, 0,
STATUS_DIZZY_TURN_MOD, 1,
STATUS_FEAR_TURN_MOD, 0,
STATUS_STATIC_TURN_MOD, 0,
STATUS_PARALYZE_TURN_MOD, 0,
STATUS_SHRINK_TURN_MOD, 0,
STATUS_STOP_TURN_MOD, 0,
STATUS_END,
};
extern s32 N(idleAnimations_8021DB9C)[];
extern s32 N(idleAnimations_8021C3D8)[];
extern s32 N(idleAnimations_8021C470)[];
extern s32 N(idleAnimations_8021C47C)[];
extern EvtSource N(init_8021F450);
extern EvtSource N(takeTurn_8021CDFC);
extern EvtSource N(idle_8021C4D4);
extern EvtSource N(handleEvent_8021C808);
ActorPartDesc N(partsTable)[] = {
{
.flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET,
.index = 1,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 20 },
.opacity = 255,
.idleAnimations = N(idleAnimations_8021DB9C),
.defenseTable = N(defenseTable_8021C1B0),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = 0,
.unk_1C = 246,
},
{
.flags = ACTOR_PART_FLAG_MULTI_TARGET,
.index = 2,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 24 },
.opacity = 255,
.idleAnimations = N(idleAnimations_8021C3D8),
.defenseTable = N(defenseTable_8021C1BC),
.eventFlags = ACTOR_EVENT_FLAG_GROUNDABLE,
.elementImmunityFlags = 0,
.unk_1C = 246,
},
{
.flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET,
.index = 3,
.posOffset = { 0, 0, 0 },
.targetOffset = { -16, 24 },
.opacity = 255,
.idleAnimations = N(idleAnimations_8021C470),
.defenseTable = N(defenseTable_8021C1B0),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = 0,
.unk_1C = 246,
},
{
.flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET,
.index = 4,
.posOffset = { 0, 0, 0 },
.targetOffset = { -16, 24 },
.opacity = 255,
.idleAnimations = N(idleAnimations_8021C47C),
.defenseTable = N(defenseTable_8021C1B0),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = 0,
.unk_1C = 246,
},
};
ActorDesc NAMESPACE = {
.flags = ACTOR_FLAG_FLYING,
.type = ACTOR_TYPE_PARAGOOMBA,
.level = 6,
.maxHP = 2,
.partCount = ARRAY_COUNT(N(partsTable)),
.partsData = N(partsTable),
.script = N(init_8021F450),
.statusTable = N(statusTable_8021C274),
.escapeChance = 90,
.airLiftChance = 100,
.spookChance = 100,
.baseStatusChance = 100,
.upAndAwayChance = 95,
.spinSmashReq = 0,
.powerBounceChance = 100,
.coinReward = 1,
.size = { 36, 26 },
.hpBarOffset = { 0, 0 },
.statusIconOffset = { -10, 20 },
.statusMessageOffset = { 10, 20 },
};
s32 N(idleAnimations_8021C3D8)[] = {
STATUS_NORMAL, NPC_ANIM_paragoomba_default_idle,
STATUS_STONE, NPC_ANIM_paragoomba_default_still,
STATUS_SLEEP, NPC_ANIM_paragoomba_default_sleep,
STATUS_POISON, NPC_ANIM_paragoomba_default_idle,
STATUS_STOP, NPC_ANIM_paragoomba_default_still,
STATUS_STATIC, NPC_ANIM_paragoomba_default_idle,
STATUS_PARALYZE, NPC_ANIM_paragoomba_default_still,
STATUS_DIZZY, NPC_ANIM_paragoomba_default_dizzy,
STATUS_FEAR, NPC_ANIM_paragoomba_default_dizzy,
STATUS_END,
};
s32 N(idleAnimations_8021C424)[] = {
STATUS_NORMAL, NPC_ANIM_paragoomba_default_run,
STATUS_STONE, NPC_ANIM_paragoomba_default_still,
STATUS_SLEEP, NPC_ANIM_paragoomba_default_sleep,
STATUS_POISON, NPC_ANIM_paragoomba_default_idle,
STATUS_STOP, NPC_ANIM_paragoomba_default_still,
STATUS_STATIC, NPC_ANIM_paragoomba_default_run,
STATUS_PARALYZE, NPC_ANIM_paragoomba_default_still,
STATUS_DIZZY, NPC_ANIM_paragoomba_default_dizzy,
STATUS_FEAR, NPC_ANIM_paragoomba_default_dizzy,
STATUS_END,
};
s32 N(idleAnimations_8021C470)[] = {
STATUS_NORMAL, NPC_ANIM_paragoomba_default_left_wing_only,
STATUS_END,
};
s32 N(idleAnimations_8021C47C)[] = {
STATUS_NORMAL, NPC_ANIM_paragoomba_default_right_wing_only,
STATUS_END,
};
EvtSource N(8021C488) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_8021CDFC)))
EVT_CALL(BindIdle, ACTOR_SELF, EVT_ADDR(N(idle_8021C4D4)))
EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_ADDR(N(handleEvent_8021C808)))
EVT_RETURN
EVT_END
};
EvtSource N(idle_8021C4D4) = {
EVT_LABEL(10)
EVT_CALL(RandInt, 80, LW(0))
EVT_ADD(LW(0), 80)
EVT_LOOP(LW(0))
EVT_LABEL(0)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(0)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6005859375))
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 2, EVT_ADDR(N(idleAnimations_8021C424)))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, 0)
EVT_LOOP(20)
EVT_LABEL(1)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(1)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6005859375))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, 0)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 2, EVT_ADDR(N(idleAnimations_8021C3D8)))
EVT_LOOP(40)
EVT_LABEL(2)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(2)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_GOTO(10)
EVT_RETURN
EVT_END
};
EvtSource N(8021C790) = {
EVT_CALL(ResetAllActorSounds, ACTOR_SELF)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0))
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, 11)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_idle)
EVT_RETURN
EVT_END
};
extern EvtSource N(8021D614);
EvtSource N(handleEvent_8021C808) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(9)
EVT_CASE_OR_EQ(10)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_pain)
EVT_EXEC_WAIT(DoNormalHit)
EVT_CALL(GetBattlePhase, LW(0))
EVT_IF_EQ(LW(0), 1)
EVT_CALL(GetEncounterState, LW(0))
EVT_IF_EQ(LW(0), 4)
EVT_EXEC_WAIT(N(8021D614))
EVT_END_IF
EVT_END_IF
EVT_END_CASE_GROUP
EVT_CASE_EQ(14)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_burn_pain)
EVT_SET_CONST(LW(2), NPC_ANIM_paragoomba_default_burn_dead)
EVT_EXEC_WAIT(DoBurnHit)
EVT_CASE_EQ(36)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_burn_pain)
EVT_SET_CONST(LW(2), NPC_ANIM_paragoomba_default_burn_dead)
EVT_EXEC_WAIT(DoBurnHit)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_burn_dead)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(12)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_pain)
EVT_EXEC_WAIT(DoNormalHit)
EVT_EXEC_WAIT(N(8021D614))
EVT_CASE_EQ(15)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_burn_pain)
EVT_SET_CONST(LW(2), NPC_ANIM_paragoomba_default_burn_dead)
EVT_EXEC_WAIT(DoBurnHit)
EVT_EXEC_WAIT(N(8021D614))
EVT_CASE_EQ(47)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_electrocute)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_pain)
EVT_EXEC_WAIT(DoJumpBack)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_dizzy)
EVT_EXEC_WAIT(N(8021C790))
EVT_CASE_EQ(38)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_electrocute)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_dead)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(19)
EVT_CASE_OR_EQ(23)
EVT_CASE_OR_EQ(25)
EVT_CASE_OR_EQ(31)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_idle)
EVT_EXEC_WAIT(DoImmune)
EVT_END_CASE_GROUP
EVT_CASE_EQ(32)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_pain)
EVT_EXEC_WAIT(DoNormalHit)
EVT_WAIT_FRAMES(10)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_dead)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(56)
EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0)
EVT_CALL(HPBarToCurrent, ACTOR_SELF)
EVT_CASE_EQ(53)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_run)
EVT_EXEC_WAIT(N(8021C790))
EVT_CALL(HPBarToHome, ACTOR_SELF)
EVT_CASE_EQ(49)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_idle)
EVT_EXEC_WAIT(DoRecover)
EVT_CASE_EQ(57)
EVT_CALL(SetActorFlagBits, ACTOR_SELF, 512, 0)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_run)
EVT_SET_CONST(LW(2), NPC_ANIM_paragoomba_default_pain)
EVT_EXEC_WAIT(DoScareAway)
EVT_RETURN
EVT_CASE_EQ(58)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_run)
EVT_EXEC_WAIT(DoAirLift)
EVT_CASE_EQ(22)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_pain)
EVT_EXEC_WAIT(DoBlowAway)
EVT_RETURN
EVT_CASE_DEFAULT
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, -1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(takeTurn_8021CDFC) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(UseBattleCamPreset, 63)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_run)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -4, 0)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), ((0)), 0, 1, 16)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(6)
EVT_CASE_OR_EQ(5)
EVT_SET(LW(10), LW(0))
EVT_WAIT_FRAMES(10)
EVT_CALL(UseBattleCamPreset, 66)
EVT_CALL(SetBattleCamZoom, 300)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20E0)
EVT_CALL(SetActorSounds, -127, 2, 0, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_attack)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1)
EVT_CALL(SetActorSounds, -127, 1, 0, 0)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_SUB(LW(0), 80)
EVT_SET(LW(1), 20)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_attack)
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, 4)
EVT_THREAD
EVT_LOOP(4)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20DF)
EVT_WAIT_FRAMES(4)
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_aim)
EVT_CALL(AddActorDecoration, ACTOR_SELF, 2, 0, 2)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 2, EVT_FLOAT(3.0))
EVT_WAIT_FRAMES(10)
EVT_IF_EQ(LW(10), 5)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), 0x80000000, 0, 0, 0)
EVT_END_IF
EVT_WAIT_FRAMES(10)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 2, EVT_FLOAT(1.0))
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(ResetAllActorSounds, ACTOR_SELF)
EVT_CALL(YieldTurn)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_run)
EVT_CALL(SetActorYaw, ACTOR_SELF, 180)
EVT_EXEC_WAIT(N(8021C790))
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_CALL(RemoveActorDecoration, ACTOR_SELF, 2, 0)
EVT_CALL(EnableIdleScript, ACTOR_SELF, -1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END_CASE_GROUP
EVT_CASE_DEFAULT
EVT_WAIT_FRAMES(10)
EVT_CALL(UseBattleCamPreset, 66)
EVT_CALL(SetBattleCamZoom, 300)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20E0)
EVT_CALL(SetActorSounds, -127, 2, 0, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_attack)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1)
EVT_CALL(SetActorSounds, -127, 1, 0, 0)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_attack)
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, 0)
EVT_END_SWITCH
EVT_WAIT_FRAMES(2)
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(0), ((0)), 0, 0, 1, 32)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(0)
EVT_CASE_OR_EQ(2)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 10, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_run)
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, 0)
EVT_CALL(ResetAllActorSounds, ACTOR_SELF)
EVT_WAIT_FRAMES(5)
EVT_CALL(YieldTurn)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_run)
EVT_EXEC_WAIT(N(8021C790))
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, -1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
#include "common/StartRumbleWithParams.inc.c"
extern EvtSource N(8021DC34);
EvtSource N(8021D614) = {
EVT_CALL(func_8027D32C, -127)
EVT_CALL(SetPartFlags, ACTOR_SELF, 2, 131077)
EVT_CALL(SetPartFlags, ACTOR_SELF, 3, 1179652)
EVT_CALL(SetPartFlags, ACTOR_SELF, 4, 1179652)
EVT_CALL(SetPartFlags, ACTOR_SELF, 1, 8388612)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetPartPos, ACTOR_SELF, 3, LW(0), LW(1), LW(2))
EVT_CALL(SetPartDispOffset, ACTOR_SELF, 3, -9, 7, -2)
EVT_CALL(SetPartPos, ACTOR_SELF, 4, LW(0), LW(1), LW(2))
EVT_CALL(SetPartDispOffset, ACTOR_SELF, 4, 11, 7, -2)
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(0))
EVT_IF_EQ(LW(0), 15)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_burn_dead)
EVT_ELSE
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_pain)
EVT_END_IF
EVT_CALL(SetActorSounds, -127, 2, 769, 0)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SET(LW(1), 0)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.80078125))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE)
EVT_CALL(N(StartRumbleWithParams), 100, 10)
EVT_THREAD
EVT_CALL(ShakeCam, 1, 0, 5, EVT_FLOAT(0.30078125))
EVT_END_THREAD
EVT_CALL(ResetActorSounds, -127, 2)
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(3))
EVT_IF_EQ(LW(3), 15)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_pain)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(3), LW(4), LW(5))
EVT_ADD(LW(4), 10)
EVT_ADD(LW(5), 5)
EVT_CALL(PlayEffect, 0x27, 0, LW(3), LW(4), LW(5), EVT_FLOAT(1.0), 10, 0, 0, 0, 0, 0, 0, 0)
EVT_END_IF
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_LOOP(10)
EVT_CALL(SetPartFlagBits, -127, 3, 1, 1)
EVT_CALL(SetPartFlagBits, -127, 4, 1, 1)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetPartFlagBits, -127, 3, 1, 0)
EVT_CALL(SetPartFlagBits, -127, 4, 1, 0)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetPartFlagBits, -127, 3, 1, 1)
EVT_CALL(SetPartFlagBits, -127, 4, 1, 1)
EVT_CALL(GetIndexFromHome, -127, LW(0))
EVT_MOD(LW(0), 4)
EVT_CALL(SetGoalToIndex, -127, LW(0))
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetHomePos, -127, LW(0), LW(1), LW(2))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_idle)
EVT_CALL(SetActorFlagBits, ACTOR_SELF, 512, 0)
EVT_CALL(SetStatusTable, -127, EVT_ADDR(N(statusTable_8021C1C8)))
EVT_CALL(SetActorType, -127, 7)
EVT_EXEC_WAIT(N(8021DC34))
EVT_CALL(SetActorFlagBits, ACTOR_SELF, 4096, 1)
EVT_CALL(HPBarToHome, ACTOR_SELF)
EVT_CALL(ResetAllActorSounds, ACTOR_SELF)
EVT_RETURN
EVT_END
};
s32 N(idleAnimations_8021DB9C)[] = {
STATUS_NORMAL, NPC_ANIM_goomba_normal_idle,
STATUS_STONE, NPC_ANIM_goomba_normal_still,
STATUS_SLEEP, NPC_ANIM_goomba_normal_asleep,
STATUS_POISON, NPC_ANIM_goomba_normal_idle,
STATUS_STOP, NPC_ANIM_goomba_normal_still,
STATUS_STATIC, NPC_ANIM_goomba_normal_idle,
STATUS_PARALYZE, NPC_ANIM_goomba_normal_still,
STATUS_DIZZY, NPC_ANIM_goomba_normal_dizzy,
STATUS_FEAR, NPC_ANIM_goomba_normal_dizzy,
STATUS_END,
};
s32 N(idleAnimations_8021DBE8)[] = {
STATUS_NORMAL, NPC_ANIM_goomba_normal_run,
STATUS_STONE, NPC_ANIM_goomba_normal_still,
STATUS_SLEEP, NPC_ANIM_goomba_normal_asleep,
STATUS_POISON, NPC_ANIM_goomba_normal_idle,
STATUS_STOP, NPC_ANIM_goomba_normal_still,
STATUS_STATIC, NPC_ANIM_goomba_normal_run,
STATUS_PARALYZE, NPC_ANIM_goomba_normal_still,
STATUS_DIZZY, NPC_ANIM_goomba_normal_dizzy,
STATUS_FEAR, NPC_ANIM_goomba_normal_dizzy,
STATUS_END,
};
extern EvtSource N(takeTurn_8021E788);
extern EvtSource N(idle);
extern EvtSource N(handleEvent_8021DF5C);
EvtSource N(8021DC34) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_8021E788)))
EVT_CALL(BindIdle, ACTOR_SELF, EVT_ADDR(N(idle)))
EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_ADDR(N(handleEvent_8021DF5C)))
EVT_RETURN
EVT_END
};
EvtSource N(idle) = {
EVT_LABEL(10)
EVT_CALL(RandInt, 80, LW(0))
EVT_ADD(LW(0), 80)
EVT_LOOP(LW(0))
EVT_LABEL(0)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(0)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0))
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021DBE8)))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleRunToGoal, -127, 0)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021DB9C)))
EVT_LOOP(20)
EVT_LABEL(1)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(1)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0))
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021DBE8)))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleRunToGoal, -127, 0)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021DB9C)))
EVT_LOOP(80)
EVT_LABEL(2)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(2)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_GOTO(10)
EVT_RETURN
EVT_END
};
EvtSource N(handleEvent_8021DF5C) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(9)
EVT_CASE_OR_EQ(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_pain)
EVT_EXEC_WAIT(DoNormalHit)
EVT_END_CASE_GROUP
EVT_CASE_EQ(14)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_burn_pain)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_normal_burn_dead)
EVT_EXEC_WAIT(DoBurnHit)
EVT_CASE_EQ(36)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_burn_pain)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_normal_burn_dead)
EVT_EXEC_WAIT(DoBurnHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_burn_dead)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(11)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_pain)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_CASE_EQ(33)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_pain)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_dead)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(47)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_electrocute)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_pain)
EVT_EXEC_WAIT(DoJumpBack)
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_dizzy)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(5)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_idle)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6005859375))
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CASE_EQ(38)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_electrocute)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_dead)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(19)
EVT_CASE_OR_EQ(23)
EVT_CASE_OR_EQ(25)
EVT_CASE_OR_EQ(31)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_idle)
EVT_EXEC_WAIT(DoImmune)
EVT_END_CASE_GROUP
EVT_CASE_EQ(32)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_pain)
EVT_EXEC_WAIT(DoNormalHit)
EVT_WAIT_FRAMES(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_dead)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(53)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_run)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_CALL(HPBarToHome, ACTOR_SELF)
EVT_CASE_EQ(49)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_idle)
EVT_EXEC_WAIT(DoRecover)
EVT_CASE_EQ(57)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_run)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_normal_pain)
EVT_EXEC_WAIT(DoScareAway)
EVT_RETURN
EVT_CASE_EQ(58)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_run)
EVT_EXEC_WAIT(DoAirLift)
EVT_CASE_EQ(22)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_pain)
EVT_EXEC_WAIT(DoBlowAway)
EVT_RETURN
EVT_CASE_DEFAULT
EVT_END_SWITCH
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_idle)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
#include "common/anglestuff.inc.c"
EvtSource N(takeTurn_8021E788) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(UseBattleCamPreset, 63)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_run)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_idle)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_headbonk)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), ((0)), 0, 1, 16)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(6)
EVT_CASE_OR_EQ(5)
EVT_SET(LW(10), LW(0))
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 10)
EVT_SET(LW(1), 10)
EVT_ADD(LW(2), 3)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2001953125))
EVT_THREAD
EVT_CALL(GetActorPos, ACTOR_SELF, LW(1), LW(2), LW(0))
EVT_SET(LW(0), 0)
EVT_LOOP(16)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(4), LW(5), LW(6))
EVT_CALL(N(AngleCalculate), LW(1), LW(2), LW(4), LW(5), LW(0))
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_SET(LW(1), LW(4))
EVT_SET(LW(2), LW(5))
EVT_SET(LW(3), LW(6))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(6)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_headbonk)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_asleep)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 5, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.30078125), EVT_FLOAT(0.5), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 7, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_pain)
EVT_WAIT_FRAMES(5)
EVT_IF_EQ(LW(10), 5)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), 0x80000000, 0, 0, 0)
EVT_END_IF
EVT_WAIT_FRAMES(5)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_headbonk)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 20)
EVT_SET(LW(1), 0)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0))
EVT_THREAD
EVT_WAIT_FRAMES(4)
EVT_SET(LW(0), 180)
EVT_LOOP(4)
EVT_SUB(LW(0), 45)
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_headbonk)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_dizzy)
EVT_WAIT_FRAMES(5)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(YieldTurn)
EVT_CALL(SetActorYaw, ACTOR_SELF, 180)
EVT_CALL(AddActorDecoration, ACTOR_SELF, 1, 0, 2)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_idle)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6005859375))
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CALL(RemoveActorDecoration, ACTOR_SELF, 1, 0)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END_CASE_GROUP
EVT_CASE_DEFAULT
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2001953125))
EVT_THREAD
EVT_CALL(GetActorPos, ACTOR_SELF, LW(1), LW(2), LW(0))
EVT_SET(LW(0), 0)
EVT_LOOP(16)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(4), LW(5), LW(6))
EVT_CALL(N(AngleCalculate), LW(1), LW(2), LW(4), LW(5), LW(0))
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_SET(LW(1), LW(4))
EVT_SET(LW(2), LW(5))
EVT_SET(LW(3), LW(6))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(6)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_headbonk)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_pre_headbonk)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.30078125), EVT_FLOAT(0.5), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_END_SWITCH
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(0), ((0)), 0, 0, 1, 32)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(0)
EVT_CASE_OR_EQ(2)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_idle)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 40)
EVT_SET(LW(1), 0)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 30)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 20)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_idle)
EVT_WAIT_FRAMES(3)
EVT_CALL(YieldTurn)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_run)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
extern EvtSource N(nextTurn_8021F690);
EvtSource N(init_8021F450) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_8021CDFC)))
EVT_CALL(BindIdle, ACTOR_SELF, EVT_ADDR(N(idle_8021C4D4)))
EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_ADDR(N(handleEvent_8021C808)))
EVT_CALL(BindNextTurn, -127, EVT_ADDR(N(nextTurn_8021F690)))
EVT_RETURN
EVT_END
};
EvtSource N(8021F4B0) = {
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 30)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 60)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 90)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 120)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 150)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 180)
EVT_WAIT_FRAMES(5)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(MoveBattleCamOver, 10)
EVT_CALL(ActorSpeak, 721080, 256, 0, 10289160, 10289153)
EVT_SET(GSWF(1819), 1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 150)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 120)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 90)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 60)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 30)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 0)
EVT_WAIT_FRAMES(5)
EVT_RETURN
EVT_END
};
EvtSource N(nextTurn_8021F690) = {
EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_PARTNER, 0)
EVT_CALL(GetBattlePhase, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_EQ(10)
EVT_IF_EQ(GSWF(1819), 0)
EVT_EXEC_WAIT(N(8021F4B0))
EVT_END_IF
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_PARTNER, 1)
EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,928 @@
#include "common.h"
#include "battle/battle.h"
#include "script_api/battle.h"
#include "sprite/npc/paragoomba.h"
#include "sprite/npc/goomba.h"
#define NAMESPACE b_area_kmr_part_3_paragoomba2
s32 N(defenseTable_8021F750)[] = {
ELEMENT_NORMAL, 0,
ELEMENT_END,
};
s32 N(defenseTable_8021F75C)[] = {
ELEMENT_NORMAL, 0,
ELEMENT_END,
};
s32 N(statusTable_8021F768)[] = {
STATUS_NORMAL, 0,
STATUS_DEFAULT, 0,
STATUS_SLEEP, 100,
STATUS_POISON, 100,
STATUS_FROZEN, 100,
STATUS_DIZZY, 100,
STATUS_FEAR, 100,
STATUS_STATIC, 100,
STATUS_PARALYZE, 100,
STATUS_SHRINK, 100,
STATUS_STOP, 100,
STATUS_DEFAULT_TURN_MOD, 0,
STATUS_SLEEP_TURN_MOD, 0,
STATUS_POISON_TURN_MOD, 0,
STATUS_FROZEN_TURN_MOD, 0,
STATUS_DIZZY_TURN_MOD, 0,
STATUS_FEAR_TURN_MOD, 0,
STATUS_STATIC_TURN_MOD, 0,
STATUS_PARALYZE_TURN_MOD, 0,
STATUS_SHRINK_TURN_MOD, 0,
STATUS_STOP_TURN_MOD, 0,
STATUS_END,
};
s32 N(statusTable_8021F814)[] = {
STATUS_NORMAL, 0,
STATUS_DEFAULT, 0,
STATUS_SLEEP, 100,
STATUS_POISON, 80,
STATUS_FROZEN, 100,
STATUS_DIZZY, 100,
STATUS_FEAR, 80,
STATUS_STATIC, 80,
STATUS_PARALYZE, 100,
STATUS_SHRINK, 100,
STATUS_STOP, 100,
STATUS_DEFAULT_TURN_MOD, 0,
STATUS_SLEEP_TURN_MOD, 0,
STATUS_POISON_TURN_MOD, 0,
STATUS_FROZEN_TURN_MOD, 0,
STATUS_DIZZY_TURN_MOD, 1,
STATUS_FEAR_TURN_MOD, 0,
STATUS_STATIC_TURN_MOD, 0,
STATUS_PARALYZE_TURN_MOD, 0,
STATUS_SHRINK_TURN_MOD, 0,
STATUS_STOP_TURN_MOD, 0,
STATUS_END,
};
extern s32 N(idleAnimations_8022113C)[];
extern s32 N(idleAnimations_8021F978)[];
extern s32 N(idleAnimations_8021FA10)[];
extern s32 N(idleAnimations_8021FA1C)[];
extern EvtSource N(init_8021FA28);
extern EvtSource N(takeTurn_8022039C);
extern EvtSource N(idle_8021FA74);
extern EvtSource N(handleEvent_8021FDA8);
ActorPartDesc N(partsTable_8021F8C0)[] = {
{
.flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET,
.index = 1,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 20 },
.opacity = 255,
.idleAnimations = N(idleAnimations_8022113C),
.defenseTable = N(defenseTable_8021F750),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = 0,
.unk_1C = 246,
},
{
.flags = ACTOR_PART_FLAG_MULTI_TARGET,
.index = 2,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 24 },
.opacity = 255,
.idleAnimations = N(idleAnimations_8021F978),
.defenseTable = N(defenseTable_8021F75C),
.eventFlags = ACTOR_EVENT_FLAG_GROUNDABLE,
.elementImmunityFlags = 0,
.unk_1C = 246,
},
{
.flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET,
.index = 3,
.posOffset = { 0, 0, 0 },
.targetOffset = { -16, 24 },
.opacity = 255,
.idleAnimations = N(idleAnimations_8021FA10),
.defenseTable = N(defenseTable_8021F750),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = 0,
.unk_1C = 246,
},
{
.flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET,
.index = 4,
.posOffset = { 0, 0, 0 },
.targetOffset = { -16, 24 },
.opacity = 255,
.idleAnimations = N(idleAnimations_8021FA1C),
.defenseTable = N(defenseTable_8021F750),
.eventFlags = ACTOR_EVENT_FLAG_0,
.elementImmunityFlags = 0,
.unk_1C = 246,
},
};
ActorDesc NAMESPACE = {
.flags = ACTOR_FLAG_FLYING,
.type = ACTOR_TYPE_PARAGOOMBA,
.level = 6,
.maxHP = 2,
.partCount = ARRAY_COUNT(N(partsTable_8021F8C0)),
.partsData = N(partsTable_8021F8C0),
.script = N(init_8021FA28),
.statusTable = N(statusTable_8021F814),
.escapeChance = 90,
.airLiftChance = 100,
.spookChance = 100,
.baseStatusChance = 100,
.upAndAwayChance = 95,
.spinSmashReq = 0,
.powerBounceChance = 100,
.coinReward = 1,
.size = { 36, 26 },
.hpBarOffset = { 0, 0 },
.statusIconOffset = { -10, 20 },
.statusMessageOffset = { 10, 20 },
};
s32 N(idleAnimations_8021F978)[] = {
STATUS_NORMAL, NPC_ANIM_paragoomba_default_idle,
STATUS_STONE, NPC_ANIM_paragoomba_default_still,
STATUS_SLEEP, NPC_ANIM_paragoomba_default_sleep,
STATUS_POISON, NPC_ANIM_paragoomba_default_idle,
STATUS_STOP, NPC_ANIM_paragoomba_default_still,
STATUS_STATIC, NPC_ANIM_paragoomba_default_idle,
STATUS_PARALYZE, NPC_ANIM_paragoomba_default_still,
STATUS_DIZZY, NPC_ANIM_paragoomba_default_dizzy,
STATUS_FEAR, NPC_ANIM_paragoomba_default_dizzy,
STATUS_END,
};
s32 N(idleAnimations_8021F9C4)[] = {
STATUS_NORMAL, NPC_ANIM_paragoomba_default_run,
STATUS_STONE, NPC_ANIM_paragoomba_default_still,
STATUS_SLEEP, NPC_ANIM_paragoomba_default_sleep,
STATUS_POISON, NPC_ANIM_paragoomba_default_idle,
STATUS_STOP, NPC_ANIM_paragoomba_default_still,
STATUS_STATIC, NPC_ANIM_paragoomba_default_run,
STATUS_PARALYZE, NPC_ANIM_paragoomba_default_still,
STATUS_DIZZY, NPC_ANIM_paragoomba_default_dizzy,
STATUS_FEAR, NPC_ANIM_paragoomba_default_dizzy,
STATUS_END,
};
s32 N(idleAnimations_8021FA10)[] = {
STATUS_NORMAL, NPC_ANIM_paragoomba_default_left_wing_only,
STATUS_END,
};
s32 N(idleAnimations_8021FA1C)[] = {
STATUS_NORMAL, NPC_ANIM_paragoomba_default_right_wing_only,
STATUS_END,
};
EvtSource N(init_8021FA28) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_8022039C)))
EVT_CALL(BindIdle, ACTOR_SELF, EVT_ADDR(N(idle_8021FA74)))
EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_ADDR(N(handleEvent_8021FDA8)))
EVT_RETURN
EVT_END
};
EvtSource N(idle_8021FA74) = {
EVT_LABEL(10)
EVT_CALL(RandInt, 80, LW(0))
EVT_ADD(LW(0), 80)
EVT_LOOP(LW(0))
EVT_LABEL(0)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(0)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6005859375))
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 2, EVT_ADDR(N(idleAnimations_8021F9C4)))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, 0)
EVT_LOOP(20)
EVT_LABEL(1)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(1)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(0.6005859375))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleFlyToGoal, ACTOR_SELF, 0, -5, 0)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 2, EVT_ADDR(N(idleAnimations_8021F978)))
EVT_LOOP(40)
EVT_LABEL(2)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(2)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_GOTO(10)
EVT_RETURN
EVT_END
};
EvtSource N(8021FD30) = {
EVT_CALL(ResetAllActorSounds, ACTOR_SELF)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(7.0))
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, 11)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_idle)
EVT_RETURN
EVT_END
};
extern EvtSource N(80220BB4);
EvtSource N(handleEvent_8021FDA8) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(9)
EVT_CASE_OR_EQ(10)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_pain)
EVT_EXEC_WAIT(DoNormalHit)
EVT_CALL(GetBattlePhase, LW(0))
EVT_IF_EQ(LW(0), 1)
EVT_CALL(GetEncounterState, LW(0))
EVT_IF_EQ(LW(0), 4)
EVT_EXEC_WAIT(N(80220BB4))
EVT_END_IF
EVT_END_IF
EVT_END_CASE_GROUP
EVT_CASE_EQ(14)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_burn_pain)
EVT_SET_CONST(LW(2), NPC_ANIM_paragoomba_default_burn_dead)
EVT_EXEC_WAIT(DoBurnHit)
EVT_CASE_EQ(36)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_burn_pain)
EVT_SET_CONST(LW(2), NPC_ANIM_paragoomba_default_burn_dead)
EVT_EXEC_WAIT(DoBurnHit)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_burn_dead)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(12)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_pain)
EVT_EXEC_WAIT(DoNormalHit)
EVT_EXEC_WAIT(N(80220BB4))
EVT_CASE_EQ(15)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_burn_pain)
EVT_SET_CONST(LW(2), NPC_ANIM_paragoomba_default_burn_dead)
EVT_EXEC_WAIT(DoBurnHit)
EVT_EXEC_WAIT(N(80220BB4))
EVT_CASE_EQ(47)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_electrocute)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_pain)
EVT_EXEC_WAIT(DoJumpBack)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_dizzy)
EVT_EXEC_WAIT(N(8021FD30))
EVT_CASE_EQ(38)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_electrocute)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_dead)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(19)
EVT_CASE_OR_EQ(23)
EVT_CASE_OR_EQ(25)
EVT_CASE_OR_EQ(31)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_idle)
EVT_EXEC_WAIT(DoImmune)
EVT_END_CASE_GROUP
EVT_CASE_EQ(32)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_pain)
EVT_EXEC_WAIT(DoNormalHit)
EVT_WAIT_FRAMES(10)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_dead)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(56)
EVT_CALL(SetActorPos, ACTOR_SELF, 20, 0, 0)
EVT_CALL(HPBarToCurrent, ACTOR_SELF)
EVT_CASE_EQ(53)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_run)
EVT_EXEC_WAIT(N(8021FD30))
EVT_CALL(HPBarToHome, ACTOR_SELF)
EVT_CASE_EQ(49)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_idle)
EVT_EXEC_WAIT(DoRecover)
EVT_CASE_EQ(57)
EVT_CALL(SetActorFlagBits, ACTOR_SELF, 512, 0)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_run)
EVT_SET_CONST(LW(2), NPC_ANIM_paragoomba_default_pain)
EVT_EXEC_WAIT(DoScareAway)
EVT_RETURN
EVT_CASE_EQ(58)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_run)
EVT_EXEC_WAIT(DoAirLift)
EVT_CASE_EQ(22)
EVT_SET_CONST(LW(0), 0x00000002)
EVT_SET_CONST(LW(1), NPC_ANIM_paragoomba_default_pain)
EVT_EXEC_WAIT(DoBlowAway)
EVT_RETURN
EVT_CASE_DEFAULT
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, -1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(takeTurn_8022039C) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(UseBattleCamPreset, 63)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_run)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -4, 0)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), ((0)), 0, 1, 16)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(6)
EVT_CASE_OR_EQ(5)
EVT_SET(LW(10), LW(0))
EVT_WAIT_FRAMES(10)
EVT_CALL(UseBattleCamPreset, 66)
EVT_CALL(SetBattleCamZoom, 300)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20E0)
EVT_CALL(SetActorSounds, -127, 2, 0, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_attack)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1)
EVT_CALL(SetActorSounds, -127, 1, 0, 0)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_SUB(LW(0), 80)
EVT_SET(LW(1), 20)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_attack)
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, 4)
EVT_THREAD
EVT_LOOP(4)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20DF)
EVT_WAIT_FRAMES(4)
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_aim)
EVT_CALL(AddActorDecoration, ACTOR_SELF, 2, 0, 2)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 2, EVT_FLOAT(3.0))
EVT_WAIT_FRAMES(10)
EVT_IF_EQ(LW(10), 5)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), 0x80000000, 0, 0, 0)
EVT_END_IF
EVT_WAIT_FRAMES(10)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 2, EVT_FLOAT(1.0))
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(ResetAllActorSounds, ACTOR_SELF)
EVT_CALL(YieldTurn)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_run)
EVT_CALL(SetActorYaw, ACTOR_SELF, 180)
EVT_EXEC_WAIT(N(8021FD30))
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_CALL(RemoveActorDecoration, ACTOR_SELF, 2, 0)
EVT_CALL(EnableIdleScript, ACTOR_SELF, -1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END_CASE_GROUP
EVT_CASE_DEFAULT
EVT_WAIT_FRAMES(10)
EVT_CALL(UseBattleCamPreset, 66)
EVT_CALL(SetBattleCamZoom, 300)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20E0)
EVT_CALL(SetActorSounds, -127, 2, 0, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_attack)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1)
EVT_CALL(SetActorSounds, -127, 1, 0, 0)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_attack)
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, 0)
EVT_END_SWITCH
EVT_WAIT_FRAMES(2)
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(0), ((0)), 0, 0, 1, 32)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(0)
EVT_CASE_OR_EQ(2)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 10, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_run)
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, 0)
EVT_CALL(ResetAllActorSounds, ACTOR_SELF)
EVT_WAIT_FRAMES(5)
EVT_CALL(YieldTurn)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_paragoomba_default_run)
EVT_EXEC_WAIT(N(8021FD30))
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, -1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
#include "common/StartRumbleWithParams.inc.c"
extern EvtSource N(802211D4);
EvtSource N(80220BB4) = {
EVT_CALL(func_8027D32C, -127)
EVT_CALL(SetPartFlags, ACTOR_SELF, 2, 131077)
EVT_CALL(SetPartFlags, ACTOR_SELF, 3, 1179652)
EVT_CALL(SetPartFlags, ACTOR_SELF, 4, 1179652)
EVT_CALL(SetPartFlags, ACTOR_SELF, 1, 8388612)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetPartPos, ACTOR_SELF, 3, LW(0), LW(1), LW(2))
EVT_CALL(SetPartDispOffset, ACTOR_SELF, 3, -9, 7, -2)
EVT_CALL(SetPartPos, ACTOR_SELF, 4, LW(0), LW(1), LW(2))
EVT_CALL(SetPartDispOffset, ACTOR_SELF, 4, 11, 7, -2)
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(0))
EVT_IF_EQ(LW(0), 15)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_burn_dead)
EVT_ELSE
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_pain)
EVT_END_IF
EVT_CALL(SetActorSounds, -127, 2, 769, 0)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SET(LW(1), 0)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.80078125))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE)
EVT_CALL(N(StartRumbleWithParams), 100, 10)
EVT_THREAD
EVT_CALL(ShakeCam, 1, 0, 5, EVT_FLOAT(0.30078125))
EVT_END_THREAD
EVT_CALL(ResetActorSounds, -127, 2)
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(3))
EVT_IF_EQ(LW(3), 15)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_pain)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(3), LW(4), LW(5))
EVT_ADD(LW(4), 10)
EVT_ADD(LW(5), 5)
EVT_CALL(PlayEffect, 0x27, 0, LW(3), LW(4), LW(5), EVT_FLOAT(1.0), 10, 0, 0, 0, 0, 0, 0, 0)
EVT_END_IF
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_LOOP(10)
EVT_CALL(SetPartFlagBits, -127, 3, 1, 1)
EVT_CALL(SetPartFlagBits, -127, 4, 1, 1)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetPartFlagBits, -127, 3, 1, 0)
EVT_CALL(SetPartFlagBits, -127, 4, 1, 0)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetPartFlagBits, -127, 3, 1, 1)
EVT_CALL(SetPartFlagBits, -127, 4, 1, 1)
EVT_CALL(GetIndexFromHome, -127, LW(0))
EVT_MOD(LW(0), 4)
EVT_CALL(SetGoalToIndex, -127, LW(0))
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetHomePos, -127, LW(0), LW(1), LW(2))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_idle)
EVT_CALL(SetActorFlagBits, ACTOR_SELF, 512, 0)
EVT_CALL(SetStatusTable, -127, EVT_ADDR(N(statusTable_8021F768)))
EVT_CALL(SetActorType, -127, 7)
EVT_EXEC_WAIT(N(802211D4))
EVT_CALL(SetActorFlagBits, ACTOR_SELF, 4096, 1)
EVT_CALL(HPBarToHome, ACTOR_SELF)
EVT_CALL(ResetAllActorSounds, ACTOR_SELF)
EVT_RETURN
EVT_END
};
s32 N(idleAnimations_8022113C)[] = {
STATUS_NORMAL, NPC_ANIM_goomba_normal_idle,
STATUS_STONE, NPC_ANIM_goomba_normal_still,
STATUS_SLEEP, NPC_ANIM_goomba_normal_asleep,
STATUS_POISON, NPC_ANIM_goomba_normal_idle,
STATUS_STOP, NPC_ANIM_goomba_normal_still,
STATUS_STATIC, NPC_ANIM_goomba_normal_idle,
STATUS_PARALYZE, NPC_ANIM_goomba_normal_still,
STATUS_DIZZY, NPC_ANIM_goomba_normal_dizzy,
STATUS_FEAR, NPC_ANIM_goomba_normal_dizzy,
STATUS_END,
};
s32 N(idleAnimations_80221188)[] = {
STATUS_NORMAL, NPC_ANIM_goomba_normal_run,
STATUS_STONE, NPC_ANIM_goomba_normal_still,
STATUS_SLEEP, NPC_ANIM_goomba_normal_asleep,
STATUS_POISON, NPC_ANIM_goomba_normal_idle,
STATUS_STOP, NPC_ANIM_goomba_normal_still,
STATUS_STATIC, NPC_ANIM_goomba_normal_run,
STATUS_PARALYZE, NPC_ANIM_goomba_normal_still,
STATUS_DIZZY, NPC_ANIM_goomba_normal_dizzy,
STATUS_FEAR, NPC_ANIM_goomba_normal_dizzy,
STATUS_END,
};
extern EvtSource N(takeTurn_80221D28);
extern EvtSource N(idle_80221220);
extern EvtSource N(handleEvent_802214FC);
EvtSource N(802211D4) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_80221D28)))
EVT_CALL(BindIdle, ACTOR_SELF, EVT_ADDR(N(idle_80221220)))
EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_ADDR(N(handleEvent_802214FC)))
EVT_RETURN
EVT_END
};
EvtSource N(idle_80221220) = {
EVT_LABEL(10)
EVT_CALL(RandInt, 80, LW(0))
EVT_ADD(LW(0), 80)
EVT_LOOP(LW(0))
EVT_LABEL(0)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(0)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0))
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_80221188)))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleRunToGoal, -127, 0)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8022113C)))
EVT_LOOP(20)
EVT_LABEL(1)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(1)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0))
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_80221188)))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleRunToGoal, -127, 0)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8022113C)))
EVT_LOOP(80)
EVT_LABEL(2)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(2)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_GOTO(10)
EVT_RETURN
EVT_END
};
EvtSource N(handleEvent_802214FC) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(9)
EVT_CASE_OR_EQ(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_pain)
EVT_EXEC_WAIT(DoNormalHit)
EVT_END_CASE_GROUP
EVT_CASE_EQ(14)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_burn_pain)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_normal_burn_dead)
EVT_EXEC_WAIT(DoBurnHit)
EVT_CASE_EQ(36)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_burn_pain)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_normal_burn_dead)
EVT_EXEC_WAIT(DoBurnHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_burn_dead)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(11)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_pain)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_CASE_EQ(33)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_pain)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_dead)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(47)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_electrocute)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_pain)
EVT_EXEC_WAIT(DoJumpBack)
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_dizzy)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(5)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_idle)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6005859375))
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CASE_EQ(38)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_electrocute)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_dead)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(19)
EVT_CASE_OR_EQ(23)
EVT_CASE_OR_EQ(25)
EVT_CASE_OR_EQ(31)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_idle)
EVT_EXEC_WAIT(DoImmune)
EVT_END_CASE_GROUP
EVT_CASE_EQ(32)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_pain)
EVT_EXEC_WAIT(DoNormalHit)
EVT_WAIT_FRAMES(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_dead)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(53)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_run)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_CALL(HPBarToHome, ACTOR_SELF)
EVT_CASE_EQ(49)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_idle)
EVT_EXEC_WAIT(DoRecover)
EVT_CASE_EQ(57)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_run)
EVT_SET_CONST(LW(2), NPC_ANIM_goomba_normal_pain)
EVT_EXEC_WAIT(DoScareAway)
EVT_RETURN
EVT_CASE_EQ(58)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_run)
EVT_EXEC_WAIT(DoAirLift)
EVT_CASE_EQ(22)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_goomba_normal_pain)
EVT_EXEC_WAIT(DoBlowAway)
EVT_RETURN
EVT_CASE_DEFAULT
EVT_END_SWITCH
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_idle)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
#include "common/anglestuff.inc.c"
EvtSource N(takeTurn_80221D28) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(UseBattleCamPreset, 63)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_run)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_idle)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_headbonk)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), ((0)), 0, 1, 16)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(6)
EVT_CASE_OR_EQ(5)
EVT_SET(LW(10), LW(0))
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 10)
EVT_SET(LW(1), 10)
EVT_ADD(LW(2), 3)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2001953125))
EVT_THREAD
EVT_CALL(GetActorPos, ACTOR_SELF, LW(1), LW(2), LW(0))
EVT_SET(LW(0), 0)
EVT_LOOP(16)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(4), LW(5), LW(6))
EVT_CALL(N(AngleCalculate), LW(1), LW(2), LW(4), LW(5), LW(0))
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_SET(LW(1), LW(4))
EVT_SET(LW(2), LW(5))
EVT_SET(LW(3), LW(6))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(6)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_headbonk)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_asleep)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 5, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.30078125), EVT_FLOAT(0.5), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 7, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_pain)
EVT_WAIT_FRAMES(5)
EVT_IF_EQ(LW(10), 5)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), 0x80000000, 0, 0, 0)
EVT_END_IF
EVT_WAIT_FRAMES(5)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_headbonk)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 20)
EVT_SET(LW(1), 0)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0))
EVT_THREAD
EVT_WAIT_FRAMES(4)
EVT_SET(LW(0), 180)
EVT_LOOP(4)
EVT_SUB(LW(0), 45)
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_headbonk)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_dizzy)
EVT_WAIT_FRAMES(5)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(YieldTurn)
EVT_CALL(SetActorYaw, ACTOR_SELF, 180)
EVT_CALL(AddActorDecoration, ACTOR_SELF, 1, 0, 2)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_idle)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6005859375))
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CALL(RemoveActorDecoration, ACTOR_SELF, 1, 0)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END_CASE_GROUP
EVT_CASE_DEFAULT
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2001953125))
EVT_THREAD
EVT_CALL(GetActorPos, ACTOR_SELF, LW(1), LW(2), LW(0))
EVT_SET(LW(0), 0)
EVT_LOOP(16)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(4), LW(5), LW(6))
EVT_CALL(N(AngleCalculate), LW(1), LW(2), LW(4), LW(5), LW(0))
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_SET(LW(1), LW(4))
EVT_SET(LW(2), LW(5))
EVT_SET(LW(3), LW(6))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(6)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_headbonk)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_pre_headbonk)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.30078125), EVT_FLOAT(0.5), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_END_SWITCH
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(0), ((0)), 0, 0, 1, 32)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(0)
EVT_CASE_OR_EQ(2)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_idle)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 40)
EVT_SET(LW(1), 0)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 30)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 20)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_idle)
EVT_WAIT_FRAMES(3)
EVT_CALL(YieldTurn)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_goomba_normal_run)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,536 @@
#include "common.h"
#include "battle/battle.h"
#include "script_api/battle.h"
#include "sprite/npc/spiked_goomba.h"
#define NAMESPACE b_area_kmr_part_3_spiked_goomba
s32 N(defenseTable_8021A390)[] = {
ELEMENT_NORMAL, 0,
ELEMENT_END,
};
s32 N(statusTable_8021A39C)[] = {
STATUS_NORMAL, 0,
STATUS_DEFAULT, 0,
STATUS_SLEEP, 100,
STATUS_POISON, 80,
STATUS_FROZEN, 100,
STATUS_DIZZY, 100,
STATUS_FEAR, 80,
STATUS_STATIC, 80,
STATUS_PARALYZE, 100,
STATUS_SHRINK, 100,
STATUS_STOP, 100,
STATUS_DEFAULT_TURN_MOD, 0,
STATUS_SLEEP_TURN_MOD, 0,
STATUS_POISON_TURN_MOD, 0,
STATUS_FROZEN_TURN_MOD, 0,
STATUS_DIZZY_TURN_MOD, 0,
STATUS_FEAR_TURN_MOD, 0,
STATUS_STATIC_TURN_MOD, 0,
STATUS_PARALYZE_TURN_MOD, 0,
STATUS_SHRINK_TURN_MOD, 0,
STATUS_STOP_TURN_MOD, 0,
STATUS_END,
};
extern s32 N(idleAnimations_8021A494)[];
extern EvtSource N(init_8021BEBC);
extern EvtSource N(takeTurn_8021B19C);
extern EvtSource N(idle_8021A578);
extern EvtSource N(handleEvent_8021A854);
ActorPartDesc N(partsTable_8021A448)[] = {
{
.flags = ACTOR_PART_FLAG_MULTI_TARGET,
.index = 1,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 24 },
.opacity = 255,
.idleAnimations = N(idleAnimations_8021A494),
.defenseTable = N(defenseTable_8021A390),
.eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP,
.elementImmunityFlags = 0,
.unk_1C = 244,
},
};
ActorDesc NAMESPACE = {
.flags = 0,
.type = ACTOR_TYPE_SPIKED_GOOMBA,
.level = 6,
.maxHP = 2,
.partCount = ARRAY_COUNT(N(partsTable_8021A448)),
.partsData = N(partsTable_8021A448),
.script = N(init_8021BEBC),
.statusTable = N(statusTable_8021A39C),
.escapeChance = 90,
.airLiftChance = 95,
.spookChance = 90,
.baseStatusChance = 100,
.upAndAwayChance = 95,
.spinSmashReq = 0,
.powerBounceChance = 100,
.coinReward = 1,
.size = { 24, 28 },
.hpBarOffset = { 0, 0 },
.statusIconOffset = { -10, 20 },
.statusMessageOffset = { 10, 20 },
};
s32 N(idleAnimations_8021A494)[] = {
STATUS_NORMAL, NPC_ANIM_spiked_goomba_default_idle,
STATUS_STONE, NPC_ANIM_spiked_goomba_default_still,
STATUS_SLEEP, NPC_ANIM_spiked_goomba_default_sleep,
STATUS_POISON, NPC_ANIM_spiked_goomba_default_idle,
STATUS_STOP, NPC_ANIM_spiked_goomba_default_still,
STATUS_STATIC, NPC_ANIM_spiked_goomba_default_idle,
STATUS_PARALYZE, NPC_ANIM_spiked_goomba_default_still,
STATUS_DIZZY, NPC_ANIM_spiked_goomba_default_dizzy,
STATUS_FEAR, NPC_ANIM_spiked_goomba_default_dizzy,
STATUS_END,
};
s32 N(idleAnimations_8021A4E0)[] = {
STATUS_NORMAL, NPC_ANIM_spiked_goomba_default_run,
STATUS_STONE, NPC_ANIM_spiked_goomba_default_still,
STATUS_SLEEP, NPC_ANIM_spiked_goomba_default_sleep,
STATUS_POISON, NPC_ANIM_spiked_goomba_default_idle,
STATUS_STOP, NPC_ANIM_spiked_goomba_default_still,
STATUS_STATIC, NPC_ANIM_spiked_goomba_default_run,
STATUS_PARALYZE, NPC_ANIM_spiked_goomba_default_still,
STATUS_DIZZY, NPC_ANIM_spiked_goomba_default_dizzy,
STATUS_FEAR, NPC_ANIM_spiked_goomba_default_dizzy,
STATUS_END,
};
EvtSource N(8021A52C) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_8021B19C)))
EVT_CALL(BindIdle, ACTOR_SELF, EVT_ADDR(N(idle_8021A578)))
EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_ADDR(N(handleEvent_8021A854)))
EVT_RETURN
EVT_END
};
EvtSource N(idle_8021A578) = {
EVT_LABEL(10)
EVT_CALL(RandInt, 80, LW(0))
EVT_ADD(LW(0), 80)
EVT_LOOP(LW(0))
EVT_LABEL(0)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(0)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0))
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021A4E0)))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleRunToGoal, -127, 0)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021A494)))
EVT_LOOP(20)
EVT_LABEL(1)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(1)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 5)
EVT_CALL(SetActorIdleSpeed, ACTOR_SELF, EVT_FLOAT(1.0))
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021A4E0)))
EVT_CALL(SetIdleGoal, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(IdleRunToGoal, -127, 0)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 1, EVT_ADDR(N(idleAnimations_8021A494)))
EVT_LOOP(80)
EVT_LABEL(2)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(1))
EVT_IF_FLAG(LW(1), 0x35D000)
EVT_WAIT_FRAMES(1)
EVT_GOTO(2)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_GOTO(10)
EVT_RETURN
EVT_END
};
EvtSource N(handleEvent_8021A854) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(9)
EVT_CASE_OR_EQ(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_goomba_default_pain)
EVT_EXEC_WAIT(DoNormalHit)
EVT_END_CASE_GROUP
EVT_CASE_EQ(14)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_goomba_default_burn_dead)
EVT_SET_CONST(LW(2), NPC_ANIM_spiked_goomba_default_burn_pain)
EVT_EXEC_WAIT(DoBurnHit)
EVT_CASE_EQ(36)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_goomba_default_burn_dead)
EVT_SET_CONST(LW(2), NPC_ANIM_spiked_goomba_default_burn_pain)
EVT_EXEC_WAIT(DoBurnHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_goomba_default_burn_pain)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(11)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_goomba_default_pain)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_CASE_EQ(33)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_goomba_default_pain)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_goomba_default_dead)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(47)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_goomba_default_electrocute)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_goomba_default_pain)
EVT_EXEC_WAIT(DoJumpBack)
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_dizzy)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(5)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_idle)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6005859375))
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CASE_EQ(38)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_goomba_default_electrocute)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_goomba_default_dead)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(19)
EVT_CASE_OR_EQ(23)
EVT_CASE_OR_EQ(25)
EVT_CASE_OR_EQ(31)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_goomba_default_idle)
EVT_EXEC_WAIT(DoImmune)
EVT_END_CASE_GROUP
EVT_CASE_EQ(32)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_goomba_default_pain)
EVT_EXEC_WAIT(DoNormalHit)
EVT_WAIT_FRAMES(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_goomba_default_dead)
EVT_EXEC_WAIT(DoDeath)
EVT_RETURN
EVT_CASE_EQ(53)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_run)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_CALL(HPBarToHome, ACTOR_SELF)
EVT_CASE_EQ(49)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_goomba_default_idle)
EVT_EXEC_WAIT(DoRecover)
EVT_CASE_EQ(57)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_goomba_default_run)
EVT_SET_CONST(LW(2), NPC_ANIM_spiked_goomba_default_pain)
EVT_EXEC_WAIT(DoScareAway)
EVT_RETURN
EVT_CASE_EQ(58)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_goomba_default_run)
EVT_EXEC_WAIT(DoAirLift)
EVT_CASE_EQ(22)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_goomba_default_pain)
EVT_EXEC_WAIT(DoBlowAway)
EVT_RETURN
EVT_CASE_EQ(27)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x35D000)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_laugh)
EVT_END_IF
EVT_WAIT_FRAMES(10)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(3))
EVT_IF_FLAG(LW(3), 0x80000)
EVT_ADD(LW(1), 10)
EVT_ELSE
EVT_ADD(LW(1), 26)
EVT_END_IF
EVT_CALL(PlayEffect, 0x1A, 0, LW(0), LW(1), LW(2), 20, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_WAIT_FRAMES(20)
EVT_CASE_DEFAULT
EVT_END_SWITCH
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_idle)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
#include "common/anglestuff.inc.c"
EvtSource N(takeTurn_8021B19C) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(UseBattleCamPreset, 63)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_run)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_idle)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_headbonk)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), ((0)), 0, 1, 16)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(6)
EVT_CASE_OR_EQ(5)
EVT_SET(LW(10), LW(0))
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 10)
EVT_SET(LW(1), 10)
EVT_ADD(LW(2), 3)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2001953125))
EVT_THREAD
EVT_CALL(GetActorPos, ACTOR_SELF, LW(1), LW(2), LW(0))
EVT_SET(LW(0), 0)
EVT_LOOP(16)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(4), LW(5), LW(6))
EVT_CALL(N(AngleCalculate), LW(1), LW(2), LW(4), LW(5), LW(0))
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_SET(LW(1), LW(4))
EVT_SET(LW(2), LW(5))
EVT_SET(LW(3), LW(6))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(6)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_headbonk)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_sleep)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 5, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.30078125), EVT_FLOAT(0.5), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 7, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_pain)
EVT_WAIT_FRAMES(5)
EVT_IF_EQ(LW(10), 5)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), 0x80000000, 0, 0, 0)
EVT_END_IF
EVT_WAIT_FRAMES(5)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_headbonk)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 20)
EVT_SET(LW(1), 0)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(2.0))
EVT_THREAD
EVT_WAIT_FRAMES(4)
EVT_SET(LW(0), 180)
EVT_LOOP(4)
EVT_SUB(LW(0), 45)
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_headbonk)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_dizzy)
EVT_WAIT_FRAMES(5)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(YieldTurn)
EVT_CALL(SetActorYaw, ACTOR_SELF, 180)
EVT_CALL(AddActorDecoration, ACTOR_SELF, 1, 0, 2)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_idle)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.6005859375))
EVT_CALL(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
EVT_CALL(RemoveActorDecoration, ACTOR_SELF, 1, 0)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END_CASE_GROUP
EVT_CASE_DEFAULT
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2001953125))
EVT_THREAD
EVT_CALL(GetActorPos, ACTOR_SELF, LW(1), LW(2), LW(0))
EVT_SET(LW(0), 0)
EVT_LOOP(16)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(4), LW(5), LW(6))
EVT_CALL(N(AngleCalculate), LW(1), LW(2), LW(4), LW(5), LW(0))
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, LW(0))
EVT_SET(LW(1), LW(4))
EVT_SET(LW(2), LW(5))
EVT_SET(LW(3), LW(6))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(6)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_headbonk)
EVT_END_THREAD
EVT_CALL(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_headbonk)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.30078125), EVT_FLOAT(0.5), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_END_SWITCH
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(0), ((0)), 0, 0, 2, 32)
EVT_SWITCH(LW(0))
EVT_CASE_OR_EQ(0)
EVT_CASE_OR_EQ(2)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.1005859375), EVT_FLOAT(0.80078125), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorScale, ACTOR_SELF, EVT_FLOAT(1.0), EVT_FLOAT(1.0), EVT_FLOAT(1.0))
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_idle)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 40)
EVT_SET(LW(1), 0)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 30)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 20)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
EVT_CALL(GetLastDamage, 0, LW(0))
EVT_IF_GT(LW(0), 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_laugh)
EVT_WAIT_FRAMES(15)
EVT_ELSE
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_idle)
EVT_WAIT_FRAMES(3)
EVT_END_IF
EVT_CALL(YieldTurn)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(2.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_goomba_default_run)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimationRate, ACTOR_SELF, 1, EVT_FLOAT(1.0))
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
extern EvtSource N(nextTurn_8021C0FC);
EvtSource N(init_8021BEBC) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_8021B19C)))
EVT_CALL(BindIdle, ACTOR_SELF, EVT_ADDR(N(idle_8021A578)))
EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_ADDR(N(handleEvent_8021A854)))
EVT_CALL(BindNextTurn, -127, EVT_ADDR(N(nextTurn_8021C0FC)))
EVT_RETURN
EVT_END
};
EvtSource N(8021BF1C) = {
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 30)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 60)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 90)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 120)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 150)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 180)
EVT_WAIT_FRAMES(5)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(MoveBattleCamOver, 10)
EVT_CALL(ActorSpeak, 721081, 256, 0, 10289160, 10289153)
EVT_SET(GSWF(1818), 1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 150)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 120)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 90)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 60)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 30)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetActorYaw, ACTOR_PLAYER, 0)
EVT_WAIT_FRAMES(5)
EVT_RETURN
EVT_END
};
EvtSource N(nextTurn_8021C0FC) = {
EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_PARTNER, 0)
EVT_CALL(GetBattlePhase, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_EQ(10)
EVT_IF_EQ(GSWF(1818), 0)
EVT_EXEC_WAIT(N(8021BF1C))
EVT_END_IF
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_PARTNER, 1)
EVT_CALL(UseIdleAnimation, ACTOR_PARTNER, TRUE)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,712 @@
#include "common.h"
#include "hud_element.h"
#include "battle/battle.h"
#include "script_api/battle.h"
#include "sprite/npc/jr_troopa.h"
#include "sprite/npc/spiked_para_jr_troopa.h"
#define NAMESPACE b_area_kmr_part_3_spiked_para_jr_troopa
s32 N(idleAnimations_80227F00)[] = {
STATUS_NORMAL, NPC_ANIM_spiked_para_jr_troopa_default_idle,
STATUS_SLEEP, NPC_ANIM_spiked_para_jr_troopa_default_sleep,
STATUS_STONE, NPC_ANIM_spiked_para_jr_troopa_default_still,
STATUS_POISON, NPC_ANIM_spiked_para_jr_troopa_default_still,
STATUS_STOP, NPC_ANIM_spiked_para_jr_troopa_default_still,
STATUS_STATIC, NPC_ANIM_spiked_para_jr_troopa_default_still,
STATUS_PARALYZE, NPC_ANIM_spiked_para_jr_troopa_default_still,
STATUS_DIZZY, NPC_ANIM_spiked_para_jr_troopa_default_dizzy,
STATUS_END,
};
s32 N(idleAnimations_80227F44)[] = {
STATUS_NORMAL, NPC_ANIM_jr_troopa_default_idle_angry,
STATUS_END,
};
s32 N(idleAnimations_80227F50)[] = {
STATUS_NORMAL, NPC_ANIM_jr_troopa_default_dead,
STATUS_END,
};
s32 N(defenseTable_80227F5C)[] = {
ELEMENT_NORMAL, 1,
ELEMENT_END,
};
s32 N(statusTable_80227F68)[] = {
STATUS_NORMAL, 100,
STATUS_DEFAULT, 100,
STATUS_SLEEP, 40,
STATUS_POISON, 0,
STATUS_FROZEN, 0,
STATUS_DIZZY, 90,
STATUS_FEAR, 0,
STATUS_STATIC, 0,
STATUS_PARALYZE, 45,
STATUS_SHRINK, 60,
STATUS_STOP, 70,
STATUS_DEFAULT_TURN_MOD, 0,
STATUS_SLEEP_TURN_MOD, -1,
STATUS_POISON_TURN_MOD, 0,
STATUS_FROZEN_TURN_MOD, 0,
STATUS_DIZZY_TURN_MOD, 0,
STATUS_FEAR_TURN_MOD, 0,
STATUS_STATIC_TURN_MOD, 0,
STATUS_PARALYZE_TURN_MOD, -1,
STATUS_SHRINK_TURN_MOD, -1,
STATUS_STOP_TURN_MOD, -2,
STATUS_END,
};
ActorPartDesc N(partsTable_80228014)[] = {
{
.flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_MULTI_TARGET,
.index = 1,
.posOffset = { 0, 0, 0 },
.targetOffset = { -5, 32 },
.opacity = 255,
.idleAnimations = N(idleAnimations_80227F00),
.defenseTable = N(defenseTable_80227F5C),
.eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP,
.elementImmunityFlags = 0,
.unk_1C = 245,
},
{
.flags = ACTOR_PART_FLAG_NO_TARGET,
.index = 2,
.posOffset = { 0, 0, 0 },
.targetOffset = { 0, 30 },
.opacity = 255,
.idleAnimations = N(idleAnimations_80227F44),
.defenseTable = N(defenseTable_80227F5C),
.eventFlags = ACTOR_EVENT_FLAG_SPIKY_TOP,
.elementImmunityFlags = 0,
.unk_1C = 0,
},
};
extern EvtSource N(init_80228618);
ActorDesc NAMESPACE = {
.flags = ACTOR_FLAG_FLYING,
.type = ACTOR_TYPE_JR_TROOPA4,
.level = 59,
.maxHP = 40,
.partCount = ARRAY_COUNT(N(partsTable_80228014)),
.partsData = N(partsTable_80228014),
.script = N(init_80228618),
.statusTable = N(statusTable_80227F68),
.escapeChance = 0,
.airLiftChance = 0,
.spookChance = 0,
.baseStatusChance = 0,
.upAndAwayChance = 0,
.spinSmashReq = 0,
.powerBounceChance = 75,
.coinReward = 0,
.size = { 60, 38 },
.hpBarOffset = { 0, 0 },
.statusIconOffset = { -25, 35 },
.statusMessageOffset = { 10, 25 },
};
EvtSource N(80228084) = {
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(2))
EVT_IF_FLAG(LW(2), 0x35D000)
EVT_RETURN
EVT_END_IF
EVT_CALL(GetBattleFlags, LW(2))
EVT_IF_FLAG(LW(2), 0x80000)
EVT_CALL(GetMenuSelection, LW(0), LW(1), LW(2))
EVT_IF_EQ(LW(2), 183)
EVT_CALL(SetActorVar, -127, 2, 1)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x263)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(1), 30)
EVT_CALL(ShowEmote, 0, EMOTE_QUESTION, -45, 30, 2, LW(0), LW(1), LW(2), 5)
EVT_WAIT_FRAMES(30)
EVT_END_IF
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtSource N(802281B4) = {
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20B9)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(3))
EVT_IF_NOT_FLAG(LW(3), 0x80000)
EVT_ADD(LW(1), 16)
EVT_ELSE
EVT_ADD(LW(1), 6)
EVT_END_IF
EVT_CALL(PlayEffect, 0x13, 0, LW(0), LW(1), LW(2), 1, 30, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x13, 1, LW(0), LW(1), LW(2), 1, 30, 0, 0, 0, 0, 0, 0, 0)
EVT_THREAD
EVT_SET(LW(0), 0)
EVT_LOOP(32)
EVT_WAIT_FRAMES(1)
EVT_ADD(LW(0), 45)
EVT_CALL(SetActorRotation, ACTOR_SELF, 0, LW(0), 0)
EVT_END_LOOP
EVT_END_THREAD
EVT_WAIT_FRAMES(32)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x300)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(1), 15)
EVT_CALL(PlayEffect, 0x52, 4, LW(0), LW(1), LW(2), 1, 40, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x7, 0, LW(0), LW(1), LW(2), -4, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x7, 0, LW(0), LW(1), LW(2), -4, 4, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x7, 0, LW(0), LW(1), LW(2), 4, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(PlayEffect, 0x7, 0, LW(0), LW(1), LW(2), 4, 4, 0, 0, 0, 0, 0, 0, 0)
EVT_RETURN
EVT_END
};
EvtSource N(802284DC) = {
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(UseBattleCamPreset, 7)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(SetBattleCamOffsetZ, 38)
EVT_CALL(SetBattleCamZoom, 256)
EVT_CALL(MoveBattleCamOver, 15)
EVT_RETURN
EVT_END
};
EvtSource N(80228574) = {
EVT_CALL(func_802535B4, 1)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(MoveBattleCamOver, 12)
EVT_RETURN
EVT_END
};
EvtSource N(802285B4) = {
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(UseBattleCamPreset, 55)
EVT_CALL(MoveBattleCamOver, 30)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_RETURN
EVT_END
};
extern EvtSource N(takeTurn_8022936C);
extern EvtSource N(idle_802286C0);
extern EvtSource N(handleEvent_802287D0);
extern EvtSource N(nextTurn_80229B38);
EvtSource N(init_80228618) = {
EVT_CALL(BindTakeTurn, ACTOR_SELF, EVT_ADDR(N(takeTurn_8022936C)))
EVT_CALL(BindIdle, ACTOR_SELF, EVT_ADDR(N(idle_802286C0)))
EVT_CALL(BindHandleEvent, ACTOR_SELF, EVT_ADDR(N(handleEvent_802287D0)))
EVT_CALL(BindNextTurn, -127, EVT_ADDR(N(nextTurn_80229B38)))
EVT_CALL(SetActorVar, -127, 0, 0)
EVT_CALL(SetActorVar, -127, 1, 0)
EVT_CALL(SetActorVar, -127, 2, 0)
EVT_RETURN
EVT_END
};
#include "common/UnkBattleFunc1.inc.c"
EvtSource N(idle_802286C0) = {
EVT_LABEL(0)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(10))
EVT_IF_FLAG(LW(10), 0x41000)
EVT_CALL(SetTargetOffset, -127, 1, -15, 28)
EVT_CALL(func_8027D4C8, -127, 1, 4, -6)
EVT_CALL(N(UnkBattleFunc1), -25, 27, -1, 27)
EVT_ELSE
EVT_CALL(SetTargetOffset, -127, 1, -8, 33)
EVT_CALL(func_8027D4C8, -127, 1, 0, -6)
EVT_CALL(N(UnkBattleFunc1), -22, 30, 2, 28)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
extern EvtSource N(80228FE8);
extern EvtSource N(8022906C);
extern EvtSource N(8022A018);
extern EvtSource N(8022A39C);
extern EvtSource N(8022A480);
EvtSource N(handleEvent_802287D0) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(GetLastEvent, ACTOR_SELF, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_EQ(9)
EVT_EXEC_WAIT(N(80228FE8))
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoNormalHit)
EVT_CASE_EQ(10)
EVT_EXEC_WAIT(N(80228FE8))
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoNormalHit)
EVT_EXEC_WAIT(N(8022906C))
EVT_EXEC_WAIT(N(80228084))
EVT_EXEC_WAIT(N(8022A480))
EVT_CASE_EQ(32)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoNormalHit)
EVT_WAIT_FRAMES(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(N(8022A018))
EVT_RETURN
EVT_CASE_EQ(14)
EVT_EXEC_WAIT(N(80228FE8))
EVT_SET(LW(0), 1)
EVT_SET(LW(1), 2293770)
EVT_SET(LW(2), 2293771)
EVT_EXEC_WAIT(DoBurnHit)
EVT_EXEC_WAIT(N(8022906C))
EVT_CASE_EQ(36)
EVT_EXEC_WAIT(N(80228FE8))
EVT_SET(LW(0), 1)
EVT_SET(LW(1), 2293770)
EVT_SET(LW(2), 2293771)
EVT_EXEC_WAIT(DoBurnHit)
EVT_WAIT_FRAMES(10)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_para_jr_troopa_default_burn_dead)
EVT_EXEC_WAIT(N(8022A018))
EVT_RETURN
EVT_CASE_EQ(11)
EVT_EXEC_WAIT(N(80228FE8))
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_EXEC_WAIT(N(8022906C))
EVT_CASE_EQ(33)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoSpinSmashHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(N(8022A018))
EVT_RETURN
EVT_CASE_EQ(47)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoJumpBack)
EVT_EXEC_WAIT(N(8022A39C))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_idle)
EVT_CASE_EQ(38)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoShockHit)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_para_jr_troopa_default_hurt)
EVT_EXEC_WAIT(DoJumpBack)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_para_jr_troopa_default_still)
EVT_EXEC_WAIT(N(8022A018))
EVT_RETURN
EVT_CASE_OR_EQ(23)
EVT_CASE_OR_EQ(25)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_para_jr_troopa_default_idle)
EVT_EXEC_WAIT(DoImmune)
EVT_EXEC_WAIT(N(80228084))
EVT_EXEC_WAIT(N(8022A480))
EVT_END_CASE_GROUP
EVT_CASE_EQ(27)
EVT_WAIT_FRAMES(10)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(3))
EVT_SWITCH(LW(3))
EVT_CASE_FLAG(266240)
EVT_ADD(LW(0), -13)
EVT_ADD(LW(1), 37)
EVT_CASE_FLAG(524288)
EVT_ADD(LW(0), -1)
EVT_ADD(LW(1), 14)
EVT_CASE_DEFAULT
EVT_ADD(LW(0), -4)
EVT_ADD(LW(1), 37)
EVT_END_SWITCH
EVT_CALL(PlayEffect, 0x1A, 0, LW(0), LW(1), LW(2), 20, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_WAIT_FRAMES(20)
EVT_CASE_EQ(58)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x35D000)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_hanging)
EVT_WAIT_FRAMES(1000)
EVT_END_IF
EVT_CASE_EQ(31)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x35D000)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_hanging)
EVT_WAIT_FRAMES(20)
EVT_EXEC_WAIT(N(802284DC))
EVT_CALL(ActorSpeak, 1900955, -127, 1, 2293775, 2293775)
EVT_EXEC_WAIT(N(80228574))
EVT_END_IF
EVT_CASE_EQ(42)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_hurt)
EVT_WAIT_FRAMES(20)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_run)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_idle)
EVT_CASE_EQ(53)
EVT_EXEC_WAIT(N(8022A39C))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_idle)
EVT_CALL(HPBarToHome, ACTOR_SELF)
EVT_CASE_EQ(49)
EVT_SET_CONST(LW(0), 0x00000001)
EVT_SET_CONST(LW(1), NPC_ANIM_spiked_para_jr_troopa_default_idle)
EVT_EXEC_WAIT(DoRecover)
EVT_CASE_DEFAULT
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(80228FE8) = {
EVT_CALL(GetActorVar, -127, 1, LW(0))
EVT_IF_EQ(LW(0), 0)
EVT_CALL(GetLastDamage, -127, LW(1))
EVT_IF_NE(LW(1), 0)
EVT_CALL(SetActorVar, -127, 1, 1)
EVT_END_IF
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtSource N(8022906C) = {
EVT_CALL(GetActorVar, -127, 1, LW(0))
EVT_IF_EQ(LW(0), 1)
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x351000)
EVT_CALL(SetActorVar, -127, 1, 2)
EVT_EXEC_WAIT(N(802284DC))
EVT_CALL(ActorSpeak, 458940, -127, 1, -1, -1)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_idle)
EVT_EXEC_WAIT(N(80228574))
EVT_ELSE
EVT_CALL(SetActorVar, -127, 1, 0)
EVT_END_IF
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtSource N(80229160) = {
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(0), 40)
EVT_SET(LW(1), 0)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 30)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
EVT_ADD(LW(0), 20)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
EVT_SUB(LW(0), 10)
EVT_CALL(JumpToGoal, ACTOR_SELF, 4, FALSE, TRUE, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_idle)
EVT_WAIT_FRAMES(8)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_idle)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_run)
EVT_CALL(RunToGoal, ACTOR_SELF, 0, FALSE)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_idle)
EVT_RETURN
EVT_END
};
EvtSource N(takeTurn_8022936C) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(UseBattleCamPreset, 63)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_run)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 0, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -4, 0)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(10), 0, 0, 6, 16)
EVT_SWITCH(LW(10))
EVT_CASE_OR_EQ(6)
EVT_CASE_OR_EQ(5)
EVT_WAIT_FRAMES(10)
EVT_CALL(UseBattleCamPreset, 66)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(SetActorSounds, -127, 2, 8416, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_run)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_CALL(SetActorSounds, -127, 1, 0, 0)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_SUB(LW(0), 80)
EVT_SET(LW(1), 20)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_attack)
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, 0)
EVT_IF_EQ(LW(10), 5)
EVT_CALL(EnemyTestTarget, ACTOR_SELF, LW(0), DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
EVT_END_IF
EVT_WAIT_FRAMES(10)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(MoveBattleCamOver, 20)
EVT_CALL(ResetAllActorSounds, ACTOR_SELF)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_run)
EVT_CALL(SetActorYaw, ACTOR_SELF, 180)
EVT_CALL(AddActorDecoration, ACTOR_SELF, 1, 0, 2)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_idle)
EVT_CALL(RemoveActorDecoration, ACTOR_SELF, 1, 0)
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_RETURN
EVT_END_CASE_GROUP
EVT_CASE_DEFAULT
EVT_WAIT_FRAMES(10)
EVT_CALL(UseBattleCamPreset, 66)
EVT_CALL(func_8024ECF8, -1, 1, 0)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(SetActorSounds, -127, 2, 8416, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(5.0))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.80078125))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_run)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
EVT_CALL(SetActorSounds, -127, 1, 0, 0)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, SOUND_UNUSED_2C1)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(8.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_attack)
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, 0)
EVT_END_SWITCH
EVT_WAIT_FRAMES(2)
EVT_CALL(EnemyDamageTarget, ACTOR_SELF, LW(0), 0, 0, 0, 6, 32)
EVT_SET(LW(15), LW(0))
EVT_SWITCH(LW(15))
EVT_CASE_OR_EQ(0)
EVT_CASE_OR_EQ(2)
EVT_CASE_OR_EQ(10)
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(SetGoalToTarget, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 50, 10, 0)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(4.0))
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_run)
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, -10, 0)
EVT_WAIT_FRAMES(10)
EVT_CALL(ResetAllActorSounds, ACTOR_SELF)
EVT_CALL(YieldTurn)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_run)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_idle)
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
ApiStatus func_802189DC_447E1C(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
f32 posX = evt_get_float_variable(script, *args++);
f32 posY = evt_get_float_variable(script, *args++);
s32 icon = create_hud_element(D_80104A28);
set_hud_element_render_pos(icon, posX, posY);
set_hud_element_scale(icon, 1.5f);
clear_hud_element_flags(icon, 0x200002);
evt_set_variable(script, *args++, icon);
load_tattle_flags(0x8B);
return ApiStatus_DONE2;
}
#include "common/FreeIcon.inc.c"
EvtSource N(nextTurn_80229B38) = {
EVT_CALL(UseIdleAnimation, ACTOR_SELF, FALSE)
EVT_CALL(EnableIdleScript, ACTOR_SELF, 0)
EVT_CALL(GetBattlePhase, LW(0))
EVT_SWITCH(LW(0))
EVT_CASE_EQ(10)
EVT_CALL(GetActorVar, -127, 0, LW(0))
EVT_IF_EQ(LW(0), 0)
EVT_CALL(SetActorVar, -127, 0, 1)
EVT_WAIT_FRAMES(15)
EVT_CALL(UseBattleCamPreset, 14)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(SetBattleCamOffsetZ, 35)
EVT_CALL(MoveBattleCamOver, 30)
EVT_WAIT_FRAMES(20)
EVT_CALL(ActorSpeak, 458936, -127, 2, 2162693, 2162693)
EVT_WAIT_FRAMES(10)
EVT_CALL(SetActorFlagBits, ACTOR_SELF, 4096, 1)
EVT_CALL(func_8026D940, -127, -20, 40)
EVT_CALL(func_8027D2D8, -127)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SET(LW(0), 115)
EVT_SET(LW(1), 150)
EVT_CALL(func_802189DC_447E1C, LW(0), LW(1), LW(10))
EVT_WAIT_FRAMES(10)
EVT_CALL(GetEnemyMaxHP, -127, LW(0))
EVT_LABEL(0)
EVT_SUB(LW(0), 1)
EVT_CALL(SetEnemyHP, -127, LW(0))
EVT_WAIT_FRAMES(1)
EVT_IF_GT(LW(0), 20)
EVT_GOTO(0)
EVT_END_IF
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_jr_troopa_default_hurt_crazy)
EVT_WAIT_FRAMES(15)
EVT_LOOP(2)
EVT_CALL(SetActorFlagBits, ACTOR_SELF, 4096, 0)
EVT_WAIT_FRAMES(15)
EVT_CALL(SetActorFlagBits, ACTOR_SELF, 4096, 1)
EVT_WAIT_FRAMES(15)
EVT_END_LOOP
EVT_CALL(ActorSpeak, 458937, -127, 2, 2162707, 2162707)
EVT_CALL(SetActorFlagBits, ACTOR_SELF, 4096, 0)
EVT_CALL(N(FreeIcon), LW(10))
EVT_CALL(func_8027D32C, -127)
EVT_CALL(func_8026D940, -127, 0, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_jr_troopa_default_idle_angry)
EVT_WAIT_FRAMES(25)
EVT_CALL(ActorSpeak, 458938, -127, 2, 2162710, 2162691)
EVT_WAIT_FRAMES(10)
EVT_EXEC_WAIT(N(802281B4))
EVT_CALL(SetPartFlagBits, -127, 2, 1, 1)
EVT_CALL(SetPartFlagBits, -127, 1, 1, 0)
EVT_WAIT_FRAMES(20)
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(AddGoalPos, ACTOR_SELF, 40, 80, 0)
EVT_CALL(FlyToGoal, ACTOR_SELF, 30, 0, 0)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(ForceHomePos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(HPBarToHome, ACTOR_SELF)
EVT_WAIT_FRAMES(10)
EVT_CALL(ActorSpeak, 458939, -127, 1, 2293775, 2293763)
EVT_WAIT_FRAMES(10)
EVT_EXEC_WAIT(N(80228574))
EVT_END_IF
EVT_CASE_EQ(12)
EVT_END_SWITCH
EVT_CALL(EnableIdleScript, ACTOR_SELF, 1)
EVT_CALL(UseIdleAnimation, ACTOR_SELF, TRUE)
EVT_RETURN
EVT_END
};
EvtSource N(8022A018) = {
EVT_CALL(UseBattleCamPreset, 2)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_IF_EQ(LW(1), 0)
EVT_GOTO(0)
EVT_END_IF
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x301)
EVT_CALL(SetActorSounds, -127, 2, 0, 0)
EVT_CALL(func_8027D32C, -127)
EVT_CALL(SetGoalPos, ACTOR_SELF, LW(0), 0, LW(2))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2001953125))
EVT_CALL(FallToGoal, -127, 10)
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(0.80078125))
EVT_CALL(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
EVT_CALL(HPBarToCurrent, ACTOR_SELF)
EVT_CALL(func_8027D2D8, -127)
EVT_LABEL(0)
EVT_THREAD
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_ADD(LW(1), 10)
EVT_ADD(LW(2), 10)
EVT_LOOP(3)
EVT_CALL(PlayEffect, 0x1, LW(0), LW(1), LW(2), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_WAIT_FRAMES(3)
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(SetPartFlagBits, -127, 1, 1, 1)
EVT_CALL(SetPartFlagBits, -127, 2, 1, 0)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_jr_troopa_default_dead_still)
EVT_CALL(GetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_SUB(LW(0), 5)
EVT_CALL(SetActorPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_WAIT_FRAMES(15)
EVT_CALL(PlaySound, SOUND_DEATH)
EVT_CALL(DropStarPoints, -127)
EVT_CALL(SetActorYaw, ACTOR_SELF, 0)
EVT_CALL(UseBattleCamPreset, 14)
EVT_CALL(SetBattleCamZoom, 260)
EVT_CALL(SetBattleCamOffsetZ, 15)
EVT_CALL(BattleCamTargetActor, ACTOR_SELF)
EVT_CALL(MoveBattleCamOver, 30)
EVT_CALL(PlaySoundAtActor, ACTOR_SELF, 0x20E5)
EVT_CALL(SetAnimation, ACTOR_SELF, 2, NPC_ANIM_jr_troopa_default_dead)
EVT_CALL(SetIdleAnimations, ACTOR_SELF, 2, EVT_ADDR(N(idleAnimations_80227F50)))
EVT_WAIT_FRAMES(60)
EVT_CALL(SetActorFlagBits, ACTOR_SELF, 4194304, 1)
EVT_RETURN
EVT_END
};
EvtSource N(8022A39C) = {
EVT_CALL(ResetAllActorSounds, ACTOR_SELF)
EVT_CALL(SetAnimation, ACTOR_SELF, 1, NPC_ANIM_spiked_para_jr_troopa_default_run)
EVT_CALL(SetActorSpeed, ACTOR_SELF, EVT_FLOAT(6.0))
EVT_CALL(SetActorJumpGravity, ACTOR_SELF, EVT_FLOAT(1.2001953125))
EVT_CALL(SetGoalToHome, ACTOR_SELF)
EVT_CALL(GetGoalPos, ACTOR_SELF, LW(0), LW(1), LW(2))
EVT_CALL(GetActorPos, ACTOR_SELF, LW(3), LW(4), LW(5))
EVT_SUB(LW(4), LW(1))
EVT_MULF(LW(4), EVT_FLOAT(0.30078125))
EVT_CALL(FlyToGoal, ACTOR_SELF, 0, LW(4), 0)
EVT_RETURN
EVT_END
};
EvtSource N(8022A480) = {
EVT_CALL(GetStatusFlags, ACTOR_SELF, LW(0))
EVT_IF_NOT_FLAG(LW(0), 0x35D000)
EVT_CALL(GetActorVar, -127, 2, LW(0))
EVT_IF_EQ(LW(0), 1)
EVT_CALL(SetActorVar, -127, 2, 0)
EVT_WAIT_FRAMES(10)
EVT_EXEC_WAIT(N(802284DC))
EVT_CALL(ActorSpeak, 1900954, -127, 1, 2293775, 2293763)
EVT_EXEC_WAIT(N(80228574))
EVT_END_IF
EVT_END_IF
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,79 @@
#include "common.h"
#include "battle/battle.h"
#define NAMESPACE b_area_kmr_part_3
extern ActorDesc N(jr_troopa);
extern ActorDesc N(egg_jr_troopa);
extern ActorDesc N(para_jr_troopa);
extern ActorDesc N(spiked_para_jr_troopa);
extern ActorDesc N(mage_jr_troopa);
extern ActorDesc N(final_jr_troopa);
extern ActorDesc N(paragoomba1);
extern ActorDesc N(paragoomba2);
extern ActorDesc N(spiked_goomba);
extern Stage N(kmr_02);
extern Stage N(kmr_03);
extern Stage N(kmr_04);
extern Stage N(kmr_05);
extern Stage N(kmr_06);
extern Stage N(nok_01);
extern Stage N(mim_01);
extern Stage N(sam_01);
extern Stage N(mac_01);
extern Stage N(kpa_01);
Formation N(formation_00) = {
{ .actor = &N(spiked_goomba), .home = { .index = 2 }, .priority = 0 },
};
Formation N(formation_01) = {
{ .actor = &N(paragoomba2), .home = { .index = 5 }, .priority = 10 },
{ .actor = &N(paragoomba1), .home = { .index = 6 }, .priority = 9 },
};
Formation N(formation_02) = {
{ .actor = &N(jr_troopa), .home = { .index = 2 }, .priority = 0 },
};
Formation N(formation_03) = {
{ .actor = &N(egg_jr_troopa), .home = { .index = 2 }, .priority = 0 },
};
Formation N(formation_04) = {
{ .actor = &N(para_jr_troopa), .home = { .index = 2 }, .priority = 0 },
};
Formation N(formation_05) = {
{ .actor = &N(spiked_para_jr_troopa), .home = { .index = 1 }, .priority = 0 },
};
Formation N(formation_06) = {
{ .actor = &N(mage_jr_troopa), .home = { .index = 2 }, .priority = 0 },
};
Formation N(formation_07) = {
{ .actor = &N(final_jr_troopa), .home = { .index = 2 }, .priority = 0 },
};
BattleList N(formationTable) = {
BATTLE("トゲクリボー(レクチャー)", N(formation_00), &N(kmr_03)),
BATTLE("パタクリボー(レクチャー)", N(formation_01), &N(kmr_03)),
BATTLE("コワッパ1", N(formation_02), &N(kmr_05)),
BATTLE("コワッパ2", N(formation_03), &N(nok_01)),
BATTLE("コワッパ4", N(formation_04), &N(mim_01)),
BATTLE("コワッパ5", N(formation_05), &N(mac_01)),
BATTLE("コワッパ6", N(formation_06), &N(sam_01)),
BATTLE("コワッパ7", N(formation_07), &N(kpa_01)),
{},
};
StageList N(stageTable) = {
{ "kmr_02", &N(kmr_02) },
{ "kmr_03", &N(kmr_03) },
{ "kmr_04", &N(kmr_04) },
{ "kmr_05", &N(kmr_05) },
{ "kmr_06", &N(kmr_06) },
{},
};

View File

@ -0,0 +1,23 @@
#include "common.h"
#include "battle/battle.h"
#define NAMESPACE b_area_kmr_part_3_kmr_02
EvtSource N(beforeBattle_802322D0) = {
EVT_CALL(SetSpriteShading, -1)
EVT_RETURN
EVT_END
};
EvtSource N(afterBattle_802322F0) = {
EVT_RETURN
EVT_END
};
Stage NAMESPACE = {
.texture = "kmr_tex",
.shape = "kmr_bt02_shape",
.bg = "kmr_bg",
.preBattle = N(beforeBattle_802322D0),
.postBattle = N(afterBattle_802322F0),
};

View File

@ -0,0 +1,37 @@
#include "common.h"
#include "battle/battle.h"
#define NAMESPACE b_area_kmr_part_3_kmr_03
#include "world/common/clouds.inc.c"
EvtSource N(beforeBattle_802326B8) = {
EVT_CALL(SetSpriteShading, -1)
EVT_SET(LW(0), 1)
EVT_SET(LW(2), 0)
EVT_EXEC(N(clouds1))
EVT_SET(LW(0), 4)
EVT_SET(LW(2), 70)
EVT_EXEC(N(clouds1))
EVT_RETURN
EVT_END
};
EvtSource N(afterBattle_80232730) = {
EVT_RETURN
EVT_END
};
s32 N(foregroundModelList_80232740)[] = {
0x00000027, 0x0000002B, 0x00000000,
};
Stage NAMESPACE = {
.texture = "kmr_tex",
.shape = "kmr_bt03_shape",
.hit = "kmr_bt03_hit",
.bg = "kmr_bg",
.preBattle = N(beforeBattle_802326B8),
.postBattle = N(afterBattle_80232730),
.foregroundModelList = N(foregroundModelList_80232740),
};

View File

@ -0,0 +1,37 @@
#include "common.h"
#include "battle/battle.h"
#define NAMESPACE b_area_kmr_part_3_kmr_04
#include "world/common/clouds.inc.c"
EvtSource N(beforeBattle_80232B08) = {
EVT_CALL(SetSpriteShading, -1)
EVT_SET(LW(0), 1)
EVT_SET(LW(2), 0)
EVT_EXEC(N(clouds1))
EVT_SET(LW(0), 4)
EVT_SET(LW(2), 70)
EVT_EXEC(N(clouds1))
EVT_RETURN
EVT_END
};
EvtSource N(afterBattle_80232B80) = {
EVT_RETURN
EVT_END
};
s32 N(foregroundModelList_80232B90)[] = {
0x00000024, 0x00000020, 0x00000000,
};
Stage NAMESPACE = {
.texture = "kmr_tex",
.shape = "kmr_bt04_shape",
.hit = "kmr_bt04_hit",
.bg = "kmr_bg",
.preBattle = N(beforeBattle_80232B08),
.postBattle = N(afterBattle_80232B80),
.foregroundModelList = N(foregroundModelList_80232B90),
};

View File

@ -0,0 +1,33 @@
#include "common.h"
#include "battle/battle.h"
#define NAMESPACE b_area_kmr_part_3_kmr_05
#include "world/common/clouds.inc.c"
EvtSource N(beforeBattle_80232F58) = {
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(EnableModel, 26, 0)
EVT_CALL(EnableModel, 29, 0)
EVT_RETURN
EVT_END
};
EvtSource N(afterBattle_80232FA0) = {
EVT_RETURN
EVT_END
};
s32 N(foregroundModelList_80232FB0)[] = {
0x00000020, 0x00000024, 0x00000000,
};
Stage NAMESPACE = {
.texture = "kmr_tex",
.shape = "kmr_bt05_shape",
.hit = "kmr_bt05_hit",
.bg = "kmr_bg",
.preBattle = N(beforeBattle_80232F58),
.postBattle = N(afterBattle_80232FA0),
.foregroundModelList = N(foregroundModelList_80232FB0),
};

View File

@ -0,0 +1,40 @@
#include "common.h"
#include "battle/battle.h"
#define NAMESPACE b_area_kmr_part_3_kmr_06
#include "world/common/clouds.inc.c"
#include "common/UnkFogFunc.inc.c"
EvtSource N(beforeBattle_80233378) = {
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(N(UnkFogFunc))
EVT_SET(LW(0), 1)
EVT_SET(LW(2), 0)
EVT_EXEC(N(clouds1))
EVT_SET(LW(0), 4)
EVT_SET(LW(2), 70)
EVT_EXEC(N(clouds1))
EVT_RETURN
EVT_END
};
EvtSource N(afterBattle_802333FC) = {
EVT_RETURN
EVT_END
};
s32 N(foregroundModelList_8023340C)[] = {
0x0000001D, 0x00000022, 0x00000021, 0x00000000,
};
Stage NAMESPACE = {
.texture = "kmr_tex",
.shape = "kmr_bt06_shape",
.hit = "kmr_bt06_hit",
.bg = "kmr_bg",
.preBattle = N(beforeBattle_80233378),
.postBattle = N(afterBattle_802333FC),
.foregroundModelList = N(foregroundModelList_8023340C),
};

View File

@ -0,0 +1,39 @@
#include "common.h"
#include "battle/battle.h"
#define NAMESPACE b_area_kmr_part_3_kpa_01
EvtSource N(80234CB0) = {
EVT_SET(LW(10), LW(0))
EVT_CALL(SetTexPanner, LW(10), 1)
EVT_SET(LW(0), 0)
EVT_SET(LW(1), 0)
EVT_LOOP(0)
EVT_CALL(SetTexPanOffset, 1, 0, LW(0), LW(1))
EVT_ADD(LW(0), 32768)
EVT_ADD(LW(1), 0)
EVT_WAIT_FRAMES(5)
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtSource N(beforeBattle_80234D60) = {
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(SetCamBGColor, 1, 0, 0, 0)
EVT_RETURN
EVT_END
};
EvtSource N(afterBattle_80234D9C) = {
EVT_RETURN
EVT_END
};
Stage NAMESPACE = {
.texture = "kpa_tex",
.shape = "kpa_bt13_shape",
.hit = "kpa_bt13_hit",
.preBattle = N(beforeBattle_80234D60),
.postBattle = N(afterBattle_80234D9C),
};

View File

@ -0,0 +1,292 @@
#include "common.h"
#include "battle/battle.h"
#define NAMESPACE b_area_kmr_part_3_mac_01
ApiStatus func_80219D60_4491A0(Evt* script, s32 isInitialCall);
INCLUDE_ASM(s32, "battle/area_kmr_part_3/448E80", func_80219D60_4491A0);
EvtSource N(80233AF0) = {
EVT_SET(LW(10), LW(0))
EVT_LABEL(0)
EVT_CALL(func_80219D60_4491A0, 0)
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), LW(2))
EVT_CALL(RotateModel, LW(10), -20, 0, 0, 1)
EVT_WAIT_FRAMES(1)
EVT_LOOP(0)
EVT_CALL(func_80219D60_4491A0, 1)
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), LW(2))
EVT_CALL(RotateModel, LW(10), -20, 0, 0, 1)
EVT_WAIT_FRAMES(1)
EVT_IF_EQ(LW(11), 1)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), LW(2))
EVT_CALL(RotateModel, LW(10), -7, 0, 0, 1)
EVT_WAIT_FRAMES(5)
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), LW(2))
EVT_CALL(RotateModel, LW(10), -27, 0, 0, 1)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), LW(2))
EVT_CALL(RotateModel, LW(10), -5, 0, 0, 1)
EVT_WAIT_FRAMES(3)
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), LW(2))
EVT_CALL(RotateModel, LW(10), -20, 0, 0, 1)
EVT_WAIT_FRAMES(5)
EVT_LOOP(0)
EVT_CALL(func_80219D60_4491A0, 2)
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), LW(2))
EVT_CALL(RotateModel, LW(10), -20, 0, 0, 1)
EVT_WAIT_FRAMES(1)
EVT_IF_EQ(LW(11), 2)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(RandInt, 80, LW(11))
EVT_ADD(LW(11), 30)
EVT_LOOP(LW(11))
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), LW(2))
EVT_CALL(RotateModel, LW(10), -20, 0, 0, 1)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(RandInt, 5, LW(0))
EVT_IF_NE(LW(0), 0)
EVT_GOTO(0)
EVT_END_IF
EVT_CALL(func_80219D60_4491A0, 3)
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), LW(2))
EVT_CALL(RotateModel, LW(10), -20, 0, 0, 1)
EVT_WAIT_FRAMES(1)
EVT_LOOP(0)
EVT_CALL(func_80219D60_4491A0, 1)
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), LW(2))
EVT_CALL(RotateModel, LW(10), -20, 0, 0, 1)
EVT_WAIT_FRAMES(1)
EVT_IF_EQ(LW(11), 1)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), LW(2))
EVT_CALL(RotateModel, LW(10), -7, 0, 0, 1)
EVT_WAIT_FRAMES(5)
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), LW(2))
EVT_CALL(RotateModel, LW(10), -27, 0, 0, 1)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), LW(2))
EVT_CALL(RotateModel, LW(10), -5, 0, 0, 1)
EVT_WAIT_FRAMES(3)
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), LW(2))
EVT_CALL(RotateModel, LW(10), -20, 0, 0, 1)
EVT_WAIT_FRAMES(5)
EVT_LOOP(0)
EVT_CALL(func_80219D60_4491A0, 2)
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), LW(2))
EVT_CALL(RotateModel, LW(10), -20, 0, 0, 1)
EVT_WAIT_FRAMES(1)
EVT_IF_EQ(LW(11), 2)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(RandInt, 80, LW(11))
EVT_ADD(LW(11), 30)
EVT_LOOP(LW(11))
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), LW(2))
EVT_CALL(RotateModel, LW(10), -20, 0, 0, 1)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtSource N(80234180) = {
EVT_SET(LW(10), LW(0))
EVT_LOOP(0)
EVT_CALL(TranslateModel, LW(10), 1, 0, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 1, 0, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 1, -1, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 2, -1, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 2, -1, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 2, -1, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 3, -2, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 3, -2, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 3, -3, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 3, -3, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 3, -3, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 3, -2, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 2, -2, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 2, -1, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 1, 0, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 1, 1, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, 1, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), -1, 1, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), -1, 1, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), -1, 0, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), -1, 0, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, 0, 0)
EVT_WAIT_FRAMES(2)
EVT_END_LOOP
EVT_RETURN
EVT_END
};
s32 N(intTable_80234524)[] = {
0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFE, 0xFFFFFFFD, 0xFFFFFFFB, 0xFFFFFFF8,
0xFFFFFFF8, 0xFFFFFFF9, 0xFFFFFFFA, 0xFFFFFFFC, 0xFFFFFFFE, 0xFFFFFFFF, 0x00000000, 0x000000FF,
};
EvtSource N(80234564) = {
EVT_SET(LW(10), LW(0))
EVT_SET(LW(11), LW(1))
EVT_SET(LW(5), 5)
EVT_USE_BUF(EVT_ADDR(N(intTable_80234524)))
EVT_LABEL(0)
EVT_BUF_READ1(LW(1))
EVT_IF_EQ(LW(1), 255)
EVT_USE_BUF(EVT_ADDR(N(intTable_80234524)))
EVT_BUF_READ1(LW(1))
EVT_END_IF
EVT_SET(LW(0), LW(5))
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), 0)
EVT_WAIT_FRAMES(1)
EVT_ADD(LW(5), 1)
EVT_SET(LW(12), LW(11))
EVT_SUB(LW(12), 20)
EVT_IF_GT(LW(5), LW(12))
EVT_GOTO(1)
EVT_END_IF
EVT_SET(LW(0), LW(5))
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), 0)
EVT_WAIT_FRAMES(1)
EVT_ADD(LW(5), 1)
EVT_SET(LW(12), LW(11))
EVT_SUB(LW(12), 20)
EVT_IF_GT(LW(5), LW(12))
EVT_GOTO(1)
EVT_END_IF
EVT_GOTO(0)
EVT_LABEL(1)
EVT_SET(LW(2), 0)
EVT_LOOP(20)
EVT_ADD(LW(5), 1)
EVT_SUB(LW(1), 2)
EVT_SET(LW(0), LW(5))
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), 0)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_SUB(LW(5), 280)
EVT_SET(LW(1), 0)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtSource N(802347D0) = {
EVT_SET(LW(10), LW(0))
EVT_LOOP(0)
EVT_CALL(TranslateModel, LW(10), 0, 0, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, 0, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, -1, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, -1, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, -1, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, -1, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, -2, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, -2, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, -3, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, -3, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, -3, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, -2, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, -2, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, -1, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, 0, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, 1, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, 1, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, 1, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, 1, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, 0, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, 0, 0)
EVT_WAIT_FRAMES(2)
EVT_CALL(TranslateModel, LW(10), 0, 0, 0)
EVT_WAIT_FRAMES(2)
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtSource N(beforeBattle_80234B74) = {
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(SetCamBGColor, 1, 0, 0, 0)
EVT_THREAD
EVT_SET(LW(0), 44)
EVT_EXEC(N(80234180))
EVT_WAIT_FRAMES(5)
EVT_SET(LW(0), 47)
EVT_EXEC(N(80234180))
EVT_WAIT_FRAMES(5)
EVT_SET(LW(0), 46)
EVT_EXEC(N(80234180))
EVT_WAIT_FRAMES(5)
EVT_SET(LW(0), 45)
EVT_EXEC(N(80234180))
EVT_END_THREAD
EVT_SET(LW(0), 40)
EVT_EXEC(N(80233AF0))
EVT_RETURN
EVT_END
};
EvtSource N(afterBattle_80234C70) = {
EVT_RETURN
EVT_END
};
Stage NAMESPACE = {
.texture = "mac_tex",
.shape = "mac_bt01_shape",
.hit = "mac_bt01_hit",
.bg = "nok_bg",
.preBattle = N(beforeBattle_80234B74),
.postBattle = N(afterBattle_80234C70),
};

View File

@ -0,0 +1,27 @@
#include "common.h"
#include "battle/battle.h"
#define NAMESPACE b_area_kmr_part_3_mim_01
#include "common/UnkFogFunc2.inc.c"
EvtSource N(beforeBattle_80233670) = {
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(N(UnkFogFunc2))
EVT_RETURN
EVT_END
};
EvtSource N(afterBattle_8023369C) = {
EVT_RETURN
EVT_END
};
Stage NAMESPACE = {
.texture = "mim_tex",
.shape = "mim_bt01_shape",
.hit = "mim_bt01_hit",
.preBattle = N(beforeBattle_80233670),
.postBattle = N(afterBattle_8023369C),
};

View File

@ -0,0 +1,60 @@
#include "common.h"
#include "battle/battle.h"
#define NAMESPACE b_area_kmr_part_3_nok_01
EvtSource N(80233450) = {
EVT_SET(LW(10), LW(0))
EVT_LABEL(0)
EVT_CALL(TranslateModel, LW(10), 0, 2, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(TranslateModel, LW(10), 0, 0, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(TranslateModel, LW(10), 0, 2, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(TranslateModel, LW(10), 0, 0, 0)
EVT_WAIT_FRAMES(5)
EVT_CALL(RandInt, 30, LW(0))
EVT_ADD(LW(0), 30)
EVT_WAIT_FRAMES(LW(0))
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtSource N(beforeBattle_80233558) = {
EVT_CALL(SetSpriteShading, -1)
EVT_SET(LW(0), 19)
EVT_EXEC(N(80233450))
EVT_SET(LW(0), 20)
EVT_EXEC(N(80233450))
EVT_SET(LW(0), 21)
EVT_EXEC(N(80233450))
EVT_SET(LW(0), 22)
EVT_EXEC(N(80233450))
EVT_SET(LW(0), 23)
EVT_EXEC(N(80233450))
EVT_SET(LW(0), 24)
EVT_EXEC(N(80233450))
EVT_RETURN
EVT_END
};
EvtSource N(afterBattle_80233620) = {
EVT_RETURN
EVT_END
};
s32 N(foregroundModelList_80233630)[] = {
0x0000001E, 0x0000001D, 0x0000001C, 0x00000000,
};
Stage NAMESPACE = {
.texture = "nok_tex",
.shape = "nok_bt01_shape",
.hit = "nok_bt01_hit",
.bg = "nok_bg",
.preBattle = N(beforeBattle_80233558),
.postBattle = N(afterBattle_80233620),
.foregroundModelList = N(foregroundModelList_80233630),
};

View File

@ -0,0 +1,117 @@
#include "common.h"
#include "battle/battle.h"
#define NAMESPACE b_area_kmr_part_3_sam_01
INCLUDE_ASM(s32, "battle/area_kmr_part_3/448E80", func_80219A40_448E80);
#include "common/Set80071270_0_16.inc.c"
#include "common/UnkFloatFunc2.inc.c"
s32 N(D_802336E0_43AB20)[] = {
0x00000000, 0x00000000, 0x00000000, 0x00000000,
};
EvtSource N(802336F0) = {
EVT_CALL(N(Set80071270_0_16))
EVT_LOOP(0)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtSource N(8023372C) = {
EVT_SET(LW(10), LW(0))
EVT_LABEL(0)
EVT_CALL(RandInt, 30, LW(0))
EVT_ADD(LW(0), 30)
EVT_WAIT_FRAMES(LW(0))
EVT_SET(LW(1), 0)
EVT_LOOP(10)
EVT_ADD(LW(1), 36)
EVT_CALL(RotateModel, LW(10), LW(1), 0, 1, 0)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtSource N(802337F4) = {
EVT_SET(LW(10), LW(0))
EVT_SET(LW(11), LW(1))
EVT_EXEC(N(8023372C))
EVT_SET(LW(7), 0)
EVT_LABEL(0)
EVT_ADD(LW(7), 4)
EVT_IF_GT(LW(7), 3599)
EVT_SUB(LW(7), 3600)
EVT_END_IF
EVT_CALL(N(UnkFloatFunc2), LW(7), LW(0), LW(1), LW(2))
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), LW(2))
EVT_WAIT_FRAMES(1)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtSource N(802338D4) = {
EVT_SET(LW(10), LW(0))
EVT_SET(LW(7), 0)
EVT_LABEL(0)
EVT_ADD(LW(7), 4)
EVT_IF_GT(LW(7), 3599)
EVT_SUB(LW(7), 3600)
EVT_END_IF
EVT_CALL(N(UnkFloatFunc2), LW(7), LW(0), LW(1), LW(2))
EVT_CALL(TranslateModel, LW(10), LW(0), LW(1), LW(2))
EVT_WAIT_FRAMES(1)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtSource N(beforeBattle_80233998) = {
EVT_CALL(SetSpriteShading, -1)
EVT_EXEC(N(802336F0))
EVT_THREAD
EVT_SET(LW(0), 22)
EVT_SET(LW(1), 1)
EVT_EXEC(N(802337F4))
EVT_WAIT_FRAMES(5)
EVT_SET(LW(0), 20)
EVT_SET(LW(1), 3)
EVT_EXEC(N(802337F4))
EVT_WAIT_FRAMES(5)
EVT_SET(LW(0), 18)
EVT_SET(LW(1), 4)
EVT_EXEC(N(802337F4))
EVT_WAIT_FRAMES(5)
EVT_SET(LW(0), 16)
EVT_SET(LW(1), 2)
EVT_EXEC(N(802337F4))
EVT_END_THREAD
EVT_RETURN
EVT_END
};
EvtSource N(afterBattle_80233AA8) = {
EVT_RETURN
EVT_END
};
s32 N(foregroundModelList_80233AB8)[] = {
0xFFFFFFFF, 0x0000001A, 0x00000000,
};
Stage NAMESPACE = {
.texture = "sam_tex",
.shape = "sam_bt01_shape",
.hit = "sam_bt01_hit",
.bg = "yki_bg",
.preBattle = N(beforeBattle_80233998),
.postBattle = N(afterBattle_80233AA8),
.foregroundModelList = N(foregroundModelList_80233AB8),
};

View File

@ -13,6 +13,9 @@ extern StageList b_area_kmr_part_1_stageTable;
extern BattleList b_area_kmr_part_2_formationTable;
extern StageList b_area_kmr_part_2_stageTable;
extern BattleList b_area_kmr_part_3_formationTable;
extern StageList b_area_kmr_part_3_stageTable;
BattleArea gBattleAreas[0x30] = {
{
AREA(area_kmr_part_1),
@ -29,8 +32,8 @@ BattleArea gBattleAreas[0x30] = {
{
AREA(area_kmr_part_3),
.name = "エリア その3",
.battles = 0x8021A2AC,
.stages = 0x8021A360,
.battles = b_area_kmr_part_3_formationTable,
.stages = b_area_kmr_part_3_stageTable,
},
{
AREA(area_mac),

View File

@ -1,5 +1,4 @@
#include "common.h"
#include "npc.h"
ApiStatus N(Dist3D)(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;

View File

@ -1,4 +1,5 @@
#include "common.h"
#include "effects.h"
ApiStatus N(Set80071270_0_16)(Evt* script, s32 isInitialCall) {
playFX_45(0, 0x10);

View File

@ -1,5 +1,4 @@
#include "common.h"
#include "npc.h"
ApiStatus N(SetBackgroundAlpha)(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;

View File

@ -131,7 +131,7 @@ def browse_header(valid_enums, enums):
if "=" in name:
name, val = name.split(" = ")
val = int(val[:-1], 0)
if val >= 0x80000000:
if val > 0x80000000:
val -= 0x100000000
else:
name = name[:-1]
@ -167,7 +167,7 @@ def get_constants():
include_path = Path(Path(__file__).resolve().parent.parent / "include")
enums = Path(include_path / "enums.h").read_text().splitlines()
browse_header(valid_enums, enums)
include_path = Path(Path(__file__).resolve().parent.parent / "src" / "battle")
enums = Path(include_path / "battle.h").read_text().splitlines()
browse_header(valid_enums, enums)
@ -283,7 +283,7 @@ def fix_args(self, func, args, info):
call = f"0x{argNum:X}"
else:
call = make_anim_macro(self, sprite, palette, anim)
except KeyError:
except ValueError:
call = f"0x{argNum:06X}"
new_args.append(call)
elif info[i] == "CustomMsg":
@ -321,7 +321,19 @@ def fix_args(self, func, args, info):
enabled.append(f"0x{flag:08X}")
if not enabled:
enabled.append(f"0")
new_args.append("((" + " | ".join(enabled) + "))")
new_args.append(enabled[0] if len(enabled) == 1 else "(" + " | ".join(enabled) + ")")
elif info[i] == "ActorFlags":
enabled = []
for x in range(32):
flag = argNum & (1 << x)
if flag:
if flag in CONSTANTS["ActorFlags"]:
enabled.append(CONSTANTS["ActorFlags"][flag])
else:
enabled.append(f"0x{flag:08X}")
if not enabled:
enabled.append(f"0")
new_args.append(enabled[0] if len(enabled) == 1 else "(" + " | ".join(enabled) + ")")
elif info[i] == "SoundIDs":
if argNum in CONSTANTS["SoundIDs"]:
new_args.append(CONSTANTS["SoundIDs"][argNum])
@ -462,7 +474,7 @@ replace_funcs = {
"FlyToGoal" :{0:"ActorIDs"},
"SetActorPos" :{0:"ActorIDs"},
"HPBarToCurrent" :{0:"ActorIDs"},
"SetActorFlagBits" :{0:"ActorIDs"}, # TODO: 1:"ActorFlags"
"SetActorFlagBits" :{0:"ActorIDs", 1:"ActorFlags"},
"SetPartFlags" :{0:"ActorIDs"},
"SetPartPos" :{0:"ActorIDs"},
"SetPartDispOffset" :{0:"ActorIDs"},

View File

@ -713,23 +713,23 @@ def disassemble(bytes, midx, symbol_map={}, comments=True, romstart=0, namespace
out += " { "
if actor in symbol_map:
out += f"&{symbol_map[actor][0][1]}, "
out += f".actor = &{symbol_map[actor][0][1]}, "
s = f"ActorDesc {symbol_map[actor][0][1]};"
if s not in INCLUDES_NEEDED["forward"]:
INCLUDES_NEEDED["forward"].append(s)
else:
out += f"{actor}, "
out += f".actor = {actor}, "
if position in symbol_map:
out += f".pos = {{ .vec = &{symbol_map[position][0][1]} }}"
out += f".home = {{ .vec = &{symbol_map[position][0][1]} }}"
s = f"Vec3f {symbol_map[position][0][1]};"
if s not in INCLUDES_NEEDED["forward"]:
INCLUDES_NEEDED["forward"].append(s)
else:
out += f".pos = {{ .index = {position} }}"
out += f".home = {{ .index = {position} }}"
out += f", .priority = {priority}"
@ -754,7 +754,7 @@ def disassemble(bytes, midx, symbol_map={}, comments=True, romstart=0, namespace
else:
out += " BATTLE("
out += f"{symbol_map[name][0][1]}, "
out += f"&{symbol_map[ptr][0][1]}, "
out += f"{symbol_map[ptr][0][1]}, "
out += f"&{symbol_map[stage_ptr][0][1]}"
out += "),\n"
@ -829,17 +829,12 @@ def disassemble(bytes, midx, symbol_map={}, comments=True, romstart=0, namespace
element = disasm_script.CONSTANTS["Statuses"][element]
sprite_id = (anim & 0x00FF0000) >> 16
palette_id = (anim & 0x0000FF00) >> 8
anim_id = (anim & 0x000000FF) >> 0
value = (anim & 0x00FFFFFF)
try:
sprite = disasm_script.CONSTANTS["NPC_SPRITE"][sprite_id]["name"]
palette = disasm_script.CONSTANTS["NPC_SPRITE"][sprite_id]["palettes"][palette_id]
anim = disasm_script.CONSTANTS["NPC_SPRITE"][sprite_id]["anims"][anim_id]
anim = f"NPC_ANIM_{sprite}_{palette}_{anim}"
INCLUDES_NEEDED["sprites"].add(sprite)
except KeyError:
if value in disasm_script.CONSTANTS["NPC_SPRITE"]:
INCLUDES_NEEDED["sprites"].add(disasm_script.CONSTANTS['NPC_SPRITE'][str(value) + ".h"])
anim = disasm_script.CONSTANTS['NPC_SPRITE'][value]
else:
anim = f"{anim:06X}"
out += f" {element}, "

File diff suppressed because one or more lines are too long

View File

@ -19,8 +19,8 @@ glabel func_80219A40_448E80
/* 448EB8 80219A78 8FA20018 */ lw $v0, 0x18($sp)
/* 448EBC 80219A7C 18400052 */ blez $v0, .L80219BC8
/* 448EC0 80219A80 0000802D */ daddu $s0, $zero, $zero
/* 448EC4 80219A84 3C038023 */ lui $v1, %hi(D_802336E0_462B20)
/* 448EC8 80219A88 246336E0 */ addiu $v1, $v1, %lo(D_802336E0_462B20)
/* 448EC4 80219A84 3C038023 */ lui $v1, %hi(b_area_kmr_part_3_sam_01_D_802336E0_43AB20)
/* 448EC8 80219A88 246336E0 */ addiu $v1, $v1, %lo(b_area_kmr_part_3_sam_01_D_802336E0_43AB20)
/* 448ECC 80219A8C 00161040 */ sll $v0, $s6, 1
/* 448ED0 80219A90 0043A021 */ addu $s4, $v0, $v1
/* 448ED4 80219A94 3C135555 */ lui $s3, 0x5555
@ -115,8 +115,8 @@ glabel func_80219A40_448E80
/* 449028 80219BE8 0C0470BB */ jal mdl_get_copied_gfx
/* 44902C 80219BEC AE020000 */ sw $v0, ($s0)
/* 449030 80219BF0 AE020004 */ sw $v0, 4($s0)
/* 449034 80219BF4 3C028023 */ lui $v0, %hi(D_802336E0_462B20)
/* 449038 80219BF8 244236E0 */ addiu $v0, $v0, %lo(D_802336E0_462B20)
/* 449034 80219BF4 3C028023 */ lui $v0, %hi(b_area_kmr_part_3_sam_01_D_802336E0_43AB20)
/* 449038 80219BF8 244236E0 */ addiu $v0, $v0, %lo(b_area_kmr_part_3_sam_01_D_802336E0_43AB20)
/* 44903C 80219BFC 00161840 */ sll $v1, $s6, 1
/* 449040 80219C00 00621821 */ addu $v1, $v1, $v0
/* 449044 80219C04 94620000 */ lhu $v0, ($v1)

View File

@ -3746,19 +3746,30 @@ segments:
type: code
start: 0x447440
vram: 0x80218000
subalign: 4
overlay: True
subsegments:
- [0x447440, c]
- [0x4479A0, c]
- [0x447C80, c]
- [0x447D50, c]
- [0x448420, c]
- [0x448690, c]
- [0x448900, c]
- [0x448B70, c]
- [0x448E20, c]
- [0x448E80, c]
- [0x4495F0, data]
- [0x447440, c, area]
- [0x447440, c, actor/spiked_goomba]
- [0x4476C0, c, actor/paragoomba]
- [0x4479A0, c, actor/paragoomba2]
- [0x447C80, c, actor/jr_troopa]
- [0x447C80, c, actor/egg_jr_troopa]
- [0x447C80, c, actor/para_jr_troopa]
- [0x447D50, c, actor/spiked_para_jr_troopa]
- [0x447F10, c, actor/mage_jr_troopa]
- [0x447F10, c, actor/final_jr_troopa]
- [0x448420, c, stage/kmr_02]
- [0x448420, c, stage/kmr_03]
- [0x448690, c, stage/kmr_04]
- [0x448900, c, stage/kmr_05]
- [0x448B70, c, stage/kmr_06]
- [0x448E20, c, stage/nok_01]
- [0x448E20, c, stage/mim_01]
- [0x448E80, c, stage/sam_01]
- [0x4491A0, c, stage/mac_01]
- [0x4495F0, c, stage/kpa_01]
- [0x4495F0]
- dir: battle/area_mac
type: code
start: 0x464490