Core: Attribute per slot random directly to the World and discourage using MultiWorld's random (#1649)

* add a random object to the World

* use it in The Messenger

* the worlds don't exist until the end of set options

* set seed in lttp tests

* use world.random for shop shuffle
This commit is contained in:
Aaron Wagener
2023-07-02 05:50:14 -05:00
committed by GitHub
parent 6a88d5aa79
commit a6ba185c55
12 changed files with 17 additions and 5 deletions

View File

@@ -102,7 +102,7 @@ class MessengerWorld(World):
# make a list of all notes except those in the player's defined starting inventory, and adjust the
# amount we need to put in the itempool and precollect based on that
notes = [note for note in NOTES if note not in self.multiworld.precollected_items[self.player]]
self.multiworld.per_slot_randoms[self.player].shuffle(notes)
self.random.shuffle(notes)
precollected_notes_amount = NotesNeeded.range_end - \
self.multiworld.notes_needed[self.player] - \
(len(NOTES) - len(notes))
@@ -129,7 +129,7 @@ class MessengerWorld(World):
filler_pool = dict(list(FILLER.items())[2:]) if remaining_fill < 10 else FILLER
itempool += [self.create_item(filler_item)
for filler_item in
self.multiworld.random.choices(
self.random.choices(
list(filler_pool),
weights=list(filler_pool.values()),
k=remaining_fill