From 622920d8c0742b397e3c7401d30d12c005cb22e1 Mon Sep 17 00:00:00 2001 From: gymnast86 Date: Thu, 30 Apr 2026 04:39:41 -0700 Subject: [PATCH] rutela and ralis checks --- src/d/actor/d_a_npc_zrc.cpp | 8 ++++++ src/d/actor/d_a_npc_zrz.cpp | 17 ++++++++++++- src/d/actor/d_a_obj_zcloth.cpp | 25 +++++++++++++++++++ src/d/actor/d_a_obj_zra_rock.cpp | 10 ++++++++ .../randomizer/generator/data/locations.yaml | 10 +++----- 5 files changed, 63 insertions(+), 7 deletions(-) diff --git a/src/d/actor/d_a_npc_zrc.cpp b/src/d/actor/d_a_npc_zrc.cpp index c169c15ad9..477464d10e 100644 --- a/src/d/actor/d_a_npc_zrc.cpp +++ b/src/d/actor/d_a_npc_zrc.cpp @@ -10,6 +10,9 @@ #include "SSystem/SComponent/c_math.h" #include "JSystem/J3DGraphBase/J3DMaterial.h" #include "Z2AudioLib/Z2Instances.h" +#if TARGET_PC +#include "dusk/randomizer/game/verify_item_functions.h" +#endif enum Event_Cut_Nums { /* 0x2 */ NUM_EVT_CUTS_e = 0x2, @@ -1685,6 +1688,11 @@ BOOL daNpc_zrC_c::ECut_earringGet(int i_staffID) { case 40: { int item_no = 0; if (mFlow.getEventId(&item_no) == 1) { +#if TARGET_PC + if (randomizer_IsActive()) { + item_no = verifyProgressiveItem(randomizer_getItemAtLocation("Gift From Ralis")); + } +#endif mItemID = fopAcM_createItemForPresentDemo(¤t.pos, item_no, 0, -1, -1, NULL, NULL); } diff --git a/src/d/actor/d_a_npc_zrz.cpp b/src/d/actor/d_a_npc_zrz.cpp index 7e71ef130e..90d86d8aae 100644 --- a/src/d/actor/d_a_npc_zrz.cpp +++ b/src/d/actor/d_a_npc_zrz.cpp @@ -14,6 +14,11 @@ #include "Z2AudioLib/Z2Instances.h" #include +#if TARGET_PC +#include "dusk/randomizer/game/flags.h" +#include "dusk/randomizer/game/verify_item_functions.h" +#endif + static NPC_ZRZ_HIO_CLASS l_HIO; daNpc_zrZ_HIOParam const daNpc_zrZ_Param_c::m = { @@ -892,7 +897,12 @@ BOOL daNpc_zrZ_c::isDelete() { if (((mDemoMode == DEMO_COME_HERE || mDemoMode == DEMO_WAIT) && dComIfGs_isSwitch(mSwitch1, fopAcM_GetRoomNo(this))) || (mDemoMode == DEMO_COME_HERE_2 && (!dComIfGs_isSwitch(mSwitch1, fopAcM_GetRoomNo(this)) - || dComIfGs_isSwitch(mSwitch2, fopAcM_GetRoomNo(this))))) +#if TARGET_PC + // Don't delete Rutela in the graveyard until we've picked up Rutelas Blessing in rando + || (dComIfGs_isSwitch(mSwitch2, fopAcM_GetRoomNo(this)) && (!randomizer_IsActive() || dComIfGs_isEventBit(GOT_ZORA_ARMOR_FROM_RUTELA)))))) +#else + || dComIfGs_isSwitch(mSwitch2, fopAcM_GetRoomNo(this))))) +#endif { return true; } else { @@ -1729,6 +1739,11 @@ BOOL daNpc_zrZ_c::ECut_clothesGet(int i_staffID) { } item_no = 0; if (mFlow.getEventId(&item_no) == 1) { +#if TARGET_PC + if (randomizer_IsActive()) { + item_no = verifyProgressiveItem(randomizer_getItemAtLocation("Rutelas Blessing")); + } +#endif mItemID = fopAcM_createItemForPresentDemo(¤t.pos, item_no, 0, -1, -1, NULL, NULL); } diff --git a/src/d/actor/d_a_obj_zcloth.cpp b/src/d/actor/d_a_obj_zcloth.cpp index c2eb40be00..bfb806f905 100644 --- a/src/d/actor/d_a_obj_zcloth.cpp +++ b/src/d/actor/d_a_obj_zcloth.cpp @@ -11,6 +11,10 @@ #include "d/d_a_itembase_static.h" #include "f_pc/f_pc_name.h" +#if TARGET_PC +#include "dusk/randomizer/game/verify_item_functions.h" +#endif + void daObjZCloth_c::initBaseMtx() { mpModel->setBaseScale(scale); setBaseMtx(); @@ -32,6 +36,27 @@ int daObjZCloth_c::Create() { int daObjZCloth_c::create() { fopAcM_ct(this, daObjZCloth_c); m_itemNo = 0x31; +#if TARGET_PC + // Override the item id in randomizer + if (randomizer_IsActive()) { + m_itemNo = verifyProgressiveItem(randomizer_getItemAtLocation("Rutelas Blessing")); + // TODO: Set rotation/height/scale depending on the item (low prio, can figure this out later) + scale.setall(1.5f); + switch (m_itemNo) { + case dItemNo_Randomizer_WOOD_STICK_e: + shape_angle.x = 0x4000; + break; + case dItemNo_Randomizer_MASTER_SWORD_e: + case dItemNo_Randomizer_LIGHT_SWORD_e: + shape_angle.x = 0x4000; + current.pos.z -= 40.0f; + scale.setall(1.0f); + break; + default: + break; + } + } +#endif int phase = dComIfG_resLoad(&mPhase, dItem_data::getFieldArc(m_itemNo)); if (phase == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, (heapCallbackFunc)CheckFieldItemCreateHeap, 0x2fb0)) { diff --git a/src/d/actor/d_a_obj_zra_rock.cpp b/src/d/actor/d_a_obj_zra_rock.cpp index df8b9333a7..91bb1b5cc9 100644 --- a/src/d/actor/d_a_obj_zra_rock.cpp +++ b/src/d/actor/d_a_obj_zra_rock.cpp @@ -10,6 +10,10 @@ #include "d/d_bg_w.h" #include "f_pc/f_pc_name.h" +#if TARGET_PC +#include "dusk/randomizer/game/flags.h" +#endif + static char const* l_arcName = "H_ZraRock"; void daObjZraRock_c::setAttnPos() { @@ -80,6 +84,12 @@ cPhs_Step daObjZraRock_c::create() { int dzb_id = dComIfG_getObjctResName2Index(l_arcName, "H_ZoraRock.dzb"); step = MoveBGCreate(l_arcName, dzb_id, dBgS_MoveBGProc_Trans, 0x2050, NULL); if (dComIfGs_isSwitch((fopAcM_GetParam(this) >> 8) & 0xff, fopAcM_GetRoomNo(this))) { +#if TARGET_PC + // Don't delete the rock when we're following rutela + if (randomizer_IsActive() && !dComIfGs_isEventBit(GOT_ZORA_ARMOR_FROM_RUTELA) && dComIfGs_isEventBit(ZORA_ESCORT_CLEARED)) { + return step; + } +#endif step = cPhs_ERROR_e; } } diff --git a/src/dusk/randomizer/generator/data/locations.yaml b/src/dusk/randomizer/generator/data/locations.yaml index 339c055026..18639a5f7f 100644 --- a/src/dusk/randomizer/generator/data/locations.yaml +++ b/src/dusk/randomizer/generator/data/locations.yaml @@ -1408,7 +1408,6 @@ Metadata: - None -# TODO - Name: Rutelas Blessing Original Item: Zora Armor Categories: @@ -1416,10 +1415,9 @@ - Npc - Kakariko Graveyard - ARC - Metadata: - - None + - Location Name Lookup + Metadata: Rutelas Blessing -# TODO - Name: Gift From Ralis Original Item: Progressive Fishing Rod Categories: @@ -1427,8 +1425,8 @@ - Npc - Kakariko Graveyard - ARC - Metadata: - - None + - Location Name Lookup + Metadata: Gift From Ralis - Name: Kakariko Graveyard Lantern Chest Original Item: Purple Rupee