mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-30 00:16:19 -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>
123 lines
3.5 KiB
C++
123 lines
3.5 KiB
C++
/**
|
|
* d_a_obj_suisya.cpp
|
|
* Ordon Village Water Wheel
|
|
*/
|
|
|
|
#include "d/dolzel_rel.h" // IWYU pragma: keep
|
|
|
|
#include "d/actor/d_a_obj_suisya.h"
|
|
#include "d/d_com_inf_game.h"
|
|
#include "f_pc/f_pc_name.h"
|
|
|
|
int daObj_Suisya_c::draw() {
|
|
g_env_light.settingTevStruct(0x10, ¤t.pos, &tevStr);
|
|
g_env_light.setLightTevColorType_MAJI(mpModel, &tevStr);
|
|
mDoExt_modelUpdateDL(mpModel);
|
|
|
|
cXyz sp18;
|
|
sp18.set(current.pos.x, current.pos.y + 100.0f, current.pos.z);
|
|
|
|
mShadowKey = dComIfGd_setShadow(mShadowKey, 1, mpModel, &sp18, 400.0f, 0.0f, current.pos.y,
|
|
mAcch.GetGroundH(), mAcch.m_gnd, &tevStr, 0, 1.0f,
|
|
dDlst_shadowControl_c::getSimpleTex());
|
|
return 1;
|
|
}
|
|
|
|
static int daObj_Suisya_Draw(daObj_Suisya_c* i_this) {
|
|
return i_this->draw();
|
|
}
|
|
|
|
int daObj_Suisya_c::execute() {
|
|
Z2GetAudioMgr()->seStartLevel(Z2SE_OBJ_WATERMILL_ROUND, ¤t.pos, 0, 0, 1.0f, 1.0f,
|
|
-1.0f, -1.0f, 0);
|
|
shape_angle.x += 25;
|
|
|
|
mDoMtx_stack_c::transS(current.pos);
|
|
mDoMtx_stack_c::ZXYrotM(shape_angle);
|
|
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
|
|
return 1;
|
|
}
|
|
|
|
static int daObj_Suisya_Execute(daObj_Suisya_c* i_this) {
|
|
return i_this->execute();
|
|
}
|
|
|
|
static int daObj_Suisya_IsDelete(daObj_Suisya_c* i_this) {
|
|
return 1;
|
|
}
|
|
|
|
int daObj_Suisya_c::_delete() {
|
|
dComIfG_resDelete(&mPhase, "Obj_sui");
|
|
return 1;
|
|
}
|
|
|
|
static int daObj_Suisya_Delete(daObj_Suisya_c* i_this) {
|
|
return i_this->_delete();
|
|
}
|
|
|
|
int daObj_Suisya_c::CreateHeap() {
|
|
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("Obj_sui", 3);
|
|
mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084);
|
|
if (mpModel == NULL) {
|
|
return 0;
|
|
}
|
|
|
|
return 1;
|
|
}
|
|
|
|
static int useHeapInit(fopAc_ac_c* i_this) {
|
|
return static_cast<daObj_Suisya_c*>(i_this)->CreateHeap();
|
|
}
|
|
|
|
int daObj_Suisya_c::create() {
|
|
fopAcM_ct(this, daObj_Suisya_c);
|
|
|
|
int phase = dComIfG_resLoad(&mPhase, "Obj_sui");
|
|
if (phase == cPhs_COMPLEATE_e) {
|
|
if (!fopAcM_entrySolidHeap(this, useHeapInit, 0x800)) {
|
|
return cPhs_ERROR_e;
|
|
}
|
|
|
|
attention_info.flags = 0;
|
|
cullMtx = mpModel->getBaseTRMtx();
|
|
fopAcM_SetMin(this, -200.0f, -500.0f, -500.0f);
|
|
fopAcM_SetMax(this, 200.0f, 500.0, 500.0f);
|
|
|
|
mAcch.Set(¤t.pos, &old.pos, this, 1, &mAcchCir, &speed, NULL, NULL);
|
|
mAcchCir.SetWall(0.0f, 0.0f);
|
|
health = 60;
|
|
field_0x560 = 60;
|
|
|
|
daObj_Suisya_Execute(this);
|
|
}
|
|
|
|
return phase;
|
|
}
|
|
|
|
static int daObj_Suisya_Create(daObj_Suisya_c* i_this) {
|
|
return i_this->create();
|
|
}
|
|
|
|
static actor_method_class l_daObj_Suisya_Method = {
|
|
(process_method_func)daObj_Suisya_Create, (process_method_func)daObj_Suisya_Delete,
|
|
(process_method_func)daObj_Suisya_Execute, (process_method_func)daObj_Suisya_IsDelete,
|
|
(process_method_func)daObj_Suisya_Draw,
|
|
};
|
|
|
|
actor_process_profile_definition g_profile_OBJ_SUISYA = {
|
|
/* Layer ID */ fpcLy_CURRENT_e,
|
|
/* List ID */ 7,
|
|
/* List Prio */ fpcPi_CURRENT_e,
|
|
/* Proc Name */ fpcNm_OBJ_SUISYA_e,
|
|
/* Proc SubMtd */ &g_fpcLf_Method.base,
|
|
/* Size */ sizeof(daObj_Suisya_c),
|
|
/* Size Other */ 0,
|
|
/* Parameters */ 0,
|
|
/* Leaf SubMtd */ &g_fopAc_Method.base,
|
|
/* Draw Prio */ fpcDwPi_OBJ_SUISYA_e,
|
|
/* Actor SubMtd */ &l_daObj_Suisya_Method,
|
|
/* Status */ fopAcStts_UNK_0x40000_e | fopAcStts_CULL_e,
|
|
/* Group */ fopAc_ACTOR_e,
|
|
/* Cull Type */ fopAc_CULLBOX_CUSTOM_e,
|
|
};
|