From 631882028e1514d02831fa5a37ae7fe72b7996a7 Mon Sep 17 00:00:00 2001 From: Demur Rumed Date: Sat, 21 Jun 2025 14:14:48 +0000 Subject: [PATCH] remove tree graphic, crate csmc --- .../objects/object_rando_tree/gRandoTreeDL | 12 -- .../gRandoTreeDLTriforceTexture32.rgba16 | Bin 2140 -> 0 bytes .../object_rando_tree/gRandoTreeDL_tri_0 | 12 -- .../object_rando_tree/gRandoTreeDL_tri_1 | 9 -- .../object_rando_tree/gRandoTreeDL_vtx_0 | 32 ----- .../object_rando_tree/gRandoTreeDL_vtx_1 | 18 --- .../object_rando_tree/gRandoTreeDL_vtx_cull | 10 -- .../mat_gRandoTreeDL_treeTexMaterial | 16 --- .../mat_gRandoTreeDL_triforceTexMaterial | 16 --- .../mat_revert_gRandoTreeDL_treeTexMaterial | 6 - ...at_revert_gRandoTreeDL_triforceTexMaterial | 6 - soh/assets/soh_assets.h | 3 - .../Enhancements/randomizer/ShuffleTrees.cpp | 109 ++++++++++++------ 13 files changed, 73 insertions(+), 176 deletions(-) delete mode 100644 soh/assets/custom/objects/object_rando_tree/gRandoTreeDL delete mode 100644 soh/assets/custom/objects/object_rando_tree/gRandoTreeDLTriforceTexture32.rgba16 delete mode 100644 soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_tri_0 delete mode 100644 soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_tri_1 delete mode 100644 soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_vtx_0 delete mode 100644 soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_vtx_1 delete mode 100644 soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_vtx_cull delete mode 100644 soh/assets/custom/objects/object_rando_tree/mat_gRandoTreeDL_treeTexMaterial delete mode 100644 soh/assets/custom/objects/object_rando_tree/mat_gRandoTreeDL_triforceTexMaterial delete mode 100644 soh/assets/custom/objects/object_rando_tree/mat_revert_gRandoTreeDL_treeTexMaterial delete mode 100644 soh/assets/custom/objects/object_rando_tree/mat_revert_gRandoTreeDL_triforceTexMaterial diff --git a/soh/assets/custom/objects/object_rando_tree/gRandoTreeDL b/soh/assets/custom/objects/object_rando_tree/gRandoTreeDL deleted file mode 100644 index 8ab80efae..000000000 --- a/soh/assets/custom/objects/object_rando_tree/gRandoTreeDL +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/soh/assets/custom/objects/object_rando_tree/gRandoTreeDLTriforceTexture32.rgba16 b/soh/assets/custom/objects/object_rando_tree/gRandoTreeDLTriforceTexture32.rgba16 deleted file mode 100644 index 256efd65a2a477f136c33b04119d02f306594ded..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2140 zcma)7J&Wr`6!l~fj@e@W!YjRFiPg zF$iOVN^j}%wdqploRPiTq{v?MVa+}F+`0GM+1YG1`!)ULXMyM6fBtdhh1dW6_Z>Vx z-L47r+YhrDuJ32FM8-b$iA?0uFY!iO4lw-s^dH9WFnR==5CQdppQ7Bo0^;s*!%tCg zS5irh3zmla^e&W)eQ7#fx~GVFB@x$kqZ>TaL@NG{CX_a|(Wy4dyvITmZQ6dUF1-zV zi9Mt1)NT=D%l+yme^4oL!QijJddmfGo4(TntTPERxMfQJR5#$4w#m+kdB+>e41f=2 ztZOS^fgh{qNQFIUQ#|C0d|`ptCOhYgC!uTNEOSV+6SKCdt!?A5_o0I6!Hl&%vrkGE z547wY_e$oA;vo^t9sVg%*_p9ejWQh!b04b_5#FNRmNiQvdoDj`r+lGL$}kf}BpI9R z1UxQs7xTR%p6C(#@66bgE8@L&2RvoSA6UlFrqtl}qhs9$eH2Ha$v;-#^x7eV z6|_bk?4Olj-CTK8{@6a`%JK)>uD6j)u-}Irkp6boO5BvfdqhicEJMj*7^Cm8R z;D&O;8+35!+p4WD)jxe{s9d7#srU(~b6}tF__}jf@zR&N6vexhg1@r96o>u@-9o!5 zs$S=J{w8ZIrV8qeF21eSm37u>je4NU!6aF-VN+dYnJzJl&@XqvSwL4%kyR4K{>5Kq z>(@FPup1Y$qq6xII)~c0(P_+6?5P=bW58raNu;qhy1jeWU{AB5TotQgjyOK_EiFvz zj`AuUy2w3H2Vvr%D=1UGiZ?L;@0|6_tei7KnPwjS!u<!6I$p^6dk;mn{av7e}r ztU9&+RTh|D>a2*0`Fcwp>(>4iDj29NfACP+N=5WhX*|S(b}#-m?a1*NePmsVc~)Uo zSXtws!w%XS-JmZ$l(a$wscW3OI7c^rgkC}fGgL>p#@Pqnn)^e)!QLW14Eb>`_gG~W zY!d^m%^u%E{-TpuM-@uWOHfN-hl(aubx`Hlzkz`#tTM|Xkj*pjv_Nn4rlxm7}}LSL!&mp6sD^A71e07ck+;%s7FVK|Fb(1O6(m z;#n4EgTC&~p+EF{oDh3t(+1SUb?B!^w^h`Y9`yVQ{%48v$HCAkbb~tLbfIQ9Lw+js zfZxM<1U1w|V73~CsZmyMKTO$Vp3LvR^T+&AZ6^;!ufO!xj`^eB{fHHs-aR2gJYafu d%EEJ};SYPiKQSvr43Ssp_I%=?>hOPU_!m^vAPxWk diff --git a/soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_tri_0 b/soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_tri_0 deleted file mode 100644 index 16bbada99..000000000 --- a/soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_tri_0 +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_tri_1 b/soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_tri_1 deleted file mode 100644 index 136154b4c..000000000 --- a/soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_tri_1 +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_vtx_0 b/soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_vtx_0 deleted file mode 100644 index e92b51e78..000000000 --- a/soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_vtx_0 +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_vtx_1 b/soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_vtx_1 deleted file mode 100644 index adf256fc1..000000000 --- a/soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_vtx_1 +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_vtx_cull b/soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_vtx_cull deleted file mode 100644 index ea47c02e0..000000000 --- a/soh/assets/custom/objects/object_rando_tree/gRandoTreeDL_vtx_cull +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/soh/assets/custom/objects/object_rando_tree/mat_gRandoTreeDL_treeTexMaterial b/soh/assets/custom/objects/object_rando_tree/mat_gRandoTreeDL_treeTexMaterial deleted file mode 100644 index 219a71f77..000000000 --- a/soh/assets/custom/objects/object_rando_tree/mat_gRandoTreeDL_treeTexMaterial +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/soh/assets/custom/objects/object_rando_tree/mat_gRandoTreeDL_triforceTexMaterial b/soh/assets/custom/objects/object_rando_tree/mat_gRandoTreeDL_triforceTexMaterial deleted file mode 100644 index a95fff2b0..000000000 --- a/soh/assets/custom/objects/object_rando_tree/mat_gRandoTreeDL_triforceTexMaterial +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/soh/assets/custom/objects/object_rando_tree/mat_revert_gRandoTreeDL_treeTexMaterial b/soh/assets/custom/objects/object_rando_tree/mat_revert_gRandoTreeDL_treeTexMaterial deleted file mode 100644 index ee8de0c37..000000000 --- a/soh/assets/custom/objects/object_rando_tree/mat_revert_gRandoTreeDL_treeTexMaterial +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/soh/assets/custom/objects/object_rando_tree/mat_revert_gRandoTreeDL_triforceTexMaterial b/soh/assets/custom/objects/object_rando_tree/mat_revert_gRandoTreeDL_triforceTexMaterial deleted file mode 100644 index ee8de0c37..000000000 --- a/soh/assets/custom/objects/object_rando_tree/mat_revert_gRandoTreeDL_triforceTexMaterial +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/soh/assets/soh_assets.h b/soh/assets/soh_assets.h index e3e2f4780..3c3ddcf5a 100644 --- a/soh/assets/soh_assets.h +++ b/soh/assets/soh_assets.h @@ -77,9 +77,6 @@ static const ALIGN_ASSET(2) char gBossSoulSkullDL[] = dgBossSoulSkullDL; #define dgRandoPotDL "__OTR__objects/gameplay_dangeon_keep/gRandoPotDL" static const ALIGN_ASSET(2) char gRandoPotDL[] = dgRandoPotDL; -#define dgRandoTreeDL "__OTR__objects/object_rando_tree/gRandoTreeDL" -static const ALIGN_ASSET(2) char gRandoTreeDL[] = dgRandoTreeDL; - #define dgRandoBushDL "__OTR__objects/gameplay_field_keep/gFieldBushRandomDL" static const ALIGN_ASSET(2) char gRandoBushDL[] = dgRandoBushDL; diff --git a/soh/soh/Enhancements/randomizer/ShuffleTrees.cpp b/soh/soh/Enhancements/randomizer/ShuffleTrees.cpp index a5c70bf3e..502a91d99 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleTrees.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleTrees.cpp @@ -6,6 +6,7 @@ extern "C" { #include "variables.h" #include "src/overlays/actors/ovl_En_Wood02/z_en_wood02.h" #include "objects/object_wood02/object_wood02.h" +#include "soh/Enhancements/enhancementTypes.h" extern PlayState* gPlayState; void EnWood02_Draw(Actor*, PlayState*); } @@ -41,45 +42,82 @@ uint8_t EnWood02_RandomizerHoldsItem(EnWood02* treeActor, PlayState* play) { } extern "C" void EnWood02_RandomizerDraw(Actor* thisx, PlayState* play) { - EnWood02* thisy = (EnWood02*)thisx; - s16 type = thisy->actor.params; - u8 red; - u8 green; - u8 blue; + GetItemCategory getItemCategory; + auto treeActor = (EnWood02*)thisx; + int csmc = CVarGetInteger(CVAR_ENHANCEMENT("ChestSizeAndTextureMatchContents"), CSMC_DISABLED); + int requiresStoneAgony = CVarGetInteger(CVAR_ENHANCEMENT("ChestSizeDependsStoneOfAgony"), 0); - if ((type == WOOD_TREE_OVAL_GREEN_SPAWNER) || (type == WOOD_TREE_OVAL_GREEN_SPAWNED) || - (type == WOOD_TREE_OVAL_GREEN) || (type == WOOD_LEAF_GREEN)) { - red = 50; - green = 170; - blue = 70; - } else if ((type == WOOD_TREE_OVAL_YELLOW_SPAWNER) || (type == WOOD_TREE_OVAL_YELLOW_SPAWNED) || - (type == WOOD_LEAF_YELLOW)) { - red = 180; - green = 155; - blue = 0; - } else { - red = green = blue = 255; + int isVanilla = + csmc == CSMC_DISABLED || csmc == CSMC_SIZE || (requiresStoneAgony && !CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY)); + + if (isVanilla || treeActor->treeId.randomizerCheck == RC_UNKNOWN_CHECK) { + return; } - OPEN_DISPS(play->state.gfxCtx); - Gfx_SetupDL_25Xlu(play->state.gfxCtx); - if ((thisy->actor.params == WOOD_LEAF_GREEN) || (thisy->actor.params == WOOD_LEAF_YELLOW)) { - Gfx_SetupDL_25Opa(play->state.gfxCtx); - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, red, green, blue, 127); - Gfx_DrawDListOpa(play, (Gfx*)gRandoTreeDL); - } else if (D_80B3BF70[thisy->drawType & 0xF] != NULL) { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, red, green, blue, 0); - Gfx_DrawDListOpa(play, (Gfx*)gRandoTreeDL); - gDPSetEnvColor(POLY_XLU_DISP++, red, green, blue, 0); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), - G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_80B3BF70[thisy->drawType & 0xF]); - } - CLOSE_DISPS(play->state.gfxCtx); + GetItemEntry smallCrateItem = + Rando::Context::GetInstance()->GetFinalGIEntry(treeActor->treeId.randomizerCheck, true, GI_NONE); + getItemCategory = smallCrateItem.getItemCategory; - if (!EnWood02_RandomizerHoldsItem(thisy, gPlayState)) { - thisy->actor.draw = (ActorFunc)EnWood02_Draw; + // If they have bombchus, don't consider the bombchu item major + if (INV_CONTENT(ITEM_BOMBCHU) == ITEM_BOMBCHU && + ((smallCrateItem.modIndex == MOD_RANDOMIZER && smallCrateItem.getItemId == RG_PROGRESSIVE_BOMBCHUS) || + (smallCrateItem.modIndex == MOD_NONE && + (smallCrateItem.getItemId == GI_BOMBCHUS_5 || smallCrateItem.getItemId == GI_BOMBCHUS_10 || + smallCrateItem.getItemId == GI_BOMBCHUS_20)))) { + getItemCategory = ITEM_CATEGORY_JUNK; + // If it's a bottle and they already have one, consider the item lesser + } else if ((smallCrateItem.modIndex == MOD_RANDOMIZER && smallCrateItem.getItemId >= RG_BOTTLE_WITH_RED_POTION && + smallCrateItem.getItemId <= RG_BOTTLE_WITH_POE) || + (smallCrateItem.modIndex == MOD_NONE && + (smallCrateItem.getItemId == GI_BOTTLE || smallCrateItem.getItemId == GI_MILK_BOTTLE))) { + if (gSaveContext.inventory.items[SLOT_BOTTLE_1] != ITEM_NONE) { + getItemCategory = ITEM_CATEGORY_LESSER; + } } + + GraphicsContext* gfxCtx = play->state.gfxCtx; + OPEN_DISPS(gfxCtx); + Matrix_Push(); + + // Change texture + switch (getItemCategory) { + case ITEM_CATEGORY_MAJOR: + Matrix_Scale(0.1, 0.05, 0.1, MTXMODE_APPLY); + Gfx_DrawDListOpa(play, (Gfx*)gSmallMajorCrateDL); + break; + case ITEM_CATEGORY_SKULLTULA_TOKEN: + Matrix_Scale(0.1, 0.05, 0.1, MTXMODE_APPLY); + Gfx_DrawDListOpa(play, (Gfx*)gSmallTokenCrateDL); + break; + case ITEM_CATEGORY_SMALL_KEY: + Matrix_Scale(0.1, 0.05, 0.1, MTXMODE_APPLY); + Gfx_DrawDListOpa(play, (Gfx*)gSmallSmallKeyCrateDL); + break; + case ITEM_CATEGORY_BOSS_KEY: + Matrix_Scale(0.1, 0.05, 0.1, MTXMODE_APPLY); + Gfx_DrawDListOpa(play, (Gfx*)gSmallBossKeyCrateDL); + break; + case ITEM_CATEGORY_LESSER: + Matrix_Scale(0.1, 0.05, 0.1, MTXMODE_APPLY); + switch (smallCrateItem.itemId) { + case ITEM_HEART_PIECE: + case ITEM_HEART_PIECE_2: + case ITEM_HEART_CONTAINER: + Gfx_DrawDListOpa(play, (Gfx*)gSmallHeartCrateDL); + break; + default: + Gfx_DrawDListOpa(play, (Gfx*)gSmallMinorCrateDL); + break; + } + case ITEM_CATEGORY_JUNK: + default: + Matrix_Scale(0.04, 0.02, 0.04, MTXMODE_APPLY); + Gfx_DrawDListOpa(play, (Gfx*)gLargeJunkCrateDL); + break; + } + + Matrix_Pop(); + CLOSE_DISPS(gfxCtx); } void EnWood02_RandomizerSpawnCollectible(EnWood02* treeActor, PlayState* play) { @@ -113,8 +151,7 @@ void RegisterShuffleTrees() { COND_VB_SHOULD(VB_TREE_SETUP_DRAW, shouldRegister, { EnWood02* treeActor = va_arg(args, EnWood02*); if (EnWood02_RandomizerHoldsItem(treeActor, gPlayState)) { - treeActor->actor.draw = (ActorFunc)EnWood02_RandomizerDraw; - *should = false; + EnWood02_RandomizerDraw(&treeActor->actor, gPlayState); } });