mirror of
https://github.com/zeldaret/tww.git
synced 2026-10-09 13:36:50 -04:00
Match d_a_tag_ba1 (#1211)
* Match d_a_tag_ba1 * Don't link against D44J01 * Format nits
This commit is contained in:
+1
-1
@@ -1530,7 +1530,7 @@ config.libs = [
|
||||
ActorRel(Matching, "d_a_swhit0"),
|
||||
ActorRel(Matching, "d_a_swtdoor"),
|
||||
ActorRel(Matching, "d_a_tag_attention"),
|
||||
ActorRel(NonMatching, "d_a_tag_ba1"),
|
||||
ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_tag_ba1"),
|
||||
ActorRel(Matching, "d_a_tag_event"),
|
||||
ActorRel(Matching, "d_a_tag_evsw"),
|
||||
ActorRel(Matching, "d_a_tag_ghostship"),
|
||||
|
||||
@@ -5,24 +5,32 @@
|
||||
|
||||
class daTag_Ba1_c : public fopAc_ac_c {
|
||||
public:
|
||||
void XyCheck_cB(int);
|
||||
void XyEvent_cB(int);
|
||||
void createInit();
|
||||
s16 XyCheck_cB(int);
|
||||
s16 XyEvent_cB(int);
|
||||
bool createInit();
|
||||
BOOL _draw();
|
||||
BOOL _execute();
|
||||
BOOL _delete();
|
||||
cPhs_State _create();
|
||||
|
||||
public:
|
||||
/* Place member variables here */
|
||||
/* 0x290 */ s16 mEventIds[1];
|
||||
/* 0x292 */ s16 mEventIdx;
|
||||
};
|
||||
|
||||
class daTag_Ba1_HIO_c {
|
||||
class daTag_Ba1_HIO_c : public JORReflexible {
|
||||
public:
|
||||
struct hio_prm_c {
|
||||
/* 0x0 */ u8 field_0x0;
|
||||
};
|
||||
|
||||
daTag_Ba1_HIO_c();
|
||||
virtual ~daTag_Ba1_HIO_c() {}
|
||||
|
||||
public:
|
||||
/* Place member variables here */
|
||||
/* 0x04 */ s8 mNo;
|
||||
/* 0x08 */ s32 mRefCount;
|
||||
/* 0x0C */ hio_prm_c mPrm;
|
||||
};
|
||||
|
||||
#endif /* D_A_TAG_BA1_H */
|
||||
|
||||
+68
-16
@@ -5,55 +5,107 @@
|
||||
|
||||
#include "d/dolzel_rel.h" // IWYU pragma: keep
|
||||
#include "d/actor/d_a_tag_ba1.h"
|
||||
#include "d/d_item_data.h"
|
||||
#include "m_Do/m_Do_hostIO.h"
|
||||
|
||||
static daTag_Ba1_HIO_c l_HIO;
|
||||
|
||||
/* 000000EC-00000144 .text __ct__15daTag_Ba1_HIO_cFv */
|
||||
daTag_Ba1_HIO_c::daTag_Ba1_HIO_c() {
|
||||
/* Nonmatching */
|
||||
daTag_Ba1_HIO_c::daTag_Ba1_HIO_c()
|
||||
: mPrm() {
|
||||
static hio_prm_c a_prm_tbl = {0};
|
||||
memcpy(&mPrm, &a_prm_tbl, sizeof(hio_prm_c));
|
||||
mNo = -1;
|
||||
mRefCount = -1;
|
||||
}
|
||||
|
||||
/* 00000144-00000164 .text daTag_Ba1_XyCheck_cB__FPvi */
|
||||
static void daTag_Ba1_XyCheck_cB(void*, int) {
|
||||
/* Nonmatching */
|
||||
static s16 daTag_Ba1_XyCheck_cB(void* i_this, int i_itemBtn) {
|
||||
return static_cast<daTag_Ba1_c*>(i_this)->XyCheck_cB(i_itemBtn);
|
||||
}
|
||||
|
||||
/* 00000164-00000184 .text XyCheck_cB__11daTag_Ba1_cFi */
|
||||
void daTag_Ba1_c::XyCheck_cB(int) {
|
||||
/* Nonmatching */
|
||||
s16 daTag_Ba1_c::XyCheck_cB(int i_itemBtn) {
|
||||
return dComIfGp_getSelectItem(i_itemBtn) == dItemNo_FAIRY_BOTTLE_e;
|
||||
}
|
||||
|
||||
/* 00000184-000001A4 .text daTag_Ba1_XyEvent_cB__FPvi */
|
||||
static void daTag_Ba1_XyEvent_cB(void*, int) {
|
||||
/* Nonmatching */
|
||||
static s16 daTag_Ba1_XyEvent_cB(void* i_this, int i_itemBtn) {
|
||||
return static_cast<daTag_Ba1_c*>(i_this)->XyEvent_cB(i_itemBtn);
|
||||
}
|
||||
|
||||
/* 000001A4-000001C0 .text XyEvent_cB__11daTag_Ba1_cFi */
|
||||
void daTag_Ba1_c::XyEvent_cB(int) {
|
||||
/* Nonmatching */
|
||||
s16 daTag_Ba1_c::XyEvent_cB(int /* i_itemBtn */) {
|
||||
mEventIdx = 0;
|
||||
return mEventIds[this->mEventIdx];
|
||||
}
|
||||
|
||||
static const char* l_evn_tbl[1] = {"Use_Fairy"};
|
||||
|
||||
/* 000001C0-00000288 .text createInit__11daTag_Ba1_cFv */
|
||||
void daTag_Ba1_c::createInit() {
|
||||
/* Nonmatching */
|
||||
bool daTag_Ba1_c::createInit() {
|
||||
bool needsInit = dComIfGs_isEventBit(dSv_event_flag_c::UNK_0520);
|
||||
if (!needsInit) {
|
||||
return needsInit;
|
||||
}
|
||||
|
||||
needsInit = !dComIfGs_isEventBit(dSv_event_flag_c::GRANDMA_HEALED);
|
||||
if (needsInit) {
|
||||
attention_info.flags = fopAc_Attn_ACTION_SPEAK_e;
|
||||
attention_info.distances[fopAc_Attn_TYPE_SPEAK_e] = 0x1a;
|
||||
mEventIds[0] = dComIfGp_evmng_getEventIdx(l_evn_tbl[0], 0xff);
|
||||
eventInfo.setXyCheckCB(daTag_Ba1_XyCheck_cB);
|
||||
eventInfo.setXyEventCB(daTag_Ba1_XyEvent_cB);
|
||||
}
|
||||
|
||||
return needsInit;
|
||||
}
|
||||
|
||||
/* 00000288-00000290 .text _draw__11daTag_Ba1_cFv */
|
||||
BOOL daTag_Ba1_c::_draw() {
|
||||
/* Nonmatching */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 00000290-00000340 .text _execute__11daTag_Ba1_cFv */
|
||||
BOOL daTag_Ba1_c::_execute() {
|
||||
/* Nonmatching */
|
||||
int staffId = -1;
|
||||
if (dComIfGp_event_runCheck()) {
|
||||
if (eventInfo.getCommand() != dEvtCmd_INTALK_e) {
|
||||
staffId = dComIfGp_evmng_getMyStaffId("TagBa1", NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (staffId >= 0) {
|
||||
if (dComIfGp_evmng_endCheck(mEventIds[mEventIdx]) != 0) {
|
||||
dComIfGp_event_onEventFlag(dEvtFlag_UNK8_e);
|
||||
fopAcM_delete(this);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 00000340-00000394 .text _delete__11daTag_Ba1_cFv */
|
||||
BOOL daTag_Ba1_c::_delete() {
|
||||
/* Nonmatching */
|
||||
if (l_HIO.mRefCount >= 0 && --l_HIO.mRefCount < 0) {
|
||||
mDoHIO_deleteChild(l_HIO.mNo);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 00000394-00000454 .text _create__11daTag_Ba1_cFv */
|
||||
cPhs_State daTag_Ba1_c::_create() {
|
||||
/* Nonmatching */
|
||||
if (l_HIO.mRefCount < 0) {
|
||||
l_HIO.mNo = mDoHIO_createChild("おばあちゃんタグ", &l_HIO);
|
||||
}
|
||||
|
||||
l_HIO.mRefCount++;
|
||||
fopAcM_SetupActor(this, daTag_Ba1_c);
|
||||
if (!createInit()) {
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
return cPhs_COMPLEATE_e;
|
||||
}
|
||||
|
||||
/* 00000454-00000474 .text daTag_Ba1_Create__FP10fopAc_ac_c */
|
||||
|
||||
Reference in New Issue
Block a user