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>
133 lines
3.1 KiB
C++
133 lines
3.1 KiB
C++
/**
|
|
* @file d_a_obj_kiPot.cpp
|
|
*
|
|
*/
|
|
|
|
#include "d/dolzel_rel.h" // IWYU pragma: keep
|
|
|
|
#include "d/actor/d_a_obj_kiPot.h"
|
|
#include "d/d_com_inf_game.h"
|
|
|
|
static daKiPot_HIO_c l_HIO;
|
|
|
|
static cull_box l_cull_box = {
|
|
{-50.0f, 0.0f, -50.0f},
|
|
{50.0f, 100.0f, 50.0f},
|
|
};
|
|
|
|
daKiPot_HIO_c::daKiPot_HIO_c() {
|
|
field_0x06 = 0x14;
|
|
}
|
|
|
|
void daKiPot_c::setBaseMtx() {
|
|
mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z);
|
|
mDoMtx_stack_c::ZXYrotM(shape_angle.x, shape_angle.y, shape_angle.z);
|
|
}
|
|
|
|
int daKiPot_c::create() {
|
|
fopAcM_ct(this, daKiPot_c);
|
|
|
|
setBaseMtx();
|
|
|
|
f32 min_x = l_cull_box.min.x * scale.x;
|
|
f32 min_y = l_cull_box.min.y * scale.y;
|
|
f32 min_z = l_cull_box.min.z * scale.x;
|
|
f32 max_x = l_cull_box.max.x * scale.x;
|
|
f32 max_y = l_cull_box.max.y * scale.y;
|
|
fopAcM_setCullSizeBox(this, min_x, min_y, min_z, max_x, max_y, max_y);
|
|
|
|
field_0x575 = 0;
|
|
init_modeWait();
|
|
|
|
return cPhs_COMPLEATE_e;
|
|
}
|
|
|
|
int daKiPot_c::Execute() {
|
|
procMain();
|
|
attention_info.position = current.pos;
|
|
attention_info.position.y += 150.0f;
|
|
eyePos = current.pos;
|
|
setBaseMtx();
|
|
return 1;
|
|
}
|
|
|
|
void daKiPot_c::procMain() {
|
|
typedef void (daKiPot_c::*modeProcessFunc)();
|
|
static modeProcessFunc mode_proc[] = {
|
|
&daKiPot_c::modeWait,
|
|
};
|
|
|
|
(this->*mode_proc[mMode])();
|
|
}
|
|
|
|
void daKiPot_c::init_modeWait() {
|
|
mMode = 0;
|
|
}
|
|
|
|
void daKiPot_c::modeWait() {
|
|
if (chkEvent() && eventInfo.checkCommandCatch() == 0) {
|
|
dComIfGp_att_CatchRequest(this, dItemNo_UGLY_SOUP_e, 100.0f, 50.0f, -50.0f, 0x2000, 1);
|
|
eventInfo.onCondition(dEvtCnd_40_e);
|
|
}
|
|
}
|
|
|
|
s32 daKiPot_c::chkEvent() {
|
|
s32 result = 1;
|
|
|
|
if (!dComIfGp_getEvent()->isOrderOK()) {
|
|
result = 0;
|
|
|
|
if (eventInfo.checkCommandCatch()) {
|
|
return result;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
|
|
int daKiPot_c::Draw() {
|
|
return 1;
|
|
}
|
|
|
|
int daKiPot_c::Delete() {
|
|
return 1;
|
|
}
|
|
|
|
static int daKiPot_Draw(daKiPot_c* i_this) {
|
|
return i_this->Draw();
|
|
}
|
|
|
|
static int daKiPot_Execute(daKiPot_c* i_this) {
|
|
return i_this->Execute();
|
|
}
|
|
|
|
static int daKiPot_Delete(daKiPot_c* i_this) {
|
|
return i_this->Delete();
|
|
}
|
|
|
|
static int daKiPot_Create(fopAc_ac_c* i_this) {
|
|
return static_cast<daKiPot_c*>(i_this)->create();
|
|
}
|
|
|
|
static actor_method_class l_daKiPot_Method = {
|
|
(process_method_func)daKiPot_Create, (process_method_func)daKiPot_Delete,
|
|
(process_method_func)daKiPot_Execute, 0,
|
|
(process_method_func)daKiPot_Draw,
|
|
};
|
|
|
|
actor_process_profile_definition g_profile_Obj_KiPot = {
|
|
/* Layer ID */ fpcLy_CURRENT_e,
|
|
/* List ID */ 7,
|
|
/* List Prio */ fpcPi_CURRENT_e,
|
|
/* Proc Name */ fpcNm_Obj_KiPot_e,
|
|
/* Proc SubMtd */ &g_fpcLf_Method.base,
|
|
/* Size */ sizeof(daKiPot_c),
|
|
/* Size Other */ 0,
|
|
/* Parameters */ 0,
|
|
/* Leaf SubMtd */ &g_fopAc_Method.base,
|
|
/* Draw Prio */ fpcDwPi_Obj_KiPot_e,
|
|
/* Actor SubMtd */ &l_daKiPot_Method,
|
|
/* Status */ fopAcStts_UNK_0x40000_e | fopAcStts_UNK_0x4000_e,
|
|
/* Group */ fopAc_ACTOR_e,
|
|
/* Cull Type */ fopAc_CULLBOX_CUSTOM_e,
|
|
};
|