diff --git a/include/functions.h b/include/functions.h index 7626230faa..bbed180d3f 100644 --- a/include/functions.h +++ b/include/functions.h @@ -187,7 +187,7 @@ s32 func_80086620(OSMesgQueue* param_1, PadmgrThreadStruct* param_2, OSContStatu // void func_80086AF0(void); // void func_80086B30(void); // void func_80086C18(void); -// void func_80086C48(void); +f32 func_80086C48(f32 param_1); // void func_80086C70(void); f64 func_80086C7C(f64 param_1); s32 func_80086C88(f32 param_1); @@ -597,25 +597,35 @@ s16 func_800B09D0(s16 a0, s16 a1, f32 a2); u8 func_800B0A24(u8 a0, u8 a1, f32 a2); void EffectSs_DrawGEffect(GlobalContext* globalCtx, EffectSs* this, void* texture); void EffectSsDust_Spawn(GlobalContext* globalCtx, u16 drawFlags, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life, u8 updateMode); -// void func_800B0DE0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8); -// void func_800B0E48(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8); -// void func_800B0EB0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8, UNK_TYPE2 param_9); -// void func_800B0F18(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8, UNK_TYPE2 param_9); +void func_800B0DE0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, + Color_RGBA8* envColor, s16 scale, s16 scaleStep); +void func_800B0E48(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, + Color_RGBA8* envColor, s16 scale, s16 scaleStep); +void func_800B0EB0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, + Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life); +void func_800B0F18(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, + Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life); void func_800B0F80(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life); -// void func_800B0FE8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8); -// void func_800B1054(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8); -// void func_800B10C0(void); -// void func_800B1130(void); -// void func_800B11A0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6); -// void func_800B1210(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6); -// void func_800B1280(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7); -// void func_800B12F0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7); -// void func_800B1360(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); -// void func_800B139C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); -// void func_800B13D8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); -// void func_800B14D4(void); -// void func_800B1598(void); +void func_800B0FE8(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, + Color_RGBA8* envColor, s16 scale, s16 scaleStep); +void func_800B1054(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, + Color_RGBA8* envColor, s16 scale, s16 scaleStep); +void func_800B10C0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel); +void func_800B1130(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel); +void func_800B11A0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep); +void func_800B1210(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep); +void func_800B1280(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, + s16 life); +void func_800B12F0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, + s16 life); +void func_800B1360(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, + Color_RGBA8* envColor); +void func_800B139C(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, + Color_RGBA8* envColor); +void func_800B13D8(Vec3f* srcPos, f32 randScale, Vec3f* newPos, Vec3f* velocity, Vec3f* accel); +void func_800B14D4(GlobalContext* globalCtx, f32 randScale, Vec3f* srcPos); +void func_800B1598(GlobalContext* globalCtx, f32 randScale, Vec3f* srcPos); void EffectSsKiraKira_SpawnSmallYellow (GlobalContext * globalCtx, Vec3f * pos, Vec3f * velocity, Vec3f * accel); void EffectSsGSpk_SpawnSmall(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor); @@ -770,7 +780,7 @@ float func_800B6FC8(ActorPlayer* player); // void func_800B71DC(void); u32 func_800B7200(s32 param_1); // void func_800B722C(void); -// UNK_TYPE4 func_800B724C(GlobalContext* globalCtx, UNK_TYPE4 param_2, u8 param_3); +void func_800B724C(GlobalContext* globalCtx, Actor* actor, u8 param_3); u32 func_800B7298(GlobalContext* globalCtx, UNK_TYPE4 param_2, u8 param_3); void func_800B72E0(s32 param_1); void func_800B72F8(DynaPolyActor* dpactor, f32 a1, s16 a2); @@ -858,14 +868,14 @@ void Actor_FreeOverlay(ActorOverlay* entry); Actor* Actor_Spawn(ActorContext* actCtxt, GlobalContext* globalCtx, s16 index, f32 x, f32 y, f32 z, s16 rotX, s16 rotY, s16 rotZ, s16 sParm10); ActorInit* Actor_LoadOverlay(ActorContext* actCtxt, s16 index); Actor* Actor_SpawnWithParentAndCutscene(ActorContext* actCtxt, GlobalContext* globalCtx, s16 index, f32 x, f32 y, f32 z, s16 rotX, s16 rotY, s16 rotZ, s16 variable, u32 cutscene, s32 param_12, Actor* parent); -void Actor_SpawnWithParent(ActorContext* actCtxt, Actor* parent, GlobalContext* globalCtx, s16 index, f32 x, f32 y, f32 z, s16 rotX, s16 rotY, s16 rotZ, s16 variable); +Actor* Actor_SpawnWithParent(ActorContext* actCtxt, Actor* parent, GlobalContext* globalCtx, s16 index, f32 x, f32 y, f32 z, s16 rotX, s16 rotY, s16 rotZ, s16 variable); void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actCtxt); void func_800BB2D0(ActorContext* aCtxt, u16* param_2, GlobalContext* globalCtx); Actor* func_800BB498(ActorContext* actCtxt, Actor* actor, GlobalContext* globalCtx); // void func_800BB59C(void); // void func_800BB604(void); // void func_800BB8EC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); -void func_800BBA88(GlobalContext* globalCtx, Actor* iParm2); +void func_800BBA88(GlobalContext* globalCtx, Actor* actor); // void func_800BBAC0(void); void func_800BBB74(s16* arg1, UNK_TYPE1 arg2, UNK_TYPE1 arg3, UNK_TYPE4 arg4); // void func_800BBC20(void); @@ -875,7 +885,7 @@ void func_800BBFB0(GlobalContext* globalCtx, Vec3f* position, f32 param3, s32 pa void func_800BC154(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actor, u8 actorCategory); // void func_800BC188(void); // void func_800BC1B4(void); -// void func_800BC270(void); +Actor* func_800BC270(GlobalContext* globalCtx, Actor* actor, f32 arg2, UNK_TYPE4 arg3); // void func_800BC444(void); // void func_800BC4EC(void); // void func_800BC5B8(void); @@ -886,7 +896,7 @@ void func_800BC154(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* acto // void func_800BC848(void); // void func_800BC8B8(void); // void func_800BCB50(void); -// void func_800BCB70(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5); +void func_800BCB70(Actor* actor, s16 arg1, u8 arg2, u8 arg3, u8 arg4); void func_800BCBF4(Vec3f* uParm1, GlobalContext* globalCtx); void func_800BCC68(Vec3f* param_1, GlobalContext* globalCtx); // void func_800BCCDC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); @@ -905,17 +915,17 @@ void func_800BDFC0(GlobalContext* globalCtx, Gfx* dl); void func_800BE03C(GlobalContext* globalCtx, Gfx* dl); // void func_800BE0B8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); // void func_800BE184(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6); -// void func_800BE22C(void); +u8 func_800BE22C(Actor* actor); // void func_800BE258(void); // void func_800BE2B8(void); // void func_800BE33C(void); // void func_800BE3D0(void); // void func_800BE504(void); // void func_800BE568(void); -// void func_800BE5CC(void); +void func_800BE5CC(Actor* actor, ColliderJntSph* collider, UNK_TYPE1 arg2); // void func_800BE63C(void); -// void func_800BE680(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE1 param_8); -// void func_800BF7CC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7); +void func_800BE680(GlobalContext* globalCtx, Actor* actor, Vec3f* param_3, s32 param_4, f32 param_5, f32 param_6, f32 param_7, u8 mode); +void func_800BF7CC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, s32 arg3, s32 arg4, f32 arg5, f32 arg6); void ActorOverlayTable_FaultPrint(void* arg0, void* arg1); // ActorOverlayTable_FaultPrint void* ActorOverlayTable_FaultAddrConv(void* arg0, void* arg1); // ActorOverlayTable_FaultAddrConv void ActorOverlayTable_Init(void); // ActorOverlayTable_Init @@ -3029,7 +3039,7 @@ void func_80169590(GlobalContext* globalCtx, s16 param_2, s16 param_3); void func_80169600(GlobalContext* globalCtx, s16 param_2); // void func_80169668(void); Camera* Play_GetCamera(GlobalContext* globalCtx, s16 index); -// void func_8016970C(void); +s32 func_8016970C(GlobalContext* globalCtx, s16 camId, Vec3f* focalPoint, Vec3f* eye); // void func_8016981C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); // void func_80169940(void); // void func_80169988(void); @@ -3912,8 +3922,8 @@ void func_801A246C(u8 param_1, u8 param_2); // void func_801A2C88(void); // void func_801A2D54(void); s32 func_801A2DE0(UNK_TYPE4 arg1); -// void func_801A2E54(void); -// void func_801A2ED8(void); +void func_801A2E54(s32 param_1); +void func_801A2ED8(void); // void func_801A2F88(void); // void func_801A3000(void); // void func_801A3038(void); diff --git a/linker_scripts/code_script.txt b/linker_scripts/code_script.txt index 5aa410749a..c04a668ceb 100644 --- a/linker_scripts/code_script.txt +++ b/linker_scripts/code_script.txt @@ -913,9 +913,9 @@ SECTIONS ovl_En_Pametfrog : AT(RomLocation) { build/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.o(.text) - build/asm/overlays/ovl_En_Pametfrog_data.o(.data) + build/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.o(.data) build/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.o(.rodata) - build/asm/overlays/ovl_En_Pametfrog_rodata.o(.rodata) + build/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog_overlay.o(.ovl) } SegmentEnd = .; SegmentSize = SegmentEnd - SegmentStart; diff --git a/linker_scripts/object_script.txt b/linker_scripts/object_script.txt index b34e252b88..9451eddbbc 100644 --- a/linker_scripts/object_script.txt +++ b/linker_scripts/object_script.txt @@ -158,6 +158,29 @@ D_06000E50 = 0x06000E50; D_06007908 = 0x06007908; D_060011C0 = 0x060011C0; +/* en_pametfrog */ +D_06000994 = 0x06000994; +D_06001B08 = 0x06001B08; +D_06001E14 = 0x06001E14; +D_06001F20 = 0x06001F20; +D_060030E4 = 0x060030E4; +D_0600347C = 0x0600347C; +D_060039C4 = 0x060039C4; +D_06003F28 = 0x06003F28; +D_06004298 = 0x06004298; +D_06004680 = 0x06004680; +D_06004894 = 0x06004894; +D_06004D50 = 0x06004D50; +D_060050B8 = 0x060050B8; +D_060052EC = 0x060052EC; +D_06005694 = 0x06005694; +D_06005D54 = 0x06005D54; +D_060066B4 = 0x060066B4; +D_060070C4 = 0x060070C4; +D_0600DF98 = 0x0600DF98; +D_0600F990 = 0x0600F990; +D_0600F048 = 0x0600F048; + /* z_en_dy_extra */ D_0600DD40 = 0x0600DD40; D_0600DEF0 = 0x0600DEF0; diff --git a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.h b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.h index e8f561f78d..9d5d40fcbb 100644 --- a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.h +++ b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.h @@ -7,7 +7,9 @@ struct EnBigpamet; typedef struct EnBigpamet { /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x488]; + /* 0x144 */ char unk_144[0x168]; + /* 0x2AC */ f32 unk_2AC; + /* 0x2B0 */ char unk_2B0[0x31C]; } EnBigpamet; // size = 0x5CC extern const ActorInit En_Bigpamet_InitVars; diff --git a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c index 68711c852a..6c24f1f8d7 100644 --- a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c +++ b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c @@ -1,4 +1,11 @@ +/* + * File: z_en_pametfrog.c + * Overlay: En_Pametfrog + * Description: Gekko & Snapper Miniboss: Gekko + */ + #include "z_en_pametfrog.h" +#include "src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.h" #define FLAGS 0x00000035 @@ -9,7 +16,76 @@ void EnPametfrog_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnPametfrog_Update(Actor* thisx, GlobalContext* globalCtx); void EnPametfrog_Draw(Actor* thisx, GlobalContext* globalCtx); -/* +void EnPametfrog_JumpWaterEffects(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_RearOnSnapper(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_RearOnSnapperWave(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupRearOnSnapperWave(EnPametfrog* this); +void EnPametfrog_RearOnSnapperWave(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupRearOnSnapperRise(EnPametfrog* this); +void EnPametfrog_RearOnSnapperRise(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_FallOffSnapper(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupJumpToWall(EnPametfrog* this); +void EnPametfrog_JumpToWall(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupWallCrawl(EnPametfrog* this); +void EnPametfrog_WallCrawl(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupWallPause(EnPametfrog* this); +void EnPametfrog_WallPause(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupClimbDownWall(EnPametfrog* this); +void EnPametfrog_ClimbDownWall(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupRunToSnapper(EnPametfrog* this); +void EnPametfrog_RunToSnapper(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupJumpOnSnapper(EnPametfrog* this); +void EnPametfrog_JumpOnSnapper(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupLandOnSnapper(EnPametfrog* this); +void EnPametfrog_LandOnSnapper(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_FallInAir(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_FallOnGround(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupFallOnGround(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupDefeatGekko(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_DefeatGekko(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupDefeatSnapper(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_DefeatSnapper(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupSpawnFrog(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SpawnFrog(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_PlayCutscene(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupLookAround(EnPametfrog* this); +void EnPametfrog_LookAround(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupJumpToLink(EnPametfrog* this); +void EnPametfrog_JumpToLink(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupMeleeAttack(EnPametfrog* this); +void EnPametfrog_MeleeAttack(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupCutscene(EnPametfrog* this); +void func_8086CC04(EnPametfrog* this, GlobalContext* globalCtx); +void func_8086CD04(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupCallSnapper(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_CallSnapper(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupSnapperSpawn(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SnapperSpawn(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_SetupTransitionGekkoSnapper(EnPametfrog* this, GlobalContext* globalCtx); +void EnPametfrog_TransitionGekkoSnapper(EnPametfrog* this, GlobalContext* globalCtx); + +extern AnimationHeader D_06000994; // Begin Rear on Snapper +extern AnimationHeader D_06001B08; // Call Snapper +extern AnimationHeader D_06001E14; // Crawl on Wall +extern AnimationHeader D_06001F20; // Falling +extern AnimationHeader D_060030E4; // Get up from Back +extern AnimationHeader D_0600347C; // Jab Punch +extern AnimationHeader D_060039C4; // Jump on Ground +extern AnimationHeader D_06003F28; // Kick +extern AnimationHeader D_06004298; // Fall on Back +extern AnimationHeader D_06004680; // Idle +extern AnimationHeader D_06004894; // Jump on Snapper +extern AnimationHeader D_06004D50; // Continue Rear on Snapper +extern AnimationHeader D_060050B8; // Squeeze Body +extern AnimationHeader D_060052EC; // Land on Snapper +extern AnimationHeader D_06005694; // Wiggle +extern AnimationHeader D_06005D54; // Head Knockback +extern AnimationHeader D_060066B4; // Look Around +extern AnimationHeader D_060070C4; // Hook Punch +extern FlexSkeletonHeader D_0600DF98; +extern AnimationHeader D_0600F048; // Windup Punch +extern AnimationHeader D_0600F990; // Melee Ready Stance + const ActorInit En_Pametfrog_InitVars = { ACTOR_EN_PAMETFROG, ACTORCAT_BOSS, @@ -21,144 +97,1290 @@ const ActorInit En_Pametfrog_InitVars = { (ActorFunc)EnPametfrog_Update, (ActorFunc)EnPametfrog_Draw, }; -*/ -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/EnPametfrog_Init.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/EnPametfrog_Destroy.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_80869FBC.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086A024.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086A068.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086A0F4.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086A1A0.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086A238.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086A2CC.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086A428.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086A4E4.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086A554.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086A6B0.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086A724.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086A80C.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086A878.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086A8C0.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086A964.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086AA60.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086AAA8.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086AB04.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086AB68.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086AC0C.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086AD34.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086AE48.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086AEC8.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086AFC8.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086B140.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086B478.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086B570.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086B66C.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086B794.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086B864.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086B8CC.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086B9D0.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086BA6C.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086BB4C.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086BB9C.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086BBE0.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086BDA8.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086BE60.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086BEEC.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086BF90.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086C088.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086C0CC.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086C1AC.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086C274.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086C4B8.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086C5A8.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086C618.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086C6D0.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086C72C.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086C7C8.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086C81C.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086C94C.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086C99C.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086CB4C.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086CC04.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086CC84.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086CD04.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086CD6C.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086CEB4.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086CEF0.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086D084.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086D140.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086D1E8.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086D230.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/EnPametfrog_Update.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/func_8086D730.asm") - -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Pametfrog_0x80869D90/EnPametfrog_Draw.asm") +static DamageTable sDamageTable = { + 0x10, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x10, 0x01, 0x01, 0x01, 0x22, 0x32, 0x42, 0x01, 0x10, + 0x01, 0x02, 0x10, 0x50, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +}; + +static ColliderJntSphElementInit sJntSphElementsInit[2] = { + { + { + ELEMTYPE_UNK1, + { 0xF7CFFFFF, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 32 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xF7CFFFFF, 0x00, 0x04 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_WOOD, + BUMP_NONE, + OCELEM_NONE, + }, + { 1, { { 0, 0, 0 }, 25 }, 100 }, + }, +}; + +static ColliderJntSphInit sJntSphInit = { + { + COLTYPE_HIT6, + AT_NONE | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 2, + sJntSphElementsInit, +}; + +static CollisionCheckInfoInit sColChkInit = { 3, 30, 60, 50 }; + +static InitChainEntry sInitChain[] = { + ICHAIN_S8(hintId, 69, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(targetArrowOffset, -13221, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_CONTINUE), + ICHAIN_VEC3F_DIV1000(scale, 7, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 10, ICHAIN_STOP), +}; + +// gSaveContext.weekEventReg[KEY] = VALUE +// KEY | VALUE +static s32 isFrogReturnedFlags[] = { + (32 << 8) | 0x40, // Woodfall Temple Frog Returned + (32 << 8) | 0x80, // Great Bay Temple Frog Returned + (33 << 8) | 0x01, // Southern Swamp Frog Returned + (33 << 8) | 0x02, // Laundry Pool Frog Returned +}; + +void EnPametfrog_Init(Actor* thisx, GlobalContext* globalCtx) { + EnPametfrog* this = THIS; + s32 i; + + Actor_ProcessInitChain(&this->actor, sInitChain); + ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 55.0f); + CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInit); + SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600DF98, &D_0600F990, this->limbDrawTable, + this->transitionDrawTable, 24); + Collider_InitAndSetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colElement); + this->params = CLAMP(this->actor.params, 1, 4); + if (Actor_GetRoomCleared(globalCtx, globalCtx->roomContext.currRoom.num)) { + Actor_MarkForDeath(&this->actor); + if (!(gSaveContext.weekEventReg[isFrogReturnedFlags[this->actor.params - 1] >> 8] & + (u8)isFrogReturnedFlags[this->actor.params - 1])) { + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_MINIFROG, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, this->params); + } + } else { + for (i = 0; i < 2; i++) { + this->collider.elements[i].dim.worldSphere.radius = this->collider.elements[i].dim.modelSphere.radius; + } + + if (Actor_SpawnWithParent(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_BIGPAMET, + this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, + 0) == NULL) { + Actor_MarkForDeath(&this->actor); + } else { + this->actor.params = ENPAMETFROG_PRE_SNAPPER; + EnPametfrog_SetupLookAround(this); + } + } +} + +void EnPametfrog_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnPametfrog* this = THIS; + + Collider_DestroyJntSph(globalCtx, &this->collider); +} + +u8 EnPametfrog_Vec3fNormalize(Vec3f* vec) { + f32 magnitude = Math3D_Vec3fMagnitude(vec); + + if (magnitude < 0.0001f) { + return false; + } else { + Math_Vec3f_Scale(vec, 1.0f / magnitude); + return true; + } +} + +void func_8086A024(EnPametfrog* this) { + this->mode = 10; + this->collider.base.colType = COLTYPE_HIT3; + this->collider.elements->info.elemType = ELEMTYPE_UNK0; + this->unk_2C8 = 0.75f; + this->unk_2CC = 1.125f; + this->unk_2C4 = 1.0f; +} + +void func_8086A068(EnPametfrog* this, GlobalContext* globalCtx) { + this->freezeTimer = 0; + if (this->mode == 10) { + this->mode = 0; + this->collider.base.colType = COLTYPE_HIT6; + this->collider.elements->info.elemType = ELEMTYPE_UNK1; + this->unk_2C4 = 0.0f; + func_800BF7CC(globalCtx, &this->actor, &this->unk_2F4[0], 12, 2, 0.3f, 0.2f); + } +} + +void EnPametfrog_JumpWaterEffects(EnPametfrog* this, GlobalContext* globalCtx) { + Vec3f pos; + + if (this->actor.yDistToWater > 0.0f) { + pos.x = this->actor.world.pos.x; + pos.z = this->actor.world.pos.z; + pos.y = this->actor.world.pos.y + this->actor.yDistToWater; + EffectSsGRipple_Spawn(globalCtx, &pos, 150, 550, 0); + pos.y += 8.0f; + EffectSsGSplash_Spawn(globalCtx, &pos, NULL, NULL, 0, 550); + } +} + +void EnPametfrog_IdleWaterEffects(EnPametfrog* this, GlobalContext* globalCtx) { + Vec3f pos; + + if ((this->actor.yDistToWater > 0.0f) && ((globalCtx->gameplayFrames % 14) == 0)) { + pos.x = this->actor.world.pos.x; + pos.z = this->actor.world.pos.z; + pos.y = this->actor.world.pos.y + this->actor.yDistToWater; + EffectSsGRipple_Spawn(globalCtx, &pos, 150, 550, 0); + } +} + +void func_8086A238(EnPametfrog* this) { + MtxF unkMtx; + + unkMtx.xx = this->unk_2E8.x; + unkMtx.xy = this->unk_2E8.y; + unkMtx.xz = this->unk_2E8.z; + unkMtx.yx = this->unk_2DC.x; + unkMtx.yy = this->unk_2DC.y; + unkMtx.yz = this->unk_2DC.z; + unkMtx.zx = this->unk_2D0.x; + unkMtx.zy = this->unk_2D0.y; + unkMtx.zz = this->unk_2D0.z; + + func_8018219C(&unkMtx, &this->actor.shape.rot, 0); + this->actor.world.rot.x = -this->actor.shape.rot.x; + this->actor.world.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.z = this->actor.shape.rot.z; +} + +s32 func_8086A2CC(EnPametfrog* this, CollisionPoly* floorPoly) { + Vec3f floorNorm; + Vec3f vec2; + f32 rotation; + f32 arg0; + + this->actor.floorPoly = floorPoly; + floorNorm.x = COLPOLY_GET_NORMAL(floorPoly->normal.x); + floorNorm.y = COLPOLY_GET_NORMAL(floorPoly->normal.y); + floorNorm.z = COLPOLY_GET_NORMAL(floorPoly->normal.z); + arg0 = DOTXYZ(floorNorm, this->unk_2DC); + if (fabsf(arg0) >= 1.0f) { + return false; + } + + rotation = func_80086C48(arg0); + if (rotation < 0.0001f) { + return false; + } + + Math3D_CrossProduct(&this->unk_2DC, &floorNorm, &vec2); + EnPametfrog_Vec3fNormalize(&vec2); + SysMatrix_InsertRotationAroundUnitVector_f(rotation, &vec2, 0); + SysMatrix_MultiplyVector3fByState(&this->unk_2E8, &vec2); + Math_Vec3f_Copy(&this->unk_2E8, &vec2); + Math3D_CrossProduct(&this->unk_2E8, &floorNorm, &this->unk_2D0); + EnPametfrog_Vec3fNormalize(&this->unk_2D0); + Math_Vec3f_Copy(&this->unk_2DC, &floorNorm); + return true; +} + +void EnPametfrog_ShakeCamera(EnPametfrog* this, GlobalContext* globalCtx, f32 magShakeXZ, f32 magShakeY) { + Camera* camera = Play_GetCamera(globalCtx, this->camId); + s16 y; + Vec3f eye; + + y = func_800DFCDC(camera) + 0x8000; + eye.x = (Math_SinS(y) * magShakeXZ) + camera->focalPoint.x; + eye.y = camera->focalPoint.y + magShakeY; + eye.z = (Math_CosS(y) * magShakeXZ) + camera->focalPoint.z; + func_8016970C(globalCtx, this->camId, &camera->focalPoint, &eye); +} + +void EnPametfrog_StopCutscene(EnPametfrog* this, GlobalContext* globalCtx) { + Camera* camera; + + if (this->camId != 0) { + camera = Play_GetCamera(globalCtx, this->camId); + func_8016970C(globalCtx, 0, &camera->focalPoint, &camera->eye); + this->camId = 0; + ActorCutscene_Stop(this->cutscene); + func_800B724C(globalCtx, &this->actor, 6); + } +} + +void EnPametfrog_PlaceSnapper(EnPametfrog* this, GlobalContext* globalCtx) { + CollisionPoly* poly; + u32 bgId; + Vec3f vec1; + Vec3f vec2; + Vec3f vec3; + Actor* child; + + poly = NULL; + this->actor.child->world.pos.x = (Math_SinS(this->actor.shape.rot.y) * 300.0f) + this->actor.world.pos.x; + this->actor.child->world.pos.z = (Math_CosS(this->actor.shape.rot.y) * 300.0f) + this->actor.world.pos.z; + this->actor.child->shape.rot.y = this->actor.shape.rot.y + 0x8000; + vec2.x = this->actor.child->world.pos.x; + vec2.y = this->actor.child->world.pos.y + 50.0f; + vec2.z = this->actor.child->world.pos.z; + vec3.x = this->actor.child->world.pos.x; + vec3.y = this->actor.child->world.pos.y - 150.0f; + vec3.z = this->actor.child->world.pos.z; + if (func_800C55C4(&globalCtx->colCtx, &vec2, &vec3, &vec1, &poly, 0, 1, 0, 1, &bgId) != 0) { + this->actor.child->floorHeight = vec1.y; + } else { + this->actor.child->floorHeight = this->actor.home.pos.y; + } + + child = this->actor.child; + child->world.pos.y = child->floorHeight - 60.0f; +} + +void EnPametfrog_JumpOnGround(EnPametfrog* this, GlobalContext* globalCtx) { + if (func_801378B8(&this->skelAnime, 1.0f)) { + Audio_PlayActorSound2(&this->actor, 0x395B); + } else if (func_801378B8(&this->skelAnime, 11.0f)) { + EnPametfrog_JumpWaterEffects(this, globalCtx); + Audio_PlayActorSound2(&this->actor, 0x2902); + } +} + +void func_8086A724(EnPametfrog* this, GlobalContext* globalCtx) { + if (this->actor.colChkInfo.damageEffect == 2) { + this->mode = 0; + this->unk_2C4 = 3.0f; + this->unk_2C8 = 0.75f; + } else if (this->actor.colChkInfo.damageEffect == 4) { + this->mode = 20; + this->unk_2C8 = 0.75f; + this->unk_2C4 = 3.0f; + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, + this->collider.elements[0].info.bumper.hitPos.x, this->collider.elements[0].info.bumper.hitPos.y, + this->collider.elements[0].info.bumper.hitPos.z, 0, 0, 0, 4); + } else if (this->actor.colChkInfo.damageEffect == 3) { + func_8086A024(this); + } +} + +void func_8086A80C(EnPametfrog* this) { + this->freezeTimer = 40; + Audio_PlayActorSound2(&this->actor, 0x389E); + func_800BCB70(&this->actor, 0, 255, 0, 40); + this->mode = 30; + this->unk_2C8 = 0.75f; + this->unk_2C4 = 2.0f; +} + +void func_8086A878(EnPametfrog* this) { + this->freezeTimer = 40; + Audio_PlayActorSound2(&this->actor, 0x389E); + func_800BCB70(&this->actor, 0, 255, 0, 40); +} + +void EnPametfrog_SetupRearOnSnapper(EnPametfrog* this) { + if (this->actionFunc == EnPametfrog_RearOnSnapperRise) { + SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06005694); + } else if (this->actionFunc == EnPametfrog_RearOnSnapperWave) { + SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_060052EC); + } else { + SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06004680); + } + + this->actor.flags &= ~1; + this->actor.params = ENPAMETFROG_ON_SNAPPER; + this->actionFunc = EnPametfrog_RearOnSnapper; +} + +void EnPametfrog_RearOnSnapper(EnPametfrog* this, GlobalContext* globalCtx) { + Actor* actor; + Vec3f rearingPoint; + s32 pad; + + if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) { + if (Rand_ZeroOne() < 0.5f) { + SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06004D50); + } else { + SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06004680); + } + } + + actor = func_800BC270(globalCtx, &this->actor, 60.0f, 0x138B0); + if (actor != NULL) { + rearingPoint.x = this->actor.world.pos.x; + rearingPoint.y = this->actor.world.pos.y + 10.0f; + rearingPoint.z = this->actor.world.pos.z; + if (actor->world.rot.x < Actor_PitchToPoint(actor, &rearingPoint)) { + EnPametfrog_SetupRearOnSnapperWave(this); + } else { + EnPametfrog_SetupRearOnSnapperRise(this); + } + } +} + +void EnPametfrog_SetupRearOnSnapperWave(EnPametfrog* this) { + SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06004894); + this->timer = 15; + this->actionFunc = EnPametfrog_RearOnSnapperWave; +} + +void EnPametfrog_RearOnSnapperWave(EnPametfrog* this, GlobalContext* globalCtx) { + if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) && this->timer > 0) { + this->timer--; + if (this->timer == 0) { + EnPametfrog_SetupRearOnSnapper(this); + } + } +} + +void EnPametfrog_SetupRearOnSnapperRise(EnPametfrog* this) { + SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_060050B8); + this->timer = 10; + this->actor.params = ENPAMETFROG_REAR_ON_SNAPPER; + this->actor.shape.rot.x = 0; + this->actor.shape.rot.z = 0; + this->actor.shape.rot.y = this->actor.child->world.rot.y; + this->actionFunc = EnPametfrog_RearOnSnapperRise; +} + +void EnPametfrog_RearOnSnapperRise(EnPametfrog* this, GlobalContext* globalCtx) { + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + this->timer--; + if (this->timer == 0) { + EnPametfrog_SetupRearOnSnapper(this); + } else { + this->actor.world.pos.y = Math_SinS(this->timer * 0xCCC) * 100.0f + (((EnBigpamet*)this->actor.child)->unk_2AC + 46.0f); + } +} + +void EnPametfrog_SetupFallOffSnapper(EnPametfrog* this, GlobalContext* globalCtx) { + Vec3f eye; + s16 yaw; + + SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06001F20); + this->actor.params = ENPAMETFROG_FALL_OFF_SNAPPER; + this->actor.speedXZ = 7.0f; + this->actor.velocity.y = 15.0f; + this->actor.world.rot.y = this->actor.child->world.rot.y + 0x8000; + this->actor.shape.rot.y = this->actor.world.rot.y; + this->actor.flags |= 1; + this->timer = 30; + this->collider.base.ocFlags1 |= 1; + yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + eye.x = (Math_SinS(yaw) * 300.0f) + this->actor.focus.pos.x; + eye.y = this->actor.focus.pos.y + 100.0f; + eye.z = (Math_CosS(yaw) * 300.0f) + this->actor.focus.pos.z; + func_8016970C(globalCtx, this->camId, &this->actor.focus.pos, &eye); + Audio_PlayActorSound2(this, 0x38D3); + this->actionFunc = EnPametfrog_FallOffSnapper; +} + +void EnPametfrog_FallOffSnapper(EnPametfrog* this, GlobalContext* globalCtx) { + f32 sin; + + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + this->actor.shape.rot.x += 0x800; + this->actor.shape.rot.z += 0x1000; + if (this->timer != 0) { + this->timer--; + } + + sin = sin_rad(this->timer * (M_PI/3.0f)) * ((0.02f * (this->timer * (1.0f/6.0f))) + 0.005f) + 1.0f; + EnPametfrog_ShakeCamera(this, globalCtx, 300.0f * sin, 100.0f * sin); + if (this->actor.bgCheckFlags & 1) { + EnPametfrog_StopCutscene(this, globalCtx); + EnPametfrog_SetupJumpToWall(this); + } +} + +void EnPametfrog_SetupJumpToWall(EnPametfrog* this) { + SkelAnime_ChangeAnim(&this->skelAnime, &D_060039C4, 2.0f, 0.0f, 0.0f, 0, -2.0f); + this->actor.shape.rot.x = 0; + this->actor.shape.rot.z = 0; + this->actor.bgCheckFlags &= ~8; + Audio_PlayActorSound2(this, 0x39A1); + this->actionFunc = EnPametfrog_JumpToWall; +} + +void EnPametfrog_JumpToWall(EnPametfrog* this, GlobalContext* globalCtx) { + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + EnPametfrog_JumpOnGround(this, globalCtx); + if ((this->actor.bgCheckFlags & 1) && (this->actor.bgCheckFlags & 8) && (this->actor.wallBgId == BGCHECK_SCENE) && + (COLPOLY_GET_NORMAL(this->actor.wallPoly->normal.y) < 0.5f)) { + EnPametfrog_SetupWallCrawl(this); + } else if (!(this->actor.bgCheckFlags & 1) || + (this->skelAnime.animCurrentFrame > 1.0f) && (this->skelAnime.animCurrentFrame < 12.0f)) { + this->actor.speedXZ = 12.0f; + } else { + this->actor.speedXZ = 0.0f; + } +} + +void EnPametfrog_SetupWallCrawl(EnPametfrog* this) { + if (this->actionFunc == EnPametfrog_JumpToWall) { + SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, &D_06001E14); + this->collider.base.acFlags |= 1; + this->unk_2D0.x = 0.0f; + this->unk_2D0.z = 0.0f; + this->actor.gravity = 0.0f; + this->actor.world.pos.y = this->actor.focus.pos.y; + this->unk_2D0.y = 1.0f; + Math_Vec3f_Copy(&this->actor.colChkInfo.displacement, &D_801D15B0); + this->actor.colChkInfo.mass = MASS_IMMOVABLE; + this->unk_2DC.x = COLPOLY_GET_NORMAL(this->actor.wallPoly->normal.x); + this->unk_2DC.y = COLPOLY_GET_NORMAL(this->actor.wallPoly->normal.y); + this->unk_2DC.z = COLPOLY_GET_NORMAL(this->actor.wallPoly->normal.z); + Math3D_CrossProduct(&this->unk_2DC, &this->unk_2D0, &this->unk_2E8); + EnPametfrog_Vec3fNormalize(&this->unk_2E8); + Math3D_CrossProduct(&this->unk_2E8, &this->unk_2DC, &this->unk_2D0); + EnPametfrog_Vec3fNormalize(&this->unk_2D0); + func_8086A238(this); + this->actor.floorPoly = this->actor.wallPoly; + this->wallPauseTimer = 10; + } else { + this->skelAnime.animPlaybackSpeed = 1.0f; + } + + Audio_PlayActorSound2(this, 0x39A9); + this->actor.speedXZ = 8.0f; + this->timer = Rand_S16Offset(35, 15); + this->actionFunc = EnPametfrog_WallCrawl; +} + +void EnPametfrog_WallCrawl(EnPametfrog* this, GlobalContext* globalCtx) { + CollisionPoly* poly1 = NULL; + CollisionPoly* poly2 = NULL; + Vec3f vec1; + Vec3f vec2; + Vec3f worldPos1; + Vec3f worldPos2; + f32 doubleSpeedXZ; + u32 bgId1; + u32 bgId2; + s32 isSuccess = false; + + if (this->freezeTimer > 0) { + this->freezeTimer--; + } else { + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + this->timer--; + this->actor.speedXZ = 8.0f; + doubleSpeedXZ = this->actor.speedXZ * 2.0f; + vec1.x = this->actor.world.pos.x + this->unk_2DC.x * 2.0f; + vec1.y = this->actor.world.pos.y + this->unk_2DC.y * 2.0f; + vec1.z = this->actor.world.pos.z + this->unk_2DC.z * 2.0f; + vec2.x = this->actor.world.pos.x - this->unk_2DC.x * 25.0f; + vec2.y = this->actor.world.pos.y - this->unk_2DC.y * 25.0f; + vec2.z = this->actor.world.pos.z - this->unk_2DC.z * 25.0f; + if (func_800C55C4(&globalCtx->colCtx, &vec1, &vec2, &worldPos2, &poly2, 1, 1, 1, 1, &bgId2) != 0) { + vec2.x = this->unk_2D0.x * doubleSpeedXZ + vec1.x; + vec2.y = this->unk_2D0.y * doubleSpeedXZ + vec1.y; + vec2.z = this->unk_2D0.z * doubleSpeedXZ + vec1.z; + if (func_800C55C4(&globalCtx->colCtx, &vec1, &vec2, &worldPos1, &poly1, 1, 1, 1, 1, &bgId1) != 0) { + isSuccess = func_8086A2CC(this, poly1); + Math_Vec3f_Copy(&this->actor.world.pos, &worldPos1); + this->actor.floorBgId = bgId1; + this->actor.speedXZ = 0.0f; + } else { + if (this->actor.floorPoly != poly2) { + isSuccess = func_8086A2CC(this, poly2); + } + Math_Vec3f_Copy(&this->actor.world.pos, &worldPos2); + this->actor.floorBgId = bgId2; + } + } else { + EnPametfrog_SetupClimbDownWall(this); + } + + if (isSuccess) { + func_8086A238(this); + } + + if (func_801378B8(&this->skelAnime, 15.0f)) { + Audio_PlayActorSound2(this, 0x3828); + } + + if (((globalCtx->gameplayFrames % 60) == 0) && (Rand_ZeroOne() < 0.8f)) { + Audio_PlayActorSound2(this, 0x38D2); + } + + if ((this->timer == 0) || + ((this->actor.world.pos.y < (this->actor.home.pos.y + 200.0f)) && (this->unk_2D0.y <= 0.0f))) { + this->wallPauseTimer--; + if (this->wallPauseTimer == 0) { + EnPametfrog_SetupClimbDownWall(this); + } else { + EnPametfrog_SetupWallPause(this); + } + } + } +} + +void EnPametfrog_SetupWallPause(EnPametfrog* this) { + s32 pad; + f32 randFloat; + + this->actor.speedXZ = 0.0f; + this->skelAnime.animPlaybackSpeed = 1.5f; + if (this->timer != 0) { + this->wallRotation = this->unk_2E8.y > 0.0f ? (M_PI/30.0f) : (-M_PI/30.0f); + } else { + randFloat = Rand_ZeroFloat(0x2000); + this->wallRotation = (Rand_ZeroOne() < 0.5f ? -1 : 1) * (0x1000 + randFloat) * (M_PI / (15 * 0x8000)); + } + this->timer = 15; + Audio_PlayActorSound2(this, 0x39AC); + this->actionFunc = EnPametfrog_WallPause; +} + +void EnPametfrog_WallPause(EnPametfrog* this, GlobalContext* globalCtx) { + Vec3f vec; + + if (this->freezeTimer > 0) { + this->freezeTimer--; + } else { + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + this->timer--; + SysMatrix_InsertRotationAroundUnitVector_f(this->wallRotation, &this->unk_2DC, 0); + SysMatrix_MultiplyVector3fByState(&this->unk_2D0, &vec); + Math_Vec3f_Copy(&this->unk_2D0, &vec); + Math3D_CrossProduct(&this->unk_2DC, &this->unk_2D0, &this->unk_2E8); + func_8086A238(this); + if (((globalCtx->gameplayFrames % 60) == 0) && (Rand_ZeroOne() < 0.8f)) { + Audio_PlayActorSound2(this, 0x38D2); + } + + if (this->timer == 0) { + EnPametfrog_SetupWallCrawl(this); + } + } +} + +void EnPametfrog_SetupClimbDownWall(EnPametfrog* this) { + s16 yaw; + + SkelAnime_ChangeAnim(&this->skelAnime, &D_060039C4, 0.0f, 0.0f, SkelAnime_GetFrameCount(&D_060039C4.common), 2, + 0.0f); + this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, this->actor.child); + this->actor.world.rot.y = this->actor.shape.rot.y; + this->actor.shape.rot.x = 0; + this->actor.shape.rot.z = 0; + this->actor.colChkInfo.mass = 50; + this->actor.speedXZ = 5.0f; + this->collider.base.acFlags &= ~1; + this->actor.velocity.y = 0.0f; + this->actor.gravity = -1.0f; + yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + this->actor.world.pos.x += 30.0f * Math_SinS(yaw); + this->actor.world.pos.z += 30.0f * Math_CosS(yaw); + this->actor.bgCheckFlags &= ~1; + this->actor.params = ENPAMETFROG_RETURN_TO_SNAPPER; + this->actionFunc = EnPametfrog_ClimbDownWall; +} + +void EnPametfrog_ClimbDownWall(EnPametfrog* this, GlobalContext* globalCtx) { + s16 yaw; + + if (this->actor.bgCheckFlags & 1) { + EnPametfrog_SetupRunToSnapper(this); + } else if (this->actor.floorHeight == -32000.0f) { + yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + this->actor.world.pos.x += 5.0f * Math_SinS(yaw); + this->actor.world.pos.z += 5.0f * Math_CosS(yaw); + if (this->actor.world.pos.y < (this->actor.home.pos.y - 5.0f)) { + this->actor.world.pos.y = this->actor.home.pos.y; + } + } +} + +void EnPametfrog_SetupRunToSnapper(EnPametfrog* this) { + SkelAnime_ChangeAnim(&this->skelAnime, &D_060039C4, 2.0f, 0.0f, 0.0f, 0, -2.0f); + this->actor.params = ENPAMETFROG_RETURN_TO_SNAPPER; + this->actionFunc = EnPametfrog_RunToSnapper; +} + +void EnPametfrog_RunToSnapper(EnPametfrog* this, GlobalContext* globalCtx) { + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + EnPametfrog_JumpOnGround(this, globalCtx); + this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, this->actor.child); + this->actor.world.rot.y = this->actor.shape.rot.y; + if (!(this->actor.bgCheckFlags & 1) || + ((this->skelAnime.animCurrentFrame > 1.0f) && (this->skelAnime.animCurrentFrame < 12.0f))) { + this->actor.speedXZ = 12.0f; + } else { + this->actor.speedXZ = 0.0f; + } + + if ((this->actor.child->params == 1) && (Actor_XZDistanceBetweenActors(&this->actor, this->actor.child) < 120.0f) && + func_801378B8(&this->skelAnime, 0.0f)) { + EnPametfrog_SetupJumpOnSnapper(this); + } +} + +void EnPametfrog_SetupJumpOnSnapper(EnPametfrog* this) { + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06004680, 6.0f); + this->timer = 6; + this->collider.base.ocFlags1 &= ~1; + this->collider.base.acFlags &= ~1; + this->actor.speedXZ = 0.0f; + this->actor.velocity.y = 0.0f; + this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, this->actor.child); + this->actor.world.rot.y = this->actor.shape.rot.y; + this->actor.params = ENPAMETFROG_JUMP_ON_SNAPPER; + Audio_PlayActorSound2(this, 0x395C); + this->actionFunc = EnPametfrog_JumpOnSnapper; +} + +void EnPametfrog_JumpOnSnapper(EnPametfrog* this, GlobalContext* globalCtx) { + f32 temp_f0; + EnBigpamet* bigpamet; + + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + this->timer--; + if (this->timer == 0) { + EnPametfrog_SetupLandOnSnapper(this); + } else { + bigpamet = (EnBigpamet*)this->actor.child; + temp_f0 = 1.0f / this->timer; + this->actor.world.pos.x -= (this->actor.world.pos.x - bigpamet->actor.world.pos.x) * temp_f0; + this->actor.world.pos.z -= (this->actor.world.pos.z - bigpamet->actor.world.pos.z) * temp_f0; + this->actor.world.pos.y = + Math_SinS((-this->timer * 0x1000) + 0x6000) * 65.0f + ((EnBigpamet*)this->actor.child)->unk_2AC; + } +} + +void EnPametfrog_SetupLandOnSnapper(EnPametfrog* this) { + SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06000994); + this->actor.shape.rot.y = this->actor.child->shape.rot.y; + this->actor.params = ENPAMETFROG_ON_SNAPPER; + this->actionFunc = EnPametfrog_LandOnSnapper; +} + +void EnPametfrog_LandOnSnapper(EnPametfrog* this, GlobalContext* globalCtx) { + if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) { + EnPametfrog_StopCutscene(this, globalCtx); + EnPametfrog_SetupRearOnSnapper(this); + } +} + +void EnPametfrog_SetupFallInAir(EnPametfrog* this, GlobalContext* globalCtx) { + s16 yaw; + Vec3f eye; + f32 xzDist; + + SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06001F20); + if (this->actor.colChkInfo.health > 0) { + this->actor.params = ENPAMETFROG_RETURN_TO_SNAPPER; + } + + this->actor.speedXZ = 0.0f; + this->actor.velocity.y = 0.0f; + this->collider.base.acFlags &= ~1; + this->timer = 10; + if (this->actor.colChkInfo.health == 0) { + Audio_PlayActorSound2(this, 0x38D6); + } else { + Audio_PlayActorSound2(this, 0x38D3); + } + + func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 0x10); + yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + this->actor.world.pos.x += 30.0f * Math_SinS(yaw); + this->actor.world.pos.z += 30.0f * Math_CosS(yaw); + if (this->camId != 0) { + xzDist = sqrtf(SQXZ(this->unk_2DC)); + if (xzDist > 0.001f) { + xzDist = 200.0f / xzDist; + } else { + xzDist = 200.0f; + this->unk_2DC.x = 1.0f; + this->unk_2DC.z = 0.0f; + } + + eye.x = this->actor.world.pos.x + (xzDist * this->unk_2DC.x); + eye.y = (this->actor.world.pos.y + this->actor.home.pos.y) * 0.5f; + eye.z = this->actor.world.pos.z + (xzDist * this->unk_2DC.z); + func_8016970C(globalCtx, this->camId, &this->actor.world.pos, &eye); + } + + this->actionFunc = EnPametfrog_FallInAir; +} + +void EnPametfrog_FallInAir(EnPametfrog* this, GlobalContext* globalCtx) { + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + this->actor.colorFilterTimer = 0x10; + if (this->timer > 0) { + this->timer--; + if (this->timer == 0) { + this->actor.gravity = -1.0f; + this->actor.colChkInfo.mass = 50; + } + } else { + this->yaw += 0xF00; + if (this->camId != 0) { + func_8016970C(globalCtx, this->camId, &this->actor.world.pos, &Play_GetCamera(globalCtx, this->camId)->eye); + } + + if (this->actor.bgCheckFlags & 1) { + EnPametfrog_SetupFallOnGround(this, globalCtx); + } + } +} + +void EnPametfrog_SetupFallOnGround(EnPametfrog* this, GlobalContext* globalCtx) { + SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06004298); + this->actor.shape.rot.x = 0; + this->actor.shape.rot.y += this->yaw; + this->actor.shape.rot.z = 0; + this->yaw = 0; + this->timer = 5; + func_8086A068(this, globalCtx); + EnPametfrog_JumpWaterEffects(this, globalCtx); + Audio_PlayActorSound2(this, 0x2902); + this->actionFunc = EnPametfrog_FallOnGround; +} + +void EnPametfrog_FallOnGround(EnPametfrog* this, GlobalContext* globalCtx) { + if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) { + if (this->skelAnime.animCurrentSeg == &D_06004298) { + if (this->actor.colChkInfo.health == 0) { + this->timer--; + if (this->timer == 0) { + EnPametfrog_SetupDefeatGekko(this, globalCtx); + } + } else { + SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_060030E4); + } + } else { + EnPametfrog_SetupRunToSnapper(this); + } + } +} + +void EnPametfrog_SetupDefeatGekko(EnPametfrog* this, GlobalContext* globalCtx) { + Vec3f eye; + s16 yaw = Actor_YawToPoint(this->actor.child, &this->actor.home.pos); + s16 yawDiff = this->actor.yawTowardsPlayer - yaw; + + yaw = yawDiff > 0 ? yaw - 0x2000 : yaw + 0x2000; + eye.x = this->actor.child->focus.pos.x + 150.0f * Math_SinS(yaw); + eye.y = this->actor.child->focus.pos.y + 20.0f; + eye.z = this->actor.child->focus.pos.z + 150.0f * Math_CosS(yaw); + func_8016970C(globalCtx, this->camId, &this->actor.child->focus.pos, &eye); + this->actor.params = ENPAMETFROG_DEFEAT; + this->timer = 38; + this->actionFunc = EnPametfrog_DefeatGekko; +} + +void EnPametfrog_DefeatGekko(EnPametfrog* this, GlobalContext* globalCtx) { + this->actor.colorFilterTimer = 16; + if (this->timer > 0) { + this->timer--; + if (this->timer == 0) { + EnPametfrog_SetupDefeatSnapper(this, globalCtx); + } + } +} + +void EnPametfrog_SetupDefeatSnapper(EnPametfrog* this, GlobalContext* globalCtx) { + Vec3f eye; + s16 yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + s16 yawDiff = this->actor.yawTowardsPlayer - yaw; + + yaw = yawDiff > 0 ? yaw - 0x2000 : yaw + 0x2000; + eye.x = this->actor.world.pos.x + Math_SinS(yaw) * 150.0f; + eye.y = this->actor.world.pos.y + 20.0f; + eye.z = this->actor.world.pos.z + Math_CosS(yaw) * 150.0f; + func_8016970C(globalCtx, this->camId, &this->actor.world.pos, &eye); + this->timer = 20; + this->actionFunc = EnPametfrog_DefeatSnapper; +} + +void EnPametfrog_DefeatSnapper(EnPametfrog* this, GlobalContext* globalCtx) { + this->timer--; + Actor_SetScale(&this->actor, this->timer * 0.00035000002f); + this->actor.colorFilterTimer = 16; + EnPametfrog_ShakeCamera(this, globalCtx, (this->timer * 3.75f) + 75.0f, (this->timer * 0.5f) + 10.0f); + if (this->timer == 0) { + EnPametfrog_SetupSpawnFrog(this, globalCtx); + } +} + +void EnPametfrog_SetupSpawnFrog(EnPametfrog* this, GlobalContext* globalCtx) { + static Vec3f sAccel = { 0.0f, -0.5f, 0.0f }; + static Color_RGBA8 primColor = { 250, 250, 250, 255 }; + static Color_RGBA8 envColor = { 180, 180, 180, 255 }; + s16 yaw = func_800DFCDC(ACTIVE_CAM) + 0x8000; + Vec3f vec1; + Vec3f vel; + s32 i; + + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_MINIFROG, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, yaw, 0, this->params); + vec1.x = (Math_SinS(yaw) * 20.0f) + this->actor.world.pos.x; + vec1.y = this->actor.world.pos.y + 25.0f; + vec1.z = (Math_CosS(yaw) * 20.0f) + this->actor.world.pos.z; + this->collider.base.ocFlags1 &= ~1; + func_800B0DE0(globalCtx, &vec1, &D_801D15B0, &D_801D15B0, &primColor, &envColor, 800, 50); + func_800F0568(globalCtx, &this->actor.world.pos, 40, 0x3A86); + Actor_SetRoomClearedTemp(globalCtx, globalCtx->roomContext.currRoom.num); + for (i = 0; i < 25; i++) { + vel.x = randPlusMinusPoint5Scaled(5.0f); + vel.y = Rand_ZeroFloat(3.0f) + 4.0f; + vel.z = randPlusMinusPoint5Scaled(5.0f); + EffectSsHahen_Spawn(globalCtx, &this->actor.world.pos, &vel, &sAccel, 0, Rand_S16Offset(12, 3), -1, 10, 0); + } + + this->timer = 40; + this->actionFunc = EnPametfrog_SpawnFrog; +} + +void EnPametfrog_SpawnFrog(EnPametfrog* this, GlobalContext* globalCtx) { + f32 magShake; + + this->timer--; + magShake = (sin_rad(this->timer * (M_PI/5.0f)) * ((0.04f * (this->timer * 0.1f)) + 0.02f)) + 1.0f; + EnPametfrog_ShakeCamera(this, globalCtx, 75.0f * magShake, 10.0f * magShake); + if (this->timer == 0) { + EnPametfrog_StopCutscene(this, globalCtx); + Actor_MarkForDeath(&this->actor); + } +} + +void EnPametfrog_SetupCutscene(EnPametfrog* this) { + if (this->actor.colChkInfo.health == 0) { + this->cutscene = this->actor.cutscene; + } else { + this->cutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); + } + + ActorCutscene_SetIntentToPlay(this->cutscene); + this->actionFunc = EnPametfrog_PlayCutscene; + this->actor.speedXZ = 0.0f; + this->actor.velocity.y = 0.0f; +} + +void EnPametfrog_PlayCutscene(EnPametfrog* this, GlobalContext* globalCtx) { + if (ActorCutscene_GetCanPlayNext(this->cutscene)) { + ActorCutscene_Start(this->cutscene, &this->actor); + this->camId = ActorCutscene_GetCurrentCamera(this->cutscene); + func_800B724C(globalCtx, &this->actor, 7); + if (this->actor.colChkInfo.health == 0) { + if (this->actor.params == ENPAMETFROG_PRE_SNAPPER) { + EnPametfrog_SetupCallSnapper(this, globalCtx); + } else { + EnPametfrog_SetupFallInAir(this, globalCtx); + } + } else { + EnPametfrog_SetupFallOffSnapper(this, globalCtx); + } + } else { + ActorCutscene_SetIntentToPlay(this->cutscene); + } +} + +void EnPametfrog_SetupLookAround(EnPametfrog* this) { + SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_060066B4); + this->collider.base.atFlags &= ~1; + this->actor.speedXZ = 0.0f; + this->actor.world.rot.y = this->actor.shape.rot.y; + this->actionFunc = EnPametfrog_LookAround; +} + +void EnPametfrog_LookAround(EnPametfrog* this, GlobalContext* globalCtx) { + EnPametfrog_IdleWaterEffects(this, globalCtx); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 5, 0x400, 0x80); + this->actor.shape.rot.y = this->actor.world.rot.y; + if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) && (func_801690CC(globalCtx) == 0)) { + if (!this->unk_2AE) { + func_801A2E54(0x38); + this->unk_2AE = true; + } + EnPametfrog_SetupJumpToLink(this); + } +} + +void EnPametfrog_SetupJumpToLink(EnPametfrog* this) { + SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, &D_060039C4); + this->collider.base.acFlags |= 1; + this->actor.world.rot.y = this->actor.shape.rot.y; + this->actionFunc = EnPametfrog_JumpToLink; +} + +void EnPametfrog_JumpToLink(EnPametfrog* this, GlobalContext* globalCtx) { + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 5, 0x1000, 0x80); + this->actor.shape.rot.y = this->actor.world.rot.y; + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + EnPametfrog_JumpOnGround(this, globalCtx); + if (!(this->actor.bgCheckFlags & 1) || + (this->skelAnime.animCurrentFrame > 1.0f && this->skelAnime.animCurrentFrame < 12.0f)) { + this->actor.speedXZ = 8.0f; + } else { + this->actor.speedXZ = 0.0f; + } + + if ((this->collider.base.ocFlags1 & 2) && (this->collider.base.ocFlags2 & 1) && + Actor_IsActorFacingLink(&this->actor, 0x3000) && + (this->skelAnime.animCurrentFrame <= 2.0f || this->skelAnime.animCurrentFrame >= 11.0f)) { + EnPametfrog_SetupMeleeAttack(this); + } +} + +void EnPametfrog_SetupMeleeAttack(EnPametfrog* this) { + SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_0600F990); + this->timer = 7; + this->actor.speedXZ = 0.0f; + this->actionFunc = EnPametfrog_MeleeAttack; +} + +static AnimationHeader* sAttackAnimations[] = { + &D_0600347C, // Jab Punch + &D_060070C4, // Hook Punch + &D_06003F28, // Kick + &D_0600F048, // Windup Punch +}; + +void EnPametfrog_MeleeAttack(EnPametfrog* this, GlobalContext* globalCtx) { + EnPametfrog_IdleWaterEffects(this, globalCtx); + if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) { + this->timer--; + if (this->timer == 0) { + EnPametfrog_SetupLookAround(this); + } else if (this->timer == 6) { + SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_0600F990); + } else { + SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, sAttackAnimations[(s32)Rand_ZeroFloat(4.0f) % 4]); + } + } + + if ((this->skelAnime.animCurrentSeg == &D_0600347C && func_801378B8(&this->skelAnime, 2.0f)) || + (this->skelAnime.animCurrentSeg == &D_060070C4 && func_801378B8(&this->skelAnime, 9.0f)) || + (this->skelAnime.animCurrentSeg == &D_06003F28 && func_801378B8(&this->skelAnime, 2.0f)) || + ((this->skelAnime.animCurrentSeg == &D_0600F048) && func_801378B8(&this->skelAnime, 27.0f))) { + this->collider.base.atFlags |= 1; + if (this->skelAnime.animCurrentSeg == &D_06003F28) { + Audio_PlayActorSound2(&this->actor, 0x3966); + } else { + Audio_PlayActorSound2(&this->actor, 0x3961); + } + } else { + this->collider.base.atFlags &= ~1; + } +} + +void func_8086CB4C(EnPametfrog* this) { + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06005D54, -3.0f); + this->timer = 20; + this->collider.base.atFlags &= ~1; + this->collider.base.acFlags &= ~1; + this->actor.speedXZ = 10.0f; + Audio_PlayActorSound2(this, 0x38D3); + func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 20); + func_800BE5CC(&this->actor, &this->collider, 0); + this->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; + this->actionFunc = func_8086CC04; +} + +void func_8086CC04(EnPametfrog* this, GlobalContext* globalCtx) { + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + this->timer--; + Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + if (this->timer == 0) { + if (this->actor.colChkInfo.health > 0) { + EnPametfrog_SetupJumpToLink(this); + } else { + EnPametfrog_SetupCutscene(this); + } + } +} + +void func_8086CC84(EnPametfrog* this) { + if (this->skelAnime.animCurrentSeg == &D_060039C4) { + this->skelAnime.animCurrentFrame = 0.0f; + SkelAnime_FrameUpdateMatrix(&this->skelAnime); + } + + this->collider.base.atFlags &= ~1; + this->actor.speedXZ = 0.0f; + if (this->actor.colChkInfo.health == 0) { + this->collider.base.acFlags &= ~1; + } + + this->actionFunc = func_8086CD04; +} + +void func_8086CD04(EnPametfrog* this, GlobalContext* globalCtx) { + this->freezeTimer--; + if (this->freezeTimer == 0) { + func_8086A068(this, globalCtx); + EnPametfrog_SetupJumpToLink(this); + } else if (this->freezeTimer == 78) { + func_8086A068(this, globalCtx); + this->actor.colorFilterTimer = 0; + EnPametfrog_SetupCutscene(this); + } +} + +void EnPametfrog_SetupCallSnapper(EnPametfrog* this, GlobalContext* globalCtx) { + Vec3f eye; + Vec3f focalPoint; + s16 yawDiff; + + SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06001B08, 3.0f); + Audio_PlayActorSound2(this, 0x395C); + this->actor.flags &= ~1; + this->actor.colChkInfo.health = 6; + this->actor.world.rot.y = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y; + if (yawDiff > 0) { + this->actor.world.rot.y -= 0x2000; + } else { + this->actor.world.rot.y += 0x2000; + } + + this->actor.shape.rot.y = this->actor.world.rot.y; + focalPoint.x = this->actor.world.pos.x; + focalPoint.z = this->actor.world.pos.z; + focalPoint.y = this->actor.world.pos.y + 45.0f; + eye.x = (Math_SinS(this->actor.shape.rot.y) * 90.0f) + focalPoint.x; + eye.z = (Math_CosS(this->actor.shape.rot.y) * 90.0f) + focalPoint.z; + eye.y = focalPoint.y + 4.0f; + + // Zooms in on Gekko + func_8016970C(globalCtx, this->camId, &focalPoint, &eye); + this->timer = 0; + this->actor.hintId = 0x5F; + this->actionFunc = EnPametfrog_CallSnapper; +} + +void EnPametfrog_CallSnapper(EnPametfrog* this, GlobalContext* globalCtx) { + if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) { + EnPametfrog_SetupSnapperSpawn(this, globalCtx); + } +} + +void EnPametfrog_SetupSnapperSpawn(EnPametfrog* this, GlobalContext* globalCtx) { + Vec3f focalPoint; + Vec3f eye; + s16 yaw; + + EnPametfrog_PlaceSnapper(this, globalCtx); + focalPoint.x = this->actor.child->world.pos.x; + focalPoint.z = this->actor.child->world.pos.z; + focalPoint.y = this->actor.child->floorHeight + 50.0f; + if ((s16)(Actor_YawToPoint(&this->actor, &this->actor.home.pos) - this->actor.shape.rot.y) > 0) { + yaw = this->actor.child->shape.rot.y - 0x1000; + } else { + yaw = this->actor.child->shape.rot.y + 0x1000; + } + + eye.x = (Math_SinS(yaw) * 500.0f) + focalPoint.x; + eye.y = focalPoint.y + 55.0f; + eye.z = (Math_CosS(yaw) * 500.0f) + focalPoint.z; + + // Zooms in on Snapper spawn point + func_8016970C(globalCtx, this->camId, &focalPoint, &eye); + this->quake = Quake_Add(ACTIVE_CAM, 6); + Quake_SetSpeed(this->quake, 18000); + Quake_SetQuakeValues(this->quake, 2, 0, 0, 0); + Quake_SetCountdown(this->quake, 15); + func_8013ECE0(this->actor.xyzDistToPlayerSq, 120, 20, 10); + this->timer = 40; + this->actionFunc = EnPametfrog_SnapperSpawn; +} + +void EnPametfrog_SnapperSpawn(EnPametfrog* this, GlobalContext* globalCtx) { + this->timer--; + EnPametfrog_ShakeCamera(this, globalCtx, (f32)(this->timer * 7.5f) + 200.0f, + ((f32)(this->timer * 2) * (15.0f/16.0f)) + -20.0f); + if (this->timer != 0) { + func_8013ECE0(this->actor.xyzDistToPlayerSq, 120, 20, 10); + } else { + EnPametfrog_SetupTransitionGekkoSnapper(this, globalCtx); + } +} + +void EnPametfrog_SetupTransitionGekkoSnapper(EnPametfrog* this, GlobalContext* globalCtx) { + this->actor.params = ENPAMETFROG_GET_SNAPPER; + Quake_RemoveFromIdx(this->quake); + this->quake = Quake_Add(ACTIVE_CAM, 3); + Quake_SetSpeed(this->quake, 20000); + Quake_SetQuakeValues(this->quake, 0x11, 0, 0, 0); + Quake_SetCountdown(this->quake, 12); + func_8013ECE0(this->actor.xyzDistToPlayerSq, 255, 20, 150); + this->actionFunc = EnPametfrog_TransitionGekkoSnapper; +} + +void EnPametfrog_TransitionGekkoSnapper(EnPametfrog* this, GlobalContext* globalCtx) { + if (this->actor.params == ENPAMETFROG_INIT_SNAPPER) { + func_801A2E54(0x38); + EnPametfrog_SetupRunToSnapper(this); + } +} + +void EnPametfrog_ApplyDamage(EnPametfrog* this, GlobalContext* globalCtx) { + if (this->collider.base.acFlags & 2) { + this->collider.base.acFlags &= ~2; + if ((this->mode != 10) || !(this->collider.elements->info.acHitInfo->toucher.dmgFlags & 0xDB0B3)) { + if (this->actor.params == ENPAMETFROG_PRE_SNAPPER) { + if (func_800BE22C(&this->actor) == 0) { + func_801A2ED8(); + } + + // Nuts/Hookshot/Deku Mask Spin all freeze Gekko for 40 frames + if (this->actor.colChkInfo.damageEffect == 5) { + func_8086A80C(this); + func_8086CC84(this); + } else if (this->actor.colChkInfo.damageEffect == 1) { + func_8086A878(this); + func_8086CC84(this); + } else if (this->actor.colChkInfo.damageEffect == 3) { // Ice arrows? + func_8086A024(this); + this->freezeTimer = 80; + func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 0x50); + func_8086CC84(this); + } else { + func_8086A068(this, globalCtx); + if (this->actor.colChkInfo.damageEffect == 2) { + this->mode = 0; + this->unk_2C8 = 0.75f; + this->unk_2C4 = 4.0f; + } else if (this->actor.colChkInfo.damageEffect == 4) { + this->mode = 20; + this->unk_2C8 = 0.75f; + this->unk_2C4 = 4.0f; + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, + this->collider.elements[0].info.bumper.hitPos.x, + this->collider.elements[0].info.bumper.hitPos.y, + this->collider.elements[0].info.bumper.hitPos.z, 0, 0, 0, 4); + } + func_8086CB4C(this); + } + } else if (func_800BE22C(&this->actor) == 0) { + this->collider.base.acFlags &= ~1; + func_8086A724(this, globalCtx); + func_800BBA88(globalCtx, &this->actor); + this->actor.flags &= ~1; + func_801A2ED8(); + EnPametfrog_SetupCutscene(this); + } else if (this->actor.colChkInfo.damageEffect == 5) { + func_8086A80C(this); + } else if (this->actor.colChkInfo.damageEffect == 1) { + func_8086A878(this); + } else { + func_8086A724(this, globalCtx); + EnPametfrog_SetupFallInAir(this, globalCtx); + } + } + } +} + +void EnPametfrog_Update(Actor* thisx, GlobalContext* globalCtx) { + EnPametfrog* this = THIS; + f32 unk2C4; + f32 arg3; + + if (this->actor.params == ENPAMETFROG_CUTSCENE) { + EnPametfrog_SetupCutscene(this); + } else if (this->actionFunc != EnPametfrog_PlayCutscene) { + EnPametfrog_ApplyDamage(this, globalCtx); + } else { + this->collider.base.acFlags &= ~2; + } + + this->actionFunc(this, globalCtx); + if ((this->actionFunc != EnPametfrog_JumpOnSnapper) && (this->actionFunc != EnPametfrog_RearOnSnapperRise)) { + if (this->actor.gravity < -0.1f) { + Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + arg3 = this->actionFunc == EnPametfrog_FallInAir ? 3.0f : 15.0f; + func_800B78B8(globalCtx, &this->actor, 25.0f, arg3, 3.0f, 0x1F); + } else if (this->freezeTimer == 0) { + Actor_SetVelocityAndMoveXYRotation(&this->actor); + this->actor.floorHeight = this->actor.world.pos.y; + } + } + + if (this->collider.base.atFlags & 1) { + CollisionCheck_SetAT(globalCtx, &globalCtx->colCheckCtx, &this->collider.base); + } + + if (this->collider.base.acFlags & 1) { + CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base); + } + + if (this->collider.base.ocFlags1 & 1) { + CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base); + } + + if (this->unk_2C4 > 0.0f) { + if ((this->mode != 10) && (this->actionFunc != EnPametfrog_PlayCutscene)) { + Math_StepToF(&this->unk_2C4, 0.0f, 0.05f); + unk2C4 = ((this->unk_2C4 + 1.0f) * 0.375f); + this->unk_2C8 = unk2C4; + this->unk_2C8 = unk2C4 > 0.75f ? 0.75f : this->unk_2C8; + } else if (!Math_StepToF(&this->unk_2CC, 0.75f, (3.0f/160.0f))) { + func_800B9010(&this->actor, 0x20B2); + } + } +} + +static s8 D_8086DA28[] = { + -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, 4, -1, 5, 6, -1, 7, 8, 9, -1, 10, -1, 11, -1, -1, +}; + +void EnPametfrog_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + EnPametfrog* this = THIS; + Vec3f vec; + Vec3s* center; + s8 index; + + if (limbIndex == 20) { + SysMatrix_GetStateTranslation(&this->actor.focus.pos); + this->actor.focus.rot.y = this->actor.shape.rot.y; + SysMatrix_GetStateTranslationAndScaledY(2500.0f, &vec); + center = &this->collider.elements[0].dim.worldSphere.center; + center->x = vec.x; + center->y = vec.y; + center->z = vec.z; + center = &this->collider.elements[1].dim.worldSphere.center; + center->x = (Math_SinS(this->actor.shape.rot.y) * 35.0f) + this->actor.focus.pos.x; + center->y = this->actor.focus.pos.y - 10.0f; + center->z = (Math_CosS(this->actor.shape.rot.y) * 35.0f) + this->actor.focus.pos.z; + } + + index = D_8086DA28[limbIndex]; + if (index != -1) { + SysMatrix_GetStateTranslation(&this->unk_2F4[index]); + } +} + +void EnPametfrog_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnPametfrog* this = THIS; + + func_8012C28C(globalCtx->state.gfxCtx); + Matrix_RotateY(this->yaw, MTXMODE_APPLY); + SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, NULL, + EnPametfrog_PostLimbDraw, &this->actor); + func_800BE680(globalCtx, &this->actor, &this->unk_2F4[0], 12, this->unk_2C8, this->unk_2CC, this->unk_2C4, + this->mode); +} diff --git a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.h b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.h index 8fe0d5a6f6..5c45d349ca 100644 --- a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.h +++ b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.h @@ -5,9 +5,47 @@ struct EnPametfrog; +typedef void (*EnPametfrogActionFunc)(struct EnPametfrog*, GlobalContext*); + +typedef enum { + /* 0x0 */ ENPAMETFROG_PRE_SNAPPER, + /* 0x1 */ ENPAMETFROG_GET_SNAPPER, + /* 0x2 */ ENPAMETFROG_INIT_SNAPPER, + /* 0x3 */ ENPAMETFROG_ON_SNAPPER, + /* 0x4 */ ENPAMETFROG_REAR_ON_SNAPPER, + /* 0x5 */ ENPAMETFROG_CUTSCENE, + /* 0x6 */ ENPAMETFROG_FALL_OFF_SNAPPER, + /* 0x7 */ ENPAMETFROG_RETURN_TO_SNAPPER, + /* 0x8 */ ENPAMETFROG_JUMP_ON_SNAPPER, + /* 0x9 */ ENPAMETFROG_DEFEAT, +} EnPametfrogState; + typedef struct EnPametfrog { /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x2E0]; + /* 0x144 */ SkelAnime skelAnime; + /* 0x188 */ Vec3s limbDrawTable[24]; + /* 0x218 */ Vec3s transitionDrawTable[24]; + /* 0x2A8 */ EnPametfrogActionFunc actionFunc; + /* 0x2AC */ u8 mode; // 0/10/20/30 + /* 0x2AD */ u8 wallPauseTimer; // Gekko stops 10 times along wall/ceiling after being blown off of Snapper + /* 0x2AE */ u8 unk_2AE; // True/False + /* 0x2B0 */ s16 cutscene; + /* 0x2B2 */ s16 params; + /* 0x2B4 */ s16 quake; + /* 0x2B6 */ s16 timer; + /* 0x2B8 */ s16 yaw; + /* 0x2BA */ s16 camId; + /* 0x2BC */ s16 freezeTimer; + /* 0x2C0 */ f32 wallRotation; + /* 0x2C4 */ f32 unk_2C4; + /* 0x2C8 */ f32 unk_2C8; + /* 0x2CC */ f32 unk_2CC; + /* 0x2D0 */ Vec3f unk_2D0; // MtxF zx/zy/zz + /* 0x2DC */ Vec3f unk_2DC; // MtxF yx/yy/yz: wallNorm/floorNorm/Base of Gekko walking??? + /* 0x2E8 */ Vec3f unk_2E8; // MtxF xx/xy/xz + /* 0x2F4 */ Vec3f unk_2F4[12]; + /* 0x384 */ ColliderJntSph collider; + /* 0x3A4 */ ColliderJntSphElement colElement[2]; } EnPametfrog; // size = 0x424 extern const ActorInit En_Pametfrog_InitVars; diff --git a/tables/functions.txt b/tables/functions.txt index cd5e8a8506..97ad8ce160 100644 --- a/tables/functions.txt +++ b/tables/functions.txt @@ -5003,73 +5003,73 @@ 0x808698F4:("EnBox_Draw",), 0x80869D90:("EnPametfrog_Init",), 0x80869F90:("EnPametfrog_Destroy",), - 0x80869FBC:("func_80869FBC",), + 0x80869FBC:("EnPametfrog_Vec3fNormalize",), 0x8086A024:("func_8086A024",), 0x8086A068:("func_8086A068",), - 0x8086A0F4:("func_8086A0F4",), - 0x8086A1A0:("func_8086A1A0",), + 0x8086A0F4:("EnPametfrog_JumpWaterEffects",), + 0x8086A1A0:("EnPametfrog_IdleWaterEffects",), 0x8086A238:("func_8086A238",), 0x8086A2CC:("func_8086A2CC",), - 0x8086A428:("func_8086A428",), - 0x8086A4E4:("func_8086A4E4",), - 0x8086A554:("func_8086A554",), - 0x8086A6B0:("func_8086A6B0",), + 0x8086A428:("EnPametfrog_ShakeCamera",), + 0x8086A4E4:("EnPametfrog_StopCutscene",), + 0x8086A554:("EnPametfrog_PlaceSnapper",), + 0x8086A6B0:("EnPametfrog_JumpOnGround",), 0x8086A724:("func_8086A724",), 0x8086A80C:("func_8086A80C",), 0x8086A878:("func_8086A878",), - 0x8086A8C0:("func_8086A8C0",), - 0x8086A964:("func_8086A964",), - 0x8086AA60:("func_8086AA60",), - 0x8086AAA8:("func_8086AAA8",), - 0x8086AB04:("func_8086AB04",), - 0x8086AB68:("func_8086AB68",), - 0x8086AC0C:("func_8086AC0C",), - 0x8086AD34:("func_8086AD34",), - 0x8086AE48:("func_8086AE48",), - 0x8086AEC8:("func_8086AEC8",), - 0x8086AFC8:("func_8086AFC8",), - 0x8086B140:("func_8086B140",), - 0x8086B478:("func_8086B478",), - 0x8086B570:("func_8086B570",), - 0x8086B66C:("func_8086B66C",), - 0x8086B794:("func_8086B794",), - 0x8086B864:("func_8086B864",), - 0x8086B8CC:("func_8086B8CC",), - 0x8086B9D0:("func_8086B9D0",), - 0x8086BA6C:("func_8086BA6C",), - 0x8086BB4C:("func_8086BB4C",), - 0x8086BB9C:("func_8086BB9C",), - 0x8086BBE0:("func_8086BBE0",), - 0x8086BDA8:("func_8086BDA8",), - 0x8086BE60:("func_8086BE60",), - 0x8086BEEC:("func_8086BEEC",), - 0x8086BF90:("func_8086BF90",), - 0x8086C088:("func_8086C088",), - 0x8086C0CC:("func_8086C0CC",), - 0x8086C1AC:("func_8086C1AC",), - 0x8086C274:("func_8086C274",), - 0x8086C4B8:("func_8086C4B8",), - 0x8086C5A8:("func_8086C5A8",), - 0x8086C618:("func_8086C618",), - 0x8086C6D0:("func_8086C6D0",), - 0x8086C72C:("func_8086C72C",), - 0x8086C7C8:("func_8086C7C8",), - 0x8086C81C:("func_8086C81C",), - 0x8086C94C:("func_8086C94C",), - 0x8086C99C:("func_8086C99C",), + 0x8086A8C0:("EnPametfrog_SetupRearOnSnapper",), + 0x8086A964:("EnPametfrog_RearOnSnapper",), + 0x8086AA60:("EnPametfrog_SetupRearOnSnapperWave",), + 0x8086AAA8:("EnPametfrog_RearOnSnapperWave",), + 0x8086AB04:("EnPametfrog_SetupRearOnSnapperRise",), + 0x8086AB68:("EnPametfrog_RearOnSnapperRise",), + 0x8086AC0C:("EnPametfrog_SetupFallOffSnapper",), + 0x8086AD34:("EnPametfrog_FallOffSnapper",), + 0x8086AE48:("EnPametfrog_SetupJumpToWall",), + 0x8086AEC8:("EnPametfrog_JumpToWall",), + 0x8086AFC8:("EnPametfrog_SetupWallCrawl",), + 0x8086B140:("EnPametfrog_WallCrawl",), + 0x8086B478:("EnPametfrog_SetupWallPause",), + 0x8086B570:("EnPametfrog_WallPause",), + 0x8086B66C:("EnPametfrog_SetupClimbDownWall",), + 0x8086B794:("EnPametfrog_ClimbDownWall",), + 0x8086B864:("EnPametfrog_SetupRunToSnapper",), + 0x8086B8CC:("EnPametfrog_RunToSnapper",), + 0x8086B9D0:("EnPametfrog_SetupJumpOnSnapper",), + 0x8086BA6C:("EnPametfrog_JumpOnSnapper",), + 0x8086BB4C:("EnPametfrog_SetupLandOnSnapper",), + 0x8086BB9C:("EnPametfrog_LandOnSnapper",), + 0x8086BBE0:("EnPametfrog_SetupFallInAir",), + 0x8086BDA8:("EnPametfrog_FallInAir",), + 0x8086BE60:("EnPametfrog_SetupFallOnGround",), + 0x8086BEEC:("EnPametfrog_FallOnGround",), + 0x8086BF90:("EnPametfrog_SetupDefeatGekko",), + 0x8086C088:("EnPametfrog_DefeatGekko",), + 0x8086C0CC:("EnPametfrog_SetupDefeatSnapper",), + 0x8086C1AC:("EnPametfrog_DefeatSnapper",), + 0x8086C274:("EnPametfrog_SetupSpawnFrog",), + 0x8086C4B8:("EnPametfrog_SpawnFrog",), + 0x8086C5A8:("EnPametfrog_SetupCutscene",), + 0x8086C618:("EnPametfrog_PlayCutscene",), + 0x8086C6D0:("EnPametfrog_SetupLookAround",), + 0x8086C72C:("EnPametfrog_LookAround",), + 0x8086C7C8:("EnPametfrog_SetupJumpToLink",), + 0x8086C81C:("EnPametfrog_JumpToLink",), + 0x8086C94C:("EnPametfrog_SetupMeleeAttack",), + 0x8086C99C:("EnPametfrog_MeleeAttack",), 0x8086CB4C:("func_8086CB4C",), 0x8086CC04:("func_8086CC04",), 0x8086CC84:("func_8086CC84",), 0x8086CD04:("func_8086CD04",), - 0x8086CD6C:("func_8086CD6C",), - 0x8086CEB4:("func_8086CEB4",), - 0x8086CEF0:("func_8086CEF0",), - 0x8086D084:("func_8086D084",), - 0x8086D140:("func_8086D140",), - 0x8086D1E8:("func_8086D1E8",), - 0x8086D230:("func_8086D230",), + 0x8086CD6C:("EnPametfrog_SetupCallSnapper",), + 0x8086CEB4:("EnPametfrog_CallSnapper",), + 0x8086CEF0:("EnPametfrog_SetupSnapperSpawn",), + 0x8086D084:("EnPametfrog_SnapperSpawn",), + 0x8086D140:("EnPametfrog_SetupTransitionGekkoSnapper",), + 0x8086D1E8:("EnPametfrog_TransitionGekkoSnapper",), + 0x8086D230:("EnPametfrog_ApplyDamage",), 0x8086D4C0:("EnPametfrog_Update",), - 0x8086D730:("func_8086D730",), + 0x8086D730:("EnPametfrog_PostLimbDraw",), 0x8086D898:("EnPametfrog_Draw",), 0x8086DE20:("EnOkuta_Init",), 0x8086E058:("EnOkuta_Destroy",), diff --git a/tables/variables.txt b/tables/variables.txt index 67961ed8d1..5917303d7f 100644 --- a/tables/variables.txt +++ b/tables/variables.txt @@ -5895,7 +5895,6 @@ 0x8086D9C8:("D_8086D9C8","UNK_TYPE1","",0x1), 0x8086D9D8:("D_8086D9D8","UNK_TYPE1","",0x1), 0x8086D9E0:("D_8086D9E0","UNK_TYPE1","",0x1), - 0x8086D9F0:("D_8086D9F0","UNK_TYPE1","",0x1), 0x8086DA04:("D_8086DA04","UNK_TYPE1","",0x1), 0x8086DA10:("D_8086DA10","UNK_TYPE1","",0x1), 0x8086DA14:("D_8086DA14","UNK_TYPE1","",0x1), diff --git a/tools/split_asm.py b/tools/split_asm.py index 48922064de..2bbba2ce4f 100755 --- a/tools/split_asm.py +++ b/tools/split_asm.py @@ -172,7 +172,7 @@ def split_asm_and_rodata(): for name in file_names: f.write('\n#pragma GLOBAL_ASM("{}")\n'.format(name)) -rodata_excluded = ["ovl_Bg_Dkjail_Ivy", "ovl_Bg_Ikana_Mirror", "ovl_Boss_02", "ovl_Boss_07", "ovl_Boss_Hakugin", "ovl_Elf_Msg", "ovl_Elf_Msg2", "ovl_Elf_Msg3", "ovl_Elf_Msg4", "ovl_Elf_Msg5", "ovl_En_Az", "ovl_En_Bigokuta", "ovl_En_Bigpamet", "ovl_En_Bigpo", "ovl_En_Bigslime", "ovl_En_Box", "ovl_En_Butte", "ovl_En_Col_Man", "ovl_En_Crow", "ovl_En_Death", "ovl_En_Elf", "ovl_En_Elforg", "ovl_En_Encount3", "ovl_En_Encount4", "ovl_En_Fish", "ovl_En_Fish2", "ovl_En_Fsn", "ovl_En_Honotrap", "ovl_En_Horse", "ovl_En_Horse_Game", "ovl_En_Invadepoh", "ovl_En_Ishi", "ovl_En_Kame", "ovl_En_Kanban", "ovl_En_Kusa2", "ovl_En_M_Thunder", "ovl_En_Maruta", "ovl_En_Mushi2", "ovl_En_Okuta", "ovl_En_Ossan", "ovl_En_Pametfrog", "ovl_En_Peehat", "ovl_En_Rg", "ovl_En_Ruppecrow", "ovl_En_Slime", "ovl_En_Sob1", "ovl_En_Syateki_Man", "ovl_En_Test7", "ovl_En_Trt", "ovl_En_Wiz_Fire", "ovl_Mir_Ray", "ovl_Obj_Bombiwa", "ovl_Obj_Driftice", "ovl_Obj_Hariko", "ovl_Obj_Iceblock", "ovl_Obj_Mure", "ovl_Obj_Snowball2", "ovl_Obj_Toudai", "ovl_select"] +rodata_excluded = ["ovl_Bg_Dkjail_Ivy", "ovl_Bg_Ikana_Mirror", "ovl_Boss_02", "ovl_Boss_07", "ovl_Boss_Hakugin", "ovl_Elf_Msg", "ovl_Elf_Msg2", "ovl_Elf_Msg3", "ovl_Elf_Msg4", "ovl_Elf_Msg5", "ovl_En_Az", "ovl_En_Bigokuta", "ovl_En_Bigpamet", "ovl_En_Bigpo", "ovl_En_Bigslime", "ovl_En_Box", "ovl_En_Butte", "ovl_En_Col_Man", "ovl_En_Crow", "ovl_En_Death", "ovl_En_Elf", "ovl_En_Elforg", "ovl_En_Encount3", "ovl_En_Encount4", "ovl_En_Fish", "ovl_En_Fish2", "ovl_En_Fsn", "ovl_En_Honotrap", "ovl_En_Horse", "ovl_En_Horse_Game", "ovl_En_Invadepoh", "ovl_En_Ishi", "ovl_En_Kame", "ovl_En_Kanban", "ovl_En_Kusa2", "ovl_En_M_Thunder", "ovl_En_Maruta", "ovl_En_Mushi2", "ovl_En_Okuta", "ovl_En_Ossan", "ovl_En_Peehat", "ovl_En_Rg", "ovl_En_Ruppecrow", "ovl_En_Slime", "ovl_En_Sob1", "ovl_En_Syateki_Man", "ovl_En_Test7", "ovl_En_Trt", "ovl_En_Wiz_Fire", "ovl_Mir_Ray", "ovl_Obj_Bombiwa", "ovl_Obj_Driftice", "ovl_Obj_Hariko", "ovl_Obj_Iceblock", "ovl_Obj_Mure", "ovl_Obj_Snowball2", "ovl_Obj_Toudai", "ovl_select"] rodata_included = ["z_en_item00"] if __name__ == '__main__':