probably fix glaring hint issues (#3752)

This commit is contained in:
Pepper0ni 2024-01-02 21:23:33 +00:00 committed by GitHub
parent 944a4c2e46
commit 46abda83d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 13 deletions

View File

@ -572,7 +572,7 @@ static void CalculateWotH() {
for (size_t j = 0; j < ctx->playthroughLocations[i].size(); j++) {
//If removing this item and no other item caused the game to become unbeatable, then it is strictly necessary, so add it
if (ctx->GetItemLocation(ctx->playthroughLocations[i][j])->IsHintable()
&& IsBeatableWithout(ctx->playthroughLocations[i][j], true)) {
&& !(IsBeatableWithout(ctx->playthroughLocations[i][j], true))) {
ctx->GetItemLocation(ctx->playthroughLocations[i][j])->SetWothCandidate();
}
}
@ -585,20 +585,21 @@ static void CalculateWotH() {
//Calculate barren locations and assign Barren Candidacy to all locations inside those areas
static void CalculateBarren() {
auto ctx = Rando::Context::GetInstance();
std::array<bool, RA_MAX> IsBarren = {true};
std::array<bool, RA_MAX> NotBarren = {}; //I would invert this but the "initialise all as true" syntax wasn't working
for (RandomizerCheck loc : ctx->allLocations) {
Rando::ItemLocation* itemLoc = ctx->GetItemLocation(loc);
RandomizerArea locArea = itemLoc->GetArea();
// If a location has a major item or is a way of the hero location, it is not barren
if (IsBarren[locArea] == true && locArea > RA_LINKS_POCKET && (itemLoc->GetPlacedItem().IsMajorItem() || itemLoc->IsWothCandidate())) {
IsBarren[locArea] = false;
}
Rando::ItemLocation* itemLoc = ctx->GetItemLocation(loc);
RandomizerArea locArea = itemLoc->GetArea();
bool test = (itemLoc->GetPlacedItem().IsMajorItem() || itemLoc->IsWothCandidate());
// If a location has a major item or is a way of the hero location, it is not barren
if (NotBarren[locArea] == false && locArea > RA_LINKS_POCKET && (itemLoc->GetPlacedItem().IsMajorItem() || itemLoc->IsWothCandidate())) {
NotBarren[locArea] = true;
}
}
for (RandomizerCheck loc : ctx->allLocations) {
Rando::ItemLocation* itemLoc = ctx->GetItemLocation(loc);
if (IsBarren[itemLoc->GetArea()]){
if (!NotBarren[itemLoc->GetArea()]){
itemLoc->SetBarrenCandidate();
}
}

View File

@ -1060,7 +1060,7 @@ void HintTable_Init() {
hintTable[RHT_OUTSIDE_GANONS_CASTLE] = HintText::Exclude({
// obscure text
Text{ "outside Ganon's Castle", /*french*/ "les alentours du Château&de Ganon",
Text{ "outside Ganon's Castle", /*french*/ "les alentours du Château de Ganon",
/*spanish*/ "el exterior del Castillo de Ganon" },
});

View File

@ -494,8 +494,8 @@ static std::vector<RandomizerCheck> FilterHintability(std::vector<RandomizerChec
std::function<bool(RandomizerCheck)> extraFilter = NoFilter){
auto ctx = Rando::Context::GetInstance();
return FilterFromPool(locations, [extraFilter, ctx](const RandomizerCheck loc) {
return ctx->GetItemLocation(loc)->IsHintable() && !(ctx->GetItemLocation(loc)->IsHintedAt()
&& extraFilter(loc));
return ctx->GetItemLocation(loc)->IsHintable() && !(ctx->GetItemLocation(loc)->IsHintedAt())
&& extraFilter(loc);
});
}
@ -1033,7 +1033,8 @@ void CreateStoneHints() {
// If we have Rainbow Bridge set to Greg, add a hint for where Greg is
(ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_GREG) &&
ctx->GetItemLocation(loc)->GetPlacedRandomizerGet() == RG_GREG_RUPEE)) &&
ctx->GetItemLocation(loc)->IsHintable() && !(ctx->GetItemLocation(loc)->IsHintedAt());
ctx->GetItemLocation(loc)->IsHintable() &&
!(ctx->GetOption(RSK_GREG_HINT) && (IsReachableWithout({RC_GREG_HINT}, loc, true)));
});
for (auto& hint : conditionalAlwaysHints) {