Fix Deku Mouth for Entrance Rando and Mido Rando Functionality (#4342)

* Restore Deku Tree open as adult with dungeon shuffle.

* Add Mido spawn VB to allow for preventing Mido moving in rando when starting with Zelda's letter and closed deku or forest.

* Use RAND_GET_OPTION instead of OTRGlobals rando context, get rid of IS_RANDO in deku mouth VB handler.
This commit is contained in:
Malkierian 2024-09-17 08:40:38 -07:00 committed by GitHub
parent 1b51750ec0
commit 6cd387ddf3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 1 deletions

View File

@ -78,6 +78,8 @@ typedef enum {
// Vanilla condition: INFTABLE_GREETED_BY_SARIA
VB_NOT_BE_GREETED_BY_SARIA,
// Opt: *EnMd
VB_MIDO_SPAWN,
// Opt: *EnMd
// Vanilla condition: EnMd->interactInfo.talkState == NPC_TALK_STATE_ACTION
VB_MOVE_MIDO_IN_KOKIRI_FOREST,
// Opt: *EnMd

View File

@ -12,6 +12,7 @@ extern "C" {
#include "functions.h"
#include "variables.h"
#include "soh/Enhancements/randomizer/adult_trade_shuffle.h"
#include "src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h"
#include "src/overlays/actors/ovl_En_Si/z_en_si.h"
#include "src/overlays/actors/ovl_En_Cow/z_en_cow.h"
#include "src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h"
@ -614,6 +615,11 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void
case VB_BE_ELIGIBLE_FOR_PRELUDE_OF_LIGHT:
*should = !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST);
break;
case VB_MIDO_SPAWN:
if (RAND_GET_OPTION(RSK_FOREST) != RO_FOREST_OPEN && !Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) {
*should = true;
}
break;
case VB_MOVE_MIDO_IN_KOKIRI_FOREST:
if (RAND_GET_OPTION(RSK_FOREST) == RO_FOREST_OPEN) {
*should = true;
@ -1465,6 +1471,14 @@ void RandomizerOnActorInitHandler(void* actorRef) {
}
}
if (actor->id == ACTOR_BG_TREEMOUTH && LINK_IS_ADULT &&
RAND_GET_OPTION(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF &&
(RAND_GET_OPTION(RSK_FOREST) == RO_FOREST_OPEN ||
Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD))) {
BgTreemouth* bgTreemouth = static_cast<BgTreemouth*>(actorRef);
bgTreemouth->unk_168 = 1.0f;
}
//consumable bags
if (
actor->id == ACTOR_EN_ITEM00 &&

View File

@ -646,7 +646,7 @@ void EnMd_Init(Actor* thisx, PlayState* play) {
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
if (!EnMd_ShouldSpawn(this, play)) {
if (!GameInteractor_Should(VB_MIDO_SPAWN, EnMd_ShouldSpawn(this, play), this)) {
Actor_Kill(&this->actor);
return;
}