From 14b464bab2ecaa2cd18255acf235a0322b66b905 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 29 Mar 2026 21:33:16 -0400 Subject: [PATCH] Bean guy text formatting and rando fixes (#6444) --- .../game-interactor/vanilla-behavior/GIVanillaBehavior.h | 8 ++++++++ .../randomizer/Messages/MerchantMessages.cpp | 6 +++--- soh/soh/Enhancements/randomizer/hook_handlers.cpp | 9 +++++++++ soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c | 4 +++- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index aae11fe86..ae9ea8958 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -1355,6 +1355,14 @@ typedef enum { // - `*DoorShutter` VB_LOCK_BOSS_DOOR, + // #### `result` + // ```c + // true + // ``` + // #### `args` + // - `*EnMs` + VB_MAGIC_BEAN_SALESMAN_TAKE_MONEY, + // #### `result` // ```c // CHECK_QUEST_ITEM(QUEST_SONG_EPONA) diff --git a/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp b/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp index 2492acc77..dae35c0d0 100644 --- a/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp @@ -49,9 +49,9 @@ void BuildBeanGuyMessage(uint16_t* textId, bool* loadFromMessageTable) { "I never thought I'd say this, but I'm selling the last %rMagic Bean%w.^%y99 Rupees%w, no " "less.\x1B%gYes&No%w", "Ich hätte nie gedacht, daß ich das sage, aber ich verkaufe die letzte^%rWundererbse%w für %y99 " - "Rubine%w.\x1B&%gJa&Nein%w", - "Je te vends mon dernier %rHaricot&magique%g pour %y99 Rubis%w.\x1B&%gAcheterNe pas acheter%w"); - msg.Format(); + "Rubine%w.\x1B%gJa&Nein%w", + "Je te vends mon dernier %rHaricot&magique%w pour %y99 Rubis%w.\x1B%gAcheter&Ne pas acheter%w"); + msg.AutoFormat(); } else if (*textId == TEXT_BEAN_SALESMAN_BUY_FOR_10) { msg = CustomMessage("Want to buy [[color]][[1]]%w for %y[[2]] Rupees%w?\x1B%gYes&No%w", "Möchten Sie [[color]][[1]]%w für %y[[2]] Rubin%w kaufen?\x1B%gJa&Nein%w", diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 73b2cda6d..340aad287 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -980,6 +980,15 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l OTRGlobals::Instance->gRandoContext->GetItemLocation(RC_ZR_MAGIC_BEAN_SALESMAN)->GetPrice(); } else if (RAND_GET_OPTION(RSK_SKIP_PLANTING_BEANS)) { *should = gSaveContext.rupees >= 60; + } else if (BEANS_BOUGHT == 9) { + *should = gSaveContext.rupees >= 99; + } + break; + } + case VB_MAGIC_BEAN_SALESMAN_TAKE_MONEY: { + if (BEANS_BOUGHT == 9) { + Rupees_ChangeBy(-99); + *should = false; } break; } diff --git a/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c index cec35379c..3c8442ba9 100644 --- a/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -150,7 +150,9 @@ void EnMs_Talk(EnMs* this, PlayState* play) { void EnMs_Sell(EnMs* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { - Rupees_ChangeBy(-sPrices[BEANS_BOUGHT]); + if (GameInteractor_Should(VB_MAGIC_BEAN_SALESMAN_TAKE_MONEY, true, this)) { + Rupees_ChangeBy(-sPrices[BEANS_BOUGHT]); + } this->actor.parent = NULL; this->actionFunc = EnMs_TalkAfterPurchase; } else {