Fix various HBA issues (#5246)

* Fix various HBA issues

* forgot to save

* cleanup to address review
This commit is contained in:
Pepper0ni 2025-03-30 22:51:20 +01:00 committed by GitHub
parent c38205ddcf
commit 026a418789
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 23 additions and 9 deletions

View file

@ -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#!^"

View file

@ -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;
}

View file

@ -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,12 +546,9 @@ 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);
}
}
}
void EnGe1_BeginGiveItem_Archery(EnGe1* this, PlayState* play) {
GetItemEntry getItemEntry = (GetItemEntry)GET_ITEM_NONE;
@ -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;