summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReppan <72985260+Jepvid@users.noreply.github.com>2026-06-29 21:13:39 +0200
committerGitHub <noreply@github.com>2026-06-29 19:13:39 +0000
commit55b804a6735bf5d6da9bf34ef07d9384e55d7234 (patch)
tree7020326aa1b7fc1aeba9864c9c02fc6bc9047c43
parent68d4c6049eaf289ef464199d01211490e717b317 (diff)
Add Easy Butterfly Fairy Cvar (#6833)
-rw-r--r--soh/soh/Enhancements/QoL/EasyButterflyFairies.cpp26
-rw-r--r--soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h8
-rw-r--r--soh/soh/SohGui/SohMenuEnhancements.cpp12
-rw-r--r--soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c18
4 files changed, 56 insertions, 8 deletions
diff --git a/soh/soh/Enhancements/QoL/EasyButterflyFairies.cpp b/soh/soh/Enhancements/QoL/EasyButterflyFairies.cpp
new file mode 100644
index 000000000..0faea5ee2
--- /dev/null
+++ b/soh/soh/Enhancements/QoL/EasyButterflyFairies.cpp
@@ -0,0 +1,26 @@
+#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
+#include "soh/ShipInit.hpp"
+#include "soh/Enhancements/randomizer/SeedContext.h"
+
+extern "C" {
+#include "src/overlays/actors/ovl_En_Butte/z_en_butte.h"
+#include "variables.h"
+extern void EnButte_SetupTransformIntoFairy(EnButte* enButte);
+}
+
+void EasyButterflyFairies_Register() {
+ COND_VB_SHOULD(VB_SPAWN_BUTTERFLY_FAIRY_EASY,
+ CVarGetInteger(CVAR_ENHANCEMENT("EasyButterflyFairies"), 0) ||
+ (IS_RANDO && RAND_GET_OPTION(RSK_SHUFFLE_BUTTERFLY_FAIRIES)),
+ {
+ EnButte* enButte = va_arg(args, EnButte*);
+ Player* player = GET_PLAYER(gPlayState);
+ if (player->heldItemAction == PLAYER_IA_DEKU_STICK && enButte->actor.xzDistToPlayer < 60.0f) {
+ EnButte_SetupTransformIntoFairy(enButte);
+ *should = false;
+ }
+ });
+}
+
+static RegisterShipInitFunc initFunc(EasyButterflyFairies_Register,
+ { CVAR_ENHANCEMENT("EasyButterflyFairies"), "IS_RANDO" });
diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h
index adb207630..c130a65c6 100644
--- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h
+++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h
@@ -2405,6 +2405,14 @@ typedef enum {
// #### `result`
// ```c
+ // true
+ // ```
+ // #### `args`
+ // - `*EnButte`
+ VB_SPAWN_BUTTERFLY_FAIRY_EASY,
+
+ // #### `result`
+ // ```c
// INV_CONTENT(ITEM_ARROW_FIRE) == ITEM_NONE
// ```
// #### `args`
diff --git a/soh/soh/SohGui/SohMenuEnhancements.cpp b/soh/soh/SohGui/SohMenuEnhancements.cpp
index afdb28730..9af0303bd 100644
--- a/soh/soh/SohGui/SohMenuEnhancements.cpp
+++ b/soh/soh/SohGui/SohMenuEnhancements.cpp
@@ -296,6 +296,18 @@ void SohMenu::AddMenuEnhancements() {
.CVar(CVAR_ENHANCEMENT("BetterOwl"))
.Options(CheckboxOptions().Tooltip(
"The default response to Kaepora Gaebora is always that you understood what he said."));
+ AddWidget(path, "Easy Butterfly Fairies", WIDGET_CVAR_CHECKBOX)
+ .CVar(CVAR_ENHANCEMENT("EasyButterflyFairies"))
+ .PreFunc([](WidgetInfo& info) {
+ info.options->disabled =
+ IS_RANDO &&
+ OTRGlobals::Instance->gRandoContext->GetOption(RSK_SHUFFLE_BUTTERFLY_FAIRIES).Is(RO_GENERIC_ON);
+ info.options->disabledTooltip = "This setting is forcefully enabled because a randomizer savefile with "
+ "\"Butterfly Fairies Shuffle\" is loaded.";
+ })
+ .Options(CheckboxOptions().Tooltip(
+ "Butterflies will transform into a fairy as soon as you approach them with a Deku Stick, "
+ "skipping the need to stand still and let the butterfly land on your stick."));
AddWidget(path, "Convenience", WIDGET_SEPARATOR_TEXT);
AddWidget(path, "Quit Fishing at Door", WIDGET_CVAR_CHECKBOX)
diff --git a/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c
index f7a171bd0..5b9bd12a3 100644
--- a/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c
+++ b/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c
@@ -338,14 +338,16 @@ void EnButte_FollowLink(EnButte* this, PlayState* play) {
distSqFromHome = Math3D_Dist2DSq(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x,
this->actor.home.pos.z);
- if (!((player->heldItemAction == PLAYER_IA_DEKU_STICK) && (fabsf(player->actor.speedXZ) < 1.8f) &&
- (this->swordDownTimer <= 0) && (distSqFromHome < SQ(320.0f)))) {
- EnButte_SetupFlyAround(this);
- } else if (distSqFromHome > SQ(240.0f)) {
- distSqFromSword = Math3D_Dist2DSq(player->meleeWeaponInfo[0].tip.x, player->meleeWeaponInfo[0].tip.z,
- this->actor.world.pos.x, this->actor.world.pos.z);
- if (distSqFromSword < SQ(60.0f)) {
- EnButte_SetupTransformIntoFairy(this);
+ if (GameInteractor_Should(VB_SPAWN_BUTTERFLY_FAIRY_EASY, true, this)) {
+ if (!((player->heldItemAction == PLAYER_IA_DEKU_STICK) && (fabsf(player->actor.speedXZ) < 1.8f) &&
+ (this->swordDownTimer <= 0) && (distSqFromHome < SQ(320.0f)))) {
+ EnButte_SetupFlyAround(this);
+ } else if (distSqFromHome > SQ(240.0f)) {
+ distSqFromSword = Math3D_Dist2DSq(player->meleeWeaponInfo[0].tip.x, player->meleeWeaponInfo[0].tip.z,
+ this->actor.world.pos.x, this->actor.world.pos.z);
+ if (distSqFromSword < SQ(60.0f)) {
+ EnButte_SetupTransformIntoFairy(this);
+ }
}
}
}