mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-05-22 22:44:40 -04:00
Fishing: don't say default 6/7 when minimum reduced by enhancement (#6523)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||
#include "soh/ShipInit.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include <variables.h>
|
||||
|
||||
f32 Fishing_GetMinimumRequiredScore();
|
||||
}
|
||||
|
||||
void BuildFishingMessage(uint16_t* textId, bool* loadFromMessageTable) {
|
||||
if (gSaveContext.minigameScore == 0) {
|
||||
gSaveContext.minigameScore = Fishing_GetMinimumRequiredScore();
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterFishingMessages() {
|
||||
COND_ID_HOOK(OnOpenText, 0x40AE, CVarGetInteger(CVAR_ENHANCEMENT("CustomizeFishing"), 0), BuildFishingMessage);
|
||||
COND_ID_HOOK(OnOpenText, 0x4080, CVarGetInteger(CVAR_ENHANCEMENT("CustomizeFishing"), 0), BuildFishingMessage);
|
||||
}
|
||||
|
||||
static RegisterShipInitFunc initFunc(RegisterFishingMessages, { CVAR_ENHANCEMENT("CustomizeFishing") });
|
||||
@@ -432,6 +432,8 @@ static FishingEffect sFishingEffects[FISHING_EFFECT_COUNT];
|
||||
static Vec3f sStreamSoundProjectedPos;
|
||||
static s16 sFishOnHandParams;
|
||||
|
||||
f32 Fishing_GetMinimumRequiredScore();
|
||||
|
||||
u8 AllHyruleLoaches() {
|
||||
return CVarGetInteger(CVAR_ENHANCEMENT("CustomizeFishing"), 0) &&
|
||||
CVarGetInteger(CVAR_ENHANCEMENT("AllHyruleLoaches"), 0);
|
||||
@@ -904,12 +906,16 @@ void Fishing_Init(Actor* thisx, PlayState* play2) {
|
||||
if (sLinkAge == LINK_AGE_CHILD) {
|
||||
if ((HIGH_SCORE(HS_FISHING) & HS_FISH_LENGTH_CHILD) != 0) {
|
||||
sFishingRecordLength = HIGH_SCORE(HS_FISHING) & HS_FISH_LENGTH_CHILD;
|
||||
} else if (CVarGetInteger(CVAR_ENHANCEMENT("CustomizeFishing"), 0)) {
|
||||
sFishingRecordLength = Fishing_GetMinimumRequiredScore();
|
||||
} else {
|
||||
sFishingRecordLength = 40.0f; // 6 lbs
|
||||
}
|
||||
} else {
|
||||
if ((HIGH_SCORE(HS_FISHING) & HS_FISH_LENGTH_ADULT) != 0) {
|
||||
sFishingRecordLength = (HIGH_SCORE(HS_FISHING) & HS_FISH_LENGTH_ADULT) >> 0x18;
|
||||
} else if (CVarGetInteger(CVAR_ENHANCEMENT("CustomizeFishing"), 0)) {
|
||||
sFishingRecordLength = Fishing_GetMinimumRequiredScore();
|
||||
} else {
|
||||
sFishingRecordLength = 45.0f; // 7 lbs
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user