From c265207c92cd15ea168d704fdf7463aff9d4b294 Mon Sep 17 00:00:00 2001 From: gymnast86 Date: Sun, 3 May 2026 17:58:11 -0700 Subject: [PATCH] ball and chain check --- src/d/actor/d_a_e_md.cpp | 10 ++++------ src/d/actor/d_a_e_th_ball.cpp | 10 +++++++++- src/dusk/randomizer/generator/data/locations.yaml | 5 ++--- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/d/actor/d_a_e_md.cpp b/src/d/actor/d_a_e_md.cpp index b6bd2d2bec..476f294640 100644 --- a/src/d/actor/d_a_e_md.cpp +++ b/src/d/actor/d_a_e_md.cpp @@ -396,12 +396,10 @@ inline int daE_MD_c::create() { int phase_state = dComIfG_resLoad(&mPhase, "E_MD"); if (phase_state == cPhs_COMPLEATE_e) { OS_REPORT("E_MD PARAM %x\n", fopAcM_GetParam(this)); -#if TARGET_PC - // We want the statues to spawn in rando, regardles of boss flag value. - if ((cDmr_SkipInfo != 0 || randomizer_IsActive()) && current.pos.z > -1500.0f) { -#else - if (cDmr_SkipInfo != 0 && current.pos.z > -1500.0f) { -#endif + + // Always create the armor in rando (otherwise ball and chain won't spawn + // if the player leaves and re-enters without getting it) + if (cDmr_SkipInfo != 0 && current.pos.z > -1500.0f IF_DUSK(&& !randomizer_IsActive())) { return cPhs_ERROR_e; } diff --git a/src/d/actor/d_a_e_th_ball.cpp b/src/d/actor/d_a_e_th_ball.cpp index 8e6c24f09c..fe94dce24f 100644 --- a/src/d/actor/d_a_e_th_ball.cpp +++ b/src/d/actor/d_a_e_th_ball.cpp @@ -10,7 +10,9 @@ #include "d/d_com_inf_game.h" #include "d/actor/d_a_player.h" #include "d/d_s_play.h" - +#if TARGET_PC +#include "dusk/randomizer/game/verify_item_functions.h" +#endif enum daE_TH_ACTION { ACTION_STOP, ACTION_SPIN, @@ -931,6 +933,12 @@ static void get_demo(e_th_ball_class* i_this) { case 0: break; case 1: +#if TARGET_PC + if (randomizer_IsActive()) { + u8 itemId = verifyProgressiveItem(randomizer_getItemAtLocation("Snowpeak Ruins Ball and Chain")); + demo_id = fopAcM_createItemForTrBoxDemo(&i_this->current.pos, itemId, -1, fopAcM_GetRoomNo(i_this), NULL, NULL); + } else +#endif demo_id = fopAcM_createItemForTrBoxDemo(&i_this->current.pos, dItemNo_IRONBALL_e, -1, fopAcM_GetRoomNo(i_this), NULL, NULL); JUT_ASSERT(1670, demo_id != fpcM_ERROR_PROCESS_ID_e); i_this->mDemoMode = 2; diff --git a/src/dusk/randomizer/generator/data/locations.yaml b/src/dusk/randomizer/generator/data/locations.yaml index 3cb543cc64..a938d6d0a7 100644 --- a/src/dusk/randomizer/generator/data/locations.yaml +++ b/src/dusk/randomizer/generator/data/locations.yaml @@ -5760,15 +5760,14 @@ - Tbox ID: 2 Stage: 27 -# TODO - Name: Snowpeak Ruins Ball and Chain Original Item: Ball and Chain Categories: - Dungeon - Snowpeak Ruins - REL - Metadata: - - None + - Location Name Lookup + Metadata: Snowpeak Ruins Ball and Chain - Name: Snowpeak Ruins Chest After Darkhammer Original Item: Ordon Cheese