summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPepper0ni <93387759+Pepper0ni@users.noreply.github.com>2025-03-30 22:51:20 +0100
committerGitHub <noreply@github.com>2025-03-30 23:51:20 +0200
commit026a418789368906f900bee2898e2cba4e3c50b0 (patch)
tree90a973775396d5ad1ed41c482616af36009d1dc5
parentc38205ddcfc079caff8a5fe02b85a9bf76012739 (diff)
Fix various HBA issues (#5246)
* Fix various HBA issues * forgot to save * cleanup to address review
-rw-r--r--soh/soh/Enhancements/randomizer/3drando/hint_list.cpp6
-rw-r--r--soh/soh/Enhancements/randomizer/hook_handlers.cpp11
-rw-r--r--soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c15
3 files changed, 23 insertions, 9 deletions
diff --git a/soh/soh/Enhancements/randomizer/3drando/hint_list.cpp b/soh/soh/Enhancements/randomizer/3drando/hint_list.cpp
index 182e5eba5..f0d7742f0 100644
--- a/soh/soh/Enhancements/randomizer/3drando/hint_list.cpp
+++ b/soh/soh/Enhancements/randomizer/3drando/hint_list.cpp
@@ -2281,15 +2281,15 @@ void StaticData::HintTable_Init() {
{QM_RED, QM_GREEN, QM_GREEN, QM_GREEN}, {}, TEXTBOX_TYPE_WOODEN));
hintTextTable[RHT_HBA_HINT_NOT_ON_HORSE] = HintText(CustomMessage("Hey, rookie!&Come back on your #horse# and take on then #Horseback Archery# challenge!^"
- "Impress me with a high score of 1000 to win a #[[1]]# or score 1500 for my #[[2]]#!",
+ "Impress me with a high score of 1000 to win a #[[1]]# or score 1500 for #[[2]]#!",
{QM_RED, QM_RED, QM_GREEN, QM_GREEN}));
hintTextTable[RHT_HBA_HINT_INITIAL] = HintText(CustomMessage("Hey, rookie!&Want to take on the #Horseback Archery# challenge?^"
- "Impress me with a high score of 1000 to win a #[[1]]# or score 1500 for my #[[2]]#!\x0B",
+ "Impress me with a high score of 1000 to win a #[[1]]# or score 1500 for #[[2]]#!\x0B",
{QM_RED, QM_GREEN, QM_GREEN}));
hintTextTable[RHT_HBA_HINT_HAVE_1000] = HintText(CustomMessage("Hey, newcomer!&Want to take on the #Horseback Archery# challenge?^"
- "Prove yourself to be a horsemaster by scoring 1500 points to win my #[[1]]#!\x0B",
+ "Prove yourself to be a horsemaster by scoring 1500 points to win #[[2]]#!\x0B",
{QM_RED, QM_GREEN}));
hintTextTable[RHT_MALON_HINT_HOW_IS_EPONA] = HintText(CustomMessage("@! You should come back with Epona and try to beat my time on the #Obstacle Course#!^"
diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp
index 8169bbb17..37a5d7323 100644
--- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp
+++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp
@@ -55,6 +55,7 @@ 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;
@@ -65,6 +66,8 @@ extern s32 Player_SetupWaitForPutAway(PlayState* play, Player* player, AfterPutA
extern void Play_InitEnvironment(PlayState * play, s16 skyboxId);
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);
}
#define RAND_GET_OPTION(option) Rando::Context::GetInstance()->GetOption(option).Get()
@@ -1317,10 +1320,18 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l
break;
}
case VB_GIVE_ITEM_FROM_HORSEBACK_ARCHERY: {
+ EnGe1* enGe1 = va_arg(args, EnGe1*);
// give both rewards at the same time
+ if (gSaveContext.minigameScore >= 1000) {
+ Flags_SetInfTable(INFTABLE_190);
+ }
if (gSaveContext.minigameScore >= 1500) {
Flags_SetItemGetInf(ITEMGETINF_0F);
}
+ //move gerudo actor onto her wait loop
+ enGe1->actionFunc = EnGe1_Wait_Archery;
+ EnGe1_SetAnimationIdle(enGe1);
+ //skip the vanilla gives.
*should = false;
break;
}
diff --git a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c
index 1614bac81..467e24678 100644
--- a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c
+++ b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c
@@ -521,7 +521,10 @@ void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, PlayState* play) {
GetItemEntry getItemEntry = (GetItemEntry)GET_ITEM_NONE;
s32 getItemId;
- if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(VB_GIVE_ITEM_FROM_HORSEBACK_ARCHERY, true, this)) {
+ if (!GameInteractor_Should(VB_GIVE_ITEM_FROM_HORSEBACK_ARCHERY, true, this)){
+ return;
+ }
+ if (Actor_HasParent(&this->actor, play)) {
this->actionFunc = EnGe1_SetupWait_Archery;
if (this->stateFlags & GE1_STATE_GIVE_QUIVER) {
@@ -543,10 +546,7 @@ void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, PlayState* play) {
} else {
getItemId = GI_HEART_PIECE;
}
-
- if (GameInteractor_Should(VB_GIVE_ITEM_FROM_HORSEBACK_ARCHERY, true, this)) {
- Actor_OfferGetItem(&this->actor, play, getItemId, 10000.0f, 50.0f);
- }
+ Actor_OfferGetItem(&this->actor, play, getItemId, 10000.0f, 50.0f);
}
}
@@ -561,7 +561,10 @@ void EnGe1_BeginGiveItem_Archery(EnGe1* this, PlayState* play) {
if (this->stateFlags & GE1_STATE_GIVE_QUIVER) {
switch (CUR_UPG_VALUE(UPG_QUIVER)) {
- //! @bug Asschest. See next function for details
+ //! @bug Asschest: the compiler inserts a default assigning *(sp+0x24) to getItemId, which is junk data left
+ //! over from the previous function run in EnGe1_Update, namely EnGe1_CueUpAnimation. The top stack variable
+ //! in that function is &this->skelAnime = thisx + 198, and depending on where this loads in memory, the
+ //! getItemId changes.
case 1:
getItemId = GI_QUIVER_40;
break;