Difficulty: CuccosToReturn

Mirrors rando option
This commit is contained in:
Demur Rumed 2025-06-01 18:41:25 +00:00
commit 8a4edc9e79
3 changed files with 26 additions and 7 deletions

View file

@ -0,0 +1,22 @@
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/ShipInit.hpp"
#include "soh/Enhancements/randomizer/context.h"
#define RAND_GET_OPTION(option) Rando::Context::GetInstance()->GetOption(option).Get()
extern "C" {
extern PlayState* gPlayState;
#include "src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h"
}
void RegisterCuccosToReturn() {
COND_VB_SHOULD(VB_SET_CUCCO_COUNT, IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("CuccosToReturn"), 7) != 7, {
EnNiwLady* enNiwLady = va_arg(args, EnNiwLady*);
// Override starting Cucco count using setting value
enNiwLady->cuccosInPen =
7 - (IS_RANDO ? RAND_GET_OPTION(RSK_CUCCO_COUNT) : CVarGetInteger(CVAR_ENHANCEMENT("CuccosToReturn"), 7));
*should = false;
});
}
static RegisterShipInitFunc initFunc(RegisterCuccosToReturn, { "IS_RANDO", CVAR_ENHANCEMENT("CuccosToReturn") });

View file

@ -927,13 +927,6 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l
*should = Flags_GetRandomizerInf(RAND_INF_LEARNED_EPONA_SONG);
break;
}
case VB_SET_CUCCO_COUNT: {
EnNiwLady* enNiwLady = va_arg(args, EnNiwLady*);
// Override starting Cucco count using setting value
enNiwLady->cuccosInPen = 7 - RAND_GET_OPTION(RSK_CUCCO_COUNT);
*should = false;
break;
}
case VB_KING_ZORA_THANK_CHILD: {
// Allow turning in Ruto's letter even if you have already rescued her
if (!Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) {

View file

@ -1138,6 +1138,10 @@ void SohMenu::AddMenuEnhancements() {
.CVar(CVAR_ENHANCEMENT("CuccoStayDurationMult"))
.Options(IntSliderOptions().Min(1).Max(5).DefaultValue(1).Format("%dx").Tooltip(
"Cuccos will stay in place longer after putting them down, by a multiple of the value of the slider."));
AddWidget(path, "Cuccos Needed By Anju: %d", WIDGET_CVAR_SLIDER_INT)
.CVar(CVAR_ENHANCEMENT("CuccosToReturn"))
.Options(IntSliderOptions().Min(0).Max(7).DefaultValue(7).Format("%d").Tooltip(
"The amount of cuccos needed to receive bottle from Anju the Cucco Lady."));
path.column = SECTION_COLUMN_3;
AddWidget(path, "Enemies", WIDGET_SEPARATOR_TEXT);