patch flight by fowl top chest to not always start closed

This commit is contained in:
gymnast86
2026-04-26 04:12:09 -07:00
parent 7c331fdb2c
commit 01d217acb5
3 changed files with 65 additions and 0 deletions
+3
View File
@@ -64,6 +64,9 @@ public:
virtual int Delete();
virtual BOOL checkSmallTbox() { return true; }
#if TARGET_PC
u8 getTboxNo() { return fopAcM_GetParamBit(this, 16, 8);}
#endif
u8 getModelType() { return fopAcM_GetParamBit(this, 8, 4); }
u8 getItemNo() { return fopAcM_GetParamBit(this, 0, 8); }
+39
View File
@@ -10,6 +10,8 @@
#include "d/actor/d_a_midna.h"
#include <cstring>
#include "dusk/randomizer/game/verify_item_functions.h"
void daTbox2_c::initBaseMtx() {
mpModel->setBaseScale(scale);
setBaseMtx();
@@ -67,6 +69,24 @@ static dCcD_SrcCyl l_cyl_src = {
};
int daTbox2_c::Create() {
#if TARGET_PC
// If the flag for this box is set, open it
u8 tboxId = getTboxNo();
if (tboxId != 0xFF && dComIfGs_isTbox(tboxId)) {
// Set the action for not allowing the player to open it
init_actionWait();
// Set the animation frame to open
mpBck->setFrame(mpBck->getEndFrame());
// Set collision to open
if (mpBgW != NULL) {
dComIfG_Bgsp().Release(mpBgW);
}
if (mBoxBgW != NULL) {
dComIfG_Bgsp().Regist(mBoxBgW, this);
}
} else
#endif
init_actionOpenWait();
initBaseMtx();
fopAcM_SetMtx(this, mpModel->getBaseTRMtx());
@@ -138,6 +158,19 @@ int daTbox2_c::create1st() {
fopAcM_ct(this, daTbox2_c);
mModelType = getModelType();
#if TARGET_PC
if (randomizer_IsActive()) {
// Get the override item for this chest
auto stage = dComIfGp_getStartStageName();
u8 tboxId = getTboxNo();
u8 itemId = randomizer_GetContext().mTreasureChestOverrides[stage][tboxId];
// Set the item in the params
u32 params = fopAcM_GetParam(this);
params &= 0xFFFFFF00;
params |= verifyProgressiveItem(itemId);
fopAcM_SetParam(this, params);
}
#endif
int phase_state = dComIfG_resLoad(&mPhase, l_arcName);
if (phase_state == cPhs_COMPLEATE_e) {
u32 heap_size;
@@ -375,6 +408,12 @@ int daTbox2_c::setGetDemoItem() {
if (mReturnRupee) {
partner_id = fopAcM_createItemForPresentDemo(&current.pos, item_no, 1, -1, -1, NULL, NULL);
} else {
#if TARGET_PC
u8 tboxId = getTboxNo();
if (tboxId != 0xFF) {
dComIfGs_onTbox(tboxId);
}
#endif
partner_id = fopAcM_createItemForTrBoxDemo(&current.pos, item_no, -1, -1, NULL, NULL);
}
@@ -160,6 +160,29 @@ F_SP113:
- 0
- 2
# Lake Hylia
F_SP115:
# Room 0 - Main Lake
0:
# Chest at the top of isle of riches
- name: tboxEL1
parameters: 0x00000106
position:
x: -102523.015625
y: -16646.677734375
z: 43291.4296875
angle:
x: 0x0000
y: 0xA16D
z: 0x0000
patch: # Give it a unique tbox id
parameters: 0x00190106
layers:
- 1
- 2
- 3
- 4
# Sacred Grove
F_SP117:
# Room 1 - Pedestal of Time