Make visible_sending part of AutoWorld.
This commit is contained in:
parent
eb602aedc3
commit
f8deb1bd7f
5
Main.py
5
Main.py
|
@ -252,12 +252,11 @@ def main(args, seed=None):
|
||||||
precollected_hints = {player: set() for player in range(1, world.players + 1)}
|
precollected_hints = {player: set() for player in range(1, world.players + 1)}
|
||||||
# for now special case Factorio tech_tree_information
|
# for now special case Factorio tech_tree_information
|
||||||
sending_visible_players = set()
|
sending_visible_players = set()
|
||||||
for player in world.get_game_players("Factorio"):
|
|
||||||
if world.tech_tree_information[player].value == 2:
|
|
||||||
sending_visible_players.add(player)
|
|
||||||
|
|
||||||
for slot in world.player_ids:
|
for slot in world.player_ids:
|
||||||
slot_data[slot] = world.worlds[slot].fill_slot_data()
|
slot_data[slot] = world.worlds[slot].fill_slot_data()
|
||||||
|
if world.worlds[slot].sending_visible:
|
||||||
|
sending_visible_players.add(slot)
|
||||||
|
|
||||||
def precollect_hint(location):
|
def precollect_hint(location):
|
||||||
hint = NetUtils.Hint(location.item.player, location.player, location.address,
|
hint = NetUtils.Hint(location.item.player, location.player, location.address,
|
||||||
|
|
|
@ -114,6 +114,9 @@ class World(metaclass=AutoWorldRegister):
|
||||||
item_names: Set[str] # set of all potential item names
|
item_names: Set[str] # set of all potential item names
|
||||||
location_names: Set[str] # set of all potential location names
|
location_names: Set[str] # set of all potential location names
|
||||||
|
|
||||||
|
# If there is visibility in what is being sent, this is where it will be known.
|
||||||
|
sending_visible: bool = False
|
||||||
|
|
||||||
def __init__(self, world: MultiWorld, player: int):
|
def __init__(self, world: MultiWorld, player: int):
|
||||||
self.world = world
|
self.world = world
|
||||||
self.player = player
|
self.player = player
|
||||||
|
|
|
@ -66,6 +66,9 @@ class Factorio(World):
|
||||||
if map_basic_settings.get("seed", None) is None: # allow seed 0
|
if map_basic_settings.get("seed", None) is None: # allow seed 0
|
||||||
map_basic_settings["seed"] = self.world.slot_seeds[player].randint(0, 2 ** 32 - 1) # 32 bit uint
|
map_basic_settings["seed"] = self.world.slot_seeds[player].randint(0, 2 ** 32 - 1) # 32 bit uint
|
||||||
|
|
||||||
|
self.sending_visible = self.world.tech_tree_information[player] == Options.TechTreeInformation.option_full
|
||||||
|
|
||||||
|
|
||||||
generate_output = generate_mod
|
generate_output = generate_mod
|
||||||
|
|
||||||
def create_regions(self):
|
def create_regions(self):
|
||||||
|
|
Loading…
Reference in New Issue