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

@@ -81,6 +81,7 @@ class MultiWorld():
random: random.Random
per_slot_randoms: Dict[int, random.Random]
"""Deprecated. Please use `self.random` instead."""
class AttributeProxy():
def __init__(self, rule):
@@ -242,6 +243,7 @@ class MultiWorld():
setattr(self, option_key, getattr(args, option_key, {}))
self.worlds[player] = world_type(self, player)
self.worlds[player].random = self.per_slot_randoms[player]
def set_item_links(self):
item_links = {}