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
86 changes: 58 additions & 28 deletions src/SB/Game/zNPCSndLists.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
#include "zNPCSndLists.h"

// clang-format off
NPCSndProp g_sndProps[] = {
{ NPC_STYP_ENCOUNTER, 0x400, 1.0f }, { NPC_STYP_LAUGH, 0xC00, 7.0f },
{ NPC_STYP_ALERT, 0x400, 0.0f }, { NPC_STYP_CLANKING, 0x400, 0.75f },
{ NPC_STYP_RESPAWN, 0x200, 0.75f }, { NPC_STYP_WARNBANG, 0x200, 0.1f },
{ NPC_STYP_OUCH, 0x200, 0.1f }, { NPC_STYP_DIZZY, 0x200, 0.1f },
{ NPC_STYP_EXCLAIM, 0x200, 0.5f }, { NPC_STYP_CHEERING, 0xA00, 0.25f },
{ NPC_STYP_LIGHTNING, 0xA00, 0.1f }, { NPC_STYP_DANCE, 0x400, 0.2f },
{ NPC_STYP_DEATH, 0x2200, 1.0f }, { NPC_STYP_DEATHJELLY, 0x2C00, 1.0f },
{ NPC_STYP_TIKIEXPLODE, 0x400, 0.1f }, { NPC_STYP_TIKITHUNDER, 0x1A00, 0.1f },
{ NPC_STYP_ENCOUNTER, 0x400, 1.0f },
{ NPC_STYP_LAUGH, 0xC00, 7.0f },
{ NPC_STYP_ALERT, 0x400, 0.0f },
{ NPC_STYP_CLANKING, 0x400, 0.75f },
{ NPC_STYP_RESPAWN, 0x200, 0.75f },
{ NPC_STYP_WARNBANG, 0x200, 0.1f },
{ NPC_STYP_OUCH, 0x200, 0.1f },
{ NPC_STYP_DIZZY, 0x200, 0.1f },
{ NPC_STYP_EXCLAIM, 0x200, 0.5f },
{ NPC_STYP_CHEERING, 0xA00, 0.25f },
{ NPC_STYP_LIGHTNING, 0xA00, 0.1f },
{ NPC_STYP_DANCE, 0x400, 0.2f },
{ NPC_STYP_DEATH, 0x2200, 1.0f },
{ NPC_STYP_DEATHJELLY, 0x2C00, 1.0f },
{ NPC_STYP_TIKIEXPLODE, 0x400, 0.1f },
{ NPC_STYP_TIKITHUNDER, 0x1A00, 0.1f },
{ NPC_STYP_LISTEND, 0x200, -1.0f },
};
NPCSndTrax g_sndTrax_Universal[] = {
Expand Down Expand Up @@ -47,19 +56,30 @@ NPCSndTrax g_sndTrax_Villager[] = {
{ NPC_STYP_LISTEND, NULL, 0 },
};
NPCSndTrax g_sndTrax_Squidward[] = {
{ NPC_STYP_EXCLAIM, "clarinet_1", 0 }, { NPC_STYP_EXCLAIM, "clarinet_2", 0 },
{ NPC_STYP_EXCLAIM, "clarinet_3", 0 }, { NPC_STYP_EXCLAIM, "clarinet_4", 0 },
{ NPC_STYP_EXCLAIM, "clarinet_5", 0 }, { NPC_STYP_LISTEND, NULL, 0 },
{ NPC_STYP_EXCLAIM, "clarinet_1", 0 },
{ NPC_STYP_EXCLAIM, "clarinet_2", 0 },
{ NPC_STYP_EXCLAIM, "clarinet_3", 0 },
{ NPC_STYP_EXCLAIM, "clarinet_4", 0 },
{ NPC_STYP_EXCLAIM, "clarinet_5", 0 },
{ NPC_STYP_LISTEND, NULL, 0 },
};
NPCSndTrax g_sndTrax_VillagerCoStar[] = {
{ NPC_STYP_EXCLAIM, "Bounce", 0 }, { NPC_STYP_EXCLAIM, "Bowl_hitplate", 0 },
{ NPC_STYP_EXCLAIM, "Bump_beep1", 0 }, { NPC_STYP_EXCLAIM, "Bump_hit1", 0 },
{ NPC_STYP_EXCLAIM, "Bump_hit2", 0 }, { NPC_STYP_EXCLAIM, "Bus_dooropen", 0 },
{ NPC_STYP_EXCLAIM, "CarAlarm", 0 }, { NPC_STYP_EXCLAIM, "Check1", 0 },
{ NPC_STYP_EXCLAIM, "Gate_hit2", 0 }, { NPC_STYP_EXCLAIM, "Metal_tube_hit", 0 },
{ NPC_STYP_EXCLAIM, "NPC_GL_jump", 0 }, { NPC_STYP_EXCLAIM, "Pop_in", 0 },
{ NPC_STYP_EXCLAIM, "Pop_out", 0 }, { NPC_STYP_EXCLAIM, "Sailflap", 0 },
{ NPC_STYP_EXCLAIM, "SlapLeaf_hit", 0 }, { NPC_STYP_LISTEND, NULL, 0 },
{ NPC_STYP_EXCLAIM, "Bounce", 0 },
{ NPC_STYP_EXCLAIM, "Bowl_hitplate", 0 },
{ NPC_STYP_EXCLAIM, "Bump_beep1", 0 },
{ NPC_STYP_EXCLAIM, "Bump_hit1", 0 },
{ NPC_STYP_EXCLAIM, "Bump_hit2", 0 },
{ NPC_STYP_EXCLAIM, "Bus_dooropen", 0 },
{ NPC_STYP_EXCLAIM, "CarAlarm", 0 },
{ NPC_STYP_EXCLAIM, "Check1", 0 },
{ NPC_STYP_EXCLAIM, "Gate_hit2", 0 },
{ NPC_STYP_EXCLAIM, "Metal_tube_hit", 0 },
{ NPC_STYP_EXCLAIM, "NPC_GL_jump", 0 },
{ NPC_STYP_EXCLAIM, "Pop_in", 0 },
{ NPC_STYP_EXCLAIM, "Pop_out", 0 },
{ NPC_STYP_EXCLAIM, "Sailflap", 0 },
{ NPC_STYP_EXCLAIM, "SlapLeaf_hit", 0 },
{ NPC_STYP_LISTEND, NULL, 0 },
};
NPCSndTrax g_sndTrax_VillagerMale[] = {
{ NPC_STYP_LISTEND, NULL, 0 },
Expand Down Expand Up @@ -114,9 +134,12 @@ NPCSndTrax g_sndTrax_Fodder[] = {
{ NPC_STYP_LISTEND, NULL, 0 },
};
NPCSndTrax g_sndTrax_FodBomb[] = {
{ NPC_STYP_DEATH, "Fod_destroy", 0 }, { NPC_STYP_ALERT, "Fod3_alert", 0 },
{ NPC_STYP_WARNBANG, "Fod3_alert", 0 }, { NPC_STYP_ATTACK, "Fod3_attack", 0 },
{ NPC_STYP_OUCH, "Fod_hit", 0 }, { NPC_STYP_LISTEND, NULL, 0 },
{ NPC_STYP_DEATH, "Fod_destroy", 0 },
{ NPC_STYP_ALERT, "Fod3_alert", 0 },
{ NPC_STYP_WARNBANG, "Fod3_alert", 0 },
{ NPC_STYP_ATTACK, "Fod3_attack", 0 },
{ NPC_STYP_OUCH, "Fod_hit", 0 },
{ NPC_STYP_LISTEND, NULL, 0 },
};
NPCSndTrax g_sndTrax_FodBzzt[] = {
{ NPC_STYP_OUCH, "Fod_hit", 0 },
Expand Down Expand Up @@ -155,8 +178,10 @@ NPCSndTrax g_sndTrax_Sleepy[] = {
{ NPC_STYP_LISTEND, NULL, 0 },
};
NPCSndTrax g_sndTrax_Chuck[] = {
{ NPC_STYP_ALERT, "Chu_alert", 0 }, { NPC_STYP_WEPLAUNCH, "Chu_cock", 0 },
{ NPC_STYP_ATTACK, "Chu_throw", 0 }, { NPC_STYP_OUCH, "Fod_hit", 0 },
{ NPC_STYP_ALERT, "Chu_alert", 0 },
{ NPC_STYP_WEPLAUNCH, "Chu_cock", 0 },
{ NPC_STYP_ATTACK, "Chu_throw", 0 },
{ NPC_STYP_OUCH, "Fod_hit", 0 },
{ NPC_STYP_LISTEND, NULL, 0 },
};
NPCSndTrax g_sndTrax_ArfArf[] = {
Expand All @@ -171,13 +196,17 @@ NPCSndTrax g_sndTrax_ArfDog[] = {
{ NPC_STYP_LISTEND, NULL, 0 },
};
NPCSndTrax g_sndTrax_Tubelet[] = {
{ NPC_STYP_ALERT, "Tube_alert", 0 }, { NPC_STYP_UNBONKED, "Tube_spawn", 0 },
{ NPC_STYP_BONKED, "Tube_pop", 0 }, { NPC_STYP_WARNBANG, "Tube_pop", 0 },
{ NPC_STYP_ALERT, "Tube_alert", 0 },
{ NPC_STYP_UNBONKED, "Tube_spawn", 0 },
{ NPC_STYP_BONKED, "Tube_pop", 0 },
{ NPC_STYP_WARNBANG, "Tube_pop", 0 },
{ NPC_STYP_LISTEND, NULL, 0 },
};
NPCSndTrax g_sndTrax_Slick[] = {
{ NPC_STYP_ALERT, "Slk_alert1", 0 }, { NPC_STYP_DIZZY, "Slk_hit1", 0 },
{ NPC_STYP_OUCH, "Slk_hit2", 0 }, { NPC_STYP_ATTACK, "Slk_attack1", 0 },
{ NPC_STYP_ALERT, "Slk_alert1", 0 },
{ NPC_STYP_DIZZY, "Slk_hit1", 0 },
{ NPC_STYP_OUCH, "Slk_hit2", 0 },
{ NPC_STYP_ATTACK, "Slk_attack1", 0 },
{ NPC_STYP_LISTEND, NULL, 0 },
};
NPCSndTrax g_sndTrax_KingJelly[] = {
Expand All @@ -189,6 +218,7 @@ NPCSndTrax g_sndTrax_Dutchman[] = {
NPCSndTrax g_sndTrax_BossSandy[] = {
{ NPC_STYP_LISTEND, NULL, 0 },
};
// clang-format on

// leftovers from the dwarf
//NPCSndTrax g_sndTrax_Prawn[] = { { NPC_STYP_LISTEND, NULL, 0 }, };
Expand Down
36 changes: 36 additions & 0 deletions src/SB/Game/zNPCSndLists.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,40 @@ struct NPCSndTrax
U32 aid_sound;
};

extern NPCSndProp g_sndProps[];
extern NPCSndTrax g_sndTrax_Universal[];
extern NPCSndTrax g_sndTrax_General[];
extern NPCSndTrax g_sndTrax_Villager[];
extern NPCSndTrax g_sndTrax_Squidward[];
extern NPCSndTrax g_sndTrax_VillagerCoStar[];
extern NPCSndTrax g_sndTrax_VillagerMale[];
extern NPCSndTrax g_sndTrax_VillagerFemale[];
extern NPCSndTrax g_sndTrax_VillagerElder[];
extern NPCSndTrax g_sndTrax_VillagerEldess[];
extern NPCSndTrax g_sndTrax_VillagerBoy[];
extern NPCSndTrax g_sndTrax_VillagerGirl[];
extern NPCSndTrax g_sndTrax_Neptune[];
extern NPCSndTrax g_sndTrax_Jelly[];
extern NPCSndTrax g_sndTrax_TikiShared[];
extern NPCSndTrax g_sndTrax_TikiThunder[];
extern NPCSndTrax g_sndTrax_Duplotron[];
extern NPCSndTrax g_sndTrax_Robot[];
extern NPCSndTrax g_sndTrax_Fodder[];
extern NPCSndTrax g_sndTrax_FodBomb[];
extern NPCSndTrax g_sndTrax_FodBzzt[];
extern NPCSndTrax g_sndTrax_Chomper[];
extern NPCSndTrax g_sndTrax_Hammer[];
extern NPCSndTrax g_sndTrax_TarTar[];
extern NPCSndTrax g_sndTrax_Glove[];
extern NPCSndTrax g_sndTrax_Monsoon[];
extern NPCSndTrax g_sndTrax_Sleepy[];
extern NPCSndTrax g_sndTrax_Chuck[];
extern NPCSndTrax g_sndTrax_ArfArf[];
extern NPCSndTrax g_sndTrax_ArfDog[];
extern NPCSndTrax g_sndTrax_Tubelet[];
extern NPCSndTrax g_sndTrax_Slick[];
extern NPCSndTrax g_sndTrax_KingJelly[];
extern NPCSndTrax g_sndTrax_Dutchman[];
extern NPCSndTrax g_sndTrax_BossSandy[];

#endif
20 changes: 9 additions & 11 deletions src/SB/Game/zNPCSndTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ static char* g_strz_sndgroup[26];
static unsigned int g_hash_sndgroup[26];
static float g_tmrz_sndplay[26];

NPCSndProp g_sndProps[];

void NPCS_Startup()
{
for (int i = 0; i < (int)(sizeof(g_strz_sndgroup) / sizeof(char*)); i++)
Expand Down Expand Up @@ -42,15 +40,15 @@ void NPCS_SndTypePlayed(en_NPC_SOUND sndtype, float delayNext)

switch (sndtype)
{
case NPC_STYP_TIKISTACK:
tym = 0.15f;
break;
case NPC_STYP_TIKIEXPLODE:
tym = 2.0f;
break;
default:
tym = -1.0f;
break;
case NPC_STYP_TIKISTACK:
tym = 0.15f;
break;
case NPC_STYP_TIKIEXPLODE:
tym = 2.0f;
break;
default:
tym = -1.0f;
break;
}

if (delayNext > 0.0f)
Expand Down
40 changes: 32 additions & 8 deletions src/SB/Game/zNPCSupplement.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "xPtankPool.h"
#include "xVec3.h"

#include "zLightning.h"
#include <types.h>
#include <rwplcore.h>
#include <rwcore.h>
Expand Down Expand Up @@ -43,7 +44,8 @@ enum en_npcstreak
NPC_STRK_FORCE = 0x7fffffff
};

enum en_nparmode {
enum en_nparmode
{
NPAR_MODE_STD = 0,
NPAR_MODE_ALT_A = 1,
NPAR_MODE_ALT_B = 2,
Expand Down Expand Up @@ -74,6 +76,20 @@ enum en_nparmode {
NPAR_MODE_NOMORE = 4,
};

enum en_npclyt
{
NPC_LYT_PLACEHOLDER = 0,
NPC_LYT_JELLYFISH = 1,
NPC_LYT_JELLYFISHBLUE = 2,
NPC_LYT_CATTLEPROD = 3,
NPC_LYT_TIKITHUNDER = 4,
NPC_LYT_CLOUDWARN = 5,
NPC_LYT_CLOUDZAP = 6,
NPC_LYT_SLEEPYARC = 7,
NPC_LYT_NOMORE = 8,
NPC_LYT_FORCE = 2147483647,
};

struct NPARData
{
xVec3 pos;
Expand All @@ -97,7 +113,8 @@ struct NPARXtraData
{
};

class NPARParmVisSplash {
class NPARParmVisSplash
{
// total size: 0x20
public:
F32 tym_lifespan; // offset 0x0, size 0x4
Expand All @@ -109,7 +126,8 @@ class NPARParmVisSplash {
void ConfigPar(NPARData* par, en_nparmode pmod, const xVec3* pos, const xVec3* vel) const;
};

class NPARParmTarTarGunk {
class NPARParmTarTarGunk
{
// total size: 0x28
public:
F32 tym_lifespan; // offset 0x0, size 0x4
Expand All @@ -124,7 +142,8 @@ class NPARParmTarTarGunk {
void ConfigPar(NPARData*, en_nparmode, const xVec3*, const xVec3*) const;
};

class NPARParmFahrwerkz {
class NPARParmFahrwerkz
{
// total size: 0x28
public:
F32 tym_lifespan; // offset 0x0, size 0x4
Expand All @@ -139,7 +158,8 @@ class NPARParmFahrwerkz {
void ConfigPar(NPARData*, en_nparmode, const xVec3*, const xVec3*) const;
};

class NPARParmSleepyZeez {
class NPARParmSleepyZeez
{
// total size: 0x28
public:
F32 tym_lifespan; // offset 0x0, size 0x4
Expand All @@ -154,7 +174,8 @@ class NPARParmSleepyZeez {
void ConfigPar(NPARData*, en_nparmode, const xVec3*, const xVec3*) const;
};

class NPARParmDogBreath {
class NPARParmDogBreath
{
// total size: 0x20
public:
F32 tym_lifespan; // offset 0x0, size 0x4
Expand All @@ -167,7 +188,8 @@ class NPARParmDogBreath {
void ConfigPar(NPARData* par, en_nparmode pmod, const xVec3* pos, const xVec3* vel) const;
};

class NPARParmGloveDust {
class NPARParmGloveDust
{
// total size: 0x1C
public:
F32 tym_lifespan; // offset 0x0, size 0x4
Expand Down Expand Up @@ -216,7 +238,8 @@ class NPARParmTubeSpiral
void ConfigPar(NPARData*, en_nparmode, const xVec3*, const xVec3*, F32 dt) const;
};

class NPARParmChuckSplash {
class NPARParmChuckSplash
{
// total size: 0x20
public:
F32 tym_lifespan; // offset 0x0, size 0x4
Expand Down Expand Up @@ -278,6 +301,7 @@ void NPCSupplement_SceneFinish();
void NPCSupplement_SceneReset();
void NPCSupplement_ScenePostInit();
void NPCSupplement_Timestep(F32 dt);
void NPCC_MakeLightningInfo(en_npclyt style, _tagLightningAdd* info);
void NPAR_ScenePrepare();
void NPAR_SceneFinish();
void NPAR_EmitTarTarTrail(const xVec3*, const xVec3*);
Expand Down
19 changes: 9 additions & 10 deletions src/SB/Game/zNPCTypeAmbient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "zGlobals.h"
#include "zNPCGoalAmbient.h"
#include "zNPCSndLists.h"
#include "zNPCTypeAmbient.h"
#include "zNPCTypes.h"
#include <xutil.h>
Expand All @@ -14,13 +15,11 @@

extern char* g_strz_ambianim[12];
extern S32 g_hash_ambianim[12];
extern NPCSndTrax g_sndTrax_Jelly[4];
extern zGlobals globals;
extern F32 zNPCTypeAmbientx40600000;
extern F32 zNPCTypeAmbientx405f66f3;
extern F32 zNPCTypeAmbientx3f400000;
extern F32 zNPCTypeAmbientx3edf66f3;
extern NPCSndTrax g_sndTrax_Neptune;
extern F32 _882;
extern F32 _883;

Expand Down Expand Up @@ -230,20 +229,20 @@ void zNPCJelly::ParseINI()
selfType = xNPCBasic::SelfType();
if (selfType == NPC_TYPE_JELLYBLUE)
{
cfg_npc->spd_moveMax = zNPCTypeAmbientx40600000;
cfg_npc->spd_turnMax = zNPCTypeAmbientx405f66f3;
cfg_npc->spd_moveMax = 3.5f; //zNPCTypeAmbientx40600000;
cfg_npc->spd_turnMax = 3.4906585f; //zNPCTypeAmbientx405f66f3;
}
else if (selfType == NPC_TYPE_JELLYPINK)
{
if (globals.sceneCur->sceneID == 'JF04') //DAT_803c2518 is globals.sceneCur->sceneID
{
cfg_npc->spd_moveMax = zNPCTypeAmbientx40600000;
cfg_npc->spd_turnMax = zNPCTypeAmbientx405f66f3;
cfg_npc->spd_moveMax = 3.5f; //zNPCTypeAmbientx40600000;
cfg_npc->spd_turnMax = 3.4906585f; //zNPCTypeAmbientx405f66f3;
}
else
{
cfg_npc->spd_moveMax = zNPCTypeAmbientx3f400000;
cfg_npc->spd_turnMax = zNPCTypeAmbientx3edf66f3;
cfg_npc->spd_moveMax = 0.75f; //zNPCTypeAmbientx3f400000;
cfg_npc->spd_turnMax = 0.43633232f; //zNPCTypeAmbientx3edf66f3;
}
}
}
Expand Down Expand Up @@ -396,8 +395,8 @@ void zNPCNeptune::ParseINI()
{
zNPCAmbient::ParseINI();
cfg_npc->snd_traxShare = NULL;
cfg_npc->snd_trax = &g_sndTrax_Neptune;
NPCS_SndTablePrepare(&g_sndTrax_Neptune);
cfg_npc->snd_trax = g_sndTrax_Neptune;
NPCS_SndTablePrepare(g_sndTrax_Neptune);
}

void zNPCNeptune::Reset()
Expand Down
Loading