diff --git a/src/SB/Game/zNPCTypeDutchman.cpp b/src/SB/Game/zNPCTypeDutchman.cpp index 046fdf5b7..8e7717a60 100644 --- a/src/SB/Game/zNPCTypeDutchman.cpp +++ b/src/SB/Game/zNPCTypeDutchman.cpp @@ -70,6 +70,10 @@ void zNPCDutchman::kill_wave(zNPCDutchman::wave_data& wave) kill_sound(1, wave.sound_handle); } +void zNPCDutchman::stop_hand_trail() +{ +} + void zNPCDutchman::start_eye_glow() //Matches but the data is fucked { flag.eye_glow = true; @@ -90,149 +94,153 @@ void zNPCDutchman::add_splash(const xVec3&, float) { } -void zNPCDutchman::start_beam() +<<<<<<< HEAD +void zNPCDutchman::stop_flames() { - if ((flag.beaming) != 0) + == == == = void zNPCDutchman::start_beam() { - return; + if ((flag.beaming) != 0) + { + return; + } + flag.beaming = 1; + flag.was_beaming = 0; + beam[1].segments = 0; //0x54C + beam[0].segments = 0; //0x430 + + //Could also write as: + + //for (S32 i = 1; i >= 0; --i) + // { + // beam[i].segments = 0; + // } } - flag.beaming = 1; - flag.was_beaming = 0; - beam[1].segments = 0; //0x54C - beam[0].segments = 0; //0x430 - - //Could also write as: - //for (S32 i = 1; i >= 0; --i) - // { - // beam[i].segments = 0; - // } -} - -void zNPCDutchman::stop_beam() -{ - flag.beaming = false; -} - -void zNPCDutchman::start_flames() -{ - //static_queue::clear(); - flag.flaming = true; - flames.time = 0.0; - flames.emitted = 0; - flames.blob_break = 1; - flames.splash_break = 1; - slime.slices.clear(); -} + void zNPCDutchman::stop_beam() + { + flag.beaming = false; + } -void zNPCDutchman::stop_flames() -{ - flag.flaming = false; -} + void zNPCDutchman::start_flames() + { + //static_queue::clear(); + flag.flaming = true; + flames.time = 0.0; + flames.emitted = 0; + flames.blob_break = 1; + flames.splash_break = 1; + slime.slices.clear(); + } -void zNPCDutchman::vanish() -{ - old.moreFlags = moreFlags; - pflags = 0; - moreFlags = 0; - flags2.flg_colCheck = 0; - flags2.flg_penCheck = 0; - chkby = 0; - penby = 0; - xEntHide(this); -} + void zNPCDutchman::stop_flames() + { + flag.flaming = false; +>>>>>>> upstream + } -void zNPCDutchman::reappear() -{ - moreFlags = old.moreFlags; - xNPCBasic::RestoreColFlags(); - xEntShow(this); -} + void zNPCDutchman::vanish() + { + old.moreFlags = moreFlags; + pflags = 0; + moreFlags = 0; + flags2.flg_colCheck = 0; + flags2.flg_penCheck = 0; + chkby = 0; + penby = 0; + xEntHide(this); + } -void zNPCDutchman::reset_speed() -{ -} + void zNPCDutchman::reappear() + { + moreFlags = old.moreFlags; + xNPCBasic::RestoreColFlags(); + xEntShow(this); + } -//S32 zNPCGoalDutchmanInitiate::Exit(F32 dt, void* updCtxt) -//{ -// return xGoal::Exit(dt, updCtxt); -//} + void zNPCDutchman::reset_speed() + { + } -S32 zNPCGoalDutchmanIdle::Enter(F32 dt, void* updCtxt) -{ - owner.face_player(); - return zNPCGoalCommon::Enter(dt, updCtxt); -} + //S32 zNPCGoalDutchmanInitiate::Exit(F32 dt, void* updCtxt) + //{ + // return xGoal::Exit(dt, updCtxt); + //} -S32 zNPCGoalDutchmanIdle::Exit(F32 dt, void* updCtxt) -{ - return xGoal::Exit(dt, updCtxt); -} + S32 zNPCGoalDutchmanIdle::Enter(F32 dt, void* updCtxt) + { + owner.face_player(); + return zNPCGoalCommon::Enter(dt, updCtxt); + } -S32 zNPCGoalDutchmanDisappear::Exit(F32 dt, void* updCtxt) -{ - return xGoal::Exit(dt, updCtxt); -} + S32 zNPCGoalDutchmanIdle::Exit(F32 dt, void* updCtxt) + { + return xGoal::Exit(dt, updCtxt); + } -S32 zNPCGoalDutchmanTeleport::Exit(F32 dt, void* updCtxt) -{ - return xGoal::Exit(dt, updCtxt); -} + S32 zNPCGoalDutchmanDisappear::Exit(F32 dt, void* updCtxt) + { + return xGoal::Exit(dt, updCtxt); + } -S32 zNPCGoalDutchmanReappear::Exit(F32 dt, void* updCtxt) -{ - owner.reset_speed(); - return xGoal::Exit(dt, updCtxt); -} + S32 zNPCGoalDutchmanTeleport::Exit(F32 dt, void* updCtxt) + { + return xGoal::Exit(dt, updCtxt); + } -S32 zNPCGoalDutchmanBeam::Exit(F32 dt, void* updCtxt) -{ - return xGoal::Exit(dt, updCtxt); -} + S32 zNPCGoalDutchmanReappear::Exit(F32 dt, void* updCtxt) + { + owner.reset_speed(); + return xGoal::Exit(dt, updCtxt); + } -S32 zNPCGoalDutchmanFlame::Exit(F32 dt, void* updCtxt) -{ - S32 tempR0; - tempR0 = this->owner.flg_vuln; - tempR0 = tempR0 &= 0xFEFFFFFF; - this->owner.flg_vuln = tempR0; + S32 zNPCGoalDutchmanBeam::Exit(F32 dt, void* updCtxt) + { + return xGoal::Exit(dt, updCtxt); + } - owner.stop_flames(); - owner.stop_hand_trail(); - return xGoal::Exit(dt, updCtxt); -} + S32 zNPCGoalDutchmanFlame::Exit(F32 dt, void* updCtxt) + { + S32 tempR0; + tempR0 = this->owner.flg_vuln; + tempR0 = tempR0 &= 0xFEFFFFFF; + this->owner.flg_vuln = tempR0; + + owner.stop_flames(); + owner.stop_hand_trail(); + return xGoal::Exit(dt, updCtxt); + } -S32 zNPCGoalDutchmanCaught::Exit(float dt, void* updCtxt) -{ - return xGoal::Exit(dt, updCtxt); -} + S32 zNPCGoalDutchmanCaught::Exit(float dt, void* updCtxt) + { + return xGoal::Exit(dt, updCtxt); + } -U8 zNPCDutchman::PhysicsFlags() const -{ - return 3; -} + U8 zNPCDutchman::PhysicsFlags() const + { + return 3; + } -U8 zNPCDutchman::ColPenByFlags() const -{ - return 16; -} + U8 zNPCDutchman::ColPenByFlags() const + { + return 16; + } -U8 zNPCDutchman::ColChkByFlags() const -{ - return 16; -} + U8 zNPCDutchman::ColChkByFlags() const + { + return 16; + } -U8 zNPCDutchman::ColPenFlags() const -{ - return 0; -} + U8 zNPCDutchman::ColPenFlags() const + { + return 0; + } -U8 zNPCDutchman::ColChkFlags() const -{ - return 0; -} + U8 zNPCDutchman::ColChkFlags() const + { + return 0; + } -WEAK void zNPCDutchman::face_player() -{ - flag.face_player = true; -} + WEAK void zNPCDutchman::face_player() + { + flag.face_player = true; + } diff --git a/src/SB/Game/zNPCTypeDutchman.h b/src/SB/Game/zNPCTypeDutchman.h index ac3bc8e79..afa5fb99d 100644 --- a/src/SB/Game/zNPCTypeDutchman.h +++ b/src/SB/Game/zNPCTypeDutchman.h @@ -147,19 +147,19 @@ struct zNPCDutchman : zNPCSubBoss void kill_wave(zNPCDutchman::wave_data&); void add_splash(const xVec3&, float); void vanish(); - void reappear(); - void face_player(); - void start_beam(); +<<<<<<< HEAD + == == == = void start_beam(); void stop_beam(); - void start_flames(); +>>>>>>> upstream void stop_flames(); void stop_hand_trail(); void reset_lasso_anim(); void reset_speed(); void Damage(en_NPC_DAMAGE_TYPE, xBase*, const xVec3*); - S32 LassoSetup(); - void start_eye_glow(); +<<<<<<< HEAD + == == == = void start_eye_glow(); void stop_eye_glow(); +>>>>>>> upstream U8 PhysicsFlags() const; U8 ColPenByFlags() const; U8 ColChkByFlags() const; 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) { }