Skip to content

Commit

Permalink
More things
Browse files Browse the repository at this point in the history
  • Loading branch information
escape209 committed Sep 18, 2024
1 parent d36ef81 commit ad23e40
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
62 changes: 61 additions & 1 deletion src/SB/Game/zNPCGoalRobo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#include "zNPCGoals.h"
#include "zGameExtras.h"
#include "zNPCSupport.h"
#include "zNPCTypeBoss.h"

#include "zNPCMgr.h"

xFactoryInst* GOALCreate_Robotic(S32 who, RyzMemGrow* grow, void*)
{
Expand Down Expand Up @@ -200,7 +203,7 @@ xFactoryInst* GOALCreate_Robotic(S32 who, RyzMemGrow* grow, void*)
S32 zNPCGoalAlertFodder::Enter(F32 dt, void* updCtxt)
{
flg_attack = 0;
tmr_alertfod = 0.0f; // need non-const float to get scheduling right
tmr_alertfod = 0.0f;
alertfod = FODDER_ALERT_NOTICE;
return zNPCGoalCommon::Enter(dt, updCtxt);
}
Expand Down Expand Up @@ -977,6 +980,14 @@ S32 zNPCGoalTubeBirth::Enter(F32 dt, void* updCtxt)
return zNPCGoalCommon::Enter(dt, updCtxt);
}

S32 zNPCGoalAlertTarTar::Resume(F32 dt, void* updCtxt)
{
zNPCTarTar* npc = ((zNPCTarTar*)(psyche->clt_owner));
npc->VelStop();
flg_info |= 2;
return zNPCGoalCommon::Resume(dt, updCtxt);
}

S32 zNPCGoalAttackMonsoon::Enter(F32 dt, void* updCtxt)
{
idx_launch = 0;
Expand Down Expand Up @@ -1063,6 +1074,14 @@ S32 zNPCGoalAlertPuppy::Resume(F32 dt, void* updCtxt)
return zNPCGoalCommon::Resume(dt, updCtxt);
}

S32 zNPCGoalAlertArf::Resume(F32 dt, void* updCtxt)
{
zNPCArfArf* npc = ((zNPCArfArf*)(psyche->clt_owner));
flg_info |= 2;
flg_user = 1;
return zNPCGoalCommon::Resume(dt, updCtxt);
}

S32 zNPCGoalAlertChuck::Resume(F32 dt, void* updCtxt)
{
zNPCChuck* npc = ((zNPCChuck*)(psyche->clt_owner));
Expand Down Expand Up @@ -1123,4 +1142,45 @@ S32 zNPCGoalWound::NPCMessage(NPCMsg* msg)
return 1;
}
return 0;
}

S32 zNPCGoalRespawn::InputInfo(NPCSpawnInfo* info)
{
zNPCRobot* npc = ((zNPCRobot*)(psyche->clt_owner));

flg_info = 0x10;
xVec3Copy(&pos_poofHere, &info->pos_spawn);

if (info->nav_spawnReference != NULL)
{
npc->nav_curr = info->nav_spawnReference;
}
else
{
npc->nav_curr = info->nav_firstMovepoint;
}

npc->nav_dest = info->nav_firstMovepoint;
return flg_info;
}

S32 zNPCGoalStunned::InputInfo(NPCStunInfo* info)
{
zNPCRobot* npc = ((zNPCRobot*)(psyche->clt_owner));
flg_info = 0x10;
F32 stunTime = npc->tmr_stunned;
F32 infoStun = info->tym_stuntime;
stunTime = (stunTime > infoStun) ? stunTime : infoStun;
npc->tmr_stunned = stunTime;
return flg_info;
}

F32 zNPCGoalEvilPat::GlyphStop()
{
zNPCRobot* npc = ((zNPCRobot*)(psyche->clt_owner));
if (npc->glyf_stun != NULL)
{
npc->glyf_stun->Discard();
}
npc->glyf_stun = NULL;
}
3 changes: 3 additions & 0 deletions src/SB/Game/zNPCGoalStd.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ class zNPCGoalStunned : public zNPCGoalCommon
// total size: 0x4C
public:
zNPCGoalStunned(S32);
S32 InputInfo(NPCStunInfo* info);
S32 Enter(F32 dt, void* updCtxt);
};

Expand Down Expand Up @@ -451,6 +452,7 @@ class zNPCGoalAlertArf : public zNPCGoalCommon
public:
zNPCGoalAlertArf(S32);
S32 Enter(F32 dt, void* updCtxt);
S32 Resume(F32 dt, void* updCtxt);
en_alertarf alertarf; // offset 0x4C, size 0x4
F32 tmr_reload; // offset 0x50, size 0x4
};
Expand Down Expand Up @@ -953,6 +955,7 @@ class zNPCGoalRespawn : public zNPCGoalCommon
// total size: 0x64
public:
zNPCGoalRespawn(S32);
S32 InputInfo(NPCSpawnInfo* info);
F32 tmr_respawn; // offset 0x4C, size 0x4
F32 tmr_robobits; // offset 0x50, size 0x4
S32 cnt_ring; // offset 0x54, size 0x4
Expand Down

0 comments on commit ad23e40

Please sign in to comment.