mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-19 21:03:42 -07:00
Fix Link's Pocket Appearing in Hints. (#4191)
* Fix issues with areas not being applied to the region itself, and Link's Pocket Propogating through randomised warps * Address reviews * address reviews again * fix mac issues * git pls
This commit is contained in:
parent
baf7691fbd
commit
510b655e5e
3 changed files with 17 additions and 12 deletions
|
@ -485,18 +485,19 @@ static void GeneratePlaythrough() {
|
||||||
GetAccessibleLocations(ctx->allLocations, SearchMode::GeneratePlaythrough);
|
GetAccessibleLocations(ctx->allLocations, SearchMode::GeneratePlaythrough);
|
||||||
}
|
}
|
||||||
|
|
||||||
RandomizerArea LookForExternalArea(Area* curRegion, std::vector<RandomizerRegion> alreadyChecked){//RANDOTODO curREGION
|
RandomizerArea LookForExternalArea(const Area* const currentRegion, std::vector<RandomizerRegion> &alreadyChecked){
|
||||||
for (auto& entrance : curRegion->entrances) {
|
for (const auto& entrance : currentRegion->entrances) {
|
||||||
RandomizerArea otherArea = entrance->GetParentRegion()->GetArea();
|
RandomizerArea otherArea = entrance->GetParentRegion()->GetArea();
|
||||||
if(otherArea != RA_NONE){
|
const bool isAreaUnchecked = std::find(alreadyChecked.begin(), alreadyChecked.end(), entrance->GetParentRegionKey()) == alreadyChecked.end();
|
||||||
return otherArea;
|
if (otherArea == RA_NONE && isAreaUnchecked) {
|
||||||
//if the area hasn't already been checked, check it
|
//if the region is in RA_NONE and hasn't already been checked, check it
|
||||||
} else if (std::find(alreadyChecked.begin(), alreadyChecked.end(), entrance->GetParentRegionKey()) == alreadyChecked.end()) {
|
|
||||||
alreadyChecked.push_back(entrance->GetParentRegionKey());
|
alreadyChecked.push_back(entrance->GetParentRegionKey());
|
||||||
RandomizerArea passdown = LookForExternalArea(entrance->GetParentRegion(), alreadyChecked);
|
const RandomizerArea passdown = LookForExternalArea(entrance->GetParentRegion(), alreadyChecked);
|
||||||
if(passdown != RA_NONE){
|
if(passdown != RA_NONE){
|
||||||
return passdown;
|
return passdown;
|
||||||
}
|
}
|
||||||
|
} else if (otherArea != RA_LINKS_POCKET){ //if it's links pocket, do not propogate this, Link's Pocket is not a real Area
|
||||||
|
return otherArea;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return RA_NONE;
|
return RA_NONE;
|
||||||
|
@ -505,16 +506,17 @@ RandomizerArea LookForExternalArea(Area* curRegion, std::vector<RandomizerRegion
|
||||||
void SetAreas(){
|
void SetAreas(){
|
||||||
auto ctx = Rando::Context::GetInstance();
|
auto ctx = Rando::Context::GetInstance();
|
||||||
//RANDOTODO give entrances an enum like RandomizerCheck, the give them all areas here, the use those areas to not need to recursivly find ItemLocation areas
|
//RANDOTODO give entrances an enum like RandomizerCheck, the give them all areas here, the use those areas to not need to recursivly find ItemLocation areas
|
||||||
for (int c = 0; c < RR_MARKER_AREAS_END; c++) {
|
for (int regionType = 0; regionType < RR_MARKER_AREAS_END; regionType++) {
|
||||||
Area region = areaTable[c];
|
Area region = areaTable[regionType];
|
||||||
RandomizerArea area = region.GetArea();
|
RandomizerArea area = region.GetArea();
|
||||||
if (area == RA_NONE) {
|
if (area == RA_NONE) {
|
||||||
std::vector<RandomizerRegion> alreadyChecked = {(RandomizerRegion)c};
|
std::vector<RandomizerRegion> alreadyChecked = {static_cast<RandomizerRegion>(regionType)};
|
||||||
area = LookForExternalArea(®ion, alreadyChecked);
|
area = LookForExternalArea(®ion, alreadyChecked);
|
||||||
}
|
}
|
||||||
for (auto& loc : region.locations){
|
for (auto& loc : region.locations){
|
||||||
ctx->GetItemLocation(loc.GetLocation())->SetArea(area);
|
ctx->GetItemLocation(loc.GetLocation())->SetArea(area);
|
||||||
}
|
}
|
||||||
|
areaTable[regionType].SetArea(area);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -496,7 +496,7 @@ void CreateWarpSongTexts() {
|
||||||
if (ctx->GetOption(RSK_WARP_SONG_HINTS)){
|
if (ctx->GetOption(RSK_WARP_SONG_HINTS)){
|
||||||
auto warpSongEntrances = GetShuffleableEntrances(EntranceType::WarpSong, false);
|
auto warpSongEntrances = GetShuffleableEntrances(EntranceType::WarpSong, false);
|
||||||
for (auto entrance : warpSongEntrances) {
|
for (auto entrance : warpSongEntrances) {
|
||||||
auto destination = entrance->GetConnectedRegion()->GetArea();//KNOWN ISSUE: says links pocket sometimes, putting off as this will need rewriting when entrance hits are added anyway
|
const auto destination = entrance->GetConnectedRegion()->GetArea();
|
||||||
switch (entrance->GetIndex()) {
|
switch (entrance->GetIndex()) {
|
||||||
case 0x0600: // minuet RANDOTODO make into entrance hints when they are added
|
case 0x0600: // minuet RANDOTODO make into entrance hints when they are added
|
||||||
ctx->AddHint(RH_MINUET_WARP_LOC, Hint(RH_MINUET_WARP_LOC, HINT_TYPE_AREA, "", {RHT_WARP_SONG}, {}, {destination}));
|
ctx->AddHint(RH_MINUET_WARP_LOC, Hint(RH_MINUET_WARP_LOC, HINT_TYPE_AREA, "", {RHT_WARP_SONG}, {}, {destination}));
|
||||||
|
|
|
@ -186,6 +186,10 @@ public:
|
||||||
return area;
|
return area;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetArea(RandomizerArea newArea) {
|
||||||
|
area = newArea;
|
||||||
|
}
|
||||||
|
|
||||||
//Here checks conditional access based on whether or not both ages have
|
//Here checks conditional access based on whether or not both ages have
|
||||||
//access to this area. For example: if there are rocks that block a path
|
//access to this area. For example: if there are rocks that block a path
|
||||||
//which both child and adult can access, adult having hammer can give
|
//which both child and adult can access, adult having hammer can give
|
||||||
|
@ -222,7 +226,6 @@ public:
|
||||||
"Child Night: " + std::to_string(childNight) + "\t"
|
"Child Night: " + std::to_string(childNight) + "\t"
|
||||||
"Adult Day: " + std::to_string(adultDay) + "\t"
|
"Adult Day: " + std::to_string(adultDay) + "\t"
|
||||||
"Adult Night: " + std::to_string(adultNight);
|
"Adult Night: " + std::to_string(adultNight);
|
||||||
//CitraPrint(message);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue