mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-08 03:37:02 -04:00
56890c32e8
* Consolidate fopAcM_STATUS into fopAc_Status_e * Add _e suffix to fopAcStts enums * Prepare for profile enumeration * Correct typo in scene_process_profile_definition * Manually handle g_profile_Obj_DamCps (inline preprocessing) * Correct g_profile_TAG_LV5SOUP procname to enum * Create d_priority.h * Update process profile definitions * Moved inline comments to the left * Add missing fopAcStts enums * Add d_priority.h include in f_pc_leaf.h * Manually update d_a_obj_damCps profile * Replace fopAcStts enums replacing and anticipatory profile size correction * Changed profile size from literal to sizeof() in anticipation of PR #3116 * Provided putative names to staff-related status enums * Replaced appropriate literals with fopAcStts enums * Fix borked merge * Rename item number enums and move to d_item_data.h * Rename process profile name & draw priority enums * Move process profile name & draw priority enums to appropriate files * Moved fpcNm_ enums from d/d_procname.h to f_pc/f_pc_name.h * Moved fpcDwPi_ enums from d/d_priority.h to f_pc/f_pc_draw_priority.h * ACTUALLY (whoops) stage merge * Correct item mistranslation Co-authored-by: LagoLunatic <LagoLunatic@users.noreply.github.com> --------- Co-authored-by: LagoLunatic <LagoLunatic@users.noreply.github.com>
167 lines
4.7 KiB
C++
167 lines
4.7 KiB
C++
/**
|
|
* @file d_a_obj_crvsteel.cpp
|
|
*
|
|
*/
|
|
|
|
#include "d/dolzel_rel.h" // IWYU pragma: keep
|
|
|
|
#include "d/actor/d_a_obj_crvsteel.h"
|
|
#include "d/d_com_inf_game.h"
|
|
|
|
static int daObjCRVSTEEL_Create(fopAc_ac_c* i_this) {
|
|
return static_cast<daObjCRVSTEEL_c*>(i_this)->create();
|
|
}
|
|
|
|
static int daObjCRVSTEEL_Delete(daObjCRVSTEEL_c* i_this) {
|
|
i_this->MoveBGDelete();
|
|
return 1;
|
|
}
|
|
|
|
void daObjCRVSTEEL_c::OpenSet(f32 param_1, f32 param_2) {
|
|
speed.y = param_1;
|
|
mMaxHeight = current.pos.y + param_2;
|
|
mAction = 1;
|
|
}
|
|
|
|
void daObjCRVSTEEL_c::CloseSet(f32 param_1) {
|
|
speed.y = param_1;
|
|
mAction = 2;
|
|
}
|
|
|
|
void daObjCRVSTEEL_c::CloseExecute() {
|
|
current.pos.y += speed.y;
|
|
if (current.pos.y < mMinHeight) {
|
|
current.pos.y = mMinHeight;
|
|
fopAcM_effSmokeSet1(&mSmokeParticle1, &mSmokeParticle2, ¤t.pos, 0, 5.0f, &tevStr, 1);
|
|
mAction = 0;
|
|
}
|
|
}
|
|
|
|
void daObjCRVSTEEL_c::OpenExecute() {
|
|
current.pos.y += speed.y;
|
|
if (current.pos.y > mMaxHeight) {
|
|
current.pos.y = mMaxHeight;
|
|
}
|
|
}
|
|
|
|
void daObjCRVSTEEL_c::Action() {
|
|
switch(mAction) {
|
|
case 0:
|
|
break;
|
|
case 1:
|
|
OpenExecute();
|
|
break;
|
|
case 2:
|
|
CloseExecute();
|
|
break;
|
|
}
|
|
}
|
|
|
|
void daObjCRVSTEEL_c::setBaseMtx() {
|
|
mDoMtx_stack_c::transS(current.pos);
|
|
mDoMtx_stack_c::ZXYrotM(shape_angle);
|
|
mModel->setBaseTRMtx(mDoMtx_stack_c::get());
|
|
cMtx_copy(mDoMtx_stack_c::get(), mBgMtx);
|
|
}
|
|
|
|
static int daObjCRVSTEEL_Draw(daObjCRVSTEEL_c* i_this) {
|
|
return i_this->Draw();
|
|
}
|
|
|
|
static int daObjCRVSTEEL_Execute(daObjCRVSTEEL_c* i_this) {
|
|
return i_this->MoveBGExecute();
|
|
}
|
|
|
|
static char* l_arcName = "CrvSteel";
|
|
|
|
int daObjCRVSTEEL_c::CreateHeap() {
|
|
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, "U_CrvSteelGate.bmd");
|
|
JUT_ASSERT(86, modelData != NULL);
|
|
mModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084);
|
|
return mModel != NULL ? TRUE : FALSE;
|
|
}
|
|
|
|
int daObjCRVSTEEL_c::create() {
|
|
fopAcM_ct(this, daObjCRVSTEEL_c);
|
|
int rv = dComIfG_resLoad(&mPhase, l_arcName);
|
|
if (rv == cPhs_COMPLEATE_e) {
|
|
gravity = -9.0f;
|
|
int dzb_id = dComIfG_getObjctResName2Index(l_arcName, "U_CrvSteelGate.dzb");
|
|
if (dzb_id == -1) {
|
|
// "dzb data not found!<%s>"
|
|
OS_REPORT("dzbデータが見つかりませんでした!<%s>\n\n", l_arcName);
|
|
JUT_ASSERT(443, dzb_id != -1);
|
|
}
|
|
rv = MoveBGCreate(l_arcName, dzb_id, dBgS_MoveBGProc_TypicalRotY, 0x4000, NULL);
|
|
if (rv == cPhs_ERROR_e) {
|
|
return rv;
|
|
}
|
|
mAcch.Set(fopAcM_GetPosition_p(this), fopAcM_GetOldPosition_p(this), this, 1,
|
|
&mAcchCir, fopAcM_GetSpeed_p(this), NULL, NULL);
|
|
fopAcM_SetMtx(this, mModel->getBaseTRMtx());
|
|
cXyz cStack_30(current.pos.x, current.pos.y + 100.0f,
|
|
current.pos.z);
|
|
if (fopAcM_gc_c::gndCheck(&cStack_30)) {
|
|
current.pos.y = fopAcM_gc_c::getGroundY();
|
|
mMinHeight = current.pos.y;
|
|
}
|
|
fopAcM_setCullSizeBox(this, -400.0f, 0.0f, -50.0f, 400.0f, 900.0f, 50.0f);
|
|
daObjCRVSTEEL_Execute(this);
|
|
}
|
|
return rv;
|
|
}
|
|
|
|
static int daObjCRVSTEEL_IsDelete(daObjCRVSTEEL_c* param_0) {
|
|
return 1;
|
|
}
|
|
|
|
int daObjCRVSTEEL_c::Create() {
|
|
fopAcM_setCullSizeBox(this, -1000.0f, -500.0f, -1000.0f, 1000.0f, 500.0, 1000.0f);
|
|
return cPhs_COMPLEATE_e;
|
|
}
|
|
|
|
int daObjCRVSTEEL_c::Execute(Mtx** param_1) {
|
|
Action();
|
|
*param_1 = &mBgMtx;
|
|
setBaseMtx();
|
|
return 1;
|
|
}
|
|
|
|
int daObjCRVSTEEL_c::Draw() {
|
|
g_env_light.settingTevStruct(8, ¤t.pos, &tevStr);
|
|
g_env_light.setLightTevColorType_MAJI(mModel, &tevStr);
|
|
dComIfGd_setListBG();
|
|
mDoExt_modelUpdateDL(mModel);
|
|
return 1;
|
|
}
|
|
|
|
int daObjCRVSTEEL_c::Delete() {
|
|
dComIfG_resDelete(&mPhase, l_arcName);
|
|
return 1;
|
|
}
|
|
|
|
static actor_method_class l_daObjCRVSTEEL_Method = {
|
|
(process_method_func)daObjCRVSTEEL_Create,
|
|
(process_method_func)daObjCRVSTEEL_Delete,
|
|
(process_method_func)daObjCRVSTEEL_Execute,
|
|
(process_method_func)daObjCRVSTEEL_IsDelete,
|
|
(process_method_func)daObjCRVSTEEL_Draw,
|
|
};
|
|
|
|
actor_process_profile_definition g_profile_Obj_CRVSTEEL = {
|
|
/* Layer ID */ fpcLy_CURRENT_e,
|
|
/* List ID */ 3,
|
|
/* List Prio */ fpcPi_CURRENT_e,
|
|
/* Proc Name */ fpcNm_Obj_CRVSTEEL_e,
|
|
/* Proc SubMtd */ &g_fpcLf_Method.base,
|
|
/* Size */ sizeof(daObjCRVSTEEL_c),
|
|
/* Size Other */ 0,
|
|
/* Parameters */ 0,
|
|
/* Leaf SubMtd */ &g_fopAc_Method.base,
|
|
/* Draw Prio */ fpcDwPi_Obj_CRVSTEEL_e,
|
|
/* Actor SubMtd */ &l_daObjCRVSTEEL_Method,
|
|
/* Status */ fopAcStts_UNK_0x40000_e | fopAcStts_CULL_e | fopAcStts_NOEXEC_e,
|
|
/* Group */ fopAc_ACTOR_e,
|
|
/* Cull Type */ fopAc_CULLBOX_CUSTOM_e,
|
|
};
|