AutoWorld: remove Games Enum (AutoWorldRegister.world_types replaces it)
This commit is contained in:
parent
31c550d410
commit
b53d6c370b
|
@ -1128,6 +1128,11 @@ class Location():
|
||||||
def __lt__(self, other):
|
def __lt__(self, other):
|
||||||
return (self.player, self.name) < (other.player, other.name)
|
return (self.player, self.name) < (other.player, other.name)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def native_item(self) -> bool:
|
||||||
|
"""Returns True if the item in this location matches game."""
|
||||||
|
return self.item and self.item.game == self.game
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def hint_text(self):
|
def hint_text(self):
|
||||||
return getattr(self, "_hint_text", self.name.replace("_", " ").replace("-", " "))
|
return getattr(self, "_hint_text", self.name.replace("_", " ").replace("-", " "))
|
||||||
|
|
4
Main.py
4
Main.py
|
@ -22,7 +22,7 @@ from worlds.alttp.Shops import create_shops, ShopSlotFill, SHOP_ID_START, total_
|
||||||
from worlds.alttp.ItemPool import generate_itempool, difficulties, fill_prizes
|
from worlds.alttp.ItemPool import generate_itempool, difficulties, fill_prizes
|
||||||
from Utils import output_path, parse_player_names, get_options, __version__, version_tuple
|
from Utils import output_path, parse_player_names, get_options, __version__, version_tuple
|
||||||
from worlds.generic.Rules import locality_rules
|
from worlds.generic.Rules import locality_rules
|
||||||
from worlds import Games, lookup_any_item_name_to_id, AutoWorld
|
from worlds import lookup_any_item_name_to_id, AutoWorld
|
||||||
import Patch
|
import Patch
|
||||||
|
|
||||||
seeddigits = 20
|
seeddigits = 20
|
||||||
|
@ -435,7 +435,7 @@ def main(args, seed=None):
|
||||||
|
|
||||||
for location in [loc for loc in world.get_filled_locations() if type(loc.address) is int]:
|
for location in [loc for loc in world.get_filled_locations() if type(loc.address) is int]:
|
||||||
main_entrance = get_entrance_to_region(location.parent_region)
|
main_entrance = get_entrance_to_region(location.parent_region)
|
||||||
if location.game != Games.LTTP:
|
if location.game != "A Link to the Past":
|
||||||
checks_in_area[location.player]["Light World"].append(location.address)
|
checks_in_area[location.player]["Light World"].append(location.address)
|
||||||
elif location.parent_region.dungeon:
|
elif location.parent_region.dungeon:
|
||||||
dungeonname = {'Inverted Agahnims Tower': 'Agahnims Tower',
|
dungeonname = {'Inverted Agahnims Tower': 'Agahnims Tower',
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
import enum
|
|
||||||
import importlib
|
import importlib
|
||||||
import os
|
import os
|
||||||
|
|
||||||
__all__ = {"lookup_any_item_id_to_name",
|
__all__ = {"lookup_any_item_id_to_name",
|
||||||
"lookup_any_location_id_to_name",
|
"lookup_any_location_id_to_name",
|
||||||
"network_data_package",
|
"network_data_package"}
|
||||||
"Games"}
|
|
||||||
|
|
||||||
# all of the below should be moved to AutoWorld functionality
|
# all of the below should be moved to AutoWorld functionality
|
||||||
from .alttp.Items import lookup_id_to_name as alttp
|
from .alttp.Items import lookup_id_to_name as alttp
|
||||||
|
@ -34,18 +32,9 @@ network_data_package = {"lookup_any_location_id_to_name": lookup_any_location_id
|
||||||
"lookup_any_item_id_to_name": lookup_any_item_id_to_name,
|
"lookup_any_item_id_to_name": lookup_any_item_id_to_name,
|
||||||
"version": 9}
|
"version": 9}
|
||||||
|
|
||||||
|
|
||||||
@enum.unique
|
|
||||||
class Games(str, enum.Enum):
|
|
||||||
HK = "Hollow Knight"
|
|
||||||
LTTP = "A Link to the Past"
|
|
||||||
Factorio = "Factorio"
|
|
||||||
Minecraft = "Minecraft"
|
|
||||||
|
|
||||||
|
|
||||||
# end of TODO block
|
# end of TODO block
|
||||||
|
|
||||||
# import all submodules to trigger AutoWorldRegister
|
# import all submodules to trigger AutoWorldRegister
|
||||||
for file in os.scandir(os.path.dirname(__file__)):
|
for file in os.scandir(os.path.dirname(__file__)):
|
||||||
if file.is_dir():
|
if file.is_dir():
|
||||||
importlib.import_module(f".{file.name}", "worlds")
|
importlib.import_module(f".{file.name}", "worlds")
|
|
@ -578,14 +578,13 @@ class Sprite():
|
||||||
return name
|
return name
|
||||||
|
|
||||||
def to_ap_sprite(self, path):
|
def to_ap_sprite(self, path):
|
||||||
from .. import Games
|
|
||||||
import yaml
|
import yaml
|
||||||
payload = {"format_version": 1,
|
payload = {"format_version": 1,
|
||||||
"min_format_version": 1,
|
"min_format_version": 1,
|
||||||
"sprite_version": 1,
|
"sprite_version": 1,
|
||||||
"name": self.name,
|
"name": self.name,
|
||||||
"author": self.author_name,
|
"author": self.author_name,
|
||||||
"game": Games.LTTP.value,
|
"game": "A Link to the Past",
|
||||||
"data": self.get_delta()}
|
"data": self.get_delta()}
|
||||||
with open(path, "w") as f:
|
with open(path, "w") as f:
|
||||||
f.write(yaml.safe_dump(payload))
|
f.write(yaml.safe_dump(payload))
|
||||||
|
@ -778,7 +777,7 @@ def patch_rom(world, rom, player, team, enemized):
|
||||||
if not location.crystal:
|
if not location.crystal:
|
||||||
|
|
||||||
if location.item is not None:
|
if location.item is not None:
|
||||||
if location.item.game != "A Link to the Past":
|
if not location.native_item:
|
||||||
itemid = get_nonnative_item_sprite(location.item.game)
|
itemid = get_nonnative_item_sprite(location.item.game)
|
||||||
# Keys in their native dungeon should use the orignal item code for keys
|
# Keys in their native dungeon should use the orignal item code for keys
|
||||||
elif location.parent_region.dungeon:
|
elif location.parent_region.dungeon:
|
||||||
|
|
Loading…
Reference in New Issue