mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-12 03:17:39 -04:00
daTbox2 handling
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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(¤t.pos, item_no, 1, -1, -1, NULL, NULL);
|
||||
partner_id = fopAcM_createItemForPresentDemo(¤t.pos, item_no, 1, -1, -1, NULL, NULL IF_DUSK_ARG(giveTag));
|
||||
} else {
|
||||
partner_id = fopAcM_createItemForTrBoxDemo(¤t.pos, item_no, -1, -1, NULL, NULL);
|
||||
partner_id = fopAcM_createItemForTrBoxDemo(¤t.pos, item_no, -1, -1, NULL, NULL IF_DUSK_ARG(giveTag));
|
||||
}
|
||||
|
||||
if (partner_id != -1) {
|
||||
|
||||
Reference in New Issue
Block a user