Demo matches (#767)

This commit is contained in:
LagoLunatic
2025-05-24 18:54:46 -04:00
committed by GitHub
parent 4a29f64e6b
commit 7cd75e8f7b
83 changed files with 945 additions and 424 deletions
+57 -4
View File
@@ -13,6 +13,7 @@
#include "d/d_priority.h"
#include "d/actor/d_a_player.h"
#include "m_Do/m_Do_ext.h"
#include "m_Do/m_Do_hostIO.h"
#include "m_Do/m_Do_mtx.h"
namespace {
@@ -43,13 +44,29 @@ namespace {
// cM3dGSphS
{
/* Center */ 0.0f, 0.0f, 0.0f,
#if VERSION == VERSION_DEMO
/* Radius */ 35.0f,
#else
/* Radius */ 90.0f,
#endif
},
};
static const Vec l_hook_offset = { 0.0f, 0.0f, 0.0f };
};
#if VERSION == VERSION_DEMO
daObjHfuck1_HIO_c l_HIO;
daObjHfuck1_HIO_c::daObjHfuck1_HIO_c() {
mNo = -1;
field_0x08 = 90.0f;
field_0x0C = -50.0f;
field_0x10 = 0.0f;
field_0x14 = 0.0f;
}
#endif
/* 00000078-00000100 .text init_mtx__13daObjHfuck1_cFv */
void daObjHfuck1_c::init_mtx() {
mpModel->setBaseScale(scale);
@@ -70,7 +87,7 @@ bool daObjHfuck1_c::create_heap() {
J3DModelData* pModelData = static_cast<J3DModelData*>(dComIfG_getObjectRes(l_arcname, HFUCK1_BDL_HFUCK1));
if (!pModelData) {
JUT_ASSERT(0xf5, FALSE);
JUT_ASSERT(VERSION_SELECT(241, 245, 245, 245), FALSE);
ret = false;
} else {
mpModel = mDoExt_J3DModel__create(pModelData, 0x80000, 0x11000022);
@@ -114,6 +131,9 @@ cPhs_State daObjHfuck1_c::_create() {
mSph.Set(l_sph_src);
mSph.SetStts(&mStts);
#if VERSION == VERSION_DEMO
mSph.SetC(current.pos);
#else
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::XYZrotM(shape_angle);
mDoMtx_stack_c::transM(0.0f, 0.0f, -50.0f);
@@ -121,12 +141,19 @@ cPhs_State daObjHfuck1_c::_create() {
mDoMtx_stack_c::multVecZero(&center);
mSph.SetC(center);
mSph.SetR(90.0f);
#endif
}
} else {
ret = cPhs_ERROR_e;
}
}
#if VERSION == VERSION_DEMO
if (l_HIO.mNo < 0) {
l_HIO.mNo = mDoHIO_createChild("フックショットの的", &l_HIO);
}
#endif
return ret;
}
@@ -134,14 +161,28 @@ cPhs_State daObjHfuck1_c::_create() {
bool daObjHfuck1_c::_delete() {
dComIfG_resDelete(&mPhs, l_arcname);
if (heap != NULL && mpBgW != NULL) {
#if VERSION == VERSION_DEMO
if (mpBgW != NULL)
#else
if (heap != NULL && mpBgW != NULL)
#endif
{
if (mpBgW->ChkUsed()) {
dComIfG_Bgsp()->Release(mpBgW);
}
#if VERSION > VERSION_DEMO
mpBgW = NULL;
#endif
}
#if VERSION == VERSION_DEMO
if (l_HIO.mNo >= 0) {
mDoHIO_deleteChild(l_HIO.mNo);
l_HIO.mNo = -1;
}
#endif
return true;
}
@@ -149,10 +190,22 @@ bool daObjHfuck1_c::_delete() {
bool daObjHfuck1_c::_execute() {
mpBgW->Move();
mStts.Move();
#if VERSION == VERSION_DEMO
mSph.SetR(l_HIO.field_0x08);
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::XYZrotM(shape_angle);
mDoMtx_stack_c::transM(0.0f, 0.0f, l_HIO.field_0x0C);
cXyz center;
mDoMtx_stack_c::multVecZero(&center);
mSph.SetC(center);
#endif
if (mpHookshotActor != NULL) {
if (fopAcM_IsActor(mpHookshotActor) == TRUE && fopAcM_GetName(mpHookshotActor) == PROC_HOOKSHOT) {
if (daPy_getPlayerActorClass() != NULL) {
daPy_getPlayerActorClass()->setHookshotCarryOffset(fopAcM_GetID(this), (const cXyz*)&l_hook_offset);
daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
if (player != NULL) {
player->setHookshotCarryOffset(fopAcM_GetID(this), (const cXyz*)&l_hook_offset);
}
}
mpHookshotActor = NULL;