Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions src/SB/Game/zNPCTypeKingJelly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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);
}
26 changes: 20 additions & 6 deletions src/SB/Game/zNPCTypeKingJelly.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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;
Expand All @@ -24,18 +28,18 @@ struct lightning_ring
F32 radius;
F32 vel;
F32 accel;
F32 time;
F32 time; //0x44??
} current;
struct
{
U8 line;
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();
Expand All @@ -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*);
Expand Down Expand Up @@ -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();
Expand All @@ -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();
};
Expand Down Expand Up @@ -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)
{
}
Expand Down