SoE: data_version bump, disable topology, clean up
This commit is contained in:
parent
449f4ee92f
commit
c32f3d6e96
|
@ -1,3 +1,3 @@
|
||||||
dumpy.py
|
dump.py
|
||||||
pyevermizer
|
pyevermizer
|
||||||
.pyevermizer
|
.pyevermizer
|
||||||
|
|
|
@ -93,15 +93,14 @@ class SoEWorld(World):
|
||||||
"""
|
"""
|
||||||
game: str = "Secret of Evermore"
|
game: str = "Secret of Evermore"
|
||||||
options = soe_options
|
options = soe_options
|
||||||
topology_present: bool = True
|
topology_present: bool = False
|
||||||
remote_items: bool = False # True only for testing
|
remote_items: bool = False
|
||||||
data_version = 0
|
data_version = 1
|
||||||
|
|
||||||
item_name_to_id, item_id_to_raw = _get_item_mapping()
|
item_name_to_id, item_id_to_raw = _get_item_mapping()
|
||||||
location_name_to_id, location_id_to_raw = _get_location_mapping()
|
location_name_to_id, location_id_to_raw = _get_location_mapping()
|
||||||
|
|
||||||
evermizer_seed: int
|
evermizer_seed: int
|
||||||
restrict_item_placement: bool = False # placeholder to force certain item types to certain pools
|
|
||||||
connect_name: str
|
connect_name: str
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
@ -136,8 +135,7 @@ class SoEWorld(World):
|
||||||
if type(self.world.precollected_items) is dict:
|
if type(self.world.precollected_items) is dict:
|
||||||
self.world.precollected_items[self.player] = []
|
self.world.precollected_items[self.player] = []
|
||||||
# add items to the pool
|
# add items to the pool
|
||||||
self.world.itempool += [item for item in
|
self.world.itempool += list(map(lambda item: self.create_item(item), _items))
|
||||||
map(lambda item: self.create_item(item, self.restrict_item_placement), _items)]
|
|
||||||
|
|
||||||
def set_rules(self):
|
def set_rules(self):
|
||||||
self.world.completion_condition[self.player] = lambda state: state.has('Victory', self.player)
|
self.world.completion_condition[self.player] = lambda state: state.has('Victory', self.player)
|
||||||
|
@ -148,9 +146,6 @@ class SoEWorld(World):
|
||||||
for loc in _locations:
|
for loc in _locations:
|
||||||
location = self.world.get_location(loc.name, self.player)
|
location = self.world.get_location(loc.name, self.player)
|
||||||
set_rule(location, self.make_rule(loc.requires))
|
set_rule(location, self.make_rule(loc.requires))
|
||||||
# limit location pool by item type
|
|
||||||
if self.restrict_item_placement:
|
|
||||||
add_item_rule(location, self.make_item_type_limit_rule(loc.type))
|
|
||||||
|
|
||||||
def make_rule(self, requires: typing.List[typing.Tuple[int]]) -> typing.Callable[[typing.Any], bool]:
|
def make_rule(self, requires: typing.List[typing.Tuple[int]]) -> typing.Callable[[typing.Any], bool]:
|
||||||
def rule(state) -> bool:
|
def rule(state) -> bool:
|
||||||
|
@ -170,14 +165,6 @@ class SoEWorld(World):
|
||||||
# generate stuff for later
|
# generate stuff for later
|
||||||
self.evermizer_seed = self.world.random.randint(0, 2**16-1) # TODO: make this an option for "full" plando?
|
self.evermizer_seed = self.world.random.randint(0, 2**16-1) # TODO: make this an option for "full" plando?
|
||||||
|
|
||||||
def post_fill(self):
|
|
||||||
# fix up the advancement property of items so they are displayed correctly in other games
|
|
||||||
if self.restrict_item_placement:
|
|
||||||
for location in self.world.get_locations():
|
|
||||||
item = location.item
|
|
||||||
if item.code and item.player == self.player and not self.item_id_to_raw[location.item.code].progression:
|
|
||||||
item.advancement = False
|
|
||||||
|
|
||||||
def generate_output(self, output_directory: str):
|
def generate_output(self, output_directory: str):
|
||||||
player_name = self.world.get_player_name(self.player)
|
player_name = self.world.get_player_name(self.player)
|
||||||
self.connect_name = player_name[:32]
|
self.connect_name = player_name[:32]
|
||||||
|
|
Loading…
Reference in New Issue