Fishsanity - Rando v3 (#3738)

* Update z_fishing documentation from decomp

* undo sCameraAt/Eye rename

* forgot to include these defines Heehee

* adding enums, settings

* adding more stuff back in

* more work

* we're literally typing words into computer

* include unordered map

maybe this fixes mac build idk

* wahoo

* hmm

* add make sure disabled flag gets popped

* poggers in the chat?

* doing some refactoring

* fixing build

* documentation, moving fishsanity instance to rando

* move FS back to context, fixing build, mod progress

since FS is needed during rando generation & provides perpetual info abt. fishsanity in the seed, seems to make more sense if it lives on the context

* moving some stuff around

* it's starting to get real in here

* ELIMINATE FISHSANITYMETA

* IT WROKS

* Update trackers, fix pond fish flagging

* ZD fish shuffle initial checkpoint

* ZD fish "working"

aside from the crashing

* wrapping up

* fix for partial pond shuffle

* remove misc. unrelated debugconsole modification

* updating GI model

* get build working

* add a todo for this

* removeoopsie

* Rework hints a bit

* update hint loc

* Use visual indicator instead of despawning caught fish

---------

Co-authored-by: jordanpg <jordanpg@users.noreply.github.com>
This commit is contained in:
Jordan Gilbreath 2024-01-14 12:02:23 -05:00 committed by GitHub
commit 4cbf3a5621
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
82 changed files with 6012 additions and 1541 deletions

View file

@ -15,6 +15,7 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "z64item.h"
#include "randomizerTypes.h"
#include "fishsanity.h"
extern "C" {
#include "variables.h"
@ -76,6 +77,10 @@ bool showLinksPocket;
bool fortressFast;
bool fortressNormal;
u8 fishsanityMode;
u8 fishsanityPondCount;
bool fishsanityAgeSplit;
// persistent during gameplay
bool initialized;
bool doAreaScroll;
@ -119,6 +124,7 @@ RandomizerCheck lastLocationChecked = RC_UNKNOWN_CHECK;
RandomizerCheckArea previousArea = RCAREA_INVALID;
RandomizerCheckArea currentArea = RCAREA_INVALID;
OSContPad* trackerButtonsPressed;
std::unordered_map<RandomizerCheck, std::string> checkNameOverrides;
void BeginFloatWindows(std::string UniqueName, bool& open, ImGuiWindowFlags flags = 0);
bool CompareChecks(RandomizerCheck, RandomizerCheck);
@ -415,6 +421,7 @@ bool HasItemBeenCollected(RandomizerCheck rc) {
case SpoilerCollectionCheckType::SPOILER_CHK_MERCHANT:
case SpoilerCollectionCheckType::SPOILER_CHK_SHOP_ITEM:
case SpoilerCollectionCheckType::SPOILER_CHK_COW:
case SpoilerCollectionCheckType::SPOILER_CHK_FISH:
case SpoilerCollectionCheckType::SPOILER_CHK_SCRUB:
case SpoilerCollectionCheckType::SPOILER_CHK_RANDOMIZER_INF:
case SpoilerCollectionCheckType::SPOILER_CHK_MASTER_SWORD:
@ -473,6 +480,14 @@ void CheckTrackerLoadGame(int32_t fileNum) {
if (areaChecksGotten[entry2->GetArea()] != 0 || RandomizerCheckObjects::AreaIsOverworld(entry2->GetArea())) {
areasSpoiled |= (1 << entry2->GetArea());
}
// Create check name overrides for child pond fish if age split is disabled
if (fishsanityMode != RO_FISHSANITY_OFF && fishsanityMode != RO_FISHSANITY_OVERWORLD && entry.GetRCType() == RCTYPE_FISH && entry.GetScene() == SCENE_FISHING_POND &&
entry.GetActorParams() != 116 && !fishsanityAgeSplit) {
if (entry.GetShortName().starts_with("Child")) {
checkNameOverrides[rc] = entry.GetShortName().substr(6);
}
}
}
if (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_LINKS_POCKET) != RO_LINKS_POCKET_NOTHING && IS_RANDO) {
s8 startingAge = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_STARTING_AGE);
@ -736,6 +751,7 @@ void CheckTrackerFlagSet(int16_t flagType, int32_t flag) {
(scCheckType == SpoilerCollectionCheckType::SPOILER_CHK_MERCHANT ||
scCheckType == SpoilerCollectionCheckType::SPOILER_CHK_SHOP_ITEM ||
scCheckType == SpoilerCollectionCheckType::SPOILER_CHK_COW ||
scCheckType == SpoilerCollectionCheckType::SPOILER_CHK_FISH ||
scCheckType == SpoilerCollectionCheckType::SPOILER_CHK_SCRUB ||
scCheckType == SpoilerCollectionCheckType::SPOILER_CHK_MASTER_SWORD ||
scCheckType == SpoilerCollectionCheckType::SPOILER_CHK_RANDOMIZER_INF)) {
@ -1161,6 +1177,10 @@ void LoadSettings() {
fortressNormal = true;
break;
}
fishsanityMode = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_FISHSANITY);
fishsanityPondCount = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_FISHSANITY_POND_COUNT);
fishsanityAgeSplit = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_FISHSANITY_AGE_SPLIT);
}
bool IsVisibleInCheckTracker(RandomizerCheck rc) {
@ -1194,6 +1214,7 @@ bool IsVisibleInCheckTracker(RandomizerCheck rc) {
(showDungeonTokens && RandomizerCheckObjects::AreaIsDungeon(loc->GetArea()))
) &&
(loc->GetRCType() != RCTYPE_COW || showCows) &&
(loc->GetRCType() != RCTYPE_FISH || OTRGlobals::Instance->gRandoContext->GetFishsanity()->GetFishLocationIncluded(loc)) &&
(loc->GetRCType() != RCTYPE_ADULT_TRADE ||
showAdultTrade ||
rc == RC_KAK_ANJU_AS_ADULT || // adult trade checks that are always shuffled
@ -1375,7 +1396,12 @@ void DrawLocation(RandomizerCheck rc) {
}
//Main Text
txt = loc->GetShortName();
if (checkNameOverrides.contains(loc->GetRandomizerCheck())) {
txt = checkNameOverrides[loc->GetRandomizerCheck()];
} else {
txt = loc->GetShortName();
}
if (lastLocationChecked == loc->GetRandomizerCheck()) {
txt = "* " + txt;
}