daTbox2 handling

This commit is contained in:
TakaRikka
2026-08-11 14:45:53 -07:00
parent 0c3bbbaba0
commit 5abc956448
2 changed files with 18 additions and 2 deletions
+3
View File
@@ -83,6 +83,9 @@ private:
/* 0xAC0 */ u8 field_0xAC0[0xAC4 - 0xAC0];
/* 0xAC4 */ int mStaffIdx;
/* 0xAC8 */ dBgW* mBoxBgW;
#if TARGET_PC
u8 mOriginalItemNo;
#endif
};
STATIC_ASSERT(sizeof(daTbox2_c) == 0xACC);
+15 -2
View File
@@ -138,6 +138,14 @@ int daTbox2_c::create1st() {
fopAcM_ct(this, daTbox2_c);
mModelType = getModelType();
#if TARGET_PC
mOriginalItemNo = getItemNo();
int tboxNo = fopAcM_GetParamBit(this, 16, 8);
const u8 resolvedItem = dusk::mods::item_check_chest(tboxNo, mOriginalItemNo, this);
u32 params = (fopAcM_GetParam(this) & 0xFFFFFF00) | resolvedItem;
fopAcM_SetParam(this, params);
#endif
int phase_state = dComIfG_resLoad(&mPhase, l_arcName);
if (phase_state == cPhs_COMPLEATE_e) {
u32 heap_size;
@@ -370,12 +378,17 @@ void daTbox2_c::actionOpenWait() {
int daTbox2_c::setGetDemoItem() {
u8 item_no = getItemNo();
#if TARGET_PC
int tboxNo = fopAcM_GetParamBit(this, 16, 8);
const u32 giveTag = dusk::mods::item_give_tag_chest(tboxNo);
item_no = dusk::mods::item_check_tagged(giveTag, mOriginalItemNo, this);
#endif
u32 partner_id;
if (mReturnRupee) {
partner_id = fopAcM_createItemForPresentDemo(&current.pos, item_no, 1, -1, -1, NULL, NULL);
partner_id = fopAcM_createItemForPresentDemo(&current.pos, item_no, 1, -1, -1, NULL, NULL IF_DUSK_ARG(giveTag));
} else {
partner_id = fopAcM_createItemForTrBoxDemo(&current.pos, item_no, -1, -1, NULL, NULL);
partner_id = fopAcM_createItemForTrBoxDemo(&current.pos, item_no, -1, -1, NULL, NULL IF_DUSK_ARG(giveTag));
}
if (partner_id != -1) {