Setup: flip apworld list (#1882)

* Setup: flip apworld list

* Update setup.py

Co-authored-by: kindasneaki <ryandj67@hotmail.com>

* Update setup.py

Co-authored-by: Scipio Wright <scipiowright@gmail.com>

* setup: make TLoZ an apworld

This reverts commit fd026c5eb2fb667d239d61c7a2bcfc1586fd4e2b.

---------

Co-authored-by: kindasneaki <ryandj67@hotmail.com>
Co-authored-by: Scipio Wright <scipiowright@gmail.com>
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
This commit is contained in:
Fabian Dill 2023-06-25 03:47:38 +02:00 committed by GitHub
parent a45e8730cb
commit aa8ffa247d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 28 deletions

View File

@ -60,20 +60,35 @@ from Utils import version_tuple, is_windows, is_linux
# On Python < 3.10 LogicMixin is not currently supported. # On Python < 3.10 LogicMixin is not currently supported.
apworlds: set = { non_apworlds: set = {
"Subnautica", "A Link to the Past",
"Factorio", "Adventure",
"Rogue Legacy", "ArchipIDLE",
"Sonic Adventure 2 Battle", "Archipelago",
"Donkey Kong Country 3", "Blasphemous",
"Super Mario World", "ChecksFinder",
"Stardew Valley", "Clique",
"Timespinner", "DLCQuest",
"Minecraft", "Dark Souls III",
"The Messenger", "Final Fantasy",
"Links Awakening DX", "Hollow Knight",
"Super Metroid", "Hylics 2",
"SMZ3", "Kingdom Hearts 2",
"Lufia II Ancient Cave",
"Meritous",
"Ocarina of Time",
"Overcooked! 2",
"Pokemon Red and Blue",
"Raft",
"Secret of Evermore",
"Slay the Spire",
"Starcraft 2 Wings of Liberty",
"Sudoku",
"Super Mario 64",
"The Witness",
"VVVVVV",
"Wargroove",
"Zillion",
} }
@ -322,11 +337,12 @@ class BuildExeCommand(cx_Freeze.command.build_exe.BuildEXE):
os.makedirs(self.buildfolder / "Players" / "Templates", exist_ok=True) os.makedirs(self.buildfolder / "Players" / "Templates", exist_ok=True)
from Options import generate_yaml_templates from Options import generate_yaml_templates
from worlds.AutoWorld import AutoWorldRegister from worlds.AutoWorld import AutoWorldRegister
assert not apworlds - set(AutoWorldRegister.world_types), "Unknown world designated for .apworld" assert not non_apworlds - set(AutoWorldRegister.world_types), \
f"Unknown world {non_apworlds - set(AutoWorldRegister.world_types)} designated for .apworld"
folders_to_remove: typing.List[str] = [] folders_to_remove: typing.List[str] = []
generate_yaml_templates(self.buildfolder / "Players" / "Templates", False) generate_yaml_templates(self.buildfolder / "Players" / "Templates", False)
for worldname, worldtype in AutoWorldRegister.world_types.items(): for worldname, worldtype in AutoWorldRegister.world_types.items():
if worldname in apworlds: if worldname not in non_apworlds:
file_name = os.path.split(os.path.dirname(worldtype.__file__))[1] file_name = os.path.split(os.path.dirname(worldtype.__file__))[1]
world_directory = self.libfolder / "worlds" / file_name world_directory = self.libfolder / "worlds" / file_name
# this method creates an apworld that cannot be moved to a different OS or minor python version, # this method creates an apworld that cannot be moved to a different OS or minor python version,

View File

@ -17,8 +17,8 @@ from .ExtractedData import locations, starts, multi_locations, location_to_regio
event_names, item_effects, connectors, one_ways, vanilla_shop_costs, vanilla_location_costs event_names, item_effects, connectors, one_ways, vanilla_shop_costs, vanilla_location_costs
from .Charms import names as charm_names from .Charms import names as charm_names
from BaseClasses import Region, Entrance, Location, MultiWorld, Item, LocationProgressType, Tutorial, ItemClassification from BaseClasses import Region, Location, MultiWorld, Item, LocationProgressType, Tutorial, ItemClassification
from ..AutoWorld import World, LogicMixin, WebWorld from worlds.AutoWorld import World, LogicMixin, WebWorld
path_of_pain_locations = { path_of_pain_locations = {
"Soul_Totem-Path_of_Pain_Below_Thornskip", "Soul_Totem-Path_of_Pain_Below_Thornskip",

View File

@ -1,10 +1,16 @@
from typing import Set
from .RulesData import location_rules from .RulesData import location_rules
from ..generic.Rules import set_rule from worlds.generic.Rules import set_rule
from BaseClasses import Location from BaseClasses import Location, CollectionState
# TODO: implement Mapstone counting, Open, OpenWorld, connection rules # TODO: implement Mapstone counting, Open, OpenWorld, connection rules
def oribf_has_all(state: CollectionState, items: Set[str], player:int) -> bool:
return all(state.prog_items[item, player] if type(item) == str
else state.prog_items[item[0], player] >= item[1] for item in items)
def set_rules(world): def set_rules(world):
temp_base_rule(world.multiworld, world.player) temp_base_rule(world.multiworld, world.player)
for logicset in world.logic_sets: for logicset in world.logic_sets:
@ -22,7 +28,7 @@ def add_or_rule_check_first(world, location: str, player: int, conditionsets):
location.access_rule = tautology location.access_rule = tautology
return return
rule = lambda state, conditionsets=conditionsets: any( rule = lambda state, conditionsets=conditionsets: any(
state._oribf_has_all(conditionset, player) for conditionset in conditionsets) oribf_has_all(state, conditionset, player) for conditionset in conditionsets)
if location.access_rule is Location.access_rule: if location.access_rule is Location.access_rule:
location.access_rule = rule location.access_rule = rule
else: else:
@ -31,7 +37,7 @@ def add_or_rule_check_first(world, location: str, player: int, conditionsets):
def temp_base_rule(world, player): def temp_base_rule(world, player):
world.completion_condition[player] = lambda state: state._oribf_has_all( world.completion_condition[player] = lambda state: oribf_has_all(state,
{"Bash", "ChargeFlame", "ChargeJump", "Climb", "Dash", "DoubleJump", "Glide", "Grenade", "Stomp", "WallJump"}, {"Bash", "ChargeFlame", "ChargeJump", "Climb", "Dash", "DoubleJump", "Glide", "Grenade", "Stomp", "WallJump"},
player) player)

View File

@ -69,9 +69,3 @@ class OriBlindForest(World):
return Item(name, return Item(name,
ItemClassification.progression if not name.startswith("EX") else ItemClassification.filler, ItemClassification.progression if not name.startswith("EX") else ItemClassification.filler,
item_table[name], self.player) item_table[name], self.player)
class OriBlindForestLogic(LogicMixin):
def _oribf_has_all(self, items: Set[str], player:int):
return all(self.prog_items[item, player] if type(item) == str
else self.prog_items[item[0], player] >= item[1] for item in items)