From 9df68203ed72d1646994d40d6c852c624145fa83 Mon Sep 17 00:00:00 2001 From: horrible Date: Mon, 26 Oct 2026 21:32:08 -0400 Subject: [PATCH 1/5] add configuration options for rocs feather - add handling to make rocs feather multi-use - add option to make rocs feather consumable rather than infinite - add setting to have rocs on empty A when available --- soh/assets/custom/lang/en_US.json | 12 +- soh/include/z64save.h | 2 + .../vanilla-behavior/GIVanillaBehavior.h | 24 +++ .../randomizer/3drando/item_pool.cpp | 9 +- .../Enhancements/randomizer/RocsFeather.cpp | 182 +++++++++++++++--- .../Enhancements/randomizer/SeedContext.cpp | 18 +- soh/soh/Enhancements/randomizer/SeedContext.h | 3 +- soh/soh/Enhancements/randomizer/logic.cpp | 4 +- .../Enhancements/randomizer/randomizer.cpp | 10 +- .../randomizerEnums/RandomizerOptions.h | 7 + .../randomizerEnums/RandomizerSettingKey.h | 1 + .../randomizer/randomizer_item_tracker.cpp | 32 +++ soh/soh/Enhancements/randomizer/settings.cpp | 56 ++++-- soh/soh/SaveManager.cpp | 10 + soh/soh/SohGui/SohMenuEnhancements.cpp | 6 + soh/soh/util.cpp | 2 +- soh/src/code/z_construct.c | 3 +- soh/src/code/z_message_PAL.c | 3 +- soh/src/code/z_parameter.c | 107 ++++++++-- .../actors/ovl_player_actor/z_player.c | 12 +- .../ovl_kaleido_scope/z_kaleido_scope_PAL.c | 3 +- 21 files changed, 428 insertions(+), 78 deletions(-) diff --git a/soh/assets/custom/lang/en_US.json b/soh/assets/custom/lang/en_US.json index 1599b007e2e..288758033e4 100644 --- a/soh/assets/custom/lang/en_US.json +++ b/soh/assets/custom/lang/en_US.json @@ -1527,8 +1527,16 @@ "rocs_feather": { "name": "Roc's Feather", "description": [ - "Adds Roc's Feather to the item pool. Roc's Feather is a custom item granting the player a jump on demand. ", - "The jump can also be used when already in mid-air. Roc's Feather is not considered by logic." + "Off - Roc's Feather will not be shuffled. No changes will be made to item pool.\n\n", + "On - Adds Roc's Feather to the item pool. Roc's Feather is a custom item granting the player a jump on demand. ", + "Increasing the number of Feathers will allow successive jumps for each feather found.\n\n", + "Consumable - Adds consumable Roc's Feathers to the item pool. Some junk drops and shop refills will be replaced with feathers.\n\n" + ] + }, + "rocs_feather_count": { + "name": "Roc's Feather Quantity / Max Capacity", + "description": [ + "If Roc's Feather is 'On' this will be the number of feathers in the pool. If Roc's Feather is 'Consumable' this will be the maximum you can carry at once." ] }, "nayrus_love_uses": { diff --git a/soh/include/z64save.h b/soh/include/z64save.h index 6624151c067..a277c076fd9 100644 --- a/soh/include/z64save.h +++ b/soh/include/z64save.h @@ -250,6 +250,8 @@ typedef struct ShipRandomizerSaveContextData { s8 silverMqSpiritBigWall; s8 silverMqGanonWater; s8 silverMqGanonShadow; + u8 rocsFeathersAcquired; + u8 rocsFeathersRemaining; } ShipRandomizerSaveContextData; typedef struct ShipBossRushSaveContextData { diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index 85ed017e1b7..53190dc8f1d 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -387,6 +387,30 @@ typedef enum { // - `int32_t` (item) VB_CHANGE_HELD_ITEM_AND_USE_ITEM, + // #### `result` + // ```c + // true + // ``` + // Whether the default action for A should be used. Sending false will (attempt to) + // intercept it. + // #### `args` + // - Player* player + // - PlayState* playState + VB_CHANGE_ACTION_AND_USE, + + // #### `result` + // ```c + // true + // ``` + // Whether the default texture for a given action on the A button should be used. + // A hook returning false must specify a replacement texture pointer. + // A hook returning true /may/ change the ACTION supplied to alter the text shown. + // Interface_LoadActionLabel + // #### `args` + // - `u16* action` (`DO_ACTION_` - specified in `z64.h`'s `DoAction` struct) + // - `const char** alternateTexture` (pointer to a 32 x 32 G_IM_FMT_RGBA texture) + VB_SET_ACTION_TEXTURE, + // #### `result` // ```c // gSaveContext.rupees < 200 diff --git a/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp b/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp index 5e8764ce68b..57f107a57b2 100644 --- a/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp @@ -435,8 +435,13 @@ void GenerateItemPool() { if (!ctx->GetOption(RSK_STARTING_MASK_OF_TRUTH)) AddItemToPool(RG_MASK_OF_TRUTH, 2, 1, 1, 1); } - if (ctx->GetOption(RSK_ROCS_FEATHER)) { - AddItemToPool(RG_ROCS_FEATHER, 2, 1, 1, 1); + if (ctx->GetOption(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_ON)) { + uint8_t feathers = ctx->GetOption(RSK_ROCS_FEATHER_COUNT).Get()+1; + AddItemToPool(RG_ROCS_FEATHER, feathers, feathers, feathers, feathers); + } else if (ctx->GetOption(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_CONSUMABLE)) { + JunkPoolItems.emplace_back(RG_ROCS_FEATHER); + JunkPoolItems.emplace_back(RG_ROCS_FEATHER); + JunkPoolItems.emplace_back(RG_ROCS_FEATHER); } int bronzeScale = ctx->GetOption(RSK_SHUFFLE_SWIM) ? 1 : 0; diff --git a/soh/soh/Enhancements/randomizer/RocsFeather.cpp b/soh/soh/Enhancements/randomizer/RocsFeather.cpp index 176960caaf9..688b6b9cb5e 100644 --- a/soh/soh/Enhancements/randomizer/RocsFeather.cpp +++ b/soh/soh/Enhancements/randomizer/RocsFeather.cpp @@ -1,4 +1,7 @@ +#include + #include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/Enhancements/randomizer/SeedContext.h" #include "soh/ShipInit.hpp" extern "C" { @@ -8,19 +11,59 @@ extern "C" { #include "variables.h" #include "macros.h" extern PlayState* gPlayState; +extern SaveContext gSaveContext; } -#define MAX_ROCS_USES 1 - -static uint8_t rocsUseCount = 0; +static uint8_t& rocsMaxUse = gSaveContext.ship.quest.data.randomizer.rocsFeathersAcquired; +static uint8_t& rocsRemaining = gSaveContext.ship.quest.data.randomizer.rocsFeathersRemaining; static uint8_t groundTimer = 0; static f32 effectsScale = 1.0f; +static bool rocsConsumable = false; + +void UseRocsFeather(PlayState* playState, Player* player) { + if (rocsRemaining > 0) { + rocsRemaining--; + + func_80838940(player, (LinkAnimationHeader*)&gPlayerAnim_link_rocs_feather_jump, 5.8f, playState, 0); + + // Actionvar needed to prevent weird animation morph + player->av2.actionVar2 = 1; + + // Move player forward on Roc's use + player->linearVelocity = 5.0f; + player->actor.world.rot.y = player->yaw = player->actor.shape.rot.y; + + if (gSaveContext.linkAge == LINK_AGE_CHILD) { + player->actor.velocity.y = 7.0f; + effectsScale = 1.0f; + } else { + player->actor.velocity.y = 7.5f; + effectsScale = 1.5f; + } + + Vec3f effectsPos = player->actor.home.pos; + effectsPos.y += 3; + + EffectSsGRipple_Spawn(playState, &effectsPos, static_cast(200 * effectsScale), + static_cast(300 * effectsScale), 1); + EffectSsGSplash_Spawn(playState, &effectsPos, NULL, NULL, 0, static_cast(150 * effectsScale)); + + // Remove hopping state when using Roc's after sidehop/backflip to allow grabbing ledges again + player->stateFlags2 &= ~(PLAYER_STATE2_HOPPING); + + Player_PlaySfx(&player->actor, NA_SE_PL_SKIP); + } +} void RegisterRocsFeather() { // Always register hooks - they only activate when ITEM_ROCS_FEATHER is actually used // Rando-specific logic (item pool, accessibility, etc.) is handled elsewhere bool shouldRegister = true; + COND_HOOK(OnLoadFile, shouldRegister, [](int32_t fileNum) { + rocsConsumable = Rando::Context::GetInstance()->GetOption(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_CONSUMABLE); + }); + COND_HOOK(OnPlayerUpdate, shouldRegister, []() { Player* player = GET_PLAYER(gPlayState); @@ -33,8 +76,8 @@ void RegisterRocsFeather() { groundTimer = 0; } - if (groundTimer >= 3) { - rocsUseCount = 0; + if (!rocsConsumable && groundTimer >= 3) { + rocsRemaining = rocsMaxUse; } }); @@ -45,39 +88,47 @@ void RegisterRocsFeather() { if (usedItem == ITEM_ROCS_FEATHER) { *should = false; - if (rocsUseCount < MAX_ROCS_USES) { - rocsUseCount++; - - Player* player = GET_PLAYER(gPlayState); - - func_80838940(player, (LinkAnimationHeader*)&gPlayerAnim_link_rocs_feather_jump, 5.8f, gPlayState, 0); - - // Actionvar needed to prevent weird animation morph - player->av2.actionVar2 = 1; + Player* player = GET_PLAYER(gPlayState); - // Move player forward on Roc's use - player->linearVelocity = 5.0f; - player->actor.world.rot.y = player->yaw = player->actor.shape.rot.y; + UseRocsFeather(gPlayState, player); + } + }); - if (gSaveContext.linkAge == LINK_AGE_CHILD) { - player->actor.velocity.y = 7.0f; - effectsScale = 1.0f; - } else { - player->actor.velocity.y = 7.5f; - effectsScale = 1.5f; - } + COND_VB_SHOULD(VB_CHANGE_ACTION_AND_USE, shouldRegister, { + if (CVarGetInteger(CVAR_ENHANCEMENT("RocsFeatherOnA"), 0) != 1) { + *should = true; + return; + } - Vec3f effectsPos = player->actor.home.pos; - effectsPos.y += 3; + Player* player = va_arg(args, Player*); + PlayState* playState = va_arg(args, PlayState*); + Input* input = &playState->state.input[0]; + + u16 action = playState->interfaceCtx.unk_1F0; + + // disabled during z-targeting, while swimming, while paused, when grounded and any + // action is displayed, while climbing ladders, when midair with something held, + // while crawling, and when there are no rocs remaining to use + if ((player->stateFlags1 & + (PLAYER_STATE1_HOSTILE_LOCK_ON | PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS | PLAYER_STATE1_PARALLEL)) || + (player->stateFlags1 & PLAYER_STATE1_IN_WATER) || (player->stateFlags2 & PLAYER_STATE2_CRAWLING) || + (playState->pauseCtx.state > 0 && playState->pauseCtx.state < 18) || + ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && action != DO_ACTION_NONE) || + (!(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + (action == DO_ACTION_DOWN || action == DO_ACTION_DROP || action == DO_ACTION_THROW)) || + (rocsRemaining == 0)) { + *should = true; - EffectSsGRipple_Spawn(gPlayState, &effectsPos, static_cast(200 * effectsScale), - static_cast(300 * effectsScale), 1); - EffectSsGSplash_Spawn(gPlayState, &effectsPos, NULL, NULL, 0, static_cast(150 * effectsScale)); + } else { - // Remove hopping state when using Roc's after sidehop/backflip to allow grabbing ledges again - player->stateFlags2 &= ~(PLAYER_STATE2_HOPPING); + if (CHECK_BTN_ANY(input->press.button, BTN_A)) { + *should = false; + UseRocsFeather(playState, player); - Player_PlaySfx(&player->actor, NA_SE_PL_SKIP); + } else if (!(CHECK_BTN_ANY(input->press.button, BTN_A)) && + player->actor.bgCheckFlags & (BGCHECKFLAG_GROUND_LEAVE | BGCHECKFLAG_GROUND_TOUCH)) { + *should = false; + playState->interfaceCtx.unk_1F0 = DO_ACTION_NONE; } } }); @@ -97,6 +148,73 @@ void RegisterRocsFeather() { memcpy(gPlayState->pauseCtx.nameSegment, textureName, strlen(textureName) + 1); } }); + + COND_VB_SHOULD(VB_OVERRIDE_AMMO_COUNT, shouldRegister, { + int16_t item = *va_arg(args, int16_t*); + int16_t* ammo = va_arg(args, int16_t*); + if (item == ITEM_ROCS_FEATHER) { + if (rocsConsumable || rocsMaxUse != 1) { + *should = false; + *ammo = rocsRemaining; + } + } + }); + + COND_VB_SHOULD(VB_DRAW_AMMO_COUNT, shouldRegister, { + s16 item = *va_arg(args, s16*); + if (item == ITEM_ROCS_FEATHER) { + if (rocsConsumable || rocsMaxUse != 1) { + *should = true; + } else { + *should = false; + } + } + }); + + COND_VB_SHOULD(VB_COLOR_AMMO_GREEN, shouldRegister, { + s16 item = va_arg(args, s16); + if (item == ITEM_ROCS_FEATHER) { + if (rocsMaxUse == rocsRemaining) { + *should = true; + } else { + *should = false; + } + } + }); + + COND_VB_SHOULD(VB_SET_ACTION_TEXTURE, shouldRegister, { + if (CVarGetInteger(CVAR_ENHANCEMENT("RocsFeatherOnA"), 0) != 1) { + *should = false; + return; + } + + u16* action = va_arg(args, u16*); + const char** alternateTexture = va_arg(args, const char**); + Player* player = GET_PLAYER(gPlayState); + + // clear action manually on jumping/landing to avoid issues with value not refreshing on change when direction + // input is maintained + if (player->actor.bgCheckFlags & (BGCHECKFLAG_GROUND_LEAVE | BGCHECKFLAG_GROUND_TOUCH)) { + *action = *action == DO_ACTION_NONE ? DO_ACTION_MAX : DO_ACTION_NONE; + *should = false; + + // disabled during z-targeting, while swimming, while paused, when grounded and any + // action is displayed, while climbing ladders, when midair with something held, + // while crawling, and when there are no rocs remaining to use + } else if ((player->stateFlags1 & + (PLAYER_STATE1_HOSTILE_LOCK_ON | PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS | PLAYER_STATE1_PARALLEL)) || + (player->stateFlags1 & PLAYER_STATE1_IN_WATER) || (player->stateFlags2 & PLAYER_STATE2_CRAWLING) || + (gPlayState->pauseCtx.state > 0 && gPlayState->pauseCtx.state < 18) || + ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && *action != DO_ACTION_NONE) || + (!(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + (*action == DO_ACTION_DOWN || *action == DO_ACTION_DROP || *action == DO_ACTION_THROW)) || + (rocsRemaining == 0)) { + *should = false; + } else { + *should = true; + *alternateTexture = gRocsFeatherTex; + } + }); } static RegisterShipInitFunc registerRocsFeather(RegisterRocsFeather); diff --git a/soh/soh/Enhancements/randomizer/SeedContext.cpp b/soh/soh/Enhancements/randomizer/SeedContext.cpp index 5dd354bbd7e..bad79c8f150 100644 --- a/soh/soh/Enhancements/randomizer/SeedContext.cpp +++ b/soh/soh/Enhancements/randomizer/SeedContext.cpp @@ -632,6 +632,22 @@ void Context::HandleGetBombchuBag() { return; } } +void Context::HandleGetRocsFeather() { + Flags_SetRandomizerInf(RAND_INF_OBTAINED_ROCS_FEATHER); + + bool rocsConsumable = Rando::Context::GetInstance()->GetOption(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_CONSUMABLE); + static uint8_t rocsMaxUse = Rando::Context::GetInstance()->GetOption(RSK_ROCS_FEATHER_COUNT).Get() + 1; + static uint8_t& rocsRemaining = mLogic->GetSaveContext()->ship.quest.data.randomizer.rocsFeathersRemaining; + static uint8_t& rocsAcquired = mLogic->GetSaveContext()->ship.quest.data.randomizer.rocsFeathersAcquired; + + if (!rocsConsumable) { + rocsAcquired = rocsAcquired < rocsMaxUse ? rocsAcquired + 1 : rocsMaxUse; + rocsRemaining = rocsAcquired; + } else { + rocsAcquired = rocsMaxUse; + rocsRemaining = rocsRemaining < rocsAcquired ? rocsRemaining + 1 : rocsAcquired; + } +} const std::string& Context::GetSeedString() const { return mSeedString; @@ -648,4 +664,4 @@ uint32_t Context::GetSeed() const { void Context::SetSeed(const uint32_t seed) { mFinalSeed = seed; } -} // namespace Rando \ No newline at end of file +} // namespace Rando diff --git a/soh/soh/Enhancements/randomizer/SeedContext.h b/soh/soh/Enhancements/randomizer/SeedContext.h index 06f31411358..3c22303e3a9 100644 --- a/soh/soh/Enhancements/randomizer/SeedContext.h +++ b/soh/soh/Enhancements/randomizer/SeedContext.h @@ -179,6 +179,7 @@ class Context { void SetHash(std::string hash); uint8_t GetBombchuCapacity(); void HandleGetBombchuBag(); + void HandleGetRocsFeather(); private: static std::weak_ptr mContext; @@ -200,4 +201,4 @@ class Context { std::string mSeedString; uint32_t mFinalSeed = 0; }; -} // namespace Rando \ No newline at end of file +} // namespace Rando diff --git a/soh/soh/Enhancements/randomizer/logic.cpp b/soh/soh/Enhancements/randomizer/logic.cpp index 416cfcc5d33..d9d4eb23318 100644 --- a/soh/soh/Enhancements/randomizer/logic.cpp +++ b/soh/soh/Enhancements/randomizer/logic.cpp @@ -2127,7 +2127,6 @@ static constexpr std::pair randInfTable[] = { { RG_SPEAK_ZORA, RAND_INF_CAN_SPEAK_ZORA }, { RG_FISHING_POLE, RAND_INF_FISHING_POLE_FOUND }, { RG_SCARECROWS_SONG, RAND_INF_HAS_SCARECROWS_SONG }, - { RG_ROCS_FEATHER, RAND_INF_OBTAINED_ROCS_FEATHER }, { RG_GUARD_HOUSE_KEY, RAND_INF_GUARD_HOUSE_KEY_OBTAINED }, { RG_MARKET_BAZAAR_KEY, RAND_INF_MARKET_BAZAAR_KEY_OBTAINED }, { RG_MARKET_POTION_SHOP_KEY, RAND_INF_MARKET_POTION_SHOP_KEY_OBTAINED }, @@ -2640,6 +2639,9 @@ void Logic::ApplyItemEffect(Item& item, bool state) { SetInventory(ITEM_BOMBCHU, (!state ? ITEM_NONE : ITEM_BOMBCHU)); } break; + case RG_ROCS_FEATHER: + OTRGlobals::Instance->gRandoContext->HandleGetRocsFeather(); + break; default: break; } diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index c1edfd9aada..6d9e2d83728 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -1193,10 +1193,6 @@ extern "C" u16 Randomizer_Item_Give(PlayState* play, GetItemEntry giEntry) { if (!ChildTradeSlotOccupied()) { INV_CONTENT(ITEM_TRADE_CHILD) = ITEM_LETTER_ZELDA; } - } else if (item == RG_ROCS_FEATHER) { - if (INV_CONTENT(ITEM_NAYRUS_LOVE) == ITEM_NONE) { - INV_CONTENT(ITEM_NAYRUS_LOVE) = ITEM_ROCS_FEATHER; - } } else if (item == RG_CHILD_WALLET && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_FULL_WALLETS)) { Rupees_ChangeBy(99); @@ -1431,6 +1427,12 @@ extern "C" u16 Randomizer_Item_Give(PlayState* play, GetItemEntry giEntry) { INV_CONTENT(ITEM_NUT) = ITEM_NUT; AMMO(ITEM_NUT) = static_cast(CUR_CAPACITY(UPG_NUTS)); break; + case RG_ROCS_FEATHER: + if (INV_CONTENT(ITEM_NAYRUS_LOVE) == ITEM_NONE) { + INV_CONTENT(ITEM_NAYRUS_LOVE) = ITEM_ROCS_FEATHER; + } + OTRGlobals::Instance->gRandoContext->HandleGetRocsFeather(); + break; case RG_SHADOW_SILVER_BLADES: case RG_SHADOW_SILVER_PIT: case RG_SHADOW_SILVER_SPIKES: diff --git a/soh/soh/Enhancements/randomizer/randomizerEnums/RandomizerOptions.h b/soh/soh/Enhancements/randomizer/randomizerEnums/RandomizerOptions.h index cd01da89dee..8c46b6ded57 100644 --- a/soh/soh/Enhancements/randomizer/randomizerEnums/RandomizerOptions.h +++ b/soh/soh/Enhancements/randomizer/randomizerEnums/RandomizerOptions.h @@ -134,6 +134,13 @@ RANDO_ENUM_ITEM(RO_SCRUBS_ONE_TIME_ONLY) RANDO_ENUM_ITEM(RO_SCRUBS_ALL) RANDO_ENUM_END(RandoOptionScrubsanity) +// Roc's Feather settings (off, permanent, consumable) +RANDO_ENUM_BEGIN(RandoOptionRocsFeather) +RANDO_ENUM_ITEM(RO_ROCS_FEATHER_OFF) +RANDO_ENUM_ITEM(RO_ROCS_FEATHER_ON) +RANDO_ENUM_ITEM(RO_ROCS_FEATHER_CONSUMABLE) +RANDO_ENUM_END(RandoOptionRocsFeather) + // Ammo drop settings (on, "on+bombchu", off) RANDO_ENUM_BEGIN(RandoOptionAmmoDrops) RANDO_ENUM_ITEM(RO_AMMO_DROPS_OFF) diff --git a/soh/soh/Enhancements/randomizer/randomizerEnums/RandomizerSettingKey.h b/soh/soh/Enhancements/randomizer/randomizerEnums/RandomizerSettingKey.h index 211cc0e1221..b4a194d25cd 100644 --- a/soh/soh/Enhancements/randomizer/randomizerEnums/RandomizerSettingKey.h +++ b/soh/soh/Enhancements/randomizer/randomizerEnums/RandomizerSettingKey.h @@ -310,6 +310,7 @@ RANDO_ENUM_ITEM(RSK_LOCK_OVERWORLD_DOORS) RANDO_ENUM_ITEM(RSK_SHUFFLE_GRASS) RANDO_ENUM_ITEM(RSK_SHUFFLE_SIGNS) RANDO_ENUM_ITEM(RSK_ROCS_FEATHER) +RANDO_ENUM_ITEM(RSK_ROCS_FEATHER_COUNT) RANDO_ENUM_ITEM(RSK_SHUFFLE_ICICLES) RANDO_ENUM_ITEM(RSK_SHUFFLE_RED_ICE) RANDO_ENUM_ITEM(RSK_SHUFFLE_FIRE_GORONS) diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index 5597309021c..ad486459902 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -732,6 +732,33 @@ void DrawItemCount(ItemTrackerItem item, bool hideMax) { ImGui::SetWindowFontScale(1.0f); // Reset font scale to the original state } + if (Rando::Context::GetInstance()->GetOption(RSK_ROCS_FEATHER_COUNT).Get() >= 1 && item.id == RG_ROCS_FEATHER) { + + std::string currentString = ""; + std::string maxString = + std::to_string(Rando::Context::GetInstance()->GetOption(RSK_ROCS_FEATHER_COUNT).Get() + 1); + ImU32 currentColor = IM_COL_WHITE; + ImU32 maxColor = IM_COL_GREEN; + + if (Rando::Context::GetInstance()->GetOption(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_CONSUMABLE)) { + currentString += std::to_string(gSaveContext.ship.quest.data.randomizer.rocsFeathersAcquired); + currentString += "/"; + } else { + currentString += std::to_string(gSaveContext.ship.quest.data.randomizer.rocsFeathersRemaining); + currentString += "/"; + } + + ImGui::SetCursorScreenPos( + ImVec2(p.x + (iconSize >> 1) - (ImGui::CalcTextSize((currentString + maxString).c_str()).x / 2), p.y - 14)); + ImGui::PushStyleColor(ImGuiCol_Text, currentColor); + ImGui::Text("%s", currentString.c_str()); + ImGui::PopStyleColor(); + ImGui::SameLine(0, 0.0f); + ImGui::PushStyleColor(ImGuiCol_Text, maxColor); + ImGui::Text("%s", maxString.c_str()); + ImGui::PopStyleColor(); + } + // progressive open chest: 'S' for small chests only, 'B' once big chests can be opened too if (item.id == RG_OPEN_CHEST && CVarGetInteger(CVAR_TRACKER_ITEM("OpenChestIdentifier"), 0) && IS_RANDO && RAND_GET_OPTION(RSK_SHUFFLE_OPEN_CHEST).Is(RO_OPEN_CHEST_PROGRESSIVE) && @@ -1011,6 +1038,11 @@ void DrawItem(ItemTrackerItem item) { itemName = "Triforce Piece"; break; case RG_ROCS_FEATHER: + if (Rando::Context::GetInstance()->GetOption(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_CONSUMABLE)) { + hasItem = gSaveContext.ship.quest.data.randomizer.rocsFeathersRemaining > 0; + } else { + hasItem = gSaveContext.ship.quest.data.randomizer.rocsFeathersAcquired > 0; + } itemName = "Roc's Feather"; break; case RG_DEATH_MOUNTAIN_CRATER_BEAN_SOUL: diff --git a/soh/soh/Enhancements/randomizer/settings.cpp b/soh/soh/Enhancements/randomizer/settings.cpp index 0af91ef6bc2..22dcdf6a860 100644 --- a/soh/soh/Enhancements/randomizer/settings.cpp +++ b/soh/soh/Enhancements/randomizer/settings.cpp @@ -1400,7 +1400,20 @@ void Settings::CreateOptions() { OPT_BOOL(RSK_SUNLIGHT_ARROWS, CVAR_RANDOMIZER_SETTING("SunlightArrows")); OPT_BOOL(RSK_BUNNY_HOOD, CVAR_RANDOMIZER_SETTING("BunnyHood")); OPT_BOOL(RSK_MASKS_AS_ADULT, CVAR_RANDOMIZER_SETTING("MasksAsAdult")); - OPT_BOOL(RSK_ROCS_FEATHER, CVAR_RANDOMIZER_SETTING("RocsFeather")); + OPT_U8(RSK_ROCS_FEATHER, {"Off", "On", "Consumable"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("RocsFeather"), WIDGET_CVAR_COMBOBOX, RO_ROCS_FEATHER_OFF); + OPT_CALLBACK(RSK_ROCS_FEATHER, { + switch (CVarGetInteger(CVAR_RANDOMIZER_SETTING("RocsFeather"), RO_ROCS_FEATHER_OFF)) { + case RO_ROCS_FEATHER_ON: + case RO_ROCS_FEATHER_CONSUMABLE: + mOptions[RSK_ROCS_FEATHER_COUNT].Unhide(); + break; + case RO_ROCS_FEATHER_OFF: + default: + mOptions[RSK_ROCS_FEATHER_COUNT].Hide(); + break; + } + }); + OPT_U8(RSK_ROCS_FEATHER_COUNT, {NumOpts(1, 10)}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("RocsFeatherCount"), WIDGET_CVAR_SLIDER_INT); OPT_U8(RSK_NAYRUS_LOVE_USES, {NumOpts(0, 5)}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("NayrusLoveUses"), WIDGET_CVAR_SLIDER_INT, 0); OPT_U8(RSK_INFINITE_UPGRADES, {"Off", "Progressive", "Condensed Progressive"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("InfiniteUpgrades")); OPT_BOOL(RSK_SKELETON_KEY, CVAR_RANDOMIZER_SETTING("SkeletonKey")); @@ -2112,21 +2125,31 @@ void Settings::CreateOptions() { WidgetContainerType::SECTION); mOptionGroups[RSG_MENU_COLUMN_SHOP_SHUFFLES] = OptionGroup::SubGroup("", { &mOptionGroups[RSG_MENU_SECTION_SHOP_SHUFFLES] }, WidgetContainerType::COLUMN); - mOptionGroups[RSG_MENU_SECTION_ADDITIONAL_ITEMS] = - OptionGroup::SubGroup("Additional Items", - { - &mOptions[RSK_SHUFFLE_CHILD_WALLET], &mOptions[RSK_INCLUDE_TYCOON_WALLET], - &mOptions[RSK_SHUFFLE_FISHING_POLE], &mOptions[RSK_SHUFFLE_DEKU_STICK_BAG], - &mOptions[RSK_SHUFFLE_DEKU_NUT_BAG], &mOptions[RSK_SHUFFLE_OCARINA_BUTTONS], - &mOptions[RSK_SHUFFLE_SWIM], &mOptions[RSK_SHUFFLE_GRAB], - &mOptions[RSK_SHUFFLE_CLIMB], &mOptions[RSK_SHUFFLE_CRAWL], - &mOptions[RSK_SHUFFLE_SPEAK], &mOptions[RSK_SHUFFLE_OPEN_CHEST], - &mOptions[RSK_SHUFFLE_BEAN_SOULS], &mOptions[RSK_ROCS_FEATHER], - &mOptions[RSK_NAYRUS_LOVE_USES], &mOptions[RSK_BOMBCHU_BAG], - &mOptions[RSK_ENABLE_BOMBCHU_DROPS], &mOptions[RSK_PROGRESSIVE_GORON_SWORD], - &mOptions[RSK_INFINITE_UPGRADES], &mOptions[RSK_SKELETON_KEY], - }, - WidgetContainerType::SECTION); + mOptionGroups[RSG_MENU_SECTION_ADDITIONAL_ITEMS] = OptionGroup::SubGroup("Additional Items", + { + &mOptions[RSK_SHUFFLE_CHILD_WALLET], + &mOptions[RSK_INCLUDE_TYCOON_WALLET], + &mOptions[RSK_SHUFFLE_FISHING_POLE], + &mOptions[RSK_SHUFFLE_DEKU_STICK_BAG], + &mOptions[RSK_SHUFFLE_DEKU_NUT_BAG], + &mOptions[RSK_SHUFFLE_OCARINA_BUTTONS], + &mOptions[RSK_SHUFFLE_SWIM], + &mOptions[RSK_SHUFFLE_GRAB], + &mOptions[RSK_SHUFFLE_CLIMB], + &mOptions[RSK_SHUFFLE_CRAWL], + &mOptions[RSK_SHUFFLE_SPEAK], + &mOptions[RSK_SHUFFLE_OPEN_CHEST], + &mOptions[RSK_SHUFFLE_BEAN_SOULS], + &mOptions[RSK_ROCS_FEATHER], + &mOptions[RSK_ROCS_FEATHER_COUNT], + &mOptions[RSK_NAYRUS_LOVE_USES], + &mOptions[RSK_BOMBCHU_BAG], + &mOptions[RSK_ENABLE_BOMBCHU_DROPS], + &mOptions[RSK_PROGRESSIVE_GORON_SWORD], + &mOptions[RSK_INFINITE_UPGRADES], + &mOptions[RSK_SKELETON_KEY], + }, + WidgetContainerType::SECTION); mOptionGroups[RSG_MENU_COLUMN_ADDITIONAL_ITEMS] = OptionGroup::SubGroup("", { &mOptionGroups[RSG_MENU_SECTION_ADDITIONAL_ITEMS] }, WidgetContainerType::COLUMN); mOptionGroups[RSG_MENU_SIDEBAR_SHUFFLES] = @@ -2317,6 +2340,7 @@ void Settings::CreateOptions() { &mOptions[RSK_SHUFFLE_100_GS_REWARD], &mOptions[RSK_SHUFFLE_BEAN_SOULS], &mOptions[RSK_ROCS_FEATHER], + &mOptions[RSK_ROCS_FEATHER_COUNT], &mOptions[RSK_NAYRUS_LOVE_USES], &mOptions[RSK_PROGRESSIVE_GORON_SWORD], &mOptions[RSK_SHUFFLE_BOSS_SOULS], diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index 26b395d4aa9..28f70aee476 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -333,6 +333,11 @@ void SaveManager::LoadRandomizer() { SaveManager::Instance->LoadData("silverMqGanonWater", gSaveContext.ship.quest.data.randomizer.silverMqGanonWater); SaveManager::Instance->LoadData("silverMqGanonShadow", gSaveContext.ship.quest.data.randomizer.silverMqGanonShadow); + SaveManager::Instance->LoadData("rocsFeathersAcquired", + gSaveContext.ship.quest.data.randomizer.rocsFeathersAcquired); + SaveManager::Instance->LoadData("rocsFeathersRemaining", + gSaveContext.ship.quest.data.randomizer.rocsFeathersRemaining); + SaveManager::Instance->LoadData("pendingIceTrapCount", gSaveContext.ship.pendingIceTrapCount); std::shared_ptr randomizer = OTRGlobals::Instance->gRandomizer; @@ -524,6 +529,11 @@ void SaveManager::SaveRandomizer(const SaveContext& saveContext, int sectionID, SaveManager::Instance->SaveData("silverMqGanonWater", gSaveContext.ship.quest.data.randomizer.silverMqGanonWater); SaveManager::Instance->SaveData("silverMqGanonShadow", gSaveContext.ship.quest.data.randomizer.silverMqGanonShadow); + SaveManager::Instance->SaveData("rocsFeathersAcquired", + saveContext.ship.quest.data.randomizer.rocsFeathersAcquired); + SaveManager::Instance->SaveData("rocsFeathersRemaining", + saveContext.ship.quest.data.randomizer.rocsFeathersRemaining); + SaveManager::Instance->SaveData("pendingIceTrapCount", saveContext.ship.pendingIceTrapCount); std::shared_ptr randomizer = OTRGlobals::Instance->gRandomizer; diff --git a/soh/soh/SohGui/SohMenuEnhancements.cpp b/soh/soh/SohGui/SohMenuEnhancements.cpp index acdfd6ebd55..8be3cccba44 100644 --- a/soh/soh/SohGui/SohMenuEnhancements.cpp +++ b/soh/soh/SohGui/SohMenuEnhancements.cpp @@ -1139,6 +1139,12 @@ void SohMenu::AddMenuEnhancements() { .CVar(CVAR_ENHANCEMENT("RebottleBlueFire")) .Options(CheckboxOptions().Tooltip("Blue Fire dropped from a bottle can be bottled.")); + AddWidget(path, "Custom Items", WIDGET_SEPARATOR_TEXT); + AddWidget(path, "Roc's Feather on A", WIDGET_CVAR_CHECKBOX) + .CVar(CVAR_ENHANCEMENT("RocsFeatherOnA")) + .Options(CheckboxOptions().Tooltip("If Roc's Feather is enabled and obtained in the current save, have it " + "usable with A whenever A would normally be blank.")); + // Fixes path.sidebarName = "Fixes"; AddSidebarEntry("Enhancements", path.sidebarName, 3); diff --git a/soh/soh/util.cpp b/soh/soh/util.cpp index daec2c288cb..e93c98de147 100644 --- a/soh/soh/util.cpp +++ b/soh/soh/util.cpp @@ -821,4 +821,4 @@ std::vector SohUtils::StringSplit(const std::string& str, const std tokens.push_back(str.substr(prevpos)); return tokens; -} \ No newline at end of file +} diff --git a/soh/src/code/z_construct.c b/soh/src/code/z_construct.c index 3eb5ec428b9..f9a4a3cac08 100644 --- a/soh/src/code/z_construct.c +++ b/soh/src/code/z_construct.c @@ -17,7 +17,8 @@ void func_801109B0(PlayState* play) { View_Init(&interfaceCtx->view, play->state.gfxCtx); - interfaceCtx->unk_1FA = interfaceCtx->unk_261 = interfaceCtx->unk_1FC = 0; + interfaceCtx->unk_261 = interfaceCtx->unk_1FC = 0; + interfaceCtx->unk_1FA &= ~(1 << 0); interfaceCtx->unk_1EC = interfaceCtx->unk_1EE = interfaceCtx->unk_1F0 = 0; interfaceCtx->unk_22E = 0; interfaceCtx->unk_230 = 16; diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 66a7baae239..1b405fe9d1c 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -4655,7 +4655,8 @@ void Message_Update(PlayState* play) { osSyncPrintf(VT_RST); msgCtx->msgLength = 0; msgCtx->msgMode = MSGMODE_NONE; - interfaceCtx->unk_1FA = interfaceCtx->unk_1FC = 0; + interfaceCtx->unk_1FC = 0; + interfaceCtx->unk_1FA &= ~(1 << 0); msgCtx->textId = msgCtx->stateTimer = 0; if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_PERSISTENT) { diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 88e857da54a..f86f4142c0e 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -2879,7 +2879,7 @@ void Interface_LoadActionLabelB(PlayState* play, u16 action) { interfaceCtx->doActionSegment[1] = action != DO_ACTION_NONE ? doAction : gEmptyTexture; osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); - interfaceCtx->unk_1FA = 1; + interfaceCtx->unk_1FA |= (1 << 0); } s32 Health_ChangeBy(PlayState* play, s16 healthChange) { @@ -4945,6 +4945,70 @@ void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) { CLOSE_DISPS(play->state.gfxCtx); } +void Interface_DrawActionIcon(PlayState* play, f32 x, f32 y, void* texture) { + InterfaceContext* interfaceCtx = &play->interfaceCtx; + OPEN_DISPS(play->state.gfxCtx); + + Matrix_Translate(-137.0f + x, 97.0f - y, XREG(18) / 10.0f, MTXMODE_NEW); + Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); + Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY); + + gSPMatrix(OVERLAY_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[0], 4, 0); + + gDPLoadTextureBlock(OVERLAY_DISP++, texture, G_IM_FMT_RGBA, G_IM_SIZ_32b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + + gSP1Quadrangle(OVERLAY_DISP++, 0, 2, 3, 1, 0); + + s16 item; + if (CVarGetInteger(CVAR_ENHANCEMENT("RocsFeatherOnA"), 0) == 1) { + item = ITEM_ROCS_FEATHER; + } else { + item = ITEM_NONE; + } + + if (GameInteractor_Should(VB_DRAW_AMMO_COUNT, false, &item)) { + s16 ammo; + if (GameInteractor_Should(VB_OVERRIDE_AMMO_COUNT, true, &item, &ammo)) { + ammo = AMMO(item); + } + + gDPPipeSync(OVERLAY_DISP++); + + if (GameInteractor_Should(VB_COLOR_AMMO_GREEN, false, item)) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 120, 255, 0, interfaceCtx->aAlpha); + } + + s16 ammoX = x + 14; + s16 ammoY = y + 27; + + if (ammo == 0) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 100, 100, 100, interfaceCtx->aAlpha); + OVERLAY_DISP = + Gfx_TextureIA8(OVERLAY_DISP, (u8*)_gAmmoDigit0Tex[0], 8, 8, ammoX, ammoY, 8, 8, 1 << 10, 1 << 10); + } else { + + if (ammo >= 100) { + ammo = ammo % 100; + } + + u8 tens = ammo / 10; + u8 ones = ammo % 10; + if (tens > 0) { + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, (u8*)_gAmmoDigit0Tex[tens], 8, 8, ammoX - 6, ammoY, 8, 8, + 1 << 10, 1 << 10); + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, (u8*)_gAmmoDigit0Tex[ones], 8, 8, ammoX, ammoY, 8, 8, + 1 << 10, 1 << 10); + } else { + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, (u8*)_gAmmoDigit0Tex[ones], 8, 8, ammoX, ammoY, 8, 8, + 1 << 10, 1 << 10); + } + } + } + CLOSE_DISPS(play->state.gfxCtx); +} + void Interface_DrawActionButton(PlayState* play, f32 x, f32 y) { InterfaceContext* interfaceCtx = &play->interfaceCtx; @@ -5441,7 +5505,7 @@ void Interface_Draw(PlayState* play) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->bAlpha); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM); - if (!(interfaceCtx->unk_1FA)) { + if (!(interfaceCtx->unk_1FA & (1 << 0))) { // B Button Icon & Ammo Count if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) { if (fullUi) { @@ -5723,22 +5787,29 @@ void Interface_Draw(PlayState* play) { if (fullUi) { Interface_DrawActionButton(play, PosX_BtnA, PosY_BtnA); } + gDPPipeSync(OVERLAY_DISP++); gSPSetGeometryMode(OVERLAY_DISP++, G_CULL_BACK); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->aAlpha); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); - Matrix_Translate(-138.0f + rAIconX, rAIconY, WREG(46 + languageOffset) / 10.0f, MTXMODE_NEW); - Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); - Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY); - gSPMatrix(OVERLAY_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD); - gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[4], 4, 0); - - if ((interfaceCtx->unk_1EC < 2) || (interfaceCtx->unk_1EC == 3)) { - Interface_DrawActionLabel(play->state.gfxCtx, interfaceCtx->doActionSegment[0]); + + // bit set to 1 if VB_SET_ACTION_TEXTURE override is to show an icon rather than text + if (interfaceCtx->unk_1FA & (1 << 1)) { + Interface_DrawActionIcon(play, PosX_BtnA, PosY_BtnA, interfaceCtx->doActionSegment[0]); } else { - Interface_DrawActionLabel(play->state.gfxCtx, interfaceCtx->doActionSegment[1]); + Matrix_Translate(-138.0f + rAIconX, rAIconY, WREG(46 + languageOffset) / 10.0f, MTXMODE_NEW); + Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); + Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY); + gSPMatrix(OVERLAY_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[4], 4, 0); + + if ((interfaceCtx->unk_1EC < 2) || (interfaceCtx->unk_1EC == 3)) { + Interface_DrawActionLabel(play->state.gfxCtx, interfaceCtx->doActionSegment[0]); + } else { + Interface_DrawActionLabel(play->state.gfxCtx, interfaceCtx->doActionSegment[1]); + } } gDPPipeSync(OVERLAY_DISP++); @@ -6757,7 +6828,12 @@ void Interface_Update(PlayState* play) { if ((action == DO_ACTION_MAX) || (action == DO_ACTION_MAX + 1)) { action = DO_ACTION_NONE; } - Interface_LoadActionLabel(interfaceCtx, action, 0); + if (!GameInteractor_Should(VB_SET_ACTION_TEXTURE, true, &action, &interfaceCtx->doActionSegment[0])) { + Interface_LoadActionLabel(interfaceCtx, action, 0); + interfaceCtx->unk_1FA &= ~(1 << 1); + } else { + interfaceCtx->unk_1FA |= (1 << 1); + } } break; case 3: @@ -6777,7 +6853,12 @@ void Interface_Update(PlayState* play) { if ((action == DO_ACTION_MAX) || (action == DO_ACTION_MAX + 1)) { action = DO_ACTION_NONE; } - Interface_LoadActionLabel(interfaceCtx, action, 0); + if (!GameInteractor_Should(VB_SET_ACTION_TEXTURE, true, &action, &interfaceCtx->doActionSegment[0])) { + Interface_LoadActionLabel(interfaceCtx, action, 0); + interfaceCtx->unk_1FA &= ~(1 << 1); + } else { + interfaceCtx->unk_1FA |= (1 << 1); + } } break; } diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 09dfb520044..c96c0082649 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -6455,7 +6455,7 @@ s32 Player_ActionHandler_Roll(Player* this, PlayState* play) { return true; } else if ((this->putAwayCooldownTimer == 0) && (this->heldItemAction >= PLAYER_IA_SWORD_MASTER)) { Player_UseItem(play, this, ITEM_NONE); - } else { + } else if (GameInteractor_Should(VB_CHANGE_ACTION_AND_USE, true, this, play)) { this->stateFlags2 ^= PLAYER_STATE2_NAVI_ACTIVE; } } @@ -9657,6 +9657,11 @@ void Player_Action_8084411C(Player* this, PlayState* play) { } } + // check for interactions on A while midair, exit early if one is triggered + if (!GameInteractor_Should(VB_CHANGE_ACTION_AND_USE, true, this, play)) { + return; + } + LinkAnimation_Update(play, &this->skelAnime); if (!(this->stateFlags2 & PLAYER_STATE2_HOPPING)) { @@ -11090,7 +11095,10 @@ void Player_UpdateInterface(PlayState* play, Player* this) { } } - Interface_SetDoAction(play, doAction); + if (!(this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND_LEAVE | BGCHECKFLAG_GROUND_TOUCH) && + GameInteractor_Should(VB_SET_ACTION_TEXTURE, false, &doAction, &play->interfaceCtx.doActionSegment[1]))) { + Interface_SetDoAction(play, doAction); + } if (this->stateFlags2 & PLAYER_STATE2_NAVI_ALERT) { if (this->focusActor != NULL) { diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 5ccfb91ae92..2974df38768 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -4874,7 +4874,8 @@ void KaleidoScope_Update(PlayState* play) { // Used to clear swordless temp B after unpause so minigame/epona handling restarts GameInteractor_Should(VB_TEMP_B_RESTORE_SWORDLESS, true); - interfaceCtx->unk_1FA = interfaceCtx->unk_1FC = 0; + interfaceCtx->unk_1FC = 0; + interfaceCtx->unk_1FA &= ~(1 << 0); osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf("i=%d LAST_TIME_TYPE=%d\n", i, gSaveContext.prevHudVisibilityMode); gSaveContext.hudVisibilityMode = 0; From 461e5e4eb4ab3aa38c514345a046ed1b7c4692df Mon Sep 17 00:00:00 2001 From: horrible Date: Sat, 7 Nov 2026 18:47:54 -0500 Subject: [PATCH 2/5] implement changes from pr comment - reorder added VB hook entries - update variable type in ammo color hook - fix static local variable oversight - move hooks to shared hook handler - re-order added RSK entry - change static fields to accessor methods - remove swimming from rocs-on-a checks - add audio feedback on use when rocs unavailable - shop refill replacement - add message builder to bring rocs to parity with nayru - combine rocs ammo count with triforce count to reduce custom drawing - update item_pool logic for rocs --- soh/assets/custom/lang/en_US.json | 2 +- .../custom-message/CustomMessageTypes.h | 2 + .../vanilla-behavior/GIVanillaBehavior.h | 39 +++--- .../randomizer/3drando/item_pool.cpp | 14 +- .../randomizer/Messages/MerchantMessages.cpp | 6 +- .../Enhancements/randomizer/RocsFeather.cpp | 122 +++++++++++------- .../Enhancements/randomizer/SeedContext.cpp | 6 +- .../Enhancements/randomizer/hook_handlers.cpp | 52 ++++++++ .../randomizerEnums/RandomizerSettingKey.h | 2 +- .../randomizer/randomizer_item_tracker.cpp | 117 +++++++++-------- .../overlays/actors/ovl_En_GirlA/z_en_girla.c | 119 +++++++++-------- 11 files changed, 287 insertions(+), 194 deletions(-) diff --git a/soh/assets/custom/lang/en_US.json b/soh/assets/custom/lang/en_US.json index 288758033e4..e8a9fc2eba7 100644 --- a/soh/assets/custom/lang/en_US.json +++ b/soh/assets/custom/lang/en_US.json @@ -1530,7 +1530,7 @@ "Off - Roc's Feather will not be shuffled. No changes will be made to item pool.\n\n", "On - Adds Roc's Feather to the item pool. Roc's Feather is a custom item granting the player a jump on demand. ", "Increasing the number of Feathers will allow successive jumps for each feather found.\n\n", - "Consumable - Adds consumable Roc's Feathers to the item pool. Some junk drops and shop refills will be replaced with feathers.\n\n" + "Consumable - Adds numerous consumable Roc's Feathers to the item pool. Recovery heart refills in shops will be replaced with feather refills.\n\n" ] }, "rocs_feather_count": { diff --git a/soh/soh/Enhancements/custom-message/CustomMessageTypes.h b/soh/soh/Enhancements/custom-message/CustomMessageTypes.h index ccae466c58c..104eefc33d3 100644 --- a/soh/soh/Enhancements/custom-message/CustomMessageTypes.h +++ b/soh/soh/Enhancements/custom-message/CustomMessageTypes.h @@ -244,6 +244,8 @@ typedef enum { TEXT_SAVE_MSG = 0x9213, TEXT_CONTINUE_OVERWORLD_MSG = 0x9214, TEXT_CONTINUE_DUNGEON_MSG = 0x9215, + TEXT_BUY_ROCS_FEATHER_PROMPT = 0x9216, + TEXT_BUY_ROCS_FEATHER_DESC = 0x9217, } TextIDs; #ifdef __cplusplus diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index 53190dc8f1d..33689e204d5 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -383,16 +383,7 @@ typedef enum { // ```c // true // ``` - // #### `args` - // - `int32_t` (item) - VB_CHANGE_HELD_ITEM_AND_USE_ITEM, - - // #### `result` - // ```c - // true - // ``` - // Whether the default action for A should be used. Sending false will (attempt to) - // intercept it. + // Intercept the default action on A // #### `args` // - Player* player // - PlayState* playState @@ -402,14 +393,9 @@ typedef enum { // ```c // true // ``` - // Whether the default texture for a given action on the A button should be used. - // A hook returning false must specify a replacement texture pointer. - // A hook returning true /may/ change the ACTION supplied to alter the text shown. - // Interface_LoadActionLabel // #### `args` - // - `u16* action` (`DO_ACTION_` - specified in `z64.h`'s `DoAction` struct) - // - `const char** alternateTexture` (pointer to a 32 x 32 G_IM_FMT_RGBA texture) - VB_SET_ACTION_TEXTURE, + // - `int32_t` (item) + VB_CHANGE_HELD_ITEM_AND_USE_ITEM, // #### `result` // ```c @@ -2794,6 +2780,14 @@ typedef enum { // - `**Gfx` (`&POLY_OPA_DISP`) VB_RENDER_YES_ON_CONTINUE_PROMPT, + // #### `result` + // ```c + // true + // ``` + // #### `args` + // - `*EnGirlA` + VB_REPLACE_SHOP_ITEM, + // #### `result` // ```c // true @@ -2857,6 +2851,17 @@ typedef enum { // - `*EnGb` VB_SELL_POES_TO_POE_COLLECTOR, + // #### `result` + // ```c + // true + // ``` + // Change text/icon on A + // #### `args` + // - `u16 action` + // - `bool rgbaIcon` + // - `char* alternateTexture` + VB_SET_ACTION_TEXTURE, + // #### `result` // ```c // true diff --git a/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp b/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp index 57f107a57b2..98ed6acabf6 100644 --- a/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp @@ -435,13 +435,13 @@ void GenerateItemPool() { if (!ctx->GetOption(RSK_STARTING_MASK_OF_TRUTH)) AddItemToPool(RG_MASK_OF_TRUTH, 2, 1, 1, 1); } - if (ctx->GetOption(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_ON)) { - uint8_t feathers = ctx->GetOption(RSK_ROCS_FEATHER_COUNT).Get()+1; - AddItemToPool(RG_ROCS_FEATHER, feathers, feathers, feathers, feathers); - } else if (ctx->GetOption(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_CONSUMABLE)) { - JunkPoolItems.emplace_back(RG_ROCS_FEATHER); - JunkPoolItems.emplace_back(RG_ROCS_FEATHER); - JunkPoolItems.emplace_back(RG_ROCS_FEATHER); + if (!ctx->GetOption(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_OFF)) { + int feathers = ctx->GetOption(RSK_ROCS_FEATHER_COUNT).Get() + 1; + if (ctx->GetOption(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_ON)) { + AddFixedItemToPool(RG_ROCS_FEATHER, feathers); + } else { + AddItemToPool(RG_ROCS_FEATHER, (int) (feathers*1.5), (int) (feathers*1.25), feathers, (int) (feathers*0.75)); + } } int bronzeScale = ctx->GetOption(RSK_SHUFFLE_SWIM) ? 1 : 0; diff --git a/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp b/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp index 3789ad25c10..bee350fafea 100644 --- a/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp @@ -212,8 +212,10 @@ void RegisterMerchantMessages() { COND_ID_HOOK(OnOpenText, TEXT_CARPET_SALESMAN_1, NON_BEAN_MERCHANTS, BuildCarpetGuyMessage); COND_ID_HOOK(OnOpenText, TEXT_CARPET_SALESMAN_ARMS_DEALER, NON_BEAN_MERCHANTS, BuildCarpetGuyMessage); COND_ID_HOOK(OnOpenText, TEXT_SCRUB_RANDOM, IS_RANDO, BuildScrubMessage); - COND_HOOK(OnOpenText, RAND_GET_OPTION(RSK_SHOPSANITY), BuildShopMessage); + COND_HOOK(OnOpenText, + RAND_GET_OPTION(RSK_SHOPSANITY) || RAND_GET_OPTION(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_CONSUMABLE), + BuildShopMessage); COND_ID_HOOK(OnOpenText, TEXT_CARPET_SALESMAN_CUSTOM_FAIL_TO_BUY, IS_RANDO, BuildCarpetGuyFailToBuyMessage); } -static RegisterShipInitFunc initFunc(RegisterMerchantMessages, { "IS_RANDO" }); \ No newline at end of file +static RegisterShipInitFunc initFunc(RegisterMerchantMessages, { "IS_RANDO" }); diff --git a/soh/soh/Enhancements/randomizer/RocsFeather.cpp b/soh/soh/Enhancements/randomizer/RocsFeather.cpp index 688b6b9cb5e..8c9c7cfdcf2 100644 --- a/soh/soh/Enhancements/randomizer/RocsFeather.cpp +++ b/soh/soh/Enhancements/randomizer/RocsFeather.cpp @@ -1,6 +1,8 @@ #include #include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/Enhancements/custom-message/CustomMessageManager.h" +#include "soh/Enhancements/custom-message/CustomMessageTypes.h" #include "soh/Enhancements/randomizer/SeedContext.h" #include "soh/ShipInit.hpp" @@ -14,15 +16,61 @@ extern PlayState* gPlayState; extern SaveContext gSaveContext; } -static uint8_t& rocsMaxUse = gSaveContext.ship.quest.data.randomizer.rocsFeathersAcquired; -static uint8_t& rocsRemaining = gSaveContext.ship.quest.data.randomizer.rocsFeathersRemaining; +#define TEXT_GET_ROCS_FEATHER 0xE0 + static uint8_t groundTimer = 0; static f32 effectsScale = 1.0f; -static bool rocsConsumable = false; +static bool rocsConsumable = true; + +static u8& RocsFeathersAcquired() { + return gSaveContext.ship.quest.data.randomizer.rocsFeathersAcquired; +} + +static u8& RocsFeathersRemaining() { + return gSaveContext.ship.quest.data.randomizer.rocsFeathersRemaining; +} + +static void BuildRocsFeatherGetMessage(uint16_t* textId, bool* loadFromMessageTable) { + CustomMessage msg; + + msg = CustomMessage( + "You got %bRoc's Feather%w!&You now have %b[[d]]%w |use|uses| of it!", + "<>", // TODO - German Translation + "<>"); // TODO - French Translation + + if (rocsConsumable) { + msg.InsertNumber(RocsFeathersRemaining()); + } else { + msg.InsertNumber(RocsFeathersAcquired()); + } + msg.AutoFormat(ITEM_ROCS_FEATHER); + msg.LoadIntoFont(); + *loadFromMessageTable = false; +} +void BuildRocsShopDesc(uint16_t* textId, bool* loadFromMessageTable) { + CustomMessage msg("\x08%rRoc's Feather 10 Rupees%w&Use this to jump across holes and chasms.\x0A\x02", + "\x08%r<>\x0A\x02", // TODO - German Translation + "\x08<>\x0A\x02"); // TODO - French Translation + msg.AutoFormat(); + msg.LoadIntoFont(); + *loadFromMessageTable = false; +} + +void BuildRocsShopPrompt(uint16_t* textId, bool* loadFromMessageTable) { + CustomMessage msg; + msg = CustomMessage( + "\x08%rRoc's Feather 10 Rupees%w\x09\x1B%gBuy&Don't buy%w\x09\x02", + "\x08<<%rGreifenfeder 10 Rubine%w\x09\x1B%gKaufen&Nicht kaufen%w>>\x09\x02", // TODO - German Translation + "\x08<<%rLa Plume de Roc 10 Rubis%w\x09\x1B%gAcheter&Ne pas acheter%w>>\x09\x02"); // TODO - French Translation + msg.AutoFormat(); + msg.LoadIntoFont(); + *loadFromMessageTable = false; +} void UseRocsFeather(PlayState* playState, Player* player) { - if (rocsRemaining > 0) { - rocsRemaining--; + if (RocsFeathersRemaining() > 0) { + RocsFeathersRemaining()--; func_80838940(player, (LinkAnimationHeader*)&gPlayerAnim_link_rocs_feather_jump, 5.8f, playState, 0); @@ -52,6 +100,8 @@ void UseRocsFeather(PlayState* playState, Player* player) { player->stateFlags2 &= ~(PLAYER_STATE2_HOPPING); Player_PlaySfx(&player->actor, NA_SE_PL_SKIP); + } else { + Sfx_PlaySfxCentered(NA_SE_SY_ERROR); } } @@ -77,7 +127,7 @@ void RegisterRocsFeather() { } if (!rocsConsumable && groundTimer >= 3) { - rocsRemaining = rocsMaxUse; + RocsFeathersRemaining() = RocsFeathersAcquired(); } }); @@ -106,19 +156,19 @@ void RegisterRocsFeather() { u16 action = playState->interfaceCtx.unk_1F0; - // disabled during z-targeting, while swimming, while paused, when grounded and any - // action is displayed, while climbing ladders, when midair with something held, + // disabled during z-targeting, while paused, when grounded and any action + // is displayed, while climbing ladders, when midair with something held, // while crawling, and when there are no rocs remaining to use if ((player->stateFlags1 & (PLAYER_STATE1_HOSTILE_LOCK_ON | PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS | PLAYER_STATE1_PARALLEL)) || - (player->stateFlags1 & PLAYER_STATE1_IN_WATER) || (player->stateFlags2 & PLAYER_STATE2_CRAWLING) || + (player->stateFlags2 & PLAYER_STATE2_CRAWLING) || (playState->pauseCtx.state > 0 && playState->pauseCtx.state < 18) || ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && action != DO_ACTION_NONE) || (!(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && - (action == DO_ACTION_DOWN || action == DO_ACTION_DROP || action == DO_ACTION_THROW)) || - (rocsRemaining == 0)) { + (action == DO_ACTION_DOWN || action == DO_ACTION_DROP || action == DO_ACTION_THROW || + action == DO_ACTION_DIVE)) || + (RocsFeathersRemaining() == 0)) { *should = true; - } else { if (CHECK_BTN_ANY(input->press.button, BTN_A)) { @@ -149,39 +199,6 @@ void RegisterRocsFeather() { } }); - COND_VB_SHOULD(VB_OVERRIDE_AMMO_COUNT, shouldRegister, { - int16_t item = *va_arg(args, int16_t*); - int16_t* ammo = va_arg(args, int16_t*); - if (item == ITEM_ROCS_FEATHER) { - if (rocsConsumable || rocsMaxUse != 1) { - *should = false; - *ammo = rocsRemaining; - } - } - }); - - COND_VB_SHOULD(VB_DRAW_AMMO_COUNT, shouldRegister, { - s16 item = *va_arg(args, s16*); - if (item == ITEM_ROCS_FEATHER) { - if (rocsConsumable || rocsMaxUse != 1) { - *should = true; - } else { - *should = false; - } - } - }); - - COND_VB_SHOULD(VB_COLOR_AMMO_GREEN, shouldRegister, { - s16 item = va_arg(args, s16); - if (item == ITEM_ROCS_FEATHER) { - if (rocsMaxUse == rocsRemaining) { - *should = true; - } else { - *should = false; - } - } - }); - COND_VB_SHOULD(VB_SET_ACTION_TEXTURE, shouldRegister, { if (CVarGetInteger(CVAR_ENHANCEMENT("RocsFeatherOnA"), 0) != 1) { *should = false; @@ -198,23 +215,28 @@ void RegisterRocsFeather() { *action = *action == DO_ACTION_NONE ? DO_ACTION_MAX : DO_ACTION_NONE; *should = false; - // disabled during z-targeting, while swimming, while paused, when grounded and any - // action is displayed, while climbing ladders, when midair with something held, + // disabled during z-targeting, while paused, when grounded and any action + // is displayed, while climbing ladders, when midair with something held, // while crawling, and when there are no rocs remaining to use } else if ((player->stateFlags1 & (PLAYER_STATE1_HOSTILE_LOCK_ON | PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS | PLAYER_STATE1_PARALLEL)) || - (player->stateFlags1 & PLAYER_STATE1_IN_WATER) || (player->stateFlags2 & PLAYER_STATE2_CRAWLING) || + (player->stateFlags2 & PLAYER_STATE2_CRAWLING) || (gPlayState->pauseCtx.state > 0 && gPlayState->pauseCtx.state < 18) || ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && *action != DO_ACTION_NONE) || (!(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && - (*action == DO_ACTION_DOWN || *action == DO_ACTION_DROP || *action == DO_ACTION_THROW)) || - (rocsRemaining == 0)) { + (*action == DO_ACTION_DOWN || *action == DO_ACTION_DROP || *action == DO_ACTION_THROW || + *action == DO_ACTION_DIVE)) || + (RocsFeathersRemaining() == 0)) { *should = false; } else { *should = true; *alternateTexture = gRocsFeatherTex; } }); + + COND_ID_HOOK(OnOpenText, TEXT_GET_ROCS_FEATHER, shouldRegister, BuildRocsFeatherGetMessage); + COND_ID_HOOK(OnOpenText, TEXT_BUY_ROCS_FEATHER_DESC, shouldRegister && rocsConsumable, BuildRocsShopDesc); + COND_ID_HOOK(OnOpenText, TEXT_BUY_ROCS_FEATHER_PROMPT, shouldRegister && rocsConsumable, BuildRocsShopPrompt); } static RegisterShipInitFunc registerRocsFeather(RegisterRocsFeather); diff --git a/soh/soh/Enhancements/randomizer/SeedContext.cpp b/soh/soh/Enhancements/randomizer/SeedContext.cpp index bad79c8f150..d79bc89e34d 100644 --- a/soh/soh/Enhancements/randomizer/SeedContext.cpp +++ b/soh/soh/Enhancements/randomizer/SeedContext.cpp @@ -636,9 +636,9 @@ void Context::HandleGetRocsFeather() { Flags_SetRandomizerInf(RAND_INF_OBTAINED_ROCS_FEATHER); bool rocsConsumable = Rando::Context::GetInstance()->GetOption(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_CONSUMABLE); - static uint8_t rocsMaxUse = Rando::Context::GetInstance()->GetOption(RSK_ROCS_FEATHER_COUNT).Get() + 1; - static uint8_t& rocsRemaining = mLogic->GetSaveContext()->ship.quest.data.randomizer.rocsFeathersRemaining; - static uint8_t& rocsAcquired = mLogic->GetSaveContext()->ship.quest.data.randomizer.rocsFeathersAcquired; + uint8_t rocsMaxUse = Rando::Context::GetInstance()->GetOption(RSK_ROCS_FEATHER_COUNT).Get() + 1; + uint8_t& rocsRemaining = mLogic->GetSaveContext()->ship.quest.data.randomizer.rocsFeathersRemaining; + uint8_t& rocsAcquired = mLogic->GetSaveContext()->ship.quest.data.randomizer.rocsFeathersAcquired; if (!rocsConsumable) { rocsAcquired = rocsAcquired < rocsMaxUse ? rocsAcquired + 1 : rocsMaxUse; diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 74f7e456c46..1a5cc126cd5 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -1914,6 +1914,31 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l } if (item == ITEM_NAYRUS_LOVE) { *should = RAND_GET_OPTION(RSK_NAYRUS_LOVE_USES).Get() > 0; + } else if (item == ITEM_ROCS_FEATHER) { + *should = RAND_GET_OPTION(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_CONSUMABLE) || + gSaveContext.ship.quest.data.randomizer.rocsFeathersAcquired != 1; + } + break; + } + case VB_OVERRIDE_AMMO_COUNT: { + s16 item = *va_arg(args, s16*); + s16* ammo = va_arg(args, s16*); + if (item == ITEM_ROCS_FEATHER) { + if (RAND_GET_OPTION(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_CONSUMABLE) || + gSaveContext.ship.quest.data.randomizer.rocsFeathersAcquired != 1) { + *should = false; + *ammo = gSaveContext.ship.quest.data.randomizer.rocsFeathersRemaining; + } else { + *should = true; + } + } + break; + } + case VB_COLOR_AMMO_GREEN: { + int item = va_arg(args, int); + if (item == ITEM_ROCS_FEATHER) { + *should = gSaveContext.ship.quest.data.randomizer.rocsFeathersAcquired == + gSaveContext.ship.quest.data.randomizer.rocsFeathersRemaining; } break; } @@ -2080,6 +2105,33 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l *should = false; break; } + case VB_REPLACE_SHOP_ITEM: { + EnGirlA* shop = va_arg(args, EnGirlA*); + + // replace Recovery Hearts in shops with Roc's Feathers when they're consumable + if (RAND_GET_OPTION(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_CONSUMABLE) && + shop->actor.params == SI_RECOVERY_HEART) { + shop->actor.textId = (s16)TEXT_BUY_ROCS_FEATHER_DESC; + shop->itemBuyPromptTextId = (s16)TEXT_BUY_ROCS_FEATHER_PROMPT; + shop->getItemId = Rando::StaticData::RetrieveItem(RG_ROCS_FEATHER).GetGIEntry_Copy().getItemId; + shop->giDrawId = GI_NONE; + shop->canBuyFunc = [](PlayState*, EnGirlA*) -> s32 { + if (gSaveContext.ship.quest.data.randomizer.rocsFeathersRemaining < + (Rando::Context::GetInstance()->GetOption(RSK_ROCS_FEATHER_COUNT).Get() + 1)) { + return CANBUY_RESULT_SUCCESS; + } else { + return CANBUY_RESULT_CANT_GET_NOW; + } + }; + shop->itemGiveFunc = [](PlayState*, EnGirlA* girlA) { + GetItemEntry replacementItem = Rando::StaticData::RetrieveItem(RG_ROCS_FEATHER).GetGIEntry_Copy(); + Randomizer_Item_Give(gPlayState, replacementItem); + Rupees_ChangeBy(-girlA->basePrice); + }; + *should = true; + } + break; + } // We need to override the vanilla behavior here because the player might sequence break and get Ruto kidnapped // before accessing other checks that require Ruto. So if she's kidnapped we allow her to spawn again case VB_RUTO_BE_CONSIDERED_NOT_KIDNAPPED: { diff --git a/soh/soh/Enhancements/randomizer/randomizerEnums/RandomizerSettingKey.h b/soh/soh/Enhancements/randomizer/randomizerEnums/RandomizerSettingKey.h index b4a194d25cd..722e2fad7c0 100644 --- a/soh/soh/Enhancements/randomizer/randomizerEnums/RandomizerSettingKey.h +++ b/soh/soh/Enhancements/randomizer/randomizerEnums/RandomizerSettingKey.h @@ -310,7 +310,6 @@ RANDO_ENUM_ITEM(RSK_LOCK_OVERWORLD_DOORS) RANDO_ENUM_ITEM(RSK_SHUFFLE_GRASS) RANDO_ENUM_ITEM(RSK_SHUFFLE_SIGNS) RANDO_ENUM_ITEM(RSK_ROCS_FEATHER) -RANDO_ENUM_ITEM(RSK_ROCS_FEATHER_COUNT) RANDO_ENUM_ITEM(RSK_SHUFFLE_ICICLES) RANDO_ENUM_ITEM(RSK_SHUFFLE_RED_ICE) RANDO_ENUM_ITEM(RSK_SHUFFLE_FIRE_GORONS) @@ -324,6 +323,7 @@ RANDO_ENUM_ITEM(RSK_STARTING_GERUDO_MASK) RANDO_ENUM_ITEM(RSK_STARTING_MASK_OF_TRUTH) RANDO_ENUM_ITEM(RSK_PROGRESSIVE_GORON_SWORD) RANDO_ENUM_ITEM(RSK_NAYRUS_LOVE_USES) +RANDO_ENUM_ITEM(RSK_ROCS_FEATHER_COUNT) RANDO_ENUM_ITEM(RSK_MAX) RANDO_ENUM_END(RandomizerSettingKey) diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index ad486459902..6234f282f93 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -732,33 +732,6 @@ void DrawItemCount(ItemTrackerItem item, bool hideMax) { ImGui::SetWindowFontScale(1.0f); // Reset font scale to the original state } - if (Rando::Context::GetInstance()->GetOption(RSK_ROCS_FEATHER_COUNT).Get() >= 1 && item.id == RG_ROCS_FEATHER) { - - std::string currentString = ""; - std::string maxString = - std::to_string(Rando::Context::GetInstance()->GetOption(RSK_ROCS_FEATHER_COUNT).Get() + 1); - ImU32 currentColor = IM_COL_WHITE; - ImU32 maxColor = IM_COL_GREEN; - - if (Rando::Context::GetInstance()->GetOption(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_CONSUMABLE)) { - currentString += std::to_string(gSaveContext.ship.quest.data.randomizer.rocsFeathersAcquired); - currentString += "/"; - } else { - currentString += std::to_string(gSaveContext.ship.quest.data.randomizer.rocsFeathersRemaining); - currentString += "/"; - } - - ImGui::SetCursorScreenPos( - ImVec2(p.x + (iconSize >> 1) - (ImGui::CalcTextSize((currentString + maxString).c_str()).x / 2), p.y - 14)); - ImGui::PushStyleColor(ImGuiCol_Text, currentColor); - ImGui::Text("%s", currentString.c_str()); - ImGui::PopStyleColor(); - ImGui::SameLine(0, 0.0f); - ImGui::PushStyleColor(ImGuiCol_Text, maxColor); - ImGui::Text("%s", maxString.c_str()); - ImGui::PopStyleColor(); - } - // progressive open chest: 'S' for small chests only, 'B' once big chests can be opened too if (item.id == RG_OPEN_CHEST && CVarGetInteger(CVAR_TRACKER_ITEM("OpenChestIdentifier"), 0) && IS_RANDO && RAND_GET_OPTION(RSK_SHUFFLE_OPEN_CHEST).Is(RO_OPEN_CHEST_PROGRESSIVE) && @@ -834,7 +807,8 @@ void DrawItemCount(ItemTrackerItem item, bool hideMax) { // These items have a static capacity, so display ammo instead (item.kind == ITEM_KIND_QUEST && item.id == QUEST_SKULL_TOKEN) || (item.kind == ITEM_KIND_ITEM && (item.id == ITEM_BEAN || item.id == ITEM_NAYRUS_LOVE || - item.id == ITEM_HEART_CONTAINER || item.id == ITEM_HEART_PIECE)); + item.id == ITEM_HEART_CONTAINER || item.id == ITEM_HEART_PIECE)) || + item.id == ITEM_ROCS_FEATHER; bool shouldDisplayMax = !(trackerNumberDisplayMode == ITEM_TRACKER_NUMBER_CURRENT_CAPACITY_ONLY || trackerNumberDisplayMode == ITEM_TRACKER_NUMBER_CURRENT_AMMO_ONLY); @@ -877,44 +851,69 @@ void DrawItemCount(ItemTrackerItem item, bool hideMax) { ImGui::PushStyleColor(ImGuiCol_Text, maxColor); ImGui::Text("%s", maxString.c_str()); ImGui::PopStyleColor(); - } else if (item.kind == ITEM_KIND_RG && item.id == RG_TRIFORCE_PIECE && IS_RANDO && - (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_TOTAL) > 0)) { + } else if (item.kind == ITEM_KIND_RG) { std::string currentString = ""; std::string requiredString = ""; std::string maxString = ""; - uint8_t piecesTotal = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_TOTAL); - uint8_t piecesRequired = OTRGlobals::Instance->gRandomizer->GetTriforcePiecesRequired(); - // If no trigger uses Triforce Pieces they're just filler; gauge progress against the whole pool. - if (piecesRequired == 0) { - piecesRequired = piecesTotal; - } - ImU32 currentColor = gSaveContext.ship.quest.data.randomizer.triforcePiecesCollected >= piecesRequired - ? IM_COL_GREEN - : IM_COL_WHITE; + ImU32 currentColor = IM_COL_GRAY; ImU32 maxColor = IM_COL_GREEN; - int32_t trackerTriforcePieceNumberDisplayMode = - CVarGetInteger(CVAR_TRACKER_ITEM("TriforcePieceCounts"), TRIFORCE_PIECE_COLLECTED_REQUIRED_MAX); - - currentString += std::to_string(gSaveContext.ship.quest.data.randomizer.triforcePiecesCollected); - currentString += "/"; - // gItemTrackerTriforcePieceTrack - if (trackerTriforcePieceNumberDisplayMode == TRIFORCE_PIECE_COLLECTED_REQUIRED_MAX) { - currentString += std::to_string(piecesRequired); + + if (item.id == RG_TRIFORCE_PIECE && IS_RANDO && + (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_TOTAL) > 0)) { + uint8_t piecesTotal = + OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_TOTAL); + uint8_t piecesRequired = OTRGlobals::Instance->gRandomizer->GetTriforcePiecesRequired(); + // If no trigger uses Triforce Pieces they're just filler; gauge progress against the whole pool. + if (piecesRequired == 0) { + piecesRequired = piecesTotal; + } + currentColor = gSaveContext.ship.quest.data.randomizer.triforcePiecesCollected >= piecesRequired + ? IM_COL_GREEN + : IM_COL_WHITE; + int32_t trackerTriforcePieceNumberDisplayMode = + CVarGetInteger(CVAR_TRACKER_ITEM("TriforcePieceCounts"), TRIFORCE_PIECE_COLLECTED_REQUIRED_MAX); + + currentString += std::to_string(gSaveContext.ship.quest.data.randomizer.triforcePiecesCollected); + currentString += "/"; + // gItemTrackerTriforcePieceTrack + if (trackerTriforcePieceNumberDisplayMode == TRIFORCE_PIECE_COLLECTED_REQUIRED_MAX) { + currentString += std::to_string(piecesRequired); + currentString += "/"; + maxString += std::to_string(piecesTotal); + } else if (trackerTriforcePieceNumberDisplayMode == TRIFORCE_PIECE_COLLECTED_REQUIRED) { + maxString += std::to_string(piecesRequired); + } + } else if (item.id == RG_ROCS_FEATHER && !(RAND_GET_OPTION(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_OFF))) { + const uint8_t maxUses = RAND_GET_OPTION(RSK_ROCS_FEATHER_COUNT).Get() + 1; + maxString += std::to_string(maxUses); + + if (RAND_GET_OPTION(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_ON)) { + currentString = std::to_string(gSaveContext.ship.quest.data.randomizer.rocsFeathersAcquired); + currentColor = gSaveContext.ship.quest.data.randomizer.rocsFeathersAcquired == maxUses ? IM_COL_GREEN + : IM_COL_WHITE; + } else { + currentString += std::to_string(gSaveContext.ship.quest.data.randomizer.rocsFeathersRemaining); + currentColor = gSaveContext.ship.quest.data.randomizer.rocsFeathersRemaining == maxUses ? IM_COL_GREEN + : IM_COL_WHITE; + } currentString += "/"; - maxString += std::to_string(piecesTotal); - } else if (trackerTriforcePieceNumberDisplayMode == TRIFORCE_PIECE_COLLECTED_REQUIRED) { - maxString += std::to_string(piecesRequired); } - ImGui::SetCursorScreenPos( - ImVec2(p.x + (iconSize >> 1) - (ImGui::CalcTextSize((currentString + maxString).c_str()).x / 2), p.y - 14)); - ImGui::PushStyleColor(ImGuiCol_Text, currentColor); - ImGui::Text("%s", currentString.c_str()); - ImGui::PopStyleColor(); - ImGui::SameLine(0, 0.0f); - ImGui::PushStyleColor(ImGuiCol_Text, maxColor); - ImGui::Text("%s", maxString.c_str()); - ImGui::PopStyleColor(); + // skip draw if there's no counts to draw :) + if (currentString == "" && requiredString == "") { + ImGui::SetCursorScreenPos(ImVec2(p.x, p.y - 14)); + ImGui::TextUnformatted(""); + } else { + ImGui::SetCursorScreenPos(ImVec2( + p.x + (iconSize >> 1) - (ImGui::CalcTextSize((currentString + maxString).c_str()).x / 2), p.y - 14)); + ImGui::PushStyleColor(ImGuiCol_Text, currentColor); + ImGui::Text("%s", currentString.c_str()); + ImGui::PopStyleColor(); + ImGui::SameLine(0, 0.0f); + ImGui::PushStyleColor(ImGuiCol_Text, maxColor); + ImGui::Text("%s", maxString.c_str()); + ImGui::PopStyleColor(); + } } else { ImGui::SetCursorScreenPos(ImVec2(p.x, p.y - 14)); ImGui::TextUnformatted(""); diff --git a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index fbc355262e1..3afdd4b7359 100644 --- a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -1268,64 +1268,67 @@ void EnGirlA_WaitForObject(EnGirlA* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) { this->actor.flags &= ~ACTOR_FLAG_UPDATE_CULLING_DISABLED; this->actor.objBankIndex = this->requiredObjectSlot; - switch (this->actor.params) { - case SI_KEATON_MASK: - if (Flags_GetItemGetInf(ITEMGETINF_38)) { - this->actor.textId = 0x70B6; - } else { - this->actor.textId = itemEntry->itemDescTextId; - } - this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; - break; - case SI_SPOOKY_MASK: - if (Flags_GetItemGetInf(ITEMGETINF_3A)) { - this->actor.textId = 0x70B5; - } else { + LUSLOG_WARN("LIZDEBUG!!!!! in EnGirlA_WaitForObject VB_REPLACE_SHOP_ITEM!!! %d", this->actor.params); + if (!GameInteractor_Should(VB_REPLACE_SHOP_ITEM, false, this)) { + switch (this->actor.params) { + case SI_KEATON_MASK: + if (Flags_GetItemGetInf(ITEMGETINF_38)) { + this->actor.textId = 0x70B6; + } else { + this->actor.textId = itemEntry->itemDescTextId; + } + this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; + break; + case SI_SPOOKY_MASK: + if (Flags_GetItemGetInf(ITEMGETINF_3A)) { + this->actor.textId = 0x70B5; + } else { + this->actor.textId = itemEntry->itemDescTextId; + } + this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; + break; + case SI_SKULL_MASK: + if (Flags_GetItemGetInf(ITEMGETINF_39)) { + this->actor.textId = 0x70B4; + } else { + this->actor.textId = itemEntry->itemDescTextId; + } + this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; + break; + case SI_BUNNY_HOOD: + if (Flags_GetItemGetInf(ITEMGETINF_3B)) { + this->actor.textId = 0x70B7; + } else { + this->actor.textId = itemEntry->itemDescTextId; + } + this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; + break; + case SI_MASK_OF_TRUTH: + if (Flags_GetItemGetInf(ITEMGETINF_3B)) { + this->actor.textId = 0x70BB; + this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; + } else { + this->actor.textId = itemEntry->itemDescTextId; + this->itemBuyPromptTextId = 0xEB; + } + break; + case SI_ZORA_MASK: this->actor.textId = itemEntry->itemDescTextId; - } - this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; - break; - case SI_SKULL_MASK: - if (Flags_GetItemGetInf(ITEMGETINF_39)) { - this->actor.textId = 0x70B4; - } else { + this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; + break; + case SI_GORON_MASK: this->actor.textId = itemEntry->itemDescTextId; - } - this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; - break; - case SI_BUNNY_HOOD: - if (Flags_GetItemGetInf(ITEMGETINF_3B)) { - this->actor.textId = 0x70B7; - } else { + this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; + break; + case SI_GERUDO_MASK: this->actor.textId = itemEntry->itemDescTextId; - } - this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; - break; - case SI_MASK_OF_TRUTH: - if (Flags_GetItemGetInf(ITEMGETINF_3B)) { - this->actor.textId = 0x70BB; this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; - } else { + break; + default: this->actor.textId = itemEntry->itemDescTextId; - this->itemBuyPromptTextId = 0xEB; - } - break; - case SI_ZORA_MASK: - this->actor.textId = itemEntry->itemDescTextId; - this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; - break; - case SI_GORON_MASK: - this->actor.textId = itemEntry->itemDescTextId; - this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; - break; - case SI_GERUDO_MASK: - this->actor.textId = itemEntry->itemDescTextId; - this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; - break; - default: - this->actor.textId = itemEntry->itemDescTextId; - this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; - break; + this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; + break; + } } if (!EnGirlA_TrySetMaskItemDescription(this, play)) { EnGirlA_SetItemDescription(play, this); @@ -1365,6 +1368,8 @@ void EnGirlA_WaitForObject(EnGirlA* this, PlayState* play) { ShopItemIdentity shopItemIdentity = Randomizer_IdentifyShopItem(play->sceneNum, this->randoSlotIndex); GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheckWithoutObtainabilityCheck( shopItemIdentity.identity.randomizerCheck, shopItemIdentity.ogItemId); + LUSLOG_WARN("LIZDEBUG!!!!! wait for object shopItemIdentity.identity.randomizerInf!!! %d", + shopItemIdentity.identity.randomizerInf); this->actor.textId = 0x9100 + (shopItemIdentity.identity.randomizerInf - RAND_INF_SHOP_ITEMS_KF_SHOP_ITEM_1); this->itemBuyPromptTextId = @@ -1463,5 +1468,11 @@ void EnGirlA_Draw(Actor* thisx, PlayState* play) { return; } - GetItem_Draw(play, this->giDrawId); + LUSLOG_WARN("LIZDEBUG!!!!! in EnGirlA_Draw VB_REPLACE_SHOP_ITEM!!! %d", this->actor.params); + if (GameInteractor_Should(VB_REPLACE_SHOP_ITEM, false, this)) { + GetItemEntry getItemEntry = ItemTable_RetrieveEntry(MOD_RANDOMIZER, this->getItemId); + GetItemEntry_Draw(play, getItemEntry); + } else { + GetItem_Draw(play, this->giDrawId); + } } From 9dee24540402da68b16cf5801773bce1b91cd4ab Mon Sep 17 00:00:00 2001 From: horrible Date: Sat, 7 Nov 2026 19:20:46 -0500 Subject: [PATCH 3/5] revert testing changes --- .../randomizer/Messages/MerchantMessages.cpp | 4 +--- .../Enhancements/randomizer/RocsFeather.cpp | 18 ++++++++---------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp b/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp index bee350fafea..3a1ec84d117 100644 --- a/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp @@ -212,9 +212,7 @@ void RegisterMerchantMessages() { COND_ID_HOOK(OnOpenText, TEXT_CARPET_SALESMAN_1, NON_BEAN_MERCHANTS, BuildCarpetGuyMessage); COND_ID_HOOK(OnOpenText, TEXT_CARPET_SALESMAN_ARMS_DEALER, NON_BEAN_MERCHANTS, BuildCarpetGuyMessage); COND_ID_HOOK(OnOpenText, TEXT_SCRUB_RANDOM, IS_RANDO, BuildScrubMessage); - COND_HOOK(OnOpenText, - RAND_GET_OPTION(RSK_SHOPSANITY) || RAND_GET_OPTION(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_CONSUMABLE), - BuildShopMessage); + COND_HOOK(OnOpenText, RAND_GET_OPTION(RSK_SHOPSANITY), BuildShopMessage); COND_ID_HOOK(OnOpenText, TEXT_CARPET_SALESMAN_CUSTOM_FAIL_TO_BUY, IS_RANDO, BuildCarpetGuyFailToBuyMessage); } diff --git a/soh/soh/Enhancements/randomizer/RocsFeather.cpp b/soh/soh/Enhancements/randomizer/RocsFeather.cpp index 8c9c7cfdcf2..585a04a381e 100644 --- a/soh/soh/Enhancements/randomizer/RocsFeather.cpp +++ b/soh/soh/Enhancements/randomizer/RocsFeather.cpp @@ -156,17 +156,16 @@ void RegisterRocsFeather() { u16 action = playState->interfaceCtx.unk_1F0; - // disabled during z-targeting, while paused, when grounded and any action - // is displayed, while climbing ladders, when midair with something held, + // not usable from A during z-targeting, swimming, while paused, when grounded and any + // action is displayed, while climbing ladders, when midair with something held, // while crawling, and when there are no rocs remaining to use if ((player->stateFlags1 & (PLAYER_STATE1_HOSTILE_LOCK_ON | PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS | PLAYER_STATE1_PARALLEL)) || - (player->stateFlags2 & PLAYER_STATE2_CRAWLING) || + (player->stateFlags1 & PLAYER_STATE1_IN_WATER) || (player->stateFlags2 & PLAYER_STATE2_CRAWLING) || (playState->pauseCtx.state > 0 && playState->pauseCtx.state < 18) || ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && action != DO_ACTION_NONE) || (!(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && - (action == DO_ACTION_DOWN || action == DO_ACTION_DROP || action == DO_ACTION_THROW || - action == DO_ACTION_DIVE)) || + (action == DO_ACTION_DOWN || action == DO_ACTION_DROP || action == DO_ACTION_THROW)) || (RocsFeathersRemaining() == 0)) { *should = true; } else { @@ -215,17 +214,16 @@ void RegisterRocsFeather() { *action = *action == DO_ACTION_NONE ? DO_ACTION_MAX : DO_ACTION_NONE; *should = false; - // disabled during z-targeting, while paused, when grounded and any action - // is displayed, while climbing ladders, when midair with something held, + // do not display on A during z-targeting, while paused, when grounded and any + // action is displayed, while climbing ladders, when midair with something held, // while crawling, and when there are no rocs remaining to use } else if ((player->stateFlags1 & (PLAYER_STATE1_HOSTILE_LOCK_ON | PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS | PLAYER_STATE1_PARALLEL)) || - (player->stateFlags2 & PLAYER_STATE2_CRAWLING) || + (player->stateFlags1 & PLAYER_STATE1_IN_WATER) || (player->stateFlags2 & PLAYER_STATE2_CRAWLING) || (gPlayState->pauseCtx.state > 0 && gPlayState->pauseCtx.state < 18) || ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && *action != DO_ACTION_NONE) || (!(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && - (*action == DO_ACTION_DOWN || *action == DO_ACTION_DROP || *action == DO_ACTION_THROW || - *action == DO_ACTION_DIVE)) || + (*action == DO_ACTION_DOWN || *action == DO_ACTION_DROP || *action == DO_ACTION_THROW)) || (RocsFeathersRemaining() == 0)) { *should = false; } else { From cfcb12171a019d541577565430d4d85b50d54f40 Mon Sep 17 00:00:00 2001 From: horrible Date: Tue, 10 Nov 2026 21:51:27 -0500 Subject: [PATCH 4/5] remove rocs-on-a functionality, clean-up missed test comments * remove rocs-on-a functionality, clean-up missed test comments * re-run clang format 14 --- .../vanilla-behavior/GIVanillaBehavior.h | 21 ---- .../Enhancements/randomizer/RocsFeather.cpp | 72 ------------ soh/soh/SohGui/SohMenuEnhancements.cpp | 6 - soh/src/code/z_construct.c | 3 +- soh/src/code/z_message_PAL.c | 3 +- soh/src/code/z_parameter.c | 106 +++--------------- .../overlays/actors/ovl_En_GirlA/z_en_girla.c | 8 +- .../actors/ovl_player_actor/z_player.c | 12 +- .../ovl_kaleido_scope/z_kaleido_scope_PAL.c | 3 +- 9 files changed, 20 insertions(+), 214 deletions(-) diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index 33689e204d5..7833863f357 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -379,16 +379,6 @@ typedef enum { // - `*EnHeishi2` VB_CAN_BRIBE_HEISHI2, - // #### `result` - // ```c - // true - // ``` - // Intercept the default action on A - // #### `args` - // - Player* player - // - PlayState* playState - VB_CHANGE_ACTION_AND_USE, - // #### `result` // ```c // true @@ -2851,17 +2841,6 @@ typedef enum { // - `*EnGb` VB_SELL_POES_TO_POE_COLLECTOR, - // #### `result` - // ```c - // true - // ``` - // Change text/icon on A - // #### `args` - // - `u16 action` - // - `bool rgbaIcon` - // - `char* alternateTexture` - VB_SET_ACTION_TEXTURE, - // #### `result` // ```c // true diff --git a/soh/soh/Enhancements/randomizer/RocsFeather.cpp b/soh/soh/Enhancements/randomizer/RocsFeather.cpp index 585a04a381e..840502e186c 100644 --- a/soh/soh/Enhancements/randomizer/RocsFeather.cpp +++ b/soh/soh/Enhancements/randomizer/RocsFeather.cpp @@ -144,44 +144,6 @@ void RegisterRocsFeather() { } }); - COND_VB_SHOULD(VB_CHANGE_ACTION_AND_USE, shouldRegister, { - if (CVarGetInteger(CVAR_ENHANCEMENT("RocsFeatherOnA"), 0) != 1) { - *should = true; - return; - } - - Player* player = va_arg(args, Player*); - PlayState* playState = va_arg(args, PlayState*); - Input* input = &playState->state.input[0]; - - u16 action = playState->interfaceCtx.unk_1F0; - - // not usable from A during z-targeting, swimming, while paused, when grounded and any - // action is displayed, while climbing ladders, when midair with something held, - // while crawling, and when there are no rocs remaining to use - if ((player->stateFlags1 & - (PLAYER_STATE1_HOSTILE_LOCK_ON | PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS | PLAYER_STATE1_PARALLEL)) || - (player->stateFlags1 & PLAYER_STATE1_IN_WATER) || (player->stateFlags2 & PLAYER_STATE2_CRAWLING) || - (playState->pauseCtx.state > 0 && playState->pauseCtx.state < 18) || - ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && action != DO_ACTION_NONE) || - (!(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && - (action == DO_ACTION_DOWN || action == DO_ACTION_DROP || action == DO_ACTION_THROW)) || - (RocsFeathersRemaining() == 0)) { - *should = true; - } else { - - if (CHECK_BTN_ANY(input->press.button, BTN_A)) { - *should = false; - UseRocsFeather(playState, player); - - } else if (!(CHECK_BTN_ANY(input->press.button, BTN_A)) && - player->actor.bgCheckFlags & (BGCHECKFLAG_GROUND_LEAVE | BGCHECKFLAG_GROUND_TOUCH)) { - *should = false; - playState->interfaceCtx.unk_1F0 = DO_ACTION_NONE; - } - } - }); - COND_VB_SHOULD(VB_DRAW_CUSTOM_ITEM_NAME, shouldRegister, { u32 namedItem = va_arg(args, u32); if (namedItem == ITEM_ROCS_FEATHER) { @@ -198,40 +160,6 @@ void RegisterRocsFeather() { } }); - COND_VB_SHOULD(VB_SET_ACTION_TEXTURE, shouldRegister, { - if (CVarGetInteger(CVAR_ENHANCEMENT("RocsFeatherOnA"), 0) != 1) { - *should = false; - return; - } - - u16* action = va_arg(args, u16*); - const char** alternateTexture = va_arg(args, const char**); - Player* player = GET_PLAYER(gPlayState); - - // clear action manually on jumping/landing to avoid issues with value not refreshing on change when direction - // input is maintained - if (player->actor.bgCheckFlags & (BGCHECKFLAG_GROUND_LEAVE | BGCHECKFLAG_GROUND_TOUCH)) { - *action = *action == DO_ACTION_NONE ? DO_ACTION_MAX : DO_ACTION_NONE; - *should = false; - - // do not display on A during z-targeting, while paused, when grounded and any - // action is displayed, while climbing ladders, when midair with something held, - // while crawling, and when there are no rocs remaining to use - } else if ((player->stateFlags1 & - (PLAYER_STATE1_HOSTILE_LOCK_ON | PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS | PLAYER_STATE1_PARALLEL)) || - (player->stateFlags1 & PLAYER_STATE1_IN_WATER) || (player->stateFlags2 & PLAYER_STATE2_CRAWLING) || - (gPlayState->pauseCtx.state > 0 && gPlayState->pauseCtx.state < 18) || - ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && *action != DO_ACTION_NONE) || - (!(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && - (*action == DO_ACTION_DOWN || *action == DO_ACTION_DROP || *action == DO_ACTION_THROW)) || - (RocsFeathersRemaining() == 0)) { - *should = false; - } else { - *should = true; - *alternateTexture = gRocsFeatherTex; - } - }); - COND_ID_HOOK(OnOpenText, TEXT_GET_ROCS_FEATHER, shouldRegister, BuildRocsFeatherGetMessage); COND_ID_HOOK(OnOpenText, TEXT_BUY_ROCS_FEATHER_DESC, shouldRegister && rocsConsumable, BuildRocsShopDesc); COND_ID_HOOK(OnOpenText, TEXT_BUY_ROCS_FEATHER_PROMPT, shouldRegister && rocsConsumable, BuildRocsShopPrompt); diff --git a/soh/soh/SohGui/SohMenuEnhancements.cpp b/soh/soh/SohGui/SohMenuEnhancements.cpp index 8be3cccba44..acdfd6ebd55 100644 --- a/soh/soh/SohGui/SohMenuEnhancements.cpp +++ b/soh/soh/SohGui/SohMenuEnhancements.cpp @@ -1139,12 +1139,6 @@ void SohMenu::AddMenuEnhancements() { .CVar(CVAR_ENHANCEMENT("RebottleBlueFire")) .Options(CheckboxOptions().Tooltip("Blue Fire dropped from a bottle can be bottled.")); - AddWidget(path, "Custom Items", WIDGET_SEPARATOR_TEXT); - AddWidget(path, "Roc's Feather on A", WIDGET_CVAR_CHECKBOX) - .CVar(CVAR_ENHANCEMENT("RocsFeatherOnA")) - .Options(CheckboxOptions().Tooltip("If Roc's Feather is enabled and obtained in the current save, have it " - "usable with A whenever A would normally be blank.")); - // Fixes path.sidebarName = "Fixes"; AddSidebarEntry("Enhancements", path.sidebarName, 3); diff --git a/soh/src/code/z_construct.c b/soh/src/code/z_construct.c index f9a4a3cac08..3eb5ec428b9 100644 --- a/soh/src/code/z_construct.c +++ b/soh/src/code/z_construct.c @@ -17,8 +17,7 @@ void func_801109B0(PlayState* play) { View_Init(&interfaceCtx->view, play->state.gfxCtx); - interfaceCtx->unk_261 = interfaceCtx->unk_1FC = 0; - interfaceCtx->unk_1FA &= ~(1 << 0); + interfaceCtx->unk_1FA = interfaceCtx->unk_261 = interfaceCtx->unk_1FC = 0; interfaceCtx->unk_1EC = interfaceCtx->unk_1EE = interfaceCtx->unk_1F0 = 0; interfaceCtx->unk_22E = 0; interfaceCtx->unk_230 = 16; diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 1b405fe9d1c..66a7baae239 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -4655,8 +4655,7 @@ void Message_Update(PlayState* play) { osSyncPrintf(VT_RST); msgCtx->msgLength = 0; msgCtx->msgMode = MSGMODE_NONE; - interfaceCtx->unk_1FC = 0; - interfaceCtx->unk_1FA &= ~(1 << 0); + interfaceCtx->unk_1FA = interfaceCtx->unk_1FC = 0; msgCtx->textId = msgCtx->stateTimer = 0; if (msgCtx->textboxEndType == TEXTBOX_ENDTYPE_PERSISTENT) { diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index f86f4142c0e..cd310d20502 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -2879,7 +2879,7 @@ void Interface_LoadActionLabelB(PlayState* play, u16 action) { interfaceCtx->doActionSegment[1] = action != DO_ACTION_NONE ? doAction : gEmptyTexture; osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); - interfaceCtx->unk_1FA |= (1 << 0); + interfaceCtx->unk_1FA = 1; } s32 Health_ChangeBy(PlayState* play, s16 healthChange) { @@ -4945,70 +4945,6 @@ void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) { CLOSE_DISPS(play->state.gfxCtx); } -void Interface_DrawActionIcon(PlayState* play, f32 x, f32 y, void* texture) { - InterfaceContext* interfaceCtx = &play->interfaceCtx; - OPEN_DISPS(play->state.gfxCtx); - - Matrix_Translate(-137.0f + x, 97.0f - y, XREG(18) / 10.0f, MTXMODE_NEW); - Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); - Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY); - - gSPMatrix(OVERLAY_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD); - gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[0], 4, 0); - - gDPLoadTextureBlock(OVERLAY_DISP++, texture, G_IM_FMT_RGBA, G_IM_SIZ_32b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - - gSP1Quadrangle(OVERLAY_DISP++, 0, 2, 3, 1, 0); - - s16 item; - if (CVarGetInteger(CVAR_ENHANCEMENT("RocsFeatherOnA"), 0) == 1) { - item = ITEM_ROCS_FEATHER; - } else { - item = ITEM_NONE; - } - - if (GameInteractor_Should(VB_DRAW_AMMO_COUNT, false, &item)) { - s16 ammo; - if (GameInteractor_Should(VB_OVERRIDE_AMMO_COUNT, true, &item, &ammo)) { - ammo = AMMO(item); - } - - gDPPipeSync(OVERLAY_DISP++); - - if (GameInteractor_Should(VB_COLOR_AMMO_GREEN, false, item)) { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 120, 255, 0, interfaceCtx->aAlpha); - } - - s16 ammoX = x + 14; - s16 ammoY = y + 27; - - if (ammo == 0) { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 100, 100, 100, interfaceCtx->aAlpha); - OVERLAY_DISP = - Gfx_TextureIA8(OVERLAY_DISP, (u8*)_gAmmoDigit0Tex[0], 8, 8, ammoX, ammoY, 8, 8, 1 << 10, 1 << 10); - } else { - - if (ammo >= 100) { - ammo = ammo % 100; - } - - u8 tens = ammo / 10; - u8 ones = ammo % 10; - if (tens > 0) { - OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, (u8*)_gAmmoDigit0Tex[tens], 8, 8, ammoX - 6, ammoY, 8, 8, - 1 << 10, 1 << 10); - OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, (u8*)_gAmmoDigit0Tex[ones], 8, 8, ammoX, ammoY, 8, 8, - 1 << 10, 1 << 10); - } else { - OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, (u8*)_gAmmoDigit0Tex[ones], 8, 8, ammoX, ammoY, 8, 8, - 1 << 10, 1 << 10); - } - } - } - CLOSE_DISPS(play->state.gfxCtx); -} - void Interface_DrawActionButton(PlayState* play, f32 x, f32 y) { InterfaceContext* interfaceCtx = &play->interfaceCtx; @@ -5505,7 +5441,7 @@ void Interface_Draw(PlayState* play) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->bAlpha); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM); - if (!(interfaceCtx->unk_1FA & (1 << 0))) { + if (!(interfaceCtx->unk_1FA)) { // B Button Icon & Ammo Count if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) { if (fullUi) { @@ -5787,7 +5723,6 @@ void Interface_Draw(PlayState* play) { if (fullUi) { Interface_DrawActionButton(play, PosX_BtnA, PosY_BtnA); } - gDPPipeSync(OVERLAY_DISP++); gSPSetGeometryMode(OVERLAY_DISP++, G_CULL_BACK); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, @@ -5795,21 +5730,16 @@ void Interface_Draw(PlayState* play) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->aAlpha); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); - // bit set to 1 if VB_SET_ACTION_TEXTURE override is to show an icon rather than text - if (interfaceCtx->unk_1FA & (1 << 1)) { - Interface_DrawActionIcon(play, PosX_BtnA, PosY_BtnA, interfaceCtx->doActionSegment[0]); - } else { - Matrix_Translate(-138.0f + rAIconX, rAIconY, WREG(46 + languageOffset) / 10.0f, MTXMODE_NEW); - Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); - Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY); - gSPMatrix(OVERLAY_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD); - gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[4], 4, 0); + Matrix_Translate(-138.0f + rAIconX, rAIconY, WREG(46 + languageOffset) / 10.0f, MTXMODE_NEW); + Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); + Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY); + gSPMatrix(OVERLAY_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[4], 4, 0); - if ((interfaceCtx->unk_1EC < 2) || (interfaceCtx->unk_1EC == 3)) { - Interface_DrawActionLabel(play->state.gfxCtx, interfaceCtx->doActionSegment[0]); - } else { - Interface_DrawActionLabel(play->state.gfxCtx, interfaceCtx->doActionSegment[1]); - } + if ((interfaceCtx->unk_1EC < 2) || (interfaceCtx->unk_1EC == 3)) { + Interface_DrawActionLabel(play->state.gfxCtx, interfaceCtx->doActionSegment[0]); + } else { + Interface_DrawActionLabel(play->state.gfxCtx, interfaceCtx->doActionSegment[1]); } gDPPipeSync(OVERLAY_DISP++); @@ -6828,12 +6758,7 @@ void Interface_Update(PlayState* play) { if ((action == DO_ACTION_MAX) || (action == DO_ACTION_MAX + 1)) { action = DO_ACTION_NONE; } - if (!GameInteractor_Should(VB_SET_ACTION_TEXTURE, true, &action, &interfaceCtx->doActionSegment[0])) { - Interface_LoadActionLabel(interfaceCtx, action, 0); - interfaceCtx->unk_1FA &= ~(1 << 1); - } else { - interfaceCtx->unk_1FA |= (1 << 1); - } + Interface_LoadActionLabel(interfaceCtx, action, 0); } break; case 3: @@ -6853,12 +6778,7 @@ void Interface_Update(PlayState* play) { if ((action == DO_ACTION_MAX) || (action == DO_ACTION_MAX + 1)) { action = DO_ACTION_NONE; } - if (!GameInteractor_Should(VB_SET_ACTION_TEXTURE, true, &action, &interfaceCtx->doActionSegment[0])) { - Interface_LoadActionLabel(interfaceCtx, action, 0); - interfaceCtx->unk_1FA &= ~(1 << 1); - } else { - interfaceCtx->unk_1FA |= (1 << 1); - } + Interface_LoadActionLabel(interfaceCtx, action, 0); } break; } diff --git a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index 3afdd4b7359..9ce41ae081b 100644 --- a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -1268,7 +1268,6 @@ void EnGirlA_WaitForObject(EnGirlA* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) { this->actor.flags &= ~ACTOR_FLAG_UPDATE_CULLING_DISABLED; this->actor.objBankIndex = this->requiredObjectSlot; - LUSLOG_WARN("LIZDEBUG!!!!! in EnGirlA_WaitForObject VB_REPLACE_SHOP_ITEM!!! %d", this->actor.params); if (!GameInteractor_Should(VB_REPLACE_SHOP_ITEM, false, this)) { switch (this->actor.params) { case SI_KEATON_MASK: @@ -1368,8 +1367,6 @@ void EnGirlA_WaitForObject(EnGirlA* this, PlayState* play) { ShopItemIdentity shopItemIdentity = Randomizer_IdentifyShopItem(play->sceneNum, this->randoSlotIndex); GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheckWithoutObtainabilityCheck( shopItemIdentity.identity.randomizerCheck, shopItemIdentity.ogItemId); - LUSLOG_WARN("LIZDEBUG!!!!! wait for object shopItemIdentity.identity.randomizerInf!!! %d", - shopItemIdentity.identity.randomizerInf); this->actor.textId = 0x9100 + (shopItemIdentity.identity.randomizerInf - RAND_INF_SHOP_ITEMS_KF_SHOP_ITEM_1); this->itemBuyPromptTextId = @@ -1379,8 +1376,8 @@ void EnGirlA_WaitForObject(EnGirlA* this, PlayState* play) { this->basePrice = shopItemIdentity.itemPrice; this->giDrawId = getItemEntry.gid; - // Correct the rotation for spiritual stones, but only if mysterious shuffle isn't on, else it's obvious - // what's there in shops + // Correct the rotation for spiritual stones, but only if mysterious shuffle isn't on, else + // it's obvious what's there in shops if (!CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0) && (getItemEntry.getItemId >= RG_KOKIRI_EMERALD && getItemEntry.getItemId <= RG_ZORA_SAPPHIRE)) { this->actor.shape.rot.y = this->actor.shape.rot.y + 20000; @@ -1468,7 +1465,6 @@ void EnGirlA_Draw(Actor* thisx, PlayState* play) { return; } - LUSLOG_WARN("LIZDEBUG!!!!! in EnGirlA_Draw VB_REPLACE_SHOP_ITEM!!! %d", this->actor.params); if (GameInteractor_Should(VB_REPLACE_SHOP_ITEM, false, this)) { GetItemEntry getItemEntry = ItemTable_RetrieveEntry(MOD_RANDOMIZER, this->getItemId); GetItemEntry_Draw(play, getItemEntry); diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index c96c0082649..09dfb520044 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -6455,7 +6455,7 @@ s32 Player_ActionHandler_Roll(Player* this, PlayState* play) { return true; } else if ((this->putAwayCooldownTimer == 0) && (this->heldItemAction >= PLAYER_IA_SWORD_MASTER)) { Player_UseItem(play, this, ITEM_NONE); - } else if (GameInteractor_Should(VB_CHANGE_ACTION_AND_USE, true, this, play)) { + } else { this->stateFlags2 ^= PLAYER_STATE2_NAVI_ACTIVE; } } @@ -9657,11 +9657,6 @@ void Player_Action_8084411C(Player* this, PlayState* play) { } } - // check for interactions on A while midair, exit early if one is triggered - if (!GameInteractor_Should(VB_CHANGE_ACTION_AND_USE, true, this, play)) { - return; - } - LinkAnimation_Update(play, &this->skelAnime); if (!(this->stateFlags2 & PLAYER_STATE2_HOPPING)) { @@ -11095,10 +11090,7 @@ void Player_UpdateInterface(PlayState* play, Player* this) { } } - if (!(this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND_LEAVE | BGCHECKFLAG_GROUND_TOUCH) && - GameInteractor_Should(VB_SET_ACTION_TEXTURE, false, &doAction, &play->interfaceCtx.doActionSegment[1]))) { - Interface_SetDoAction(play, doAction); - } + Interface_SetDoAction(play, doAction); if (this->stateFlags2 & PLAYER_STATE2_NAVI_ALERT) { if (this->focusActor != NULL) { diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 2974df38768..5ccfb91ae92 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -4874,8 +4874,7 @@ void KaleidoScope_Update(PlayState* play) { // Used to clear swordless temp B after unpause so minigame/epona handling restarts GameInteractor_Should(VB_TEMP_B_RESTORE_SWORDLESS, true); - interfaceCtx->unk_1FC = 0; - interfaceCtx->unk_1FA &= ~(1 << 0); + interfaceCtx->unk_1FA = interfaceCtx->unk_1FC = 0; osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf("i=%d LAST_TIME_TYPE=%d\n", i, gSaveContext.prevHudVisibilityMode); gSaveContext.hudVisibilityMode = 0; From f85adb621d49dc4c22becfbf7edb547e42003aef Mon Sep 17 00:00:00 2001 From: horrible Date: Wed, 18 Nov 2026 02:05:54 -0500 Subject: [PATCH 5/5] Feature configurable rocs pr changed (#10) * implement pr feedback & minor clean-up * update item descriptions to match latest changes --- soh/assets/custom/lang/en_US.json | 14 ++- .../custom-message/CustomMessageTypes.h | 2 - .../vanilla-behavior/GIVanillaBehavior.h | 8 -- .../randomizer/3drando/item_pool.cpp | 6 +- .../randomizer/Messages/ItemMessages.cpp | 21 +++- .../randomizer/Messages/MerchantMessages.cpp | 2 +- .../Enhancements/randomizer/RocsFeather.cpp | 46 ------- .../Enhancements/randomizer/hook_handlers.cpp | 27 ---- soh/soh/Enhancements/randomizer/savefile.cpp | 3 + soh/src/code/z_parameter.c | 1 - .../overlays/actors/ovl_En_GirlA/z_en_girla.c | 119 +++++++++--------- 11 files changed, 94 insertions(+), 155 deletions(-) diff --git a/soh/assets/custom/lang/en_US.json b/soh/assets/custom/lang/en_US.json index e8a9fc2eba7..3e492e9e34c 100644 --- a/soh/assets/custom/lang/en_US.json +++ b/soh/assets/custom/lang/en_US.json @@ -1527,16 +1527,20 @@ "rocs_feather": { "name": "Roc's Feather", "description": [ - "Off - Roc's Feather will not be shuffled. No changes will be made to item pool.\n\n", - "On - Adds Roc's Feather to the item pool. Roc's Feather is a custom item granting the player a jump on demand. ", - "Increasing the number of Feathers will allow successive jumps for each feather found.\n\n", - "Consumable - Adds numerous consumable Roc's Feathers to the item pool. Recovery heart refills in shops will be replaced with feather refills.\n\n" + "Off - Roc's Feather will not be shuffled. No changes will be made to the item pool.\n\n", + "On - Adds Roc's Feather to the item pool. Roc's Feather is a custom item granting the ", + "player a jump on demand. Increasing Quantity will allow an additional, consecutive ", + "jump with each feather found.\n\n", + "Consumable - Adds a variable number of consumable Roc's Feathers to the item pool, matching ", + "Max Capacity at an absolute minimum.\n\n", + "Roc's Feather is not considered by logic." ] }, "rocs_feather_count": { "name": "Roc's Feather Quantity / Max Capacity", "description": [ - "If Roc's Feather is 'On' this will be the number of feathers in the pool. If Roc's Feather is 'Consumable' this will be the maximum you can carry at once." + "If Roc's Feather is 'On' this will be the number of feathers obtainable in the pool. ", + "If Roc's Feather is 'Consumable' this will be the maximum you can carry at once." ] }, "nayrus_love_uses": { diff --git a/soh/soh/Enhancements/custom-message/CustomMessageTypes.h b/soh/soh/Enhancements/custom-message/CustomMessageTypes.h index 104eefc33d3..ccae466c58c 100644 --- a/soh/soh/Enhancements/custom-message/CustomMessageTypes.h +++ b/soh/soh/Enhancements/custom-message/CustomMessageTypes.h @@ -244,8 +244,6 @@ typedef enum { TEXT_SAVE_MSG = 0x9213, TEXT_CONTINUE_OVERWORLD_MSG = 0x9214, TEXT_CONTINUE_DUNGEON_MSG = 0x9215, - TEXT_BUY_ROCS_FEATHER_PROMPT = 0x9216, - TEXT_BUY_ROCS_FEATHER_DESC = 0x9217, } TextIDs; #ifdef __cplusplus diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index 7833863f357..85ed017e1b7 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -2770,14 +2770,6 @@ typedef enum { // - `**Gfx` (`&POLY_OPA_DISP`) VB_RENDER_YES_ON_CONTINUE_PROMPT, - // #### `result` - // ```c - // true - // ``` - // #### `args` - // - `*EnGirlA` - VB_REPLACE_SHOP_ITEM, - // #### `result` // ```c // true diff --git a/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp b/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp index 98ed6acabf6..05bc32f7656 100644 --- a/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp @@ -440,7 +440,11 @@ void GenerateItemPool() { if (ctx->GetOption(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_ON)) { AddFixedItemToPool(RG_ROCS_FEATHER, feathers); } else { - AddItemToPool(RG_ROCS_FEATHER, (int) (feathers*1.5), (int) (feathers*1.25), feathers, (int) (feathers*0.75)); + //ensure at least one full fill of feathers + AddFixedItemToPool(RG_ROCS_FEATHER, feathers); + //include in the junk pool for additional acq + JunkPoolItems.emplace_back(RG_ROCS_FEATHER); + JunkPoolItems.emplace_back(RG_ROCS_FEATHER); } } diff --git a/soh/soh/Enhancements/randomizer/Messages/ItemMessages.cpp b/soh/soh/Enhancements/randomizer/Messages/ItemMessages.cpp index 1faeb51fb21..54a881a127d 100644 --- a/soh/soh/Enhancements/randomizer/Messages/ItemMessages.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/ItemMessages.cpp @@ -152,6 +152,23 @@ void BuildTriforceMessage(CustomMessage& msg) { msg.Format(ITEM_CUSTOM); } +void BuildRocsFeatherMessage(CustomMessage& msg) { + u8 max = (Rando::Context::GetInstance()->GetOption(RSK_ROCS_FEATHER_COUNT).Get() + 1); + bool consumable = Rando::Context::GetInstance()->GetOption(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_CONSUMABLE); + u8& current = gSaveContext.ship.quest.data.randomizer.rocsFeathersRemaining; + u8& total = gSaveContext.ship.quest.data.randomizer.rocsFeathersAcquired; + msg = CustomMessage("You got %bRoc's Feather%w!&You now have %b[[d]]%w |use|uses| of it!", + "Du erhältst %bGreifenfeder%w!&Du kannst sie nun %b[[d]]%w-mal einsetzen!", + "Vous obtenez la %bPlume de Roc%w!&Vous pouvez l'utiliser %b[[d]]%w fois!"); + + if (consumable) { + msg.InsertNumber(current < max ? current + 1 : current); + } else { + msg.InsertNumber(total < max ? total + 1 : total); + } + msg.AutoFormat(ITEM_ROCS_FEATHER); +} + void BuildCustomItemMessage(Player* player, CustomMessage& msg) { int16_t rgid; msg = CustomMessage("You found [[article]][[color]][[name]]%w!", "Du hast [[article]][[color]][[name]]%w gefunden!", @@ -248,6 +265,8 @@ void BuildItemMessage(u16* textId, bool* loadFromMessageTable) { BuildTriforcePieceMessage(msg); } else if (player->getItemEntry.getItemId == RG_TRIFORCE) { BuildTriforceMessage(msg); + } else if (player->getItemEntry.getItemId == RG_ROCS_FEATHER) { + BuildRocsFeatherMessage(msg); } else { BuildCustomItemMessage(player, msg); } @@ -374,4 +393,4 @@ void RegisterCustomIconHooks() { }); } -static RegisterShipInitFunc customIconInitFunc(RegisterCustomIconHooks, { "IS_RANDO" }); \ No newline at end of file +static RegisterShipInitFunc customIconInitFunc(RegisterCustomIconHooks, { "IS_RANDO" }); diff --git a/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp b/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp index 3a1ec84d117..3789ad25c10 100644 --- a/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp @@ -216,4 +216,4 @@ void RegisterMerchantMessages() { COND_ID_HOOK(OnOpenText, TEXT_CARPET_SALESMAN_CUSTOM_FAIL_TO_BUY, IS_RANDO, BuildCarpetGuyFailToBuyMessage); } -static RegisterShipInitFunc initFunc(RegisterMerchantMessages, { "IS_RANDO" }); +static RegisterShipInitFunc initFunc(RegisterMerchantMessages, { "IS_RANDO" }); \ No newline at end of file diff --git a/soh/soh/Enhancements/randomizer/RocsFeather.cpp b/soh/soh/Enhancements/randomizer/RocsFeather.cpp index 840502e186c..642cb8be371 100644 --- a/soh/soh/Enhancements/randomizer/RocsFeather.cpp +++ b/soh/soh/Enhancements/randomizer/RocsFeather.cpp @@ -1,8 +1,6 @@ #include #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/custom-message/CustomMessageManager.h" -#include "soh/Enhancements/custom-message/CustomMessageTypes.h" #include "soh/Enhancements/randomizer/SeedContext.h" #include "soh/ShipInit.hpp" @@ -16,8 +14,6 @@ extern PlayState* gPlayState; extern SaveContext gSaveContext; } -#define TEXT_GET_ROCS_FEATHER 0xE0 - static uint8_t groundTimer = 0; static f32 effectsScale = 1.0f; static bool rocsConsumable = true; @@ -30,44 +26,6 @@ static u8& RocsFeathersRemaining() { return gSaveContext.ship.quest.data.randomizer.rocsFeathersRemaining; } -static void BuildRocsFeatherGetMessage(uint16_t* textId, bool* loadFromMessageTable) { - CustomMessage msg; - - msg = CustomMessage( - "You got %bRoc's Feather%w!&You now have %b[[d]]%w |use|uses| of it!", - "<>", // TODO - German Translation - "<>"); // TODO - French Translation - - if (rocsConsumable) { - msg.InsertNumber(RocsFeathersRemaining()); - } else { - msg.InsertNumber(RocsFeathersAcquired()); - } - msg.AutoFormat(ITEM_ROCS_FEATHER); - msg.LoadIntoFont(); - *loadFromMessageTable = false; -} -void BuildRocsShopDesc(uint16_t* textId, bool* loadFromMessageTable) { - CustomMessage msg("\x08%rRoc's Feather 10 Rupees%w&Use this to jump across holes and chasms.\x0A\x02", - "\x08%r<>\x0A\x02", // TODO - German Translation - "\x08<>\x0A\x02"); // TODO - French Translation - msg.AutoFormat(); - msg.LoadIntoFont(); - *loadFromMessageTable = false; -} - -void BuildRocsShopPrompt(uint16_t* textId, bool* loadFromMessageTable) { - CustomMessage msg; - msg = CustomMessage( - "\x08%rRoc's Feather 10 Rupees%w\x09\x1B%gBuy&Don't buy%w\x09\x02", - "\x08<<%rGreifenfeder 10 Rubine%w\x09\x1B%gKaufen&Nicht kaufen%w>>\x09\x02", // TODO - German Translation - "\x08<<%rLa Plume de Roc 10 Rubis%w\x09\x1B%gAcheter&Ne pas acheter%w>>\x09\x02"); // TODO - French Translation - msg.AutoFormat(); - msg.LoadIntoFont(); - *loadFromMessageTable = false; -} - void UseRocsFeather(PlayState* playState, Player* player) { if (RocsFeathersRemaining() > 0) { RocsFeathersRemaining()--; @@ -159,10 +117,6 @@ void RegisterRocsFeather() { memcpy(gPlayState->pauseCtx.nameSegment, textureName, strlen(textureName) + 1); } }); - - COND_ID_HOOK(OnOpenText, TEXT_GET_ROCS_FEATHER, shouldRegister, BuildRocsFeatherGetMessage); - COND_ID_HOOK(OnOpenText, TEXT_BUY_ROCS_FEATHER_DESC, shouldRegister && rocsConsumable, BuildRocsShopDesc); - COND_ID_HOOK(OnOpenText, TEXT_BUY_ROCS_FEATHER_PROMPT, shouldRegister && rocsConsumable, BuildRocsShopPrompt); } static RegisterShipInitFunc registerRocsFeather(RegisterRocsFeather); diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 1a5cc126cd5..354982c9097 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -2105,33 +2105,6 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l *should = false; break; } - case VB_REPLACE_SHOP_ITEM: { - EnGirlA* shop = va_arg(args, EnGirlA*); - - // replace Recovery Hearts in shops with Roc's Feathers when they're consumable - if (RAND_GET_OPTION(RSK_ROCS_FEATHER).Is(RO_ROCS_FEATHER_CONSUMABLE) && - shop->actor.params == SI_RECOVERY_HEART) { - shop->actor.textId = (s16)TEXT_BUY_ROCS_FEATHER_DESC; - shop->itemBuyPromptTextId = (s16)TEXT_BUY_ROCS_FEATHER_PROMPT; - shop->getItemId = Rando::StaticData::RetrieveItem(RG_ROCS_FEATHER).GetGIEntry_Copy().getItemId; - shop->giDrawId = GI_NONE; - shop->canBuyFunc = [](PlayState*, EnGirlA*) -> s32 { - if (gSaveContext.ship.quest.data.randomizer.rocsFeathersRemaining < - (Rando::Context::GetInstance()->GetOption(RSK_ROCS_FEATHER_COUNT).Get() + 1)) { - return CANBUY_RESULT_SUCCESS; - } else { - return CANBUY_RESULT_CANT_GET_NOW; - } - }; - shop->itemGiveFunc = [](PlayState*, EnGirlA* girlA) { - GetItemEntry replacementItem = Rando::StaticData::RetrieveItem(RG_ROCS_FEATHER).GetGIEntry_Copy(); - Randomizer_Item_Give(gPlayState, replacementItem); - Rupees_ChangeBy(-girlA->basePrice); - }; - *should = true; - } - break; - } // We need to override the vanilla behavior here because the player might sequence break and get Ruto kidnapped // before accessing other checks that require Ruto. So if she's kidnapped we allow her to spawn again case VB_RUTO_BE_CONSIDERED_NOT_KIDNAPPED: { diff --git a/soh/soh/Enhancements/randomizer/savefile.cpp b/soh/soh/Enhancements/randomizer/savefile.cpp index b687f7521a1..0ed20f71e8d 100644 --- a/soh/soh/Enhancements/randomizer/savefile.cpp +++ b/soh/soh/Enhancements/randomizer/savefile.cpp @@ -459,6 +459,9 @@ extern "C" void Randomizer_InitSaveFile() { gSaveContext.ship.quest.data.randomizer.nayrusLoveUses = 0; sStartingNayrusLoveGives = 0; + gSaveContext.ship.quest.data.randomizer.rocsFeathersAcquired = 0; + gSaveContext.ship.quest.data.randomizer.rocsFeathersRemaining = 0; + SetStartingItems(); // Debug saves start with bombchus but no bag level, which would cap them at 0 diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index cd310d20502..88e857da54a 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -5729,7 +5729,6 @@ void Interface_Draw(PlayState* play) { PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->aAlpha); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); - Matrix_Translate(-138.0f + rAIconX, rAIconY, WREG(46 + languageOffset) / 10.0f, MTXMODE_NEW); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY); diff --git a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index 9ce41ae081b..fbc355262e1 100644 --- a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -1268,66 +1268,64 @@ void EnGirlA_WaitForObject(EnGirlA* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) { this->actor.flags &= ~ACTOR_FLAG_UPDATE_CULLING_DISABLED; this->actor.objBankIndex = this->requiredObjectSlot; - if (!GameInteractor_Should(VB_REPLACE_SHOP_ITEM, false, this)) { - switch (this->actor.params) { - case SI_KEATON_MASK: - if (Flags_GetItemGetInf(ITEMGETINF_38)) { - this->actor.textId = 0x70B6; - } else { - this->actor.textId = itemEntry->itemDescTextId; - } - this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; - break; - case SI_SPOOKY_MASK: - if (Flags_GetItemGetInf(ITEMGETINF_3A)) { - this->actor.textId = 0x70B5; - } else { - this->actor.textId = itemEntry->itemDescTextId; - } - this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; - break; - case SI_SKULL_MASK: - if (Flags_GetItemGetInf(ITEMGETINF_39)) { - this->actor.textId = 0x70B4; - } else { - this->actor.textId = itemEntry->itemDescTextId; - } - this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; - break; - case SI_BUNNY_HOOD: - if (Flags_GetItemGetInf(ITEMGETINF_3B)) { - this->actor.textId = 0x70B7; - } else { - this->actor.textId = itemEntry->itemDescTextId; - } - this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; - break; - case SI_MASK_OF_TRUTH: - if (Flags_GetItemGetInf(ITEMGETINF_3B)) { - this->actor.textId = 0x70BB; - this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; - } else { - this->actor.textId = itemEntry->itemDescTextId; - this->itemBuyPromptTextId = 0xEB; - } - break; - case SI_ZORA_MASK: + switch (this->actor.params) { + case SI_KEATON_MASK: + if (Flags_GetItemGetInf(ITEMGETINF_38)) { + this->actor.textId = 0x70B6; + } else { this->actor.textId = itemEntry->itemDescTextId; - this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; - break; - case SI_GORON_MASK: + } + this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; + break; + case SI_SPOOKY_MASK: + if (Flags_GetItemGetInf(ITEMGETINF_3A)) { + this->actor.textId = 0x70B5; + } else { this->actor.textId = itemEntry->itemDescTextId; - this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; - break; - case SI_GERUDO_MASK: + } + this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; + break; + case SI_SKULL_MASK: + if (Flags_GetItemGetInf(ITEMGETINF_39)) { + this->actor.textId = 0x70B4; + } else { this->actor.textId = itemEntry->itemDescTextId; - this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; - break; - default: + } + this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; + break; + case SI_BUNNY_HOOD: + if (Flags_GetItemGetInf(ITEMGETINF_3B)) { + this->actor.textId = 0x70B7; + } else { this->actor.textId = itemEntry->itemDescTextId; + } + this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; + break; + case SI_MASK_OF_TRUTH: + if (Flags_GetItemGetInf(ITEMGETINF_3B)) { + this->actor.textId = 0x70BB; this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; - break; - } + } else { + this->actor.textId = itemEntry->itemDescTextId; + this->itemBuyPromptTextId = 0xEB; + } + break; + case SI_ZORA_MASK: + this->actor.textId = itemEntry->itemDescTextId; + this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; + break; + case SI_GORON_MASK: + this->actor.textId = itemEntry->itemDescTextId; + this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; + break; + case SI_GERUDO_MASK: + this->actor.textId = itemEntry->itemDescTextId; + this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; + break; + default: + this->actor.textId = itemEntry->itemDescTextId; + this->itemBuyPromptTextId = itemEntry->itemBuyPromptTextId; + break; } if (!EnGirlA_TrySetMaskItemDescription(this, play)) { EnGirlA_SetItemDescription(play, this); @@ -1376,8 +1374,8 @@ void EnGirlA_WaitForObject(EnGirlA* this, PlayState* play) { this->basePrice = shopItemIdentity.itemPrice; this->giDrawId = getItemEntry.gid; - // Correct the rotation for spiritual stones, but only if mysterious shuffle isn't on, else - // it's obvious what's there in shops + // Correct the rotation for spiritual stones, but only if mysterious shuffle isn't on, else it's obvious + // what's there in shops if (!CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0) && (getItemEntry.getItemId >= RG_KOKIRI_EMERALD && getItemEntry.getItemId <= RG_ZORA_SAPPHIRE)) { this->actor.shape.rot.y = this->actor.shape.rot.y + 20000; @@ -1465,10 +1463,5 @@ void EnGirlA_Draw(Actor* thisx, PlayState* play) { return; } - if (GameInteractor_Should(VB_REPLACE_SHOP_ITEM, false, this)) { - GetItemEntry getItemEntry = ItemTable_RetrieveEntry(MOD_RANDOMIZER, this->getItemId); - GetItemEntry_Draw(play, getItemEntry); - } else { - GetItem_Draw(play, this->giDrawId); - } + GetItem_Draw(play, this->giDrawId); }