mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-07-16 10:02:59 -07:00
Fix Dungeon Type Spoiling (#4719)
* Make new `SpoilAreaFromCheck` function to spoil areas when getting maps or a first check in a dungeon that isn't spoiled by entrance. * Add scummed check dungeon spoiling on load.
This commit is contained in:
parent
fd8bd31507
commit
0afffe24fe
3 changed files with 31 additions and 1 deletions
|
@ -259,6 +259,33 @@ void RecalculateAreaTotals(RandomizerCheckArea rcArea) {
|
|||
CalculateTotals();
|
||||
}
|
||||
|
||||
std::map<RandomizerGet, RandomizerCheckArea> MapRGtoRandomizerCheckArea = {
|
||||
{ RG_DEKU_TREE_MAP, RCAREA_DEKU_TREE},
|
||||
{ RG_DODONGOS_CAVERN_MAP, RCAREA_DODONGOS_CAVERN },
|
||||
{ RG_JABU_JABUS_BELLY_MAP, RCAREA_JABU_JABUS_BELLY },
|
||||
{ RG_FOREST_TEMPLE_MAP, RCAREA_FOREST_TEMPLE },
|
||||
{ RG_FIRE_TEMPLE_MAP, RCAREA_FIRE_TEMPLE },
|
||||
{ RG_WATER_TEMPLE_MAP, RCAREA_WATER_TEMPLE },
|
||||
{ RG_SPIRIT_TEMPLE_MAP, RCAREA_SPIRIT_TEMPLE },
|
||||
{ RG_SHADOW_TEMPLE_MAP, RCAREA_SHADOW_TEMPLE },
|
||||
{ RG_BOTTOM_OF_THE_WELL_MAP, RCAREA_BOTTOM_OF_THE_WELL },
|
||||
{ RG_ICE_CAVERN_MAP, RCAREA_ICE_CAVERN }
|
||||
};
|
||||
|
||||
void SpoilAreaFromCheck(RandomizerCheck rc) {
|
||||
Rando::Location* loc = Rando::StaticData::GetLocation(rc);
|
||||
Rando::ItemLocation* itemLoc = Rando::Context::GetInstance()->GetItemLocation(rc);
|
||||
if (itemLoc->GetPlacedItem().GetItemType() == ItemType::ITEMTYPE_MAP) {
|
||||
RandomizerCheckArea area = MapRGtoRandomizerCheckArea[itemLoc->GetPlacedRandomizerGet()];
|
||||
if (!IsAreaSpoiled(area)) {
|
||||
SetAreaSpoiled(area);
|
||||
}
|
||||
}
|
||||
if (!IsAreaSpoiled(loc->GetArea())) {
|
||||
SetAreaSpoiled(loc->GetArea());
|
||||
}
|
||||
}
|
||||
|
||||
void RecalculateAllAreaTotals() {
|
||||
for (auto& [rcArea, checks] : checksByArea) {
|
||||
if (rcArea == RCAREA_INVALID) {
|
||||
|
@ -437,7 +464,8 @@ void CheckTrackerLoadGame(int32_t fileNum) {
|
|||
}
|
||||
}
|
||||
|
||||
if (areaChecksGotten[entry2->GetArea()] != 0 || RandomizerCheckObjects::AreaIsOverworld(entry2->GetArea())) {
|
||||
if (areaChecksGotten[entry2->GetArea()] != 0 || RandomizerCheckObjects::AreaIsOverworld(entry2->GetArea()) ||
|
||||
loc->GetCheckStatus() == RCSHOW_SCUMMED) {
|
||||
areasSpoiled |= (1 << entry2->GetArea());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue