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

Fairysanity #4744

Open
wants to merge 52 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
075b28c
Define VB for fairy group spawning
boomshroom Sep 4, 2024
a263d45
Add skeleton of new files for fairy shuffle
boomshroom Sep 4, 2024
792515d
Add option to enable/disable fairy shuffle
boomshroom Sep 4, 2024
e655f2e
Add field to fairy entities to hold randomizer data
boomshroom Sep 4, 2024
59222c8
Expose the current grotto id, or find it if not shuffled
boomshroom Sep 5, 2024
987f4ce
Initialise fairy groups if detected
boomshroom Sep 5, 2024
d4f2c0d
Randomize first set of fairies
boomshroom Sep 5, 2024
8d13e1d
Make randomized fairies collectible
boomshroom Sep 5, 2024
3c9bc5f
VBify fairy healing customization
boomshroom Sep 5, 2024
0e5c64b
Add remaining grotto fairies
boomshroom Sep 5, 2024
e1df531
Add remaining fairy group spawns
boomshroom Sep 5, 2024
e1d1557
Override bean sprouts spawning fairies
boomshroom Sep 6, 2024
96055ff
Define bean sprout fairy checks
boomshroom Sep 6, 2024
41d10c3
Add HasItem and CanUse entries for magic beans.
boomshroom Sep 6, 2024
1598ce3
Define logic for bean sprout fairies
boomshroom Sep 6, 2024
12c4bb4
Enabling looking up fairies by z coordinate
boomshroom Sep 6, 2024
fb5e1bc
Add Temple of Time Gossip Stones
boomshroom Sep 6, 2024
3552242
Disable quick age change around gossip stones to simplify logic
boomshroom Sep 7, 2024
16da42c
Add remaining gossip stone fairies
boomshroom Sep 8, 2024
4e4fa63
Finish gossip stone fairies
boomshroom Sep 9, 2024
174554c
Add Desert Colossus Oasis
boomshroom Sep 10, 2024
d5dc2bd
Restrict fairy type
boomshroom Sep 10, 2024
0e83131
Add overworld special fairy spots
boomshroom Sep 12, 2024
d31b791
Add mini-dungeon fairy song spots
boomshroom Sep 13, 2024
727202c
Add remaining dungeons except Shadow
boomshroom Sep 13, 2024
97d2acc
Add Shadow Temple fairies
boomshroom Sep 13, 2024
ac0dd73
Add fairy check flags to the save editor
boomshroom Sep 13, 2024
ffb5e8e
Filter fairy checks from check tracker
boomshroom Sep 13, 2024
8356a3a
Add hints for fairy checks
boomshroom Sep 14, 2024
c2ede84
Merge branch 'develop' into HEAD
Pepper0ni Dec 20, 2024
4bb6fd3
get fairysanity as far as I can for now
Pepper0ni Dec 20, 2024
2be3c1a
fix a few obvious issues
Pepper0ni Dec 21, 2024
a2f635a
now builds
Pepper0ni Dec 21, 2024
e6ce18c
try to convert FairyOnVanillaBehaviorHandler to vardic args
Pepper0ni Dec 22, 2024
41ee568
convert RegisterFairyCustomization to REGISTER_VB_SHOULD
Pepper0ni Dec 22, 2024
8693e44
fix some generation issues
Pepper0ni Dec 22, 2024
fdb988c
Merge branch 'develop' into Fairys
Pepper0ni Dec 22, 2024
f27eaaf
remove the list of fairy locations
Pepper0ni Dec 23, 2024
5474665
Merge branch 'develop' into Fairys
Pepper0ni Dec 23, 2024
9de96b6
fix up logic
Pepper0ni Dec 24, 2024
b7b1ed5
more logic changes for gossip stones
Pepper0ni Dec 24, 2024
113a0ce
try silly thing for windows
Pepper0ni Dec 24, 2024
04a345e
more stupid
Pepper0ni Dec 24, 2024
0cbc945
more dumb testing
Pepper0ni Dec 24, 2024
d718673
more testing
Pepper0ni Dec 24, 2024
d7889ae
small fixes
Pepper0ni Dec 26, 2024
d2f042d
Merge branch 'develop' into Fairys
Pepper0ni Dec 26, 2024
1d086d1
implement inside fence storms fairy
Pepper0ni Dec 26, 2024
81699e8
Merge remote-tracking branch 'master/develop' into Fairys
Pepper0ni Dec 26, 2024
9397747
add inside fence storms fairy to logic
Pepper0ni Dec 26, 2024
57a4b80
remove duplicate hints (stupid conflicts)
Pepper0ni Dec 26, 2024
d550548
oops
Pepper0ni Dec 26, 2024
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
213 changes: 213 additions & 0 deletions soh/soh/Enhancements/debugger/debugSaveEditor.h

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions soh/soh/Enhancements/game-interactor/GameInteractor.h
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,14 @@ typedef enum {
// Vanilla condition: Actor is ACTOR_EN_ELF, ACTOR_EN_FISH, ACTOR_EN_ICE_HONO, or ACTOR_EN_INSECT
// Opt: *Actor
VB_BOTTLE_ACTOR,

/*** Fairy Shuffle ***/
// Opt: *EnElf
VB_SPAWN_FAIRY_GROUP,
// Opt: *EnElf
VB_FAIRY_HEAL,
// Opt: *ObjBean
VB_BEAN_SPAWN_FAIRIES,
} GIVanillaBehavior;

#ifdef __cplusplus
Expand Down
2 changes: 2 additions & 0 deletions soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

#include "GameInteractor.h"
#include <stdarg.h>

Expand Down
29 changes: 28 additions & 1 deletion soh/soh/Enhancements/mods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h"
#include "src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h"
#include "src/overlays/actors/ovl_En_Door/z_en_door.h"
#include "src/overlays/actors/ovl_En_Elf/z_en_elf.h"
#include "objects/object_link_boy/object_link_boy.h"
#include "objects/object_link_child/object_link_child.h"
#include "kaleido.h"
Expand Down Expand Up @@ -265,8 +266,9 @@ void RegisterOcarinaTimeTravel() {
Actor* nearbyOcarinaSpot = Actor_FindNearby(gPlayState, player, ACTOR_EN_OKARINA_TAG, ACTORCAT_PROP, 120.0f);
Actor* nearbyDoorOfTime = Actor_FindNearby(gPlayState, player, ACTOR_DOOR_TOKI, ACTORCAT_BG, 500.0f);
Actor* nearbyFrogs = Actor_FindNearby(gPlayState, player, ACTOR_EN_FR, ACTORCAT_NPC, 300.0f);
Actor* nearbyGossipStone = Actor_FindNearby(gPlayState, player, ACTOR_EN_GS, ACTORCAT_NPC, 300.0f);
bool justPlayedSoT = gPlayState->msgCtx.lastPlayedSong == OCARINA_SONG_TIME;
bool notNearAnySource = !nearbyTimeBlockEmpty && !nearbyTimeBlock && !nearbyOcarinaSpot && !nearbyDoorOfTime && !nearbyFrogs;
bool notNearAnySource = !nearbyTimeBlockEmpty && !nearbyTimeBlock && !nearbyOcarinaSpot && !nearbyDoorOfTime && !nearbyFrogs && !nearbyGossipStone;
bool hasOcarinaOfTime = (INV_CONTENT(ITEM_OCARINA_TIME) == ITEM_OCARINA_TIME);
bool doesntNeedOcarinaOfTime = CVarGetInteger(CVAR_ENHANCEMENT("TimeTravel"), 0) == 2;
bool hasMasterSword = CHECK_OWNED_EQUIP(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_MASTER);
Expand Down Expand Up @@ -1399,6 +1401,30 @@ void RegisterRandomizerCompasses() {
});
}

#define FAIRY_FLAG_BIG (1 << 9)


void RegisterFairyCustomization() {
REGISTER_VB_SHOULD(VB_FAIRY_HEAL, {
EnElf* enElf = va_arg(args, EnElf*);
// Don't trigger if fairy is shuffled
if (!IS_RANDO || !OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_FAIRIES) || enElf->sohFairyIdentity.randomizerInf == RAND_INF_MAX) {
if (CVarGetInteger(CVAR_ENHANCEMENT("FairyEffect"), 0) && !(enElf->fairyFlags & FAIRY_FLAG_BIG))
{
if (CVarGetInteger(CVAR_ENHANCEMENT("FairyPercentRestore"), 0))
{
Health_ChangeBy(gPlayState, (gSaveContext.healthCapacity * CVarGetInteger(CVAR_ENHANCEMENT("FairyHealth"), 100) / 100 + 15) / 16 * 16);
}
else
{
Health_ChangeBy(gPlayState, CVarGetInteger(CVAR_ENHANCEMENT("FairyHealth"), 8) * 16);
}
*should = false;
}
}
});
}

void InitMods() {
BossRush_RegisterHooks();
RandomizerRegisterHooks();
Expand Down Expand Up @@ -1442,4 +1468,5 @@ void InitMods() {
RegisterHurtContainerModeHandler();
RegisterPauseMenuHooks();
RandoKaleido_RegisterHooks();
RegisterFairyCustomization();
}
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,15 @@ hintTextTable[RHT_DODONGOS_CAVERN_BOSS_ROOM_CHEST] = HintText(CustomMessage("The
/*german*/ "",
/*french*/ "", {QM_RED, QM_GREEN}));

hintTextTable[RHT_DODONGOS_CAVERN_GOSSIP_STONE_FAIRY] = HintText(CustomMessage("They say that #playing a tune for an odd stone in Dodongo's Cavern# reveals #[[1]]#.",
/*german*/ "!!!",
/*french*/ "!!!", {QM_RED, QM_GREEN}));

hintTextTable[RHT_DODONGOS_CAVERN_GOSSIP_STONE_FAIRY_BIG] = HintText(CustomMessage("They say that #playing a stormy tune for an odd stone in Dodongo's Cavern# reveals #[[1]]#.",
/*german*/ "!!!",
/*french*/ "!!!", {QM_RED, QM_GREEN}));


/*--------------------------
| JABU JABUS BELLY |
---------------------------*/
Expand Down Expand Up @@ -673,7 +682,6 @@ hintTextTable[RHT_DODONGOS_CAVERN_BOSS_ROOM_CHEST] = HintText(CustomMessage("The
/*german*/ "",
/*french*/ "", {QM_RED, QM_GREEN}));


hintTextTable[RHT_FOREST_TEMPLE_HEART] = HintText(CustomMessage("They say that a #heart in the Forest Temple# hides #[[1]]#.",
/*german*/ "",
/*french*/ "", {QM_RED, QM_GREEN}));
Expand Down Expand Up @@ -874,6 +882,14 @@ hintTextTable[RHT_FIRE_TEMPLE_NEAR_BOSS_CHEST] = HintText(CustomMessage("They sa
/*german*/ "",
/*french*/ "", {QM_RED, QM_GREEN}));

hintTextTable[RAND_INF_FIRE_TEMPLE_MQ_LOOP_STALFOS_SUN_FAIRY] = HintText(CustomMessage("They say that #calling the sun in a hot arena# reveals #[[1]]#.",
/*german*/ "!!!",
/*french*/ "!!!", {QM_RED, QM_GREEN}));

hintTextTable[RAND_INF_FIRE_TEMPLE_MQ_LOOP_KNUCKLE_SUN_FAIRY] = HintText(CustomMessage("They say that #calling the sun behind a knight's throne in a volcano# reveals #[[1]]#.",
/*german*/ "!!!",
/*french*/ "!!!", {QM_RED, QM_GREEN}));

/*--------------------------
| WATER TEMPLE |
---------------------------*/
Expand Down Expand Up @@ -1009,6 +1025,22 @@ hintTextTable[RHT_FIRE_TEMPLE_NEAR_BOSS_CHEST] = HintText(CustomMessage("They sa
/*german*/ "",
/*french*/ "", {QM_RED, QM_GREEN}));

hintTextTable[RHT_WATER_TEMPLE_HEART] = HintText(CustomMessage("They say that in a #river in the Water Temple# lies #[[1]]#.",
/*german*/ "",
/*french*/ "", {QM_RED, QM_GREEN}));

hintTextTable[RHT_WATER_TEMPLE_MQ_DARK_LINK_PILAR_SUN_FAIRY] = HintText(CustomMessage("They say that #calling the sun atop a small pillar before a duel with one's shadow# reveals #[[1]]#.",
/*german*/ "!!!",
/*french*/ "!!!", {QM_RED, QM_GREEN}));

hintTextTable[RHT_WATER_TEMPLE_MQ_DARK_LINK_LEFT_STORM_FAIRY] = HintText(CustomMessage("They say that #calling the rain before a duel with one's shadow# reveals #[[1]]#.",
/*german*/ "!!!",
/*french*/ "!!!", {QM_RED, QM_GREEN}));

hintTextTable[RHT_WATER_TEMPLE_MQ_DARK_LINK_RIGHT_SUN_FAIRY] = HintText(CustomMessage("They say that #calling the sun before a duel with one's shadow# reveals #[[1]]#.",
/*german*/ "!!!",
/*french*/ "!!!", {QM_RED, QM_GREEN}));

/*--------------------------
| SPIRIT TEMPLE |
---------------------------*/
Expand Down Expand Up @@ -1505,6 +1537,18 @@ hintTextTable[RHT_SHADOW_TEMPLE_MAP_CHEST] = HintText(CustomMessage("They say th
/*german*/ "",
/*french*/ "", {QM_RED, QM_GREEN}));

hintTextTable[RHT_SHADOW_TEMPLE_BEAMOS_STORM_FAIRY] = HintText(CustomMessage("They say that an #calling the rain for a sentry guarding a house of the dead# reveals #[[1]]#.",
/*german*/ "!!!",
/*french*/ "!!!.", {QM_RED, QM_GREEN}));

hintTextTable[RHT_SHADOW_TEMPLE_PIT_STORM_FAIRY] = HintText(CustomMessage("They say that an #calling the rain on a platform suspended above a bottomless pit# reveals #[[1]]#.",
/*german*/ "!!!",
/*french*/ "!!!.", {QM_RED, QM_GREEN}));

hintTextTable[RHT_SHADOW_TEMPLE_WIND_HINT_SUN_FAIRY] = HintText(CustomMessage("They say that an #calling the sun near an invisible chest guarded by the dead# reveals #[[1]]#.",
/*german*/ "!!!",
/*french*/ "!!!.", {QM_RED, QM_GREEN}));

/*--------------------------
| BOTTOM OF THE WELL |
---------------------------*/
Expand Down Expand Up @@ -1626,7 +1670,7 @@ hintTextTable[RHT_SHADOW_TEMPLE_MAP_CHEST] = HintText(CustomMessage("They say th
hintTextTable[RHT_POT_BOTTOM_OF_THE_WELL] = HintText(CustomMessage("They say that a #pot in Bottom of the Well# contains #[[1]]#.",
/*german*/ "",
/*french*/ "", {QM_RED, QM_GREEN}));

hintTextTable[RHT_BOTTOM_OF_THE_WELL_HEART] = HintText(CustomMessage("They say that a #heart within the well# hides #[[1]]#.",
/*german*/ "",
/*french*/ "", {QM_RED, QM_GREEN}));
Expand All @@ -1635,6 +1679,19 @@ hintTextTable[RHT_SHADOW_TEMPLE_MAP_CHEST] = HintText(CustomMessage("They say th
/*german*/ "",
/*french*/ "", {QM_RED, QM_GREEN}));

hintTextTable[RHT_BOTTOM_OF_THE_WELL_BASEMENT_SUN_FAIRY] = HintText(CustomMessage("They say that an #calling the sun a dead end# within the well reveals #[[1]]#.",
/*german*/ "!!!",
/*french*/ "!!!.", {QM_RED, QM_GREEN}));

hintTextTable[RHT_BOTTOM_OF_THE_WELL_MQ_CELL_SUN_FAIRY] = HintText(CustomMessage("They say that an #calling the sun in an empty cell# within the well reveals #[[1]]#.",
/*german*/ "!!!",
/*french*/ "!!!.", {QM_RED, QM_GREEN}));

hintTextTable[RHT_BOTTOM_OF_THE_WELL_MQ_BASEMENT_SUN_FAIRY] = HintText(CustomMessage("They say that an #calling the sun a dead end# within the well reveals #[[1]]#.",
/*german*/ "!!!",
/*french*/ "!!!.", {QM_RED, QM_GREEN}));


/*--------------------------
| ICE CAVERN |
---------------------------*/
Expand Down Expand Up @@ -1720,6 +1777,11 @@ hintTextTable[RHT_SHADOW_TEMPLE_MAP_CHEST] = HintText(CustomMessage("They say th
/*german*/ "",
/*french*/ "", {QM_RED, QM_GREEN}));

hintTextTable[RHT_ICE_CAVERN_ENTRANCE_STORMS_FAIRY] = HintText(CustomMessage("They say that #calling the rain near the entrance to a frozen cave# reveals #[[1]]#.",
/*german*/ "!!!",
/*french*/ "!!!", {QM_RED, QM_GREEN}));
// /*spanish*/ Según dicen, una #Skulltula tras un ardiente hielo# otorga #[[1]]#.

/*--------------------------
| Gerudo Training Ground |
---------------------------*/
Expand Down Expand Up @@ -1818,6 +1880,10 @@ hintTextTable[RHT_SHADOW_TEMPLE_MAP_CHEST] = HintText(CustomMessage("They say th
/*french*/ "Selon moi, #derrière un bloc argent# dans le Gymnase Gerudo gît #[[1]]#.", {QM_RED, QM_GREEN}));
// /*spanish*/ Según dicen, una #hazaña de fuerza# premia a las bandidas con #[[1]]#.

hintTextTable[RHT_GERUDO_TRAINING_GROUND_ENTRANCE_STORMS_FAIRY] = HintText(CustomMessage("They say that #calling the rain near the entrance to the Gerudo Training Grounds# reveals #[[1]]#.",
/*german*/ "!!!",
/*french*/ "!!!", {QM_RED, QM_GREEN}));

hintTextTable[RHT_GERUDO_TRAINING_GROUND_FREESTANDING_KEY] = HintText(CustomMessage("They say that the #Song of Time# in the Gerudo Training Ground leads to #[[1]]#.",
/*german*/ "Man erzählt sich, daß die #Hymne der Zeit# in der Gerudo-Trainingsarena zu #[[1]]# führe.",
/*french*/ "Selon moi, le #chant du temps# révèle dans le Gymnase Gerudo #[[1]]#.", {QM_RED, QM_GREEN}));
Expand Down Expand Up @@ -1985,6 +2051,14 @@ hintTextTable[RHT_SHADOW_TEMPLE_MAP_CHEST] = HintText(CustomMessage("They say th
/*french*/ "Selon moi, la #musique dans l'épreuve du ciel# révèle #[[1]]#.", {QM_RED, QM_GREEN}));
// /*spanish*/ Según dicen, la #música en la prueba del resplandor# revela #[[1]]#.

hintTextTable[RHT_GANONS_CASTLE_SPIRIT_TRIAL_SUN_FAIRY] = HintText(CustomMessage("They say that #calling the sun for a sentry in the test of the sands# reveals #[[1]]#.",
/*german*/ "!!!",
/*french*/ "!!!", {QM_RED, QM_GREEN}));

hintTextTable[RHT_GANONS_CASTLE_SCRUBS_FAIRY] = HintText(CustomMessage("They say that within a #sanctuary before the final trial# rests #[[1]]#.",
/*german*/ "!!!",
/*french*/ "!!!", {QM_RED, QM_GREEN}));

hintTextTable[RHT_GANONS_CASTLE_MQ_WATER_TRIAL_CHEST] = HintText(CustomMessage("They say that the #test of the seas# holds #[[1]]#.",
/*german*/ "Man erzählt sich, daß die #Prüfung der Meere# #[[1]]# enthielte.",
/*french*/ "Selon moi, l'#épreuve des mers# contient #[[1]]#.", {QM_RED, QM_GREEN}));
Expand Down
Loading