mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-23 22:45:05 -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>
125 lines
3.4 KiB
C++
125 lines
3.4 KiB
C++
/**
|
|
* @file d_a_talk.cpp
|
|
*
|
|
*/
|
|
|
|
#include "d/dolzel_rel.h" // IWYU pragma: keep
|
|
|
|
#include "d/actor/d_a_talk.h"
|
|
#include "d/d_msg_object.h"
|
|
#include "f_op/f_op_msg_mng.h"
|
|
|
|
daTalk_c::~daTalk_c() {
|
|
dMsgObject_getMsgObjectClass()->setProcessID(-1);
|
|
}
|
|
|
|
int daTalk_c::create() {
|
|
fopAcM_ct(this, daTalk_c);
|
|
|
|
if (getStatus() != 1) {
|
|
return cPhs_ERROR_e;
|
|
}
|
|
|
|
attention_info = dMsgObject_getMsgObjectClass()->getpTalkActor()->attention_info;
|
|
mMessageID = -1;
|
|
return cPhs_COMPLEATE_e;
|
|
}
|
|
|
|
int daTalk_c::execute() {
|
|
if (dComIfGp_event_runCheck()) {
|
|
if (!eventInfo.checkCommandTalk()) {
|
|
fopAcM_delete(this);
|
|
}
|
|
} else {
|
|
if (fopAcM_searchPlayerDistanceXZ(this) >
|
|
dAttention_c::getDistTable(attention_info.distances[fopAc_attn_TALK_e]).mDistMaxRelease)
|
|
{
|
|
mMessageID = -1;
|
|
fopAcM_delete(this);
|
|
} else {
|
|
eventInfo.onCondition(dEvtCnd_CANTALK_e);
|
|
}
|
|
}
|
|
|
|
if (eventInfo.checkCommandTalk()) {
|
|
if (dMsgObject_getMsgObjectClass()->getNodeIdx() == 0xFF) {
|
|
if (mMessageID == -1) {
|
|
mMessageID = messageSet();
|
|
} else if (getStatus() == 14) {
|
|
setStatus(16);
|
|
} else if (getStatus() == 18) {
|
|
dComIfGp_event_reset();
|
|
setStatus(19);
|
|
mMessageID = -1;
|
|
fopAcM_delete(this);
|
|
}
|
|
} else if (mMessageID == -1) {
|
|
mMsgFlow.init(this, dMsgObject_getMsgObjectClass()->getNodeIdx(), 0, NULL);
|
|
mMessageID = 2;
|
|
} else if (mMsgFlow.doFlow(dMsgObject_getMsgObjectClass()->getpTalkActor(), NULL, 0)) {
|
|
dComIfGp_event_reset();
|
|
mMessageID = -1;
|
|
fopAcM_delete(this);
|
|
}
|
|
}
|
|
|
|
return 1;
|
|
}
|
|
|
|
int daTalk_c::draw() {
|
|
return 1;
|
|
}
|
|
|
|
void daTalk_c::setStatus(u16 i_status) {
|
|
dMsgObject_getMsgObjectClass()->setStatus(i_status);
|
|
}
|
|
|
|
u16 daTalk_c::getStatus() {
|
|
return dMsgObject_getMsgObjectClass()->getStatus();
|
|
}
|
|
|
|
u32 daTalk_c::messageSet() {
|
|
return fopMsgM_messageSet(dMsgObject_getMsgObjectClass()->getIdx(),
|
|
dMsgObject_getMsgObjectClass()->getpTalkActor(), 1000);
|
|
}
|
|
|
|
static int daTalk_Create(fopAc_ac_c* i_this) {
|
|
return static_cast<daTalk_c*>(i_this)->create();
|
|
}
|
|
|
|
static int daTalk_Delete(daTalk_c* i_this) {
|
|
i_this->~daTalk_c();
|
|
return 1;
|
|
}
|
|
|
|
static int daTalk_Execute(daTalk_c* i_this) {
|
|
return i_this->execute();
|
|
}
|
|
|
|
static int daTalk_Draw(daTalk_c* i_this) {
|
|
return i_this->draw();
|
|
}
|
|
|
|
static actor_method_class l_daTalk_Method = {
|
|
(process_method_func)daTalk_Create, (process_method_func)daTalk_Delete,
|
|
(process_method_func)daTalk_Execute, (process_method_func)NULL,
|
|
(process_method_func)daTalk_Draw,
|
|
};
|
|
|
|
actor_process_profile_definition g_profile_TALK = {
|
|
/* Layer ID */ fpcLy_CURRENT_e,
|
|
/* List ID */ 7,
|
|
/* List Prio */ fpcPi_CURRENT_e,
|
|
/* Proc Name */ fpcNm_TALK_e,
|
|
/* Proc SubMtd */ &g_fpcLf_Method.base,
|
|
/* Size */ sizeof(daTalk_c),
|
|
/* Size Other */ 0,
|
|
/* Parameters */ 0,
|
|
/* Leaf SubMtd */ &g_fopAc_Method.base,
|
|
/* Draw Prio */ fpcDwPi_TALK_e,
|
|
/* Actor SubMtd */ &l_daTalk_Method,
|
|
/* Status */ fopAcStts_UNK_0x40000_e | fopAcStts_UNK_0x4000_e,
|
|
/* Group */ fopAc_ACTOR_e,
|
|
/* Cull Type */ fopAc_CULLBOX_6_e,
|
|
};
|