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
4 changes: 2 additions & 2 deletions src/SB/Game/zNPCGoals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void zNPCGoals_RegisterTypes(xFactory* fac)
NPC_GOAL_TALK, GOALCreate_Villager, GOALDestroy_Goal,
NPC_GOAL_CHATTER, GOALCreate_Villager, GOALDestroy_Goal,
NPC_GOAL_SPEAK, GOALCreate_Villager, GOALDestroy_Goal,
NPC_GOAL_BALLOON, GOALCreate_Villager, GOALDestroy_Goal,
NPC_GOAL_BALLOON, GOALCreate_Villager, GOALDestroy_Goal, //0x533e
NPC_GOAL_BOYRIDE, GOALCreate_Villager, GOALDestroy_Goal,
NPC_GOAL_BOYFALL, GOALCreate_Villager, GOALDestroy_Goal,
NPC_GOAL_BOYWEEP, GOALCreate_Villager, GOALDestroy_Goal,
Expand Down Expand Up @@ -201,4 +201,4 @@ void zNPCGoals_RegisterTypes(xFactory* fac)
// clang-format on

fac->RegItemType(typelist);
}
}
105 changes: 105 additions & 0 deletions src/SB/Game/zNPCTypeVillager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ void zNPCVillager::Init(xEntAsset* asset)
// this->psy_instinct->GoalSet(NPC_GOAL_IDLE, 1);
// }
// }
void zNPCVillager::Reset()
{
}

void zNPCVillager::ParseINI()
{
Expand Down Expand Up @@ -374,6 +377,10 @@ void zNPCVillager::TossMyConverse()
converse = 0;
}

void zNPCFish::Reset()
{
}

void zNPCFish::ParseINI()
{
zNPCVillager::ParseINI();
Expand Down Expand Up @@ -436,6 +443,104 @@ void zNPCMerManChair::Init(xEntAsset*) //Seems to load an extra value?
flg_vuln = flg_vuln & 0x9effffff;
}

void zNPCNewsFish::SpeakStop()
{
S32 tempvar = zNPCNewsFish::IsTalking();
if (tempvar != 0)
{
xSndStop(soundHandle);
}
currSoundID = 0;
nextSoundID = 0;
soundHandle = 0;
jawData = 0;
}

S32 zNPCNewsFish::IsTalking()
{
return (soundHandle) ? xSndIsPlayingByHandle(soundHandle) : false;
}

void zNPCNewsFish::TalkOnScreen(S32 talkOnScreen)
{
if (talkOnScreen != 0)
{
newsfishFlags = newsfishFlags | 1;
return;
}
newsfishFlags = newsfishFlags & 0xfffffffe;
return;
}

void zNPCNewsFish::reset_said()
{
//
}

void zNPCSandyBikini::Reset() //100% code match
{
zNPCVillager::Reset();
tmr_leakCycle = 0.0;
}

void zNPCSandyBikini::Process(xScene* xscn, float dt) //100% code match
{
zNPCVillager::Process(xscn, dt);
zNPCSandyBikini::VFXLeakyFaucet(dt);
}

void zNPCBalloonBoy::Init(xEntAsset* asset) //68%
{
zNPCFish::Init(asset);
rast_shadBalloon = 0;
bound.type = 0;

//cg_npc 0x1d8
//bound.type 0x84
}

void zNPCBalloonBoy::SelfSetup() //100% code match
{
xPsyche* psy;
zNPCFish::SelfSetup();
psy = psy_instinct;
psy->BrainExtend();
zNPCBalloonBoy::AddBallooning(psy);
psy->BrainEnd();
}

void zNPCBalloonBoy::Render()
{
xNPCBasic::Render();
zNPCBalloonBoy::PlatShadRend();
}

void zNPCBalloonBoy::AddBallooning(xPsyche* psy)
{
psy->AddGoal(NPC_GOAL_BALLOON, NULL);
psy->AddGoal(NPC_GOAL_BOYRIDE, NULL);
psy->AddGoal(NPC_GOAL_BOYFALL, NULL);
psy->AddGoal(NPC_GOAL_BOYWEEP, NULL);
psy->AddGoal(NPC_GOAL_BOYSWIM, NULL);
}

void zNPCBalloonBoy::PlatAnimSet(en_BBOY_PLATANIM platanim)
{
F32 fvals[4];
}

void zNPCBalloonBoy::PlatAnimSync()
{
zNPCCommon::AnimCurState();
}

void zNPCBubbleBuddy::Reset() // possible scheduling meme?
{
zNPCFish::Reset();
// flags = flags | 0x40;
flags |= 0x40;
}

void ztaskbox::callback::on_talk_start()
{
}
Expand Down
27 changes: 21 additions & 6 deletions src/SB/Game/zNPCTypeVillager.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,15 @@ struct zNPCFish : zNPCVillager
void ParseINI();
void FishSoundTables();
void CheckDoChat();
void Reset();
void SelfSetup();
};

struct zNPCBubbleBuddy : zNPCFish
{
zNPCBubbleBuddy(S32 myType);

void Reset();
};

enum en_BBOY_PLATANIM
Expand All @@ -72,18 +76,27 @@ struct zNPCBalloonBoy : zNPCFish
S32 specialBalloon;
zPlatform* plat_balloons;
xShadowCache* shadCache;
RwRaster* rast_shadBalloon;

zNPCBalloonBoy(S32 myType);

void Init(xEntAsset* asset);
void SelfSetup();
void Render();
void PlatShadRend();
void AddBallooning(xPsyche* psy);
void PlatAnimSet(en_BBOY_PLATANIM anim);
void PlatAnimSync();
};

struct zNPCSandyBikini : zNPCVillager
{
F32 tmr_leakCycle;
F32 tmr_leakCycle; //0xac

zNPCSandyBikini(S32 myType);
void Reset();
void Process(xScene* xscn, float dt);
void VFXLeakyFaucet(float dt);
};

struct zNPCMerManChair : zNPCVillager
Expand All @@ -107,12 +120,12 @@ struct zNPCNewsFish : zNPCVillager

say_data said[71];
U8 was_reset;
U32 soundHandle;
U32 currSoundID;
U32 nextSoundID;
F32 jawTime;
U32 soundHandle; //0x4ec
U32 currSoundID; //0x4f0
U32 nextSoundID; //0x4f4
F32 jawTime; //0x4f8
void* jawData;
U32 newsfishFlags;
U32 newsfishFlags; //0x500
xVec2 onScreenCoords;
xVec2 offScreenCoords;
xVec2 screenCoords;
Expand All @@ -121,6 +134,8 @@ struct zNPCNewsFish : zNPCVillager
F32 appearSpeed;
F32 disappearSpeed;
F32 screenLerp;
S32 IsTalking();
void reset_said();

zNPCNewsFish(S32 myType);

Expand Down