Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skips Banker Deposit Dialogue #172

Open
wants to merge 3 commits into
base: develop-rando
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mm/2s2h/GameInteractor/GameInteractor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
32 changes: 32 additions & 0 deletions mm/2s2h/Rando/ActorBehavior/EnGinko.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
}
32 changes: 21 additions & 11 deletions mm/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -116,6 +118,10 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, PlayState* play) {
return;
}

if (!GameInteractor_Should(VB_CONTINUE_BANKER_DIALOGUE, true, this)) {
return;
}

switch (this->curTextId) {
case 0x44C:
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING);
Expand Down Expand Up @@ -339,6 +345,10 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, PlayState* play) {
return;
}

if (!GameInteractor_Should(VB_CONTINUE_BANKER_DIALOGUE, true, this)) {
return;
}

switch (this->curTextId) {
case 0x44E:
if (play->msgCtx.choiceIndex == GINKOMAN_CHOICE_YES) {
Expand Down
Loading