From 2e4f5a64b3b40cbfb75b5af34cc4db32004ade09 Mon Sep 17 00:00:00 2001 From: Scipio Wright Date: Thu, 16 Jan 2025 21:13:37 -0500 Subject: [PATCH] TUNIC: Make the local_fill option load in a specific number of locations (#4488) * Make it load in a specific number of locations * TunicLocation -> Location * Actually shuffle the list --- worlds/tunic/__init__.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/worlds/tunic/__init__.py b/worlds/tunic/__init__.py index 09279dd1..388a4411 100644 --- a/worlds/tunic/__init__.py +++ b/worlds/tunic/__init__.py @@ -95,7 +95,7 @@ class TunicWorld(World): # for the local_fill option fill_items: List[TunicItem] - fill_locations: List[TunicLocation] + fill_locations: List[Location] amount_to_local_fill: int # so we only loop the multiworld locations once @@ -394,8 +394,6 @@ class TunicWorld(World): self.multiworld.itempool += tunic_items def pre_fill(self) -> None: - self.fill_locations = [] - if self.options.local_fill > 0 and self.multiworld.players > 1: # we need to reserve a couple locations so that we don't fill up every sphere 1 location reserved_locations: Set[str] = set(self.random.sample(sphere_one, 2)) @@ -406,8 +404,8 @@ class TunicWorld(World): if len(viable_locations) < self.amount_to_local_fill: raise OptionError(f"TUNIC: Not enough locations for local_fill option for {self.player_name}. " f"This is likely due to excess plando or priority locations.") - - self.fill_locations += viable_locations + self.random.shuffle(viable_locations) + self.fill_locations = viable_locations[:self.amount_to_local_fill] @classmethod def stage_pre_fill(cls, multiworld: MultiWorld) -> None: