From f50bd4881a34a2ba26da0d4f05ac7e0b05fa8004 Mon Sep 17 00:00:00 2001 From: Livewire Date: Tue, 18 Mar 2025 00:06:10 -0400 Subject: [PATCH 01/44] self setup and others --- src/SB/Game/zNPCTypeKingJelly.cpp | 88 +++++++++++++++++++++++++++++++ src/SB/Game/zNPCTypeKingJelly.h | 26 ++++++--- 2 files changed, 108 insertions(+), 6 deletions(-) diff --git a/src/SB/Game/zNPCTypeKingJelly.cpp b/src/SB/Game/zNPCTypeKingJelly.cpp index 6b95c0b11..79eddbd40 100644 --- a/src/SB/Game/zNPCTypeKingJelly.cpp +++ b/src/SB/Game/zNPCTypeKingJelly.cpp @@ -11,6 +11,11 @@ namespace void lightning_ring::create() { + // store 1 into 0x0 + active = 1; + arcs_size = 0; + + //store 0 into 0x7c } xVec3* zNPCKingJelly::get_bottom() @@ -46,6 +51,57 @@ void zNPCKingJelly::BUpdate(xVec3* pos) zNPCCommon::BUpdate(pos); } +void zNPCKingJelly::SelfSetup() +{ + xBehaveMgr* bmgr; + xPsyche* psy; + + bmgr = xBehaveMgr_GetSelf(); + psy_instinct = bmgr->Subscribe(this, 0); + psy = psy_instinct; + psy->BrainBegin(); + psy->AddGoal(NPC_GOAL_KJIDLE, NULL); + psy->AddGoal(NPC_GOAL_KJBORED, NULL); + psy->AddGoal(NPC_GOAL_KJSPAWNKIDS, NULL); + psy->AddGoal(NPC_GOAL_KJTAUNT, NULL); + psy->AddGoal(NPC_GOAL_KJSHOCKGROUND, NULL); + psy->AddGoal(NPC_GOAL_KJDAMAGE, NULL); + psy->AddGoal(NPC_GOAL_KJDEATH, NULL); + psy->AddGoal(NPC_GOAL_LIMBO, NULL); + psy->BrainEnd(); + psy->SetSafety(NPC_GOAL_KJIDLE); +} + +void zNPCKingJelly::init_child(zNPCKingJelly::child_data& child, zNPCCommon& npc, int wave) +{ + child.npc = &npc; + child.wave = wave; + child.active = 1; + child.callback.eventFunc = npc.eventFunc; + child.callback.update = npc.update; + child.callback.bupdate = npc.bupdate; + child.callback.move = npc.move; + child.callback.render = npc.render; + child.callback.transl = npc.transl; +} + +void zNPCKingJelly::disable_child(zNPCKingJelly::child_data& child) +{ + if (child.active) + { + ((zNPCJelly*)child.npc)->JellyKill(); + child.active = false; + } +} + +void zNPCKingJelly::enable_child(zNPCKingJelly::child_data& child) +{ + if (child.active == false) + { + child.active = true; + } +} + // probably how many times the jellyfish can hit the player for that round // whatever round it is, add one. // Round = 0, max strikes = 1 @@ -144,6 +200,16 @@ void zNPCKingJelly::load_curtain_model() { } +// void zNPCKingJelly::reset_curtain() +// { +// // f0 = data shit +// // r4 = 0x10b0 +// // 0x24 = f0 +// // r3 = 0x10a8 +// // 0x24 = f0 // 0x24 model??? + +// } + S32 zNPCGoalKJDamage::Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* xscn) { // TODO @@ -167,3 +233,25 @@ S32 zNPCGoalKJDamage::Exit(F32 dt, void* updCtxt) return xGoal::Exit(dt, updCtxt); } + +void zNPCKingJelly::update_round() +{ +} + +S32 zNPCGoalKJDeath::Enter(float dt, void* updCtxt) +{ + zNPCKingJelly& kj = *(zNPCKingJelly*)this->psyche->clt_owner; + kj.decompose(); + kj.post_decompose(); + zNPCGoalCommon::Enter(dt, updCtxt); +} + +S32 zNPCGoalKJDeath::Exit(float dt, void* updCtxt) +{ + xGoal::Exit(dt, updCtxt); +} + +S32 zNPCGoalKJDeath::Process(en_trantype* trantype, float dt, void* updCtxt, xScene* xscn) +{ + xGoal::Process(trantype, dt, updCtxt, xscn); +} diff --git a/src/SB/Game/zNPCTypeKingJelly.h b/src/SB/Game/zNPCTypeKingJelly.h index 70ba294ad..341078dce 100644 --- a/src/SB/Game/zNPCTypeKingJelly.h +++ b/src/SB/Game/zNPCTypeKingJelly.h @@ -3,7 +3,11 @@ #include "zNPCTypeSubBoss.h" #include "zNPCGoalCommon.h" +#include "zNPCGoals.h" #include "xEnt.h" +#include "containers.h" +#include "xBehaviour.h" +#include "zNPCTypeAmbient.h" struct lightning_ring { @@ -13,7 +17,7 @@ struct lightning_ring F32 min_height; F32 max_height; F32 min_radius; - F32 max_radius; + F32 max_radius; //0x20? F32 delay; F32 accel; F32 max_vel; @@ -24,7 +28,7 @@ struct lightning_ring F32 radius; F32 vel; F32 accel; - F32 time; + F32 time; //0x44?? } current; struct { @@ -32,10 +36,10 @@ struct lightning_ring F32 thickness; iColor_tag color; F32 rot_radius; - F32 degrees; + F32 degrees; //0x58? } property; zLightning* arcs[8]; - U32 arcs_size; + U32 arcs_size; //0x7c void (*update_callback)(lightning_ring&, F32); void create(); @@ -56,11 +60,11 @@ struct zNPCKingJelly : zNPCSubBoss struct child_data { zNPCCommon* npc; - U8 wave; + U8 wave; //0x5 U8 active; struct { - S32 (*eventFunc)(xBase*, xBase*, U32, F32*, xBase*); + xBaseEventCB eventFunc; void (*update)(xEnt*, xScene*, F32); void (*bupdate)(xEnt*, xVec3*); void (*move)(xEnt*, xScene*, F32, xEntFrame*); @@ -131,9 +135,14 @@ struct zNPCKingJelly : zNPCSubBoss void Setup(); void Destroy(); void BUpdate(xVec3*); + void SelfSetup(); + void init_child(zNPCKingJelly::child_data&, zNPCCommon&, int); + void disable_child(zNPCKingJelly::child_data&); + void enable_child(zNPCKingJelly::child_data& child); S32 max_strikes(); void load_model(); void load_curtain_model(); + void reset_curtain(); void decompose(); void post_decompose(); void vanish(); @@ -143,6 +152,8 @@ struct zNPCKingJelly : zNPCSubBoss void on_change_fade_obstructions(const tweak_info&); void render_debug(); void create_tentacle_lightning(); + void refresh_tentacle_points(); + void refresh_tentacle_points(S32); void generate_spawn_particles(); void update_round(); }; @@ -207,6 +218,9 @@ struct zNPCGoalKJDamage : zNPCGoalCommon struct zNPCGoalKJDeath : zNPCGoalCommon { + S32 Enter(float dt, void* updCtxt); + S32 Exit(float dt, void* updCtxt); + S32 Process(en_trantype* trantype, float dt, void* updCtxt, xScene* xscn); zNPCGoalKJDeath(S32 goalID) : zNPCGoalCommon(goalID) { } From 935bf498a44a0770ec91414b4055d0d1aa33f712 Mon Sep 17 00:00:00 2001 From: Livewire Date: Tue, 18 Mar 2025 23:46:55 -0400 Subject: [PATCH 02/44] zNPC_AnimTable_KingJelly --- src/SB/Game/zNPCTypeKingJelly.cpp | 132 ++++++++++++++++++++++++++++++ src/SB/Game/zNPCTypeKingJelly.h | 4 + src/SB/Game/zNPCTypeSubBoss.cpp | 6 +- src/SB/Game/zNPCTypeSubBoss.h | 4 + 4 files changed, 145 insertions(+), 1 deletion(-) diff --git a/src/SB/Game/zNPCTypeKingJelly.cpp b/src/SB/Game/zNPCTypeKingJelly.cpp index 79eddbd40..6b945fa95 100644 --- a/src/SB/Game/zNPCTypeKingJelly.cpp +++ b/src/SB/Game/zNPCTypeKingJelly.cpp @@ -1,6 +1,45 @@ #include "zNPCTypeKingJelly.h" #include +#include "string.h" + +#define f1868 1.0f +#define f1869 0.0f +#define f2105 0.2f +#define f2106 0.1f + +#define ANIM_Unknown 0 // 0x0 +#define ANIM_Idle01 1 // 0x04 +#define ANIM_Idle02 2 // 0x08 animetable new state +#define ANIM_Idle03 3 // 0xC +#define ANIM_Fidget01 4 // +#define ANIM_Fidget02 5 +#define ANIM_Fidget03 6 +#define ANIM_Taunt01 7 // 0x1c +#define ANIM_Attack01 8 //0x20 DEPRACATED +#define ANIM_Damage01 9 //0x24 +#define ANIM_Damage02 10 //0x28 +#define ANIM_Death01 11 //0x2c +#define ANIM_AttackWindup01 12 //0x30 +#define ANIM_AttackLoop01 13 //0x34 +#define ANIM_AttackEnd01 14 //0x38 +#define ANIM_SpawnKids01 15 //0x3C +#define ANIM_Attack02Windup01 16 +#define ANIM_Attack02Loop01 17 +#define ANIM_Attack02End01 18 +#define ANIM_LassoGrab01 19 + +// #define ANIM_Idle01 1 +// #define ANIM_Idle02 2 +// #define ANIM_Idle03 3 +// #define ANIM_Taunt01 7 +// #define ANIM_Attack01 8 +// #define ANIM_AttackWindup01 12 +// #define ANIM_AttackLoop01 13 +// #define ANIM_AttackEnd01 14 +// #define ANIM_Damage01 9 +// #define ANIM_SpawnKids01 15 +// #define ANIM_Unknown 0 namespace { @@ -18,6 +57,99 @@ void lightning_ring::create() //store 0 into 0x7c } +void foo() +{ + xAnimTable* foo = xAnimTableNew("FOO", 0, 0); +} + +xAnimTable* ZNPC_AnimTable_KingJelly() +{ + // clang-format off + S32 ourAnims[11] = { + ANIM_Idle01, + ANIM_Idle02, + ANIM_Idle03, + ANIM_Taunt01, + ANIM_Attack01, + ANIM_AttackWindup01, // replace with king jelly anims + ANIM_AttackLoop01, + ANIM_AttackEnd01, + ANIM_Damage01, + ANIM_SpawnKids01, + ANIM_Unknown, + + }; + // clang-format on + + xAnimTable* table = xAnimTableNew("zNPCKingJelly", NULL, 0); + + xAnimTableNewState(table, g_strz_subbanim[ANIM_Idle01], 0x10, 0, f1868, NULL, NULL, f1869, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_Idle02], 0x20, 0, f1868, NULL, NULL, f1869, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_Idle03], 0x20, 0, f1868, NULL, NULL, f1869, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_Taunt01], 0x20, 0, f1868, NULL, NULL, f1869, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_Attack01], 0x10, 0, f1868, NULL, NULL, f1869, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_AttackWindup01], 0x20, 0, f1868, NULL, NULL, + f1869, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_AttackLoop01], 0x10, 0, f1868, NULL, NULL, f1869, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_AttackEnd01], 0x20, 0, f1868, NULL, NULL, f1869, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_Damage01], 0x20, 0, f1868, NULL, NULL, f1869, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_SpawnKids01], 0x10, 0, f1868, NULL, NULL, f1869, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + + NPCC_BuildStandardAnimTran(table, g_strz_subbanim, ourAnims, 1, f2105); + + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_AttackWindup01], + g_strz_subbanim[ANIM_Attack01], 0, 0, 0x10, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_AttackLoop01], + g_strz_subbanim[ANIM_Attack01], 0, 0, 0, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_Attack01], + g_strz_subbanim[ANIM_AttackLoop01], 0, 0, 0, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_AttackLoop01], + g_strz_subbanim[ANIM_AttackEnd01], 0, 0, 0, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_Idle02], g_strz_subbanim[ANIM_Damage01], 0, + 0, 0, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_Idle03], g_strz_subbanim[ANIM_Damage01], 0, + 0, 0, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_Taunt01], g_strz_subbanim[ANIM_Damage01], 0, + 0, 0, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_AttackWindup01], + g_strz_subbanim[ANIM_Damage01], 0, 0, 0, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_AttackLoop01], + g_strz_subbanim[ANIM_Damage01], 0, 0, 0, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_Attack01], g_strz_subbanim[ANIM_Damage01], + 0, 0, 0, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_AttackEnd01], + g_strz_subbanim[ANIM_Damage01], 0, 0, 0, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_SpawnKids01], + g_strz_subbanim[ANIM_Damage01], 0, 0, 0, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_Idle02], g_strz_subbanim[ANIM_Taunt01], 0, + 0, 0, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_Idle03], g_strz_subbanim[ANIM_Taunt01], 0, + 0, 0, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_AttackWindup01], + g_strz_subbanim[ANIM_Taunt01], 0, 0, 0, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_AttackLoop01], + g_strz_subbanim[ANIM_Taunt01], 0, 0, 0, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_Attack01], g_strz_subbanim[ANIM_Taunt01], 0, + 0, 0, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_AttackEnd01], g_strz_subbanim[ANIM_Taunt01], + 0, 0, 0, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_SpawnKids01], g_strz_subbanim[ANIM_Taunt01], + 0, 0, 0, 0, 0, 0, 0, 0, f2106, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_Damage01], + g_strz_subbanim[ANIM_SpawnKids01], 0, 0, 0, 0, 0, 0, 0, 0, f2106, 0); + + return table; +} + xVec3* zNPCKingJelly::get_bottom() { return (xVec3*)&this->model->Mat->pos; diff --git a/src/SB/Game/zNPCTypeKingJelly.h b/src/SB/Game/zNPCTypeKingJelly.h index 341078dce..3a78a22a2 100644 --- a/src/SB/Game/zNPCTypeKingJelly.h +++ b/src/SB/Game/zNPCTypeKingJelly.h @@ -130,10 +130,14 @@ struct zNPCKingJelly : zNPCSubBoss zEnt* curtain_ent; xModelInstance* curtain_model[5]; U8 first_update; //0x10B4 + xAnimState* animState; // offset 0x157C, size 0x4 //copied from patrick comment not true + xAnimTransitionList* + animTranList; // offset 0x1580, size 0x4 //copied from patrick comment not true zNPCKingJelly(S32 myType); void Setup(); void Destroy(); + U32 AnimPick(S32 rawgoal, en_NPC_GOAL_SPOT gspot, xGoal* goal); void BUpdate(xVec3*); void SelfSetup(); void init_child(zNPCKingJelly::child_data&, zNPCCommon&, int); diff --git a/src/SB/Game/zNPCTypeSubBoss.cpp b/src/SB/Game/zNPCTypeSubBoss.cpp index 658504dbc..436d136f9 100644 --- a/src/SB/Game/zNPCTypeSubBoss.cpp +++ b/src/SB/Game/zNPCTypeSubBoss.cpp @@ -9,8 +9,12 @@ U32 g_hash_subbanim[ANIM_COUNT] = {}; +void foo(zNPCKingJelly* jelly) +{ +} + // clang-format off -const char* g_strz_subbanim[ANIM_COUNT] = +char* g_strz_subbanim[ANIM_COUNT] = { "Unknown", "Idle01", diff --git a/src/SB/Game/zNPCTypeSubBoss.h b/src/SB/Game/zNPCTypeSubBoss.h index a597c5375..9a1508521 100644 --- a/src/SB/Game/zNPCTypeSubBoss.h +++ b/src/SB/Game/zNPCTypeSubBoss.h @@ -26,4 +26,8 @@ void zNPCSubBoss_SceneFinish(); xFactoryInst* ZNPC_Create_SubBoss(S32 who, RyzMemGrow* grow, void*); void ZNPC_Destroy_SubBoss(xFactoryInst* inst); +#define ANIM_COUNT 78 +extern U32 g_hash_subbanim[ANIM_COUNT]; +extern char* g_strz_subbanim[ANIM_COUNT]; + #endif From ed0e484420f83fc25c72e360116ae310fb3322aa Mon Sep 17 00:00:00 2001 From: Livewire Date: Tue, 18 Mar 2025 23:52:28 -0400 Subject: [PATCH 03/44] fix --- src/SB/Game/zNPCTypeKingJelly.cpp | 1 - src/SB/Game/zNPCTypeSubBoss.cpp | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/SB/Game/zNPCTypeKingJelly.cpp b/src/SB/Game/zNPCTypeKingJelly.cpp index 6b945fa95..767abae7d 100644 --- a/src/SB/Game/zNPCTypeKingJelly.cpp +++ b/src/SB/Game/zNPCTypeKingJelly.cpp @@ -80,7 +80,6 @@ xAnimTable* ZNPC_AnimTable_KingJelly() }; // clang-format on - xAnimTable* table = xAnimTableNew("zNPCKingJelly", NULL, 0); xAnimTableNewState(table, g_strz_subbanim[ANIM_Idle01], 0x10, 0, f1868, NULL, NULL, f1869, NULL, diff --git a/src/SB/Game/zNPCTypeSubBoss.cpp b/src/SB/Game/zNPCTypeSubBoss.cpp index 436d136f9..0f31b506a 100644 --- a/src/SB/Game/zNPCTypeSubBoss.cpp +++ b/src/SB/Game/zNPCTypeSubBoss.cpp @@ -5,8 +5,6 @@ #include "zNPCTypeDutchman.h" #include "zNPCTypePrawn.h" -#define ANIM_COUNT 23 - U32 g_hash_subbanim[ANIM_COUNT] = {}; void foo(zNPCKingJelly* jelly) From 7c8371849fe4e3c6b8d4cf6844e04667c0164c76 Mon Sep 17 00:00:00 2001 From: Livewire Date: Wed, 19 Mar 2025 00:00:01 -0400 Subject: [PATCH 04/44] removed leftover junk from intially starting the function --- src/SB/Game/zNPCTypeKingJelly.cpp | 5 ----- src/SB/Game/zNPCTypeKingJelly.h | 3 --- src/SB/Game/zNPCTypeSubBoss.cpp | 4 ---- 3 files changed, 12 deletions(-) diff --git a/src/SB/Game/zNPCTypeKingJelly.cpp b/src/SB/Game/zNPCTypeKingJelly.cpp index 767abae7d..682e81d19 100644 --- a/src/SB/Game/zNPCTypeKingJelly.cpp +++ b/src/SB/Game/zNPCTypeKingJelly.cpp @@ -57,11 +57,6 @@ void lightning_ring::create() //store 0 into 0x7c } -void foo() -{ - xAnimTable* foo = xAnimTableNew("FOO", 0, 0); -} - xAnimTable* ZNPC_AnimTable_KingJelly() { // clang-format off diff --git a/src/SB/Game/zNPCTypeKingJelly.h b/src/SB/Game/zNPCTypeKingJelly.h index 3a78a22a2..880593dbd 100644 --- a/src/SB/Game/zNPCTypeKingJelly.h +++ b/src/SB/Game/zNPCTypeKingJelly.h @@ -130,9 +130,6 @@ struct zNPCKingJelly : zNPCSubBoss zEnt* curtain_ent; xModelInstance* curtain_model[5]; U8 first_update; //0x10B4 - xAnimState* animState; // offset 0x157C, size 0x4 //copied from patrick comment not true - xAnimTransitionList* - animTranList; // offset 0x1580, size 0x4 //copied from patrick comment not true zNPCKingJelly(S32 myType); void Setup(); diff --git a/src/SB/Game/zNPCTypeSubBoss.cpp b/src/SB/Game/zNPCTypeSubBoss.cpp index 0f31b506a..a74dd0d7e 100644 --- a/src/SB/Game/zNPCTypeSubBoss.cpp +++ b/src/SB/Game/zNPCTypeSubBoss.cpp @@ -7,10 +7,6 @@ U32 g_hash_subbanim[ANIM_COUNT] = {}; -void foo(zNPCKingJelly* jelly) -{ -} - // clang-format off char* g_strz_subbanim[ANIM_COUNT] = { From 8ef31113988c8692fad815b06f7f0444156b8a93 Mon Sep 17 00:00:00 2001 From: Livewire Date: Wed, 19 Mar 2025 21:18:51 -0400 Subject: [PATCH 05/44] ZNPC_AnimTable_BossSB2 - 73% code match --- src/SB/Game/zNPCTypeBossSB2.cpp | 198 +++++++++++++++++++++++++++++++- 1 file changed, 195 insertions(+), 3 deletions(-) diff --git a/src/SB/Game/zNPCTypeBossSB2.cpp b/src/SB/Game/zNPCTypeBossSB2.cpp index aa2293038..b8e74e975 100644 --- a/src/SB/Game/zNPCTypeBossSB2.cpp +++ b/src/SB/Game/zNPCTypeBossSB2.cpp @@ -1,9 +1,201 @@ -#include "xVec3.h" -#include "xMath3.h" #include "zNPCTypeBossSB2.h" - #include +#include "string.h" +#include "iModel.h" +#include "xCollide.h" +#include "xMath.h" +#include "xMath3.h" +#include "xstransvc.h" +#include "xSnd.h" +#include "xVec3.h" + +#include "zCamera.h" +#include "zEntSimpleObj.h" +#include "zEntDestructObj.h" +#include "zGlobals.h" +#include "zGrid.h" +#include "zNPCTypeBossPatrick.h" +#include "zRenderState.h" +#include "zNPCGoals.h" +#include "zLightning.h" +#include "zNPCTypeRobot.h" +#include + +#define ANIM_Unknown 0 //0x0 +#define ANIM_Idle01 1 // 0x4 +#define ANIM_Idle02 2 // 0x8 +#define ANIM_Taunt01 3 // 0xC +#define ANIM_Hit01 7 //0x1c +#define ANIM_Hit02 8 //0x20 +#define ANIM_Dizzy01 10 //0x28 +#define ANIM_SmashHitLeft 46 +#define ANIM_SmashHitRight 47 +#define ANIM_SmackLeft01 48 +#define ANIM_SmackRight01 49 +#define ANIM_ChopLeftBegin 50 +#define ANIM_ChopLeftLoop 51 +#define ANIM_ChopLeftEnd 52 +#define ANIM_ChopRightBegin 53 +#define ANIM_ChopRightLoop 54 +#define ANIM_ChopRightEnd 55 +#define ANIM_SwipeLeftBegin 56 +#define ANIM_SwipeLeftLoop 57 +#define ANIM_SwipeLeftEnd 58 +#define ANIM_SwipeRightBegin 59 +#define ANIM_SwipeRightLoop 60 +#define ANIM_SwipeRightEnd 61 +#define ANIM_ReturnIdle01 62 +#define ANIM_KarateStart 63 +#define ANIM_KarateLoop 64 +#define ANIM_KarateEnd 65 + +xAnimTable* ZNPC_AnimTable_BossSB2() +{ + // clang-format off + // S32 anim_list[27] = { + + // ANIM_Idle01, + // ANIM_Idle02, + // ANIM_Taunt01, + // ANIM_Hit01, + // ANIM_Hit02, + // ANIM_SmashHitLeft, + // ANIM_SmashHitRight, + // ANIM_SmackLeft01, + // ANIM_SmackRight01, + // ANIM_ChopLeftBegin, + // ANIM_ChopLeftLoop, + // ANIM_ChopLeftEnd, + // ANIM_ChopRightBegin, No longer needed? + // ANIM_ChopRightLoop, Was used instead of "ANIM_xxxxx;" right about new state + // ANIM_ChopRightEnd, + // ANIM_SwipeLeftBegin, + // ANIM_SwipeLeftLoop, + // ANIM_SwipeLeftEnd, + // ANIM_SwipeRightBegin, + // ANIM_SwipeRightLoop, + // ANIM_SwipeRightEnd, + // ANIM_ReturnIdle01, + // ANIM_KarateStart, + // ANIM_KarateLoop, + // ANIM_KarateEnd, + // ANIM_Dizzy01, + // }; + + + xAnimTable* table = xAnimTableNew("zNPCB_SB2_Karate", NULL, 0); + //24 new state + //15 new transition + ANIM_Idle01; + xAnimTableNewState(table, g_strz_bossanim[ANIM_Idle01], 0x10, 0, 1, NULL, NULL, 0, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_Idle02; + xAnimTableNewState(table, g_strz_bossanim[ANIM_Idle02], 0, 0, 1, NULL, NULL, 0, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_Taunt01; + xAnimTableNewState(table, g_strz_bossanim[ANIM_Taunt01], 0, 0, 1, NULL, NULL, 0, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_SmackLeft01; + xAnimTableNewState(table, g_strz_bossanim[ANIM_SmackLeft01], 0x20, 0, 1, NULL, NULL, 0, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_SmackRight01; + xAnimTableNewState(table, g_strz_bossanim[ANIM_SmackRight01], 0x20, 0, 1, NULL, NULL, 0, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_ChopLeftBegin; + xAnimTableNewState(table, g_strz_bossanim[ANIM_ChopLeftBegin], 0x20, 0, 1, NULL, NULL, 0, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_ChopLeftLoop; + xAnimTableNewState(table, g_strz_bossanim[ANIM_ChopLeftLoop], 0, 0, 1, NULL, NULL, 0, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_ChopLeftEnd; + xAnimTableNewState(table, g_strz_bossanim[ANIM_ChopLeftEnd], 0x20, 0, 1, NULL, NULL, 0, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_ChopRightBegin; + xAnimTableNewState(table, g_strz_bossanim[ANIM_ChopRightBegin], 0x20, 0, 1, NULL, NULL, 0, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_ChopRightLoop; + xAnimTableNewState(table, g_strz_bossanim[ANIM_ChopRightLoop], 0, 0, 1, NULL, NULL, 0, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_ChopRightEnd; + xAnimTableNewState(table, g_strz_bossanim[ANIM_ChopRightEnd], 0x20, 0, 1, NULL, NULL, 0, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_SwipeLeftBegin; + xAnimTableNewState(table, g_strz_bossanim[ANIM_SwipeLeftBegin], 0x20, 0, 1, NULL, NULL, 0, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_SwipeLeftLoop; + xAnimTableNewState(table, g_strz_bossanim[ANIM_SwipeLeftLoop], 0x10, 0, 1, NULL, NULL, 0, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_SwipeLeftEnd; + xAnimTableNewState(table, g_strz_bossanim[ANIM_SwipeLeftEnd], 0x20, 0, 1, NULL, NULL, 0, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_SwipeRightBegin; + xAnimTableNewState(table, g_strz_bossanim[ANIM_SwipeRightBegin], 0x20, 0, 1, NULL, NULL, 0, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_SwipeRightLoop; + xAnimTableNewState(table, g_strz_bossanim[ANIM_SwipeRightLoop], 0x10, 0, 1, NULL, NULL, 0, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_SwipeRightEnd; + xAnimTableNewState(table, g_strz_bossanim[ANIM_SwipeRightEnd], 0x20, 0, 1, NULL, NULL, 0, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_Dizzy01; + xAnimTableNewState(table, g_strz_bossanim[ANIM_Dizzy01], 0x10, 0, 1, NULL, NULL, 0, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_Hit01; + xAnimTableNewState(table, g_strz_bossanim[ANIM_Hit01], 0, 0, 1, NULL, NULL, 0, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_Hit02; + xAnimTableNewState(table, g_strz_bossanim[ANIM_Hit02], 0, 0, 1, NULL, NULL, 0, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_ReturnIdle01; + xAnimTableNewState(table, g_strz_bossanim[ANIM_ReturnIdle01], 0x20, 0, 1, NULL, NULL, 0, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_KarateStart; + xAnimTableNewState(table, g_strz_bossanim[ANIM_KarateStart], 0x20, 0, 1, NULL, NULL, 0, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_KarateLoop; + xAnimTableNewState(table, g_strz_bossanim[ANIM_KarateLoop], 0x10, 0, 1, NULL, NULL, 0, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + ANIM_KarateEnd; + xAnimTableNewState(table, g_strz_bossanim[ANIM_KarateEnd], 0x20, 0, 1, NULL, NULL, 0, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + + NPCC_BuildStandardAnimTran(table, g_strz_bossanim, 0, 1, 0.2); + + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_SmackLeft01], g_strz_bossanim[ANIM_Dizzy01], + 0, 0, 0x10, 0, 0, 0, 0, 0, 0.1, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_SmackRight01], + g_strz_bossanim[ANIM_Dizzy01], 0, 0, 0x10, 0, 0, 0, 0, 0, 0.1, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_ReturnIdle01], g_strz_bossanim[ANIM_Idle01], + 0, 0, 0x10, 0, 0, 0, 0, 0, 0.1, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_KarateStart], + g_strz_bossanim[ANIM_KarateLoop], 0, 0, 0x10, 0, 0, 0, 0, 0, 0.1, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_KarateEnd], g_strz_bossanim[ANIM_Idle01], 0, + 0, 0x10, 0, 0, 0, 0, 0, 0.1, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_ChopLeftBegin], + g_strz_bossanim[ANIM_ChopLeftLoop], 0, 0, 0x10, 0, 0, 0, 0, 0, 0.1, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_ChopLeftLoop], + g_strz_bossanim[ANIM_ChopLeftEnd], 0, 0, 0, 0, 0, 0, 0, 0, 0.1, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_ChopRightBegin], + g_strz_bossanim[ANIM_ChopRightLoop], 0, 0, 0x10, 0, 0, 0, 0, 0, 0.1, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_ChopRightLoop], + g_strz_bossanim[ANIM_ChopRightEnd], 0, 0, 0, 0, 0, 0, 0, 0, 0.1, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_SwipeLeftBegin], + g_strz_bossanim[ANIM_SwipeLeftLoop], 0, 0, 0x10, 0, 0, 0, 0, 0, 0.1, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_SwipeLeftLoop], + g_strz_bossanim[ANIM_SwipeLeftEnd], 0, 0, 0, 0, 0, 0, 0, 0, 0.1, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_SwipeRightBegin], + g_strz_bossanim[ANIM_SwipeRightLoop], 0, 0, 0x10, 0, 0, 0, 0, 0, 0.1, + 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_SwipeRightLoop], + g_strz_bossanim[ANIM_SwipeRightEnd], 0, 0, 0, 0, 0, 0, 0, 0, 0.1, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_Hit01], g_strz_bossanim[ANIM_Idle01], 0, 0, + 0x10, 0, 0, 0, 0, 0, 0.1, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_Hit02], g_strz_bossanim[ANIM_Dizzy01], 0, 0, + 0x10, 0, 0, 0, 0, 0, 0.1, 0); + + return table; +} void xMat3x3RMulVec(xVec3* o, const xMat3x3* m, const xVec3* v) { From 58b715b7795427094f503623af16aa37f4b5cfc1 Mon Sep 17 00:00:00 2001 From: Livewire Date: Wed, 19 Mar 2025 22:50:36 -0400 Subject: [PATCH 06/44] Dutchman anim table should be complete, removed some junk from zNPCTypeKingJelly --- src/SB/Game/zNPCTypeDutchman.cpp | 97 ++++++++++++++++++++++++++++++- src/SB/Game/zNPCTypeKingJelly.cpp | 16 +---- 2 files changed, 97 insertions(+), 16 deletions(-) diff --git a/src/SB/Game/zNPCTypeDutchman.cpp b/src/SB/Game/zNPCTypeDutchman.cpp index 22f18c4fc..76fdb0e17 100644 --- a/src/SB/Game/zNPCTypeDutchman.cpp +++ b/src/SB/Game/zNPCTypeDutchman.cpp @@ -10,7 +10,101 @@ namespace { } } // namespace -//dummy text for pushing + +#define f1605 0.0f +#define f1606 1.0f +#define f1689 0.2f +#define f1690 0.1f + +#define ANIM_Idle01 1 +#define ANIM_Fidget01 4 //0x10 +#define ANIM_Fidget02 5 //0x14 +#define ANIM_Fidget03 6 //0x18 +#define ANIM_Taunt01 7 // 0x1c +#define ANIM_Death01 11 //0x2c +#define ANIM_AttackWindup01 12 //0x30 +#define ANIM_AttackLoop01 13 //0x34 +#define ANIM_AttackEnd01 14 //0x38 +#define ANIM_Attack02Windup01 16 //0x40 +#define ANIM_Attack02Loop01 17 //0x44 +#define ANIM_Attack02End01 18 //0x48 +#define ANIM_LassoGrab01 19 //0x4c + +//13 new states +//8 new transitions +xAnimTable* ZNPC_AnimTable_Dutchman() +{ + // clang-format off + S32 ourAnims[13] = { + ANIM_Idle01, + ANIM_Fidget01, + ANIM_Fidget02, + ANIM_Fidget03, + ANIM_Taunt01, + ANIM_Death01, + ANIM_AttackWindup01, + ANIM_AttackLoop01, + ANIM_AttackEnd01, + ANIM_Attack02Windup01, + ANIM_Attack02Loop01, + ANIM_Attack02End01, + ANIM_LassoGrab01, + + }; + // clang-format on + xAnimTable* table = xAnimTableNew("zNPCDutchman", NULL, 0); + + xAnimTableNewState(table, g_strz_subbanim[ANIM_Idle01], 0x10, 0, f1606, NULL, NULL, f1605, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_Death01], 0, 0, f1606, NULL, NULL, f1605, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_Fidget01], 0x20, 0, f1606, NULL, NULL, f1605, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_Fidget02], 0x20, 0, f1606, NULL, NULL, f1605, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_Fidget03], 0x20, 0, f1606, NULL, NULL, f1605, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_Taunt01], 0x20, 0, f1606, NULL, NULL, f1605, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_AttackWindup01], 0x20, 0, f1606, NULL, NULL, + f1605, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_AttackLoop01], 0x10, 0, f1606, NULL, NULL, f1605, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_AttackEnd01], 0x20, 0, f1606, NULL, NULL, f1605, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_Attack02Windup01], 0x20, 0, f1606, NULL, NULL, + f1605, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_Attack02Loop01], 0x10, 0, f1606, NULL, NULL, + f1605, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_Attack02End01], 0x20, 0, f1606, NULL, NULL, + f1605, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_LassoGrab01], 0x20, 0x2000000, f1606, NULL, NULL, + f1605, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + + NPCC_BuildStandardAnimTran(table, g_strz_subbanim, ourAnims, 1, f1689); + + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_AttackWindup01], + g_strz_subbanim[ANIM_AttackLoop01], 0, 0, 0x10, 0, 0, 0, 0, 0, f1690, + 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_AttackLoop01], + g_strz_subbanim[ANIM_AttackEnd01], 0, 0, 0, 0, 0, 0, 0, 0, f1690, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_Attack02Windup01], + g_strz_subbanim[ANIM_Attack02Loop01], 0, 0, 0x10, 0, 0, 0, 0, 0, f1690, + 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_Attack02Loop01], + g_strz_subbanim[ANIM_Attack02End01], 0, 0, 0, 0, 0, 0, 0, 0, f1690, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_Fidget02], g_strz_subbanim[ANIM_Idle01], 0, + 0, 0x10, 0, 0, 0, 0, 0, f1690, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_Fidget02], + g_strz_subbanim[ANIM_AttackWindup01], 0, 0, 0, 0, 0, 0, 0, 0, f1690, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_Fidget02], g_strz_subbanim[ANIM_Fidget01], + 0, 0, 0, 0, 0, 0, 0, 0, f1690, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_LassoGrab01], g_strz_subbanim[ANIM_Death01], + 0, 0, 0, 0, 0, 0, 0, 0, f1690, 0); + + return table; +} + void xMat3x3RMulVec(xVec3* o, const xMat3x3* m, const xVec3* v) { F32 x = m->right.x * v->x + m->up.x * v->y + m->at.x * v->z; @@ -216,7 +310,6 @@ S32 zNPCGoalDutchmanDeath::Enter(F32 dt, void* updCtxt) { owner.delay = 0.0f; return zNPCGoalCommon::Enter(dt, updCtxt); - } U8 zNPCDutchman::PhysicsFlags() const diff --git a/src/SB/Game/zNPCTypeKingJelly.cpp b/src/SB/Game/zNPCTypeKingJelly.cpp index 682e81d19..695619064 100644 --- a/src/SB/Game/zNPCTypeKingJelly.cpp +++ b/src/SB/Game/zNPCTypeKingJelly.cpp @@ -16,7 +16,7 @@ #define ANIM_Fidget02 5 #define ANIM_Fidget03 6 #define ANIM_Taunt01 7 // 0x1c -#define ANIM_Attack01 8 //0x20 DEPRACATED +#define ANIM_Attack01 8 //0x20 #define ANIM_Damage01 9 //0x24 #define ANIM_Damage02 10 //0x28 #define ANIM_Death01 11 //0x2c @@ -29,18 +29,6 @@ #define ANIM_Attack02End01 18 #define ANIM_LassoGrab01 19 -// #define ANIM_Idle01 1 -// #define ANIM_Idle02 2 -// #define ANIM_Idle03 3 -// #define ANIM_Taunt01 7 -// #define ANIM_Attack01 8 -// #define ANIM_AttackWindup01 12 -// #define ANIM_AttackLoop01 13 -// #define ANIM_AttackEnd01 14 -// #define ANIM_Damage01 9 -// #define ANIM_SpawnKids01 15 -// #define ANIM_Unknown 0 - namespace { void tweak() @@ -66,7 +54,7 @@ xAnimTable* ZNPC_AnimTable_KingJelly() ANIM_Idle03, ANIM_Taunt01, ANIM_Attack01, - ANIM_AttackWindup01, // replace with king jelly anims + ANIM_AttackWindup01, ANIM_AttackLoop01, ANIM_AttackEnd01, ANIM_Damage01, From a48a40f1f5308ae4f5c069cc97d58d544b31d72e Mon Sep 17 00:00:00 2001 From: Livewire Date: Sun, 23 Mar 2025 19:12:57 -0400 Subject: [PATCH 07/44] Anim Tables --- src/SB/Game/zNPCTypeBossPlankton.cpp | 128 +++++++++++++++++++++++++++ src/SB/Game/zNPCTypeBossSB2.cpp | 2 +- src/SB/Game/zNPCTypePrawn.cpp | 77 ++++++++++++++++ 3 files changed, 206 insertions(+), 1 deletion(-) diff --git a/src/SB/Game/zNPCTypeBossPlankton.cpp b/src/SB/Game/zNPCTypeBossPlankton.cpp index 1f67bbe92..78cf10362 100644 --- a/src/SB/Game/zNPCTypeBossPlankton.cpp +++ b/src/SB/Game/zNPCTypeBossPlankton.cpp @@ -2,6 +2,134 @@ #include +#define f1585 1.0f +#define f1586 0.0f +#define f1657 0.2f +#define f1658 0.1f + +#define ANIM_Unknown 0 +#define ANIM_Idle01 1 // 0x4 +#define ANIM_Taunt01 3 // 0xC +#define ANIM_move 66 // 0x42 +#define ANIM_stun_begin 67 //0x43 +#define ANIM_stun_loop 68 //0x44 +#define ANIM_stun_end 69 //0x45 +#define ANIM_attack_beam_begin 70 //0x46 +#define ANIM_attack_beam_loop 71 //0x47 +#define ANIM_attack_beam_end 72 //0x48 +#define ANIM_attack_wall_begin 73 //0x49 +#define ANIM_attack_wall_loop 74 //0x4a +#define ANIM_attack_wall_end 75 //0x4b +#define ANIM_attack_missle 76 //0x4c +#define ANIM_attack_bomb 77 //0x4d + +xAnimTable* ZNPC_AnimTable_BossPlankton() +{ + // clang-format off + S32 ourAnims[32] = { //dwarf says it should be 32, matches less with 15 + ANIM_Idle01, + ANIM_Taunt01, + ANIM_move, + ANIM_stun_begin, + ANIM_stun_loop, + ANIM_stun_end, + ANIM_attack_beam_begin, + ANIM_attack_beam_loop, + ANIM_attack_beam_end, + ANIM_attack_wall_begin, + ANIM_attack_wall_loop, + ANIM_attack_wall_end, + ANIM_attack_missle, + ANIM_attack_bomb, + ANIM_Unknown, + }; + // clang-format on + + xAnimTable* table = xAnimTableNew("zNPCBPlankton", NULL, 0); + + xAnimTableNewState(table, g_strz_bossanim[ANIM_Idle01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[ANIM_Taunt01], 0x20, 0, 1.0f, NULL, NULL, 0.0f, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[ANIM_move], 0x10, 0, f1585, NULL, NULL, f1586, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[ANIM_stun_begin], 0x20, 0, f1585, NULL, NULL, f1586, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[ANIM_stun_loop], 0x10, 0, f1585, NULL, NULL, f1586, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[ANIM_stun_end], 0x20, 0, f1585, NULL, NULL, f1586, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[ANIM_attack_beam_begin], 0x20, 0, f1585, NULL, NULL, + f1586, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[ANIM_attack_beam_loop], 0x10, 0, f1585, NULL, NULL, + f1586, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[ANIM_attack_beam_end], 0x20, 0, f1585, NULL, NULL, + f1586, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[ANIM_attack_wall_begin], 0x20, 0, f1585, NULL, NULL, + f1586, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[ANIM_attack_wall_loop], 0x10, 0, f1585, NULL, NULL, + f1586, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[ANIM_attack_wall_end], 0x20, 0, f1585, NULL, NULL, + f1586, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[ANIM_attack_missle], 0x20, 0, f1585, NULL, NULL, + f1586, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[ANIM_attack_bomb], 0x20, 0, f1585, NULL, NULL, f1586, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + + NPCC_BuildStandardAnimTran(table, g_strz_bossanim, ourAnims, 1, f1657); + + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_stun_begin], + g_strz_bossanim[ANIM_stun_loop], 0, 0, 0x10, 0, f1586, f1586, 0, 0, + f1658, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_stun_loop], g_strz_bossanim[ANIM_stun_end], + 0, 0, 0, 0, f1586, f1586, 0, 0, f1658, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_beam_begin], + g_strz_bossanim[ANIM_attack_beam_loop], 0, 0, 0x10, 0, f1586, f1586, 0, + 0, f1658, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_beam_begin], + g_strz_bossanim[ANIM_attack_beam_end], 0, 0, 0, 0, f1586, f1586, 0, 0, + f1658, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_beam_loop], + g_strz_bossanim[ANIM_attack_beam_end], 0, 0, 0, 0, f1586, f1586, 0, 0, + f1658, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_wall_begin], + g_strz_bossanim[ANIM_attack_wall_loop], 0, 0, 0x10, 0, f1586, f1586, 0, + 0, f1658, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_wall_loop], + g_strz_bossanim[ANIM_attack_wall_end], 0, 0, 0, 0, f1586, f1586, 0, 0, + f1658, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_Taunt01], g_strz_bossanim[ANIM_stun_begin], + 0, 0, 0, 0, f1586, f1586, 0, 0, f1658, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_move], g_strz_bossanim[ANIM_stun_begin], 0, + 0, 0, 0, f1586, f1586, 0, 0, f1658, 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_beam_begin], + g_strz_bossanim[ANIM_stun_begin], 0, 0, 0, 0, f1586, f1586, 0, 0, f1658, + 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_beam_loop], + g_strz_bossanim[ANIM_stun_begin], 0, 0, 0, 0, f1586, f1586, 0, 0, f1658, + 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_beam_end], + g_strz_bossanim[ANIM_stun_begin], 0, 0, 0, 0, f1586, f1586, 0, 0, f1658, + 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_wall_begin], + g_strz_bossanim[ANIM_stun_begin], 0, 0, 0, 0, f1586, f1586, 0, 0, f1658, + 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_wall_loop], + g_strz_bossanim[ANIM_stun_begin], 0, 0, 0, 0, f1586, f1586, 0, 0, f1658, + 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_wall_end], + g_strz_bossanim[ANIM_stun_begin], 0, 0, 0, 0, f1586, f1586, 0, 0, f1658, + 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_missle], + g_strz_bossanim[ANIM_stun_begin], 0, 0, 0, 0, f1586, f1586, 0, 0, f1658, + 0); + xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_bomb], + g_strz_bossanim[ANIM_stun_begin], 0, 0, 0, 0, f1586, f1586, 0, 0, f1658, + 0); + + return table; +} + void zNPCBPlankton::render_debug() { } diff --git a/src/SB/Game/zNPCTypeBossSB2.cpp b/src/SB/Game/zNPCTypeBossSB2.cpp index b8e74e975..4999aafe6 100644 --- a/src/SB/Game/zNPCTypeBossSB2.cpp +++ b/src/SB/Game/zNPCTypeBossSB2.cpp @@ -68,7 +68,7 @@ xAnimTable* ZNPC_AnimTable_BossSB2() // ANIM_ChopLeftLoop, // ANIM_ChopLeftEnd, // ANIM_ChopRightBegin, No longer needed? - // ANIM_ChopRightLoop, Was used instead of "ANIM_xxxxx;" right about new state + // ANIM_ChopRightLoop, Was used instead of "ANIM_xxxxx;" right before new state // ANIM_ChopRightEnd, // ANIM_SwipeLeftBegin, // ANIM_SwipeLeftLoop, diff --git a/src/SB/Game/zNPCTypePrawn.cpp b/src/SB/Game/zNPCTypePrawn.cpp index 7c38bf85e..80c053efa 100644 --- a/src/SB/Game/zNPCTypePrawn.cpp +++ b/src/SB/Game/zNPCTypePrawn.cpp @@ -2,6 +2,32 @@ #include +#define f1052 1.0f +#define f1053 0.0f +#define f1454 0.2f +#define f1455 0.1f + +#define ANIM_Unknown 0 // 0x0 +#define ANIM_Idle01 1 // 0x04 +#define ANIM_Idle02 2 // 0x08 animtable new state +#define ANIM_Idle03 3 // 0xC +#define ANIM_Fidget01 4 // +#define ANIM_Fidget02 5 +#define ANIM_Fidget03 6 +#define ANIM_Taunt01 7 // 0x1c +#define ANIM_Attack01 8 //0x20 +#define ANIM_Damage01 9 //0x24 +#define ANIM_Damage02 10 //0x28 +#define ANIM_Death01 11 //0x2c +#define ANIM_AttackWindup01 12 //0x30 +#define ANIM_AttackLoop01 13 //0x34 +#define ANIM_AttackEnd01 14 //0x38 +#define ANIM_SpawnKids01 15 //0x3C +#define ANIM_Attack02Windup01 16 +#define ANIM_Attack02Loop01 17 +#define ANIM_Attack02End01 18 +#define ANIM_LassoGrab01 19 + namespace { sound_data_type sound_data[4]; @@ -246,6 +272,57 @@ void aqua_beam::render() { } +xAnimTable* ZNPC_AnimTable_Prawn() +{ + // clang-format off + S32 ourAnims[10] = { + ANIM_Idle01, + ANIM_Fidget01, + ANIM_Fidget02, + ANIM_Taunt01, + ANIM_AttackWindup01, + ANIM_AttackLoop01, + ANIM_AttackLoop01, + ANIM_AttackEnd01, + ANIM_Damage01, + ANIM_Damage02, + + }; + // clang-format on + xAnimTable* table = xAnimTableNew("zNPCPrawn", NULL, 0); + + xAnimTableNewState(table, g_strz_subbanim[ANIM_Idle01], 0x10, 0, f1052, NULL, NULL, f1053, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_Fidget01], 0x20, 0, f1052, NULL, NULL, f1053, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_Fidget02], 0x20, 0, f1052, NULL, NULL, f1053, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_Taunt01], 0x20, 0, f1052, NULL, NULL, f1053, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_AttackWindup01], 0x20, 0, f1052, NULL, NULL, + f1053, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_AttackLoop01], 0x10, 0, f1052, NULL, NULL, f1053, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_AttackEnd01], 0x20, 0, f1052, NULL, NULL, f1053, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_Damage01], 0x20, 0, f1052, NULL, NULL, f1053, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_subbanim[ANIM_Damage02], 0x20, 0, f1052, NULL, NULL, f1053, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + + NPCC_BuildStandardAnimTran(table, g_strz_subbanim, ourAnims, 1, f1454); + + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_AttackWindup01], + g_strz_subbanim[ANIM_AttackLoop01], 0, 0, 0x10, 0, 0, 0, 0, 0, f1455, + 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_AttackLoop01], + g_strz_subbanim[ANIM_AttackEnd01], 0, 0, 0, 0, 0, 0, 0, 0, f1455, 0); + xAnimTableNewTransition(table, g_strz_subbanim[ANIM_AttackEnd01], g_strz_subbanim[ANIM_Idle01], + 0, 0, 0x10, 0, 0, 0, 0, 0, f1455, 0); + + return table; +} + void zNPCPrawn::NewTime(xScene* xscn, float dt) { zNPCCommon::NewTime(xscn, dt); From 41af8673835980902f928a2067e8dcb8b74012aa Mon Sep 17 00:00:00 2001 From: Livewire Date: Mon, 24 Mar 2025 00:15:34 -0400 Subject: [PATCH 08/44] worst push ever --- src/SB/Game/zNPCTypeDuplotron.cpp | 45 +++++++++++++++++++++++++++++++ src/SB/Game/zNPCTypeDuplotron.h | 6 ++++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/src/SB/Game/zNPCTypeDuplotron.cpp b/src/SB/Game/zNPCTypeDuplotron.cpp index d1d1cbea8..ef6745dfb 100644 --- a/src/SB/Game/zNPCTypeDuplotron.cpp +++ b/src/SB/Game/zNPCTypeDuplotron.cpp @@ -1,9 +1,16 @@ #include "zNPCTypeDuplotron.h" +#include "zNPCTypeCommon.h" #include "zNPCTypes.h" #include "xMath3.h" #include "xstransvc.h" +#define ANIM_Unk1 1 +#define ANIM_Unk2 2 +#define ANIM_Unk3 3 // TEMP NAMES +#define ANIM_Unk4 4 +#define ANIM_UNKNOWN 5 + extern U32 g_hash_dupoanim[5]; extern char* g_strz_dupoanim[5]; @@ -72,6 +79,38 @@ void ZNPC_Destroy_Duplotron(xFactoryInst* inst) delete inst; } +xAnimTable* ZNPC_AnimTable_Duplotron() +{ + S32 ourAnims[5] = { //Literally no clue what the names should be. + ANIM_Unk1, ANIM_Unk2, ANIM_Unk3, ANIM_Unk4, ANIM_UNKNOWN + }; + + xAnimTable* table = xAnimTableNew("zNPCDupltron", NULL, 0); + + xAnimTableNewState(table, g_strz_dupoanim[ANIM_Unk1], 0x10, 0, 1, NULL, NULL, 0, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_dupoanim[ANIM_Unk2], 0x20, 0, 1, NULL, NULL, 0, NULL, + NULL, //Needs a bit of attention + xAnimDefaultBeforeEnter, NULL, + NULL); //Only pushing cus im done with it for now + xAnimTableNewState(table, g_strz_dupoanim[ANIM_Unk3], 0x10, 0, 1, NULL, NULL, 0, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_dupoanim[ANIM_Unk4], 0, 0, 1, NULL, NULL, 0, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + + NPCC_BuildStandardAnimTran(table, g_strz_dupoanim, ourAnims, 1, 0.2); +} + +void zNPCDuplotron::ParseINI() +{ + zNPCCommon::ParseINI(); +} + +void zNPCDuplotron::BUpdate(xVec3* pos) +{ + zNPCCommon::BUpdate(pos); +} + // 100% match that needs the full vtable to be filled out // because it induces vtable generation void zNPCDuplotron::SelfSetup() @@ -86,6 +125,12 @@ void zNPCDuplotron::SelfSetup() psy->SetSafety(0x4E474430); } +S32 zNPCDuplotron::IsAlive() +{ + xPsyche* psy = this->psy_instinct; + psy->GIDOfActive(); +} + // non-matching: scheduling? void DUPO_InitEffects() { diff --git a/src/SB/Game/zNPCTypeDuplotron.h b/src/SB/Game/zNPCTypeDuplotron.h index 8d5624ba6..7c9e85f09 100644 --- a/src/SB/Game/zNPCTypeDuplotron.h +++ b/src/SB/Game/zNPCTypeDuplotron.h @@ -13,10 +13,14 @@ struct zNPCDuplotron : zNPCCommon zNPCDuplotron(S32 myType); void SelfSetup(); - + S32 IsAlive(); void VFXSmokeStack(F32 dt); void VFXOverheat(F32 dt, F32); void VFXCycleLights(F32 dt, S32 fastpace); + void ParseINI(); + void Reset(); + void BUpdate(xVec3*); + void Process(xScene*, float); // zNPCTypeCommon overrides void Move(xScene*, F32 dt, xEntFrame*); From 44288bc2d846bc615b9b0f588ca08398e6016f2d Mon Sep 17 00:00:00 2001 From: Livewire Date: Mon, 24 Mar 2025 01:02:05 -0400 Subject: [PATCH 09/44] BossSandy Animtable --- src/SB/Game/zNPCTypeBossSandy.cpp | 119 ++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/src/SB/Game/zNPCTypeBossSandy.cpp b/src/SB/Game/zNPCTypeBossSandy.cpp index bea758ddb..6fef07ea9 100644 --- a/src/SB/Game/zNPCTypeBossSandy.cpp +++ b/src/SB/Game/zNPCTypeBossSandy.cpp @@ -14,6 +14,35 @@ extern const char bossSandyStrings[]; +#define Unknown 1 +#define Idle01 2 +#define Idle02 3 +#define Taunt01 4 +#define Run01 5 +#define Walk01 6 +#define Melee01 7 +#define Hit01 8 +#define Hit02 9 +#define GetUp01 10 +#define Dizzy01 11 +#define ElbowDrop01 12 +#define Leap01 13 +#define Leap02 14 +#define Leap03 15 +#define Leap04 16 +#define Sit01 17 +#define SitShock01 18 +#define CLBegin01 19 +#define CLLoop01 20 +#define CLEnd01 21 +#define NoHeadIdle01 22 +#define NoHeadWaving01 23 +#define NoHeadGetUp01 24 +#define NoHeadShotUp01 25 +#define NoHeadShock01 26 +#define NoHeadReplace01 27 +#define NoHeadHit01 28 + extern F32 __830; // 0.0 0 extern F32 __831; // 1.0 3f800000 extern F32 __842; // 0.20000000298023224 3e4ccccd @@ -129,6 +158,96 @@ void on_change_shockwave(const tweak_info& tweak) sSandyPtr->shockRadius = __831; } +xAnimTable* ZNPC_AnimTable_BossSandy() +{ + // clang-format off + S32 ourAnims[28] = { + Unknown, + Idle01, + Idle02, + Taunt01, + Run01, + Walk01, + Melee01, + Hit01, + Hit02, + GetUp01, + Dizzy01, + ElbowDrop01, + Leap01, + Leap02, + Leap03 , + Leap04, + Sit01, + SitShock01, + CLBegin01, + CLLoop01, + CLEnd01, + NoHeadIdle01, + NoHeadWaving01, + NoHeadGetUp01, + NoHeadShotUp01, + NoHeadShock01, + NoHeadReplace01, + NoHeadHit01, + }; + // clang-format on + + //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, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[Taunt01], 0x10, 0, __831, NULL, NULL, __830, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[Run01], 0x10, 0, __831, NULL, NULL, __830, 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, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[Sit01], 0x10, 0, __831, NULL, NULL, __830, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[Hit02], 0x10, 0, __831, NULL, NULL, __830, NULL, NULL, + xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[SitShock01], 0x10, 0, __831, NULL, NULL, __830, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[CLBegin01], 0x10, 0, __831, NULL, NULL, __830, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[CLLoop01], 0x10, 0, __831, NULL, NULL, __830, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[CLEnd01], 0x10, 0, __831, NULL, NULL, __830, NULL, + NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[NoHeadIdle01], 0x10, 0, __831, NULL, NULL, __830, + 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, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + xAnimTableNewState(table, g_strz_bossanim[NoHeadReplace01], 0x10, 0, __831, NULL, NULL, __830, + NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL); + + NPCC_BuildStandardAnimTran(table, g_strz_bossanim, ourAnims, 1, __842); + + return table; +} + U32 HeadIsCarried(xAnimTransition*, xAnimSingle*, void*) { return globals.player.carry.grabbed == sSandyPtr->headBoulder; From be630cec361c4fa761e520c25d08d51603e5b0a5 Mon Sep 17 00:00:00 2001 From: Livewire Date: Mon, 24 Mar 2025 23:54:08 -0400 Subject: [PATCH 10/44] ZNPCTypeVillager --- src/SB/Game/zNPCTypeDuplotron.cpp | 4 +- src/SB/Game/zNPCTypeVillager.cpp | 135 ++++++++++++++++++++++++++++++ src/SB/Game/zNPCTypeVillager.h | 29 ++++++- 3 files changed, 166 insertions(+), 2 deletions(-) diff --git a/src/SB/Game/zNPCTypeDuplotron.cpp b/src/SB/Game/zNPCTypeDuplotron.cpp index ef6745dfb..8f5cdbd27 100644 --- a/src/SB/Game/zNPCTypeDuplotron.cpp +++ b/src/SB/Game/zNPCTypeDuplotron.cpp @@ -99,6 +99,7 @@ xAnimTable* ZNPC_AnimTable_Duplotron() xAnimDefaultBeforeEnter, NULL, NULL); NPCC_BuildStandardAnimTran(table, g_strz_dupoanim, ourAnims, 1, 0.2); + return table; } void zNPCDuplotron::ParseINI() @@ -128,7 +129,8 @@ void zNPCDuplotron::SelfSetup() S32 zNPCDuplotron::IsAlive() { xPsyche* psy = this->psy_instinct; - psy->GIDOfActive(); + //psy->GIDOfActive(); + return psy->GIDOfActive(); } // non-matching: scheduling? diff --git a/src/SB/Game/zNPCTypeVillager.cpp b/src/SB/Game/zNPCTypeVillager.cpp index 4891b1403..e83131fdc 100644 --- a/src/SB/Game/zNPCTypeVillager.cpp +++ b/src/SB/Game/zNPCTypeVillager.cpp @@ -1,6 +1,19 @@ #include "zNPCTypeVillager.h" #include "zNPCTypes.h" +#include "zNPCGoals.h" + +#define ANIM_Idle01 1 +#define ANIM_Move01 2 +#define ANIM_Hurt01 3 +#define ANIM_Yawn01 4 +#define ANIM_Talk01 5 +#define ANIM_Flee01 6 +#define ANIM_Fear01 7 +#define ANIM_Pray01 8 +#define ANIM_Clap01 9 +#define ANIM_Special01 10 +#define ANIM_Unknown 0 extern char* g_strz_folkanim[26]; extern U32 g_hash_folkanim[26]; @@ -268,6 +281,120 @@ xAnimTable* ZNPC_AnimTable_SuperFriend() return ZNPC_AnimTable_SuperFriend(NULL); } +U8 zNPCVillager::PhysicsFlags() const +{ + S32 flags = 0; + S32 pflags = 0; + if (flg_move & 0x6) + { + flags |= 3; + } + pflags = flags * -5; + if (flg_move & 0x2) + { + pflags = flags |= 4; + } + + return pflags; +} + +void zNPCVillager::Init(xEntAsset* asset) +{ + zNPCCommon::Init(asset); + zNPCCommon::flg_move = 10; + zNPCCommon::flg_vuln = 0; +} + +// void zNPCVillager::Reset() //Not sure what the correct values are for the IFs +// { +// NPCConfig* cfg; +// this->zNPCCommon::Reset(); + +// if (psy_instinct != 0) +// { +// this->psy_instinct->GoalSet(NPC_GOAL_IDLE, 1); +// } +// } + +void zNPCVillager::ParseINI() +{ + zNPCCommon::ParseINI(); + cfg_npc->snd_traxShare = &g_sndTrax_Villager; + NPCS_SndTablePrepare((NPCSndTrax*)&g_sndTrax_Villager); + zNPCVillager::ParseNonRandTalk(); +} + +void zNPCVillager::ParseNonRandTalk() +{ + // NPCConfig* cfg; //0x1d8 + // F32 non_choices[4]; + // S32 found; + // S32 i; + // U8 skip; + // S32 j; + + // cfg = cfg_npc; + // cfg = 0; + // non_choices[0] = 0.0; + // non_choices[1] = 0.0; + // non_choices[2] = 0.0; + // non_choices[3] = 0.0; + + // +} + +void zNPCVillager::Process(xScene* xscn, float dt) +{ + zNPCVillager::ChkCheatSize(); + if (psy_instinct != 0) + { + this->psy_instinct->Timestep(dt, NULL); + } + zNPCCommon::Process(xscn, dt); +} + +void zNPCVillager::SpeakBegin() +{ + psy_instinct->GoalSet(NPC_GOAL_SPEAK, 1); +} + +void zNPCVillager::SpeakEnd() //80% +{ + xPsyche* psy = psy_instinct; + psy->GIDInStack(NPC_GOAL_LIMBO); + + if ((psy == 0) && (psy->GIDOfSafety() != 0)) + { + psy->GoalSet(NPC_GOAL_LIMBO, 1); + } +} + +void zNPCVillager::TossMyConverse() +{ + converse = 0; +} + +void zNPCFish::ParseINI() +{ + zNPCVillager::ParseINI(); + zNPCFish::FishSoundTables(); +} + +// void zNPCFish::FishSoundTables() +// { +// S32 tempR; +// tempR = xNPCBasic::SelfType(); +// switch (tempR) +// { +// case 'NTF0': +// { +// } +// case 'NPC_TYPE_FISH_MALE': +// { +// } +// } +// } + /* void FOLK_InitEffects() { @@ -301,6 +428,14 @@ void zNPCFish::CheckDoChat() { } +void zNPCMerManChair::Init(xEntAsset*) //Seems to load an extra value? +{ + zNPCVillager::Init(asset); + flg_move = 1; + flg_vuln = -1; + flg_vuln = flg_vuln & 0x9effffff; +} + void ztaskbox::callback::on_talk_start() { } diff --git a/src/SB/Game/zNPCTypeVillager.h b/src/SB/Game/zNPCTypeVillager.h index 11f03a669..6549982c8 100644 --- a/src/SB/Game/zNPCTypeVillager.h +++ b/src/SB/Game/zNPCTypeVillager.h @@ -18,7 +18,7 @@ struct HiThere : ztaskbox::callback struct zNPCVillager : zNPCCommon { HiThere hithere; - ztaskbox* converse; + ztaskbox* converse; //0x2a8 S32 current_talk_anim; zNPCVillager(S32 myType); @@ -26,6 +26,18 @@ struct zNPCVillager : zNPCCommon void FindMyConverse(); U8 ColPenByFlags() const; U8 ColChkByFlags() const; + U8 ColPenFlags() const; + U8 PhysicsFlags() const; + void Init(xEntAsset*); + void Reset(); + void ParseINI(); + void ParseNonRandTalk(); + void Process(xScene* xscn, float dt); + void SelfSetup(); + void SpeakBegin(); + void SpeakEnd(); + void TossMyConverse(); + void ChkCheatSize(); F32 GenShadCacheRad(); }; @@ -37,6 +49,8 @@ struct zNPCFish : zNPCVillager xEntDrive raw_drvdata; zNPCFish(S32 myType); + void ParseINI(); + void FishSoundTables(); void CheckDoChat(); }; @@ -77,6 +91,7 @@ struct zNPCMerManChair : zNPCVillager S32 flg_mermanchair; zNPCMerManChair(S32 myType); + void Init(xEntAsset*); U8 PhysicsFlags() const; U8 ColPenFlags() const; U8 ColChkFlags() const; @@ -192,5 +207,17 @@ 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); + +extern NPCSndTrax g_sndTrax_VillagerMale; +extern NPCSndTrax g_sndTrax_VillagerFemale; +extern NPCSndTrax g_sndTrax_VillagerElder; +extern NPCSndTrax g_sndTrax_VillagerEldess; +extern NPCSndTrax g_sndTrax_VillagerBoy; +extern NPCSndTrax g_sndTrax_VillagerGirl; +extern NPCSndTrax g_sndTrax_VillagerCoStar; +extern NPCSndTrax g_sndTrax_Squidward; #endif From 4c7e35aedc7c3c63d00b754796dda085648a6108 Mon Sep 17 00:00:00 2001 From: Livewire Date: Wed, 26 Mar 2025 00:41:22 -0400 Subject: [PATCH 11/44] ZNPCTypeVillager functions --- src/SB/Game/zNPCGoals.cpp | 4 +- src/SB/Game/zNPCTypeVillager.cpp | 105 +++++++++++++++++++++++++++++++ src/SB/Game/zNPCTypeVillager.h | 27 ++++++-- 3 files changed, 128 insertions(+), 8 deletions(-) diff --git a/src/SB/Game/zNPCGoals.cpp b/src/SB/Game/zNPCGoals.cpp index 3920d92eb..5c19fb03b 100644 --- a/src/SB/Game/zNPCGoals.cpp +++ b/src/SB/Game/zNPCGoals.cpp @@ -43,7 +43,7 @@ void zNPCGoals_RegisterTypes(xFactory* fac) NPC_GOAL_TALK, GOALCreate_Villager, GOALDestroy_Goal, NPC_GOAL_CHATTER, GOALCreate_Villager, GOALDestroy_Goal, NPC_GOAL_SPEAK, GOALCreate_Villager, GOALDestroy_Goal, - NPC_GOAL_BALLOON, GOALCreate_Villager, GOALDestroy_Goal, + NPC_GOAL_BALLOON, GOALCreate_Villager, GOALDestroy_Goal, //0x533e NPC_GOAL_BOYRIDE, GOALCreate_Villager, GOALDestroy_Goal, NPC_GOAL_BOYFALL, GOALCreate_Villager, GOALDestroy_Goal, NPC_GOAL_BOYWEEP, GOALCreate_Villager, GOALDestroy_Goal, @@ -201,4 +201,4 @@ void zNPCGoals_RegisterTypes(xFactory* fac) // clang-format on fac->RegItemType(typelist); -} \ No newline at end of file +} diff --git a/src/SB/Game/zNPCTypeVillager.cpp b/src/SB/Game/zNPCTypeVillager.cpp index e83131fdc..6d6506c70 100644 --- a/src/SB/Game/zNPCTypeVillager.cpp +++ b/src/SB/Game/zNPCTypeVillager.cpp @@ -315,6 +315,9 @@ void zNPCVillager::Init(xEntAsset* asset) // this->psy_instinct->GoalSet(NPC_GOAL_IDLE, 1); // } // } +void zNPCVillager::Reset() +{ +} void zNPCVillager::ParseINI() { @@ -374,6 +377,10 @@ void zNPCVillager::TossMyConverse() converse = 0; } +void zNPCFish::Reset() +{ +} + void zNPCFish::ParseINI() { zNPCVillager::ParseINI(); @@ -436,6 +443,104 @@ void zNPCMerManChair::Init(xEntAsset*) //Seems to load an extra value? flg_vuln = flg_vuln & 0x9effffff; } +void zNPCNewsFish::SpeakStop() +{ + S32 tempvar = zNPCNewsFish::IsTalking(); + if (tempvar != 0) + { + xSndStop(soundHandle); + } + currSoundID = 0; + nextSoundID = 0; + soundHandle = 0; + jawData = 0; +} + +S32 zNPCNewsFish::IsTalking() +{ + return (soundHandle) ? xSndIsPlayingByHandle(soundHandle) : false; +} + +void zNPCNewsFish::TalkOnScreen(S32 talkOnScreen) +{ + if (talkOnScreen != 0) + { + newsfishFlags = newsfishFlags | 1; + return; + } + newsfishFlags = newsfishFlags & 0xfffffffe; + return; +} + +void zNPCNewsFish::reset_said() +{ + // +} + +void zNPCSandyBikini::Reset() //100% code match +{ + zNPCVillager::Reset(); + tmr_leakCycle = 0.0; +} + +void zNPCSandyBikini::Process(xScene* xscn, float dt) //100% code match +{ + zNPCVillager::Process(xscn, dt); + zNPCSandyBikini::VFXLeakyFaucet(dt); +} + +void zNPCBalloonBoy::Init(xEntAsset* asset) //68% +{ + zNPCFish::Init(asset); + rast_shadBalloon = 0; + bound.type = 0; + + //cg_npc 0x1d8 + //bound.type 0x84 +} + +void zNPCBalloonBoy::SelfSetup() //100% code match +{ + xPsyche* psy; + zNPCFish::SelfSetup(); + psy = psy_instinct; + psy->BrainExtend(); + zNPCBalloonBoy::AddBallooning(psy); + psy->BrainEnd(); +} + +void zNPCBalloonBoy::Render() +{ + xNPCBasic::Render(); + zNPCBalloonBoy::PlatShadRend(); +} + +void zNPCBalloonBoy::AddBallooning(xPsyche* psy) +{ + psy->AddGoal(NPC_GOAL_BALLOON, NULL); + psy->AddGoal(NPC_GOAL_BOYRIDE, NULL); + psy->AddGoal(NPC_GOAL_BOYFALL, NULL); + psy->AddGoal(NPC_GOAL_BOYWEEP, NULL); + psy->AddGoal(NPC_GOAL_BOYSWIM, NULL); +} + +void zNPCBalloonBoy::PlatAnimSet(en_BBOY_PLATANIM platanim) +{ + F32 fvals[4]; +} + +void zNPCBalloonBoy::PlatAnimSync() +{ + zNPCCommon::AnimCurState(); +} + +void zNPCBubbleBuddy::Reset() // possible scheduling meme? +{ + zNPCFish::Reset(); + // flags = flags | 0x40; + flags |= 0x40; +} + void ztaskbox::callback::on_talk_start() { } diff --git a/src/SB/Game/zNPCTypeVillager.h b/src/SB/Game/zNPCTypeVillager.h index 6549982c8..89ad80795 100644 --- a/src/SB/Game/zNPCTypeVillager.h +++ b/src/SB/Game/zNPCTypeVillager.h @@ -52,11 +52,15 @@ struct zNPCFish : zNPCVillager void ParseINI(); void FishSoundTables(); void CheckDoChat(); + void Reset(); + void SelfSetup(); }; struct zNPCBubbleBuddy : zNPCFish { zNPCBubbleBuddy(S32 myType); + + void Reset(); }; enum en_BBOY_PLATANIM @@ -72,18 +76,27 @@ struct zNPCBalloonBoy : zNPCFish S32 specialBalloon; zPlatform* plat_balloons; xShadowCache* shadCache; + RwRaster* rast_shadBalloon; zNPCBalloonBoy(S32 myType); + void Init(xEntAsset* asset); + void SelfSetup(); + void Render(); + void PlatShadRend(); + void AddBallooning(xPsyche* psy); void PlatAnimSet(en_BBOY_PLATANIM anim); void PlatAnimSync(); }; struct zNPCSandyBikini : zNPCVillager { - F32 tmr_leakCycle; + F32 tmr_leakCycle; //0xac zNPCSandyBikini(S32 myType); + void Reset(); + void Process(xScene* xscn, float dt); + void VFXLeakyFaucet(float dt); }; struct zNPCMerManChair : zNPCVillager @@ -107,12 +120,12 @@ struct zNPCNewsFish : zNPCVillager say_data said[71]; U8 was_reset; - U32 soundHandle; - U32 currSoundID; - U32 nextSoundID; - F32 jawTime; + U32 soundHandle; //0x4ec + U32 currSoundID; //0x4f0 + U32 nextSoundID; //0x4f4 + F32 jawTime; //0x4f8 void* jawData; - U32 newsfishFlags; + U32 newsfishFlags; //0x500 xVec2 onScreenCoords; xVec2 offScreenCoords; xVec2 screenCoords; @@ -121,6 +134,8 @@ struct zNPCNewsFish : zNPCVillager F32 appearSpeed; F32 disappearSpeed; F32 screenLerp; + S32 IsTalking(); + void reset_said(); zNPCNewsFish(S32 myType); From 1620763703a3dd48fbb20f6d84bd302834608761 Mon Sep 17 00:00:00 2001 From: Matt P Date: Fri, 28 Mar 2025 21:45:50 -0500 Subject: [PATCH 12/44] ship it, YOLO --- .github/workflows/build.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5382a09f5..979d82796 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -141,7 +141,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: write - needs: + needs: - build - build-previous if: github.ref == 'refs/heads/main' @@ -197,3 +197,28 @@ jobs: github_token: ${{ secrets.WEBSITE_TOKEN }} repository: bfbbdecomp/website branch: ${{ github.ref }} + pr-comment: + runs-on: ubuntu-latest + needs: + - build + - build-previous + if: github.event_name == 'pull_request' + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Run OK command + id: ok-command + run: | + OK --previous build/${{ matrix.version }}/previous.json --current build/${{ matrix.version }}/progress.json pr > result.txt + cat result.txt + + - name: Post comment to PR + run: | + PR_NUMBER=$(jq --raw-output .pull_request.number $GITHUB_EVENT_PATH) + COMMENT_BODY=$(cat result.txt) + curl -X POST \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "Content-Type: application/json" \ + --data "{\"body\":\"$COMMENT_BODY\"}" \ + "https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/comments" From 438c0c73a0ca478c391b06e132c9f46a8819c2eb Mon Sep 17 00:00:00 2001 From: Livewire Date: Fri, 28 Mar 2025 22:50:40 -0400 Subject: [PATCH 13/44] test commit --- src/SB/Game/zNPCTypeKingJelly.cpp | 62 ++++++++++++++++++++++++++++++- src/SB/Game/zNPCTypeKingJelly.h | 26 +++++++++++-- src/SB/Game/zNPCTypeVillager.cpp | 19 ++++++---- src/SB/Game/zNPCTypeVillager.h | 5 ++- 4 files changed, 98 insertions(+), 14 deletions(-) diff --git a/src/SB/Game/zNPCTypeKingJelly.cpp b/src/SB/Game/zNPCTypeKingJelly.cpp index 1b4c07699..297d4cc22 100644 --- a/src/SB/Game/zNPCTypeKingJelly.cpp +++ b/src/SB/Game/zNPCTypeKingJelly.cpp @@ -139,7 +139,7 @@ xVec3* zNPCKingJelly::get_bottom() void zNPCKingJelly::Setup() { - this->children_size = 0; //Called for address 0x88C, Started plugging things in till it matched. + this->children_size = 0; //0x88C load_model(); load_curtain_model(); zNPCSubBoss::Setup(); @@ -165,6 +165,11 @@ void zNPCKingJelly::BUpdate(xVec3* pos) zNPCCommon::BUpdate(pos); } +void zNPCKingJelly::RenderExtra() +{ + zNPCKingJelly::render_debug(); +} + void zNPCKingJelly::SelfSetup() { xBehaveMgr* bmgr; @@ -302,6 +307,36 @@ void zNPCKingJelly::create_tentacle_lightning() { } +void zNPCKingJelly::destroy_tentacle_lightning() +{ + for (S32 i = 0; i < 7; i++) + { + if (tentacle_lightning[i]) + { + zLightningKill(tentacle_lightning[i]); + tentacle_lightning[i] = NULL; + } + } +} + +void zNPCKingJelly::refresh_tentacle_points() +{ + S32 tempvar = 0; + do + { + refresh_tentacle_points(tempvar); + tempvar = tempvar + 1; + } while (tempvar < 7); +} + +void zNPCKingJelly::destroy_ambient_rings() +{ + for (S32 i = 0; i < 3; i++) + { + ambient_rings[i].destroy(); + } +} + void zNPCKingJelly::generate_spawn_particles() { } @@ -324,12 +359,37 @@ void zNPCKingJelly::load_curtain_model() // } +// void zNPCKingJelly::start_blink() +// { +// blink.active = 1; +// blink.delay = 0; +// blink.count = 0; +// model = 0; +// render = 0; +// this = 0; + +// // 0x24 model +// // 0x44 render +// } + S32 zNPCGoalKJDamage::Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* xscn) { // TODO return 0; } +S32 zNPCGoalKJShockGround::Exit(F32 dt, void* updCtxt) +{ + zNPCKingJelly& kj = *(zNPCKingJelly*)this->psyche->clt_owner; + if (kj.flag.charging != 0) + { + kj.end_charge(); + } + kj.create_ambient_rings(); + kj.disable_tentacle_damage = 0; + return xGoal::Exit(dt, updCtxt); +} + S32 zNPCGoalKJDamage::Enter(F32 dt, void* updCtxt) { // TODO diff --git a/src/SB/Game/zNPCTypeKingJelly.h b/src/SB/Game/zNPCTypeKingJelly.h index 880593dbd..d8526ecde 100644 --- a/src/SB/Game/zNPCTypeKingJelly.h +++ b/src/SB/Game/zNPCTypeKingJelly.h @@ -16,7 +16,7 @@ struct lightning_ring F32 segment_length; F32 min_height; F32 max_height; - F32 min_radius; + F32 min_radius; //0x1c? F32 max_radius; //0x20? F32 delay; F32 accel; @@ -38,11 +38,14 @@ struct lightning_ring F32 rot_radius; F32 degrees; //0x58? } property; - zLightning* arcs[8]; + zLightning* arcs[8]; //0x78 U32 arcs_size; //0x7c + void (*update_callback)(lightning_ring&, F32); void create(); + void destroy(); + static void destroy(S32); }; struct zNPCKingJelly : zNPCSubBoss @@ -110,7 +113,7 @@ struct zNPCKingJelly : zNPCSubBoss U8 active; //0x2EC S32 count; //0x2f0 F32 intensity; - F32 delay; + F32 delay; //0x2f8 } blink; struct { @@ -120,7 +123,7 @@ struct zNPCKingJelly : zNPCSubBoss child_data children[32]; U32 children_size; //0x88C F32 last_tentacle_shock; - zLightning* tentacle_lightning[7]; + zLightning* tentacle_lightning[7]; //0x894 [0] xVec3 tentacle_points[13][7]; lightning_ring ambient_rings[3]; lightning_ring wave_rings[4]; @@ -136,6 +139,7 @@ struct zNPCKingJelly : zNPCSubBoss void Destroy(); U32 AnimPick(S32 rawgoal, en_NPC_GOAL_SPOT gspot, xGoal* goal); void BUpdate(xVec3*); + void RenderExtra(); void SelfSetup(); void init_child(zNPCKingJelly::child_data&, zNPCCommon&, int); void disable_child(zNPCKingJelly::child_data&); @@ -144,6 +148,7 @@ struct zNPCKingJelly : zNPCSubBoss void load_model(); void load_curtain_model(); void reset_curtain(); + void start_blink(); void decompose(); void post_decompose(); void vanish(); @@ -153,10 +158,14 @@ struct zNPCKingJelly : zNPCSubBoss void on_change_fade_obstructions(const tweak_info&); void render_debug(); void create_tentacle_lightning(); + void destroy_tentacle_lightning(); void refresh_tentacle_points(); void refresh_tentacle_points(S32); + void destroy_ambient_rings(); void generate_spawn_particles(); void update_round(); + void end_charge(); + void create_ambient_rings(); }; struct zNPCGoalKJIdle : zNPCGoalCommon @@ -204,6 +213,15 @@ struct zNPCGoalKJShockGround : zNPCGoalCommon zNPCGoalKJShockGround(S32 goalID) : zNPCGoalCommon(goalID) { } + + S32 Enter(F32 dt, void* updCtxt); + S32 Exit(F32 dt, void* updCtxt); + S32 Process(en_trantype*, float, void*, xScene*); + S32 update_start(float); + S32 update_warm_up(float); + S32 update_release(float); + S32 update_cool_down(float); + S32 update_stop(float); }; struct zNPCGoalKJDamage : zNPCGoalCommon diff --git a/src/SB/Game/zNPCTypeVillager.cpp b/src/SB/Game/zNPCTypeVillager.cpp index 6d6506c70..8b35a5e9c 100644 --- a/src/SB/Game/zNPCTypeVillager.cpp +++ b/src/SB/Game/zNPCTypeVillager.cpp @@ -361,14 +361,16 @@ void zNPCVillager::SpeakBegin() psy_instinct->GoalSet(NPC_GOAL_SPEAK, 1); } -void zNPCVillager::SpeakEnd() //80% +void zNPCVillager::SpeakEnd() { xPsyche* psy = psy_instinct; - psy->GIDInStack(NPC_GOAL_LIMBO); - - if ((psy == 0) && (psy->GIDOfSafety() != 0)) + if ((psy->GIDInStack(NPC_GOAL_LIMBO) == 0)) { - psy->GoalSet(NPC_GOAL_LIMBO, 1); + S32 safetyGid = psy->GIDOfSafety(); + if (safetyGid != 0) + { + psy->GoalSet(safetyGid, 1); + } } } @@ -489,13 +491,14 @@ void zNPCSandyBikini::Process(xScene* xscn, float dt) //100% code match zNPCSandyBikini::VFXLeakyFaucet(dt); } -void zNPCBalloonBoy::Init(xEntAsset* asset) //68% +void zNPCBalloonBoy::Init(xEntAsset* asset) { zNPCFish::Init(asset); rast_shadBalloon = 0; - bound.type = 0; + cfg_npc->dst_castShadow = -1; + return; - //cg_npc 0x1d8 + //cfg_npc 0x1d8 //bound.type 0x84 } diff --git a/src/SB/Game/zNPCTypeVillager.h b/src/SB/Game/zNPCTypeVillager.h index 1f9ad3232..3a2552add 100644 --- a/src/SB/Game/zNPCTypeVillager.h +++ b/src/SB/Game/zNPCTypeVillager.h @@ -37,6 +37,7 @@ struct zNPCVillager : zNPCCommon void SpeakBegin(); void SpeakEnd(); void TossMyConverse(); + S32 PlayerIsStaring(); void ChkCheatSize(); F32 GenShadCacheRad(); }; @@ -49,6 +50,7 @@ struct zNPCFish : zNPCVillager xEntDrive raw_drvdata; zNPCFish(S32 myType); + void Init(xEntAsset*); void ParseINI(); void FishSoundTables(); void CheckDoChat(); @@ -76,7 +78,7 @@ struct zNPCBalloonBoy : zNPCFish S32 specialBalloon; zPlatform* plat_balloons; xShadowCache* shadCache; - RwRaster* rast_shadBalloon; + static RwRaster* rast_shadBalloon; zNPCBalloonBoy(S32 myType); @@ -213,6 +215,7 @@ xAnimTable* ZNPC_AnimTable_BalloonBoy(); xAnimTable* ZNPC_AnimTable_BalloonBoy(xAnimTable* callerTable); xAnimTable* ZNPC_AnimTable_SuperFriend(); xAnimTable* ZNPC_AnimTable_SuperFriend(xAnimTable* callerTable); +S32 FOLK_grul_goAlert(xGoal*, void*, en_trantype*, float, void*); void FOLK_KillEffects(); void FOLK_InitEffects(); void zNPCVillager_ScenePostInit(); From 869d1310db272fb9ecba9f2f1dac87787bb234ca Mon Sep 17 00:00:00 2001 From: Livewire Date: Fri, 28 Mar 2025 23:22:26 -0400 Subject: [PATCH 14/44] test --- .github/workflows/build.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea8f0e7c6..2db014404 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -197,3 +197,38 @@ jobs: github_token: ${{ secrets.WEBSITE_TOKEN }} repository: bfbbdecomp/website branch: ${{ github.ref }} + pr-comment: + runs-on: ubuntu-latest + needs: + - build + - build-previous + if: github.event_name == 'pull_request' + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download Progress Artifacts + uses: actions/download-artifact@v4 + with: + path: ./artifacts + + - name: Download OK bot + id: download-ok + run: | + python ./tools/download_tool.py ok . --tag v0.1.1 + + - name: Run OK command + id: ok-command + run: | + ./ok --previous artifacts/previous.json --current artifacts/progress.json pr > pr.txt + cat pr.txt + + - name: Post comment to PR + run: | + PR_NUMBER=$(jq --raw-output .pull_request.number $GITHUB_EVENT_PATH) + COMMENT_BODY=$(cat pr.txt) + curl -X POST \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "Content-Type: application/json" \ + --data "{\"body\":\"$COMMENT_BODY\"}" \ + "https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/comments" From db0369aea5e365e5c28976a56f771b6c073a09bd Mon Sep 17 00:00:00 2001 From: Matt P Date: Fri, 28 Mar 2025 22:48:34 -0500 Subject: [PATCH 15/44] add permissions --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 85447c3da..b01d0dccb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -199,6 +199,10 @@ jobs: branch: ${{ github.ref }} pr-comment: runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + repository-projects: write needs: - build - build-previous From 03a8c2600db9e049226de9cc0e6e258db06b8a0f Mon Sep 17 00:00:00 2001 From: Matt P Date: Fri, 28 Mar 2025 22:50:48 -0500 Subject: [PATCH 16/44] CI --- .DS_Store | Bin 0 -> 6148 bytes .github/workflows/build.yml | 1 + 2 files changed, 1 insertion(+) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b2f7f23c2c0c81b6f3a8d732fceffc3f3026355d GIT binary patch literal 6148 zcmeHKK~BRk5FEFmw7{W9E=YMnC4P{W_D~5p&<{Y9QXz!~we-L(cmBW^cpoR2wXG^n z%7F_)Xg6Aq9uHVn)>^plHSS53i!IjdVSp#RgmLDq z78fC7A8GI|F~51O@eVnL6?r*xXIRv-el*yZnBoExTw{hw$Zjob?1&>+@0p|M@mA5J zhZ|-bVvH-|0FTJR%vP0ZM4L*lk%la*L6vpDwJ3PydsV11IUqGvKow90ey9NVY_aaK zLoHPSRX`QkDInj6m@b%jEFIcU2Mc=yAVzGq#=86pN=)oA@mMFrO5yQA} zw#S~Acq|>da2S91FurHwPbkLr&it{Z!z2#1R0ULlP=U6)?aTf@`TqPL2I-wDpbGpe z1xz%ajYpi4-&-4#lf5>k-_pf|S32B Date: Fri, 28 Mar 2025 22:57:48 -0500 Subject: [PATCH 17/44] asdoijfaoisdjf --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b49ce3b8..5a05cc1ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -238,7 +238,7 @@ jobs: run: | PR_NUMBER=$(jq --raw-output .pull_request.number $GITHUB_EVENT_PATH) COMMENT_BODY=$(cat pr.txt) - curl -X POST \ + curl --fail-with-body -X POST \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ -H "Content-Type: application/json" \ --data "{\"body\":\"$COMMENT_BODY\"}" \ From e1aec2fffdbadb1c54a193d72a26488e7fcdeb86 Mon Sep 17 00:00:00 2001 From: Matt P Date: Fri, 28 Mar 2025 23:00:22 -0500 Subject: [PATCH 18/44] ijasdoifj --- .github/workflows/build.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a05cc1ee..0ab442ecf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -238,6 +238,16 @@ jobs: run: | PR_NUMBER=$(jq --raw-output .pull_request.number $GITHUB_EVENT_PATH) COMMENT_BODY=$(cat pr.txt) + + # Print the URL + echo "Posting comment to: $URL" + + curl --fail-with-body -X POST \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "Content-Type: application/json" \ + --data "{\"body\":\"$COMMENT_BODY\"}" \ + "$URL" + curl --fail-with-body -X POST \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ -H "Content-Type: application/json" \ From a7860c8067c520eadfb7334aa90bb81125de751d Mon Sep 17 00:00:00 2001 From: Matt P Date: Fri, 28 Mar 2025 23:03:13 -0500 Subject: [PATCH 19/44] ojaspdfijasdfijUPPERCASE test --- .github/workflows/build.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0ab442ecf..c4ed53d53 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -240,13 +240,8 @@ jobs: COMMENT_BODY=$(cat pr.txt) # Print the URL - echo "Posting comment to: $URL" - - curl --fail-with-body -X POST \ - -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ - -H "Content-Type: application/json" \ - --data "{\"body\":\"$COMMENT_BODY\"}" \ - "$URL" + # Print the URL as you requested + echo "URL: https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/comments" curl --fail-with-body -X POST \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ From 1199753fddd759734e07818cdd5875d1faba8a95 Mon Sep 17 00:00:00 2001 From: Matt P Date: Fri, 28 Mar 2025 23:07:26 -0500 Subject: [PATCH 20/44] KFUCK --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c4ed53d53..0cd857516 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -235,6 +235,8 @@ jobs: cat pr.txt - name: Post comment to PR + with: + github_token: ${{ secrets.WEBSITE_TOKEN }} run: | PR_NUMBER=$(jq --raw-output .pull_request.number $GITHUB_EVENT_PATH) COMMENT_BODY=$(cat pr.txt) From 6d514aabecf00a499db05abaea13132b3989534d Mon Sep 17 00:00:00 2001 From: Matt P Date: Fri, 28 Mar 2025 23:15:20 -0500 Subject: [PATCH 21/44] ODIO MI PUTA VIDA DIOS MATAME YA --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0cd857516..b6ba3c537 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -235,8 +235,6 @@ jobs: cat pr.txt - name: Post comment to PR - with: - github_token: ${{ secrets.WEBSITE_TOKEN }} run: | PR_NUMBER=$(jq --raw-output .pull_request.number $GITHUB_EVENT_PATH) COMMENT_BODY=$(cat pr.txt) @@ -245,8 +243,10 @@ jobs: # Print the URL as you requested echo "URL: https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/comments" - curl --fail-with-body -X POST \ + curl --fail-with-body -L -X POST \ + -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ -H "Content-Type: application/json" \ --data "{\"body\":\"$COMMENT_BODY\"}" \ "https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/comments" From 0547e08baca7ab59b97c65bd92b1b44686a58ac1 Mon Sep 17 00:00:00 2001 From: Matt P Date: Fri, 28 Mar 2025 23:18:20 -0500 Subject: [PATCH 22/44] FUCOI:JVSIDJklj --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6ba3c537..52b4224c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -241,7 +241,7 @@ jobs: # Print the URL # Print the URL as you requested - echo "URL: https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/comments" + echo "URL: https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER/comments" curl --fail-with-body -L -X POST \ -H "Accept: application/vnd.github+json" \ @@ -249,4 +249,4 @@ jobs: -H "X-GitHub-Api-Version: 2022-11-28" \ -H "Content-Type: application/json" \ --data "{\"body\":\"$COMMENT_BODY\"}" \ - "https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/comments" + "https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER/comments" From 8582d382b2d7f79cf16e21162ea90aa97560a9d7 Mon Sep 17 00:00:00 2001 From: Matt P Date: Fri, 28 Mar 2025 23:27:10 -0500 Subject: [PATCH 23/44] IJSDOFIJPSDOIFJ --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 52b4224c3..ed5bd2d62 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -233,6 +233,10 @@ jobs: run: | ./ok --previous artifacts/previous.json --current artifacts/progress.json pr > pr.txt cat pr.txt + - name: PR comment with file + uses: thollander/actions-comment-pull-request@v3 + with: + file-path: pr.txt - name: Post comment to PR run: | From fe15f0324202e3e36925bab171ebb3a84d10e038 Mon Sep 17 00:00:00 2001 From: Matt P Date: Fri, 28 Mar 2025 23:41:41 -0500 Subject: [PATCH 24/44] aisdj FUCK FUCK FUCK --- .github/workflows/build.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed5bd2d62..e77ef2ff4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -199,15 +199,12 @@ jobs: branch: ${{ github.ref }} pr-comment: runs-on: ubuntu-latest - permissions: - contents: write - issues: write - pull-requests: write - repository-projects: write needs: - build - build-previous if: github.event_name == 'pull_request' + permissions: + pull-requests: write steps: - name: Checkout repository uses: actions/checkout@v4 From a38192dc29a7dcf39169ab4800540cfb74be510a Mon Sep 17 00:00:00 2001 From: Matt P Date: Fri, 28 Mar 2025 23:43:57 -0500 Subject: [PATCH 25/44] fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK !fuck FUCK ! --- .github/workflows/build.yml | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e77ef2ff4..2ed40a7de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -231,23 +231,8 @@ jobs: ./ok --previous artifacts/previous.json --current artifacts/progress.json pr > pr.txt cat pr.txt - name: PR comment with file + permissions: + pull-requests: write uses: thollander/actions-comment-pull-request@v3 with: file-path: pr.txt - - - name: Post comment to PR - run: | - PR_NUMBER=$(jq --raw-output .pull_request.number $GITHUB_EVENT_PATH) - COMMENT_BODY=$(cat pr.txt) - - # Print the URL - # Print the URL as you requested - echo "URL: https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER/comments" - - curl --fail-with-body -L -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - -H "Content-Type: application/json" \ - --data "{\"body\":\"$COMMENT_BODY\"}" \ - "https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER/comments" From f2942a019faa6c3ab177dfe91e7ed8649dde0ae4 Mon Sep 17 00:00:00 2001 From: Matt P Date: Fri, 28 Mar 2025 23:44:38 -0500 Subject: [PATCH 26/44] Foiapjsdoifjaoisdjfaoidsjfio --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2ed40a7de..4ed423e5b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -231,8 +231,6 @@ jobs: ./ok --previous artifacts/previous.json --current artifacts/progress.json pr > pr.txt cat pr.txt - name: PR comment with file - permissions: - pull-requests: write uses: thollander/actions-comment-pull-request@v3 with: file-path: pr.txt From 7cd3850246b0cc559375995d62f726492f88fd89 Mon Sep 17 00:00:00 2001 From: Matt P Date: Sat, 29 Mar 2025 00:01:48 -0500 Subject: [PATCH 27/44] does this dumb shit work? --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ed423e5b..7b9adcfd7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -202,7 +202,7 @@ jobs: needs: - build - build-previous - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request_target' permissions: pull-requests: write steps: From ac1e272a4b3f48062995154660a7c85068b320ba Mon Sep 17 00:00:00 2001 From: Matt P Date: Sat, 29 Mar 2025 00:04:36 -0500 Subject: [PATCH 28/44] I am dead inside --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7b9adcfd7..4ed423e5b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -202,7 +202,7 @@ jobs: needs: - build - build-previous - if: github.event_name == 'pull_request_target' + if: github.event_name == 'pull_request' permissions: pull-requests: write steps: From e8f84f9ace32e359540f0a026afb3bb1a5555a07 Mon Sep 17 00:00:00 2001 From: Matt P Date: Sat, 29 Mar 2025 00:07:00 -0500 Subject: [PATCH 29/44] jaspdiofjasdopifj --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5a0d7bb03..f4b6a91da 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![Perfect Match]][progress] [![Fuzzy Match]][progress] + [![Functions]][progress] [progress]: https://bfbbdecomp.github.io/bfbb/ From a6abcdd5e87bf1cd268efedb4be2f2e469384bd4 Mon Sep 17 00:00:00 2001 From: Matt P Date: Sat, 29 Mar 2025 00:16:29 -0500 Subject: [PATCH 30/44] IJSDOIFJIOSDJFOIJES --- .github/workflows/build.yml | 1 + README.md | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ed423e5b..25c2e69a0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -233,4 +233,5 @@ jobs: - name: PR comment with file uses: thollander/actions-comment-pull-request@v3 with: + github_token: ${{ secrets.OK_BOT_PR_TOKEN }} file-path: pr.txt diff --git a/README.md b/README.md index f4b6a91da..5a0d7bb03 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ [![Perfect Match]][progress] [![Fuzzy Match]][progress] - [![Functions]][progress] [progress]: https://bfbbdecomp.github.io/bfbb/ From 005937eeb777db447eb7e44f3b43684b4667ea76 Mon Sep 17 00:00:00 2001 From: Matt P Date: Sat, 29 Mar 2025 00:20:03 -0500 Subject: [PATCH 31/44] why me --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25c2e69a0..dbf9ef10b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -233,5 +233,5 @@ jobs: - name: PR comment with file uses: thollander/actions-comment-pull-request@v3 with: - github_token: ${{ secrets.OK_BOT_PR_TOKEN }} + github-token: ${{ secrets.OK_BOT_PR_TOKEN }} file-path: pr.txt From eff1939032868b15b887e78a40eafd11a4c176dc Mon Sep 17 00:00:00 2001 From: Matt P Date: Sat, 29 Mar 2025 00:27:39 -0500 Subject: [PATCH 32/44] I guess this shit is just fucking impossible --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dbf9ef10b..744abf925 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -233,5 +233,5 @@ jobs: - name: PR comment with file uses: thollander/actions-comment-pull-request@v3 with: - github-token: ${{ secrets.OK_BOT_PR_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} file-path: pr.txt From 78e4c4d5c69e112f7e4b4106d6097804deafd097 Mon Sep 17 00:00:00 2001 From: Matt P Date: Sat, 29 Mar 2025 00:29:05 -0500 Subject: [PATCH 33/44] use newer version --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 744abf925..cc8533763 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -223,7 +223,7 @@ jobs: - name: Download OK bot id: download-ok run: | - python ./tools/download_tool.py OK ok --tag v0.1.1 + python ./tools/download_tool.py OK ok --tag v0.1.2 - name: Run OK command id: ok-command From 3dde261fccbf8beb5ae21c32a79ac39cf9738d46 Mon Sep 17 00:00:00 2001 From: Matt P Date: Sat, 29 Mar 2025 00:33:32 -0500 Subject: [PATCH 34/44] garbo --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc8533763..deb1a1217 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -202,7 +202,7 @@ jobs: needs: - build - build-previous - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request_target' permissions: pull-requests: write steps: From 3672d4032ac7d83ffd712304169a91a2f9a84ea3 Mon Sep 17 00:00:00 2001 From: Matt P Date: Sat, 29 Mar 2025 00:36:20 -0500 Subject: [PATCH 35/44] t --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5a0d7bb03..2d2634ea4 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ [![Perfect Match]][progress] [![Fuzzy Match]][progress] [![Functions]][progress] +asdfjads;fj [progress]: https://bfbbdecomp.github.io/bfbb/ [Fuzzy Match]: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fbfbbdecomp.github.io%2Fbfbb%2Fapi.json&query=fuzzy_match&label=Close%20Match&color=yellowgreen From b067adf261d9ead579c98c693a1a49f216d86cd7 Mon Sep 17 00:00:00 2001 From: Matt P Date: Sat, 29 Mar 2025 00:40:36 -0500 Subject: [PATCH 36/44] i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up i give up --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index deb1a1217..cc8533763 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -202,7 +202,7 @@ jobs: needs: - build - build-previous - if: github.event_name == 'pull_request_target' + if: github.event_name == 'pull_request' permissions: pull-requests: write steps: From 09e4ae24051084f27715eb40f7def43613dcf1c7 Mon Sep 17 00:00:00 2001 From: Matt P Date: Sat, 29 Mar 2025 22:09:53 -0500 Subject: [PATCH 37/44] try this --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc8533763..bf69e2d1f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: Build on: push: - pull_request: + pull_request_target: jobs: build: @@ -202,7 +202,7 @@ jobs: needs: - build - build-previous - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request_target' permissions: pull-requests: write steps: From 25f16c17d5d38acbfe0bf97421e0c6b8e81047e2 Mon Sep 17 00:00:00 2001 From: Matt P Date: Sat, 29 Mar 2025 22:14:57 -0500 Subject: [PATCH 38/44] test --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 2d2634ea4..5a0d7bb03 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ [![Perfect Match]][progress] [![Fuzzy Match]][progress] [![Functions]][progress] -asdfjads;fj [progress]: https://bfbbdecomp.github.io/bfbb/ [Fuzzy Match]: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fbfbbdecomp.github.io%2Fbfbb%2Fapi.json&query=fuzzy_match&label=Close%20Match&color=yellowgreen From 29521b69a332be55c349c388eb0bf34dae13b09d Mon Sep 17 00:00:00 2001 From: Livewire Date: Sun, 30 Mar 2025 00:29:36 -0400 Subject: [PATCH 39/44] functions and a bit of cleanup --- src/SB/Game/zNPCTypeKingJelly.cpp | 63 ++++++++++++++++++++++++------- src/SB/Game/zNPCTypeKingJelly.h | 10 ++++- 2 files changed, 59 insertions(+), 14 deletions(-) diff --git a/src/SB/Game/zNPCTypeKingJelly.cpp b/src/SB/Game/zNPCTypeKingJelly.cpp index 297d4cc22..636c7fadf 100644 --- a/src/SB/Game/zNPCTypeKingJelly.cpp +++ b/src/SB/Game/zNPCTypeKingJelly.cpp @@ -1,5 +1,6 @@ #include "zNPCTypeKingJelly.h" +#include "zNPCGoalCommon.h" #include #include "string.h" @@ -31,9 +32,17 @@ namespace { - void tweak() + S32 kill_sound(int) { + return 0; //to do } + S32 play_sound(int, const xVec3*) + { + return 0; //todo + } + // void tweak() + // { + // } } // namespace void lightning_ring::create() @@ -349,25 +358,53 @@ void zNPCKingJelly::load_curtain_model() { } -// void zNPCKingJelly::reset_curtain() -// { -// // f0 = data shit -// // r4 = 0x10b0 -// // 0x24 = f0 -// // r3 = 0x10a8 -// // 0x24 = f0 // 0x24 model??? +void zNPCKingJelly::show_shower_model() +{ +} -// } +void zNPCKingJelly::reset_curtain() +{ + // f0 = data shit + // r4 = 0x10b0 + // 0x24 = f0 + // r3 = 0x10a8 + // 0x24 = f0 // 0x24 model??? +} + +S32 zNPCGoalKJIdle::Exit(float dt, void* updCtxt) +{ + zNPCKingJelly& kj = *(zNPCKingJelly*)this->psyche->clt_owner; + kill_sound(6); + kj.flag.stop_moving = 1; + return xGoal::Exit(dt, updCtxt); +} + +S32 zNPCGoalKJBored::Enter(float dt, void* updCtxt) +{ + zNPCKingJelly& kj = *(zNPCKingJelly*)this->psyche->clt_owner; + //play_sound(int, const xVec3*); + play_sound(3, kj.model->anim_coll.verts); // kind of correct + play_sound(3, kj.model->anim_coll.verts); //kind of correct + return zNPCGoalCommon::Enter(dt, updCtxt); +} + +S32 zNPCGoalKJBored::Exit(float dt, void* updCtxt) +{ + return xGoal::Exit(dt, updCtxt); +} + +S32 zNPCGoalKJSpawnKids::Enter(float dt, void* updCtxt) +{ + zNPCKingJelly& kj = *(zNPCKingJelly*)this->psyche->clt_owner; + count_children(kj.round); + return zNPCGoalCommon::Enter(dt, updCtxt); +} // void zNPCKingJelly::start_blink() // { // blink.active = 1; // blink.delay = 0; // blink.count = 0; -// model = 0; -// render = 0; -// this = 0; - // // 0x24 model // // 0x44 render // } diff --git a/src/SB/Game/zNPCTypeKingJelly.h b/src/SB/Game/zNPCTypeKingJelly.h index d8526ecde..8f94658d8 100644 --- a/src/SB/Game/zNPCTypeKingJelly.h +++ b/src/SB/Game/zNPCTypeKingJelly.h @@ -96,7 +96,7 @@ struct zNPCKingJelly : zNPCSubBoss bool fighting; bool died; bool charging; - bool stop_moving; + bool stop_moving; //0x2b8 bool updated; } flag; S32 round; //0x2BC @@ -147,6 +147,7 @@ struct zNPCKingJelly : zNPCSubBoss S32 max_strikes(); void load_model(); void load_curtain_model(); + void show_shower_model(); void reset_curtain(); void start_blink(); void decompose(); @@ -175,6 +176,8 @@ struct zNPCGoalKJIdle : zNPCGoalCommon zNPCGoalKJIdle(S32 goalID) : zNPCGoalCommon(goalID) { } + + S32 Exit(float, void*); }; struct zNPCGoalKJBored : zNPCGoalCommon @@ -182,6 +185,9 @@ struct zNPCGoalKJBored : zNPCGoalCommon zNPCGoalKJBored(S32 goalID) : zNPCGoalCommon(goalID) { } + + S32 Enter(float, void*); + S32 Exit(float, void*); }; struct zNPCGoalKJSpawnKids : zNPCGoalCommon @@ -196,6 +202,8 @@ struct zNPCGoalKJSpawnKids : zNPCGoalCommon zNPCGoalKJSpawnKids(S32 goalID) : zNPCGoalCommon(goalID) { } + S32 Enter(float, void*); + S32 count_children(int); }; struct zNPCGoalKJTaunt : zNPCGoalCommon From 765d15703874be51d336e8f32f0aa10443d30ab6 Mon Sep 17 00:00:00 2001 From: Livewire Date: Sun, 30 Mar 2025 22:22:07 -0400 Subject: [PATCH 40/44] matched a few functions in Kingjelly, cleaned up both kingjelly and prawn a bit. --- src/SB/Game/zNPCTypeKingJelly.cpp | 102 +++++++++++++++++++++++++++--- src/SB/Game/zNPCTypeKingJelly.h | 13 +++- src/SB/Game/zNPCTypePrawn.cpp | 23 ++----- src/SB/Game/zNPCTypePrawn.h | 1 + 4 files changed, 112 insertions(+), 27 deletions(-) diff --git a/src/SB/Game/zNPCTypeKingJelly.cpp b/src/SB/Game/zNPCTypeKingJelly.cpp index 636c7fadf..ee1ad099f 100644 --- a/src/SB/Game/zNPCTypeKingJelly.cpp +++ b/src/SB/Game/zNPCTypeKingJelly.cpp @@ -32,17 +32,41 @@ namespace { - S32 kill_sound(int) + S32 boss_cam() { - return 0; //to do + return 0; //todo } + S32 play_sound(int, const xVec3*) { return 0; //todo } - // void tweak() - // { - // } + + S32 kill_sound(int) + { + return 0; //to do + } + + void kill_sounds() + { + for (S32 i = 0; i < 11; i++) + { + kill_sound(i); + } + } + + void reset_model_color(xModelInstance* submodel) //25% matching. will need rewritten + { + while (submodel != NULL) + { + submodel = submodel->Next; + } + } + + void tweak() + { + } + } // namespace void lightning_ring::create() @@ -54,6 +78,16 @@ void lightning_ring::create() //store 0 into 0x7c } +void lightning_ring::destroy() +{ + for (S32 i = 0; i < arcs_size; i++) + { + zLightningKill(arcs[i]); + } + arcs_size = 0; + active = 0; +} + xAnimTable* ZNPC_AnimTable_KingJelly() { // clang-format off @@ -141,6 +175,13 @@ xAnimTable* ZNPC_AnimTable_KingJelly() return table; } +void zNPCKingJelly::Init(xEntAsset* asset) +{ + zNPCCommon::Init(asset); + memset(&flag.fighting, 0, 5); + this->bossCam.init(); +} + xVec3* zNPCKingJelly::get_bottom() { return (xVec3*)&this->model->Mat->pos; @@ -179,6 +220,15 @@ void zNPCKingJelly::RenderExtra() zNPCKingJelly::render_debug(); } +void zNPCKingJelly::ParseINI() +{ + zNPCCommon::ParseINI(); + cfg_npc->snd_traxShare = &g_sndTrax_KingJelly; + NPCS_SndTablePrepare((NPCSndTrax*)&g_sndTrax_KingJelly); + cfg_npc->snd_trax = &g_sndTrax_KingJelly; + NPCS_SndTablePrepare((NPCSndTrax*)&g_sndTrax_KingJelly); +} + void zNPCKingJelly::SelfSetup() { xBehaveMgr* bmgr; @@ -200,6 +250,11 @@ void zNPCKingJelly::SelfSetup() psy->SetSafety(NPC_GOAL_KJIDLE); } +S32 zNPCKingJelly::max_strikes() const +{ + return round + 1; +} + void zNPCKingJelly::init_child(zNPCKingJelly::child_data& child, zNPCCommon& npc, int wave) { child.npc = &npc; @@ -383,8 +438,8 @@ S32 zNPCGoalKJBored::Enter(float dt, void* updCtxt) { zNPCKingJelly& kj = *(zNPCKingJelly*)this->psyche->clt_owner; //play_sound(int, const xVec3*); - play_sound(3, kj.model->anim_coll.verts); // kind of correct - play_sound(3, kj.model->anim_coll.verts); //kind of correct + play_sound(3, kj.model->anim_coll.verts); // kj.model is correct? dont know the xVec3* + play_sound(3, kj.model->anim_coll.verts); // same as above return zNPCGoalCommon::Enter(dt, updCtxt); } @@ -400,6 +455,31 @@ S32 zNPCGoalKJSpawnKids::Enter(float dt, void* updCtxt) return zNPCGoalCommon::Enter(dt, updCtxt); } +S32 zNPCGoalKJSpawnKids::Exit(float dt, void* updCtxt) +{ + zNPCKingJelly& kj = *(zNPCKingJelly*)this->psyche->clt_owner; + if (spawn_count < child_count) //0x58 child_count + { + kj.generate_spawn_particles(); + kj.spawn_children(kj.round, child_count - spawn_count); + } + return zNPCGoalCommon::Exit(dt, updCtxt); +} + +S32 zNPCGoalKJTaunt::Enter(float dt, void* updCtxt) +{ + zNPCKingJelly& kj = *(zNPCKingJelly*)this->psyche->clt_owner; + //play_sound(int, const xVec3*); + play_sound(9, kj.model->anim_coll.verts); // kj.model is correct? dont know the xVec3* + play_sound(9, kj.model->anim_coll.verts); // same as above + return zNPCGoalCommon::Enter(dt, updCtxt); +} + +S32 zNPCGoalKJTaunt::Exit(float dt, void* updCtxt) +{ + return xGoal::Exit(dt, updCtxt); +} + // void zNPCKingJelly::start_blink() // { // blink.active = 1; @@ -429,8 +509,12 @@ S32 zNPCGoalKJShockGround::Exit(F32 dt, void* updCtxt) S32 zNPCGoalKJDamage::Enter(F32 dt, void* updCtxt) { - // TODO - return 0; + zNPCKingJelly& kj = *(zNPCKingJelly*)this->psyche->clt_owner; + //play_sound(int, const xVec3*); + play_sound(4, kj.model->anim_coll.verts); // kj.model is correct? dont know the xVec3* + play_sound(4, kj.model->anim_coll.verts); // same as above + kj.disable_tentacle_damage = 1; + return zNPCGoalCommon::Enter(dt, updCtxt); } S32 zNPCGoalKJDamage::Exit(F32 dt, void* updCtxt) diff --git a/src/SB/Game/zNPCTypeKingJelly.h b/src/SB/Game/zNPCTypeKingJelly.h index 8f94658d8..6121484f4 100644 --- a/src/SB/Game/zNPCTypeKingJelly.h +++ b/src/SB/Game/zNPCTypeKingJelly.h @@ -8,6 +8,7 @@ #include "containers.h" #include "xBehaviour.h" #include "zNPCTypeAmbient.h" +#include "xCamera.h" struct lightning_ring { @@ -138,12 +139,16 @@ struct zNPCKingJelly : zNPCSubBoss void Setup(); void Destroy(); U32 AnimPick(S32 rawgoal, en_NPC_GOAL_SPOT gspot, xGoal* goal); + void Init(xEntAsset*); void BUpdate(xVec3*); void RenderExtra(); + void ParseINI(); void SelfSetup(); + S32 max_strikes() const; void init_child(zNPCKingJelly::child_data&, zNPCCommon&, int); void disable_child(zNPCKingJelly::child_data&); void enable_child(zNPCKingJelly::child_data& child); + void spawn_children(int, int); S32 max_strikes(); void load_model(); void load_curtain_model(); @@ -167,6 +172,8 @@ struct zNPCKingJelly : zNPCSubBoss void update_round(); void end_charge(); void create_ambient_rings(); + NPCSndTrax g_sndTrax_KingJelly; + xBinaryCamera bossCam; }; struct zNPCGoalKJIdle : zNPCGoalCommon @@ -196,13 +203,14 @@ struct zNPCGoalKJSpawnKids : zNPCGoalCommon S32 cycle; U8 spawned; U8 spewed; - S32 child_count; + S32 child_count; //0x58 S32 spawn_count; zNPCGoalKJSpawnKids(S32 goalID) : zNPCGoalCommon(goalID) { } S32 Enter(float, void*); + S32 Exit(float, void*); S32 count_children(int); }; @@ -211,6 +219,9 @@ struct zNPCGoalKJTaunt : zNPCGoalCommon zNPCGoalKJTaunt(S32 goalID) : zNPCGoalCommon(goalID) { } + + S32 Enter(float, void*); + S32 Exit(float, void*); }; struct zNPCGoalKJShockGround : zNPCGoalCommon diff --git a/src/SB/Game/zNPCTypePrawn.cpp b/src/SB/Game/zNPCTypePrawn.cpp index 80c053efa..6d565cb18 100644 --- a/src/SB/Game/zNPCTypePrawn.cpp +++ b/src/SB/Game/zNPCTypePrawn.cpp @@ -233,34 +233,23 @@ void tweak_group::register_tweaks(bool init, xModelAssetParam* ap, U32 apsize) void aqua_beam::reset() // I don't know whats wrong here. Probably a simple error { firing = 0; - bool bvar; + bool tempBvar; while (true) { - bvar = ring.queue.empty(); - if (bvar) - break; aqua_beam::kill_ring(); + tempBvar = ring.queue.empty(); + if (tempBvar) + break; } ring_sounds = 0; - - // Ghidra output - // bool bVar1; - // *(undefined *)(param_1 + 0x3c) = 0; - // while( true ) { - // bVar1 = empty__42fixed_queue<>CFv((int *)(param_1 + 0xa4)); - // if (bVar1) break; - // kill_ring__9aqua_beamFv(param_1); - // } - // *(undefined4 *)(param_1 + 0xf54) = 0; - // return; } void aqua_beam::start() //100% code match, data does not match { firing = 1; - time = 0; - ring.emit_time = 0; + time = 0.0; + ring.emit_time = -1000000000.0; } void aqua_beam::stop() diff --git a/src/SB/Game/zNPCTypePrawn.h b/src/SB/Game/zNPCTypePrawn.h index 290e2e82b..49d35a3c1 100644 --- a/src/SB/Game/zNPCTypePrawn.h +++ b/src/SB/Game/zNPCTypePrawn.h @@ -175,6 +175,7 @@ struct aqua_beam F32 alpha; F32 scale; } squiggle; + S32 ring_sounds; //0xf54 void reset(); void start(); From 332eeb5b03916486f3761a78348a6cb979ec11d3 Mon Sep 17 00:00:00 2001 From: Livewire Date: Sun, 30 Mar 2025 22:39:04 -0400 Subject: [PATCH 41/44] float fix --- src/SB/Game/zNPCTypePrawn.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SB/Game/zNPCTypePrawn.cpp b/src/SB/Game/zNPCTypePrawn.cpp index 6d565cb18..96009a893 100644 --- a/src/SB/Game/zNPCTypePrawn.cpp +++ b/src/SB/Game/zNPCTypePrawn.cpp @@ -248,8 +248,8 @@ void aqua_beam::reset() // I don't know whats wrong here. Probably a simple erro void aqua_beam::start() //100% code match, data does not match { firing = 1; - time = 0.0; - ring.emit_time = -1000000000.0; + time = 0.0f; + ring.emit_time = -1000000000.0f; } void aqua_beam::stop() From 4e43241a27a32501d13c81908987f463304435be Mon Sep 17 00:00:00 2001 From: Livewire Date: Mon, 31 Mar 2025 20:48:35 -0400 Subject: [PATCH 42/44] Prawn and Dutchman functions --- src/SB/Game/zNPCTypeDutchman.cpp | 143 +++++++++++++++++++++++++++++++ src/SB/Game/zNPCTypeDutchman.h | 25 ++++-- src/SB/Game/zNPCTypePrawn.cpp | 29 +++++-- src/SB/Game/zNPCTypePrawn.h | 5 +- 4 files changed, 189 insertions(+), 13 deletions(-) diff --git a/src/SB/Game/zNPCTypeDutchman.cpp b/src/SB/Game/zNPCTypeDutchman.cpp index 5d296afd3..2bed6e12a 100644 --- a/src/SB/Game/zNPCTypeDutchman.cpp +++ b/src/SB/Game/zNPCTypeDutchman.cpp @@ -121,12 +121,92 @@ void zNPCDutchman::Render() zNPCDutchman::render_debug(); } +void zNPCDutchman::SelfSetup() +{ + xBehaveMgr* bmgr = xBehaveMgr_GetSelf(); + this->psy_instinct = bmgr->Subscribe(this, 0); + xPsyche* psy = this->psy_instinct; + psy->BrainBegin(); + S32 i; + for (i = NPC_GOAL_DUTCHMANNIL; i <= NPC_GOAL_DUTCHMANDEATH; i++) + { + psy->AddGoal(i, this); + } + psy->BrainEnd(); + psy->SetSafety(NPC_GOAL_DUTCHMANIDLE); +} + void zNPCDutchman::Damage(en_NPC_DAMAGE_TYPE, xBase*, const xVec3*) { xPsyche* psy = this->psy_instinct; psy->GIDOfActive(); } +U32 zNPCDutchman::AnimPick(S32 rawgoal, en_NPC_GOAL_SPOT gspot, xGoal* goal) +{ + S32 index = -1; + U32 animId = 0; + + switch (rawgoal) + { + case NPC_GOAL_DUTCHMANNIL: + case NPC_GOAL_DUTCHMANDAMAGE: + case NPC_GOAL_DUTCHMANDEATH: + index = -1; + break; + case NPC_GOAL_DUTCHMANINITIATE: + case NPC_GOAL_DUTCHMANIDLE: + case NPC_GOAL_DUTCHMANDISAPPEAR: + case NPC_GOAL_DUTCHMANTELEPORT: + index = 1; + break; + case NPC_GOAL_DUTCHMANREAPPEAR: + index = 5; + break; + case NPC_GOAL_DUTCHMANBEAM: + index = 0xC; + break; + case NPC_GOAL_DUTCHMANFLAME: + index = 0x10; + break; + case NPC_GOAL_DUTCHMANPOSTFLAME: + if (flag.hurting != false) + { + index = 4; + } + else + { + index = 6; + } + break; + case NPC_GOAL_DUTCHMANCAUGHT: + index = 0x13; + break; + + default: + index = 1; + break; + } + + if (index > -1) + { + animId = g_hash_subbanim[index]; + } + + return animId; +} + +void zNPCDutchman::LassoNotify(en_LASSO_EVENT event) +{ + if ((event != 3) && (event < 3) && (event > 1)) + { + // xPsyche::GoalSet(NPC_GOAL_DUTCHMANCAUGHT, 1); + } + + zNPCCommon::LassoNotify(event); +} +//NPC_GOAL_DUTCHMANCAUGHT + // double zNPCDutchman::goal_delay() // { // move_info* tempR4; @@ -140,6 +220,25 @@ S32 zNPCDutchman::LassoSetup() return zNPCCommon::LassoSetup(); } +void zNPCDutchman::update_round() +{ + S32 roundCntr = round; + if (life == 0) + { + round = 3; + } + else + { + round = 2 - ((life + -1) * 3) / 3; + } + if (round == roundCntr) + { + return; + } + + stage = -1; +} + void zNPCDutchman::render_debug() { } @@ -164,11 +263,28 @@ void zNPCDutchman::stop_eye_glow() flag.eye_glow = false; } +void zNPCDutchman::start_hand_trail() +{ + flag.hand_trail = true; + for (S32 i = 0; i < 2; i++) + { + get_hand_loc(i); + hand_trail.loc[i] = hand_trail.loc[i]; + } + + // hand_trail.loc[0] // 0x5cc +} + void zNPCDutchman::stop_hand_trail() { flag.hand_trail = false; } +void zNPCDutchman::reset_lasso_anim() +{ + xAnimPlaySetState(0, lassdata->holdGuideAnim, 0); +} + void zNPCDutchman::add_splash(const xVec3&, float) { } @@ -252,6 +368,23 @@ S32 zNPCGoalDutchmanIdle::Exit(F32 dt, void* updCtxt) return xGoal::Exit(dt, updCtxt); } +S32 zNPCGoalDutchmanIdle::Process(en_trantype* trantype, float dt, void* updCtxt, xScene* xscn) +{ + owner.goal_delay(); + if (owner.delay < owner.delay) + { + xGoal::Process(trantype, dt, updCtxt, xscn); + } + else + { + trantype = 0; + owner.next_goal(); + } + return 0; + + //return xGoal::Process(trantype, dt, updCtxt, xscn); +} + S32 zNPCGoalDutchmanDisappear::Exit(F32 dt, void* updCtxt) { return xGoal::Exit(dt, updCtxt); @@ -278,6 +411,16 @@ S32 zNPCGoalDutchmanBeam::Exit(F32 dt, void* updCtxt) return xGoal::Exit(dt, updCtxt); } +S32 zNPCGoalDutchmanFlame::Enter(F32 dt, void* updCtxt) +{ + owner.reset_lasso_anim(); + owner.get_orbit(); + owner.turn_to_face(owner.flames.splash_loc); //dont know the correct xVec3& + owner.delay = 0; + owner.collis = 0; + return zNPCGoalCommon::Enter(dt, updCtxt); +} + S32 zNPCGoalDutchmanFlame::Exit(F32 dt, void* updCtxt) { S32 tempR0; diff --git a/src/SB/Game/zNPCTypeDutchman.h b/src/SB/Game/zNPCTypeDutchman.h index 5d5fcffa7..d74ee7308 100644 --- a/src/SB/Game/zNPCTypeDutchman.h +++ b/src/SB/Game/zNPCTypeDutchman.h @@ -6,6 +6,7 @@ #include "containers.h" #include "xBehaviour.h" #include "zNPCTypeCommon.h" +#include "zNPCGoals.h" struct zNPCDutchman : zNPCSubBoss { @@ -82,11 +83,11 @@ struct zNPCDutchman : zNPCSubBoss move_enum move; fade_enum fade; } flag; - S32 life; //0x2B4 - S32 round; //0x2B8 - S32 stage; //0x2BC - F32 delay; //0x2C0 - F32 alpha; //0x2d0 + S32 life; //0x2C4 + S32 round; //0x2C8 + S32 stage; //0x2CC + F32 delay; //0x2d0 + F32 alpha; //0x2d4 struct { xVec2 dir; //0x2d4 @@ -142,24 +143,34 @@ struct zNPCDutchman : zNPCSubBoss void Setup(); void Destroy(); void Render(); + void SelfSetup(); void render_debug(); void update_animation(float); void kill_wave(zNPCDutchman::wave_data&); void add_splash(const xVec3&, float); void vanish(); void reappear(); + void turn_to_face(const xVec3&); void face_player(); void start_beam(); void stop_beam(); void start_flames(); void stop_flames(); + void get_hand_loc(S32) const; + void start_hand_trail(); void stop_hand_trail(); void reset_lasso_anim(); void reset_speed(); void Damage(en_NPC_DAMAGE_TYPE, xBase*, const xVec3*); + U32 AnimPick(S32 rawgoal, en_NPC_GOAL_SPOT gspot, xGoal* goal); + void LassoNotify(en_LASSO_EVENT); S32 LassoSetup(); + void update_round(); + void next_goal(); + void goal_delay(); void start_eye_glow(); void stop_eye_glow(); + void get_orbit() const; //Weak U8 PhysicsFlags() const; U8 ColPenByFlags() const; U8 ColChkByFlags() const; @@ -185,6 +196,7 @@ struct zNPCGoalDutchmanIdle : zNPCGoalCommon zNPCDutchman& owner; S32 Enter(float, void*); S32 Exit(float, void*); + S32 Process(en_trantype*, float, void*, xScene*); static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); }; @@ -260,6 +272,7 @@ struct zNPCGoalDutchmanFlame : zNPCGoalCommon xVec2 move_dir; U8 stopped; zNPCDutchman& owner; + S32 Enter(float, void*); S32 Exit(float, void*); static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); @@ -287,7 +300,7 @@ struct zNPCGoalDutchmanDamage : zNPCGoalCommon zNPCDutchman& owner; static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); - S32 Exit(F32 dt, void* updCtxt); + S32 Exit(F32 dt, void* updCtxt); }; struct delay_goal diff --git a/src/SB/Game/zNPCTypePrawn.cpp b/src/SB/Game/zNPCTypePrawn.cpp index 96009a893..0c1643e6a 100644 --- a/src/SB/Game/zNPCTypePrawn.cpp +++ b/src/SB/Game/zNPCTypePrawn.cpp @@ -398,6 +398,20 @@ void zNPCGoalPrawnBeam::update_aim(float dt) //Needs clrlwi and cntlzw to be fin prawn.turning(); } +S32 zNPCGoalPrawnIdle::Enter(float dt, void* updCtxt) +{ + zNPCPrawn& prawn = *((zNPCPrawn*)this->psyche->clt_owner); + prawn.face_player = 1; + prawn.delay = 0; + prawn.set_floor_state(prawn.FS_DANGER, false, false); + return zNPCGoalCommon::Enter(dt, updCtxt); +} + +S32 zNPCGoalPrawnIdle::Exit(float dt, void* updCtxt) +{ + return xGoal::Exit(dt, updCtxt); +} + S32 zNPCGoalPrawnDamage::Enter(float dt, void* updCtxt) { zNPCPrawn& prawn = *(zNPCPrawn*)psyche->clt_owner; @@ -405,12 +419,15 @@ S32 zNPCGoalPrawnDamage::Enter(float dt, void* updCtxt) return zNPCGoalCommon::Enter(dt, updCtxt); } -// S32 zNPCGoalPrawnBowl::Enter(float dt, void* updCtxt) -// { -// zNPCPrawn& prawn = *(zNPCPrawn*)psyche->clt_owner; -// prawn.set_floor_state(prawn.FS_DANGER, false, false); -// zNPCGoalCommon::Enter(dt, updCtxt); -// } +S32 zNPCGoalPrawnBowl::Enter(float dt, void* updCtxt) +{ + zNPCPrawn& prawn = *((zNPCPrawn*)this->psyche->clt_owner); + prawn.face_player = 1; + prawn.set_floor_state(prawn.FS_AIM_LANE, false, false); + prawn.delay = 0; + aiming = 1; + return zNPCGoalCommon::Enter(dt, updCtxt); +} S32 zNPCGoalPrawnBowl::Exit(float dt, void* updCtxt) { diff --git a/src/SB/Game/zNPCTypePrawn.h b/src/SB/Game/zNPCTypePrawn.h index 49d35a3c1..e15e8cb61 100644 --- a/src/SB/Game/zNPCTypePrawn.h +++ b/src/SB/Game/zNPCTypePrawn.h @@ -216,7 +216,7 @@ struct zNPCPrawn : zNPCSubBoss S32 floor_state_index; //0x2e4 U32 floor_state_counter; F32 floor_time; - F32 delay; + F32 delay; //0x2f0 U8 first_update; U8 fighting; struct @@ -271,6 +271,9 @@ struct zNPCGoalPrawnIdle : zNPCGoalCommon zNPCGoalPrawnIdle(S32 goalID) : zNPCGoalCommon(goalID) { } + + S32 Enter(float, void*); + S32 Exit(float, void*); }; struct zNPCGoalPrawnBeam : zNPCGoalCommon From 0ca456156456b2eeb2d9e919fb72cdb35879d7a5 Mon Sep 17 00:00:00 2001 From: Colin Miller Date: Fri, 9 May 2025 10:21:26 -0400 Subject: [PATCH 43/44] re-organized BossPlankton. Added all create functions and a few others. --- src/SB/Game/zNPCTypeBossPlankton.cpp | 157 +++++++++++++++++++++++---- src/SB/Game/zNPCTypeBossPlankton.h | 66 +++++++++++ src/SB/Game/zNPCTypeDutchman.cpp | 15 +-- 3 files changed, 202 insertions(+), 36 deletions(-) diff --git a/src/SB/Game/zNPCTypeBossPlankton.cpp b/src/SB/Game/zNPCTypeBossPlankton.cpp index 65d30295a..592cb35bc 100644 --- a/src/SB/Game/zNPCTypeBossPlankton.cpp +++ b/src/SB/Game/zNPCTypeBossPlankton.cpp @@ -376,29 +376,77 @@ U8 zNPCBPlankton::ColChkByFlags() const return 16; } -S32 zNPCGoalBPlanktonBomb::Process(en_trantype*, F32, void*, xScene*) +xFactoryInst* zNPCGoalBPlanktonIdle::create(S32 who, RyzMemGrow* grow, void* info) { - return 0; + return new (who, grow) zNPCGoalBPlanktonIdle(who, (zNPCBPlankton&)*info); } -S32 zNPCGoalBPlanktonMissle::Process(en_trantype*, F32, void*, xScene*) +xFactoryInst* zNPCGoalBPlanktonAttack::create(S32 who, RyzMemGrow* grow, void* info) { - return 0; + return new (who, grow) zNPCGoalBPlanktonAttack(who, (zNPCBPlankton&)*info); } -S32 zNPCGoalBPlanktonWall::Process(en_trantype*, F32, void*, xScene*) +xFactoryInst* zNPCGoalBPlanktonAmbush::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBPlanktonAmbush(who, (zNPCBPlankton&)*info); +} + +xFactoryInst* zNPCGoalBPlanktonFlank::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBPlanktonFlank(who, (zNPCBPlankton&)*info); +} + +xFactoryInst* zNPCGoalBPlanktonEvade::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBPlanktonEvade(who, (zNPCBPlankton&)*info); +} + +xFactoryInst* zNPCGoalBPlanktonHunt::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBPlanktonHunt(who, (zNPCBPlankton&)*info); +} + +S32 zNPCGoalBPlanktonHunt::Enter(float dt, void* updCtxt) +{ + owner.reappear(); + get_player_loc(); + owner.flag.attacking = true; + owner.delay = 0.0f; + owner.reset_speed(); + owner.refresh_orbit(); + owner.follow_camera(); + return zNPCGoalCommon::Enter(dt, updCtxt); +} + +S32 zNPCGoalBPlanktonHunt::Exit(float dt, void* updCtxt) +{ + owner.refresh_orbit(); + return xGoal::Exit(dt, updCtxt); +} + +xFactoryInst* zNPCGoalBPlanktonTaunt::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBPlanktonTaunt(who, (zNPCBPlankton&)*info); +} + +S32 zNPCGoalBPlanktonTaunt::Process(en_trantype*, F32, void*, xScene*) { return 0; } +xFactoryInst* zNPCGoalBPlanktonMove::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBPlanktonMove(who, (zNPCBPlankton&)*info); +} + S32 zNPCGoalBPlanktonMove::Process(en_trantype*, F32, void*, xScene*) { return 0; } -xFactoryInst* zNPCGoalBPlanktonBomb::create(S32 who, RyzMemGrow* grow, void* info) +xFactoryInst* zNPCGoalBPlanktonStun::create(S32 who, RyzMemGrow* grow, void* info) { - return 0; // To-Do + return new (who, grow) zNPCGoalBPlanktonStun(who, (zNPCBPlankton&)*info); } S32 zNPCGoalBPlanktonStun::Enter(float dt, void* updCtxt) @@ -416,6 +464,16 @@ S32 zNPCGoalBPlanktonStun::Exit(float dt, void* updCtxt) return xGoal::Exit(dt, updCtxt); } +xFactoryInst* zNPCGoalBPlanktonFall::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBPlanktonFall(who, (zNPCBPlankton&)*info); +} + +xFactoryInst* zNPCGoalBPlanktonDizzy::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBPlanktonDizzy(who, (zNPCBPlankton&)*info); +} + S32 zNPCGoalBPlanktonDizzy::Enter(float dt, void* updCtxt) { owner.give_control(); @@ -424,6 +482,11 @@ S32 zNPCGoalBPlanktonDizzy::Enter(float dt, void* updCtxt) return zNPCGoalCommon::Enter(dt, updCtxt); } +xFactoryInst* zNPCGoalBPlanktonBeam::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBPlanktonBeam(who, (zNPCBPlankton&)*info); +} + S32 zNPCGoalBPlanktonBeam::Enter(float dt, void* updCtxt) { xParEmitter parE; @@ -437,27 +500,77 @@ S32 zNPCGoalBPlanktonBeam::Enter(float dt, void* updCtxt) return zNPCGoalCommon::Enter(dt, updCtxt); } -S32 zNPCGoalBPlanktonBomb::Enter(float dt, void* updCtxt) +S32 zNPCGoalBPlanktonBeam::Exit(float dt, void* updCtxt) { - return zNPCGoalCommon::Enter(dt, updCtxt); + xParEmitter parE; + xParEmitter& pEmit = parE; // this is one of the codes of all time + owner.flag.aim_gun = false; + owner.flag.follow = owner.FOLLOW_NONE; + owner.disable_emitter(pEmit); + return xGoal::Exit(dt, updCtxt); } -S32 zNPCGoalBPlanktonHunt::Enter(float dt, void* updCtxt) +S32 zNPCGoalBPlanktonBeam::Process(en_trantype* trantype, F32 dt, void* unk, + xScene* xscn) // void* should be someting else. +// cross reference other files for the answer + +// Im probably just dumb, but i dont get how this should be written. { - owner.reappear(); - get_player_loc(); - owner.flag.attacking = true; - owner.delay = 0.0f; - owner.reset_speed(); - owner.refresh_orbit(); - owner.follow_camera(); - return zNPCGoalCommon::Enter(dt, updCtxt); + S32 tempProcess; + tempProcess = emitted; + if (tempProcess != 2) + { + zNPCGoalBPlanktonBeam::update_warm_up(dt); + } + else if (tempProcess < 2) + { + if (tempProcess == 0) + { + zNPCGoalBPlanktonBeam::update_fire(dt); + } + else + { + zNPCGoalBPlanktonBeam::update_cool_down(dt); + } + } + else if (tempProcess < 4) + { + unk = 0; + tempProcess = owner.next_goal(); + return tempProcess; + } + + return 0; } -S32 zNPCGoalBPlanktonHunt::Exit(float dt, void* updCtxt) +xFactoryInst* zNPCGoalBPlanktonWall::create(S32 who, RyzMemGrow* grow, void* info) { - owner.refresh_orbit(); - return xGoal::Exit(dt, updCtxt); + return new (who, grow) zNPCGoalBPlanktonWall(who, (zNPCBPlankton&)*info); +} + +S32 zNPCGoalBPlanktonWall::Process(en_trantype*, F32, void*, xScene*) +{ + return 0; +} + +xFactoryInst* zNPCGoalBPlanktonMissle::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBPlanktonMissle(who, (zNPCBPlankton&)*info); +} + +S32 zNPCGoalBPlanktonMissle::Process(en_trantype*, F32, void*, xScene*) +{ + return 0; +} + +xFactoryInst* zNPCGoalBPlanktonBomb::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBPlanktonBomb(who, (zNPCBPlankton&)*info); +} + +S32 zNPCGoalBPlanktonBomb::Enter(float dt, void* updCtxt) +{ + return zNPCGoalCommon::Enter(dt, updCtxt); } S32 zNPCGoalBPlanktonBomb::Exit(float dt, void* updCtxt) @@ -465,7 +578,7 @@ S32 zNPCGoalBPlanktonBomb::Exit(float dt, void* updCtxt) return xGoal::Exit(dt, updCtxt); } -S32 zNPCGoalBPlanktonTaunt::Process(en_trantype*, F32, void*, xScene*) +S32 zNPCGoalBPlanktonBomb::Process(en_trantype*, F32, void*, xScene*) { return 0; } diff --git a/src/SB/Game/zNPCTypeBossPlankton.h b/src/SB/Game/zNPCTypeBossPlankton.h index be7ec5e9a..61d4aa9d5 100644 --- a/src/SB/Game/zNPCTypeBossPlankton.h +++ b/src/SB/Game/zNPCTypeBossPlankton.h @@ -142,12 +142,17 @@ struct zNPCBPlankton : zNPCBoss // Not yet organized void enable_emitter(xParEmitter&) const; + void disable_emitter(xParEmitter&) const; }; struct zNPCGoalBPlanktonIdle : zNPCGoalCommon { zNPCBPlankton& owner; + zNPCGoalBPlanktonIdle(S32 goalID, zNPCBPlankton& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); }; @@ -155,6 +160,10 @@ struct zNPCGoalBPlanktonAttack : zNPCGoalCommon { zNPCBPlankton& owner; + zNPCGoalBPlanktonAttack(S32 goalID, zNPCBPlankton& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); }; @@ -162,6 +171,10 @@ struct zNPCGoalBPlanktonAmbush : zNPCGoalCommon { zNPCBPlankton& owner; + zNPCGoalBPlanktonAmbush(S32 goalID, zNPCBPlankton& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); }; @@ -170,6 +183,10 @@ struct zNPCGoalBPlanktonFlank : zNPCGoalCommon F32 accel; zNPCBPlankton& owner; + zNPCGoalBPlanktonFlank(S32 goalID, zNPCBPlankton& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); }; @@ -178,6 +195,10 @@ struct zNPCGoalBPlanktonEvade : zNPCGoalCommon F32 evade_delay; zNPCBPlankton& owner; + zNPCGoalBPlanktonEvade(S32 goalID, zNPCBPlankton& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); }; @@ -186,6 +207,10 @@ struct zNPCGoalBPlanktonHunt : zNPCGoalCommon xVec3 player_loc; zNPCBPlankton& owner; + zNPCGoalBPlanktonHunt(S32 goalID, zNPCBPlankton& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); S32 Enter(float, void*); @@ -196,6 +221,10 @@ struct zNPCGoalBPlanktonTaunt : zNPCGoalCommon { zNPCBPlankton& owner; + zNPCGoalBPlanktonTaunt(S32 goalID, zNPCBPlankton& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); S32 Process(en_trantype*, float, void*, xScene*); }; @@ -204,6 +233,10 @@ struct zNPCGoalBPlanktonMove : zNPCGoalCommon { zNPCBPlankton& owner; + zNPCGoalBPlanktonMove(S32 goalID, zNPCBPlankton& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); S32 Process(en_trantype*, float, void*, xScene*); }; @@ -212,6 +245,10 @@ struct zNPCGoalBPlanktonStun : zNPCGoalCommon { zNPCBPlankton& owner; + zNPCGoalBPlanktonStun(S32 goalID, zNPCBPlankton& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); S32 Enter(float, void*); S32 Exit(float, void*); @@ -222,6 +259,10 @@ struct zNPCGoalBPlanktonFall : zNPCGoalCommon { zNPCBPlankton& owner; + zNPCGoalBPlanktonFall(S32 goalID, zNPCBPlankton& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); }; @@ -229,6 +270,10 @@ struct zNPCGoalBPlanktonDizzy : zNPCGoalCommon { zNPCBPlankton& owner; + zNPCGoalBPlanktonDizzy(S32 goalID, zNPCBPlankton& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); S32 Enter(float, void*); S32 Exit(float, void*); @@ -248,14 +293,27 @@ struct zNPCGoalBPlanktonBeam : zNPCGoalCommon substate_enum substate; zNPCBPlankton& owner; + zNPCGoalBPlanktonBeam(S32 goalID, zNPCBPlankton& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); S32 Enter(float, void*); + S32 Exit(float, void*); + S32 Process(en_trantype*, float, void*, xScene*); + S32 update_cool_down(float); + S32 update_warm_up(float); + S32 update_fire(float); }; struct zNPCGoalBPlanktonWall : zNPCGoalCommon { zNPCBPlankton& owner; + zNPCGoalBPlanktonWall(S32 goalID, zNPCBPlankton& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); S32 Process(en_trantype*, float, void*, xScene*); }; @@ -264,6 +322,10 @@ struct zNPCGoalBPlanktonMissle : zNPCGoalCommon { zNPCBPlankton& owner; + zNPCGoalBPlanktonMissle(S32 goalID, zNPCBPlankton& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); S32 Process(en_trantype*, float, void*, xScene*); }; @@ -272,6 +334,10 @@ struct zNPCGoalBPlanktonBomb : zNPCGoalCommon { zNPCBPlankton& owner; + zNPCGoalBPlanktonBomb(S32 goalID, zNPCBPlankton& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); S32 Enter(float, void*); S32 Exit(float, void*); diff --git a/src/SB/Game/zNPCTypeDutchman.cpp b/src/SB/Game/zNPCTypeDutchman.cpp index 36b5563c0..4aa5d3e23 100644 --- a/src/SB/Game/zNPCTypeDutchman.cpp +++ b/src/SB/Game/zNPCTypeDutchman.cpp @@ -388,20 +388,7 @@ S32 zNPCGoalDutchmanIdle::Process(en_trantype* trantype, float dt, void* updCtxt xFactoryInst* zNPCGoalDutchmanDisappear::create(S32 who, RyzMemGrow* grow, void* info) { - zNPCGoalDutchmanDisappear* tempVar; - tempVar = new (who, grow) zNPCGoalDutchmanDisappear(who, (zNPCDutchman&)*info); - // tempVar = new (who, grow) RyzMemGrow(grow); - if (tempVar != NULL) - { - //tempVar = zNPCGoalDutchmanDisappear(0, (zNPCDutchman&)*info); - // tempVar = new (who, grow) zNPCGoalDutchmanDisappear(who, (zNPCDutchman&)*info); - - //goal = new (who, growCtxt) xGoalEmpty(who); - } - // if () - // { - // } - return 0; + return new (who, grow) zNPCGoalDutchmanDisappear(who, (zNPCDutchman&)*info); } S32 zNPCGoalDutchmanDisappear::Exit(F32 dt, void* updCtxt) From 99b68827fb5973aee57642cde00014e506c97006 Mon Sep 17 00:00:00 2001 From: Colin Miller Date: Fri, 9 May 2025 10:34:00 -0400 Subject: [PATCH 44/44] pr comment retry --- src/SB/Game/zNPCTypeBossPlankton.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SB/Game/zNPCTypeBossPlankton.cpp b/src/SB/Game/zNPCTypeBossPlankton.cpp index 592cb35bc..d4b8aa740 100644 --- a/src/SB/Game/zNPCTypeBossPlankton.cpp +++ b/src/SB/Game/zNPCTypeBossPlankton.cpp @@ -2,6 +2,8 @@ #include +// pr comment retry + #define f1585 1.0f #define f1586 0.0f #define f1657 0.2f