Merge pull request #546 from SuperDude88/ghostship

d_a_ghostship Mostly Done
This commit is contained in:
Jasper St. Pierre
2023-12-03 19:04:54 -08:00
committed by GitHub
9 changed files with 653 additions and 118 deletions
+2 -2
View File
@@ -1309,7 +1309,7 @@ config.libs = [
ActorRel(NonMatching, "d_a_tag_ba1"),
ActorRel(NonMatching, "d_a_tag_event"),
ActorRel(NonMatching, "d_a_tag_evsw"),
ActorRel(NonMatching, "d_a_tag_ghostship"),
ActorRel(Matching, "d_a_tag_ghostship"),
ActorRel(NonMatching, "d_a_tag_hint"),
ActorRel(Matching, "d_a_tag_kb_item"),
ActorRel(NonMatching, "d_a_tag_kk1"),
@@ -1619,7 +1619,7 @@ config.libs = [
ActorRel(NonMatching, "d_a_wz"),
ActorRel(NonMatching, "d_a_ygcwp"),
ActorRel(NonMatching, "d_a_yougan"),
ActorRel(NonMatching, "d_a_ghostship"),
ActorRel(NonMatching, "d_a_ghostship", extra_cflags=['-pragma "nosyminline on"']),
ActorRel(NonMatching, "d_a_movie_player"),
]
+57 -9
View File
@@ -2,24 +2,30 @@
#define D_A_GHOSTSHIP_H
#include "f_op/f_op_actor.h"
#include "SSystem/SComponent/c_phase.h"
#include "m_Do/m_Do_hostIO.h"
#include "m_Do/m_Do_ext.h"
#include "d/d_cloth_packet.h"
#include "d/d_bg_s_acch.h"
#include "d/d_lib.h"
class daGhostship_c : public fopAc_ac_c {
public:
bool checkInShip() { return mbInShip; }
bool checkInShip() { return mbCanEnterShip; }
void getAlpha() {}
void setMtx() {}
inline s32 _create();
inline BOOL _delete();
inline BOOL _draw();
inline BOOL _execute();
inline bool _delete();
inline bool _draw();
inline bool _execute();
void _createHeap();
BOOL _createHeap();
void pathMove();
void modeWaitInit();
void modeWait();
void modeRealize();
void _pathMove(cXyz*, cXyz*, cXyz*);
bool _pathMove(cXyz*, cXyz*, cXyz*);
void modePathMoveInit();
void modePathMove();
void modeProcCall();
@@ -27,9 +33,51 @@ public:
void getArg();
public:
/* Place member variables here */
/* 0x290 */ u8 m290[0x708 - 0x290];
/* 0x708 */ bool mbInShip;
/* 0x290 */ u32 mMode;
/* 0x294 */ s32 pathId;
/* 0x298 */ u8 moonPhase;
/* 0x29C */ cXyz mCurPntPos;
/* 0x2A8 */ s8 mPathPntNo;
/* 0x2AC */ dPath* mPath;
/* 0x2B0 */ u32 field_0x2B0;
/* 0x2B4 */ cXyz mNextPntPos;
/* 0x2C0 */ u32 field_0x2C0;
/* 0x2C4 */ u32 field_0x2C4;
/* 0x2C8 */ u32 field_0x2C8;
/* 0x2CC */ request_of_phase_process_class mPhs;
/* 0x2D4 */ request_of_phase_process_class mClothPhs;
/* 0x2DC */ dCloth_packet_c* mpCloth;
/* 0x2E0 */ dCloth_packet_c* mpCloth2;
/* 0x2E4 */ J3DModel* mpModel;
/* 0x2E8 */ mDoExt_btkAnm mBtk;
/* 0x2FC */ f32 mAlpha;
/* 0x300 */ dBgS_ObjAcch mAcch;
/* 0x4C4 */ dBgS_AcchCir mCir;
/* 0x504 */ dLib_wave_c mWave;
/* 0x510 */ bool mbEnteredShip;
/* 0x514 */ dLib_circle_path_c mPaths[0xC];
/* 0x6C4 */ f32 field_0x6C4[0xC];
/* 0x6F4 */ cXyz mPathPos;
/* 0x700 */ u32 field_0x700;
/* 0x704 */ f32 mPathSpeed;
/* 0x708 */ bool mbCanEnterShip;
static const u32 m_heapsize;
static const char m_arc_name[];
static const char m_cloth_arc_name[];
};
class daGhostship_HIO_c : public mDoHIO_entry_c {
public:
daGhostship_HIO_c();
~daGhostship_HIO_c() {}
/* 0x04 */ u8 field_0x04;
/* 0x05 */ bool hideShip;
/* 0x08 */ f32 shipAlpha;
/* 0x0C */ f32 field_0x0C;
/* 0x10 */ f32 shipHideDist;
/* 0x14 */ f32 shipEnterDist;
};
#endif /* D_A_GHOSTSHIP_H */
+20 -11
View File
@@ -6,7 +6,8 @@
class daTag_Gship_c : public fopAc_ac_c {
public:
enum Proc_e {
CLEAR_WAIT = 0,
CLEAR_EVENT
};
void modeProcInit(int) {}
@@ -16,20 +17,28 @@ public:
void modeClearEventInit();
void modeClearEvent();
void modeProc(Proc_e, int);
BOOL _execute();
BOOL _draw();
bool _execute();
bool _draw();
void getArg();
s32 _create();
BOOL _delete();
bool _delete();
public:
/* 0x290 */ int mMode;
/* 0x294 */ s8 m294;
/* 0x295 */ s8 m295;
/* 0x296 */ s8 m296;
/* 0x297 */ s8 m297;
/* 0x298 */ f32 m298;
/* 0x29C */ u8 m29C[0x2A4 - 0x29C];
};
/* 0x294 */ s8 field_0x294;
/* 0x298 */ f32 field_0x298;
/* 0x29C */ u8 field_0x29C[0x2A4 - 0x29C];
}; // Size: 0x2A4
class daTag_Gship_HIO_c {
public:
daTag_Gship_HIO_c();
virtual ~daTag_Gship_HIO_c() {}
/* 0x04 */ s8 field_0x04;
/* 0x05 */ u8 field_0x05;
/* 0x08 */ u32 field_0x08;
/* 0x0C */ u32 field_0x0C;
}; // Size: 0x10
#endif /* D_A_TAG_GHOSTSHIP_H */
+24 -1
View File
@@ -9,12 +9,14 @@
class dKy_tevstr_c;
class dCloth_packet_c : public J3DPacket {
typedef int (*FactorCheck)(dCloth_packet_c*, int, int);
/* 0x10 */ s32 mFlyGridSize;
/* 0x14 */ s32 mHoistGridSize;
/* 0x18 */ f32 mFlyLength;
/* 0x1C */ f32 mHoistLength;
/* 0x20 */ dKy_tevstr_c* mpTevstr;
/* 0x24 */ u32 mpFactorCheckCB;
/* 0x24 */ FactorCheck mpFactorCheckCB;
/* 0x28 */ cXyz* mpPosArr[2];
/* 0x30 */ cXyz* mpNrmArr[2];
/* 0x38 */ cXyz* mpNrmArrBack[2];
@@ -52,6 +54,25 @@ public:
void setScale(cXyz scale) { mScale = scale; }
void setMtx(Mtx mtx);
void setFactorCheckCB(FactorCheck cb) { mpFactorCheckCB = cb; }
void setWindPower(f32 wind, f32 windWave) {
mWindSpeed = wind;
mWindSpeedWave = windWave;
}
void setParam(f32 spring, f32 grav, f32 drag, f32 flyFlex, f32 hoistFlex, s16 wave, s16 param_1, s16 ripple, s16 rotate, f32 wind, f32 windWave) {
mSpring = spring;
mGravity = grav;
mDrag = drag;
mFlyFlex = flyFlex;
mHoistFlex = hoistFlex;
mWaveSpeed = wave;
field_0xF2 = param_1;
mRipple = ripple;
mRotateY = rotate;
setWindPower(wind, windWave);
}
void setGlobalWind(cXyz*);
}; // Size: 0xFC
dCloth_packet_c* dClothVobj03_create(ResTIMG*, ResTIMG*, dKy_tevstr_c*, cXyz**);
@@ -59,4 +80,6 @@ dCloth_packet_c* dClothVobj04_create(ResTIMG*, ResTIMG*, dKy_tevstr_c*, cXyz**);
dCloth_packet_c* dClothVobj05_create(ResTIMG*, ResTIMG*, dKy_tevstr_c*, cXyz**);
dCloth_packet_c* dClothVobj07_0_create(ResTIMG*, ResTIMG*, dKy_tevstr_c*, cXyz**);
dCloth_packet_c* dCloth_packetXlu_create(ResTIMG*, ResTIMG*, int, int, float, float, dKy_tevstr_c*, cXyz**);
#endif /* D_A_CLOTH_PACKET_H */
+2
View File
@@ -1533,6 +1533,8 @@ inline dSv_player_status_c_c* dComIfGs_getpPlayerStatusC(int i_idx) {
u8 dComIfGs_checkGetItemNum(u8 i_itemNo);
stage_scls_info_class* dComIfGd_getMeshSceneList(Vec& vec);
BOOL dComIfGs_checkSeaLandingEvent(s8 i_roomNo);
/**
+3 -1
View File
@@ -386,7 +386,7 @@ enum dKy_dice_wether_state {
int dKy_getdaytime_hour();
int dKy_getdaytime_minute();
int dKy_get_dayofweek();
u32 dKy_moon_type_chk();
s32 dKy_moon_type_chk();
BOOL dKy_checkEventNightStop();
void dKy_set_nexttime(f32);
void dKy_instant_timechg(f32);
@@ -416,6 +416,8 @@ void dKy_Sound_init();
void dKy_change_colset(u8 param_0, u8 param_1, f32 param_2);
void dKy_change_colpat(u8 param_0);
void dKy_custom_colset(u8 param_0, u8 param_1, f32 i_blend);
void dKy_pship_existense_set();
void dKy_pship_existense_cut();
u8 dKy_pship_existense_chk();
void dKy_Itemgetcol_chg_off();
void dKy_Itemgetcol_chg_move();
+401 -52
View File
@@ -4,115 +4,464 @@
//
#include "d/actor/d_a_ghostship.h"
#include "dolphin/types.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "SSystem/SComponent/c_math.h"
#include "m_Do/m_Do_mtx.h"
#include "d/d_procname.h"
#include "d/d_com_inf_game.h"
#include "d/d_s_play.h"
#include "d/d_kankyo_wether.h"
/* 000000EC-000000F8 .text daGhostship_SailVtxFactorCB__FP15dCloth_packet_cii */
void daGhostship_SailVtxFactorCB(dCloth_packet_c*, int, int) {
/* Nonmatching */
// Needed for .data to match.
static f32 dummy1[3] = {1.0f, 1.0f, 1.0f};
static f32 dummy2[3] = {1.0f, 1.0f, 1.0f};
static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01};
static f64 dummy4[2] = {3.0, 0.5};
const u32 daGhostship_c::m_heapsize = 0x1EA0;
const char daGhostship_c::m_arc_name[] = "Ayush";
const char daGhostship_c::m_cloth_arc_name[] = "Cloth";
static daGhostship_HIO_c l_HIO;
/* 000000EC-000000F8 .text daGhostship_SailVtxFactorCB__FP15dCloth_packet_cii */
static int daGhostship_SailVtxFactorCB(dCloth_packet_c*, int, int param_3) {
return param_3 ? 0 : 1;
}
/* 000000F8-00000118 .text createHeap_CB__FP10fopAc_ac_c */
static BOOL createHeap_CB(fopAc_ac_c*) {
/* Nonmatching */
/* 000000F8-00000118 .text createHeap_CB__FP10fopAc_ac_c */
static BOOL createHeap_CB(fopAc_ac_c* i_this) {
return static_cast<daGhostship_c*>(i_this)->_createHeap();
}
/* 00000118-0000032C .text _createHeap__13daGhostship_cFv */
void daGhostship_c::_createHeap() {
/* Nonmatching */
/* 00000118-0000032C .text _createHeap__13daGhostship_cFv */
BOOL daGhostship_c::_createHeap() {
J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes(m_arc_name, 5));
JUT_ASSERT(88, modelData != 0);
mpModel = mDoExt_J3DModel__create(modelData, 0, 0x11020203);
if(!mpModel) {
return false;
}
J3DAnmTextureSRTKey* btk = static_cast<J3DAnmTextureSRTKey*>(dComIfG_getObjectRes(m_arc_name, 8));
JUT_ASSERT(95, btk != 0);
if(!mBtk.init(modelData, btk, true, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1, false, 0)) {
return false;
}
ResTIMG* res1 = static_cast<ResTIMG*>(dComIfG_getObjectRes(m_arc_name, 0xB));
ResTIMG* res2 = static_cast<ResTIMG*>(dComIfG_getObjectRes(m_arc_name, 0xC));
ResTIMG* res3 = static_cast<ResTIMG*>(dComIfG_getObjectRes(m_cloth_arc_name, 0x3));
mpCloth = dCloth_packetXlu_create(res1, res3, 5, 5, 700.0f, 350.0f, &mTevStr, 0);
mpCloth2 = dCloth_packetXlu_create(res2, res3, 6, 6, 1800.0f, 1000.0f, &mTevStr, 0);
if(!mpCloth || !mpCloth2) {
return false;
}
mpCloth2->setFactorCheckCB(&daGhostship_SailVtxFactorCB);
return true;
}
/* 0000032C-00000368 .text pathMove_CB__FP4cXyzP4cXyzP4cXyzPv */
void pathMove_CB(cXyz*, cXyz*, cXyz*, void*) {
/* Nonmatching */
/* 0000032C-00000368 .text pathMove_CB__FP4cXyzP4cXyzP4cXyzPv */
static int pathMove_CB(cXyz* curPos, cXyz* curPntPos, cXyz* nextPntPos, void* i_this) {
static_cast<daGhostship_c*>(i_this)->_pathMove(curPos, curPntPos, nextPntPos);
}
/* 00000368-000003B8 .text __ct__17daGhostship_HIO_cFv */
/* 00000368-000003B8 .text __ct__17daGhostship_HIO_cFv */
daGhostship_HIO_c::daGhostship_HIO_c() {
/* Nonmatching */
field_0x04 = 0;
hideShip = false;
shipAlpha = 0.51f;
field_0x0C = 5.0f;
shipHideDist = 3000.0f;
shipEnterDist = 1500.0f;
}
/* 00000400-000004CC .text pathMove__13daGhostship_cFv */
/* 00000400-000004CC .text pathMove__13daGhostship_cFv */
void daGhostship_c::pathMove() {
/* Nonmatching */
cLib_addCalc2(&speedF, mPathSpeed, 0.1f, 2.0f);
dLib_pathMove(&mPathPos, &mPathPntNo, mPath, speedF, &pathMove_CB, this);
cLib_addCalcPosXZ2(&current.pos, mPathPos, g_regHIO.mChild[12].mFloatRegs[0] + 0.01f, speedF);
if(speedF != 0.0f && mPathSpeed != 0.0f) {
cLib_addCalcAngleS2(&shape_angle.y, cLib_targetAngleY(&current.pos, &mPathPos), 8, 0x100);
}
}
/* 000004CC-000004D8 .text modeWaitInit__13daGhostship_cFv */
/* 000004CC-000004D8 .text modeWaitInit__13daGhostship_cFv */
void daGhostship_c::modeWaitInit() {
/* Nonmatching */
mMode = 0;
}
/* 000004D8-000004DC .text modeWait__13daGhostship_cFv */
/* 000004D8-000004DC .text modeWait__13daGhostship_cFv */
void daGhostship_c::modeWait() {
/* Nonmatching */
return;
}
/* 000004DC-000004E0 .text modeRealize__13daGhostship_cFv */
/* 000004DC-000004E0 .text modeRealize__13daGhostship_cFv */
void daGhostship_c::modeRealize() {
/* Nonmatching */
return;
}
/* 000004E0-00000770 .text _pathMove__13daGhostship_cFP4cXyzP4cXyzP4cXyz */
void daGhostship_c::_pathMove(cXyz*, cXyz*, cXyz*) {
/* 000004E0-00000770 .text _pathMove__13daGhostship_cFP4cXyzP4cXyzP4cXyz */
bool daGhostship_c::_pathMove(cXyz* curPos, cXyz* p_curPntPos, cXyz* p_nextPntPos) {
/* Nonmatching */
mCurPntPos = *p_curPntPos;
mCurPntPos.y = current.pos.y;
mNextPntPos = *p_nextPntPos;
mNextPntPos.y = current.pos.y;
cXyz dist = mNextPntPos - mCurPntPos;
if(!dist.normalizeRS()) {
return true;
}
f32 step = speedF * fabsf(cM_scos(cLib_addCalcAngleS(&current.angle.y, cM_atan2s(dist.x, dist.z), 8, 0x200, 8)));
cLib_chasePosXZ(curPos, mNextPntPos, step);
if((*curPos - mNextPntPos).absXZ() < step * (g_regHIO.mChild[12].mFloatRegs[5] + 1.0f) || (*curPos - mNextPntPos).absXZ() == 0.0f) {
return true;
}
return false;
}
/* 00000770-0000077C .text modePathMoveInit__13daGhostship_cFv */
/* 00000770-0000077C .text modePathMoveInit__13daGhostship_cFv */
void daGhostship_c::modePathMoveInit() {
/* Nonmatching */
mMode = 2;
}
/* 0000077C-000007D0 .text modePathMove__13daGhostship_cFv */
void daGhostship_c::modePathMove() {
/* Nonmatching */
if(pathId != 0xFF) {
mPathSpeed = 10.0f;
pathMove();
}
current.pos.y = dLib_getWaterY(current.pos, mAcch);
}
/* 000007D0-00000874 .text modeProcCall__13daGhostship_cFv */
/* 000007D0-00000874 .text modeProcCall__13daGhostship_cFv */
void daGhostship_c::modeProcCall() {
/* Nonmatching */
typedef void(daGhostship_c::*ProcFunc)(void);
static const ProcFunc mode_proc[] = {
&daGhostship_c::modeWait,
&daGhostship_c::modeRealize,
&daGhostship_c::modePathMove
};
(this->*mode_proc[mMode])();
}
/* 00000874-00000C78 .text createInit__13daGhostship_cFv */
// probably unused/debug colors or something
const u32 dummy[] = {
0x0000FF80,
0xFF000080,
0xFF000080,
0xFF000080,
0x00FF0080,
0x0000FF80,
0x0000FF80,
0x0000FF80,
};
u32 dummyFunc() {
return dummy[0];
}
/* 00000874-00000C78 .text createInit__13daGhostship_cFv */
void daGhostship_c::createInit() {
/* Nonmatching */
mPathPos = current.pos;
for(int i = 0; i < 0xC; i++) {
mPaths[i].mAngle = 0x2000 * i;
s32 temp2 = 1;
f32 temp3 = 600.0f * cM_scos(mPaths[i].mAngle + mPaths[i].mAngleSpeed);
if(i % 2 == 1) {
temp2 = -1;
temp3 = 600.0f * cM_ssin(mPaths[i].mAngle + mPaths[i].mAngleSpeed);
}
mPaths[i].mRadius = 100.0f * i;
f32 temp4 = 500.0f + g_regHIO.mChild[12].mFloatRegs[10];
mPaths[i].mWobbleAmplitude = 300.0f + g_regHIO.mChild[12].mFloatRegs[1];
mPaths[i].mAngleSpeed = temp2 * (0x100 + g_regHIO.mChild[12].mShortRegs[0] + 0x10 * i + cM_rndF(100.0f));
mPaths[i].mTranslation.x = current.pos.x + temp4 * cM_ssin(shape_angle.y);
mPaths[i].mTranslation.y = 600.0f + current.pos.y + temp3 + cM_rndF(100.0f);
mPaths[i].mTranslation.z = current.pos.z + temp4 * cM_scos(shape_angle.y);
dLib_setCirclePath(&mPaths[i]);
}
if(pathId != 0xFF) {
mPath = dPath_GetRoomPath(pathId, fopAcM_GetRoomNo(this));
modePathMoveInit();
}
else {
modeWaitInit();
}
mCir.SetWall(30.0f, 30.0f);
mAcch.Set(&fopAcM_GetPosition_p(this), &fopAcM_GetOldPosition_p(this), this, true, &mCir, &fopAcM_GetSpeed_p(this), 0, 0);
mAcch.SetWallNone();
mAcch.SetRoofNone();
dLib_waveRot(&current.pos, 0.0f, &mWave);
shape_angle.x = mWave.mRotX;
shape_angle.z = mWave.mRotZ;
mpModel->setBaseScale(mScale);
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::XYZrotM(shape_angle.x, 0, shape_angle.z);
mDoMtx_stack_c::YrotM(shape_angle.y);
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
mDoMtx_stack_c::copy(mpModel->getBaseTRMtx());
mDoMtx_stack_c::push();
mDoMtx_stack_c::transM(0.0f, 3200.0f, 75.0f);
mpCloth->setMtx(mDoMtx_stack_c::get());
mDoMtx_stack_c::pop();
mDoMtx_stack_c::transM(-900.0f, 2080.0f, 85.0f);
mDoMtx_stack_c::YrotM(0x4000);
mpCloth2->setMtx(mDoMtx_stack_c::get());
}
/* 00000C78-00000C8C .text getArg__13daGhostship_cFv */
/* 00000C78-00000C8C .text getArg__13daGhostship_cFv */
void daGhostship_c::getArg() {
/* Nonmatching */
u32 param = fopAcM_GetParam(this);
pathId = fopAcM_GetParamBit(param, 0x10, 8);
moonPhase = fopAcM_GetParamBit(param, 0, 8);
}
/* 00000C8C-00000DFC .text daGhostshipCreate__FPv */
static s32 daGhostshipCreate(void*) {
/* Nonmatching */
/* 00000C8C-00000DFC .text daGhostshipCreate__FPv */
static s32 daGhostshipCreate(void* i_actor) {
daGhostship_c* i_this = static_cast<daGhostship_c*>(i_actor);
fopAcM_SetupActor(i_this, daGhostship_c);
s32 result = dComIfG_resLoad(&i_this->mPhs, daGhostship_c::m_arc_name);
if(result != cPhs_COMPLEATE_e) {
return result;
}
result = dComIfG_resLoad(&i_this->mClothPhs, daGhostship_c::m_cloth_arc_name);
if(result != cPhs_COMPLEATE_e) {
return result;
}
i_this->getArg();
if((s32)dComIfGs_getEventReg(0x8803) == 3) {
return cPhs_ERROR_e;
}
if (!fopAcM_entrySolidHeap(i_this, createHeap_CB, 0x1EA0)) {
return cPhs_ERROR_e;
}
i_this->createInit();
return cPhs_COMPLEATE_e;
}
/* 00000FD8-00001024 .text daGhostshipDelete__FPv */
static BOOL daGhostshipDelete(void*) {
/* Nonmatching */
/* 00000FD8-00001024 .text daGhostshipDelete__FPv */
static BOOL daGhostshipDelete(void* i_actor) {
daGhostship_c* i_this = static_cast<daGhostship_c*>(i_actor);
dComIfG_resDelete(&i_this->mPhs, daGhostship_c::m_arc_name);
dComIfG_resDelete(&i_this->mClothPhs, daGhostship_c::m_cloth_arc_name);
return true;
}
/* 00001024-00001048 .text daGhostshipExecute__FPv */
static BOOL daGhostshipExecute(void*) {
/* Nonmatching */
/* 00001024-00001048 .text daGhostshipExecute__FPv */
static BOOL daGhostshipExecute(void* i_this) {
return static_cast<daGhostship_c*>(i_this)->_execute();
}
/* 00001048-0000182C .text _execute__13daGhostship_cFv */
BOOL daGhostship_c::_execute() {
/* Nonmatching */
/* 00001048-0000182C .text _execute__13daGhostship_cFv */
bool daGhostship_c::_execute() {
f32 time = dComIfGs_getTime();
f32 dist = fopAcM_searchActorDistanceXZ(this, dComIfGp_getPlayer(0));
mbCanEnterShip = false;
if(moonPhase != dKy_moon_type_chk() || (time > 90.0f && time < 285.0f)) {
dKy_pship_existense_cut();
mAlpha = 0.0f;
}
else {
dKy_pship_existense_set();
f32 targetAlpha;
if(dist < l_HIO.shipHideDist) {
targetAlpha = 0.0f;
}
else {
targetAlpha = l_HIO.shipAlpha;
}
if(dComIfGs_isOpenCollectMap(0x24) && dComIfGs_isGetCollectMap(0x24)) {
mbCanEnterShip = 1;
targetAlpha = l_HIO.shipAlpha;
}
cLib_chaseF(&mAlpha, targetAlpha, 0.02f);
}
if(mAlpha == 0.0f) {
fopAcM_OffStatus(this, fopAcStts_SHOWMAP_e | 0x3);
}
else {
fopAcM_seStart(this, JA_SE_CV_YUUREISEN_SONG, 0);
fopAcM_OnStatus(this, fopAcStts_SHOWMAP_e | 0x3);
}
for(int i = 0; i < 0xC; i++) {
if(mPaths[i].mRadius < 900.0f) {
field_0x6C4[i] = i * 100.0f + 1500.0f;
}
else {
if(mPaths[i].mRadius > i * 100.0f + 1400.0f) {
field_0x6C4[i] = 800.0f;
}
}
s32 temp2 = 1;
f32 temp3 = 600.0f * cM_scos((mPaths[i].mAngle + mPaths[i].mAngleSpeed) * 2 & 0xFFFE);
if(i % 2 == 1) {
temp2 = -1;
temp3 = 600.0f * cM_ssin((mPaths[i].mAngle + mPaths[i].mAngleSpeed) * 2 & 0xFFFE);
}
cLib_addCalc2(&mPaths[i].mRadius, field_0x6C4[i], 0.1f, 10.0f);
f32 temp = (500.0f + g_regHIO.mChild[12].mFloatRegs[10]);
mPaths[i].mWobbleAmplitude = 300.0f + g_regHIO.mChild[12].mFloatRegs[1];
mPaths[i].mAngleSpeed = (5 + g_regHIO.mChild[12].mShortRegs[0] + i * 2 + cM_rndF(20.0f)) * temp2;
mPaths[i].mTranslation.x = current.pos.x + temp * cM_ssin(shape_angle.y);
mPaths[i].mTranslation.y = 600.0f + current.pos.y + temp3;
mPaths[i].mTranslation.z = current.pos.z + temp * cM_scos(shape_angle.y);
dLib_setCirclePath(&mPaths[i]);
if(mAlpha != 0.0f) {
dComIfGp_particle_setSimple(0x8306, &mPaths[i].mPos, 0xFF, g_whiteColor, g_whiteColor, 0);
}
}
if(mAlpha == l_HIO.shipAlpha && dist < l_HIO.shipEnterDist && dComIfGs_getEventReg(0x8803) < 3 && !mbEnteredShip) {
mDoAud_seStart(JA_SE_LK_WARP_TO_G_SHIP, 0, 0, 0);
stage_scls_info_class* scls_data = dComIfGd_getMeshSceneList(current.pos);
JUT_ASSERT(463, scls_data != 0)
u8 startCode = scls_data->mStart;
dComIfGs_setEventReg(0xC3FF, scls_data->mRoom);
dComIfGs_setEventReg(0x85FF, startCode);
dComIfGp_setNextStage("PShip", 0, 2, 0xFF, 0.0f, 0, 1, 0);
mbEnteredShip = true;
}
modeProcCall();
mBtk.play();
dLib_waveRot(&current.pos, 0.0f, &mWave);
shape_angle.x = mWave.mRotX;
shape_angle.z = mWave.mRotZ;
mpModel->setBaseScale(mScale);
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::XYZrotM(shape_angle.x, 0, shape_angle.z);
mDoMtx_stack_c::YrotM(shape_angle.y);
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
mDoMtx_stack_c::copy(mpModel->getBaseTRMtx());
mDoMtx_stack_c::push();
mDoMtx_stack_c::transM(0.0f, 3200.0f, 75.0f);
mpCloth->setMtx(mDoMtx_stack_c::get());
mDoMtx_stack_c::pop();
mDoMtx_stack_c::transM(-900.0f, 2080.0f, 85.0f);
mDoMtx_stack_c::YrotM(0x4000);
mpCloth2->setMtx(mDoMtx_stack_c::get());
mpCloth->setParam(0.45f, -1.5f, 0.875f, 1.0f, 1.0f, 0x100, 0, 900, -800, 7.0f, 6.0f);
mpCloth->setGlobalWind(dKyw_get_wind_vec());
mpCloth->cloth_move();
mpCloth2->setParam(0.45f, -0.25f, 0.875f, 1.0f, 1.0f, 0x100, 0, 900, -800, 7.0f, 6.0f);
cXyz wind2 = *dKyw_get_wind_vec();
wind2 *= 0.548f;
wind2.y = -0.83f;
mpCloth2->setGlobalWind(&wind2);
mpCloth2->cloth_move();
return false;
}
/* 0000182C-00001850 .text daGhostshipDraw__FPv */
static BOOL daGhostshipDraw(void*) {
/* Nonmatching */
/* 0000182C-00001850 .text daGhostshipDraw__FPv */
static BOOL daGhostshipDraw(void* i_this) {
return static_cast<daGhostship_c*>(i_this)->_draw();
}
/* 00001850-000019A4 .text _draw__13daGhostship_cFv */
BOOL daGhostship_c::_draw() {
/* 00001850-000019A4 .text _draw__13daGhostship_cFv */
bool daGhostship_c::_draw() {
/* Nonmatching */
if(mAlpha == 0.0f) {
return true;
}
if(!l_HIO.hideShip) {
g_env_light.settingTevStruct(TEV_TYPE_ACTOR, &current.pos, &mTevStr);
g_env_light.setLightTevColorType(mpModel, &mTevStr);
J3DModelData* modelData = mpModel->getModelData();
u32 alpha = (u8)(mAlpha * 255.5f);
for(u8 i = 0; i < modelData->getMaterialNum(); i++) {
modelData->getMaterialNodePointer(i)->getTevKColor(3)->mColor.a = alpha;
}
mBtk.entry(modelData, mBtk.getFrame());
mDoExt_modelUpdateDL(mpModel);
mBtk.remove(modelData);
mTevStr.mColorC0.a = alpha;
mpCloth->cloth_draw();
mTevStr.mColorC0.a = alpha;
mpCloth2->cloth_draw();
}
return true;
}
/* 000019A4-000019AC .text daGhostshipIsDelete__FPv */
/* 000019A4-000019AC .text daGhostshipIsDelete__FPv */
static BOOL daGhostshipIsDelete(void*) {
/* Nonmatching */
return true;
}
static actor_method_class daGhostshipMethodTable = {
(process_method_func)daGhostshipCreate,
(process_method_func)daGhostshipDelete,
(process_method_func)daGhostshipExecute,
(process_method_func)daGhostshipIsDelete,
(process_method_func)daGhostshipDraw,
};
actor_process_profile_definition g_profile_AYUSH = {
fpcLy_CURRENT_e,
7,
fpcPi_CURRENT_e,
PROC_AYUSH,
&g_fpcLf_Method.mBase,
sizeof(daGhostship_c),
0,
0,
&g_fopAc_Method.base,
0x009E,
&daGhostshipMethodTable,
fopAcStts_UNK40000_e | fopAcStts_SHOWMAP_e | 0x3,
fopAc_ACTOR_e,
fopAc_CULLBOX_4_e,
};
+143 -41
View File
@@ -4,85 +4,187 @@
//
#include "d/actor/d_a_tag_ghostship.h"
#include "dolphin/types.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "d/d_com_inf_game.h"
#include "d/d_procname.h"
/* 000000EC-0000010C .text __ct__17daTag_Gship_HIO_cFv */
// Needed for .data to match.
static f32 dummy1[3] = {1.0f, 1.0f, 1.0f};
static f32 dummy2[3] = {1.0f, 1.0f, 1.0f};
static u8 dummy3[4] = {0x02, 0x00, 0x02, 0x01};
static f64 dummy4[2] = {3.0, 0.5};
static daTag_Gship_HIO_c l_HIO;
/* 000000EC-0000010C .text __ct__17daTag_Gship_HIO_cFv */
daTag_Gship_HIO_c::daTag_Gship_HIO_c() {
/* Nonmatching */
field_0x04 = -1;
field_0x05 = 0;
}
/* 0000010C-00000110 .text modeClearWaitInit__13daTag_Gship_cFv */
/* 0000010C-00000110 .text modeClearWaitInit__13daTag_Gship_cFv */
void daTag_Gship_c::modeClearWaitInit() {
/* Nonmatching */
return;
}
/* 00000110-000001C0 .text modeClearWait__13daTag_Gship_cFv */
/* 00000110-000001C0 .text modeClearWait__13daTag_Gship_cFv */
void daTag_Gship_c::modeClearWait() {
/* Nonmatching */
if(dComIfGp_evmng_endCheck("DEFAULT_TREASURE") || dComIfGp_evmng_endCheck("DEFAULT_TREASURE2") || dComIfGp_evmng_endCheck("DEFAULT_TREASURE_A") || l_HIO.field_0x05) {
modeProc(CLEAR_WAIT, 1);
}
}
/* 000001C0-00000214 .text modeClearEventInit__13daTag_Gship_cFv */
/* 000001C0-00000214 .text modeClearEventInit__13daTag_Gship_cFv */
void daTag_Gship_c::modeClearEventInit() {
/* Nonmatching */
dComIfGs_getEventReg(0x8803);
dComIfGs_setEventReg(0x8803, 3);
}
/* 00000214-00000418 .text modeClearEvent__13daTag_Gship_cFv */
/* 00000214-00000418 .text modeClearEvent__13daTag_Gship_cFv */
void daTag_Gship_c::modeClearEvent() {
/* Nonmatching */
if(mEvtInfo.checkCommandDemoAccrpt()) {
int staffIdx = dComIfGp_evmng_getMyStaffId("PScnChg", 0, 0);
if(dEvmng_strcmp(dComIfGp_getPEvtManager()->getMyNowCutName(staffIdx), "WARAIGOE") == 0) {
if(dComIfGs_getEventReg(0x8803) == 3) {
mDoAud_seStart(JA_SE_CV_G_SHIP_SCREAM, 0, 0, 0);
}
else {
mDoAud_seStart(JA_SE_CV_G_SHIP_LAUGH, 0, 0, 0);
}
dComIfGp_evmng_cutEnd(staffIdx);
}
if(dComIfGp_evmng_endCheck("PSHIP_CLEAR")) {
mDoAud_seStart(JA_SE_LK_WARP_TO_G_SHIP, 0, 0, 0);
s8 room = dComIfGs_getEventReg(0xC3FF);
s8 spawn = dComIfGs_getEventReg(0x85FF);
dKy_set_nexttime(120.0f);
dComIfGp_setNextStage("sea", spawn, room, 0xFF, 0.0f, 5, 1, 0);
}
}
else {
fopAcM_orderOtherEvent2(this, "PSHIP_CLEAR", 1, 0xFFFF);
}
}
/* 00000418-00000508 .text modeProc__13daTag_Gship_cFQ213daTag_Gship_c6Proc_ei */
void daTag_Gship_c::modeProc(daTag_Gship_c::Proc_e, int) {
/* Nonmatching */
/* 00000418-00000508 .text modeProc__13daTag_Gship_cFQ213daTag_Gship_c6Proc_ei */
void daTag_Gship_c::modeProc(daTag_Gship_c::Proc_e proc, int param_2) {
typedef void(daTag_Gship_c::*ProcFunc)(void);
struct ProcEntry {
ProcFunc init;
ProcFunc run;
const char* name;
};
static const ProcEntry mode_proc[] = {
{
&daTag_Gship_c::modeClearWaitInit,
&daTag_Gship_c::modeClearWait,
"CLEAR_WAIT"
},
{
&daTag_Gship_c::modeClearEventInit,
&daTag_Gship_c::modeClearEvent,
"CLEAR_EVENT"
}
};
if(proc == CLEAR_WAIT) {
mMode = param_2;
(this->*mode_proc[mMode].init)();
}
else if(proc == CLEAR_EVENT) {
(this->*mode_proc[mMode].run)();
}
}
/* 00000508-00000534 .text _execute__13daTag_Gship_cFv */
BOOL daTag_Gship_c::_execute() {
/* Nonmatching */
/* 00000508-00000534 .text _execute__13daTag_Gship_cFv */
bool daTag_Gship_c::_execute() {
modeProc(CLEAR_EVENT, 2);
return true;
}
/* 00000534-0000053C .text _draw__13daTag_Gship_cFv */
BOOL daTag_Gship_c::_draw() {
/* Nonmatching */
/* 00000534-0000053C .text _draw__13daTag_Gship_cFv */
bool daTag_Gship_c::_draw() {
return true;
}
/* 0000053C-00000594 .text getArg__13daTag_Gship_cFv */
/* 0000053C-00000594 .text getArg__13daTag_Gship_cFv */
void daTag_Gship_c::getArg() {
/* Nonmatching */
u32 param = fopAcM_GetParam(this);
field_0x294 = param;
s32 bit = fopAcM_GetParamBit(param, 8, 8);
if(bit == 0xFF) {
field_0x298 = 1000.0f;
}
else {
field_0x298 = bit * 100;
}
}
/* 00000594-000005EC .text _create__13daTag_Gship_cFv */
/* 00000594-000005EC .text _create__13daTag_Gship_cFv */
s32 daTag_Gship_c::_create() {
/* Nonmatching */
fopAcM_SetupActor(this, daTag_Gship_c);
getArg();
return cPhs_COMPLEATE_e;
}
/* 000005EC-000005F4 .text _delete__13daTag_Gship_cFv */
BOOL daTag_Gship_c::_delete() {
/* Nonmatching */
/* 000005EC-000005F4 .text _delete__13daTag_Gship_cFv */
bool daTag_Gship_c::_delete() {
return true;
}
/* 000005F4-00000614 .text daTag_GshipCreate__FPv */
static s32 daTag_GshipCreate(void*) {
/* Nonmatching */
/* 000005F4-00000614 .text daTag_GshipCreate__FPv */
static s32 daTag_GshipCreate(void* i_this) {
return static_cast<daTag_Gship_c*>(i_this)->_create();
}
/* 00000614-00000638 .text daTag_GshipDelete__FPv */
static BOOL daTag_GshipDelete(void*) {
/* Nonmatching */
/* 00000614-00000638 .text daTag_GshipDelete__FPv */
static BOOL daTag_GshipDelete(void* i_this) {
return static_cast<daTag_Gship_c*>(i_this)->_delete();
}
/* 00000638-0000065C .text daTag_GshipExecute__FPv */
static BOOL daTag_GshipExecute(void*) {
/* Nonmatching */
/* 00000638-0000065C .text daTag_GshipExecute__FPv */
static BOOL daTag_GshipExecute(void* i_this) {
return static_cast<daTag_Gship_c*>(i_this)->_execute();
}
/* 0000065C-00000680 .text daTag_GshipDraw__FPv */
static BOOL daTag_GshipDraw(void*) {
/* Nonmatching */
/* 0000065C-00000680 .text daTag_GshipDraw__FPv */
static BOOL daTag_GshipDraw(void* i_this) {
return static_cast<daTag_Gship_c*>(i_this)->_draw();
}
/* 00000680-00000688 .text daTag_GshipIsDelete__FPv */
/* 00000680-00000688 .text daTag_GshipIsDelete__FPv */
static BOOL daTag_GshipIsDelete(void*) {
/* Nonmatching */
return true;
}
static actor_method_class daTag_GshipMethodTable = {
(process_method_func)daTag_GshipCreate,
(process_method_func)daTag_GshipDelete,
(process_method_func)daTag_GshipExecute,
(process_method_func)daTag_GshipIsDelete,
(process_method_func)daTag_GshipDraw,
};
actor_process_profile_definition g_profile_TAG_GSHIP = {
fpcLy_CURRENT_e,
8,
fpcPi_CURRENT_e,
PROC_TAG_GSHIP,
&g_fpcLf_Method.mBase,
sizeof(daTag_Gship_c),
0,
0,
&g_fopAc_Method.base,
0x0066,
&daTag_GshipMethodTable,
fopAcStts_UNK40000_e | fopAcStts_UNK4000_e,
fopAc_ACTOR_e,
fopAc_CULLBOX_4_e,
};
+1 -1
View File
@@ -3436,7 +3436,7 @@ void dKy_instant_rainchg() {
}
/* 801973B8-80197404 .text dKy_moon_type_chk__Fv */
u32 dKy_moon_type_chk() {
s32 dKy_moon_type_chk() {
int weekday = dKy_get_dayofweek();
if (dComIfGs_getTime() < 180.0f) {