Gerudo Guards: offer to throw you in jail

Necessary for logic to use being captured in routing
This commit is contained in:
Demur Rumed 2025-04-11 16:05:23 +00:00
commit 9416358d16
5 changed files with 37 additions and 14 deletions

View file

@ -163,6 +163,7 @@ typedef enum {
TEXT_ANJU_ROUND_THEM_UP_OR_YOULL_PAY = 0x503C,
TEXT_ANJU_DONT_TEASE_MY_CUCCOS = 0x503D,
TEXT_BIG_POE_COLLECTED_RANDO = 0x5090,
TEXT_GERUDO_GUARD_FRIENDLY = 0x6005,
TEXT_HBA_NOT_ON_HORSE = 0x603F,
TEXT_HBA_INITIAL_EXPLAINATION = 0x6040,
TEXT_HBA_WANT_TO_TRY_AGAIN_YES_NO = 0x6041,

View file

@ -567,6 +567,14 @@ typedef enum {
// - None
VB_GANON_HEAL_BEFORE_FIGHT,
// #### `result`
// ```c
// true
// ```
// #### `args`
// - `*EnGe2`
VB_GERUDO_GUARD_SET_ACTION_AFTER_TALK,
// #### `result`
// See logic in
// ```c

View file

@ -46,6 +46,7 @@ extern "C" {
#include "src/overlays/actors/ovl_En_Hy/z_en_hy.h"
#include "src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h"
#include "src/overlays/actors/ovl_En_Ge1/z_en_ge1.h"
#include "src/overlays/actors/ovl_En_Ge2/z_en_ge2.h"
#include "src/overlays/actors/ovl_En_Ds/z_en_ds.h"
#include "src/overlays/actors/ovl_En_Gm/z_en_gm.h"
#include "src/overlays/actors/ovl_En_Js/z_en_js.h"
@ -55,7 +56,6 @@ extern "C" {
#include "src/overlays/actors/ovl_En_Xc/z_en_xc.h"
#include "src/overlays/actors/ovl_Fishing/z_fishing.h"
#include "src/overlays/actors/ovl_En_Mk/z_en_mk.h"
#include "src/overlays/actors/ovl_En_Ge1/z_en_ge1.h"
#include "draw.h"
extern SaveContext gSaveContext;
@ -69,6 +69,8 @@ extern void EnMk_Wait(EnMk* enMk, PlayState* play);
extern void func_80ABA778(EnNiwLady* enNiwLady, PlayState* play);
extern void EnGe1_Wait_Archery(EnGe1* enGe1, PlayState* play);
extern void EnGe1_SetAnimationIdle(EnGe1* enGe1);
extern void EnGe1_SetAnimationIdle(EnGe1* enGe1);
extern void EnGe2_SetupCapturePlayer(EnGe2* enGe2, PlayState* play);
}
#define RAND_GET_OPTION(option) Rando::Context::GetInstance()->GetOption(option).Get()
@ -1444,6 +1446,13 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l
}
break;
}
case VB_GERUDO_GUARD_SET_ACTION_AFTER_TALK:
if (gPlayState->msgCtx.choiceIndex == 0) {
EnGe2* enGe2 = va_arg(args, EnGe2*);
EnGe2_SetupCapturePlayer(enGe2, gPlayState);
*should = false;
}
break;
case VB_GERUDOS_BE_FRIENDLY: {
*should = CHECK_QUEST_ITEM(QUEST_GERUDO_CARD);
break;

View file

@ -2443,6 +2443,9 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) {
} else if (textId == TEXT_BIG_POE_COLLECTED_RANDO) {
messageEntry =
CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, textId, MF_AUTO_FORMAT);
} else if (textId == TEXT_GERUDO_GUARD_FRIENDLY) {
messageEntry = CustomMessage("Want me to throw you in jail?&\x1B#Yes please&No thanks#", { QM_GREEN });
messageEntry.AutoFormat();
}
}
if (textId == TEXT_GS_NO_FREEZE || textId == TEXT_GS_FREEZE) {

View file

@ -54,6 +54,7 @@ void EnGe2_Walk(EnGe2* this, PlayState* play);
void EnGe2_Stand(EnGe2* this, PlayState* play);
void EnGe2_WaitLookAtPlayer(EnGe2* this, PlayState* play);
void EnGe2_ForceTalk(EnGe2* this, PlayState* play);
void EnGe2_SetupCapturePlayer(EnGe2* this, PlayState* play);
// Update functions
void EnGe2_UpdateFriendly(Actor* thisx, PlayState* play);
@ -439,20 +440,21 @@ void EnGe2_LookAtPlayer(EnGe2* this, PlayState* play) {
void EnGe2_SetActionAfterTalk(EnGe2* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
switch (this->actor.params & 0xFF) {
case GE2_TYPE_PATROLLING:
EnGe2_ChangeAction(this, GE2_ACTION_ABOUTTURN);
break;
case GE2_TYPE_STATIONARY:
EnGe2_ChangeAction(this, GE2_ACTION_STAND);
break;
case GE2_TYPE_GERUDO_CARD_GIVER:
this->actionFunc = EnGe2_WaitLookAtPlayer;
break;
if (GameInteractor_Should(VB_GERUDO_GUARD_SET_ACTION_AFTER_TALK, true, this)) {
switch (this->actor.params & 0xFF) {
case GE2_TYPE_PATROLLING:
EnGe2_ChangeAction(this, GE2_ACTION_ABOUTTURN);
break;
case GE2_TYPE_STATIONARY:
EnGe2_ChangeAction(this, GE2_ACTION_STAND);
break;
case GE2_TYPE_GERUDO_CARD_GIVER:
this->actionFunc = EnGe2_WaitLookAtPlayer;
break;
}
this->actor.update = EnGe2_UpdateFriendly;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
}
this->actor.update = EnGe2_UpdateFriendly;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
}
EnGe2_TurnToFacePlayer(this, play);
}