SkipAmyPuzzle (#5550)

This commit is contained in:
Philip Dubé 2025-06-05 00:08:36 +00:00 committed by GitHub
parent 56a53e9fac
commit 3a60c3f651
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 24 additions and 1 deletions

View file

@ -0,0 +1,8 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/ShipInit.hpp"
void RegisterSkipAmyPuzzle() {
COND_VB_SHOULD(VB_AMY_SOLVE, CVarGetInteger(CVAR_ENHANCEMENT("SkipAmyPuzzle"), 0), { *should = true; });
}
static RegisterShipInitFunc initFunc(RegisterSkipAmyPuzzle, { CVAR_ENHANCEMENT("SkipAmyPuzzle") });

View file

@ -20,6 +20,14 @@ typedef enum {
// - `int32_t` (entrance index) (promoted from `uint16_t` by va_arg)
VB_ALLOW_ENTRANCE_CS_FOR_EITHER_AGE,
// #### `result`
// ```c
// sBgPoEventPuzzleState == 0xF
// ```
// #### `args`
// - None
VB_AMY_SOLVE,
// #### `result`
// ```c
// this->actor.textId == 0x401A

View file

@ -1312,6 +1312,11 @@ void SohMenu::AddMenuEnhancements() {
.Format("%d notes")
.Tooltip("Adjust the number of notes you need to play to end the third round."));
AddWidget(path, "Forest Temple", WIDGET_SEPARATOR_TEXT);
AddWidget(path, "Solve Amy's Puzzle", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("SkipAmyPuzzle"))
.Options(CheckboxOptions().Tooltip("Amy's block pushing puzzle instantly solved."));
path.column = SECTION_COLUMN_3;
AddWidget(path, "Fishing", WIDGET_SEPARATOR_TEXT);
AddWidget(path, "Customize Behavior##Fishing", WIDGET_CVAR_CHECKBOX)

View file

@ -6,6 +6,8 @@
#include "z_bg_po_event.h"
#include "objects/object_po_sisters/object_po_sisters.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#define FLAGS 0
@ -333,7 +335,7 @@ void BgPoEvent_BlockIdle(BgPoEvent* this, PlayState* play) {
Player* player = GET_PLAYER(play);
Actor* amy;
if (sBgPoEventPuzzleState == 0xF) {
if (GameInteractor_Should(VB_AMY_SOLVE, sBgPoEventPuzzleState == 0xF)) {
this->actionFunc = BgPoEvent_BlockSolved;
if ((this->type == 0) && (this->index == 0)) {
amy = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_PO_SISTERS, this->dyna.actor.world.pos.x + 30.0f,