mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 14:23:44 -07:00
Difficulty: CuccosToReturn
Mirrors rando option
This commit is contained in:
parent
f5d8f1eece
commit
8a4edc9e79
3 changed files with 26 additions and 7 deletions
22
soh/soh/Enhancements/CuccosToReturn.cpp
Normal file
22
soh/soh/Enhancements/CuccosToReturn.cpp
Normal 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") });
|
|
@ -927,13 +927,6 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l
|
||||||
*should = Flags_GetRandomizerInf(RAND_INF_LEARNED_EPONA_SONG);
|
*should = Flags_GetRandomizerInf(RAND_INF_LEARNED_EPONA_SONG);
|
||||||
break;
|
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: {
|
case VB_KING_ZORA_THANK_CHILD: {
|
||||||
// Allow turning in Ruto's letter even if you have already rescued her
|
// Allow turning in Ruto's letter even if you have already rescued her
|
||||||
if (!Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) {
|
if (!Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) {
|
||||||
|
|
|
@ -1138,6 +1138,10 @@ void SohMenu::AddMenuEnhancements() {
|
||||||
.CVar(CVAR_ENHANCEMENT("CuccoStayDurationMult"))
|
.CVar(CVAR_ENHANCEMENT("CuccoStayDurationMult"))
|
||||||
.Options(IntSliderOptions().Min(1).Max(5).DefaultValue(1).Format("%dx").Tooltip(
|
.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."));
|
"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;
|
path.column = SECTION_COLUMN_3;
|
||||||
AddWidget(path, "Enemies", WIDGET_SEPARATOR_TEXT);
|
AddWidget(path, "Enemies", WIDGET_SEPARATOR_TEXT);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue