From 2dd064475a6e3cb03b94680e3bdfc34d5a047520 Mon Sep 17 00:00:00 2001 From: Louis Stockdale-Lees Date: Fri, 3 Oct 2025 20:07:06 +0100 Subject: [PATCH 1/5] SB2Chop::Enter --- src/SB/Game/zNPCTypeBossSB2.cpp | 25 +++++++++++++++++++++++++ src/SB/Game/zNPCTypeBossSB2.h | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/SB/Game/zNPCTypeBossSB2.cpp b/src/SB/Game/zNPCTypeBossSB2.cpp index 68e88d2be..4beb6476a 100644 --- a/src/SB/Game/zNPCTypeBossSB2.cpp +++ b/src/SB/Game/zNPCTypeBossSB2.cpp @@ -1368,6 +1368,31 @@ S32 zNPCGoalBossSB2Swipe::can_start() const return tempStart != 0; } +S32 zNPCGoalBossSB2Chop::Enter(F32 dt, void* updCtxt) +{ + targetted = 0; + started = 0; + owner.flag.face_player = true; + + owner.choose_hand(); + owner.activate_hand(owner.active_hand, true); + + if (owner.active_hand == 0) + { + begin_anim = g_hash_bossanim[50]; + loop_anim = g_hash_bossanim[51]; + end_anim = g_hash_bossanim[52]; + } + else + { + begin_anim = g_hash_bossanim[53]; + loop_anim = g_hash_bossanim[54]; + end_anim = g_hash_bossanim[55]; + } + + return zNPCGoalCommon::Enter(dt, updCtxt); +} + S32 zNPCGoalBossSB2Chop::Exit(float dt, void* updCtxt) { owner.deactivate_hand(owner.active_hand); diff --git a/src/SB/Game/zNPCTypeBossSB2.h b/src/SB/Game/zNPCTypeBossSB2.h index 6a2047585..446d90442 100644 --- a/src/SB/Game/zNPCTypeBossSB2.h +++ b/src/SB/Game/zNPCTypeBossSB2.h @@ -157,7 +157,7 @@ struct zNPCB_SB2 : zNPCBoss struct { - bool face_player; + bool face_player; //0x2b4 bool face_follow; bool dizzy; //0x2b6 move_enum move; @@ -324,6 +324,7 @@ struct zNPCGoalBossSB2Chop : zNPCGoalCommon zNPCB_SB2& owner; static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); + S32 Enter(F32 dt, void*); S32 Exit(float, void*); }; From f59cdd094132a05720f8557dda0d83042a3851f3 Mon Sep 17 00:00:00 2001 From: Louis Stockdale-Lees Date: Mon, 6 Oct 2025 01:08:04 +0100 Subject: [PATCH 2/5] Replaced float with F32 --- src/SB/Game/zNPCTypeBossSB2.cpp | 38 ++++++++++++++-------------- src/SB/Game/zNPCTypeBossSB2.h | 44 ++++++++++++++++++--------------- 2 files changed, 43 insertions(+), 39 deletions(-) diff --git a/src/SB/Game/zNPCTypeBossSB2.cpp b/src/SB/Game/zNPCTypeBossSB2.cpp index 4beb6476a..ec255020f 100644 --- a/src/SB/Game/zNPCTypeBossSB2.cpp +++ b/src/SB/Game/zNPCTypeBossSB2.cpp @@ -96,13 +96,13 @@ namespace model->PipeFlags |= 0x6508; } - F32 max(float maxFloat1, float maxFloat2) //Temp names till file is further + F32 max(F32 maxF321, F32 maxF322) //Temp names till file is further { - if (maxFloat1 > maxFloat2) + if (maxF321 > maxF322) { - return maxFloat1; + return maxF321; } - return maxFloat2; + return maxF322; } S32 tweak() @@ -118,7 +118,7 @@ namespace } } - S32 play_sound(int, const xVec3*, float) + S32 play_sound(int, const xVec3*, F32) { return 0; // to-do } @@ -1130,7 +1130,7 @@ void zNPCB_SB2::Destroy() zNPCCommon::Destroy(); } -void zNPCB_SB2::NewTime(xScene* x, float y) +void zNPCB_SB2::NewTime(xScene* x, F32 y) { } @@ -1246,7 +1246,7 @@ void zNPCB_SB2::destroy_glow_light() xLightKit_Destroy(&glow_light.kit); } -S32 zNPCGoalBossSB2Intro::Enter(float dt, void* updCtxt) +S32 zNPCGoalBossSB2Intro::Enter(F32 dt, void* updCtxt) { if (owner.said_intro == 0) { @@ -1259,36 +1259,36 @@ S32 zNPCGoalBossSB2Intro::Enter(float dt, void* updCtxt) } -S32 zNPCGoalBossSB2Intro::Exit(float dt, void* updCtxt) +S32 zNPCGoalBossSB2Intro::Exit(F32 dt, void* updCtxt) { zEntPlayerControlOn(CONTROL_OWNER_BOSS); return xGoal::Exit(dt, updCtxt); } -S32 zNPCGoalBossSB2Idle::Enter(float dt, void* updCtxt) +S32 zNPCGoalBossSB2Idle::Enter(F32 dt, void* updCtxt) { transitioning = 1; return zNPCGoalCommon::Enter(dt, updCtxt); } -S32 zNPCGoalBossSB2Idle::Exit(float dt, void* updCtxt) +S32 zNPCGoalBossSB2Idle::Exit(F32 dt, void* updCtxt) { return xGoal::Exit(dt, updCtxt); } -S32 zNPCGoalBossSB2Taunt::Enter(float dt, void* updCtxt) +S32 zNPCGoalBossSB2Taunt::Enter(F32 dt, void* updCtxt) { play_sound(0, &owner.sound_loc.mouth , 1.0f); owner.flag.face_player = 1; return zNPCGoalCommon::Enter(dt, updCtxt); } -S32 zNPCGoalBossSB2Taunt::Exit(float dt, void* updCtxt) +S32 zNPCGoalBossSB2Taunt::Exit(F32 dt, void* updCtxt) { return xGoal::Exit(dt, updCtxt); } -S32 zNPCGoalBossSB2Dizzy::Enter(float dt, void* updCtxt) +S32 zNPCGoalBossSB2Dizzy::Enter(F32 dt, void* updCtxt) { sicked = 0; owner.flag.face_player = 0; @@ -1297,7 +1297,7 @@ S32 zNPCGoalBossSB2Dizzy::Enter(float dt, void* updCtxt) return zNPCGoalCommon::Enter(dt, updCtxt); } -S32 zNPCGoalBossSB2Dizzy::Exit(float dt, void* updCtxt) +S32 zNPCGoalBossSB2Dizzy::Exit(F32 dt, void* updCtxt) { S32 tempDizzy; owner.set_vulnerable(true); @@ -1316,7 +1316,7 @@ S32 zNPCGoalBossSB2Dizzy::Exit(float dt, void* updCtxt) return xGoal::Exit(dt, updCtxt); } -S32 zNPCGoalBossSB2Hit::Enter(float dt, void* updCtxt) +S32 zNPCGoalBossSB2Hit::Enter(F32 dt, void* updCtxt) { // Function needs set up differently // im just dumb @@ -1348,7 +1348,7 @@ S32 zNPCGoalBossSB2Hit::Enter(float dt, void* updCtxt) return zNPCGoalCommon::Enter(dt, updCtxt); } -S32 zNPCGoalBossSB2Hit::Exit(float dt, void* updCtxt) +S32 zNPCGoalBossSB2Hit::Exit(F32 dt, void* updCtxt) { owner.set_vulnerable(true); return xGoal::Exit(dt, updCtxt); @@ -1393,7 +1393,7 @@ S32 zNPCGoalBossSB2Chop::Enter(F32 dt, void* updCtxt) return zNPCGoalCommon::Enter(dt, updCtxt); } -S32 zNPCGoalBossSB2Chop::Exit(float dt, void* updCtxt) +S32 zNPCGoalBossSB2Chop::Exit(F32 dt, void* updCtxt) { owner.deactivate_hand(owner.active_hand); return xGoal::Exit(dt, updCtxt); @@ -1412,13 +1412,13 @@ S32 zNPCGoalBossSB2Karate::can_start() const return tempStart != 0; } -S32 zNPCGoalBossSB2Death::Enter(float dt, void* updCtxt) +S32 zNPCGoalBossSB2Death::Enter(F32 dt, void* updCtxt) { owner.decompose(); return zNPCGoalCommon::Enter(dt, updCtxt); } -S32 zNPCGoalBossSB2Death::Exit(float dt, void* updCtxt) +S32 zNPCGoalBossSB2Death::Exit(F32 dt, void* updCtxt) { return xGoal::Exit(dt, updCtxt); } diff --git a/src/SB/Game/zNPCTypeBossSB2.h b/src/SB/Game/zNPCTypeBossSB2.h index 446d90442..98daff2aa 100644 --- a/src/SB/Game/zNPCTypeBossSB2.h +++ b/src/SB/Game/zNPCTypeBossSB2.h @@ -216,17 +216,18 @@ struct zNPCB_SB2 : zNPCBoss zNPCB_SB2(S32 myType); void SelfSetup(); void Destroy(); - void NewTime(xScene*, float); + void NewTime(xScene*, F32); void move_nodes(); - void move_hand(zNPCB_SB2::hand_data&, float); + void move_hand(zNPCB_SB2::hand_data&, F32); void update_bounds(); - void update_platforms(float); - void update_slugs(float); + void update_platforms(F32); + void update_slugs(F32); void render_debug(); void decompose(); void show_nodes(); void ouchie(); void destroy_glow_light(); + void say(U32); void Render(); F32 AttackTimeLeft(); void HoldUpDude(); @@ -242,6 +243,7 @@ struct zNPCB_SB2 : zNPCBoss void set_vulnerable(bool); void say(int); void choose_hand(); + U32 facing() const; }; struct zNPCGoalBossSB2Intro : zNPCGoalCommon @@ -249,8 +251,8 @@ struct zNPCGoalBossSB2Intro : zNPCGoalCommon zNPCB_SB2& owner; static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); - S32 Enter(float, void*); - S32 Exit(float, void*); + S32 Enter(F32, void*); + S32 Exit(F32, void*); }; struct zNPCGoalBossSB2Idle : zNPCGoalCommon @@ -259,8 +261,8 @@ struct zNPCGoalBossSB2Idle : zNPCGoalCommon zNPCB_SB2& owner; static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); - S32 Enter(float, void*); - S32 Exit(float, void*); + S32 Enter(F32, void*); + S32 Exit(F32, void*); }; struct zNPCGoalBossSB2Taunt : zNPCGoalCommon @@ -268,8 +270,8 @@ struct zNPCGoalBossSB2Taunt : zNPCGoalCommon zNPCB_SB2& owner; static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); - S32 Enter(float, void*); - S32 Exit(float, void*); + S32 Enter(F32, void*); + S32 Exit(F32, void*); }; struct zNPCGoalBossSB2Dizzy : zNPCGoalCommon @@ -278,8 +280,8 @@ struct zNPCGoalBossSB2Dizzy : zNPCGoalCommon zNPCB_SB2& owner; static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); - S32 Enter(float, void*); - S32 Exit(float, void*); + S32 Enter(F32, void*); + S32 Exit(F32, void*); }; struct zNPCGoalBossSB2Hit : zNPCGoalCommon @@ -287,8 +289,8 @@ struct zNPCGoalBossSB2Hit : zNPCGoalCommon zNPCB_SB2& owner; static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); - S32 Enter(float, void*); - S32 Exit(float, void*); + S32 Enter(F32, void*); + S32 Exit(F32, void*); }; struct zNPCGoalBossSB2Hunt : zNPCGoalCommon @@ -310,7 +312,8 @@ struct zNPCGoalBossSB2Swipe : zNPCGoalCommon zNPCB_SB2& owner; static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); - S32 Exit(float, void*); + S32 Enter(F32 dt, void* updCtxt); + S32 Exit(F32 dt, void* updCtxt); S32 can_start() const; }; @@ -324,8 +327,8 @@ struct zNPCGoalBossSB2Chop : zNPCGoalCommon zNPCB_SB2& owner; static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); - S32 Enter(F32 dt, void*); - S32 Exit(float, void*); + S32 Enter(F32 dt, void* updCtxt); + S32 Exit(F32 dt, void* updCtxt); }; struct zNPCGoalBossSB2Karate : zNPCGoalCommon @@ -335,7 +338,8 @@ struct zNPCGoalBossSB2Karate : zNPCGoalCommon zNPCB_SB2& owner; static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); - S32 Exit(float, void*); + S32 Enter(F32 dt, void* updCtxt); + S32 Exit(F32, void*); S32 can_start() const; }; @@ -345,8 +349,8 @@ struct zNPCGoalBossSB2Death : zNPCGoalCommon static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); S32 Process(en_trantype*, F32, void*, xScene*); - S32 Enter(float, void*); - S32 Exit(float, void*); + S32 Enter(F32, void*); + S32 Exit(F32, void*); }; xAnimTable* ZNPC_AnimTable_BossSB2(); From 215a1c7968570307b78264f1745a7a76c1df451f Mon Sep 17 00:00:00 2001 From: Louis Stockdale-Lees Date: Mon, 6 Oct 2025 01:08:49 +0100 Subject: [PATCH 3/5] Swipe::Enter --- src/SB/Game/zNPCTypeBossSB2.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/SB/Game/zNPCTypeBossSB2.cpp b/src/SB/Game/zNPCTypeBossSB2.cpp index ec255020f..f138a9fe0 100644 --- a/src/SB/Game/zNPCTypeBossSB2.cpp +++ b/src/SB/Game/zNPCTypeBossSB2.cpp @@ -1354,7 +1354,32 @@ S32 zNPCGoalBossSB2Hit::Exit(F32 dt, void* updCtxt) return xGoal::Exit(dt, updCtxt); } -S32 zNPCGoalBossSB2Swipe::Exit(float dt, void* updCtxt) +S32 zNPCGoalBossSB2Swipe::Enter(F32 dt, void* updCtxt) +{ + owner.flag.face_player = 1; + said = 0; + holding = 0; + started = 0; + + owner.choose_hand(); + + if (owner.active_hand == 0) + { + begin_anim = g_hash_bossanim[56]; + loop_anim = g_hash_bossanim[57]; + end_anim = g_hash_bossanim[58]; + } + else + { + begin_anim = g_hash_bossanim[59]; + loop_anim = g_hash_bossanim[60]; + end_anim = g_hash_bossanim[61]; + } + + return zNPCGoalCommon::Enter(dt, updCtxt); +} + +S32 zNPCGoalBossSB2Swipe::Exit(F32 dt, void* updCtxt) { owner.flag.face_player = true; owner.deactivate_hand(owner.active_hand); From c1898a0026a6e57f4b5977902aeaa046dcfd23f3 Mon Sep 17 00:00:00 2001 From: Louis Stockdale-Lees Date: Tue, 7 Oct 2025 14:09:31 +0100 Subject: [PATCH 4/5] Copy and paste :) --- src/SB/Game/zNPCTypeBossSB2.cpp | 91 ++++++++++++++++++++++++++++++--- src/SB/Game/zNPCTypeBossSB2.h | 45 +++++++++++++++- 2 files changed, 129 insertions(+), 7 deletions(-) diff --git a/src/SB/Game/zNPCTypeBossSB2.cpp b/src/SB/Game/zNPCTypeBossSB2.cpp index f138a9fe0..42b07edd0 100644 --- a/src/SB/Game/zNPCTypeBossSB2.cpp +++ b/src/SB/Game/zNPCTypeBossSB2.cpp @@ -1,5 +1,6 @@ #include "zNPCTypeBossSB2.h" +#include "PowerPC_EABI_Support/MSL_C++/MSL_Common/Include/new.h" #include "xLightKit.h" #include "zNPCGoalCommon.h" #include @@ -1134,10 +1135,6 @@ void zNPCB_SB2::NewTime(xScene* x, F32 y) { } -void zNPCB_SB2::render_debug() -{ -} - void zNPCB_SB2::decompose() { } @@ -1246,6 +1243,15 @@ void zNPCB_SB2::destroy_glow_light() xLightKit_Destroy(&glow_light.kit); } +void zNPCB_SB2::say(U32) +{ +} + +xFactoryInst* zNPCGoalBossSB2Intro::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBossSB2Intro(who, (zNPCB_SB2&)*info); +} + S32 zNPCGoalBossSB2Intro::Enter(F32 dt, void* updCtxt) { if (owner.said_intro == 0) @@ -1256,7 +1262,6 @@ S32 zNPCGoalBossSB2Intro::Enter(F32 dt, void* updCtxt) owner.delay = 0.0f; zEntPlayerControlOff(CONTROL_OWNER_BOSS); return zNPCGoalCommon::Enter(dt, updCtxt); - } S32 zNPCGoalBossSB2Intro::Exit(F32 dt, void* updCtxt) @@ -1265,6 +1270,11 @@ S32 zNPCGoalBossSB2Intro::Exit(F32 dt, void* updCtxt) return xGoal::Exit(dt, updCtxt); } +xFactoryInst* zNPCGoalBossSB2Idle::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBossSB2Idle(who, (zNPCB_SB2&)*info); +} + S32 zNPCGoalBossSB2Idle::Enter(F32 dt, void* updCtxt) { transitioning = 1; @@ -1276,6 +1286,11 @@ S32 zNPCGoalBossSB2Idle::Exit(F32 dt, void* updCtxt) return xGoal::Exit(dt, updCtxt); } +xFactoryInst* zNPCGoalBossSB2Taunt::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBossSB2Taunt(who, (zNPCB_SB2&)*info); +} + S32 zNPCGoalBossSB2Taunt::Enter(F32 dt, void* updCtxt) { play_sound(0, &owner.sound_loc.mouth , 1.0f); @@ -1288,6 +1303,11 @@ S32 zNPCGoalBossSB2Taunt::Exit(F32 dt, void* updCtxt) return xGoal::Exit(dt, updCtxt); } +xFactoryInst* zNPCGoalBossSB2Dizzy::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBossSB2Dizzy(who, (zNPCB_SB2&)*info); +} + S32 zNPCGoalBossSB2Dizzy::Enter(F32 dt, void* updCtxt) { sicked = 0; @@ -1316,6 +1336,11 @@ S32 zNPCGoalBossSB2Dizzy::Exit(F32 dt, void* updCtxt) return xGoal::Exit(dt, updCtxt); } +xFactoryInst* zNPCGoalBossSB2Hit::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBossSB2Hit(who, (zNPCB_SB2&)*info); +} + S32 zNPCGoalBossSB2Hit::Enter(F32 dt, void* updCtxt) { // Function needs set up differently @@ -1354,6 +1379,16 @@ S32 zNPCGoalBossSB2Hit::Exit(F32 dt, void* updCtxt) return xGoal::Exit(dt, updCtxt); } +xFactoryInst* zNPCGoalBossSB2Hunt::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBossSB2Hunt(who, (zNPCB_SB2&)*info); +} + +xFactoryInst* zNPCGoalBossSB2Swipe::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBossSB2Swipe(who, (zNPCB_SB2&)*info); +} + S32 zNPCGoalBossSB2Swipe::Enter(F32 dt, void* updCtxt) { owner.flag.face_player = 1; @@ -1393,6 +1428,11 @@ S32 zNPCGoalBossSB2Swipe::can_start() const return tempStart != 0; } +xFactoryInst* zNPCGoalBossSB2Chop::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBossSB2Chop(who, (zNPCB_SB2&)*info); +} + S32 zNPCGoalBossSB2Chop::Enter(F32 dt, void* updCtxt) { targetted = 0; @@ -1424,7 +1464,17 @@ S32 zNPCGoalBossSB2Chop::Exit(F32 dt, void* updCtxt) return xGoal::Exit(dt, updCtxt); } -S32 zNPCGoalBossSB2Karate::Exit(float dt, void* updCtxt) +xFactoryInst* zNPCGoalBossSB2Karate::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBossSB2Karate(who, (zNPCB_SB2&)*info); +} + +S32 zNPCGoalBossSB2Karate::Enter(F32 dt, void* updCtxt) +{ + return zNPCGoalCommon::Enter(dt, updCtxt); +} + +S32 zNPCGoalBossSB2Karate::Exit(F32 dt, void* updCtxt) { owner.abandon_slugs(); return xGoal::Exit(dt, updCtxt); @@ -1437,6 +1487,11 @@ S32 zNPCGoalBossSB2Karate::can_start() const return tempStart != 0; } +xFactoryInst* zNPCGoalBossSB2Death::create(S32 who, RyzMemGrow* grow, void* info) +{ + return new (who, grow) zNPCGoalBossSB2Death(who, (zNPCB_SB2&)*info); +} + S32 zNPCGoalBossSB2Death::Enter(F32 dt, void* updCtxt) { owner.decompose(); @@ -1459,3 +1514,27 @@ void zNPCB_SB2::choose_hand() S32 b = (r >> 13) & 1; this->active_hand = (b == 0 ? LEFT_HAND : RIGHT_HAND); } + +xVec3& zNPCB_SB2::location() const +{ + return (xVec3&)(this->model->Mat->pos); +} + +void zNPCB_SB2::render_debug() +{ +} + +xVec3& zNPCB_SB2::get_home() const +{ + return (xVec3&)(this->asset->pos); +} + +xVec3& zNPCB_SB2::start_location() const +{ + return (xVec3&)(this->asset->pos); +} + +xVec3& zNPCB_SB2::facing() const +{ + return (xVec3&)(this->model->Mat->at); +} diff --git a/src/SB/Game/zNPCTypeBossSB2.h b/src/SB/Game/zNPCTypeBossSB2.h index 98daff2aa..216a5a195 100644 --- a/src/SB/Game/zNPCTypeBossSB2.h +++ b/src/SB/Game/zNPCTypeBossSB2.h @@ -243,11 +243,18 @@ struct zNPCB_SB2 : zNPCBoss void set_vulnerable(bool); void say(int); void choose_hand(); - U32 facing() const; + xVec3& location() const; + xVec3& get_home() const; + xVec3& start_location() const; + xVec3& facing() const; }; struct zNPCGoalBossSB2Intro : zNPCGoalCommon { + zNPCGoalBossSB2Intro::zNPCGoalBossSB2Intro(S32 goalID, zNPCB_SB2& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + zNPCB_SB2& owner; static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); @@ -257,6 +264,10 @@ struct zNPCGoalBossSB2Intro : zNPCGoalCommon struct zNPCGoalBossSB2Idle : zNPCGoalCommon { + zNPCGoalBossSB2Idle::zNPCGoalBossSB2Idle(S32 goalID, zNPCB_SB2& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + U8 transitioning; zNPCB_SB2& owner; @@ -267,6 +278,10 @@ struct zNPCGoalBossSB2Idle : zNPCGoalCommon struct zNPCGoalBossSB2Taunt : zNPCGoalCommon { + zNPCGoalBossSB2Taunt::zNPCGoalBossSB2Taunt(S32 goalID, zNPCB_SB2& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + zNPCB_SB2& owner; static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); @@ -276,6 +291,10 @@ struct zNPCGoalBossSB2Taunt : zNPCGoalCommon struct zNPCGoalBossSB2Dizzy : zNPCGoalCommon { + zNPCGoalBossSB2Dizzy::zNPCGoalBossSB2Dizzy(S32 goalID, zNPCB_SB2& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + U8 sicked; zNPCB_SB2& owner; @@ -286,6 +305,10 @@ struct zNPCGoalBossSB2Dizzy : zNPCGoalCommon struct zNPCGoalBossSB2Hit : zNPCGoalCommon { + zNPCGoalBossSB2Hit::zNPCGoalBossSB2Hit(S32 goalID, zNPCB_SB2& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + zNPCB_SB2& owner; static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); @@ -295,6 +318,10 @@ struct zNPCGoalBossSB2Hit : zNPCGoalCommon struct zNPCGoalBossSB2Hunt : zNPCGoalCommon { + zNPCGoalBossSB2Hunt::zNPCGoalBossSB2Hunt(S32 goalID, zNPCB_SB2& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + U8 following; zNPCB_SB2& owner; @@ -303,6 +330,10 @@ struct zNPCGoalBossSB2Hunt : zNPCGoalCommon struct zNPCGoalBossSB2Swipe : zNPCGoalCommon { + zNPCGoalBossSB2Swipe::zNPCGoalBossSB2Swipe(S32 goalID, zNPCB_SB2& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + U8 started; U8 holding; U8 said; @@ -319,6 +350,10 @@ struct zNPCGoalBossSB2Swipe : zNPCGoalCommon struct zNPCGoalBossSB2Chop : zNPCGoalCommon { + zNPCGoalBossSB2Chop::zNPCGoalBossSB2Chop(S32 goalID, zNPCB_SB2& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + U8 started; U8 targetted; U32 begin_anim; @@ -333,6 +368,10 @@ struct zNPCGoalBossSB2Chop : zNPCGoalCommon struct zNPCGoalBossSB2Karate : zNPCGoalCommon { + zNPCGoalBossSB2Karate::zNPCGoalBossSB2Karate(S32 goalID, zNPCB_SB2& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + U8 emitted[3]; U8 started; zNPCB_SB2& owner; @@ -345,6 +384,10 @@ struct zNPCGoalBossSB2Karate : zNPCGoalCommon struct zNPCGoalBossSB2Death : zNPCGoalCommon { + zNPCGoalBossSB2Death::zNPCGoalBossSB2Death(S32 goalID, zNPCB_SB2& npc) : zNPCGoalCommon(goalID), owner(npc) + { + } + zNPCB_SB2& owner; static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info); From 89f0d97f46e856bb3782eeb9a02cbf14499b8420 Mon Sep 17 00:00:00 2001 From: Louis Stockdale-Lees Date: Tue, 7 Oct 2025 22:58:12 +0100 Subject: [PATCH 5/5] Proper naming conventions --- src/SB/Game/zNPCTypeBossSB2.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/SB/Game/zNPCTypeBossSB2.cpp b/src/SB/Game/zNPCTypeBossSB2.cpp index 42b07edd0..d621f29c4 100644 --- a/src/SB/Game/zNPCTypeBossSB2.cpp +++ b/src/SB/Game/zNPCTypeBossSB2.cpp @@ -97,13 +97,13 @@ namespace model->PipeFlags |= 0x6508; } - F32 max(F32 maxF321, F32 maxF322) //Temp names till file is further + F32 max(F32 f0, F32 f1) { - if (maxF321 > maxF322) + if (f0 > f1) { - return maxF321; + return f0; } - return maxF322; + return f1; } S32 tweak() @@ -1517,7 +1517,7 @@ void zNPCB_SB2::choose_hand() xVec3& zNPCB_SB2::location() const { - return (xVec3&)(this->model->Mat->pos); + return reinterpret_cast(this->model->Mat->pos); } void zNPCB_SB2::render_debug() @@ -1526,15 +1526,15 @@ void zNPCB_SB2::render_debug() xVec3& zNPCB_SB2::get_home() const { - return (xVec3&)(this->asset->pos); + return reinterpret_cast(this->asset->pos); } xVec3& zNPCB_SB2::start_location() const { - return (xVec3&)(this->asset->pos); + return reinterpret_cast(this->asset->pos); } xVec3& zNPCB_SB2::facing() const { - return (xVec3&)(this->model->Mat->at); + return reinterpret_cast(this->model->Mat->at); }