mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-30 16:35:26 -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>
120 lines
3.6 KiB
C++
120 lines
3.6 KiB
C++
/**
|
|
* d_a_obj_digholl.cpp
|
|
* Object - Dig Hole
|
|
*/
|
|
|
|
#include "d/dolzel_rel.h" // IWYU pragma: keep
|
|
|
|
#include "d/actor/d_a_obj_digholl.h"
|
|
#include "d/actor/d_a_player.h"
|
|
#include "f_op/f_op_actor_mng.h"
|
|
|
|
int daObjDigholl_c::create() {
|
|
fopAcM_ct(this, daObjDigholl_c);
|
|
field_0x569 = fopAcM_GetParam(this);
|
|
field_0x56a = fopAcM_GetParam(this) >> 8;
|
|
field_0x56c = fopAcM_GetParam(this) >> 0x10 & 0xff;
|
|
if (field_0x56c == 0xff) {
|
|
field_0x56c = -1;
|
|
}
|
|
if (fopAcM_isSwitch(this, field_0x569)) {
|
|
field_0x568 = 2;
|
|
field_0x56b = 1;
|
|
}
|
|
fopAcM_SetMin(this, -60.0f, 0.0f, -100.0f);
|
|
fopAcM_SetMax(this, 60.0f, 10.0f, 100.0f);
|
|
attention_info.position = current.pos;
|
|
eyePos = attention_info.position;
|
|
attention_info.distances[fopAc_attn_ETC_e] = 0x20;
|
|
return cPhs_COMPLEATE_e;
|
|
}
|
|
|
|
static int daObjDigholl_Create(fopAc_ac_c* i_this) {
|
|
return static_cast<daObjDigholl_c*>(i_this)->create();
|
|
}
|
|
|
|
daObjDigholl_c::~daObjDigholl_c() {}
|
|
|
|
static int daObjDigholl_Delete(daObjDigholl_c* i_this) {
|
|
i_this->~daObjDigholl_c();
|
|
return 1;
|
|
}
|
|
|
|
int daObjDigholl_c::execute() {
|
|
daPy_py_c* player = daPy_getLinkPlayerActorClass();
|
|
if (player->checkNowWolf() &&
|
|
(field_0x56a == 0xff || fopAcM_isSwitch(this, field_0x56a)) &&
|
|
(f32)fabsf(current.pos.y - player->current.pos.y) < 40.0f)
|
|
{
|
|
attention_info.flags = fopAc_AttnFlag_ETC_e;
|
|
} else {
|
|
attention_info.flags = 0;
|
|
}
|
|
if (field_0x568 == 1) {
|
|
if (cLib_distanceAngleS(player->shape_angle.y, shape_angle.y) < 0x6000) {
|
|
shape_angle.y = player->shape_angle.y + 0x10000 - 0x8000;
|
|
current.angle.y = shape_angle.y;
|
|
}
|
|
fopAcM_onSwitch(this, field_0x569);
|
|
|
|
if (dComIfGp_event_runCheck()) {
|
|
if (player->getBaseAnimeFrame() > 35.0f) {
|
|
field_0x56b = 1;
|
|
}
|
|
} else {
|
|
field_0x568 = 2;
|
|
field_0x56b = 1;
|
|
}
|
|
} else {
|
|
if ((player->current.pos.abs2XZ(current.pos) < 250000.0f) &&
|
|
(fabsf(current.pos.y - player->current.pos.y) < 200.0f))
|
|
{
|
|
daPy_py_c::setLookPos(&attention_info.position);
|
|
}
|
|
}
|
|
|
|
if (player->current.pos.abs(current.pos) < 1000.0f) {
|
|
dComIfGp_particle_setSimple(0x70f, ¤t.pos, 0xff, g_whiteColor, g_whiteColor, 0,
|
|
0.0f);
|
|
dComIfGp_particle_setSimple(0x73d, ¤t.pos, 0xff, g_whiteColor, g_whiteColor, 0,
|
|
0.0f);
|
|
}
|
|
|
|
return 1;
|
|
}
|
|
|
|
static int daObjDigholl_Execute(daObjDigholl_c* i_this) {
|
|
return i_this->execute();
|
|
}
|
|
|
|
int daObjDigholl_c::draw() {
|
|
return 1;
|
|
}
|
|
|
|
static int daObjDigholl_Draw(daObjDigholl_c* i_this) {
|
|
return i_this->draw();
|
|
}
|
|
|
|
static actor_method_class l_daObjDigholl_Method = {
|
|
(process_method_func)daObjDigholl_Create, (process_method_func)daObjDigholl_Delete,
|
|
(process_method_func)daObjDigholl_Execute, (process_method_func)NULL,
|
|
(process_method_func)daObjDigholl_Draw,
|
|
};
|
|
|
|
actor_process_profile_definition g_profile_Obj_Digholl = {
|
|
/* Layer ID */ fpcLy_CURRENT_e,
|
|
/* List ID */ 3,
|
|
/* List Prio */ fpcPi_CURRENT_e,
|
|
/* Proc Name */ fpcNm_Obj_Digholl_e,
|
|
/* Proc SubMtd */ &g_fpcLf_Method.base,
|
|
/* Size */ sizeof(daObjDigholl_c),
|
|
/* Size Other */ 0,
|
|
/* Parameters */ 0,
|
|
/* Leaf SubMtd */ &g_fopAc_Method.base,
|
|
/* Draw Prio */ fpcDwPi_Obj_Digholl_e,
|
|
/* Actor SubMtd */ &l_daObjDigholl_Method,
|
|
/* Status */ fopAcStts_UNK_0x40000_e | fopAcStts_UNK_0x4000_e | fopAcStts_CULL_e,
|
|
/* Group */ fopAc_ENV_e,
|
|
/* Cull Type */ fopAc_CULLBOX_CUSTOM_e,
|
|
};
|