mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-25 15:05:06 -04:00
877889c510
* Remove NDEBUG_DEFINED fakematch, clean up getName temps * Fix ifdef * Fix bad JSystem pch ifdef breaking decomp.me * Remove Acch Chk fakematches * Private Acch fields * Fix some clangd errors in headers * Add UNUSED macro for matching debug parameters * Enable clangd unused-parameter warning * Remove extern from initializers Probably added by dol2asm? * Fix process profile definitions * Remove leftover dol2asm address comments * Remove some unnecessary double casts * Enable some more clangd warnings * Fix missing usages of fopAcM_ct * Fix wrong enum usage * Fix more fakematches
126 lines
3.1 KiB
C++
126 lines
3.1 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() {
|
|
dComIfG_inf_c& dcomif = g_dComIfG_gameInfo;
|
|
if (dcomif.play.getEvent().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) {
|
|
dcomif.play.getEvent().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)) {
|
|
dcomif.play.getEvent().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 = {
|
|
fpcLy_CURRENT_e,
|
|
7,
|
|
fpcPi_CURRENT_e,
|
|
PROC_TALK,
|
|
&g_fpcLf_Method.base,
|
|
sizeof(daTalk_c),
|
|
0,
|
|
0,
|
|
&g_fopAc_Method.base,
|
|
766,
|
|
&l_daTalk_Method,
|
|
0x44000,
|
|
fopAc_ACTOR_e,
|
|
fopAc_CULLBOX_6_e,
|
|
};
|