From f28f0fe27be8fa5d4854b2665b0ae1c5e36230e8 Mon Sep 17 00:00:00 2001 From: Louis Stockdale-Lees Date: Fri, 26 Sep 2025 21:12:06 +0100 Subject: [PATCH 1/2] set_alpha_blend, abandon_slugs, choose_hand --- src/SB/Game/zNPCTypeBossSB2.cpp | 47 ++++++++++++++++++++++++++------- src/SB/Game/zNPCTypeBossSB2.h | 8 ++++-- 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/src/SB/Game/zNPCTypeBossSB2.cpp b/src/SB/Game/zNPCTypeBossSB2.cpp index 00fd2fefc..f2d5a6a51 100644 --- a/src/SB/Game/zNPCTypeBossSB2.cpp +++ b/src/SB/Game/zNPCTypeBossSB2.cpp @@ -90,9 +90,10 @@ namespace { 7, "RSB_armhit2", 0, 0 }, { 8, "RSB_armsmash", 0, 0 }, { 9, "RSB_foor_impact", 0, 0 }, }; - S32 set_alpha_blend(xModelInstance*) + void set_alpha_blend(xModelInstance* model) { - return 0; // to-do + model->PipeFlags &= ~0xFF0C; + model->PipeFlags |= 0x6508; } F32 max(float maxFloat1, float maxFloat2) //Temp names till file is further @@ -1129,6 +1130,31 @@ void zNPCB_SB2::Destroy() zNPCCommon::Destroy(); } +void zNPCB_SB2::NewTime(xScene* x, float y) +{ + //this-> + if(1 != 0) + { + zNPCB_SB2::move_nodes(); + } + + if(1 != 0) + { + zNPCB_SB2::move_hand(zNPCB_SB2::hands[1], 0); + } + + zNPCB_SB2::update_bounds(); + zNPCB_SB2::update_platforms(0.0f); + zNPCB_SB2::update_slugs(0.0f); + //xModelGetBoneLocation(const xModelInstance&, unsigned long); + //xVec3::operator=(const xVec3&); + //xVec3::operator=(const xVec3&); + //xModelGetBoneLocation(const xModelInstance&, unsigned long); + //xVec3::operator=(const xVec3&); + //xModelGetBoneLocation(const xModelInstance&, unsigned long); + //xVec3::operator=(const xVec3&); + zNPCCommon::NewTime(x, y); +} void zNPCB_SB2::render_debug() { @@ -1223,7 +1249,12 @@ S32 zNPCB_SB2::player_on_ground() const void zNPCB_SB2::abandon_slugs() { - + slug_data* pCurSlug = &slugs[0]; + slug_data* pLastSlug = &pCurSlug[3]; + for (; pCurSlug != pLastSlug; pCurSlug++) + { + pCurSlug->abandoned = 1; + } } void zNPCB_SB2::reset_stage() @@ -1394,11 +1425,9 @@ S32 zNPCGoalBossSB2Death::Process(en_trantype*, F32, void*, xScene*) return 0; } -// WEAK - -void zNPCB_SB2::choose_hand() //53% +void zNPCB_SB2::choose_hand() { - S32 rand; - rand = xrand() >> 0xd & 1; - + S32 r = xrand(); + S32 b = (r >> 13) & 1; + this->active_hand = (b == 0 ? LEFT_HAND : RIGHT_HAND); } diff --git a/src/SB/Game/zNPCTypeBossSB2.h b/src/SB/Game/zNPCTypeBossSB2.h index bff1a91a2..6a2047585 100644 --- a/src/SB/Game/zNPCTypeBossSB2.h +++ b/src/SB/Game/zNPCTypeBossSB2.h @@ -216,6 +216,12 @@ struct zNPCB_SB2 : zNPCBoss zNPCB_SB2(S32 myType); void SelfSetup(); void Destroy(); + void NewTime(xScene*, float); + void move_nodes(); + void move_hand(zNPCB_SB2::hand_data&, float); + void update_bounds(); + void update_platforms(float); + void update_slugs(float); void render_debug(); void decompose(); void show_nodes(); @@ -235,8 +241,6 @@ struct zNPCB_SB2 : zNPCBoss void abandon_slugs(); void set_vulnerable(bool); void say(int); - - // WEAK void choose_hand(); }; From a6ef80e2cdbcd2edba8fdd45066bc4eaa56c6504 Mon Sep 17 00:00:00 2001 From: Louis Stockdale-Lees Date: Fri, 26 Sep 2025 21:22:06 +0100 Subject: [PATCH 2/2] rm wip newtime --- src/SB/Game/zNPCTypeBossSB2.cpp | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/SB/Game/zNPCTypeBossSB2.cpp b/src/SB/Game/zNPCTypeBossSB2.cpp index f2d5a6a51..68e88d2be 100644 --- a/src/SB/Game/zNPCTypeBossSB2.cpp +++ b/src/SB/Game/zNPCTypeBossSB2.cpp @@ -1132,28 +1132,6 @@ void zNPCB_SB2::Destroy() void zNPCB_SB2::NewTime(xScene* x, float y) { - //this-> - if(1 != 0) - { - zNPCB_SB2::move_nodes(); - } - - if(1 != 0) - { - zNPCB_SB2::move_hand(zNPCB_SB2::hands[1], 0); - } - - zNPCB_SB2::update_bounds(); - zNPCB_SB2::update_platforms(0.0f); - zNPCB_SB2::update_slugs(0.0f); - //xModelGetBoneLocation(const xModelInstance&, unsigned long); - //xVec3::operator=(const xVec3&); - //xVec3::operator=(const xVec3&); - //xModelGetBoneLocation(const xModelInstance&, unsigned long); - //xVec3::operator=(const xVec3&); - //xModelGetBoneLocation(const xModelInstance&, unsigned long); - //xVec3::operator=(const xVec3&); - zNPCCommon::NewTime(x, y); } void zNPCB_SB2::render_debug()