From 474e2989514c0d7daa637591278528b7705e4e1c Mon Sep 17 00:00:00 2001 From: Caladius Date: Tue, 14 Jan 2025 11:55:37 -0500 Subject: [PATCH 1/2] Skips unneccesary Banker Deposit Interactions. --- mm/2s2h/GameInteractor/GameInteractor.h | 1 + mm/2s2h/Rando/ActorBehavior/EnGinko.cpp | 32 +++++++++++++++++++ .../actors/ovl_En_Ginko_Man/z_en_ginko_man.c | 32 ++++++++++++------- 3 files changed, 54 insertions(+), 11 deletions(-) diff --git a/mm/2s2h/GameInteractor/GameInteractor.h b/mm/2s2h/GameInteractor/GameInteractor.h index dc28b55c03..0407c237d5 100644 --- a/mm/2s2h/GameInteractor/GameInteractor.h +++ b/mm/2s2h/GameInteractor/GameInteractor.h @@ -199,6 +199,7 @@ typedef enum { VB_GORON_ROLL_INCREASE_SPIKE_LEVEL, VB_GORON_ROLL_DISABLE_SPIKE_MODE, VB_DEKU_LINK_SPIN_ON_LAST_HOP, + VB_CONTINUE_BANKER_DIALOGUE, } GIVanillaBehavior; typedef enum { diff --git a/mm/2s2h/Rando/ActorBehavior/EnGinko.cpp b/mm/2s2h/Rando/ActorBehavior/EnGinko.cpp index 95f36d0f96..e517ba8e08 100644 --- a/mm/2s2h/Rando/ActorBehavior/EnGinko.cpp +++ b/mm/2s2h/Rando/ActorBehavior/EnGinko.cpp @@ -32,4 +32,36 @@ void Rando::ActorBehavior::InitEnGinkoBehavior() { *should = false; }); + + COND_ID_HOOK(OnActorInit, ACTOR_EN_GINKO_MAN, IS_RANDO, [](Actor* actor) { + EnGinkoMan* refActor = (EnGinkoMan*)actor; + + // Set New Account + refActor->isNewAccount = false; + if (HS_GET_BANK_RUPEES() == 0) { + HS_SET_BANK_RUPEES(1); + } + }); + + COND_VB_SHOULD(VB_CONTINUE_BANKER_DIALOGUE, IS_RANDO, { + EnGinkoMan* enGinkoMan = va_arg(args, EnGinkoMan*); + + // Initial Banter + if (enGinkoMan->curTextId == 0 || enGinkoMan->curTextId == 0x44c || enGinkoMan->curTextId == 0x457) { + Message_StartTextbox(gPlayState, 0x466, &enGinkoMan->actor); + enGinkoMan->curTextId = 0x466; + *should = false; + } + + // Deposit Dialogue + if (enGinkoMan->curTextId == 0x469 && enGinkoMan->choiceDepositWithdrawl == GINKOMAN_CHOICE_DEPOSIT) { + enGinkoMan->curTextId = 0x44f; + *should = false; + } + + if (enGinkoMan->curTextId == 0x454 || enGinkoMan->curTextId == 0x453) { + enGinkoMan->curTextId = 0x455; + *should = false; + } + }); } \ No newline at end of file diff --git a/mm/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c b/mm/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c index 811f1e4564..fe2e6fb1bf 100644 --- a/mm/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c +++ b/mm/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c @@ -90,18 +90,20 @@ void EnGinkoMan_Idle(EnGinkoMan* this, PlayState* play) { EnGinkoMan_SwitchAnimation(this, play); if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - if (HS_GET_BANK_RUPEES() == 0) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_LEGSMACKING); - Message_StartTextbox(play, 0x44C, &this->actor); - this->curTextId = 0x44C; // would you like to make an account - } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING); - if ((CURRENT_DAY == 3) && (gSaveContext.save.isNight == true)) { - Message_StartTextbox(play, 0x467, &this->actor); - this->curTextId = 0x467; + if (GameInteractor_Should(VB_CONTINUE_BANKER_DIALOGUE, true, this)) { + if (HS_GET_BANK_RUPEES() == 0) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_LEGSMACKING); + Message_StartTextbox(play, 0x44C, &this->actor); + this->curTextId = 0x44C; // would you like to make an account } else { - Message_StartTextbox(play, 0x466, &this->actor); - this->curTextId = 0x466; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING); + if ((CURRENT_DAY == 3) && (gSaveContext.save.isNight == true)) { + Message_StartTextbox(play, 0x467, &this->actor); + this->curTextId = 0x467; + } else { + Message_StartTextbox(play, 0x466, &this->actor); + this->curTextId = 0x466; + } } } EnGinkoMan_SetupDialogue(this); @@ -116,6 +118,10 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, PlayState* play) { return; } + if (GameInteractor_Should(VB_CONTINUE_BANKER_DIALOGUE, false, this)) { + return; + } + switch (this->curTextId) { case 0x44C: Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING); @@ -339,6 +345,10 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, PlayState* play) { return; } + if (GameInteractor_Should(VB_CONTINUE_BANKER_DIALOGUE, false, this)) { + return; + } + switch (this->curTextId) { case 0x44E: if (play->msgCtx.choiceIndex == GINKOMAN_CHOICE_YES) { From f22089f53a630538964539dbaeeaae496ff103fd Mon Sep 17 00:00:00 2001 From: Caladius Date: Tue, 14 Jan 2025 14:55:36 -0500 Subject: [PATCH 2/2] Correct Should Usage --- mm/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c b/mm/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c index fe2e6fb1bf..bc92f21f45 100644 --- a/mm/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c +++ b/mm/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c @@ -118,7 +118,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, PlayState* play) { return; } - if (GameInteractor_Should(VB_CONTINUE_BANKER_DIALOGUE, false, this)) { + if (!GameInteractor_Should(VB_CONTINUE_BANKER_DIALOGUE, true, this)) { return; } @@ -345,7 +345,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, PlayState* play) { return; } - if (GameInteractor_Should(VB_CONTINUE_BANKER_DIALOGUE, false, this)) { + if (!GameInteractor_Should(VB_CONTINUE_BANKER_DIALOGUE, true, this)) { return; }