Skip to content

add configuration options for rocs feather - #7466

Open
horrible wants to merge 11 commits into
HarbourMasters:developfrom
horrible:feature-configurable-rocs
Open

horrible wants to merge 11 commits into
HarbourMasters:developfrom
horrible:feature-configurable-rocs

Conversation

@horrible

@horrible horrible commented Oct 27, 2026 •

Copy link
Copy Markdown
  • add handling to make rocs feather multi-use
  • add option to make rocs feather consumable rather than infinite

Build Artifacts

- 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
Comment thread soh/include/z64save.h Resolved
Comment thread soh/src/code/z_parameter.c Resolved
@serprex

serprex commented Oct 29, 2026

Copy link
Copy Markdown
Member

hi, thanks for contribution, this is a pretty intricate change touching decomp code so will need some careful review. Just want to let you know I'll be unavailable to review for next few weeks

@serprex
serprex self-requested a review October 29, 2026 11:00
@f1ana
f1ana self-requested a review October 30, 2026 20:29

@f1ana f1ana left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's my first pass. Took a bit to go through but I think I've pointed out most of it.

// - `u16* action` (`DO_ACTION_<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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VB's should be in alphabetical order here
Comments here are a bit verbose as well

This comment was marked as outdated.

});

COND_VB_SHOULD(VB_COLOR_AMMO_GREEN, shouldRegister, {
s16 item = va_arg(args, s16);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

va_arg(args, int)

Comment thread soh/src/code/z_parameter.c Outdated
CLOSE_DISPS(play->state.gfxCtx);
}

void Interface_DrawActionIcon(PlayState* play, f32 x, f32 y, void* texture) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, net new changes should not touch decomp. Use GI/VB to keep decomp as close to upstream as possible.

This comment was marked as outdated.

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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might make sense for these three to be locals

Comment thread soh/assets/custom/lang/en_US.json Outdated
"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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not seeing where this is happening.

This comment was marked as outdated.

effectsScale = 1.5f;
}
COND_VB_SHOULD(VB_CHANGE_ACTION_AND_USE, shouldRegister, {
if (CVarGetInteger(CVAR_ENHANCEMENT("RocsFeatherOnA"), 0) != 1) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Food for thought, this PR has a few moving parts already. Maybe separate A button into its own effort.

This comment was marked as resolved.

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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question for @serprex - I realize this is inherited but wondering if registration should at least be gated on IS_RANDO and a CVar?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I think there was some effort made to allow enabling Roc's Feather in normal play using save editor. I don't think maintaining that is necessary if this can be made more elegant by not supporting that

Comment thread soh/src/code/z_construct.c Outdated
View_Init(&interfaceCtx->view, play->state.gfxCtx);

interfaceCtx->unk_1FA = interfaceCtx->unk_261 = interfaceCtx->unk_1FC = 0;
interfaceCtx->unk_261 = interfaceCtx->unk_1FC = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some more deviations from upstream

This comment was marked as outdated.

static f32 effectsScale = 1.0f;
static bool rocsConsumable = false;

void UseRocsFeather(PlayState* playState, Player* player) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have a message builder here to keep a consistent experience with consumable Nayru's

This comment was marked as outdated.

*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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Audio feedback if it cannot be used, or no uses left would also keep consistency with consumable Nayru's

This comment was marked as outdated.

horrible

This comment was marked as outdated.

- 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
* remove rocs-on-a functionality, clean-up missed test comments

* re-run clang format 14
Comment thread soh/src/code/z_parameter.c Resolved

@f1ana f1ana left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes and hard work. A few more things I found and hopefully we're good after that.

*should = false;
break;
}
case VB_REPLACE_SHOP_ITEM: {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be on me for misinterpreting the description previously, but I would advise against this. I think it makes sense to just let the feathers get placed into the pool, wherever they may land.
With this approach, spoiler logs would also still read Recovery Heart.

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));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems possible that minimal count could truncate to 0

This comment was marked as resolved.

Comment thread soh/soh/SaveManager.cpp
SaveManager::Instance->LoadData("silverMqGanonWater", gSaveContext.ship.quest.data.randomizer.silverMqGanonWater);
SaveManager::Instance->LoadData("silverMqGanonShadow", gSaveContext.ship.quest.data.randomizer.silverMqGanonShadow);

SaveManager::Instance->LoadData("rocsFeathersAcquired",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll also need to reset counts in savefile.cpp. See the consumable Nayru's PR for reference.

}

#define MAX_ROCS_USES 1
#define TEXT_GET_ROCS_FEATHER 0xE0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this work? I think the value might be 0xF8, which is TEXT_RANDOMIZER_CUSTOM_ITEM. The message builder already exists in ItemMessages.cpp, since this is a custom item and there is no vanilla textbox. May be able to reuse some aspect of it there.

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants