diff --git a/mm/2s2h/BenGui/SearchableMenuItems.h b/mm/2s2h/BenGui/SearchableMenuItems.h index 4131b5941..c24246197 100644 --- a/mm/2s2h/BenGui/SearchableMenuItems.h +++ b/mm/2s2h/BenGui/SearchableMenuItems.h @@ -1023,6 +1023,11 @@ void AddEnhancements() { "-Rupee: Get the rupee reward", WIDGET_CVAR_COMBOBOX, { .comboBoxOptions = cremiaRewardOptions } }, + { "Cucco Shack Cucco Count", + "gEnhancements.Minigames.CuccoShackCuccoCount", + "Choose how many cuccos you need to raise to make Grog happy.", + WIDGET_CVAR_SLIDER_INT, + { 1, 10, 10 } }, { "Fast Magic Arrow Equip Animation", "gEnhancements.Equipment.MagicArrowEquipSpeed", "Removes the animation for equipping Magic Arrows.", WIDGET_CVAR_CHECKBOX }, { "Instant Fin Boomerangs Recall", "gEnhancements.PlayerActions.InstantRecall", diff --git a/mm/2s2h/Enhancements/Enhancements.cpp b/mm/2s2h/Enhancements/Enhancements.cpp index 22c97aa68..fbf88667d 100644 --- a/mm/2s2h/Enhancements/Enhancements.cpp +++ b/mm/2s2h/Enhancements/Enhancements.cpp @@ -50,6 +50,7 @@ void InitEnhancements() { // Minigames RegisterAlwaysWinDoggyRace(); RegisterCremiaHugs(); + RegisterCuccoShackCuccoCount(); // Player RegisterClimbSpeed(); diff --git a/mm/2s2h/Enhancements/Minigames/CuccoShackCuccoCount.cpp b/mm/2s2h/Enhancements/Minigames/CuccoShackCuccoCount.cpp new file mode 100644 index 000000000..3a02182b5 --- /dev/null +++ b/mm/2s2h/Enhancements/Minigames/CuccoShackCuccoCount.cpp @@ -0,0 +1,33 @@ +#include +#include "2s2h/GameInteractor/GameInteractor.h" + +extern "C" { +#include "overlays/actors/ovl_En_Hs/z_en_hs.h" +#include "overlays/actors/ovl_En_Nwc/z_en_nwc.h" + +void func_8095345C(EnHs* enHs, PlayState* play); +} + +void RegisterCuccoShackCuccoCount() { + GameInteractor::Instance->RegisterGameHookForID( + ACTOR_EN_HS, [](Actor* actor, bool* should) { + EnHs* enHs = (EnHs*)actor; + + if (enHs->actionFunc != func_8095345C || + CVarGetInteger("gEnhancements.Minigames.CuccoShackCuccoCount", 10) == 10) { + return; + } + + // As soon as enough have grown up, set the count to the max + if (enHs->actor.home.rot.x >= (CVarGetInteger("gEnhancements.Minigames.CuccoShackCuccoCount", 10) * 2) && + enHs->actor.home.rot.x != 20) { + enHs->actor.home.rot.x = 20; + } + + // As soon as enough are following the player, set the count to the max + if (enHs->actor.home.rot.z >= (CVarGetInteger("gEnhancements.Minigames.CuccoShackCuccoCount", 10) * 2) && + enHs->actor.home.rot.z != 20) { + enHs->actor.home.rot.z = 20; + } + }); +} diff --git a/mm/2s2h/Enhancements/Minigames/Minigames.h b/mm/2s2h/Enhancements/Minigames/Minigames.h index f616fc81a..858eb781e 100644 --- a/mm/2s2h/Enhancements/Minigames/Minigames.h +++ b/mm/2s2h/Enhancements/Minigames/Minigames.h @@ -4,5 +4,6 @@ void RegisterAlwaysWinDoggyRace(); void RegisterCremiaHugs(); +void RegisterCuccoShackCuccoCount(); #endif // MINIGAMES_H