Skip to content
Closed
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
21 changes: 17 additions & 4 deletions src/SB/Game/zNPCTypeBossPlankton.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "zNPCTypeBossPlankton.h"
#include "xDebug.h"
#include "xMathInlines.h"

#include <types.h>

Expand Down Expand Up @@ -1147,8 +1148,7 @@ void zNPCBPlankton::Process(xScene* xscn, F32 dt)
update_turn(dt);
update_move(dt);
update_animation(dt); //uvar5 = update anim
check_player_damage(); //uvar1 = check_player_damage
if (psy_instinct != 0) //psy_instinct isnt right, needs (uvar1 & 0xff)
if ((U8)check_player_damage())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider changing this function's signature to return U8/char/bool or something or does that not work?

{
zEntPlayer_Damage(0, 1); //needs xBase* instead of 0
}
Expand Down Expand Up @@ -1323,9 +1323,22 @@ void zNPCBPlankton::update_follow(F32 dt)
}
}

void zNPCBPlankton::check_player_damage()
F32 zNPCBPlankton::get_orbit_yaw(const xVec3& vec) const
{
// TODO
return xatan2(vec.x - this->orbit.center.x, vec.z - this->orbit.center.z);
}

void zNPCBPlankton::give_control()
{
if (!this->crony)
return;

this->crony->ThanksImDone();
}

S32 zNPCBPlankton::check_player_damage()
{
return (((-globals.player.cheat_mode) | globals.player.cheat_mode) & 1);
}

void zNPCBPlankton::init_beam()
Expand Down
5 changes: 3 additions & 2 deletions src/SB/Game/zNPCTypeBossPlankton.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ struct zNPCBPlankton : zNPCBoss
void Setup();
void PostSetup();
void Reset();
void Destroy();
void Destroy(); // 0x54
void Process(xScene*, F32);
S32 SysEvent(xBase*, xBase*, unsigned int, const F32*, xBase*, int*);
void Render();
Expand All @@ -129,7 +129,7 @@ struct zNPCBPlankton : zNPCBoss
S32 next_goal();
void update_turn(F32);
void update_move(F32);
void check_player_damage();
S32 check_player_damage();
void reset_territories();
void update_animation(F32);
void update_follow(F32);
Expand Down Expand Up @@ -158,6 +158,7 @@ struct zNPCBPlankton : zNPCBoss
xVec3& location() const;
void face_player();
void render_debug();
F32 get_orbit_yaw(const xVec3&) const;
void give_control();
void enable_emitter(xParEmitter&) const;
void disable_emitter(xParEmitter&) const;
Expand Down
Loading