Repository navigation
Conversation
- 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
|
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 |
f1ana
left a comment
There was a problem hiding this comment.
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, | ||
|
|
There was a problem hiding this comment.
VB's should be in alphabetical order here
Comments here are a bit verbose as well
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
| }); | ||
|
|
||
| COND_VB_SHOULD(VB_COLOR_AMMO_GREEN, shouldRegister, { | ||
| s16 item = va_arg(args, s16); |
| CLOSE_DISPS(play->state.gfxCtx); | ||
| } | ||
|
|
||
| void Interface_DrawActionIcon(PlayState* play, f32 x, f32 y, void* texture) { |
There was a problem hiding this comment.
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.
This comment was marked as outdated.
Sorry, something went wrong.
| 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; |
There was a problem hiding this comment.
It might make sense for these three to be locals
| "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" |
There was a problem hiding this comment.
I am not seeing where this is happening.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
| effectsScale = 1.5f; | ||
| } | ||
| COND_VB_SHOULD(VB_CHANGE_ACTION_AND_USE, shouldRegister, { | ||
| if (CVarGetInteger(CVAR_ENHANCEMENT("RocsFeatherOnA"), 0) != 1) { |
There was a problem hiding this comment.
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.
This comment was marked as resolved.
Sorry, something went wrong.
| 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; |
There was a problem hiding this comment.
Question for @serprex - I realize this is inherited but wondering if registration should at least be gated on IS_RANDO and a CVar?
There was a problem hiding this comment.
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
| View_Init(&interfaceCtx->view, play->state.gfxCtx); | ||
|
|
||
| interfaceCtx->unk_1FA = interfaceCtx->unk_261 = interfaceCtx->unk_1FC = 0; | ||
| interfaceCtx->unk_261 = interfaceCtx->unk_1FC = 0; |
There was a problem hiding this comment.
Some more deviations from upstream
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
| static f32 effectsScale = 1.0f; | ||
| static bool rocsConsumable = false; | ||
|
|
||
| void UseRocsFeather(PlayState* playState, Player* player) { |
There was a problem hiding this comment.
Would be nice to have a message builder here to keep a consistent experience with consumable Nayru's
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
| *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 |
There was a problem hiding this comment.
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.
This comment was marked as outdated.
Sorry, something went wrong.
- 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
f1ana
left a comment
There was a problem hiding this comment.
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: { |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
It seems possible that minimal count could truncate to 0
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| SaveManager::Instance->LoadData("silverMqGanonWater", gSaveContext.ship.quest.data.randomizer.silverMqGanonWater); | ||
| SaveManager::Instance->LoadData("silverMqGanonShadow", gSaveContext.ship.quest.data.randomizer.silverMqGanonShadow); | ||
|
|
||
| SaveManager::Instance->LoadData("rocsFeathersAcquired", |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
This comment was marked as resolved.
Sorry, something went wrong.
* implement pr feedback & minor clean-up * update item descriptions to match latest changes
Build Artifacts