SM: remove events from data package (#973)

This commit is contained in:
lordlou
2022-08-31 00:14:17 -04:00
committed by GitHub
parent fcfc2c2e10
commit 8da1cfeeb7
4 changed files with 11 additions and 40 deletions

View File

@@ -1,14 +0,0 @@
from worlds.sm.variaRandomizer.rando.Items import ItemManager
items_start_id = 83000
def gen_special_id():
special_id_value_start = 32
while True:
yield special_id_value_start
special_id_value_start += 1
gen_run = gen_special_id()
lookup_id_to_name = dict((items_start_id + (value.Id if value.Id != None else next(gen_run)), value.Name) for key, value in ItemManager.Items.items())
lookup_name_to_id = {item_name: item_id for item_id, item_name in lookup_id_to_name.items()}

View File

@@ -1,14 +0,0 @@
from worlds.sm.variaRandomizer.graph.location import locationsDict
locations_start_id = 82000
def gen_boss_id():
boss_id_value_start = 256
while True:
yield boss_id_value_start
boss_id_value_start += 1
gen_run = gen_boss_id()
lookup_id_to_name = dict((locations_start_id + (value.Id if value.Id != None else next(gen_run)), key) for key, value in locationsDict.items())
lookup_name_to_id = {location_name: location_id for location_id, location_name in lookup_id_to_name.items()}

View File

@@ -11,8 +11,6 @@ from worlds.sm.variaRandomizer.graph.graph_utils import GraphUtils
logger = logging.getLogger("Super Metroid")
from .Locations import lookup_name_to_id as locations_lookup_name_to_id
from .Items import lookup_name_to_id as items_lookup_name_to_id
from .Regions import create_regions
from .Rules import set_rules, add_entrance_rule
from .Options import sm_options
@@ -68,6 +66,8 @@ class SMWeb(WebWorld):
["Farrak Kilhn"]
)]
locations_start_id = 82000
items_start_id = 83000
class SMWorld(World):
"""
@@ -78,12 +78,11 @@ class SMWorld(World):
game: str = "Super Metroid"
topology_present = True
data_version = 1
data_version = 2
option_definitions = sm_options
item_names: Set[str] = frozenset(items_lookup_name_to_id)
location_names: Set[str] = frozenset(locations_lookup_name_to_id)
item_name_to_id = items_lookup_name_to_id
location_name_to_id = locations_lookup_name_to_id
item_name_to_id = {value.Name: items_start_id + value.Id for key, value in ItemManager.Items.items() if value.Id != None}
location_name_to_id = {key: locations_start_id + value.Id for key, value in locationsDict.items() if value.Id != None}
web = SMWeb()
remote_items: bool = False
@@ -701,8 +700,8 @@ class SMWorld(World):
dest.Name) for src, dest in self.variaRando.randoExec.areaGraph.InterAreaTransitions if src.Boss]))
def create_locations(self, player: int):
for name, id in locations_lookup_name_to_id.items():
self.locations[name] = SMLocation(player, name, id)
for name in locationsDict:
self.locations[name] = SMLocation(player, name, self.location_name_to_id.get(name, None))
def create_region(self, world: MultiWorld, player: int, name: str, locations=None, exits=None):