diff --git a/src/SB/Game/zNPCFXCinematic.cpp b/src/SB/Game/zNPCFXCinematic.cpp index 1cd92f044..55d859e50 100644 --- a/src/SB/Game/zNPCFXCinematic.cpp +++ b/src/SB/Game/zNPCFXCinematic.cpp @@ -49,7 +49,7 @@ void NCIN_Par_BPLANK_JET_1_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 param) F32& float_accum = fxrec->pos_A[1].y; - if (float_accum < 0.0f) + if (float_accum < 0.0f) { U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0]; float_accum = 20.0f + val; @@ -87,7 +87,7 @@ void NCIN_Par_BPLANK_JET_2_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 param) F32& float_accum = fxrec->pos_A[1].y; - if (float_accum < 0.0f) + if (float_accum < 0.0f) { U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0]; float_accum = 20.0f + val; @@ -125,7 +125,7 @@ void NCIN_Par_BPLANK_SBB_FLAMES_1_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 F32& float_accum = fxrec->pos_A[1].y; - if (float_accum < 0.0f) + if (float_accum < 0.0f) { U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0]; float_accum = 20.0f + val; @@ -163,7 +163,7 @@ void NCIN_Par_BPLANK_SBB_FLAMES_2_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 F32& float_accum = fxrec->pos_A[1].y; - if (float_accum < 0.0f) + if (float_accum < 0.0f) { U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0]; float_accum = 20.0f + val; @@ -201,7 +201,7 @@ void NCIN_Par_BPLANK_SBB_JET_1_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 pa F32& float_accum = fxrec->pos_A[1].y; - if (float_accum < 0.0f) + if (float_accum < 0.0f) { U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0]; float_accum = 20.0f + val; @@ -239,7 +239,7 @@ void NCIN_Par_BPLANK_SBB_JET_2_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 pa F32& float_accum = fxrec->pos_A[1].y; - if (float_accum < 0.0f) + if (float_accum < 0.0f) { U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0]; float_accum = 20.0f + val; @@ -277,7 +277,7 @@ void NCIN_Par_BPLANK_SBB_SMOKE_1_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 F32& float_accum = fxrec->pos_A[1].y; - if (float_accum < 0.0f) + if (float_accum < 0.0f) { U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0]; float_accum = 20.0f + val; @@ -315,7 +315,7 @@ void NCIN_Par_BPLANK_SBB_SMOKE_2_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 F32& float_accum = fxrec->pos_A[1].y; - if (float_accum < 0.0f) + if (float_accum < 0.0f) { U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0]; float_accum = 20.0f + val; @@ -353,7 +353,7 @@ void NCIN_Par_CIN_BIGDUP_SMOKE_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 pa F32& float_accum = fxrec->pos_A[1].y; - if (float_accum < 0.0f) + if (float_accum < 0.0f) { U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0]; float_accum = 20.0f + val; @@ -391,7 +391,7 @@ void NCIN_Par_CIN_BIGDUP_SPAWN_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 pa F32& float_accum = fxrec->pos_A[1].y; - if (float_accum < 0.0f) + if (float_accum < 0.0f) { U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0]; float_accum = 20.0f + val; @@ -429,7 +429,7 @@ void NCIN_Par_CIN_PLATFORM_JETS_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 p F32& float_accum = fxrec->pos_A[1].y; - if (float_accum < 0.0f) + if (float_accum < 0.0f) { U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0]; float_accum = 20.0f + val; @@ -457,7 +457,7 @@ void NCIN_BubSlam(const zCutsceneMgr*, NCINEntry* fxrec, S32 param) if (!(fxrec->flg_stat & 2)) { - return; + return; } switch (fxrec->typ_ncinfx) @@ -557,6 +557,138 @@ void NCIN_HammerShock(const zCutsceneMgr*, NCINEntry* fxrec, S32 param) } } +void NCIN_HammerStreak_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 param) +{ + if (param != 0) + { + fxrec->flg_stat |= 4; + + xFXStreakStop(fxrec->fxdata.strkdata.sid_horz); + xFXStreakStop(fxrec->fxdata.strkdata.sid_vert); + + fxrec->fxdata.strkdata.sid_horz = 57005; + fxrec->fxdata.strkdata.sid_vert = 57005; + + return; + } + + if (fxrec->flg_stat & 2) + { + en_npcstreak styp_h = NPC_STRK_HAMMERSMASH_HORZ; + en_npcstreak styp_v = NPC_STRK_HAMMERSMASH_VERT; + + fxrec->fxdata.strkdata.sid_horz = NPCC_StreakCreate(styp_h); + fxrec->fxdata.strkdata.sid_vert = NPCC_StreakCreate(styp_v); + } +} + +void NCIN_HammerStreak_AR(const zCutsceneMgr*, NCINEntry* fxrec, RpAtomic*, RwMatrixTag*, U32 num_1, + U32 num_2) +{ + if (num_2 != 2) + { + return; + } + + U32 sid_vert = fxrec->fxdata.strkdata.sid_vert; + U32 sid_horz = fxrec->fxdata.strkdata.sid_horz; +} + +void NCIN_WaterSplash(const zCutsceneMgr*, NCINEntry* fxrec, S32 param) +{ + if (param != 0) + { + fxrec->flg_stat |= 4; + return; + } + + if (fxrec->flg_stat & 2) + { + const F32 splash_radius = -1.0f; + + NPCC_MakeASplash(&fxrec->pos_A[0], splash_radius); + fxrec->flg_stat |= 4; + } +} + +void NCIN_HazProjShoot(const zCutsceneMgr* mgr, NCINEntry* fxrec, S32 param) +{ + if (param != 0) + { + fxrec->flg_stat |= 4; + + if (fxrec->fxdata.hazdata.npchaz->flg_hazard) + { + fxrec->fxdata.hazdata.npchaz->MarkForRecycle(); + } + return; + } + + if (fxrec->flg_stat & 2) + { + S32 type = fxrec->fxdata.hazdata.npchaz->typ_hazard; + S32 haztype = 10; + + if (type == 11) + { + haztype = 18; + } + else if (type >= 10 && type < 13) + { + haztype = (type == 12) ? 16 : 10; + } + + NPCHazard* haz = HAZ_Acquire(); + + if (!haz) + { + return; + } + + if (!haz->ConfigHelper((en_npchaz)haztype)) + { + return; + } + + haz->SetNPCOwner(NULL); + fxrec->fxdata.hazdata.npchaz = haz; + haz->flg_hazard &= ~128; + + xVec3 delta = fxrec->pos_B[0] - fxrec->pos_A[0]; + F32 len = delta.length(); + + F32 height = fxrec->tym_beg - fxrec->tym_end; + + if (height < 0.01f) + { + height = 1.0f; + } + + haz->pos_hazard = delta; + haz->Start(&fxrec->pos_A[0], height); + } + + if (fxrec->fxdata.hazdata.npchaz) + { + if (fxrec->fxdata.hazdata.npchaz->typ_hazard != 11) + { + fxrec->fxdata.hazdata.npchaz->flg_hazard &= ~0xF000; + } + else + { + fxrec->flg_stat |= 4; + } + } +} + +void NCIN_HazTTSteam_Upd(const zCutsceneMgr* manager, NCINEntry* fxrec, S32 param) +{ +} + +void NCIN_HazTTSteam_AR(const zCutsceneMgr* cutsceneMgr, NCINEntry* fxrec, RpAtomic* atomic, + RwMatrixTag* matrix, U32 num_1, U32 num_2) +{ +} void clamp_bone_index(NCINEntry*, RpAtomic*) { @@ -570,7 +702,7 @@ void NPCCone::TextureSet(RwRaster* raster) void NPCCone::UVSliceSet(F32 u, F32 v) { this->uv_tip[2] = u; - this->uv_slice[1] = v; + this->uv_slice[1] = v; } void NPCCone::UVBaseSet(F32 u, F32 v) @@ -594,4 +726,3 @@ void NPARMgmt::KillAll() { this->cnt_active = 0; } - diff --git a/src/SB/Game/zNPCFXCinematic.h b/src/SB/Game/zNPCFXCinematic.h index bca187829..361788736 100644 --- a/src/SB/Game/zNPCFXCinematic.h +++ b/src/SB/Game/zNPCFXCinematic.h @@ -3,6 +3,7 @@ #include #include "zCutsceneMgr.h" +#include "zNPCSupplement.h" #include "xVec3.h" #include "zLightning.h" #include "zNPCHazard.h" @@ -17,55 +18,6 @@ S32 zNPCFXCutscenePrep(const xScene*, F32, const zCutsceneMgr* csnmgr); void zNPCFXCutscene(const xScene*, F32, const zCutsceneMgr* csnmgr); void zNPCFXCutsceneDone(const xScene*, F32, const zCutsceneMgr* csnmgr); -enum en_nparptyp -{ - NPAR_TYP_UNKNOWN, - NPAR_TYP_OILBUB, - NPAR_TYP_TUBESPIRAL, - NPAR_TYP_TUBECONFETTI, - NPAR_TYP_GLOVEDUST , - NPAR_TYP_MONSOONRAIN, - NPAR_TYP_SLEEPYZEEZ, - NPAR_TYP_CHUCKSPLASH, - NPAR_TYP_TARTARGUNK, - NPAR_TYP_DOGBREATH, - NPAR_TYP_VISSPLASH, - NPAR_TYP_FIREWORKS, - NPAR_TYP_NOMORE, - NPAR_TYP_FORCE = 2147483647 -}; - -struct NPARData -{ - xVec3 pos; - F32 xy_size[2]; - F32 uv_tl[2]; - F32 uv_br[2]; - RwRGBA color; - F32 tmr_remain; - F32 tym_exist; - F32 fac_abuse; - xVec3 vel; - S32 flg_popts : 24; - S32 nparmode : 8; - F32 unused[3]; -}; - -struct NPARXtraData -{ -}; - -struct NPARMgmt -{ - en_nparptyp typ_npar; - S32 flg_npar; - NPARData * par_buf; - S32 cnt_active; - S32 num_max; - RwTexture * txtr; - NPARXtraData * xtra_data; - void KillAll(); -}; struct NCINLyt { diff --git a/src/SB/Game/zNPCSupplement.h b/src/SB/Game/zNPCSupplement.h index 0530486a8..55873a3c6 100644 --- a/src/SB/Game/zNPCSupplement.h +++ b/src/SB/Game/zNPCSupplement.h @@ -76,6 +76,7 @@ struct NPARMgmt RwTexture* txtr; NPARXtraData* xtra_data; void** user_data; + void KillAll(); void Init(en_nparptyp parType, void** userData, NPARXtraData* xtraData); void Clear(); diff --git a/src/SB/Game/zTalkBox.h b/src/SB/Game/zTalkBox.h index 7772d2aed..b7ae4c526 100644 --- a/src/SB/Game/zTalkBox.h +++ b/src/SB/Game/zTalkBox.h @@ -84,10 +84,11 @@ struct ztalkbox : xBase static void update_all(xScene& s, F32 dt); static void render_all(); static void reset_all(); + static void clear_layout(); static void permit(U32 add_flags, U32 remove_flags); + static ztalkbox* get_active(); - static ztalkbox* get_active(); void start_talk(U32 textID, callback*, zNPCCommon*); // FIXME: params not verified void stop_talk();