Fix song Fairies (#4826)

* Fix song fairies

* forgot a bool
This commit is contained in:
Pepper0ni 2025-01-08 16:51:51 +00:00 committed by GitHub
parent 9455579f42
commit 323ea2df96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 17 additions and 3 deletions

View File

@ -517,6 +517,8 @@ typedef enum {
VB_FAIRY_HEAL, VB_FAIRY_HEAL,
// Opt: *ObjBean // Opt: *ObjBean
VB_SPAWN_BEAN_STALK_FAIRIES, VB_SPAWN_BEAN_STALK_FAIRIES,
// Opt: *ShotSun
VB_SPAWN_SONG_FAIRY,
// Opt: *EnGs // Opt: *EnGs
VB_SPAWN_GOSSIP_STONE_FAIRY, VB_SPAWN_GOSSIP_STONE_FAIRY,
} GIVanillaBehavior; } GIVanillaBehavior;

View File

@ -4,6 +4,7 @@
#include "src/overlays/actors/ovl_En_Elf/z_en_elf.h" #include "src/overlays/actors/ovl_En_Elf/z_en_elf.h"
#include "src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h" #include "src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h"
#include "src/overlays/actors/ovl_En_Gs/z_en_gs.h" #include "src/overlays/actors/ovl_En_Gs/z_en_gs.h"
#include "src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h"
#include "../../OTRGlobals.h" #include "../../OTRGlobals.h"
#include "../../cvar_prefixes.h" #include "../../cvar_prefixes.h"
@ -116,6 +117,14 @@ void ShuffleFairies_OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should,
if (fairySpawned) { if (fairySpawned) {
*should = false; *should = false;
} }
// Spawn a fairy from a ShotSun when playing the right song near it
} else if (id == VB_SPAWN_SONG_FAIRY) {
ShotSun* shotSun = (ShotSun*)(actor);
if (ShuffleFairies_SpawnFairy(shotSun->actor.world.pos.x, shotSun->actor.world.pos.y,
shotSun->actor.world.pos.z,
TWO_ACTOR_PARAMS(0x1000, (int32_t)shotSun->actor.world.pos.z))) {
*should = false;
}
// Handle playing both misc songs and song of storms in front of a gossip stone. // Handle playing both misc songs and song of storms in front of a gossip stone.
} else if (id == VB_SPAWN_GOSSIP_STONE_FAIRY) { } else if (id == VB_SPAWN_GOSSIP_STONE_FAIRY) {
EnGs* gossipStone = (EnGs*)(actor); EnGs* gossipStone = (EnGs*)(actor);

View File

@ -1798,7 +1798,7 @@ void Rando::StaticData::InitLocationTable() { //
locationTable[RC_LH_ISLAND_SUN_FAIRY] = Location::Fairy(RC_LH_ISLAND_SUN_FAIRY, RCQUEST_BOTH, RCAREA_LAKE_HYLIA, SCENE_LAKE_HYLIA, TWO_ACTOR_PARAMS(0x1000, 7319), "Island Sun's Song Fairy", "Island Sun's Song Fairy", RHT_LH_ISLAND_SUN_FAIRY, SpoilerCollectionCheck::RandomizerInf(RAND_INF_LH_ISLAND_SUN_FAIRY)); locationTable[RC_LH_ISLAND_SUN_FAIRY] = Location::Fairy(RC_LH_ISLAND_SUN_FAIRY, RCQUEST_BOTH, RCAREA_LAKE_HYLIA, SCENE_LAKE_HYLIA, TWO_ACTOR_PARAMS(0x1000, 7319), "Island Sun's Song Fairy", "Island Sun's Song Fairy", RHT_LH_ISLAND_SUN_FAIRY, SpoilerCollectionCheck::RandomizerInf(RAND_INF_LH_ISLAND_SUN_FAIRY));
locationTable[RC_HF_POND_STORMS_FAIRY] = Location::Fairy(RC_HF_POND_STORMS_FAIRY, RCQUEST_BOTH, RCAREA_HYRULE_FIELD, SCENE_HYRULE_FIELD, TWO_ACTOR_PARAMS(0x1000, 5012), "Pond Song of Storms Fairy", "Pond Song of Storms Fairy", RHT_HF_POND_STORMS_FAIRY, SpoilerCollectionCheck::RandomizerInf(RAND_INF_HF_POND_STORMS_FAIRY)); locationTable[RC_HF_POND_STORMS_FAIRY] = Location::Fairy(RC_HF_POND_STORMS_FAIRY, RCQUEST_BOTH, RCAREA_HYRULE_FIELD, SCENE_HYRULE_FIELD, TWO_ACTOR_PARAMS(0x1000, 5012), "Pond Song of Storms Fairy", "Pond Song of Storms Fairy", RHT_HF_POND_STORMS_FAIRY, SpoilerCollectionCheck::RandomizerInf(RAND_INF_HF_POND_STORMS_FAIRY));
locationTable[RC_HF_FENCE_GROTTO_STORMS_FAIRY] = Location::Fairy(RC_HF_FENCE_GROTTO_STORMS_FAIRY, RCQUEST_BOTH, RCAREA_HYRULE_FIELD, SCENE_GROTTOS, TWO_ACTOR_PARAMS(0x1012, -308), "Inside Fence Storms Fairy", "Inside Fence Storms Fairy", RHT_HF_FENCE_GROTTO_STORMS_FAIRY, SpoilerCollectionCheck::RandomizerInf(RHT_HF_FENCE_GROTTO_STORMS_FAIRY)); locationTable[RC_HF_FENCE_GROTTO_STORMS_FAIRY] = Location::Fairy(RC_HF_FENCE_GROTTO_STORMS_FAIRY, RCQUEST_BOTH, RCAREA_HYRULE_FIELD, SCENE_GROTTOS, TWO_ACTOR_PARAMS(0x1000, -308), "Inside Fence Storms Fairy", "Inside Fence Storms Fairy", RHT_HF_FENCE_GROTTO_STORMS_FAIRY, SpoilerCollectionCheck::RandomizerInf(RAND_INF_HF_FENCE_GROTTO_STORMS_FAIRY));
locationTable[RC_DMT_FLAG_SUN_FAIRY] = Location::Fairy(RC_DMT_FLAG_SUN_FAIRY, RCQUEST_BOTH, RCAREA_DEATH_MOUNTAIN_TRAIL, SCENE_DEATH_MOUNTAIN_TRAIL, TWO_ACTOR_PARAMS(0x1000, 464), "Flag Sun's Song Fairy", "Flag Sun's Song Fairy", RHT_DMT_FLAG_SUN_FAIRY, SpoilerCollectionCheck::RandomizerInf(RAND_INF_DMT_FLAG_SUN_FAIRY)); locationTable[RC_DMT_FLAG_SUN_FAIRY] = Location::Fairy(RC_DMT_FLAG_SUN_FAIRY, RCQUEST_BOTH, RCAREA_DEATH_MOUNTAIN_TRAIL, SCENE_DEATH_MOUNTAIN_TRAIL, TWO_ACTOR_PARAMS(0x1000, 464), "Flag Sun's Song Fairy", "Flag Sun's Song Fairy", RHT_DMT_FLAG_SUN_FAIRY, SpoilerCollectionCheck::RandomizerInf(RAND_INF_DMT_FLAG_SUN_FAIRY));
locationTable[RC_LW_SHORTCUT_STORMS_FAIRY] = Location::Fairy(RC_LW_SHORTCUT_STORMS_FAIRY, RCQUEST_BOTH, RCAREA_LOST_WOODS, SCENE_LOST_WOODS, TWO_ACTOR_PARAMS(0x1000, -795), "Shortcuts Song of Storms Fairy", "Shortcuts Song of Storms Fairy", RHT_LW_SHORTCUT_STORMS_FAIRY, SpoilerCollectionCheck::RandomizerInf(RAND_INF_LW_SHORTCUT_STORMS_FAIRY)); locationTable[RC_LW_SHORTCUT_STORMS_FAIRY] = Location::Fairy(RC_LW_SHORTCUT_STORMS_FAIRY, RCQUEST_BOTH, RCAREA_LOST_WOODS, SCENE_LOST_WOODS, TWO_ACTOR_PARAMS(0x1000, -795), "Shortcuts Song of Storms Fairy", "Shortcuts Song of Storms Fairy", RHT_LW_SHORTCUT_STORMS_FAIRY, SpoilerCollectionCheck::RandomizerInf(RAND_INF_LW_SHORTCUT_STORMS_FAIRY));
locationTable[RC_GF_KITCHEN_SUN_FAIRY] = Location::Fairy(RC_GF_KITCHEN_SUN_FAIRY, RCQUEST_BOTH, RCAREA_GERUDO_FORTRESS, SCENE_THIEVES_HIDEOUT, TWO_ACTOR_PARAMS(0x1000, -621), "Kitchen Sun's Song Fairy", "Kitchen Sun's Song Fairy", RHT_GF_KITCHEN_SUN_FAIRY, SpoilerCollectionCheck::RandomizerInf(RAND_INF_GF_KITCHEN_SUN_FAIRY)); locationTable[RC_GF_KITCHEN_SUN_FAIRY] = Location::Fairy(RC_GF_KITCHEN_SUN_FAIRY, RCQUEST_BOTH, RCAREA_GERUDO_FORTRESS, SCENE_THIEVES_HIDEOUT, TWO_ACTOR_PARAMS(0x1000, -621), "Kitchen Sun's Song Fairy", "Kitchen Sun's Song Fairy", RHT_GF_KITCHEN_SUN_FAIRY, SpoilerCollectionCheck::RandomizerInf(RAND_INF_GF_KITCHEN_SUN_FAIRY));

View File

@ -1248,6 +1248,7 @@ typedef enum {
RAND_INF_LH_ISLAND_SUN_FAIRY, RAND_INF_LH_ISLAND_SUN_FAIRY,
RAND_INF_HF_POND_STORMS_FAIRY, RAND_INF_HF_POND_STORMS_FAIRY,
RAND_INF_DMT_FLAG_SUN_FAIRY, RAND_INF_DMT_FLAG_SUN_FAIRY,
RAND_INF_HF_FENCE_GROTTO_STORMS_FAIRY,
RAND_INF_LW_SHORTCUT_STORMS_FAIRY, RAND_INF_LW_SHORTCUT_STORMS_FAIRY,
RAND_INF_GF_KITCHEN_SUN_FAIRY, RAND_INF_GF_KITCHEN_SUN_FAIRY,
RAND_INF_SPIRIT_TEMPLE_BOULDER_ROOM_SUN_FAIRY, RAND_INF_SPIRIT_TEMPLE_BOULDER_ROOM_SUN_FAIRY,

View File

@ -101,8 +101,10 @@ void ShotSun_SpawnFairy(ShotSun* this, PlayState* play) {
} }
//! @bug fairyType may be uninitialized //! @bug fairyType may be uninitialized
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, this->actor.home.pos.x, this->actor.home.pos.y, if (GameInteractor_Should(VB_SPAWN_SONG_FAIRY, true, this)) {
this->actor.home.pos.z, 0, 0, 0, fairyType, true); Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, this->actor.home.pos.x, this->actor.home.pos.y,
this->actor.home.pos.z, 0, 0, 0, fairyType, true);
}
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} }