From 307e1060381bebd338b4769af3e606eecb898c00 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Thu, 4 Apr 2024 11:55:07 -0400 Subject: [PATCH] vb talon's chickens (#99) --- .../Enhancements/game-interactor/GameInteractor.h | 2 ++ soh/soh/Enhancements/randomizer/hook_handlers.cpp | 1 + soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c | 12 +++--------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.h b/soh/soh/Enhancements/game-interactor/GameInteractor.h index 08f1fe0be..f5e70da16 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.h @@ -292,6 +292,8 @@ typedef enum { GI_VB_GIVE_ITEM_FROM_SHOOTING_GALLERY, // Opt: *EnExItem GI_VB_GIVE_ITEM_FROM_TARGET_IN_WOODS, + // Opt: *EnTa + GI_VB_GIVE_ITEM_FROM_TALONS_CHICKENS, // Opt: *EnDivingGame GI_VB_GIVE_ITEM_FROM_DIVING_MINIGAME, diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index f1cc89102..772ce16aa 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -768,6 +768,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void case GI_VB_TRADE_TIMER_FROG: case GI_VB_ANJU_SET_OBTAINED_TRADE_ITEM: case GI_VB_GIVE_ITEM_FROM_TARGET_IN_WOODS: + case GI_VB_GIVE_ITEM_FROM_TALONS_CHICKENS: case GI_VB_GIVE_ITEM_FROM_DIVING_MINIGAME: case GI_VB_GIVE_ITEM_FROM_GORON: case GI_VB_GIVE_ITEM_FROM_LAB_DIVE: diff --git a/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c index d8a0ff554..cdec042bc 100644 --- a/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -869,7 +869,7 @@ void EnTa_TalkGeneralInLonLonHouse(EnTa* this, PlayState* play) { } void EnTa_GiveItemInLonLonHouse(EnTa* this, PlayState* play) { - if (Actor_HasParent(&this->actor, play)) { + if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(GI_VB_GIVE_ITEM_FROM_TALONS_CHICKENS, true, &this->actor)) { this->actor.parent = NULL; this->actionFunc = EnTa_TalkGeneralInLonLonHouse; if (!(this->unk_2E0 & 0x2)) { @@ -879,11 +879,8 @@ void EnTa_GiveItemInLonLonHouse(EnTa* this, PlayState* play) { } else if (this->unk_2E0 & 2) { Actor_OfferGetItem(&this->actor, play, GI_MILK, 10000.0f, 50.0f); } else { - if (!IS_RANDO) { + if (GameInteractor_Should(GI_VB_GIVE_ITEM_FROM_TALONS_CHICKENS, true, &this->actor)) { Actor_OfferGetItem(&this->actor, play, GI_MILK_BOTTLE, 10000.0f, 50.0f); - } else { - GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LLR_TALONS_CHICKENS, GI_MILK_BOTTLE); - GiveItemEntryFromActor(&this->actor, play, getItemEntry, 10000.0f, 50.0f); } } this->unk_2E0 |= 1; @@ -894,11 +891,8 @@ void EnTa_TalkAfterCuccoGameFirstWon(EnTa* this, PlayState* play) { Message_CloseTextbox(play); this->unk_2E0 &= ~0x2; EnTa_SetupAction(this, EnTa_GiveItemInLonLonHouse, EnTa_AnimRunToEnd); - if (!IS_RANDO) { + if (GameInteractor_Should(GI_VB_GIVE_ITEM_FROM_TALONS_CHICKENS, true, &this->actor)) { Actor_OfferGetItem(&this->actor, play, GI_MILK_BOTTLE, 10000.0f, 50.0f); - } else { - GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LLR_TALONS_CHICKENS, GI_MILK_BOTTLE); - GiveItemEntryFromActor(&this->actor, play, getItemEntry, 10000.0f, 50.0f); } } }