diff --git a/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp b/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp index 5a289ae13..b64067a18 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp @@ -134,27 +134,31 @@ void Rock_RandomizerSpawnCollectible(Actor* actor, CheckIdentity rockIdentity, P item00->randoInf = rockIdentity.randomizerInf; item00->itemEntry = Rando::Context::GetInstance()->GetFinalGIEntry(rockIdentity.randomizerCheck, true, GI_NONE); item00->actor.draw = (ActorFunc)EnItem00_DrawRandomizedItem; + item00->actor.velocity.y = 9.0f; + item00->actor.speedXZ = 2.0f; + item00->actor.world.rot.y = Rand_CenteredFloat(65536.0f); switch (rockIdentity.randomizerCheck) { case RC_SPIRIT_TEMPLE_MQ_ENTRANCE_EYE_BOULDER: - item00->actor.velocity.y = 9.0f; - item00->actor.speedXZ = 2.0f; - item00->actor.world.rot.y = 0x4000; + item00->actor.world.rot.y = 0x8000; break; - default: - item00->actor.velocity.y = 9.0f; - item00->actor.speedXZ = 2.0f; - item00->actor.world.rot.y = Rand_CenteredFloat(65536.0f); + case RC_SPIRIT_TEMPLE_MQ_GIBDO_BOULDER_LOW: + item00->actor.velocity.y = 15.0f; + [[fallthrough]]; + case RC_SPIRIT_TEMPLE_MQ_GIBDO_BOULDER_HIGH: + item00->actor.world.rot.y = 0x0; + item00->actor.speedXZ = 8.0f; + break; + case RC_SPIRIT_TEMPLE_MQ_ENTRANCE_CEILING_BOULDER: + case RC_SPIRIT_TEMPLE_MQ_CRAWLSPACE_BOULDER: + item00->actor.speedXZ = 0.0f; + break; + default:; } } void EnIshi_RandomizerInit(void* actorRef) { Actor* actor = static_cast(actorRef); - - if (actor->id != ACTOR_EN_ISHI) - return; - EnIshi* rockActor = static_cast(actorRef); - auto rockIdentity = OTRGlobals::Instance->gRandomizer->IdentifyRock(gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z); if (rockIdentity.randomizerCheck == RC_MAX) { @@ -173,12 +177,7 @@ void EnIshi_RandomizerInit(void* actorRef) { void ObjBombiwa_RandomizerInit(void* actorRef) { Actor* actor = static_cast(actorRef); - - if (actor->id != ACTOR_OBJ_BOMBIWA) - return; - ObjBombiwa* rockActor = static_cast(actorRef); - auto rockIdentity = OTRGlobals::Instance->gRandomizer->IdentifyRock(gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z); if (rockIdentity.randomizerCheck == RC_MAX) { @@ -196,12 +195,7 @@ void ObjBombiwa_RandomizerInit(void* actorRef) { void ObjHamishi_RandomizerInit(void* actorRef) { Actor* actor = static_cast(actorRef); - - if (actor->id != ACTOR_OBJ_HAMISHI) - return; - ObjHamishi* rockActor = static_cast(actorRef); - auto rockIdentity = OTRGlobals::Instance->gRandomizer->IdentifyRock(gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z); if (rockIdentity.randomizerCheck == RC_MAX) { @@ -217,38 +211,6 @@ void ObjHamishi_RandomizerInit(void* actorRef) { } } -void ObjBombiwa_RandomizerKill(void* actorRef) { - Actor* actor = static_cast(actorRef); - - if (actor->id != ACTOR_OBJ_BOMBIWA) - return; - - ObjBombiwa* rockActor = static_cast(actorRef); - const auto rockIdentity = ObjectExtension::GetInstance().Get(actorRef); - - if (rockIdentity != nullptr && Rock_RandomizerHoldsItem(*rockIdentity, gPlayState, true)) { - Rock_RandomizerSpawnCollectible(&rockActor->actor, *rockIdentity, gPlayState); - rockIdentity->randomizerCheck = RC_MAX; - rockIdentity->randomizerInf = RAND_INF_MAX; - } -} - -void ObjHamishi_RandomizerKill(void* actorRef) { - Actor* actor = static_cast(actorRef); - - if (actor->id != ACTOR_OBJ_HAMISHI) - return; - - ObjHamishi* rockActor = static_cast(actorRef); - const auto rockIdentity = ObjectExtension::GetInstance().Get(actorRef); - - if (rockIdentity != nullptr && Rock_RandomizerHoldsItem(*rockIdentity, gPlayState, true)) { - Rock_RandomizerSpawnCollectible(&rockActor->actor, *rockIdentity, gPlayState); - rockIdentity->randomizerCheck = RC_MAX; - rockIdentity->randomizerInf = RAND_INF_MAX; - } -} - void RegisterShuffleRock() { bool shouldRegister = IS_RANDO && (RAND_GET_OPTION(RSK_SHUFFLE_ROCKS) || RAND_GET_OPTION(RSK_SHUFFLE_BOULDERS)); bool shouldRegisterBoulder = IS_RANDO && RAND_GET_OPTION(RSK_SHUFFLE_BOULDERS); @@ -269,13 +231,14 @@ void RegisterShuffleRock() { }); COND_VB_SHOULD(VB_BOULDER_BREAK_FLAG, shouldRegisterBoulder, { - Actor* rockActor = va_arg(args, Actor*); - // hook called before OnActorInit sets up object extension - auto rockIdentity = OTRGlobals::Instance->gRandomizer->IdentifyRock( - gPlayState->sceneNum, (s16)rockActor->world.pos.x, (s16)rockActor->world.pos.z); - if (rockIdentity.randomizerCheck != RC_UNKNOWN_CHECK && - Rock_RandomizerHoldsItem(rockIdentity, gPlayState, true)) { - *should = false; + if (*should) { + Actor* rockActor = va_arg(args, Actor*); + // hook called before OnActorInit sets up object extension + auto rockIdentity = OTRGlobals::Instance->gRandomizer->IdentifyRock( + gPlayState->sceneNum, (s16)rockActor->world.pos.x, (s16)rockActor->world.pos.z); + if (Rock_RandomizerHoldsItem(rockIdentity, gPlayState, true)) { + Rock_RandomizerSpawnCollectible(rockActor, rockIdentity, gPlayState); + } } }); } diff --git a/soh/soh/Enhancements/randomizer/location_access/dungeons/spirit_temple.cpp b/soh/soh/Enhancements/randomizer/location_access/dungeons/spirit_temple.cpp index 5e2d64139..daa414179 100644 --- a/soh/soh/Enhancements/randomizer/location_access/dungeons/spirit_temple.cpp +++ b/soh/soh/Enhancements/randomizer/location_access/dungeons/spirit_temple.cpp @@ -569,7 +569,7 @@ void RegionTable_Init_SpiritTemple() { LOCATION(RC_SPIRIT_TEMPLE_MQ_ENTRANCE_POT_4, logic->CanBreakPots()), LOCATION(RC_SPIRIT_TEMPLE_MQ_ENTRANCE_BOULDER_1, logic->BlastOrSmash()), LOCATION(RC_SPIRIT_TEMPLE_MQ_ENTRANCE_BOULDER_2, logic->BlastOrSmash()), - LOCATION(RC_SPIRIT_TEMPLE_MQ_ENTRANCE_BOULDER_3, logic->BlastOrSmash()), + LOCATION(RC_SPIRIT_TEMPLE_MQ_ENTRANCE_EYE_BOULDER, logic->BlastOrSmash()), LOCATION(RC_SPIRIT_TEMPLE_MQ_ENTRANCE_CEILING_BOULDER, logic->CanUse(RG_BOMBCHU_5)), LOCATION(RC_SPIRIT_TEMPLE_LEFT_SNAKE_STATUE, logic->CanRead()), LOCATION(RC_SPIRIT_TEMPLE_RIGHT_SNAKE_STATUE, logic->CanRead()), diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index a8dd7261b..6e5820e64 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -3127,7 +3127,7 @@ std::map rcToRandomizerInf = { { RC_JABU_JABUS_BELLY_MQ_TAILPASARAN_WALL_BOULDER, RAND_INF_JABU_JABUS_BELLY_MQ_TAILPASARAN_WALL_BOULDER }, { RC_SPIRIT_TEMPLE_MQ_ENTRANCE_BOULDER_1, RAND_INF_SPIRIT_TEMPLE_MQ_ENTRANCE_BOULDER_1 }, { RC_SPIRIT_TEMPLE_MQ_ENTRANCE_BOULDER_2, RAND_INF_SPIRIT_TEMPLE_MQ_ENTRANCE_BOULDER_2 }, - { RC_SPIRIT_TEMPLE_MQ_ENTRANCE_BOULDER_3, RAND_INF_SPIRIT_TEMPLE_MQ_ENTRANCE_BOULDER_3 }, + { RC_SPIRIT_TEMPLE_MQ_ENTRANCE_EYE_BOULDER, RAND_INF_SPIRIT_TEMPLE_MQ_ENTRANCE_EYE_BOULDER }, { RC_SPIRIT_TEMPLE_MQ_ENTRANCE_CEILING_BOULDER, RAND_INF_SPIRIT_TEMPLE_MQ_ENTRANCE_CEILING_BOULDER }, { RC_SPIRIT_TEMPLE_MQ_EARLY_ADULT_BOULDER, RAND_INF_SPIRIT_TEMPLE_MQ_EARLY_ADULT_BOULDER }, { RC_BOTW_MQ_BOULDER_1, RAND_INF_BOTW_MQ_BOULDER_1 },