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
1 change: 1 addition & 0 deletions src/SB/Core/x/containers.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ template <class T> struct static_queue
U32 _max_size;
U32 _max_size_mask;
T* _buffer;
void clear();
};

template <class T, U32 N> struct fixed_queue
Expand Down
2 changes: 1 addition & 1 deletion src/SB/Core/x/xEnt.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ struct xEnt : xBase

// Offset: 0x10
xEntAsset* asset;
U16 idx;
U16 idx; //0x14
U16 num_updates;

// Offset: 0x18
Expand Down
1 change: 1 addition & 0 deletions src/SB/Game/zEntCruiseBubble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1753,6 +1753,7 @@ void cruise_bubble::tweak_group::register_tweaks(bool init, xModelAssetParam* ap
{
if (init)
{
this->aim_delay;
this->aim_delay = zEntCruiseBubble_f_0_2;
auto_tweak::load_param<F32, F32>(this->aim_delay, 1.0f, zEntCruiseBubble_f_0_0, 1.0f, ap,
apsize, "aim_delay");
Expand Down
48 changes: 45 additions & 3 deletions src/SB/Game/zNPCTypeDutchman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

namespace
{
}

void kill_sound(S32 a, U32 b)
{
}
} // namespace
//dummy text for pushing
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;
Expand Down Expand Up @@ -48,6 +51,12 @@ void zNPCDutchman::Damage(en_NPC_DAMAGE_TYPE, xBase*, const xVec3*)
// move = *tempR4;
// }

S32 zNPCDutchman::LassoSetup()
{
zNPCCommon::LassoUseGuides(1, 1);
zNPCCommon::LassoSetup();
}

void zNPCDutchman::render_debug()
{
}
Expand All @@ -56,6 +65,11 @@ void zNPCDutchman::update_animation(float)
{
}

void zNPCDutchman::kill_wave(zNPCDutchman::wave_data& wave)
{
kill_sound(1, wave.sound_handle);
}

void zNPCDutchman::start_eye_glow() //Matches but the data is fucked
{
flag.eye_glow = true;
Expand Down Expand Up @@ -100,6 +114,17 @@ void zNPCDutchman::stop_beam()
flag.beaming = false;
}

void zNPCDutchman::start_flames()
{
//static_queue<zNPCDutchman::slime_slice>::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_flames()
{
flag.flaming = false;
Expand All @@ -117,16 +142,28 @@ void zNPCDutchman::vanish()
xEntHide(this);
}

void zNPCDutchman::reappear()
{
moreFlags = old.moreFlags;
xNPCBasic::RestoreColFlags();
xEntShow(this);
}

void zNPCDutchman::reset_speed()
{
}

//S32 zNPCGoalDutchmanInitiate::Exit(F32 dt, void* updCtxt)
//{
// owner;
// return xGoal::Exit(dt, updCtxt);
//}

S32 zNPCGoalDutchmanIdle::Enter(F32 dt, void* updCtxt)
{
owner.face_player();
return zNPCGoalCommon::Enter(dt, updCtxt);
}

S32 zNPCGoalDutchmanIdle::Exit(F32 dt, void* updCtxt)
{
return xGoal::Exit(dt, updCtxt);
Expand Down Expand Up @@ -194,3 +231,8 @@ U8 zNPCDutchman::ColChkFlags() const
{
return 0;
}

WEAK void zNPCDutchman::face_player()
{
flag.face_player = true;
}
13 changes: 10 additions & 3 deletions src/SB/Game/zNPCTypeDutchman.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct zNPCDutchman : zNPCSubBoss
bool beaming;
bool was_beaming;
bool hurting;
bool flaming;
bool flaming; //0x2b9
bool eye_glow;
bool hand_trail; //0x2bb
move_enum move;
Expand All @@ -97,7 +97,7 @@ struct zNPCDutchman : zNPCSubBoss
move_info move; //0x2C8
struct
{
U8 moreFlags; //0x31c??
U8 moreFlags; //0x31c
} old;
beam_info beam[2]; //Needed for start_beam func
static_queue<wave_data> waves; //Needed for start_beam func
Expand All @@ -108,7 +108,7 @@ struct zNPCDutchman : zNPCSubBoss
S32 emitted; //0x574
U8 splash_break;
xVec3 splash_loc;
U8 blob_break;
U8 blob_break; //0x588
xVec3 blob_loc;
F32 imax_dist; //0x598
xMat3x3 blob_mat;
Expand Down Expand Up @@ -144,14 +144,20 @@ struct zNPCDutchman : zNPCSubBoss
void Render();
void render_debug();
void update_animation(float);
void kill_wave(zNPCDutchman::wave_data&);
void add_splash(const xVec3&, float);
void vanish();
void reappear();
void face_player();
void start_beam();
void stop_beam();
void start_flames();
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();
void stop_eye_glow();
U8 PhysicsFlags() const;
Expand All @@ -177,6 +183,7 @@ struct zNPCGoalDutchmanInitiate : zNPCGoalCommon
struct zNPCGoalDutchmanIdle : zNPCGoalCommon
{
zNPCDutchman& owner;
S32 Enter(float, void*);
S32 Exit(float, void*);

static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info);
Expand Down
202 changes: 202 additions & 0 deletions src/SB/Game/zNPCTypePrawn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,208 @@

#include <types.h>

namespace
{
sound_data_type sound_data[4];
U32 sound_asset_ids[6][4];

struct tweak_group
{
F32 turn_accel;
F32 spawn_delay;
F32 repel_radius;
struct
{
range_type pattern;
} safe;
struct
{
range_type pattern;
F32 state_delay; // 0x1c
F32 transition_delay;
} begin;
struct
{
F32 delay[3];
range_type pattern;
F32 state_delay;
F32 transition_delay;
F32 exhaust_vel;
F32 knock_back;
struct
{
S32 amount[3];
F32 arc;
F32 delay;
F32 accel;
F32 max_vel;
} sweep;
fire_type fire;
} beam;
_class_7 aim_lane;
_class_14 lane;
_class_25 danger;
sound_property sound[4];
void* context;
tweak_callback cb_sound;
tweak_callback cb_sound_asset;

void register_tweaks(bool init, xModelAssetParam* ap, U32 apsize);
}; // namespace tweak_group
} // namespace

/*

TODO: 42%, needs quite a bit of work still.
Thought this function was going to be an easy copy/paste like other register_tweak fn,
but turning out to be harder to decipher than I anticipated so leaving it like this for now.
*/
void tweak_group::register_tweaks(bool init, xModelAssetParam* ap, U32 apsize)
{
if (init)
{
this->sound[0].volume = 0;
auto_tweak::load_param<F32, F32>(this->sound[0].volume, 1.0f, 0.0, 1.0f, ap, apsize,
"TODO1");
}

if (init)
{
this->sound[0].range_inner = 0;
auto_tweak::load_param<F32, F32>(this->sound[0].range_inner, 1.0f, 0.0, 1.0f, ap, apsize,
"TODO2");
}
if (init)
{
this->sound[0].range_outer = 0;
auto_tweak::load_param<F32, F32>(this->sound[0].range_outer, 1.0f, 0.0, 1.0f, ap, apsize,
"TODO3");
}

if (init)
{
this->sound[0].delay = 0;
auto_tweak::load_param<F32, F32>(this->sound[0].delay, 1.0f, 0.0, 1.0f, ap, apsize,
"TODO4");
}
if (init)
{
this->sound[1].volume = 0;
auto_tweak::load_param<F32, F32>(this->sound[1].volume, 1.0f, 0.0, 1.0f, ap, apsize,
"TODo5");
}
if (init)
{
this->sound[1].range_inner = 0;
auto_tweak::load_param<F32, F32>(this->sound[1].range_inner, 1.0f, 0.0, 1.0f, ap, apsize,
"TODo6");
}

if (init)
{
this->sound[1].range_outer = 0;
auto_tweak::load_param<F32, F32>(this->sound[1].range_outer, 1.0f, 0.0, 1.0f, ap, apsize,
"todo7");
}
if (init)
{
this->sound[1].delay = 0;
auto_tweak::load_param<F32, F32>(this->sound[1].delay, 1.0f, 0.0, 1.0f, ap, apsize,
"todo8");
}
if (init)
{
this->sound[2].volume = 0;
auto_tweak::load_param<F32, F32>(this->sound[2].volume, 1.0f, 0.0, 1.0f, ap, apsize,
"todo9");
}
if (init)
{
this->sound[2].range_inner = 0;
auto_tweak::load_param<F32, F32>(this->sound[2].range_inner, 1.0f, 0.0, 1.0f, ap, apsize,
"todo10");
}

if (init)
{
this->sound[2].range_outer = 0;
auto_tweak::load_param<F32, F32>(this->sound[2].range_outer, 1.0f, 0.0, 1.0f, ap, apsize,
"todo11");
}
if (init)
{
this->sound[2].delay = 0;
auto_tweak::load_param<F32, F32>(this->sound[2].delay, 1.0f, 0.0, 1.0f, ap, apsize,
"todo12");
}
if (init)
{
this->sound[3].volume = 0;
auto_tweak::load_param<F32, F32>(this->sound[3].volume, 1.0f, 0.0, 1.0f, ap, apsize,
"todo13");
}
if (init)
{
this->sound[3].range_inner = 0;
auto_tweak::load_param<F32, F32>(this->sound[3].range_inner, 1.0f, 0.0, 1.0f, ap, apsize,
"todo14");
}

if (init)
{
this->sound[3].range_outer = 0;
auto_tweak::load_param<F32, F32>(this->sound[3].range_outer, 1.0f, 0.0, 1.0f, ap, apsize,
"todo15");
}
if (init)
{
this->sound[3].delay = 0;
auto_tweak::load_param<F32, F32>(this->sound[3].delay, 1.0f, 0.0, 1.0f, ap, apsize,
"todo16");
}

if (init)
{
this->sound[3].delay = 0;
auto_tweak::load_param<F32, F32>(this->sound[3].delay, 1.0f, 0.0, 1.0f, ap, apsize,
"todo17");
}

if (init)
{
sound_data[0].volume = sound[0].volume;
sound_data[0].id = sound_asset_ids[0][0] = xStrHash("TES1");
}
if (init)
{
sound_data[1].volume = sound[1].volume;
sound_data[1].id = sound_asset_ids[0][1] = xStrHash("TES2");
}
if (init)
{
sound_data[2].volume = sound[2].volume;
sound_data[2].id = sound_asset_ids[0][2] = xStrHash("TES3");
}
if (init)
{
sound_data[3].volume = sound[3].volume;
sound_data[3].id = sound_asset_ids[0][3] = xStrHash("TES4");
}

/*
*(undefined4 *)(param_1 + 0x1ac) = sound_asset_ids__27@unnamed@zNPCTypePrawn_cpp@;
sound_data__27@unnamed@zNPCTypePrawn_cpp@ =
xStrHash__FPCc((&PTR_@stringBase0_8026e83c)[*(int *)(param_1 + 0x1ac) * 4]);
*(undefined4 *)(param_1 + 0x1c4) = DAT_80329548;
DAT_803295b0 = xStrHash__FPCc((&PTR_@stringBase0_8026e83c)[*(int *)(param_1 + 0x1c4) * 4]);
*(undefined4 *)(param_1 + 0x1dc) = DAT_80329560;
DAT_803295c0 = xStrHash__FPCc((&PTR_@stringBase0_8026e83c)[*(int *)(param_1 + 0x1dc) * 4]);
*(undefined4 *)(param_1 + 500) = DAT_80329578;
DAT_803295d0 = xStrHash__FPCc((&PTR_@stringBase0_8026e83c)[*(int *)(param_1 + 500) * 4]);
}
*/
}

void zNPCPrawn::render_debug()
{
}
Expand Down
Loading