Skip to content
128 changes: 128 additions & 0 deletions src/SB/Game/zNPCTypeBossPlankton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,134 @@

#include <types.h>

#define f1585 1.0f
#define f1586 0.0f
#define f1657 0.2f
#define f1658 0.1f

#define ANIM_Unknown 0
#define ANIM_Idle01 1 // 0x4
#define ANIM_Taunt01 3 // 0xC
#define ANIM_move 66 // 0x42
#define ANIM_stun_begin 67 //0x43
#define ANIM_stun_loop 68 //0x44
#define ANIM_stun_end 69 //0x45
#define ANIM_attack_beam_begin 70 //0x46
#define ANIM_attack_beam_loop 71 //0x47
#define ANIM_attack_beam_end 72 //0x48
#define ANIM_attack_wall_begin 73 //0x49
#define ANIM_attack_wall_loop 74 //0x4a
#define ANIM_attack_wall_end 75 //0x4b
#define ANIM_attack_missle 76 //0x4c
#define ANIM_attack_bomb 77 //0x4d

xAnimTable* ZNPC_AnimTable_BossPlankton()
{
// clang-format off
S32 ourAnims[32] = { //dwarf says it should be 32, matches less with 15
ANIM_Idle01,
ANIM_Taunt01,
ANIM_move,
ANIM_stun_begin,
ANIM_stun_loop,
ANIM_stun_end,
ANIM_attack_beam_begin,
ANIM_attack_beam_loop,
ANIM_attack_beam_end,
ANIM_attack_wall_begin,
ANIM_attack_wall_loop,
ANIM_attack_wall_end,
ANIM_attack_missle,
ANIM_attack_bomb,
ANIM_Unknown,
};
// clang-format on

xAnimTable* table = xAnimTableNew("zNPCBPlankton", NULL, 0);

xAnimTableNewState(table, g_strz_bossanim[ANIM_Idle01], 0x10, 0, 1.0f, NULL, NULL, 0.0f, NULL,
NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[ANIM_Taunt01], 0x20, 0, 1.0f, NULL, NULL, 0.0f, NULL,
NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[ANIM_move], 0x10, 0, f1585, NULL, NULL, f1586, NULL,
NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[ANIM_stun_begin], 0x20, 0, f1585, NULL, NULL, f1586,
NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[ANIM_stun_loop], 0x10, 0, f1585, NULL, NULL, f1586,
NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[ANIM_stun_end], 0x20, 0, f1585, NULL, NULL, f1586,
NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[ANIM_attack_beam_begin], 0x20, 0, f1585, NULL, NULL,
f1586, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[ANIM_attack_beam_loop], 0x10, 0, f1585, NULL, NULL,
f1586, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[ANIM_attack_beam_end], 0x20, 0, f1585, NULL, NULL,
f1586, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[ANIM_attack_wall_begin], 0x20, 0, f1585, NULL, NULL,
f1586, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[ANIM_attack_wall_loop], 0x10, 0, f1585, NULL, NULL,
f1586, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[ANIM_attack_wall_end], 0x20, 0, f1585, NULL, NULL,
f1586, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[ANIM_attack_missle], 0x20, 0, f1585, NULL, NULL,
f1586, NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[ANIM_attack_bomb], 0x20, 0, f1585, NULL, NULL, f1586,
NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);

NPCC_BuildStandardAnimTran(table, g_strz_bossanim, ourAnims, 1, f1657);

xAnimTableNewTransition(table, g_strz_bossanim[ANIM_stun_begin],
g_strz_bossanim[ANIM_stun_loop], 0, 0, 0x10, 0, f1586, f1586, 0, 0,
f1658, 0);
xAnimTableNewTransition(table, g_strz_bossanim[ANIM_stun_loop], g_strz_bossanim[ANIM_stun_end],
0, 0, 0, 0, f1586, f1586, 0, 0, f1658, 0);
xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_beam_begin],
g_strz_bossanim[ANIM_attack_beam_loop], 0, 0, 0x10, 0, f1586, f1586, 0,
0, f1658, 0);
xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_beam_begin],
g_strz_bossanim[ANIM_attack_beam_end], 0, 0, 0, 0, f1586, f1586, 0, 0,
f1658, 0);
xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_beam_loop],
g_strz_bossanim[ANIM_attack_beam_end], 0, 0, 0, 0, f1586, f1586, 0, 0,
f1658, 0);
xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_wall_begin],
g_strz_bossanim[ANIM_attack_wall_loop], 0, 0, 0x10, 0, f1586, f1586, 0,
0, f1658, 0);
xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_wall_loop],
g_strz_bossanim[ANIM_attack_wall_end], 0, 0, 0, 0, f1586, f1586, 0, 0,
f1658, 0);
xAnimTableNewTransition(table, g_strz_bossanim[ANIM_Taunt01], g_strz_bossanim[ANIM_stun_begin],
0, 0, 0, 0, f1586, f1586, 0, 0, f1658, 0);
xAnimTableNewTransition(table, g_strz_bossanim[ANIM_move], g_strz_bossanim[ANIM_stun_begin], 0,
0, 0, 0, f1586, f1586, 0, 0, f1658, 0);
xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_beam_begin],
g_strz_bossanim[ANIM_stun_begin], 0, 0, 0, 0, f1586, f1586, 0, 0, f1658,
0);
xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_beam_loop],
g_strz_bossanim[ANIM_stun_begin], 0, 0, 0, 0, f1586, f1586, 0, 0, f1658,
0);
xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_beam_end],
g_strz_bossanim[ANIM_stun_begin], 0, 0, 0, 0, f1586, f1586, 0, 0, f1658,
0);
xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_wall_begin],
g_strz_bossanim[ANIM_stun_begin], 0, 0, 0, 0, f1586, f1586, 0, 0, f1658,
0);
xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_wall_loop],
g_strz_bossanim[ANIM_stun_begin], 0, 0, 0, 0, f1586, f1586, 0, 0, f1658,
0);
xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_wall_end],
g_strz_bossanim[ANIM_stun_begin], 0, 0, 0, 0, f1586, f1586, 0, 0, f1658,
0);
xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_missle],
g_strz_bossanim[ANIM_stun_begin], 0, 0, 0, 0, f1586, f1586, 0, 0, f1658,
0);
xAnimTableNewTransition(table, g_strz_bossanim[ANIM_attack_bomb],
g_strz_bossanim[ANIM_stun_begin], 0, 0, 0, 0, f1586, f1586, 0, 0, f1658,
0);

return table;
}

void zNPCBPlankton::render_debug()
{
}
Expand Down
2 changes: 1 addition & 1 deletion src/SB/Game/zNPCTypeBossSB2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ xAnimTable* ZNPC_AnimTable_BossSB2()
// ANIM_ChopLeftLoop,
// ANIM_ChopLeftEnd,
// ANIM_ChopRightBegin, No longer needed?
// ANIM_ChopRightLoop, Was used instead of "ANIM_xxxxx;" right about new state
// ANIM_ChopRightLoop, Was used instead of "ANIM_xxxxx;" right before new state
// ANIM_ChopRightEnd,
// ANIM_SwipeLeftBegin,
// ANIM_SwipeLeftLoop,
Expand Down
119 changes: 119 additions & 0 deletions src/SB/Game/zNPCTypeBossSandy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,35 @@

extern const char bossSandyStrings[];

#define Unknown 1
#define Idle01 2
#define Idle02 3
#define Taunt01 4
#define Run01 5
#define Walk01 6
#define Melee01 7
#define Hit01 8
#define Hit02 9
#define GetUp01 10
#define Dizzy01 11
#define ElbowDrop01 12
#define Leap01 13
#define Leap02 14
#define Leap03 15
#define Leap04 16
#define Sit01 17
#define SitShock01 18
#define CLBegin01 19
#define CLLoop01 20
#define CLEnd01 21
#define NoHeadIdle01 22
#define NoHeadWaving01 23
#define NoHeadGetUp01 24
#define NoHeadShotUp01 25
#define NoHeadShock01 26
#define NoHeadReplace01 27
#define NoHeadHit01 28

extern F32 __830; // 0.0 0
extern F32 __831; // 1.0 3f800000
extern F32 __842; // 0.20000000298023224 3e4ccccd
Expand Down Expand Up @@ -129,6 +158,96 @@ void on_change_shockwave(const tweak_info& tweak)
sSandyPtr->shockRadius = __831;
}

xAnimTable* ZNPC_AnimTable_BossSandy()
{
// clang-format off
S32 ourAnims[28] = {
Unknown,
Idle01,
Idle02,
Taunt01,
Run01,
Walk01,
Melee01,
Hit01,
Hit02,
GetUp01,
Dizzy01,
ElbowDrop01,
Leap01,
Leap02,
Leap03 ,
Leap04,
Sit01,
SitShock01,
CLBegin01,
CLLoop01,
CLEnd01,
NoHeadIdle01,
NoHeadWaving01,
NoHeadGetUp01,
NoHeadShotUp01,
NoHeadShock01,
NoHeadReplace01,
NoHeadHit01,
};
// clang-format on

//Missing like 2 logic lines or something, too tired to figure it out
xAnimTable* table = xAnimTableNew("zNPCBSandy", NULL, 0);

xAnimTableNewState(table, g_strz_bossanim[Unknown], 0x10, 0x40, __831, NULL, NULL, __830, NULL,
NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[Idle02], 0x10, 0x40, __831, NULL, NULL, __830, NULL,
NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[Taunt01], 0x10, 0, __831, NULL, NULL, __830, NULL,
NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[Run01], 0x10, 0, __831, NULL, NULL, __830, NULL, NULL,
xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[Walk01], 0x10, 0, __831, NULL, NULL, __830, NULL,
NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[Dizzy01], 0x10, 0, __831, NULL, NULL, __830, NULL,
NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[ElbowDrop01], 0x10, 0, __831, NULL, NULL, __830, NULL,
NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[Leap01], 0x10, 0, __831, NULL, NULL, __830, NULL,
NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[Leap02], 0x10, 0, __831, NULL, NULL, __830, NULL,
NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[Leap03], 0x10, 0, __831, NULL, NULL, __830, NULL,
NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[Leap04], 0x10, 0, __831, NULL, NULL, __830, NULL,
NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[Sit01], 0x10, 0, __831, NULL, NULL, __830, NULL, NULL,
xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[Hit02], 0x10, 0, __831, NULL, NULL, __830, NULL, NULL,
xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[SitShock01], 0x10, 0, __831, NULL, NULL, __830, NULL,
NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[CLBegin01], 0x10, 0, __831, NULL, NULL, __830, NULL,
NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[CLLoop01], 0x10, 0, __831, NULL, NULL, __830, NULL,
NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[CLEnd01], 0x10, 0, __831, NULL, NULL, __830, NULL,
NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[NoHeadIdle01], 0x10, 0, __831, NULL, NULL, __830,
NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[NoHeadWaving01], 0x10, 0, __831, NULL, NULL, __830,
NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[NoHeadGetUp01], 0x10, 0, __831, NULL, NULL, __830,
NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[NoHeadShotUp01], 0x10, 0, __831, NULL, NULL, __830,
NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[NoHeadShock01], 0x10, 0, __831, NULL, NULL, __830,
NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_bossanim[NoHeadReplace01], 0x10, 0, __831, NULL, NULL, __830,
NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);

NPCC_BuildStandardAnimTran(table, g_strz_bossanim, ourAnims, 1, __842);

return table;
}

U32 HeadIsCarried(xAnimTransition*, xAnimSingle*, void*)
{
return globals.player.carry.grabbed == sSandyPtr->headBoulder;
Expand Down
45 changes: 45 additions & 0 deletions src/SB/Game/zNPCTypeDuplotron.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
#include "zNPCTypeDuplotron.h"
#include "zNPCTypeCommon.h"
#include "zNPCTypes.h"
#include "xMath3.h"

#include "xstransvc.h"

#define ANIM_Unk1 1
#define ANIM_Unk2 2
#define ANIM_Unk3 3 // TEMP NAMES
#define ANIM_Unk4 4
#define ANIM_UNKNOWN 5

extern U32 g_hash_dupoanim[5];
extern char* g_strz_dupoanim[5];

Expand Down Expand Up @@ -72,6 +79,38 @@ void ZNPC_Destroy_Duplotron(xFactoryInst* inst)
delete inst;
}

xAnimTable* ZNPC_AnimTable_Duplotron()
{
S32 ourAnims[5] = { //Literally no clue what the names should be.
ANIM_Unk1, ANIM_Unk2, ANIM_Unk3, ANIM_Unk4, ANIM_UNKNOWN
};

xAnimTable* table = xAnimTableNew("zNPCDupltron", NULL, 0);

xAnimTableNewState(table, g_strz_dupoanim[ANIM_Unk1], 0x10, 0, 1, NULL, NULL, 0, NULL, NULL,
xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_dupoanim[ANIM_Unk2], 0x20, 0, 1, NULL, NULL, 0, NULL,
NULL, //Needs a bit of attention
xAnimDefaultBeforeEnter, NULL,
NULL); //Only pushing cus im done with it for now
xAnimTableNewState(table, g_strz_dupoanim[ANIM_Unk3], 0x10, 0, 1, NULL, NULL, 0, NULL, NULL,
xAnimDefaultBeforeEnter, NULL, NULL);
xAnimTableNewState(table, g_strz_dupoanim[ANIM_Unk4], 0, 0, 1, NULL, NULL, 0, NULL, NULL,
xAnimDefaultBeforeEnter, NULL, NULL);

NPCC_BuildStandardAnimTran(table, g_strz_dupoanim, ourAnims, 1, 0.2);
}

void zNPCDuplotron::ParseINI()
{
zNPCCommon::ParseINI();
}

void zNPCDuplotron::BUpdate(xVec3* pos)
{
zNPCCommon::BUpdate(pos);
}

// 100% match that needs the full vtable to be filled out
// because it induces vtable generation
void zNPCDuplotron::SelfSetup()
Expand All @@ -86,6 +125,12 @@ void zNPCDuplotron::SelfSetup()
psy->SetSafety(0x4E474430);
}

S32 zNPCDuplotron::IsAlive()
{
xPsyche* psy = this->psy_instinct;
psy->GIDOfActive();
}

// non-matching: scheduling?
void DUPO_InitEffects()
{
Expand Down
6 changes: 5 additions & 1 deletion src/SB/Game/zNPCTypeDuplotron.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ struct zNPCDuplotron : zNPCCommon
zNPCDuplotron(S32 myType);

void SelfSetup();

S32 IsAlive();
void VFXSmokeStack(F32 dt);
void VFXOverheat(F32 dt, F32);
void VFXCycleLights(F32 dt, S32 fastpace);
void ParseINI();
void Reset();
void BUpdate(xVec3*);
void Process(xScene*, float);

// zNPCTypeCommon overrides
void Move(xScene*, F32 dt, xEntFrame*);
Expand Down
Loading