From 09ce212b761109b500176f8cc6de3c46a5faafc3 Mon Sep 17 00:00:00 2001 From: Josh Sanchez Date: Sat, 12 Apr 2025 15:59:15 -0500 Subject: [PATCH 1/5] zNPCTypeVillager: Limit scope of g_sndTrax_Villager --- src/SB/Game/zNPCTypeVillager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SB/Game/zNPCTypeVillager.h b/src/SB/Game/zNPCTypeVillager.h index 2c1b95dc7..b3e1b522e 100644 --- a/src/SB/Game/zNPCTypeVillager.h +++ b/src/SB/Game/zNPCTypeVillager.h @@ -225,12 +225,12 @@ void ZNPC_Villager_Startup(); void ZNPC_Villager_Shutdown(); xFactoryInst* ZNPC_Create_Villager(S32 who, RyzMemGrow* growCtxt, void*); void ZNPC_Destroy_Villager(xFactoryInst* inst); -NPCSndTrax g_sndTrax_Villager; S32 zParamGetFloatList(xModelAssetParam* parmdata, U32 pdatsize, const char* str32, S32 found, F32* non_choices, F32 len_mvptspline); void zNPCVillager_SceneFinish(); void zNPCVillager_SceneTimestep(xScene* xscn, F32 dt); +extern NPCSndTrax g_sndTrax_Villager; extern NPCSndTrax g_sndTrax_VillagerMale; extern NPCSndTrax g_sndTrax_VillagerFemale; extern NPCSndTrax g_sndTrax_VillagerElder; From 50977af4fed9caf1ce3dd1f2feb287629fd135e7 Mon Sep 17 00:00:00 2001 From: Josh Sanchez Date: Sat, 12 Apr 2025 15:59:37 -0500 Subject: [PATCH 2/5] zNPCTypeBossSandy: Add SandyLimbSpring struct from DWARF data --- src/SB/Game/zNPCTypeBossSandy.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/SB/Game/zNPCTypeBossSandy.h b/src/SB/Game/zNPCTypeBossSandy.h index 178bb7a47..7801e20d1 100644 --- a/src/SB/Game/zNPCTypeBossSandy.h +++ b/src/SB/Game/zNPCTypeBossSandy.h @@ -294,6 +294,15 @@ struct zNPCGoalBossSandyClothesline : zNPCGoalCommon } }; +struct SandyLimbSpring +{ + F32 node1; + F32 vel1; + F32 node2; + F32 vel2; + xBound* bound; +}; + void zNPCBSandy_AddBoundEntsToGrid(zScene*); void zNPCBSandy_GameIsPaused(zScene*); From 12da3cb2b7f325fa5a44daa1ff6df861b470ad85 Mon Sep 17 00:00:00 2001 From: Josh Sanchez Date: Sat, 12 Apr 2025 16:02:44 -0500 Subject: [PATCH 3/5] zNPCTypeBossSandy: Unextern floats and match most data --- src/SB/Game/zNPCTypeBossSandy.cpp | 275 +++++++++++++----------------- 1 file changed, 120 insertions(+), 155 deletions(-) diff --git a/src/SB/Game/zNPCTypeBossSandy.cpp b/src/SB/Game/zNPCTypeBossSandy.cpp index c1a50ac90..ff7451f5e 100644 --- a/src/SB/Game/zNPCTypeBossSandy.cpp +++ b/src/SB/Game/zNPCTypeBossSandy.cpp @@ -11,6 +11,7 @@ #include "zGlobals.h" #include "zNPCSndTable.h" #include "zNPCTypeBossSandy.h" +#include "xMarkerAsset.h" extern const char bossSandyStrings[]; @@ -43,105 +44,69 @@ extern const char bossSandyStrings[]; #define NoHeadReplace01 27 #define NoHeadHit01 28 -extern F32 __830; // 0.0 0 -extern F32 __831; // 1.0 3f800000 -extern F32 __842; // 0.20000000298023224 3e4ccccd -extern F32 _843; // 3.3333332538604736 40555555 -extern F32 _864; // 0.25 3e800000 -extern F32 _1029; // 6.2831854820251465 40c90fdb -extern F32 _1030; // 0.0625 3d800000 -extern F32 _1031; // 255.0 437f0000 -extern F32 _1032; // 0.5 3f000000 -extern F32 _1033; // -1.0 bf800000 -extern F32 _1034; // 20.0 41a00000 -extern F32 _1035; // 10.0 41200000 -extern F32 _1036; // 1000000000.0 4e6e6b28 -extern F32 _1037; // 2.25 40100000 -extern F32 _1039; // 176.0 43300000 -extern F32 _1061_1; // 6.0 40c00000 -extern F32 _1062_1; // 1.2999999523162842 3fa66666 -extern F32 _1063; // 2.0 40000000 -extern F32 _1064; // 3.0 40400000 -extern F32 _1065; // 8.199999809265137 41033333 -extern F32 _1066; // 4.0 40800000 -extern F32 _1067; // 4.5 40900000 -extern F32 _1068; // 0.15000000596046448 3e19999a -extern F32 _1069; // -0.4000000059604645 becccccd -extern F32 _1070; // 9.699999809265137 411b3333 -extern F32 _1071; // 7.0 40e00000 -extern F32 _1072; // 5.0 40a00000 -extern F32 _1188_1; // -0.30000001192092896 be99999a -extern F32 _1189; // 1.25 3fa00000 -extern F32 _1190; // 0.035999998450279236 3d1374bc -extern F32 _1191; // 0.10999999940395355 3de147ae -extern F32 _1192_1; // 0.10000000149011612 3dcccccd -extern F32 _1193; // -10.0 c1200000 -extern F32 _1194; // 6.041999816894531 40c15810 -extern F32 _1195; // 0.125 3e000000 -extern F32 _1196; // 100.0 42c80000 -extern F32 _1209; // 9.999999747378752e-06 3727c5ac -extern F32 _1378; // 478.0 43ef0000 -extern F32 _1379; // 0.6000000238418579 3f19999a -extern F32 _1380; // 0.8999999761581421 3f666666 -extern F32 _1381; // 1.100000023841858 3f8ccccd -extern F32 _1462; // 9.0 41100000 -extern F32 _1463; // 0.30000001192092896 3e99999a -extern F32 _1464; // 0.699999988079071 3f333333 -extern F32 _1465; // 3.1415927410125732 40490fdb -extern F32 _1466; // 0.75 3f400000 -extern F32 _1521; // 0.800000011920929 3f4ccccd -extern F32 _1522; // -0.800000011920929 bf4ccccd -extern F32 _1523; // -2.0 c0000000 -extern F32 _1524; // 66.0 42840000 -extern F32 _1525; // -2500.0 c51c4000 -extern F32 _1526_0; // -1.5 bfc00000 -extern F32 _1527; // 13.0 41500000 -extern F32 _1528; // 3.5 40600000 -extern F32 _1529; // -2.5 c0200000 -extern F32 _1530; // 25.0 41c80000 -extern F32 _1531; // 15.0 41700000 -extern F32 _1666; // 0.4000000059604645 3ecccccd -extern F32 _1667; // -3.1415927410125732 c0490fdb -extern F32 _1935; // 60.0 42700000 -extern F32 _1936; // 0.9900000095367432 3f7d70a4 -extern F32 _1937; // 0.009999999776482582 3c23d70a -extern F32 _1938; // 2.950000047683716 403ccccd -extern F32 _1939; // 15.5 41780000 -extern F32 _1940; // 1.5 3fc00000 -extern F32 _1941; // 40.0 42200000 -extern F32 _1942; // 0.8100000023841858 3f4f5c29 -extern F32 _2154; // 30.0 41f00000 -extern F32 _2155; // -9.999999747378752e-06 b727c5ac -extern F32 _2156; // 2.309999942779541 4013d70a -extern F32 _2173; // 12.0 41400000 -extern F32 _2236; // 0.7070000171661377 3f34fdf4 -extern F32 _2237; // 2.5 40200000 -extern F32 _2264; // 1.7000000476837158 3fd9999a -extern F32 _2265; // 0.7699999809265137 3f451eb8 -extern F32 _2376; // 0.9800000190734863 3f7ae148 -extern F32 _2377; // 0.019999999552965164 3ca3d70a -extern F32 _2517; // 1.1549999713897705 3f93d70a -extern F32 _2518; // 80.0 42a00000 -extern F32 _2519; // 31.0 41f80000 -extern F32 _2520; // 42.0 42280000 -extern F32 _2525; // 0.6499999761581421 3f266666 -extern F32 _2582; // -3.0 c0400000 -extern F32 _2633; // 5.25 40a80000 -extern F32 _2741; // 0.0010000000474974513 3a83126f -extern F32 _2742; // 4.71238899230957 4096cbe4 -extern F32 _2818; // 1.75 3fe00000 -extern F32 _2903; // 0.05000000074505806 3d4ccccd -extern F32 _2904; // -0.05000000074505806 bd4ccccd +static F32 sSinTable[16]; +static SandyLimbSpring sLeftArmSpring; +static SandyLimbSpring sRightArmSpring; +static SandyLimbSpring sLeftLegSpring; +static SandyLimbSpring sRightLegSpring; +static xVec3 sCamSubTargetFixed; +static U32 sNFSoundValue[30]; +static BossDamageEffectRecord BDErecord[4]; + +static U8 sOthersHaventBeenAdded; +static U8 sPCWasBubbleBouncing; +static F32 sRadiusOfRing; +static F32 sElbowDropTimer; +static F32 sChaseTimer; +static F32 sNumAttacks; +static F32 sDidClothesline; +static F32 sElbowDropThreshold; +static zNPCBSandy* sSandyPtr; +static xVec3* sCamSubTarget; +static F32 sCurrYaw; +static F32 sCurrHeight; +static F32 sCurrRadius; +static F32 sCurrPitch; +static U32 sCurrNFSound; + +static U8 sUseBossCam = TRUE; +static U8 sWasUsingBossCam = TRUE; +static F32 sPCHeightDiff = -1.0f; +static F32 sHeadPopOffFactor = -1.0f; +static S32 sLeftFootBones[2] = { 0x2B, 0x2C }; +static S32 sRightFootBones[2] = { 0x30, 0x31 }; + +static S32 sBone[13] = { + 0x3, 0x5, 0x12, 0x14, 0x19, 0x1B, 0x22, 0x24, 0x26, 0x29, 0x2B, 0x2E, 0x30 +}; +static S32 sLeftHandBones[4] = { 0x14, 0x15, 0x16, 0x17 }; +static S32 sRightHandBones[4] = { 0x1B, 0x1C, 0x1D, 0x1E }; +static F32 sBoundRadius[13] = { 1.4f, 1.3f, -1.0f, 0.6f, -1.0f, 0.6f, 0.6f, + 0.69999999f, 0.8f, -1.0f, 0.89999999f, -1.0f, 0.89999999f }; +static xVec3 sBoneOffset[13] = { {}, + { 0.0f, 1.1f, 0.0f }, + {}, + { 0.3f, 0.0f, 0.0f }, + {}, + { -0.3f, 0.0f, 0.0f }, + { 0.0f, 0.2f, 0.0f }, + { 0.0f, 0.2f, 0.0f }, + {}, + {}, + { 0.0f, -0.6f, 0.3f }, + {}, + { 0.0f, -0.6f, 0.3f } }; +static char* sNFSoundLabel[30] = { + "FAB1006", "FAB1007", "FAB1008", "FAB1009", "FAB1010", "FAB1011", "FAB1012", "FAB1013", + "FAB1014", "FAB1015", "FAB1016", "FAB1017", "FAB1018", "FAB1018", "FAB1018", "FAB1018", + "FAB1018", "FAB1018", "FAB1019", "FAB1020", "FAB1021", "FAB1022", "FAB1023", "FAB1024", + "FAB1025", "FAB1026", "FAB1027", "FAB1028", "FAB1029", "FAB1030" +}; extern zGlobals globals; -extern zNPCBSandy* sSandyPtr; -extern U32 sCurrNFSound; - extern NPCSndTrax g_sndTrax_BossSandy[1]; -extern BossDamageEffectRecord BDErecord[4]; - void on_change_newsfish(const tweak_info& tweak) { sSandyPtr->newsfish->SpeakStart(sCurrNFSound, 0, -1); @@ -154,8 +119,8 @@ void on_change_shockwave(const tweak_info& tweak) xVec3Copy((xVec3*)(&sSandyPtr->shockwaveEmitter->tasset->pos), (xVec3*)(&sSandyPtr->model->Mat->pos)); - sSandyPtr->shockwaveEmitter->tasset->pos.y = __830; - sSandyPtr->shockRadius = __831; + sSandyPtr->shockwaveEmitter->tasset->pos.y = 0.0f; + sSandyPtr->shockRadius = 1.0f; } xAnimTable* ZNPC_AnimTable_BossSandy() @@ -196,54 +161,54 @@ xAnimTable* ZNPC_AnimTable_BossSandy() //Missing like 2 logic lines or something, too tired to figure it out xAnimTable* table = xAnimTableNew("zNPCBSandy", NULL, 0); - xAnimTableNewState(table, g_strz_bossanim[Unknown], 0x10, 0x40, __831, NULL, NULL, __830, NULL, - NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[Idle02], 0x10, 0x40, __831, NULL, NULL, __830, NULL, + xAnimTableNewState(table, g_strz_bossanim[Unknown], 0x10, 0x40, 1.0f, NULL, NULL, 0.0f, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[Taunt01], 0x10, 0, __831, NULL, NULL, __830, NULL, + xAnimTableNewState(table, g_strz_bossanim[Idle02], 0x10, 0x40, 1.0f, NULL, NULL, 0.0f, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[Run01], 0x10, 0, __831, NULL, NULL, __830, NULL, NULL, + xAnimTableNewState(table, g_strz_bossanim[Taunt01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[Walk01], 0x10, 0, __831, NULL, NULL, __830, NULL, - NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[Dizzy01], 0x10, 0, __831, NULL, NULL, __830, NULL, - NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[ElbowDrop01], 0x10, 0, __831, NULL, NULL, __830, NULL, - NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[Leap01], 0x10, 0, __831, NULL, NULL, __830, NULL, - NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[Leap02], 0x10, 0, __831, NULL, NULL, __830, NULL, - NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[Leap03], 0x10, 0, __831, NULL, NULL, __830, NULL, - NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[Leap04], 0x10, 0, __831, NULL, NULL, __830, NULL, + xAnimTableNewState(table, g_strz_bossanim[Run01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[Walk01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[Dizzy01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[ElbowDrop01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[Sit01], 0x10, 0, __831, NULL, NULL, __830, NULL, NULL, + xAnimTableNewState(table, g_strz_bossanim[Leap01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[Leap02], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[Leap03], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[Hit02], 0x10, 0, __831, NULL, NULL, __830, NULL, NULL, + xAnimTableNewState(table, g_strz_bossanim[Leap04], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[SitShock01], 0x10, 0, __831, NULL, NULL, __830, NULL, + xAnimTableNewState(table, g_strz_bossanim[Sit01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[Hit02], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[SitShock01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[CLBegin01], 0x10, 0, __831, NULL, NULL, __830, NULL, + xAnimTableNewState(table, g_strz_bossanim[CLBegin01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[CLLoop01], 0x10, 0, __831, NULL, NULL, __830, NULL, + xAnimTableNewState(table, g_strz_bossanim[CLLoop01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[CLEnd01], 0x10, 0, __831, NULL, NULL, __830, NULL, + xAnimTableNewState(table, g_strz_bossanim[CLEnd01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[NoHeadIdle01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[NoHeadIdle01], 0x10, 0, __831, NULL, NULL, __830, + xAnimTableNewState(table, g_strz_bossanim[NoHeadWaving01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[NoHeadWaving01], 0x10, 0, __831, NULL, NULL, __830, - NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[NoHeadGetUp01], 0x10, 0, __831, NULL, NULL, __830, - NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[NoHeadShotUp01], 0x10, 0, __831, NULL, NULL, __830, - NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[NoHeadShock01], 0x10, 0, __831, NULL, NULL, __830, + xAnimTableNewState(table, g_strz_bossanim[NoHeadGetUp01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[NoHeadShotUp01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, g_strz_bossanim[NoHeadReplace01], 0x10, 0, __831, NULL, NULL, __830, + xAnimTableNewState(table, g_strz_bossanim[NoHeadShock01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[NoHeadReplace01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - NPCC_BuildStandardAnimTran(table, g_strz_bossanim, ourAnims, 1, __842); + NPCC_BuildStandardAnimTran(table, g_strz_bossanim, ourAnims, 1, 0.20000000298023224f); return table; } @@ -279,21 +244,21 @@ xAnimTable* ZNPC_AnimTable_BossSandyHead() table = xAnimTableNew(str_SandyBossHead, NULL, 0); - xAnimTableNewState(table, str_Idle01, 0x10, 0, __831, NULL, NULL, __830, NULL, NULL, + xAnimTableNewState(table, str_Idle01, 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, str_Carried01, 0x10, 0, __831, NULL, NULL, __830, NULL, NULL, + xAnimTableNewState(table, str_Carried01, 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewState(table, str_Shocked01, 0x10, 0, __831, NULL, NULL, __830, NULL, NULL, + xAnimTableNewState(table, str_Shocked01, 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - xAnimTableNewTransition(table, str_Idle01, str_Carried01, HeadIsCarried, NULL, 0, 0, __830, - __830, 0, 0, _864, NULL); - xAnimTableNewTransition(table, str_Carried01, str_Idle01, HeadNotCarried, NULL, 0, 0, __830, - __830, 0, 0, _864, NULL); - xAnimTableNewTransition(table, str_Idle01, str_Shocked01, HeadIsShocked, NULL, 0, 0, __830, - __830, 0, 0, _864, NULL); - xAnimTableNewTransition(table, str_Shocked01, str_Idle01, HeadNotShocked, NULL, 0, 0, __830, - __830, 0, 0, _864, NULL); + xAnimTableNewTransition(table, str_Idle01, str_Carried01, HeadIsCarried, NULL, 0, 0, 0.0f, 0.0f, + 0, 0, 0.25f, NULL); + xAnimTableNewTransition(table, str_Carried01, str_Idle01, HeadNotCarried, NULL, 0, 0, 0.0f, + 0.0f, 0, 0, 0.25f, NULL); + xAnimTableNewTransition(table, str_Idle01, str_Shocked01, HeadIsShocked, NULL, 0, 0, 0.0f, 0.0f, + 0, 0, 0.25f, NULL); + xAnimTableNewTransition(table, str_Shocked01, str_Idle01, HeadNotShocked, NULL, 0, 0, 0.0f, + 0.0f, 0, 0, 0.25f, NULL); return table; } @@ -347,7 +312,7 @@ void zNPCBSandy::hiddenByCutscene() { this->underwear[i]->state = (this->underwear[i]->state & 0xffffffc0) | 1; zEntEvent(this->underwear[i], eEventCollision_Visible_On); - this->underwear[i]->timer = __830; // 0.0 + this->underwear[i]->timer = 0.0f; // 0.0 } switch (this->round) @@ -447,13 +412,13 @@ S32 idleCB(xGoal* rawgoal, void*, en_trantype* trantype, F32, void*) xVec3Sub(&tempVector, (xVec3*)&globals.player.ent.model->Mat->pos, (xVec3*)&sandy->model->Mat->pos); - tempVector.y = __830; // 0.0 + tempVector.y = 0.0f; // 0.0 F32 length = xVec3Length2(&tempVector); - if (idle->timeInGoal > _1463) // 0.3 + if (idle->timeInGoal > 0.30000001192092896f) // 0.3 { - if (length > _2173) // 12.0 + if (length > 12.0f) // 12.0 { *trantype = GOAL_TRAN_SET; nextgoal = 'NGB3'; @@ -475,7 +440,7 @@ S32 tauntCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) S32 nextgoal = 0; xVec3 tempVector; - if (taunt->timeInGoal > _1463) // 0.3 + if (taunt->timeInGoal > 0.30000001192092896f) // 0.3 { if (sandy->bossFlags & 0x400) { @@ -487,18 +452,18 @@ S32 tauntCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) xVec3Sub(&tempVector, (xVec3*)&globals.player.ent.model->Mat->pos, (xVec3*)&sandy->model->Mat->pos); - tempVector.y = __830; // 0.0 + tempVector.y = 0.0f; // 0.0 F32 length = xVec3Length2(&tempVector); - if (sandy->AnimTimeRemain(NULL) < _1381 * dt) // 1.1 + if (sandy->AnimTimeRemain(NULL) < 1.100000023841858f * dt) // 1.1 { if (globals.player.ControlOff) { *trantype = GOAL_TRAN_SET; nextgoal = 'NGB1'; } - else if (length > _2173) // 12.0 + else if (length > 12.0f) // 12.0 { *trantype = GOAL_TRAN_SET; nextgoal = 'NGB3'; @@ -521,7 +486,7 @@ S32 noHeadCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) if (noHead->stage == 4 || noHead->stage == 5) { - if (sandy->AnimTimeRemain(NULL) < _2264 * dt) // 1.7 + if (sandy->AnimTimeRemain(NULL) < 1.7000000476837158f * dt) // 1.7 { *trantype = GOAL_TRAN_SET; nextgoal = 'NGB1'; @@ -538,7 +503,7 @@ S32 elbowDropCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) S32 nextgoal = 0; xVec3 tempVector; - if (edrop->timeInGoal > _1463) // 0.3 + if (edrop->timeInGoal > 0.30000001192092896f) // 0.3 { if (sandy->bossFlags & 0x400) { @@ -550,11 +515,11 @@ S32 elbowDropCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) xVec3Sub(&tempVector, (xVec3*)&globals.player.ent.model->Mat->pos, (xVec3*)&sandy->model->Mat->pos); - tempVector.y = __830; // 0.0 + tempVector.y = 0.0f; // 0.0 F32 length = xVec3Length2(&tempVector); - if (sandy->AnimTimeRemain(NULL) < _2264 * dt) // 1.7 + if (sandy->AnimTimeRemain(NULL) < 1.7000000476837158f * dt) // 1.7 { if (globals.player.ControlOff) { @@ -567,7 +532,7 @@ S32 elbowDropCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) *trantype = GOAL_TRAN_SET; nextgoal = 'NGB2'; } - else if (length < _2173) // 12.0 + else if (length < 12.0f) // 12.0 { *trantype = GOAL_TRAN_SET; nextgoal = 'NGB4'; @@ -590,7 +555,7 @@ S32 leapCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) if (leap->stage == 3) { - if (sandy->AnimTimeRemain(NULL) < _2264 * dt) // 1.7 + if (sandy->AnimTimeRemain(NULL) < 1.7000000476837158f * dt) // 1.7 { if (sandy->bossFlags & 2) { From 386f05c31f86c694bdda955902bcba57e172afc0 Mon Sep 17 00:00:00 2001 From: Josh Sanchez Date: Sat, 12 Apr 2025 22:47:07 -0500 Subject: [PATCH 4/5] Sandy: Several function matches + some WIP --- src/SB/Game/zNPCTypeBossSandy.cpp | 410 +++++++++++++++++++++++++++++- src/SB/Game/zNPCTypeBossSandy.h | 39 +++ 2 files changed, 444 insertions(+), 5 deletions(-) diff --git a/src/SB/Game/zNPCTypeBossSandy.cpp b/src/SB/Game/zNPCTypeBossSandy.cpp index ff7451f5e..5a3ab95f5 100644 --- a/src/SB/Game/zNPCTypeBossSandy.cpp +++ b/src/SB/Game/zNPCTypeBossSandy.cpp @@ -5,6 +5,7 @@ #include "xEvent.h" #include "xCamera.h" #include "xMath3.h" +#include "xDebug.h" #include "zEnt.h" #include "zFX.h" @@ -12,6 +13,8 @@ #include "zNPCSndTable.h" #include "zNPCTypeBossSandy.h" #include "xMarkerAsset.h" +#include "zCamera.h" +#include "zGrid.h" extern const char bossSandyStrings[]; @@ -103,10 +106,25 @@ static char* sNFSoundLabel[30] = { "FAB1025", "FAB1026", "FAB1027", "FAB1028", "FAB1029", "FAB1030" }; +static const tweak_callback newsfish_cb = {}; +static const tweak_callback shockwave_cb = {}; + extern zGlobals globals; extern NPCSndTrax g_sndTrax_BossSandy[1]; +static S32 idleCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*); +static S32 tauntCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*); +static S32 noHeadCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*); +static S32 elbowDropCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*); +static S32 leapCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*); +static S32 chaseCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*); +static S32 meleeCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*); +static S32 sitCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*); +static S32 getUpCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*); +static S32 runToRopeCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*); +static S32 clotheslineCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*); + void on_change_newsfish(const tweak_info& tweak) { sSandyPtr->newsfish->SpeakStart(sCurrNFSound, 0, -1); @@ -263,6 +281,140 @@ xAnimTable* ZNPC_AnimTable_BossSandyHead() return table; } +void zNPCBSandy::Init(xEntAsset* asset) +{ + S32 i; + xEnt* ent; + char objName[32]; + xMarkerAsset* laserMarker; + U32 colorPicker; + RwRGBA* _col; + // RwRGBA* _col; + // RwRGBA* _col; + // RwRGBA* _col; + + zNPCCommon::Init(asset); + sSandyPtr = this; + + round = 1; + firstTimeR1Csn = 1; + boundFlags = (U32*)xMemAlloc(gActiveHeap, 13 * sizeof(U32), 0x0); + boundList = (xEnt**)xMemAlloc(gActiveHeap, 13 * sizeof(xEnt*), 0x0); + + for (i = 0; i < 13; i++) + { + } +} + +void zNPCBSandy::Setup() +{ + S32 i; + char objName[32]; + + newsfish = (zNPCNewsFish*)zSceneFindObject(xStrHash("NPC_NEWSCASTER")); + newsfish->TalkOnScreen(1); + + strcpy(objName, "HEALTH_00"); + for (i = 0; i < 3; i++) + { + objName[8] = '1' + (char)i; + underwear[i] = (zEntPickup*)zSceneFindObject(xStrHash(objName)); + } + + // Configure and initialize bossCam + bossCam.cfg.zone_rest.distance = 6.0f; + bossCam.cfg.zone_rest.height = 1.3f; + bossCam.cfg.zone_rest.height_focus = 2.0f; + + bossCam.cfg.zone_above.distance = 3.0f; + bossCam.cfg.zone_above.height = 8.2f; + bossCam.cfg.zone_above.height_focus = 4.0f; + + bossCam.cfg.zone_below.distance = 4.5f; + bossCam.cfg.zone_below.height = 0.15f; + bossCam.cfg.zone_below.height_focus = 2.0f; + + bossCam.cfg.move_speed = 10.0f; + bossCam.cfg.turn_speed = 10.0f; + bossCam.cfg.stick_speed = 10.0f; + bossCam.cfg.stick_yaw_vel = 10.0f; + bossCam.cfg.max_yaw_vel = 10.0f; + bossCam.cfg.margin_angle = -0.4f; + + bossCam.init(); + bossCam.add_tweaks("NPC|zNPCBSandy|Boss Cam|"); + + // Configure and initialize specialBossCam + specialBossCam.cfg.zone_rest.distance = 9.7f; + specialBossCam.cfg.zone_rest.height = 4.0f; + specialBossCam.cfg.zone_rest.height_focus = 4.0f; + + specialBossCam.cfg.zone_above.distance = 10.0f; + specialBossCam.cfg.zone_above.height = 7.0f; + specialBossCam.cfg.zone_above.height_focus = 0.15f; + + specialBossCam.cfg.zone_below.distance = 10.0f; + specialBossCam.cfg.zone_below.height = 0.5f; + specialBossCam.cfg.zone_below.height_focus = 5.0f; + + specialBossCam.cfg.move_speed = 10.0f; + specialBossCam.cfg.turn_speed = 10.0f; + specialBossCam.cfg.stick_speed = 10.0f; + specialBossCam.cfg.stick_yaw_vel = 10.0f; + specialBossCam.cfg.max_yaw_vel = 10.0f; + specialBossCam.cfg.margin_angle = -0.4f; + + specialBossCam.init(); + specialBossCam.add_tweaks("NPC|zNPCBSandy|Mat Smash Cam|"); + + zNPCCommon::Setup(); +} + +void zNPCBSandy::SelfSetup() +{ + xBehaveMgr* bmgr = xBehaveMgr_GetSelf(); + psy_instinct = bmgr->Subscribe(this, 0); + + xPsyche* psy = psy_instinct; + psy->BrainBegin(); + + xGoal* goal = psy->AddGoal('NGB1', NULL); + goal->SetCallbacks(idleCB, NULL, NULL, NULL); + + goal = psy->AddGoal('NGB2', NULL); + goal->SetCallbacks(tauntCB, NULL, NULL, NULL); + + goal = psy->AddGoal('NGB3', NULL); + goal->SetCallbacks(chaseCB, NULL, NULL, NULL); + + goal = psy->AddGoal('NGB4', NULL); + goal->SetCallbacks(meleeCB, NULL, NULL, NULL); + + goal = psy->AddGoal('NGB5', NULL); + goal->SetCallbacks(noHeadCB, NULL, NULL, NULL); + + goal = psy->AddGoal('NGB6', NULL); + goal->SetCallbacks(elbowDropCB, NULL, NULL, NULL); + + goal = psy->AddGoal('NGB7', NULL); + goal->SetCallbacks(leapCB, NULL, NULL, NULL); + + goal = psy->AddGoal('NGB8', NULL); + goal->SetCallbacks(sitCB, NULL, NULL, NULL); + + goal = psy->AddGoal('NGB9', NULL); + goal->SetCallbacks(getUpCB, NULL, NULL, NULL); + + goal = psy->AddGoal('NGB:', NULL); + goal->SetCallbacks(runToRopeCB, NULL, NULL, NULL); + + goal = psy->AddGoal('NGB;', NULL); + goal->SetCallbacks(clotheslineCB, NULL, NULL, NULL); + + psy->BrainEnd(); + psy->SetSafety('NGB1'); +} + void zNPCBSandy::ParseINI() { zNPCCommon::ParseINI(); @@ -273,6 +425,119 @@ void zNPCBSandy::ParseINI() NPCS_SndTablePrepare(g_sndTrax_BossSandy); } +U32 zNPCBSandy::AnimPick(S32 gid, en_NPC_GOAL_SPOT param_2, xGoal* rawgoal) +{ + S32 index = -1; + U32 animID = 0; + zNPCGoalBossSandyClothesline* cl; + + switch (gid) + { + case 'NGB1': + index = 1; + break; + case 'NGB2': + index = 3; + break; + case 'NGB3': + index = 5; + break; + case 'NGB4': + index = 6; + break; + case 'NGB5': + zNPCGoalBossSandyNoHead* noHeadGoal = (zNPCGoalBossSandyNoHead*)rawgoal; + U32 anid = noHeadGoal->stage; + if (anid == 0) + { + if (round == 2) + { + index = 23; + } + else + { + index = 24; + } + } + else if (anid == 1) + { + if (round == 2) + { + index = 21; + } + else + { + index = 22; + } + } + else if (anid == 2) + { + index = 25; + } + else if (anid == 3) + { + index = 21; + } + else if (anid == 4) + { + index = 26; + } + else if (anid == 5) + { + index = 27; + } + break; + case 'NGB6': + index = 11; + break; + case 'NGB7': + index = 12; + break; + case 'NGB8': + zNPCGoalBossSandySit* sitGoal = (zNPCGoalBossSandySit*)rawgoal; + if ((sitGoal->sitFlags & 2) != 0x0) + { + index = 17; + } + else + { + index = 16; + } + break; + case 'NGB:': + index = 4; + break; + case 'NGB;': + cl = (zNPCGoalBossSandyClothesline*)rawgoal; + if (cl->stage == 0) + { + index = 18; + } + else if (cl->stage == 1 && cl->playedAnimEarly == FALSE) + { + index = 19; + } + else + { + index = 20; + } + break; + case 'NGB9': + index = 9; + break; + default: + index = 1; + break; + } + + if (index > -1) + { + animID = g_hash_bossanim[index]; + } + + return animID; +} + void zNPCBSandy_BossDamageEffect_Init() { for (S32 i = 0; i < 4; i++) @@ -281,6 +546,76 @@ void zNPCBSandy_BossDamageEffect_Init() } } +static void UpdateSandyBossCam(zNPCBSandy* sandy, F32 dt) +{ + S32 needToCallStart = 0; + xVec3 tempTarget; + + if ((zCameraIsTrackingDisabled() & 0x8) == 0) + { + needToCallStart = 1; + } + + zCameraDisableTracking(CO_BOSS); + + if (needToCallStart) + { + sandy->bossCam.start(globals.camera); + } + + if (sandy->bossFlags & 0x40) + { + if ((sandy->bossFlags & 0x2000) == 0) + { + sandy->specialBossCam.start(globals.camera); + } + + tempTarget.x = globals.player.ent.model->Mat->pos.x; + tempTarget.y = 0.0f; + tempTarget.z = globals.player.ent.model->Mat->pos.z; + sandy->specialBossCam.set_targets(tempTarget, (xVec3&)sCamSubTarget, 2.0f); + + if ((sandy->bossFlags & 0x4000)) + { + sandy->specialBossCam.update(10.0f); + sandy->bossFlags &= ~0x4000; + } + else + { + sandy->specialBossCam.update(dt); + } + } + else + { + if (sandy->bossFlags & 0x2000) + { + sandy->bossCam.start(globals.camera); + } + + sandy->bossCam.set_targets(*((xVec3*)&globals.player.ent.model->Mat->pos), + (xVec3&)sCamSubTarget, 10.0f); + + if (sandy->bossFlags & 0x4000) + { + sandy->bossCam.update(10.0f); + sandy->bossFlags &= ~0x4000; + } + else + { + sandy->bossCam.update(dt); + } + } + + if (sandy->bossFlags & 0x40) + { + sandy->bossFlags |= 0x2000; + } + else + { + sandy->bossFlags &= ~0x2000; + } +} + static void GetBonePos(xVec3* result, xMat4x3* matArray, S32 index, xVec3* offset) { xMat4x3 tmpMat; @@ -375,6 +710,54 @@ void zNPCBSandy::Damage(en_NPC_DAMAGE_TYPE damtype, xBase*, const xVec3*) } } +void zNPCBSandy_AddBoundEntsToGrid(zScene* scn) +{ + S32 i; + S32 isLimb; + xEnt* ent; + + if (sOthersHaventBeenAdded) + { + sOthersHaventBeenAdded = 0; + + for (i = 0; i < 13; i++) + { + ent = sSandyPtr->boundList[i]; + if (i == 2 || i == 4 || i == 9 || i == 11) + { + isLimb = TRUE; + } + else + { + isLimb = FALSE; + } + + if (isLimb || xGridEntIsTooBig(&colls_grid, ent) != FALSE) + { + xGridAdd(&colls_oso_grid, ent); + + if (isLimb || xGridEntIsTooBig(&colls_oso_grid, ent) != FALSE) + { + ent->gridb.oversize = 0x2; + } + else + { + ent->gridb.oversize = 0x1; + } + } + else + { + xGridAdd(&colls_grid, ent); + ent->gridb.oversize = 0x0; + } + } + } + else + { + sSandyPtr = NULL; + } +} + void zNPCBSandy_GameIsPaused(zScene*) { if (sSandyPtr) @@ -387,7 +770,7 @@ void zNPCBSandy_GameIsPaused(zScene*) } } -S32 idleCB(xGoal* rawgoal, void*, en_trantype* trantype, F32, void*) +static S32 idleCB(xGoal* rawgoal, void*, en_trantype* trantype, F32, void*) { zNPCGoalBossSandyIdle* idle = (zNPCGoalBossSandyIdle*)rawgoal; zNPCBSandy* sandy = (zNPCBSandy*)idle->psyche->clt_owner; @@ -433,7 +816,7 @@ S32 idleCB(xGoal* rawgoal, void*, en_trantype* trantype, F32, void*) return nextgoal; } -S32 tauntCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) +static S32 tauntCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) { zNPCGoalBossSandyTaunt* taunt = (zNPCGoalBossSandyTaunt*)rawgoal; zNPCBSandy* sandy = (zNPCBSandy*)taunt->psyche->clt_owner; @@ -478,7 +861,10 @@ S32 tauntCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) return nextgoal; } -S32 noHeadCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) +static S32 chaseCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*); +static S32 meleeCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*); + +static S32 noHeadCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) { zNPCGoalBossSandyNoHead* noHead = (zNPCGoalBossSandyNoHead*)rawgoal; zNPCBSandy* sandy = (zNPCBSandy*)noHead->psyche->clt_owner; @@ -496,7 +882,7 @@ S32 noHeadCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) return nextgoal; } -S32 elbowDropCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) +static S32 elbowDropCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) { zNPCGoalBossSandyElbowDrop* edrop = (zNPCGoalBossSandyElbowDrop*)rawgoal; zNPCBSandy* sandy = (zNPCBSandy*)edrop->psyche->clt_owner; @@ -547,7 +933,7 @@ S32 elbowDropCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) return nextgoal; } -S32 leapCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) +static S32 leapCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) { zNPCGoalBossSandyLeap* leap = (zNPCGoalBossSandyLeap*)rawgoal; zNPCBSandy* sandy = (zNPCBSandy*)leap->psyche->clt_owner; @@ -573,6 +959,20 @@ S32 leapCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*) return nextgoal; } +static S32 sitCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*); +static S32 getUpCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*); +static S32 runToRopeCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*); +static S32 clotheslineCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*); + +S32 zNPCGoalBossSandyIdle::Enter(F32 dt, void* updCtxt) +{ + zNPCBSandy* sandy; + + // xVec3Init(); + + return zNPCGoalCommon::Enter(dt, updCtxt); +} + void xBinaryCamera::add_tweaks(char const*) { } diff --git a/src/SB/Game/zNPCTypeBossSandy.h b/src/SB/Game/zNPCTypeBossSandy.h index 7801e20d1..cbd5280fb 100644 --- a/src/SB/Game/zNPCTypeBossSandy.h +++ b/src/SB/Game/zNPCTypeBossSandy.h @@ -186,6 +186,10 @@ struct zNPCGoalBossSandyIdle : zNPCGoalCommon zNPCGoalBossSandyIdle(S32 goalID) : zNPCGoalCommon(goalID) { } + + virtual S32 Enter(F32 dt, void* updCtxt); + virtual S32 Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* scene); + virtual S32 Exit(F32 dt, void* updCtxt); }; struct zNPCGoalBossSandyTaunt : zNPCGoalCommon @@ -195,6 +199,9 @@ struct zNPCGoalBossSandyTaunt : zNPCGoalCommon zNPCGoalBossSandyTaunt(S32 goalID) : zNPCGoalCommon(goalID) { } + + virtual S32 Enter(F32 dt, void* updCtxt); + virtual S32 Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* scene); }; struct zNPCGoalBossSandyChase : zNPCGoalCommon @@ -204,6 +211,10 @@ struct zNPCGoalBossSandyChase : zNPCGoalCommon zNPCGoalBossSandyChase(S32 goalID) : zNPCGoalCommon(goalID) { } + + virtual S32 Enter(F32 dt, void* updCtxt); + virtual S32 Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* scene); + virtual S32 Exit(F32 dt, void* updCtxt); }; struct zNPCGoalBossSandyMelee : zNPCGoalCommon @@ -213,6 +224,10 @@ struct zNPCGoalBossSandyMelee : zNPCGoalCommon zNPCGoalBossSandyMelee(S32 goalID) : zNPCGoalCommon(goalID) { } + + virtual S32 Enter(F32 dt, void* updCtxt); + virtual S32 Exit(F32 dt, void* updCtxt); + virtual S32 Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* scene); }; struct zNPCGoalBossSandyNoHead : zNPCGoalCommon @@ -224,6 +239,9 @@ struct zNPCGoalBossSandyNoHead : zNPCGoalCommon zNPCGoalBossSandyNoHead(S32 goalID) : zNPCGoalCommon(goalID) { } + + virtual S32 Enter(F32 dt, void* updCtxt); + virtual S32 Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* scene); }; struct zNPCGoalBossSandyElbowDrop : zNPCGoalCommon @@ -234,6 +252,10 @@ struct zNPCGoalBossSandyElbowDrop : zNPCGoalCommon zNPCGoalBossSandyElbowDrop(S32 goalID) : zNPCGoalCommon(goalID) { } + + virtual S32 Enter(F32 dt, void* updCtxt); + virtual S32 Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* scene); + virtual S32 Exit(F32 dt, void* updCtxt); }; struct zNPCGoalBossSandyLeap : zNPCGoalCommon @@ -249,6 +271,9 @@ struct zNPCGoalBossSandyLeap : zNPCGoalCommon { } + virtual S32 Enter(F32 dt, void* updCtxt); + virtual S32 Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* scene); + virtual S32 Exit(F32 dt, void* updCtxt); S32 Name(); }; @@ -261,6 +286,10 @@ struct zNPCGoalBossSandySit : zNPCGoalCommon zNPCGoalBossSandySit(S32 goalID) : zNPCGoalCommon(goalID) { } + + virtual S32 Enter(F32 dt, void* updCtxt); + virtual S32 Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* scene); + virtual S32 Exit(F32 dt, void* updCtxt); }; struct zNPCGoalBossSandyGetUp : zNPCGoalCommon @@ -270,6 +299,9 @@ struct zNPCGoalBossSandyGetUp : zNPCGoalCommon zNPCGoalBossSandyGetUp(S32 goalID) : zNPCGoalCommon(goalID) { } + + virtual S32 Enter(F32 dt, void* updCtxt); + virtual S32 Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* scene); }; struct zNPCGoalBossSandyRunToRope : zNPCGoalCommon @@ -279,6 +311,10 @@ struct zNPCGoalBossSandyRunToRope : zNPCGoalCommon zNPCGoalBossSandyRunToRope(S32 goalID) : zNPCGoalCommon(goalID) { } + + virtual S32 Enter(F32 dt, void* updCtxt); + virtual S32 Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* scene); + virtual S32 Exit(F32 dt, void* updCtxt); }; struct zNPCGoalBossSandyClothesline : zNPCGoalCommon @@ -292,6 +328,9 @@ struct zNPCGoalBossSandyClothesline : zNPCGoalCommon zNPCGoalBossSandyClothesline(S32 goalID) : zNPCGoalCommon(goalID) { } + + virtual S32 Enter(F32 dt, void* updCtxt); + virtual S32 Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* scene); }; struct SandyLimbSpring From e55a9745df8fa7fbd682ddd52abed3de209d1582 Mon Sep 17 00:00:00 2001 From: Josh Sanchez Date: Sun, 13 Apr 2025 12:18:12 -0500 Subject: [PATCH 5/5] Sandy: Fix regression in ZNPC_AnimTable_BossSandy and increase matchingness --- src/SB/Game/zNPCTypeBossSandy.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/SB/Game/zNPCTypeBossSandy.cpp b/src/SB/Game/zNPCTypeBossSandy.cpp index 5a3ab95f5..64c78f188 100644 --- a/src/SB/Game/zNPCTypeBossSandy.cpp +++ b/src/SB/Game/zNPCTypeBossSandy.cpp @@ -226,7 +226,14 @@ xAnimTable* ZNPC_AnimTable_BossSandy() xAnimTableNewState(table, g_strz_bossanim[NoHeadReplace01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); - NPCC_BuildStandardAnimTran(table, g_strz_bossanim, ourAnims, 1, 0.20000000298023224f); + NPCC_BuildStandardAnimTran(table, g_strz_bossanim, ourAnims, 1, 0.2f); + + xAnimTransition* tList = table->TransitionList; + while (tList != NULL) + { + tList->BlendRecip = 3.3333333f; + tList = tList->Next; + } return table; }