Some Shop fixes:

Make sure that dark lake hylia shop in inverted retains the blue potion, while allowing shop slots on top (potion will always be the leftmost slot, ignoring "i"/"f"/"g")
Cull Shop swap Candidates before generating weights, then keep track of updated sphere sizes during swaps. This significantly reduces the chance to run out of candidates, as large clumps of false candidates do not get included in the weight
Shop fill is slower with this, as all candidates need to be swept once, instead of on-demand; but this seemed the best way to address the remaining issues.
This commit is contained in:
Fabian Dill
2021-02-03 14:24:29 +01:00
parent 5503547663
commit e4d4ff667c
2 changed files with 53 additions and 25 deletions

View File

@@ -450,7 +450,7 @@ class World(object):
def get_spheres(self):
state = CollectionState(self)
locations = {location for location in self.get_locations()}
locations = set(self.get_locations())
while locations:
sphere = set()
@@ -1138,6 +1138,11 @@ class Item(object):
def __eq__(self, other):
return self.name == other.name and self.player == other.player
def __lt__(self, other):
if other.player != self.player:
return other.player < self.player
return self.name < other.name
def __hash__(self):
return hash((self.name, self.player))