Split progression item randomization into separate function
@@ -314,6 +314,21 @@ class Randomizer:
def randomize_items(self):
print("Randomizing items...")
+ self.randomize_progression_items()
+
+ # Place unique non-progress items.
+ while self.logic.unplaced_nonprogress_items:
+ item_name = random.choice(self.logic.unplaced_nonprogress_items)
+ location_name = random.choice(self.logic.remaining_item_locations)
+ self.logic.set_location_to_item(location_name, item_name)
+
+ # Fill remaining unused locations with consumables (Rupees and Spoils).
+ locations_to_place_consumables_at = list(self.logic.remaining_item_locations)
+ for location_name in locations_to_place_consumables_at:
+ item_name = random.choice(self.logic.consumable_items)
+ self.logic.set_location_to_item(location_name, item_name)
+
+ def randomize_progression_items(self):
if True:
# Don't randomize dungeon keys.
for location_name, item_location in self.logic.item_locations.items():
@@ -352,18 +367,6 @@ class Randomizer:
unrandomized_item_name = self.logic.item_locations[location_name]["Original item"]
self.logic.set_location_to_item(location_name, unrandomized_item_name)
- # Place unique non-progress items.
- while self.logic.unplaced_nonprogress_items:
- item_name = random.choice(self.logic.unplaced_nonprogress_items)
- location_name = random.choice(self.logic.remaining_item_locations)
- self.logic.set_location_to_item(location_name, item_name)
-
- # Fill remaining unused locations with consumables (Rupees and Spoils).
- locations_to_place_consumables_at = list(self.logic.remaining_item_locations)
- for location_name in locations_to_place_consumables_at:
- item_name = random.choice(self.logic.consumable_items)
- self.logic.set_location_to_item(location_name, item_name)
-
def write_changed_items(self):
for location_name, item_name in self.logic.done_item_locations.items():
paths = self.logic.item_locations[location_name]["Paths"]
