Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CuccoShackCuccoCount #817

Merged
merged 3 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions mm/2s2h/BenGui/SearchableMenuItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions mm/2s2h/Enhancements/Enhancements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ void InitEnhancements() {
// Minigames
RegisterAlwaysWinDoggyRace();
RegisterCremiaHugs();
RegisterCuccoShackCuccoCount();

// Player
RegisterClimbSpeed();
Expand Down
34 changes: 34 additions & 0 deletions mm/2s2h/Enhancements/Minigames/CuccoShackCuccoCount.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include <libultraship/bridge.h>
#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 EnNwc_SpawnDust(EnNwc* enNwc, PlayState* play);
garrettjoecox marked this conversation as resolved.
Show resolved Hide resolved
}

void RegisterCuccoShackCuccoCount() {
GameInteractor::Instance->RegisterGameHookForID<GameInteractor::ShouldActorUpdate>(
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;
Copy link
Contributor

Choose a reason for hiding this comment

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

lol at the game abusing rotation values.

}

// 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;
}
});
}
1 change: 1 addition & 0 deletions mm/2s2h/Enhancements/Minigames/Minigames.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
void RegisterAlwaysWinDoggyRace();

void RegisterCremiaHugs();
void RegisterCuccoShackCuccoCount();

#endif // MINIGAMES_H
Loading