mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-03-10 17:43:53 -07:00
Compare commits
97 Commits
NewSoupVi-
...
NewSoupVi-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2e1c66f1d | ||
|
|
03442621f4 | ||
|
|
6803c373e5 | ||
|
|
575c338aa3 | ||
|
|
05ce29f7dc | ||
|
|
74697b679e | ||
|
|
cf6661439e | ||
|
|
6297a4efa5 | ||
|
|
8ddb49f071 | ||
|
|
90446ad175 | ||
|
|
98bb8517e1 | ||
|
|
203c8f4d89 | ||
|
|
c0ef02d6fa | ||
|
|
4620493828 | ||
|
|
75b8c7891c | ||
|
|
53bc4ffa52 | ||
|
|
91f7cf16de | ||
|
|
7c8ea34a02 | ||
|
|
a05dbac55f | ||
|
|
83521e99d9 | ||
|
|
1d19da0c76 | ||
|
|
77e3f9fbef | ||
|
|
954d728005 | ||
|
|
80daa092a7 | ||
|
|
fac72dbc20 | ||
|
|
e764da3dc6 | ||
|
|
ab0903679c | ||
|
|
67f329b96f | ||
|
|
b273852512 | ||
|
|
b77805e5ee | ||
|
|
34141f8de0 | ||
|
|
e38f5d0a61 | ||
|
|
35ed0d4e19 | ||
|
|
e5c9b8ad0c | ||
|
|
6994f863e5 | ||
|
|
9d36ad0df2 | ||
|
|
cc22161644 | ||
|
|
d030a698a6 | ||
|
|
b6e5223aa2 | ||
|
|
79843803cf | ||
|
|
5fb1ebdcfd | ||
|
|
b019485944 | ||
|
|
205ca7fa37 | ||
|
|
8949e21565 | ||
|
|
deae524e9b | ||
|
|
496f0e09af | ||
|
|
f34da74012 | ||
|
|
94e6e978f3 | ||
|
|
697f749518 | ||
|
|
2307694012 | ||
|
|
b23c120258 | ||
|
|
ea1bb8d927 | ||
|
|
e714d2e129 | ||
|
|
878d5141ce | ||
|
|
1852287c91 | ||
|
|
8756f48e46 | ||
|
|
ff680b26cc | ||
|
|
29a0b013cb | ||
|
|
e7dbfa7fcd | ||
|
|
ad5089b5a3 | ||
|
|
dc50444edd | ||
|
|
ed4ad386e8 | ||
|
|
5188375736 | ||
|
|
9c2933f803 | ||
|
|
b840c3fe1a | ||
|
|
c12d3dd6ad | ||
|
|
f7989780fa | ||
|
|
e59bec36ec | ||
|
|
48a0fb05a2 | ||
|
|
12f1ef873c | ||
|
|
d7d4565429 | ||
|
|
7039b17bf6 | ||
|
|
34e7748f23 | ||
|
|
e33a9991ef | ||
|
|
4d1507cd0e | ||
|
|
7b39b23f73 | ||
|
|
925e02dca7 | ||
|
|
e76d32e908 | ||
|
|
08a36ec223 | ||
|
|
48dc14421e | ||
|
|
948f50f35d | ||
|
|
187f9dac94 | ||
|
|
eaec41d885 | ||
|
|
1e3a4b6db5 | ||
|
|
8c86139066 | ||
|
|
c96c554dfa | ||
|
|
9b22458f44 | ||
|
|
f99ee77325 | ||
|
|
bfac100567 | ||
|
|
e7a8e195e6 | ||
|
|
4054a9f15f | ||
|
|
ca76628813 | ||
|
|
d4d0a3e945 | ||
|
|
315e0c89e2 | ||
|
|
f6735745b6 | ||
|
|
50f7a79ea7 | ||
|
|
95110c4787 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -150,7 +150,7 @@ venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
.code-workspace
|
||||
*.code-workspace
|
||||
shell.nix
|
||||
|
||||
# Spyder project settings
|
||||
|
||||
112
BaseClasses.py
112
BaseClasses.py
@@ -1,5 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import collections
|
||||
import copy
|
||||
import itertools
|
||||
import functools
|
||||
@@ -63,7 +64,6 @@ class MultiWorld():
|
||||
state: CollectionState
|
||||
|
||||
plando_options: PlandoOptions
|
||||
accessibility: Dict[int, Options.Accessibility]
|
||||
early_items: Dict[int, Dict[str, int]]
|
||||
local_early_items: Dict[int, Dict[str, int]]
|
||||
local_items: Dict[int, Options.LocalItems]
|
||||
@@ -288,6 +288,86 @@ class MultiWorld():
|
||||
group["non_local_items"] = item_link["non_local_items"]
|
||||
group["link_replacement"] = replacement_prio[item_link["link_replacement"]]
|
||||
|
||||
def link_items(self) -> None:
|
||||
"""Called to link together items in the itempool related to the registered item link groups."""
|
||||
from worlds import AutoWorld
|
||||
|
||||
for group_id, group in self.groups.items():
|
||||
def find_common_pool(players: Set[int], shared_pool: Set[str]) -> Tuple[
|
||||
Optional[Dict[int, Dict[str, int]]], Optional[Dict[str, int]]
|
||||
]:
|
||||
classifications: Dict[str, int] = collections.defaultdict(int)
|
||||
counters = {player: {name: 0 for name in shared_pool} for player in players}
|
||||
for item in self.itempool:
|
||||
if item.player in counters and item.name in shared_pool:
|
||||
counters[item.player][item.name] += 1
|
||||
classifications[item.name] |= item.classification
|
||||
|
||||
for player in players.copy():
|
||||
if all([counters[player][item] == 0 for item in shared_pool]):
|
||||
players.remove(player)
|
||||
del (counters[player])
|
||||
|
||||
if not players:
|
||||
return None, None
|
||||
|
||||
for item in shared_pool:
|
||||
count = min(counters[player][item] for player in players)
|
||||
if count:
|
||||
for player in players:
|
||||
counters[player][item] = count
|
||||
else:
|
||||
for player in players:
|
||||
del (counters[player][item])
|
||||
return counters, classifications
|
||||
|
||||
common_item_count, classifications = find_common_pool(group["players"], group["item_pool"])
|
||||
if not common_item_count:
|
||||
continue
|
||||
|
||||
new_itempool: List[Item] = []
|
||||
for item_name, item_count in next(iter(common_item_count.values())).items():
|
||||
for _ in range(item_count):
|
||||
new_item = group["world"].create_item(item_name)
|
||||
# mangle together all original classification bits
|
||||
new_item.classification |= classifications[item_name]
|
||||
new_itempool.append(new_item)
|
||||
|
||||
region = Region("Menu", group_id, self, "ItemLink")
|
||||
self.regions.append(region)
|
||||
locations = region.locations
|
||||
for item in self.itempool:
|
||||
count = common_item_count.get(item.player, {}).get(item.name, 0)
|
||||
if count:
|
||||
loc = Location(group_id, f"Item Link: {item.name} -> {self.player_name[item.player]} {count}",
|
||||
None, region)
|
||||
loc.access_rule = lambda state, item_name = item.name, group_id_ = group_id, count_ = count: \
|
||||
state.has(item_name, group_id_, count_)
|
||||
|
||||
locations.append(loc)
|
||||
loc.place_locked_item(item)
|
||||
common_item_count[item.player][item.name] -= 1
|
||||
else:
|
||||
new_itempool.append(item)
|
||||
|
||||
itemcount = len(self.itempool)
|
||||
self.itempool = new_itempool
|
||||
|
||||
while itemcount > len(self.itempool):
|
||||
items_to_add = []
|
||||
for player in group["players"]:
|
||||
if group["link_replacement"]:
|
||||
item_player = group_id
|
||||
else:
|
||||
item_player = player
|
||||
if group["replacement_items"][player]:
|
||||
items_to_add.append(AutoWorld.call_single(self, "create_item", item_player,
|
||||
group["replacement_items"][player]))
|
||||
else:
|
||||
items_to_add.append(AutoWorld.call_single(self, "create_filler", item_player))
|
||||
self.random.shuffle(items_to_add)
|
||||
self.itempool.extend(items_to_add[:itemcount - len(self.itempool)])
|
||||
|
||||
def secure(self):
|
||||
self.random = ThreadBarrierProxy(secrets.SystemRandom())
|
||||
self.is_race = True
|
||||
@@ -523,26 +603,22 @@ class MultiWorld():
|
||||
players: Dict[str, Set[int]] = {
|
||||
"minimal": set(),
|
||||
"items": set(),
|
||||
"locations": set()
|
||||
"full": set()
|
||||
}
|
||||
for player, access in self.accessibility.items():
|
||||
players[access.current_key].add(player)
|
||||
for player, world in self.worlds.items():
|
||||
players[world.options.accessibility.current_key].add(player)
|
||||
|
||||
beatable_fulfilled = False
|
||||
|
||||
def location_condition(location: Location):
|
||||
def location_condition(location: Location) -> bool:
|
||||
"""Determine if this location has to be accessible, location is already filtered by location_relevant"""
|
||||
if location.player in players["locations"] or (location.item and location.item.player not in
|
||||
players["minimal"]):
|
||||
return True
|
||||
return False
|
||||
return location.player in players["full"] or \
|
||||
(location.item and location.item.player not in players["minimal"])
|
||||
|
||||
def location_relevant(location: Location):
|
||||
def location_relevant(location: Location) -> bool:
|
||||
"""Determine if this location is relevant to sweep."""
|
||||
if location.progress_type != LocationProgressType.EXCLUDED \
|
||||
and (location.player in players["locations"] or location.advancement):
|
||||
return True
|
||||
return False
|
||||
return location.progress_type != LocationProgressType.EXCLUDED \
|
||||
and (location.player in players["full"] or location.advancement)
|
||||
|
||||
def all_done() -> bool:
|
||||
"""Check if all access rules are fulfilled"""
|
||||
@@ -680,13 +756,13 @@ class CollectionState():
|
||||
def can_reach_region(self, spot: str, player: int) -> bool:
|
||||
return self.multiworld.get_region(spot, player).can_reach(self)
|
||||
|
||||
def sweep_for_events(self, key_only: bool = False, locations: Optional[Iterable[Location]] = None) -> None:
|
||||
def sweep_for_events(self, locations: Optional[Iterable[Location]] = None) -> None:
|
||||
if locations is None:
|
||||
locations = self.multiworld.get_filled_locations()
|
||||
reachable_events = True
|
||||
# since the loop has a good chance to run more than once, only filter the events once
|
||||
locations = {location for location in locations if location.advancement and location not in self.events and
|
||||
not key_only or getattr(location.item, "locked_dungeon_item", False)}
|
||||
locations = {location for location in locations if location.advancement and location not in self.events}
|
||||
|
||||
while reachable_events:
|
||||
reachable_events = {location for location in locations if location.can_reach(self)}
|
||||
locations -= reachable_events
|
||||
@@ -1291,8 +1367,6 @@ class Spoiler:
|
||||
state = CollectionState(multiworld)
|
||||
collection_spheres = []
|
||||
while required_locations:
|
||||
state.sweep_for_events(key_only=True)
|
||||
|
||||
sphere = set(filter(state.can_reach, required_locations))
|
||||
|
||||
for location in sphere:
|
||||
|
||||
@@ -61,6 +61,7 @@ class ClientCommandProcessor(CommandProcessor):
|
||||
if address:
|
||||
self.ctx.server_address = None
|
||||
self.ctx.username = None
|
||||
self.ctx.password = None
|
||||
elif not self.ctx.server_address:
|
||||
self.output("Please specify an address.")
|
||||
return False
|
||||
@@ -514,6 +515,7 @@ class CommonContext:
|
||||
async def shutdown(self):
|
||||
self.server_address = ""
|
||||
self.username = None
|
||||
self.password = None
|
||||
self.cancel_autoreconnect()
|
||||
if self.server and not self.server.socket.closed:
|
||||
await self.server.socket.close()
|
||||
|
||||
1
Fill.py
1
Fill.py
@@ -646,7 +646,6 @@ def balance_multiworld_progression(multiworld: MultiWorld) -> None:
|
||||
|
||||
def get_sphere_locations(sphere_state: CollectionState,
|
||||
locations: typing.Set[Location]) -> typing.Set[Location]:
|
||||
sphere_state.sweep_for_events(key_only=True, locations=locations)
|
||||
return {loc for loc in locations if sphere_state.can_reach(loc)}
|
||||
|
||||
def item_percentage(player: int, num: int) -> float:
|
||||
|
||||
90
Main.py
90
Main.py
@@ -124,14 +124,19 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No
|
||||
for player in multiworld.player_ids:
|
||||
exclusion_rules(multiworld, player, multiworld.worlds[player].options.exclude_locations.value)
|
||||
multiworld.worlds[player].options.priority_locations.value -= multiworld.worlds[player].options.exclude_locations.value
|
||||
world_excluded_locations = set()
|
||||
for location_name in multiworld.worlds[player].options.priority_locations.value:
|
||||
try:
|
||||
location = multiworld.get_location(location_name, player)
|
||||
except KeyError as e: # failed to find the given location. Check if it's a legitimate location
|
||||
if location_name not in multiworld.worlds[player].location_name_to_id:
|
||||
raise Exception(f"Unable to prioritize location {location_name} in player {player}'s world.") from e
|
||||
else:
|
||||
except KeyError:
|
||||
continue
|
||||
|
||||
if location.progress_type != LocationProgressType.EXCLUDED:
|
||||
location.progress_type = LocationProgressType.PRIORITY
|
||||
else:
|
||||
logger.warning(f"Unable to prioritize location \"{location_name}\" in player {player}'s world because the world excluded it.")
|
||||
world_excluded_locations.add(location_name)
|
||||
multiworld.worlds[player].options.priority_locations.value -= world_excluded_locations
|
||||
|
||||
# Set local and non-local item rules.
|
||||
if multiworld.players > 1:
|
||||
@@ -179,82 +184,7 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No
|
||||
assert len(multiworld.itempool) == len(new_items), "Item Pool amounts should not change."
|
||||
multiworld.itempool[:] = new_items
|
||||
|
||||
# temporary home for item links, should be moved out of Main
|
||||
for group_id, group in multiworld.groups.items():
|
||||
def find_common_pool(players: Set[int], shared_pool: Set[str]) -> Tuple[
|
||||
Optional[Dict[int, Dict[str, int]]], Optional[Dict[str, int]]
|
||||
]:
|
||||
classifications: Dict[str, int] = collections.defaultdict(int)
|
||||
counters = {player: {name: 0 for name in shared_pool} for player in players}
|
||||
for item in multiworld.itempool:
|
||||
if item.player in counters and item.name in shared_pool:
|
||||
counters[item.player][item.name] += 1
|
||||
classifications[item.name] |= item.classification
|
||||
|
||||
for player in players.copy():
|
||||
if all([counters[player][item] == 0 for item in shared_pool]):
|
||||
players.remove(player)
|
||||
del (counters[player])
|
||||
|
||||
if not players:
|
||||
return None, None
|
||||
|
||||
for item in shared_pool:
|
||||
count = min(counters[player][item] for player in players)
|
||||
if count:
|
||||
for player in players:
|
||||
counters[player][item] = count
|
||||
else:
|
||||
for player in players:
|
||||
del (counters[player][item])
|
||||
return counters, classifications
|
||||
|
||||
common_item_count, classifications = find_common_pool(group["players"], group["item_pool"])
|
||||
if not common_item_count:
|
||||
continue
|
||||
|
||||
new_itempool: List[Item] = []
|
||||
for item_name, item_count in next(iter(common_item_count.values())).items():
|
||||
for _ in range(item_count):
|
||||
new_item = group["world"].create_item(item_name)
|
||||
# mangle together all original classification bits
|
||||
new_item.classification |= classifications[item_name]
|
||||
new_itempool.append(new_item)
|
||||
|
||||
region = Region("Menu", group_id, multiworld, "ItemLink")
|
||||
multiworld.regions.append(region)
|
||||
locations = region.locations
|
||||
for item in multiworld.itempool:
|
||||
count = common_item_count.get(item.player, {}).get(item.name, 0)
|
||||
if count:
|
||||
loc = Location(group_id, f"Item Link: {item.name} -> {multiworld.player_name[item.player]} {count}",
|
||||
None, region)
|
||||
loc.access_rule = lambda state, item_name = item.name, group_id_ = group_id, count_ = count: \
|
||||
state.has(item_name, group_id_, count_)
|
||||
|
||||
locations.append(loc)
|
||||
loc.place_locked_item(item)
|
||||
common_item_count[item.player][item.name] -= 1
|
||||
else:
|
||||
new_itempool.append(item)
|
||||
|
||||
itemcount = len(multiworld.itempool)
|
||||
multiworld.itempool = new_itempool
|
||||
|
||||
while itemcount > len(multiworld.itempool):
|
||||
items_to_add = []
|
||||
for player in group["players"]:
|
||||
if group["link_replacement"]:
|
||||
item_player = group_id
|
||||
else:
|
||||
item_player = player
|
||||
if group["replacement_items"][player]:
|
||||
items_to_add.append(AutoWorld.call_single(multiworld, "create_item", item_player,
|
||||
group["replacement_items"][player]))
|
||||
else:
|
||||
items_to_add.append(AutoWorld.call_single(multiworld, "create_filler", item_player))
|
||||
multiworld.random.shuffle(items_to_add)
|
||||
multiworld.itempool.extend(items_to_add[:itemcount - len(multiworld.itempool)])
|
||||
multiworld.link_items()
|
||||
|
||||
if any(multiworld.item_links.values()):
|
||||
multiworld._all_state = None
|
||||
|
||||
@@ -1352,7 +1352,7 @@ class ClientMessageProcessor(CommonCommandProcessor):
|
||||
if self.ctx.remaining_mode == "enabled":
|
||||
remaining_item_ids = get_remaining(self.ctx, self.client.team, self.client.slot)
|
||||
if remaining_item_ids:
|
||||
self.output("Remaining items: " + ", ".join(self.ctx.item_names[self.client.slot.game][item_id]
|
||||
self.output("Remaining items: " + ", ".join(self.ctx.item_names[self.ctx.games[self.client.slot]][item_id]
|
||||
for item_id in remaining_item_ids))
|
||||
else:
|
||||
self.output("No remaining items found.")
|
||||
@@ -1365,7 +1365,7 @@ class ClientMessageProcessor(CommonCommandProcessor):
|
||||
if self.ctx.client_game_state[self.client.team, self.client.slot] == ClientStatus.CLIENT_GOAL:
|
||||
remaining_item_ids = get_remaining(self.ctx, self.client.team, self.client.slot)
|
||||
if remaining_item_ids:
|
||||
self.output("Remaining items: " + ", ".join(self.ctx.item_names[self.client.slot.game][item_id]
|
||||
self.output("Remaining items: " + ", ".join(self.ctx.item_names[self.ctx.games[self.client.slot]][item_id]
|
||||
for item_id in remaining_item_ids))
|
||||
else:
|
||||
self.output("No remaining items found.")
|
||||
@@ -1857,6 +1857,7 @@ async def process_client_cmd(ctx: Context, client: Client, args: dict):
|
||||
args["cmd"] = "SetReply"
|
||||
value = ctx.stored_data.get(args["key"], args.get("default", 0))
|
||||
args["original_value"] = copy.copy(value)
|
||||
args["slot"] = client.slot
|
||||
for operation in args["operations"]:
|
||||
func = modify_functions[operation["operation"]]
|
||||
value = func(value, operation["value"])
|
||||
|
||||
67
Options.py
67
Options.py
@@ -786,17 +786,22 @@ class VerifyKeys(metaclass=FreezeValidKeys):
|
||||
verify_location_name: bool = False
|
||||
value: typing.Any
|
||||
|
||||
@classmethod
|
||||
def verify_keys(cls, data: typing.Iterable[str]) -> None:
|
||||
if cls.valid_keys:
|
||||
data = set(data)
|
||||
dataset = set(word.casefold() for word in data) if cls.valid_keys_casefold else set(data)
|
||||
extra = dataset - cls._valid_keys
|
||||
def verify_keys(self) -> None:
|
||||
if self.valid_keys:
|
||||
data = set(self.value)
|
||||
dataset = set(word.casefold() for word in data) if self.valid_keys_casefold else set(data)
|
||||
extra = dataset - self._valid_keys
|
||||
if extra:
|
||||
raise Exception(f"Found unexpected key {', '.join(extra)} in {cls}. "
|
||||
f"Allowed keys: {cls._valid_keys}.")
|
||||
raise OptionError(
|
||||
f"Found unexpected key {', '.join(extra)} in {getattr(self, 'display_name', self)}. "
|
||||
f"Allowed keys: {self._valid_keys}."
|
||||
)
|
||||
|
||||
def verify(self, world: typing.Type[World], player_name: str, plando_options: "PlandoOptions") -> None:
|
||||
try:
|
||||
self.verify_keys()
|
||||
except OptionError as validation_error:
|
||||
raise OptionError(f"Player {player_name} has invalid option keys:\n{validation_error}")
|
||||
if self.convert_name_groups and self.verify_item_name:
|
||||
new_value = type(self.value)() # empty container of whatever value is
|
||||
for item_name in self.value:
|
||||
@@ -833,7 +838,6 @@ class OptionDict(Option[typing.Dict[str, typing.Any]], VerifyKeys, typing.Mappin
|
||||
@classmethod
|
||||
def from_any(cls, data: typing.Dict[str, typing.Any]) -> OptionDict:
|
||||
if type(data) == dict:
|
||||
cls.verify_keys(data)
|
||||
return cls(data)
|
||||
else:
|
||||
raise NotImplementedError(f"Cannot Convert from non-dictionary, got {type(data)}")
|
||||
@@ -879,7 +883,6 @@ class OptionList(Option[typing.List[typing.Any]], VerifyKeys):
|
||||
@classmethod
|
||||
def from_any(cls, data: typing.Any):
|
||||
if is_iterable_except_str(data):
|
||||
cls.verify_keys(data)
|
||||
return cls(data)
|
||||
return cls.from_text(str(data))
|
||||
|
||||
@@ -905,7 +908,6 @@ class OptionSet(Option[typing.Set[str]], VerifyKeys):
|
||||
@classmethod
|
||||
def from_any(cls, data: typing.Any):
|
||||
if is_iterable_except_str(data):
|
||||
cls.verify_keys(data)
|
||||
return cls(data)
|
||||
return cls.from_text(str(data))
|
||||
|
||||
@@ -948,6 +950,19 @@ class PlandoTexts(Option[typing.List[PlandoText]], VerifyKeys):
|
||||
self.value = []
|
||||
logging.warning(f"The plando texts module is turned off, "
|
||||
f"so text for {player_name} will be ignored.")
|
||||
else:
|
||||
super().verify(world, player_name, plando_options)
|
||||
|
||||
def verify_keys(self) -> None:
|
||||
if self.valid_keys:
|
||||
data = set(text.at for text in self)
|
||||
dataset = set(word.casefold() for word in data) if self.valid_keys_casefold else set(data)
|
||||
extra = dataset - self._valid_keys
|
||||
if extra:
|
||||
raise OptionError(
|
||||
f"Invalid \"at\" placement {', '.join(extra)} in {getattr(self, 'display_name', self)}. "
|
||||
f"Allowed placements: {self._valid_keys}."
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def from_any(cls, data: PlandoTextsFromAnyType) -> Self:
|
||||
@@ -971,7 +986,6 @@ class PlandoTexts(Option[typing.List[PlandoText]], VerifyKeys):
|
||||
texts.append(text)
|
||||
else:
|
||||
raise Exception(f"Cannot create plando text from non-dictionary type, got {type(text)}")
|
||||
cls.verify_keys([text.at for text in texts])
|
||||
return cls(texts)
|
||||
else:
|
||||
raise NotImplementedError(f"Cannot Convert from non-list, got {type(data)}")
|
||||
@@ -1144,18 +1158,35 @@ class PlandoConnections(Option[typing.List[PlandoConnection]], metaclass=Connect
|
||||
|
||||
|
||||
class Accessibility(Choice):
|
||||
"""Set rules for reachability of your items/locations.
|
||||
"""
|
||||
Set rules for reachability of your items/locations.
|
||||
|
||||
**Full:** ensure everything can be reached and acquired.
|
||||
|
||||
- **Locations:** ensure everything can be reached and acquired.
|
||||
- **Items:** ensure all logically relevant items can be acquired.
|
||||
- **Minimal:** ensure what is needed to reach your goal can be acquired.
|
||||
**Minimal:** ensure what is needed to reach your goal can be acquired.
|
||||
"""
|
||||
display_name = "Accessibility"
|
||||
rich_text_doc = True
|
||||
option_locations = 0
|
||||
option_items = 1
|
||||
option_full = 0
|
||||
option_minimal = 2
|
||||
alias_none = 2
|
||||
alias_locations = 0
|
||||
alias_items = 0
|
||||
default = 0
|
||||
|
||||
|
||||
class ItemsAccessibility(Accessibility):
|
||||
"""
|
||||
Set rules for reachability of your items/locations.
|
||||
|
||||
**Full:** ensure everything can be reached and acquired.
|
||||
|
||||
**Minimal:** ensure what is needed to reach your goal can be acquired.
|
||||
|
||||
**Items:** ensure all logically relevant items can be acquired. Some items, such as keys, may be self-locking, and
|
||||
some locations may be inaccessible.
|
||||
"""
|
||||
option_items = 1
|
||||
default = 1
|
||||
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ Currently, the following games are supported:
|
||||
* Aquaria
|
||||
* Yu-Gi-Oh! Ultimate Masters: World Championship Tournament 2006
|
||||
* A Hat in Time
|
||||
* Old School Runescape
|
||||
|
||||
For setup and instructions check out our [tutorials page](https://archipelago.gg/tutorial/).
|
||||
Downloads can be found at [Releases](https://github.com/ArchipelagoMW/Archipelago/releases), including compiled
|
||||
|
||||
@@ -29,7 +29,7 @@ class UndertaleCommandProcessor(ClientCommandProcessor):
|
||||
def _cmd_patch(self):
|
||||
"""Patch the game. Only use this command if /auto_patch fails."""
|
||||
if isinstance(self.ctx, UndertaleContext):
|
||||
os.makedirs(name=os.path.join(os.getcwd(), "Undertale"), exist_ok=True)
|
||||
os.makedirs(name=Utils.user_path("Undertale"), exist_ok=True)
|
||||
self.ctx.patch_game()
|
||||
self.output("Patched.")
|
||||
|
||||
@@ -43,7 +43,7 @@ class UndertaleCommandProcessor(ClientCommandProcessor):
|
||||
def _cmd_auto_patch(self, steaminstall: typing.Optional[str] = None):
|
||||
"""Patch the game automatically."""
|
||||
if isinstance(self.ctx, UndertaleContext):
|
||||
os.makedirs(name=os.path.join(os.getcwd(), "Undertale"), exist_ok=True)
|
||||
os.makedirs(name=Utils.user_path("Undertale"), exist_ok=True)
|
||||
tempInstall = steaminstall
|
||||
if not os.path.isfile(os.path.join(tempInstall, "data.win")):
|
||||
tempInstall = None
|
||||
@@ -62,7 +62,7 @@ class UndertaleCommandProcessor(ClientCommandProcessor):
|
||||
for file_name in os.listdir(tempInstall):
|
||||
if file_name != "steam_api.dll":
|
||||
shutil.copy(os.path.join(tempInstall, file_name),
|
||||
os.path.join(os.getcwd(), "Undertale", file_name))
|
||||
Utils.user_path("Undertale", file_name))
|
||||
self.ctx.patch_game()
|
||||
self.output("Patching successful!")
|
||||
|
||||
@@ -111,12 +111,12 @@ class UndertaleContext(CommonContext):
|
||||
self.save_game_folder = os.path.expandvars(r"%localappdata%/UNDERTALE")
|
||||
|
||||
def patch_game(self):
|
||||
with open(os.path.join(os.getcwd(), "Undertale", "data.win"), "rb") as f:
|
||||
with open(Utils.user_path("Undertale", "data.win"), "rb") as f:
|
||||
patchedFile = bsdiff4.patch(f.read(), undertale.data_path("patch.bsdiff"))
|
||||
with open(os.path.join(os.getcwd(), "Undertale", "data.win"), "wb") as f:
|
||||
with open(Utils.user_path("Undertale", "data.win"), "wb") as f:
|
||||
f.write(patchedFile)
|
||||
os.makedirs(name=os.path.join(os.getcwd(), "Undertale", "Custom Sprites"), exist_ok=True)
|
||||
with open(os.path.expandvars(os.path.join(os.getcwd(), "Undertale", "Custom Sprites",
|
||||
os.makedirs(name=Utils.user_path("Undertale", "Custom Sprites"), exist_ok=True)
|
||||
with open(os.path.expandvars(Utils.user_path("Undertale", "Custom Sprites",
|
||||
"Which Character.txt")), "w") as f:
|
||||
f.writelines(["// Put the folder name of the sprites you want to play as, make sure it is the only "
|
||||
"line other than this one.\n", "frisk"])
|
||||
|
||||
@@ -325,10 +325,12 @@ def run_server_process(name: str, ponyconfig: dict, static_server_data: dict,
|
||||
def run(self):
|
||||
while 1:
|
||||
next_room = rooms_to_run.get(block=True, timeout=None)
|
||||
gc.collect(0)
|
||||
task = asyncio.run_coroutine_threadsafe(start_room(next_room), loop)
|
||||
self._tasks.append(task)
|
||||
task.add_done_callback(self._done)
|
||||
logging.info(f"Starting room {next_room} on {name}.")
|
||||
del task # delete reference to task object
|
||||
|
||||
starter = Starter()
|
||||
starter.daemon = True
|
||||
|
||||
@@ -231,6 +231,13 @@ def generate_yaml(game: str):
|
||||
|
||||
del options[key]
|
||||
|
||||
# Detect keys which end with -range, indicating a NamedRange with a possible custom value
|
||||
elif key_parts[-1].endswith("-range"):
|
||||
if options[key_parts[-1][:-6]] == "custom":
|
||||
options[key_parts[-1][:-6]] = val
|
||||
|
||||
del options[key]
|
||||
|
||||
# Detect random-* keys and set their options accordingly
|
||||
for key, val in options.copy().items():
|
||||
if key.startswith("random-"):
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
{% macro NamedRange(option_name, option) %}
|
||||
{{ OptionTitle(option_name, option) }}
|
||||
<div class="named-range-container">
|
||||
<select id="{{ option_name }}-select" data-option-name="{{ option_name }}" {{ "disabled" if option.default == "random" }}>
|
||||
<select id="{{ option_name }}-select" name="{{ option_name }}" data-option-name="{{ option_name }}" {{ "disabled" if option.default == "random" }}>
|
||||
{% for key, val in option.special_range_names.items() %}
|
||||
{% if option.default == val %}
|
||||
<option value="{{ val }}" selected>{{ key|replace("_", " ")|title }} ({{ val }})</option>
|
||||
@@ -64,17 +64,17 @@
|
||||
{% endfor %}
|
||||
<option value="custom" hidden>Custom</option>
|
||||
</select>
|
||||
<div class="named-range-wrapper">
|
||||
<div class="named-range-wrapper js-required">
|
||||
<input
|
||||
type="range"
|
||||
id="{{ option_name }}"
|
||||
name="{{ option_name }}"
|
||||
name="{{ option_name }}-range"
|
||||
min="{{ option.range_start }}"
|
||||
max="{{ option.range_end }}"
|
||||
value="{{ option.default | default(option.range_start) if option.default != "random" else option.range_start }}"
|
||||
{{ "disabled" if option.default == "random" }}
|
||||
/>
|
||||
<span id="{{ option_name }}-value" class="range-value js-required">
|
||||
<span id="{{ option_name }}-value" class="range-value">
|
||||
{{ option.default | default(option.range_start) if option.default != "random" else option.range_start }}
|
||||
</span>
|
||||
{{ RandomizeButton(option_name, option) }}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<noscript>
|
||||
<style>
|
||||
.js-required{
|
||||
display: none;
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
</noscript>
|
||||
|
||||
@@ -79,7 +79,7 @@ class TrackerData:
|
||||
|
||||
# Normal lookup tables as well.
|
||||
self.item_name_to_id[game] = game_package["item_name_to_id"]
|
||||
self.location_name_to_id[game] = game_package["item_name_to_id"]
|
||||
self.location_name_to_id[game] = game_package["location_name_to_id"]
|
||||
|
||||
def get_seed_name(self) -> str:
|
||||
"""Retrieves the seed name."""
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Archipelago World Code Owners / Maintainers Document
|
||||
#
|
||||
# This file is used to notate the current "owners" or "maintainers" of any currently merged world folder. For any pull
|
||||
# requests that modify these worlds, a code owner must approve the PR in addition to a core maintainer. This is not to
|
||||
# be used for files/folders outside the /worlds folder, those will always need sign off from a core maintainer.
|
||||
# This file is used to notate the current "owners" or "maintainers" of any currently merged world folder as well as
|
||||
# certain documentation. For any pull requests that modify these worlds/docs, a code owner must approve the PR in
|
||||
# addition to a core maintainer. All other files and folders are owned and maintained by core maintainers directly.
|
||||
#
|
||||
# All usernames must be GitHub usernames (and are case sensitive).
|
||||
|
||||
@@ -115,6 +115,9 @@
|
||||
# Ocarina of Time
|
||||
/worlds/oot/ @espeon65536
|
||||
|
||||
# Old School Runescape
|
||||
/worlds/osrs @digiholic
|
||||
|
||||
# Overcooked! 2
|
||||
/worlds/overcooked2/ @toasterparty
|
||||
|
||||
@@ -226,3 +229,11 @@
|
||||
|
||||
# Ori and the Blind Forest
|
||||
# /worlds_disabled/oribf/
|
||||
|
||||
###################
|
||||
## Documentation ##
|
||||
###################
|
||||
|
||||
# Apworld Dev Faq
|
||||
/docs/apworld_dev_faq.md @qwint @ScipioWright
|
||||
|
||||
|
||||
45
docs/apworld_dev_faq.md
Normal file
45
docs/apworld_dev_faq.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# APWorld Dev FAQ
|
||||
|
||||
This document is meant as a reference tool to show solutions to common problems when developing an apworld.
|
||||
It is not intended to answer every question about Archipelago and it assumes you have read the other docs,
|
||||
including [Contributing](contributing.md), [Adding Games](<adding games.md>), and [World API](<world api.md>).
|
||||
|
||||
---
|
||||
|
||||
### My game has a restrictive start that leads to fill errors
|
||||
|
||||
Hint to the Generator that an item needs to be in sphere one with local_early_items. Here, `1` represents the number of "Sword" items to attempt to place in sphere one.
|
||||
```py
|
||||
early_item_name = "Sword"
|
||||
self.multiworld.local_early_items[self.player][early_item_name] = 1
|
||||
```
|
||||
|
||||
Some alternative ways to try to fix this problem are:
|
||||
* Add more locations to sphere one of your world, potentially only when there would be a restrictive start
|
||||
* Pre-place items yourself, such as during `create_items`
|
||||
* Put items into the player's starting inventory using `push_precollected`
|
||||
* Raise an exception, such as an `OptionError` during `generate_early`, to disallow options that would lead to a restrictive start
|
||||
|
||||
---
|
||||
|
||||
### I have multiple settings that change the item/location pool counts and need to balance them out
|
||||
|
||||
In an ideal situation your system for producing locations and items wouldn't leave any opportunity for them to be unbalanced. But in real, complex situations, that might be unfeasible.
|
||||
|
||||
If that's the case, you can create extra filler based on the difference between your unfilled locations and your itempool by comparing [get_unfilled_locations](https://github.com/ArchipelagoMW/Archipelago/blob/main/BaseClasses.py#:~:text=get_unfilled_locations) to your list of items to submit
|
||||
|
||||
Note: to use self.create_filler(), self.get_filler_item_name() should be defined to only return valid filler item names
|
||||
```py
|
||||
total_locations = len(self.multiworld.get_unfilled_locations(self.player))
|
||||
item_pool = self.create_non_filler_items()
|
||||
|
||||
for _ in range(total_locations - len(item_pool)):
|
||||
item_pool.append(self.create_filler())
|
||||
|
||||
self.multiworld.itempool += item_pool
|
||||
```
|
||||
|
||||
A faster alternative to the `for` loop would be to use a [list comprehension](https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions):
|
||||
```py
|
||||
item_pool += [self.create_filler() for _ in range(total_locations - len(item_pool))]
|
||||
```
|
||||
@@ -261,6 +261,7 @@ Sent to clients in response to a [Set](#Set) package if want_reply was set to tr
|
||||
| key | str | The key that was updated. |
|
||||
| value | any | The new value for the key. |
|
||||
| original_value | any | The value the key had before it was updated. Not present on "_read" prefixed special keys. |
|
||||
| slot | int | The slot that originally sent the Set package causing this change. |
|
||||
|
||||
Additional arguments added to the [Set](#Set) package that triggered this [SetReply](#SetReply) will also be passed along.
|
||||
|
||||
|
||||
7
kvui.py
7
kvui.py
@@ -595,8 +595,9 @@ class GameManager(App):
|
||||
"!help for server commands.")
|
||||
|
||||
def connect_button_action(self, button):
|
||||
self.ctx.username = None
|
||||
self.ctx.password = None
|
||||
if self.ctx.server:
|
||||
self.ctx.username = None
|
||||
async_start(self.ctx.disconnect())
|
||||
else:
|
||||
async_start(self.ctx.connect(self.server_connect_bar.text.replace("/connect ", "")))
|
||||
@@ -836,6 +837,10 @@ class KivyJSONtoTextParser(JSONtoTextParser):
|
||||
return self._handle_text(node)
|
||||
|
||||
def _handle_text(self, node: JSONMessagePart):
|
||||
# All other text goes through _handle_color, and we don't want to escape markup twice,
|
||||
# or mess up text that already has intentional markup applied to it
|
||||
if node.get("type", "text") == "text":
|
||||
node["text"] = escape_markup(node["text"])
|
||||
for ref in node.get("refs", []):
|
||||
node["text"] = f"[ref={self.ref_count}|{ref}]{node['text']}[/ref]"
|
||||
self.ref_count += 1
|
||||
|
||||
18
settings.py
18
settings.py
@@ -3,6 +3,7 @@ Application settings / host.yaml interface using type hints.
|
||||
This is different from player options.
|
||||
"""
|
||||
|
||||
import os
|
||||
import os.path
|
||||
import shutil
|
||||
import sys
|
||||
@@ -11,7 +12,6 @@ import warnings
|
||||
from enum import IntEnum
|
||||
from threading import Lock
|
||||
from typing import cast, Any, BinaryIO, ClassVar, Dict, Iterator, List, Optional, TextIO, Tuple, Union, TypeVar
|
||||
import os
|
||||
|
||||
__all__ = [
|
||||
"get_settings", "fmt_doc", "no_gui",
|
||||
@@ -798,6 +798,7 @@ class Settings(Group):
|
||||
atexit.register(autosave)
|
||||
|
||||
def save(self, location: Optional[str] = None) -> None: # as above
|
||||
from Utils import parse_yaml
|
||||
location = location or self._filename
|
||||
assert location, "No file specified"
|
||||
temp_location = location + ".tmp" # not using tempfile to test expected file access
|
||||
@@ -807,10 +808,18 @@ class Settings(Group):
|
||||
# can't use utf-8-sig because it breaks backward compat: pyyaml on Windows with bytes does not strip the BOM
|
||||
with open(temp_location, "w", encoding="utf-8") as f:
|
||||
self.dump(f)
|
||||
# replace old with new
|
||||
if os.path.exists(location):
|
||||
f.flush()
|
||||
if hasattr(os, "fsync"):
|
||||
os.fsync(f.fileno())
|
||||
# validate new file is valid yaml
|
||||
with open(temp_location, encoding="utf-8") as f:
|
||||
parse_yaml(f.read())
|
||||
# replace old with new, try atomic operation first
|
||||
try:
|
||||
os.rename(temp_location, location)
|
||||
except (OSError, FileExistsError):
|
||||
os.unlink(location)
|
||||
os.rename(temp_location, location)
|
||||
os.rename(temp_location, location)
|
||||
self._filename = location
|
||||
|
||||
def dump(self, f: TextIO, level: int = 0) -> None:
|
||||
@@ -832,7 +841,6 @@ def get_settings() -> Settings:
|
||||
with _lock: # make sure we only have one instance
|
||||
res = getattr(get_settings, "_cache", None)
|
||||
if not res:
|
||||
import os
|
||||
from Utils import user_path, local_path
|
||||
filenames = ("options.yaml", "host.yaml")
|
||||
locations: List[str] = []
|
||||
|
||||
3
setup.py
3
setup.py
@@ -21,7 +21,7 @@ from pathlib import Path
|
||||
|
||||
# This is a bit jank. We need cx-Freeze to be able to run anything from this script, so install it
|
||||
try:
|
||||
requirement = 'cx-Freeze==7.0.0'
|
||||
requirement = 'cx-Freeze==7.2.0'
|
||||
import pkg_resources
|
||||
try:
|
||||
pkg_resources.require(requirement)
|
||||
@@ -66,7 +66,6 @@ non_apworlds: set = {
|
||||
"Adventure",
|
||||
"ArchipIDLE",
|
||||
"Archipelago",
|
||||
"ChecksFinder",
|
||||
"Clique",
|
||||
"Final Fantasy",
|
||||
"Lufia II Ancient Cave",
|
||||
|
||||
@@ -174,8 +174,8 @@ class TestFillRestrictive(unittest.TestCase):
|
||||
player1 = generate_player_data(multiworld, 1, 3, 3)
|
||||
player2 = generate_player_data(multiworld, 2, 3, 3)
|
||||
|
||||
multiworld.accessibility[player1.id].value = multiworld.accessibility[player1.id].option_minimal
|
||||
multiworld.accessibility[player2.id].value = multiworld.accessibility[player2.id].option_locations
|
||||
multiworld.worlds[player1.id].options.accessibility.value = Accessibility.option_minimal
|
||||
multiworld.worlds[player2.id].options.accessibility.value = Accessibility.option_full
|
||||
|
||||
multiworld.completion_condition[player1.id] = lambda state: True
|
||||
multiworld.completion_condition[player2.id] = lambda state: state.has(player2.prog_items[2].name, player2.id)
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import os
|
||||
import os.path
|
||||
import unittest
|
||||
from io import StringIO
|
||||
from tempfile import TemporaryFile
|
||||
from tempfile import TemporaryDirectory, TemporaryFile
|
||||
from typing import Any, Dict, List, cast
|
||||
|
||||
import Utils
|
||||
from settings import Settings, Group
|
||||
from settings import Group, Settings, ServerOptions
|
||||
|
||||
|
||||
class TestIDs(unittest.TestCase):
|
||||
@@ -80,3 +81,27 @@ class TestSettingsDumper(unittest.TestCase):
|
||||
self.assertEqual(value_spaces[2], value_spaces[0]) # start of sub-list
|
||||
self.assertGreater(value_spaces[3], value_spaces[0],
|
||||
f"{value_lines[3]} should have more indentation than {value_lines[0]} in {lines}")
|
||||
|
||||
|
||||
class TestSettingsSave(unittest.TestCase):
|
||||
def test_save(self) -> None:
|
||||
"""Test that saving and updating works"""
|
||||
with TemporaryDirectory() as d:
|
||||
filename = os.path.join(d, "host.yaml")
|
||||
new_release_mode = ServerOptions.ReleaseMode("enabled")
|
||||
# create default host.yaml
|
||||
settings = Settings(None)
|
||||
settings.save(filename)
|
||||
self.assertTrue(os.path.exists(filename),
|
||||
"Default settings could not be saved")
|
||||
self.assertNotEqual(settings.server_options.release_mode, new_release_mode,
|
||||
"Unexpected default release mode")
|
||||
# update host.yaml
|
||||
settings.server_options.release_mode = new_release_mode
|
||||
settings.save(filename)
|
||||
self.assertFalse(os.path.exists(filename + ".tmp"),
|
||||
"Temp file was not removed during save")
|
||||
# read back host.yaml
|
||||
settings = Settings(filename)
|
||||
self.assertEqual(settings.server_options.release_mode, new_release_mode,
|
||||
"Settings were not overwritten")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import unittest
|
||||
|
||||
from BaseClasses import PlandoOptions
|
||||
from BaseClasses import MultiWorld, PlandoOptions
|
||||
from Options import ItemLinks
|
||||
from worlds.AutoWorld import AutoWorldRegister
|
||||
|
||||
@@ -47,3 +47,15 @@ class TestOptions(unittest.TestCase):
|
||||
self.assertIn("Bow", link.value[0]["item_pool"])
|
||||
|
||||
# TODO test that the group created using these options has the items
|
||||
|
||||
def test_item_links_resolve(self):
|
||||
"""Test item link option resolves correctly."""
|
||||
item_link_group = [{
|
||||
"name": "ItemLinkTest",
|
||||
"item_pool": ["Everything"],
|
||||
"link_replacement": False,
|
||||
"replacement_item": None,
|
||||
}]
|
||||
item_links = {1: ItemLinks.from_any(item_link_group), 2: ItemLinks.from_any(item_link_group)}
|
||||
for link in item_links.values():
|
||||
self.assertEqual(link.value[0], item_link_group[0])
|
||||
|
||||
@@ -69,7 +69,7 @@ class TestTwoPlayerMulti(MultiworldTestBase):
|
||||
for world in AutoWorldRegister.world_types.values():
|
||||
self.multiworld = setup_multiworld([world, world], ())
|
||||
for world in self.multiworld.worlds.values():
|
||||
world.options.accessibility.value = Accessibility.option_locations
|
||||
world.options.accessibility.value = Accessibility.option_full
|
||||
self.assertSteps(gen_steps)
|
||||
with self.subTest("filling multiworld", seed=self.multiworld.seed):
|
||||
distribute_items_restrictive(self.multiworld)
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import unittest
|
||||
import typing
|
||||
from uuid import uuid4
|
||||
|
||||
from flask import Flask
|
||||
from flask.testing import FlaskClient
|
||||
|
||||
|
||||
class TestBase(unittest.TestCase):
|
||||
app: typing.ClassVar[Flask]
|
||||
client: FlaskClient
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls) -> None:
|
||||
from WebHostLib import app as raw_app
|
||||
from WebHost import get_app
|
||||
|
||||
raw_app.config["PONY"] = {
|
||||
"provider": "sqlite",
|
||||
"filename": ":memory:",
|
||||
"create_db": True,
|
||||
}
|
||||
raw_app.config.update({
|
||||
"TESTING": True,
|
||||
"DEBUG": True,
|
||||
})
|
||||
try:
|
||||
cls.app = get_app()
|
||||
except AssertionError as e:
|
||||
# since we only have 1 global app object, this might fail, but luckily all tests use the same config
|
||||
if "register_blueprint" not in e.args[0]:
|
||||
raise
|
||||
cls.app = raw_app
|
||||
|
||||
def setUp(self) -> None:
|
||||
self.client = self.app.test_client()
|
||||
|
||||
@@ -1,31 +1,16 @@
|
||||
import io
|
||||
import unittest
|
||||
import json
|
||||
import yaml
|
||||
|
||||
from . import TestBase
|
||||
|
||||
class TestDocs(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls) -> None:
|
||||
from WebHostLib import app as raw_app
|
||||
from WebHost import get_app
|
||||
raw_app.config["PONY"] = {
|
||||
"provider": "sqlite",
|
||||
"filename": ":memory:",
|
||||
"create_db": True,
|
||||
}
|
||||
raw_app.config.update({
|
||||
"TESTING": True,
|
||||
})
|
||||
app = get_app()
|
||||
|
||||
cls.client = app.test_client()
|
||||
|
||||
def test_correct_error_empty_request(self):
|
||||
class TestAPIGenerate(TestBase):
|
||||
def test_correct_error_empty_request(self) -> None:
|
||||
response = self.client.post("/api/generate")
|
||||
self.assertIn("No options found. Expected file attachment or json weights.", response.text)
|
||||
|
||||
def test_generation_queued_weights(self):
|
||||
def test_generation_queued_weights(self) -> None:
|
||||
options = {
|
||||
"Tester1":
|
||||
{
|
||||
@@ -43,7 +28,7 @@ class TestDocs(unittest.TestCase):
|
||||
self.assertTrue(json_data["text"].startswith("Generation of seed "))
|
||||
self.assertTrue(json_data["text"].endswith(" started successfully."))
|
||||
|
||||
def test_generation_queued_file(self):
|
||||
def test_generation_queued_file(self) -> None:
|
||||
options = {
|
||||
"game": "Archipelago",
|
||||
"name": "Tester",
|
||||
|
||||
192
test/webhost/test_host_room.py
Normal file
192
test/webhost/test_host_room.py
Normal file
@@ -0,0 +1,192 @@
|
||||
import os
|
||||
from uuid import UUID, uuid4, uuid5
|
||||
|
||||
from flask import url_for
|
||||
|
||||
from . import TestBase
|
||||
|
||||
|
||||
class TestHostFakeRoom(TestBase):
|
||||
room_id: UUID
|
||||
log_filename: str
|
||||
|
||||
def setUp(self) -> None:
|
||||
from pony.orm import db_session
|
||||
from Utils import user_path
|
||||
from WebHostLib.models import Room, Seed
|
||||
|
||||
super().setUp()
|
||||
|
||||
with self.client.session_transaction() as session:
|
||||
session["_id"] = uuid4()
|
||||
with db_session:
|
||||
# create an empty seed and a room from it
|
||||
seed = Seed(multidata=b"", owner=session["_id"])
|
||||
room = Room(seed=seed, owner=session["_id"], tracker=uuid4())
|
||||
self.room_id = room.id
|
||||
self.log_filename = user_path("logs", f"{self.room_id}.txt")
|
||||
|
||||
def tearDown(self) -> None:
|
||||
from pony.orm import db_session, select
|
||||
from WebHostLib.models import Command, Room
|
||||
|
||||
with db_session:
|
||||
for command in select(command for command in Command if command.room.id == self.room_id): # type: ignore
|
||||
command.delete()
|
||||
room: Room = Room.get(id=self.room_id)
|
||||
room.seed.delete()
|
||||
room.delete()
|
||||
|
||||
try:
|
||||
os.unlink(self.log_filename)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
def test_display_log_missing_full(self) -> None:
|
||||
"""
|
||||
Verify that we get a 200 response even if log is missing.
|
||||
This is required to not get an error for fetch.
|
||||
"""
|
||||
with self.app.app_context(), self.app.test_request_context():
|
||||
response = self.client.get(url_for("display_log", room=self.room_id))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
def test_display_log_missing_range(self) -> None:
|
||||
"""
|
||||
Verify that we get a full response for missing log even if we asked for range.
|
||||
This is required for the JS logic to differentiate between log update and log error message.
|
||||
"""
|
||||
with self.app.app_context(), self.app.test_request_context():
|
||||
response = self.client.get(url_for("display_log", room=self.room_id), headers={
|
||||
"Range": "bytes=100-"
|
||||
})
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
def test_display_log_denied(self) -> None:
|
||||
"""Verify that only the owner can see the log."""
|
||||
other_client = self.app.test_client()
|
||||
with self.app.app_context(), self.app.test_request_context():
|
||||
response = other_client.get(url_for("display_log", room=self.room_id))
|
||||
self.assertEqual(response.status_code, 403)
|
||||
|
||||
def test_display_log_missing_room(self) -> None:
|
||||
"""Verify log for missing room gives an error as opposed to missing log for existing room."""
|
||||
missing_room_id = uuid5(uuid4(), "") # rooms are always uuid4, so this can't exist
|
||||
other_client = self.app.test_client()
|
||||
with self.app.app_context(), self.app.test_request_context():
|
||||
response = other_client.get(url_for("display_log", room=missing_room_id))
|
||||
self.assertEqual(response.status_code, 404)
|
||||
|
||||
def test_display_log_full(self) -> None:
|
||||
"""Verify full log response."""
|
||||
with open(self.log_filename, "w", encoding="utf-8") as f:
|
||||
text = "x" * 200
|
||||
f.write(text)
|
||||
|
||||
with self.app.app_context(), self.app.test_request_context():
|
||||
response = self.client.get(url_for("display_log", room=self.room_id))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(response.get_data(True), text)
|
||||
|
||||
def test_display_log_range(self) -> None:
|
||||
"""Verify that Range header in request gives a range in response."""
|
||||
with open(self.log_filename, "w", encoding="utf-8") as f:
|
||||
f.write(" " * 100)
|
||||
text = "x" * 100
|
||||
f.write(text)
|
||||
|
||||
with self.app.app_context(), self.app.test_request_context():
|
||||
response = self.client.get(url_for("display_log", room=self.room_id), headers={
|
||||
"Range": "bytes=100-"
|
||||
})
|
||||
self.assertEqual(response.status_code, 206)
|
||||
self.assertEqual(response.get_data(True), text)
|
||||
|
||||
def test_display_log_range_bom(self) -> None:
|
||||
"""Verify that a BOM in the log file is skipped for range."""
|
||||
with open(self.log_filename, "w", encoding="utf-8-sig") as f:
|
||||
f.write(" " * 100)
|
||||
text = "x" * 100
|
||||
f.write(text)
|
||||
self.assertEqual(f.tell(), 203) # including BOM
|
||||
|
||||
with self.app.app_context(), self.app.test_request_context():
|
||||
response = self.client.get(url_for("display_log", room=self.room_id), headers={
|
||||
"Range": "bytes=100-"
|
||||
})
|
||||
self.assertEqual(response.status_code, 206)
|
||||
self.assertEqual(response.get_data(True), text)
|
||||
|
||||
def test_host_room_missing(self) -> None:
|
||||
"""Verify that missing room gives a 404 response."""
|
||||
missing_room_id = uuid5(uuid4(), "") # rooms are always uuid4, so this can't exist
|
||||
with self.app.app_context(), self.app.test_request_context():
|
||||
response = self.client.get(url_for("host_room", room=missing_room_id))
|
||||
self.assertEqual(response.status_code, 404)
|
||||
|
||||
def test_host_room_own(self) -> None:
|
||||
"""Verify that own room gives the full output."""
|
||||
with open(self.log_filename, "w", encoding="utf-8-sig") as f:
|
||||
text = "* should be visible *"
|
||||
f.write(text)
|
||||
|
||||
with self.app.app_context(), self.app.test_request_context():
|
||||
response = self.client.get(url_for("host_room", room=self.room_id))
|
||||
response_text = response.get_data(True)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertIn("href=\"/seed/", response_text)
|
||||
self.assertIn(text, response_text)
|
||||
|
||||
def test_host_room_other(self) -> None:
|
||||
"""Verify that non-own room gives the reduced output."""
|
||||
from pony.orm import db_session
|
||||
from WebHostLib.models import Room
|
||||
|
||||
with db_session:
|
||||
room: Room = Room.get(id=self.room_id)
|
||||
room.last_port = 12345
|
||||
|
||||
with open(self.log_filename, "w", encoding="utf-8-sig") as f:
|
||||
text = "* should not be visible *"
|
||||
f.write(text)
|
||||
|
||||
other_client = self.app.test_client()
|
||||
with self.app.app_context(), self.app.test_request_context():
|
||||
response = other_client.get(url_for("host_room", room=self.room_id))
|
||||
response_text = response.get_data(True)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertNotIn("href=\"/seed/", response_text)
|
||||
self.assertNotIn(text, response_text)
|
||||
self.assertIn("/connect ", response_text)
|
||||
self.assertIn(":12345", response_text)
|
||||
|
||||
def test_host_room_own_post(self) -> None:
|
||||
"""Verify command from owner gets queued for the server and response is redirect."""
|
||||
from pony.orm import db_session, select
|
||||
from WebHostLib.models import Command
|
||||
|
||||
with self.app.app_context(), self.app.test_request_context():
|
||||
response = self.client.post(url_for("host_room", room=self.room_id), data={
|
||||
"cmd": "/help"
|
||||
})
|
||||
self.assertEqual(response.status_code, 302, response.text)\
|
||||
|
||||
with db_session:
|
||||
commands = select(command for command in Command if command.room.id == self.room_id) # type: ignore
|
||||
self.assertIn("/help", (command.commandtext for command in commands))
|
||||
|
||||
def test_host_room_other_post(self) -> None:
|
||||
"""Verify command from non-owner does not get queued for the server."""
|
||||
from pony.orm import db_session, select
|
||||
from WebHostLib.models import Command
|
||||
|
||||
other_client = self.app.test_client()
|
||||
with self.app.app_context(), self.app.test_request_context():
|
||||
response = other_client.post(url_for("host_room", room=self.room_id), data={
|
||||
"cmd": "/help"
|
||||
})
|
||||
self.assertLess(response.status_code, 500)
|
||||
|
||||
with db_session:
|
||||
commands = select(command for command in Command if command.room.id == self.room_id) # type: ignore
|
||||
self.assertNotIn("/help", (command.commandtext for command in commands))
|
||||
@@ -39,7 +39,7 @@ def create_itempool(world: "HatInTimeWorld") -> List[Item]:
|
||||
continue
|
||||
else:
|
||||
if name == "Scooter Badge":
|
||||
if world.options.CTRLogic is CTRLogic.option_scooter or get_difficulty(world) >= Difficulty.MODERATE:
|
||||
if world.options.CTRLogic == CTRLogic.option_scooter or get_difficulty(world) >= Difficulty.MODERATE:
|
||||
item_type = ItemClassification.progression
|
||||
elif name == "No Bonk Badge" and world.is_dw():
|
||||
item_type = ItemClassification.progression
|
||||
|
||||
@@ -292,6 +292,9 @@ blacklisted_combos = {
|
||||
# See above comment
|
||||
"Time Rift - Deep Sea": ["Alpine Free Roam", "Nyakuza Free Roam", "Contractual Obligations",
|
||||
"Murder on the Owl Express"],
|
||||
|
||||
# was causing test failures
|
||||
"Time Rift - Balcony": ["Alpine Free Roam"],
|
||||
}
|
||||
|
||||
|
||||
@@ -656,6 +659,10 @@ def is_valid_act_combo(world: "HatInTimeWorld", entrance_act: Region,
|
||||
if exit_act.name not in chapter_finales:
|
||||
return False
|
||||
|
||||
exit_chapter: str = act_chapters.get(exit_act.name)
|
||||
# make sure that certain time rift combinations never happen
|
||||
always_block: bool = exit_chapter != "Mafia Town" and exit_chapter != "Subcon Forest"
|
||||
if not ignore_certain_rules or always_block:
|
||||
if entrance_act.name in rift_access_regions and exit_act.name in rift_access_regions[entrance_act.name]:
|
||||
return False
|
||||
|
||||
@@ -681,9 +688,12 @@ def is_valid_first_act(world: "HatInTimeWorld", act: Region) -> bool:
|
||||
if act.name not in guaranteed_first_acts:
|
||||
return False
|
||||
|
||||
if world.options.ActRandomizer == ActRandomizer.option_light and "Time Rift" in act.name:
|
||||
return False
|
||||
|
||||
# If there's only a single level in the starting chapter, only allow Mafia Town or Subcon Forest levels
|
||||
start_chapter = world.options.StartingChapter
|
||||
if start_chapter is ChapterIndex.ALPINE or start_chapter is ChapterIndex.SUBCON:
|
||||
if start_chapter == ChapterIndex.ALPINE or start_chapter == ChapterIndex.SUBCON:
|
||||
if "Time Rift" in act.name:
|
||||
return False
|
||||
|
||||
@@ -720,7 +730,8 @@ def is_valid_first_act(world: "HatInTimeWorld", act: Region) -> bool:
|
||||
elif act.name == "Contractual Obligations" and world.options.ShuffleSubconPaintings:
|
||||
return False
|
||||
|
||||
if world.options.ShuffleSubconPaintings and act_chapters.get(act.name, "") == "Subcon Forest":
|
||||
if world.options.ShuffleSubconPaintings and "Time Rift" not in act.name \
|
||||
and act_chapters.get(act.name, "") == "Subcon Forest":
|
||||
# Only allow Subcon levels if painting skips are allowed
|
||||
if diff < Difficulty.MODERATE or world.options.NoPaintingSkips:
|
||||
return False
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from worlds.AutoWorld import CollectionState
|
||||
from worlds.generic.Rules import add_rule, set_rule
|
||||
from .Locations import location_table, zipline_unlocks, is_location_valid, contract_locations, \
|
||||
shop_locations, event_locs
|
||||
from .Locations import location_table, zipline_unlocks, is_location_valid, shop_locations, event_locs
|
||||
from .Types import HatType, ChapterIndex, hat_type_to_item, Difficulty, HitType
|
||||
from BaseClasses import Location, Entrance, Region
|
||||
from typing import TYPE_CHECKING, List, Callable, Union, Dict
|
||||
@@ -148,14 +147,14 @@ def set_rules(world: "HatInTimeWorld"):
|
||||
if world.is_dlc1():
|
||||
chapter_list.append(ChapterIndex.CRUISE)
|
||||
|
||||
if world.is_dlc2() and final_chapter is not ChapterIndex.METRO:
|
||||
if world.is_dlc2() and final_chapter != ChapterIndex.METRO:
|
||||
chapter_list.append(ChapterIndex.METRO)
|
||||
|
||||
chapter_list.remove(starting_chapter)
|
||||
world.random.shuffle(chapter_list)
|
||||
|
||||
# Make sure Alpine is unlocked before any DLC chapters are, as the Alpine door needs to be open to access them
|
||||
if starting_chapter is not ChapterIndex.ALPINE and (world.is_dlc1() or world.is_dlc2()):
|
||||
if starting_chapter != ChapterIndex.ALPINE and (world.is_dlc1() or world.is_dlc2()):
|
||||
index1 = 69
|
||||
index2 = 69
|
||||
pos: int
|
||||
@@ -165,7 +164,7 @@ def set_rules(world: "HatInTimeWorld"):
|
||||
if world.is_dlc1():
|
||||
index1 = chapter_list.index(ChapterIndex.CRUISE)
|
||||
|
||||
if world.is_dlc2() and final_chapter is not ChapterIndex.METRO:
|
||||
if world.is_dlc2() and final_chapter != ChapterIndex.METRO:
|
||||
index2 = chapter_list.index(ChapterIndex.METRO)
|
||||
|
||||
lowest_index = min(index1, index2)
|
||||
@@ -242,9 +241,6 @@ def set_rules(world: "HatInTimeWorld"):
|
||||
if not is_location_valid(world, key):
|
||||
continue
|
||||
|
||||
if key in contract_locations.keys():
|
||||
continue
|
||||
|
||||
loc = world.multiworld.get_location(key, world.player)
|
||||
|
||||
for hat in data.required_hats:
|
||||
@@ -256,7 +252,7 @@ def set_rules(world: "HatInTimeWorld"):
|
||||
if data.paintings > 0 and world.options.ShuffleSubconPaintings:
|
||||
add_rule(loc, lambda state, paintings=data.paintings: has_paintings(state, world, paintings))
|
||||
|
||||
if data.hit_type is not HitType.none and world.options.UmbrellaLogic:
|
||||
if data.hit_type != HitType.none and world.options.UmbrellaLogic:
|
||||
if data.hit_type == HitType.umbrella:
|
||||
add_rule(loc, lambda state: state.has("Umbrella", world.player))
|
||||
|
||||
@@ -518,7 +514,7 @@ def set_hard_rules(world: "HatInTimeWorld"):
|
||||
lambda state: can_use_hat(state, world, HatType.ICE))
|
||||
|
||||
# Hard: clear Rush Hour with Brewing Hat only
|
||||
if world.options.NoTicketSkips is not NoTicketSkips.option_true:
|
||||
if world.options.NoTicketSkips != NoTicketSkips.option_true:
|
||||
set_rule(world.multiworld.get_location("Act Completion (Rush Hour)", world.player),
|
||||
lambda state: can_use_hat(state, world, HatType.BREWING))
|
||||
else:
|
||||
@@ -863,6 +859,8 @@ def set_rift_rules(world: "HatInTimeWorld", regions: Dict[str, Region]):
|
||||
if world.is_dlc1():
|
||||
for entrance in regions["Time Rift - Balcony"].entrances:
|
||||
add_rule(entrance, lambda state: can_clear_required_act(state, world, "The Arctic Cruise - Finale"))
|
||||
reg_act_connection(world, world.multiworld.get_entrance("The Arctic Cruise - Finale",
|
||||
world.player).connected_region, entrance)
|
||||
|
||||
for entrance in regions["Time Rift - Deep Sea"].entrances:
|
||||
add_rule(entrance, lambda state: has_relic_combo(state, world, "Cake"))
|
||||
@@ -939,6 +937,7 @@ def set_default_rift_rules(world: "HatInTimeWorld"):
|
||||
if world.is_dlc1():
|
||||
for entrance in world.multiworld.get_region("Time Rift - Balcony", world.player).entrances:
|
||||
add_rule(entrance, lambda state: can_clear_required_act(state, world, "The Arctic Cruise - Finale"))
|
||||
reg_act_connection(world, "Rock the Boat", entrance.name)
|
||||
|
||||
for entrance in world.multiworld.get_region("Time Rift - Deep Sea", world.player).entrances:
|
||||
add_rule(entrance, lambda state: has_relic_combo(state, world, "Cake"))
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
from BaseClasses import Item, ItemClassification, Tutorial, Location, MultiWorld
|
||||
from .Items import item_table, create_item, relic_groups, act_contracts, create_itempool, get_shop_trap_name, \
|
||||
calculate_yarn_costs
|
||||
calculate_yarn_costs, alps_hooks
|
||||
from .Regions import create_regions, randomize_act_entrances, chapter_act_info, create_events, get_shuffled_region
|
||||
from .Locations import location_table, contract_locations, is_location_valid, get_location_names, TASKSANITY_START_ID, \
|
||||
get_total_locations
|
||||
from .Rules import set_rules
|
||||
from .Rules import set_rules, has_paintings
|
||||
from .Options import AHITOptions, slot_data_options, adjust_options, RandomizeHatOrder, EndGoal, create_option_groups
|
||||
from .Types import HatType, ChapterIndex, HatInTimeItem, hat_type_to_item
|
||||
from .Types import HatType, ChapterIndex, HatInTimeItem, hat_type_to_item, Difficulty
|
||||
from .DeathWishLocations import create_dw_regions, dw_classes, death_wishes
|
||||
from .DeathWishRules import set_dw_rules, create_enemy_events, hit_list, bosses
|
||||
from worlds.AutoWorld import World, WebWorld, CollectionState
|
||||
from worlds.generic.Rules import add_rule
|
||||
from typing import List, Dict, TextIO
|
||||
from worlds.LauncherComponents import Component, components, icon_paths, launch_subprocess, Type
|
||||
from Utils import local_path
|
||||
@@ -86,19 +87,27 @@ class HatInTimeWorld(World):
|
||||
if self.is_dw_only():
|
||||
return
|
||||
|
||||
# If our starting chapter is 4 and act rando isn't on, force hookshot into inventory
|
||||
# If starting chapter is 3 and painting shuffle is enabled, and act rando isn't, give one free painting unlock
|
||||
start_chapter: ChapterIndex = ChapterIndex(self.options.StartingChapter)
|
||||
# Take care of some extremely restrictive starts in other chapters with act shuffle off
|
||||
if not self.options.ActRandomizer:
|
||||
start_chapter = self.options.StartingChapter
|
||||
if start_chapter == ChapterIndex.ALPINE:
|
||||
self.multiworld.push_precollected(self.create_item("Hookshot Badge"))
|
||||
if self.options.UmbrellaLogic:
|
||||
self.multiworld.push_precollected(self.create_item("Umbrella"))
|
||||
|
||||
if start_chapter == ChapterIndex.ALPINE or start_chapter == ChapterIndex.SUBCON:
|
||||
if not self.options.ActRandomizer:
|
||||
if start_chapter == ChapterIndex.ALPINE:
|
||||
self.multiworld.push_precollected(self.create_item("Hookshot Badge"))
|
||||
if self.options.UmbrellaLogic:
|
||||
self.multiworld.push_precollected(self.create_item("Umbrella"))
|
||||
|
||||
if start_chapter == ChapterIndex.SUBCON and self.options.ShuffleSubconPaintings:
|
||||
if self.options.ShuffleAlpineZiplines:
|
||||
ziplines = list(alps_hooks.keys())
|
||||
ziplines.remove("Zipline Unlock - The Twilight Bell Path") # not enough checks from this one
|
||||
self.multiworld.push_precollected(self.create_item(self.random.choice(ziplines)))
|
||||
elif start_chapter == ChapterIndex.SUBCON:
|
||||
if self.options.ShuffleSubconPaintings:
|
||||
self.multiworld.push_precollected(self.create_item("Progressive Painting Unlock"))
|
||||
elif start_chapter == ChapterIndex.BIRDS:
|
||||
if self.options.UmbrellaLogic:
|
||||
if self.options.LogicDifficulty < Difficulty.EXPERT:
|
||||
self.multiworld.push_precollected(self.create_item("Umbrella"))
|
||||
elif self.options.LogicDifficulty < Difficulty.MODERATE:
|
||||
self.multiworld.push_precollected(self.create_item("Umbrella"))
|
||||
|
||||
def create_regions(self):
|
||||
# noinspection PyClassVar
|
||||
@@ -119,7 +128,10 @@ class HatInTimeWorld(World):
|
||||
# place vanilla contract locations if contract shuffle is off
|
||||
if not self.options.ShuffleActContracts:
|
||||
for name in contract_locations.keys():
|
||||
self.multiworld.get_location(name, self.player).place_locked_item(create_item(self, name))
|
||||
loc = self.get_location(name)
|
||||
loc.place_locked_item(create_item(self, name))
|
||||
if self.options.ShuffleSubconPaintings and loc.name != "Snatcher's Contract - The Subcon Well":
|
||||
add_rule(loc, lambda state: has_paintings(state, self, 1))
|
||||
|
||||
def create_items(self):
|
||||
if self.has_yarn():
|
||||
@@ -317,7 +329,7 @@ class HatInTimeWorld(World):
|
||||
|
||||
def remove(self, state: "CollectionState", item: "Item") -> bool:
|
||||
old_count: int = state.count(item.name, self.player)
|
||||
change = super().collect(state, item)
|
||||
change = super().remove(state, item)
|
||||
if change and old_count == 1:
|
||||
if "Stamp" in item.name:
|
||||
if "2 Stamp" in item.name:
|
||||
|
||||
@@ -12,41 +12,29 @@
|
||||
|
||||
## Instructions
|
||||
|
||||
1. Have Steam running. Open the Steam console with this link: [steam://open/console](steam://open/console)
|
||||
This may not work for some browsers. If that's the case, and you're on Windows, open the Run dialog using Win+R,
|
||||
paste the link into the box, and hit Enter.
|
||||
1. **BACK UP YOUR SAVE FILES IN YOUR MAIN INSTALL IF YOU CARE ABOUT THEM!!!**
|
||||
Go to `steamapps/common/HatinTime/HatinTimeGame/SaveData/` and copy everything inside that folder over to a safe place.
|
||||
**This is important! Changing the game version CAN and WILL break your existing save files!!!**
|
||||
|
||||
|
||||
2. In the Steam console, enter the following command:
|
||||
`download_depot 253230 253232 7770543545116491859`. ***Wait for the console to say the download is finished!***
|
||||
This can take a while to finish (30+ minutes) depending on your connection speed, so please be patient. Additionally,
|
||||
**try to prevent your connection from being interrupted or slowed while Steam is downloading the depot,**
|
||||
or else the download may potentially become corrupted (see first FAQ issue below).
|
||||
2. In your Steam library, right-click on **A Hat in Time** in the list of games and click on **Properties**.
|
||||
|
||||
|
||||
3. Once the download finishes, go to `steamapps/content/app_253230` in Steam's program folder.
|
||||
3. Click the **Betas** tab. In the **Beta Participation** dropdown, select `tcplink`.
|
||||
While it downloads, you can subscribe to the [Archipelago workshop mod.]((https://steamcommunity.com/sharedfiles/filedetails/?id=3026842601))
|
||||
|
||||
|
||||
4. There should be a folder named `depot_253232`. Rename it to HatinTime_AP and move it to your `steamapps/common` folder.
|
||||
4. Once the game finishes downloading, start it up.
|
||||
In Game Settings, make sure **Enable Developer Console** is checked.
|
||||
|
||||
|
||||
5. In the HatinTime_AP folder, navigate to `Binaries/Win64` and create a new file: `steam_appid.txt`.
|
||||
In this new text file, input the number **253230** on the first line.
|
||||
|
||||
|
||||
6. Create a shortcut of `HatinTimeGame.exe` from that folder and move it to wherever you'd like.
|
||||
You will use this shortcut to open the Archipelago-compatible version of A Hat in Time.
|
||||
|
||||
|
||||
7. Start up the game using your new shortcut. To confirm if you are on the correct version,
|
||||
go to Settings -> Game Settings. If you don't see an option labelled ***Live Game Events*** you should be running
|
||||
the correct version of the game. In Game Settings, make sure ***Enable Developer Console*** is checked.
|
||||
5. You should now be good to go. See below for more details on how to use the mod and connect to an Archipelago game.
|
||||
|
||||
|
||||
## Connecting to the Archipelago server
|
||||
|
||||
To connect to the multiworld server, simply run the **ArchipelagoAHITClient**
|
||||
(or run it from the Launcher if you have the apworld installed) and connect it to the Archipelago server.
|
||||
To connect to the multiworld server, simply run the **Archipelago AHIT Client** from the Launcher
|
||||
and connect it to the Archipelago server.
|
||||
The game will connect to the client automatically when you create a new save file.
|
||||
|
||||
|
||||
@@ -61,33 +49,8 @@ make sure ***Enable Developer Console*** is checked in Game Settings and press t
|
||||
|
||||
|
||||
## FAQ/Common Issues
|
||||
### I followed the setup, but I receive an odd error message upon starting the game or creating a save file!
|
||||
If you receive an error message such as
|
||||
**"Failed to find default engine .ini to retrieve My Documents subdirectory to use. Force quitting."** or
|
||||
**"Failed to load map "hub_spaceship"** after booting up the game or creating a save file respectively, then the depot
|
||||
download was likely corrupted. The only way to fix this is to start the entire download all over again.
|
||||
Unfortunately, this appears to be an underlying issue with Steam's depot downloader. The only way to really prevent this
|
||||
from happening is to ensure that your connection is not interrupted or slowed while downloading.
|
||||
|
||||
### The game keeps crashing on startup after the splash screen!
|
||||
This issue is unfortunately very hard to fix, and the underlying cause is not known. If it does happen however,
|
||||
try the following:
|
||||
|
||||
- Close Steam **entirely**.
|
||||
- Open the downpatched version of the game (with Steam closed) and allow it to load to the titlescreen.
|
||||
- Close the game, and then open Steam again.
|
||||
- After launching the game, the issue should hopefully disappear. If not, repeat the above steps until it does.
|
||||
|
||||
### I followed the setup, but "Live Game Events" still shows up in the options menu!
|
||||
The most common cause of this is the `steam_appid.txt` file. If you're on Windows 10, file extensions are hidden by
|
||||
default (thanks Microsoft). You likely made the mistake of still naming the file `steam_appid.txt`, which, since file
|
||||
extensions are hidden, would result in the file being named `steam_appid.txt.txt`, which is incorrect.
|
||||
To show file extensions in Windows 10, open any folder, click the View tab at the top, and check
|
||||
"File name extensions". Then you can correct the name of the file. If the name of the file is correct,
|
||||
and you're still running into the issue, re-read the setup guide again in case you missed a step.
|
||||
If you still can't get it to work, ask for help in the Discord thread.
|
||||
|
||||
### The game is running on the older version, but it's not connecting when starting a new save!
|
||||
### The game is not connecting when starting a new save!
|
||||
For unknown reasons, the mod will randomly disable itself in the mod menu. To fix this, go to the Mods menu
|
||||
(rocket icon) in-game, and re-enable the mod.
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import typing
|
||||
|
||||
from BaseClasses import MultiWorld
|
||||
from Options import Choice, Range, Option, Toggle, DefaultOnToggle, DeathLink, \
|
||||
StartInventoryPool, PlandoBosses, PlandoConnections, PlandoTexts, FreeText, Removed
|
||||
from Options import Choice, Range, DeathLink, DefaultOnToggle, FreeText, ItemsAccessibility, Option, \
|
||||
PlandoBosses, PlandoConnections, PlandoTexts, Removed, StartInventoryPool, Toggle
|
||||
from .EntranceShuffle import default_connections, default_dungeon_connections, \
|
||||
inverted_default_connections, inverted_default_dungeon_connections
|
||||
from .Text import TextTable
|
||||
@@ -743,6 +743,7 @@ class ALttPPlandoTexts(PlandoTexts):
|
||||
|
||||
|
||||
alttp_options: typing.Dict[str, type(Option)] = {
|
||||
"accessibility": ItemsAccessibility,
|
||||
"plando_connections": ALttPPlandoConnections,
|
||||
"plando_texts": ALttPPlandoTexts,
|
||||
"start_inventory_from_pool": StartInventoryPool,
|
||||
|
||||
@@ -2,6 +2,7 @@ import collections
|
||||
import logging
|
||||
from typing import Iterator, Set
|
||||
|
||||
from Options import ItemsAccessibility
|
||||
from BaseClasses import Entrance, MultiWorld
|
||||
from worlds.generic.Rules import (add_item_rule, add_rule, forbid_item,
|
||||
item_name_in_location_names, location_item_name, set_rule, allow_self_locking_items)
|
||||
@@ -39,7 +40,7 @@ def set_rules(world):
|
||||
else:
|
||||
# Set access rules according to max glitches for multiworld progression.
|
||||
# Set accessibility to none, and shuffle assuming the no logic players can always win
|
||||
world.accessibility[player] = world.accessibility[player].from_text("minimal")
|
||||
world.accessibility[player].value = ItemsAccessibility.option_minimal
|
||||
world.progression_balancing[player].value = 0
|
||||
|
||||
else:
|
||||
@@ -377,7 +378,7 @@ def global_rules(multiworld: MultiWorld, player: int):
|
||||
or state.has("Cane of Somaria", player)))
|
||||
set_rule(multiworld.get_location('Tower of Hera - Big Chest', player), lambda state: state.has('Big Key (Tower of Hera)', player))
|
||||
set_rule(multiworld.get_location('Tower of Hera - Big Key Chest', player), lambda state: has_fire_source(state, player))
|
||||
if multiworld.accessibility[player] != 'locations':
|
||||
if multiworld.accessibility[player] != 'full':
|
||||
set_always_allow(multiworld.get_location('Tower of Hera - Big Key Chest', player), lambda state, item: item.name == 'Small Key (Tower of Hera)' and item.player == player)
|
||||
|
||||
set_rule(multiworld.get_entrance('Swamp Palace Moat', player), lambda state: state.has('Flippers', player) and state.has('Open Floodgate', player))
|
||||
@@ -393,7 +394,7 @@ def global_rules(multiworld: MultiWorld, player: int):
|
||||
if state.has('Hookshot', player)
|
||||
else state._lttp_has_key('Small Key (Swamp Palace)', player, 4))
|
||||
set_rule(multiworld.get_location('Swamp Palace - Big Chest', player), lambda state: state.has('Big Key (Swamp Palace)', player))
|
||||
if multiworld.accessibility[player] != 'locations':
|
||||
if multiworld.accessibility[player] != 'full':
|
||||
allow_self_locking_items(multiworld.get_location('Swamp Palace - Big Chest', player), 'Big Key (Swamp Palace)')
|
||||
set_rule(multiworld.get_entrance('Swamp Palace (North)', player), lambda state: state.has('Hookshot', player) and state._lttp_has_key('Small Key (Swamp Palace)', player, 5))
|
||||
if not multiworld.small_key_shuffle[player] and multiworld.glitches_required[player] not in ['hybrid_major_glitches', 'no_logic']:
|
||||
@@ -423,7 +424,7 @@ def global_rules(multiworld: MultiWorld, player: int):
|
||||
set_rule(multiworld.get_entrance('Skull Woods First Section West Door', player), lambda state: state._lttp_has_key('Small Key (Skull Woods)', player, 5))
|
||||
set_rule(multiworld.get_entrance('Skull Woods First Section (Left) Door to Exit', player), lambda state: state._lttp_has_key('Small Key (Skull Woods)', player, 5))
|
||||
set_rule(multiworld.get_location('Skull Woods - Big Chest', player), lambda state: state.has('Big Key (Skull Woods)', player) and can_use_bombs(state, player))
|
||||
if multiworld.accessibility[player] != 'locations':
|
||||
if multiworld.accessibility[player] != 'full':
|
||||
allow_self_locking_items(multiworld.get_location('Skull Woods - Big Chest', player), 'Big Key (Skull Woods)')
|
||||
set_rule(multiworld.get_entrance('Skull Woods Torch Room', player), lambda state: state._lttp_has_key('Small Key (Skull Woods)', player, 4) and state.has('Fire Rod', player) and has_sword(state, player)) # sword required for curtain
|
||||
add_rule(multiworld.get_location('Skull Woods - Prize', player), lambda state: state._lttp_has_key('Small Key (Skull Woods)', player, 5))
|
||||
@@ -488,7 +489,7 @@ def global_rules(multiworld: MultiWorld, player: int):
|
||||
set_rule(multiworld.get_location('Turtle Rock - Roller Room - Right', player), lambda state: state.has('Cane of Somaria', player) and state.has('Fire Rod', player))
|
||||
set_rule(multiworld.get_location('Turtle Rock - Big Chest', player), lambda state: state.has('Big Key (Turtle Rock)', player) and (state.has('Cane of Somaria', player) or state.has('Hookshot', player)))
|
||||
set_rule(multiworld.get_entrance('Turtle Rock (Big Chest) (North)', player), lambda state: state.has('Cane of Somaria', player) or state.has('Hookshot', player))
|
||||
set_rule(multiworld.get_entrance('Turtle Rock Big Key Door', player), lambda state: state.has('Big Key (Turtle Rock)', player) and can_kill_most_things(state, player, 10))
|
||||
set_rule(multiworld.get_entrance('Turtle Rock Big Key Door', player), lambda state: state.has('Big Key (Turtle Rock)', player) and can_kill_most_things(state, player, 10) and can_bomb_or_bonk(state, player))
|
||||
set_rule(multiworld.get_location('Turtle Rock - Chain Chomps', player), lambda state: can_use_bombs(state, player) or can_shoot_arrows(state, player)
|
||||
or has_beam_sword(state, player) or state.has_any(["Blue Boomerang", "Red Boomerang", "Hookshot", "Cane of Somaria", "Fire Rod", "Ice Rod"], player))
|
||||
set_rule(multiworld.get_entrance('Turtle Rock (Dark Room) (North)', player), lambda state: state.has('Cane of Somaria', player))
|
||||
@@ -522,12 +523,12 @@ def global_rules(multiworld: MultiWorld, player: int):
|
||||
|
||||
set_rule(multiworld.get_entrance('Palace of Darkness Big Key Chest Staircase', player), lambda state: can_use_bombs(state, player) and (state._lttp_has_key('Small Key (Palace of Darkness)', player, 6) or (
|
||||
location_item_name(state, 'Palace of Darkness - Big Key Chest', player) in [('Small Key (Palace of Darkness)', player)] and state._lttp_has_key('Small Key (Palace of Darkness)', player, 3))))
|
||||
if multiworld.accessibility[player] != 'locations':
|
||||
if multiworld.accessibility[player] != 'full':
|
||||
set_always_allow(multiworld.get_location('Palace of Darkness - Big Key Chest', player), lambda state, item: item.name == 'Small Key (Palace of Darkness)' and item.player == player and state._lttp_has_key('Small Key (Palace of Darkness)', player, 5))
|
||||
|
||||
set_rule(multiworld.get_entrance('Palace of Darkness Spike Statue Room Door', player), lambda state: state._lttp_has_key('Small Key (Palace of Darkness)', player, 6) or (
|
||||
location_item_name(state, 'Palace of Darkness - Harmless Hellway', player) in [('Small Key (Palace of Darkness)', player)] and state._lttp_has_key('Small Key (Palace of Darkness)', player, 4)))
|
||||
if multiworld.accessibility[player] != 'locations':
|
||||
if multiworld.accessibility[player] != 'full':
|
||||
set_always_allow(multiworld.get_location('Palace of Darkness - Harmless Hellway', player), lambda state, item: item.name == 'Small Key (Palace of Darkness)' and item.player == player and state._lttp_has_key('Small Key (Palace of Darkness)', player, 5))
|
||||
|
||||
set_rule(multiworld.get_entrance('Palace of Darkness Maze Door', player), lambda state: state._lttp_has_key('Small Key (Palace of Darkness)', player, 6))
|
||||
@@ -1200,7 +1201,7 @@ def set_trock_key_rules(world, player):
|
||||
# Must not go in the Chain Chomps chest - only 2 other chests available and 3+ keys required for all other chests
|
||||
forbid_item(world.get_location('Turtle Rock - Chain Chomps', player), 'Big Key (Turtle Rock)', player)
|
||||
forbid_item(world.get_location('Turtle Rock - Pokey 2 Key Drop', player), 'Big Key (Turtle Rock)', player)
|
||||
if world.accessibility[player] == 'locations':
|
||||
if world.accessibility[player] == 'full':
|
||||
if world.big_key_shuffle[player] and can_reach_big_chest:
|
||||
# Must not go in the dungeon - all 3 available chests (Chomps, Big Chest, Crystaroller) must be keys to access laser bridge, and the big key is required first
|
||||
for location in ['Turtle Rock - Chain Chomps', 'Turtle Rock - Compass Chest',
|
||||
@@ -1214,7 +1215,7 @@ def set_trock_key_rules(world, player):
|
||||
location.place_locked_item(item)
|
||||
toss_junk_item(world, player)
|
||||
|
||||
if world.accessibility[player] != 'locations':
|
||||
if world.accessibility[player] != 'full':
|
||||
set_always_allow(world.get_location('Turtle Rock - Big Key Chest', player), lambda state, item: item.name == 'Small Key (Turtle Rock)' and item.player == player
|
||||
and state.can_reach(state.multiworld.get_region('Turtle Rock (Second Section)', player)))
|
||||
|
||||
|
||||
@@ -76,10 +76,6 @@ class ALttPItem(Item):
|
||||
if self.type in {"SmallKey", "BigKey", "Map", "Compass"}:
|
||||
return self.type
|
||||
|
||||
@property
|
||||
def locked_dungeon_item(self):
|
||||
return self.location.locked and self.dungeon_item
|
||||
|
||||
|
||||
class LTTPRegionType(IntEnum):
|
||||
LightWorld = 1
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from worlds.alttp.Dungeons import create_dungeons, get_dungeon_item_pool
|
||||
from worlds.alttp.Dungeons import get_dungeon_item_pool
|
||||
from worlds.alttp.EntranceShuffle import link_inverted_entrances
|
||||
from worlds.alttp.InvertedRegions import create_inverted_regions
|
||||
from worlds.alttp.ItemPool import difficulties
|
||||
from worlds.alttp.Items import item_factory
|
||||
from worlds.alttp.Regions import mark_light_world_regions
|
||||
from worlds.alttp.Shops import create_shops
|
||||
from test.TestBase import TestBase
|
||||
from test.bases import TestBase
|
||||
|
||||
from worlds.alttp.test import LTTPTestBase
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from worlds.alttp.Items import item_factory
|
||||
from worlds.alttp.Options import GlitchesRequired
|
||||
from worlds.alttp.Regions import mark_light_world_regions
|
||||
from worlds.alttp.Shops import create_shops
|
||||
from test.TestBase import TestBase
|
||||
from test.bases import TestBase
|
||||
|
||||
from worlds.alttp.test import LTTPTestBase
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from worlds.alttp.Items import item_factory
|
||||
from worlds.alttp.Options import GlitchesRequired
|
||||
from worlds.alttp.Regions import mark_light_world_regions
|
||||
from worlds.alttp.Shops import create_shops
|
||||
from test.TestBase import TestBase
|
||||
from test.bases import TestBase
|
||||
|
||||
from worlds.alttp.test import LTTPTestBase
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ item_table = {
|
||||
"Mutant Costume": ItemData(698020, 1, ItemType.JUNK, ItemGroup.COLLECTIBLE), # collectible_mutant_costume
|
||||
"Baby Nautilus": ItemData(698021, 1, ItemType.NORMAL, ItemGroup.UTILITY), # collectible_nautilus
|
||||
"Baby Piranha": ItemData(698022, 1, ItemType.NORMAL, ItemGroup.UTILITY), # collectible_piranha
|
||||
"Arnassi Armor": ItemData(698023, 1, ItemType.NORMAL, ItemGroup.UTILITY), # collectible_seahorse_costume
|
||||
"Arnassi Armor": ItemData(698023, 1, ItemType.PROGRESSION, ItemGroup.UTILITY), # collectible_seahorse_costume
|
||||
"Seed Bag": ItemData(698024, 1, ItemType.JUNK, ItemGroup.COLLECTIBLE), # collectible_seed_bag
|
||||
"King's Skull": ItemData(698025, 1, ItemType.JUNK, ItemGroup.COLLECTIBLE), # collectible_skull
|
||||
"Song Plant Spore": ItemData(698026, 1, ItemType.JUNK, ItemGroup.COLLECTIBLE), # collectible_spore_seed
|
||||
|
||||
@@ -30,7 +30,7 @@ class AquariaLocations:
|
||||
|
||||
locations_verse_cave_r = {
|
||||
"Verse Cave, bulb in the skeleton room": 698107,
|
||||
"Verse Cave, bulb in the path left of the skeleton room": 698108,
|
||||
"Verse Cave, bulb in the path right of the skeleton room": 698108,
|
||||
"Verse Cave right area, Big Seed": 698175,
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ class AquariaLocations:
|
||||
"Home Water, bulb below the grouper fish": 698058,
|
||||
"Home Water, bulb in the path below Nautilus Prime": 698059,
|
||||
"Home Water, bulb in the little room above the grouper fish": 698060,
|
||||
"Home Water, bulb in the end of the left path from the Verse Cave": 698061,
|
||||
"Home Water, bulb in the end of the path close to the Verse Cave": 698061,
|
||||
"Home Water, bulb in the top left path": 698062,
|
||||
"Home Water, bulb in the bottom left room": 698063,
|
||||
"Home Water, bulb close to Naija's Home": 698064,
|
||||
@@ -67,7 +67,7 @@ class AquariaLocations:
|
||||
|
||||
locations_song_cave = {
|
||||
"Song Cave, Erulian spirit": 698206,
|
||||
"Song Cave, bulb in the top left part": 698071,
|
||||
"Song Cave, bulb in the top right part": 698071,
|
||||
"Song Cave, bulb in the big anemone room": 698072,
|
||||
"Song Cave, bulb in the path to the singing statues": 698073,
|
||||
"Song Cave, bulb under the rock in the path to the singing statues": 698074,
|
||||
@@ -122,6 +122,7 @@ class AquariaLocations:
|
||||
"Open Water top right area, second urn in the Mithalas exit": 698149,
|
||||
"Open Water top right area, third urn in the Mithalas exit": 698150,
|
||||
}
|
||||
|
||||
locations_openwater_tr_turtle = {
|
||||
"Open Water top right area, bulb in the turtle room": 698009,
|
||||
"Open Water top right area, Transturtle": 698211,
|
||||
@@ -151,6 +152,9 @@ class AquariaLocations:
|
||||
|
||||
locations_arnassi_path = {
|
||||
"Arnassi Ruins, Arnassi Statue": 698164,
|
||||
}
|
||||
|
||||
locations_arnassi_cave_transturtle = {
|
||||
"Arnassi Ruins, Transturtle": 698217,
|
||||
}
|
||||
|
||||
@@ -195,7 +199,7 @@ class AquariaLocations:
|
||||
|
||||
locations_cathedral_l = {
|
||||
"Mithalas City Castle, bulb in the flesh hole": 698042,
|
||||
"Mithalas City Castle, Blue banner": 698165,
|
||||
"Mithalas City Castle, Blue Banner": 698165,
|
||||
"Mithalas City Castle, urn in the bedroom": 698130,
|
||||
"Mithalas City Castle, first urn of the single lamp path": 698131,
|
||||
"Mithalas City Castle, second urn of the single lamp path": 698132,
|
||||
@@ -226,7 +230,7 @@ class AquariaLocations:
|
||||
"Mithalas Cathedral, third urn in the path behind the flesh vein": 698146,
|
||||
"Mithalas Cathedral, fourth urn in the top right room": 698147,
|
||||
"Mithalas Cathedral, Mithalan Dress": 698189,
|
||||
"Mithalas Cathedral right area, urn below the left entrance": 698198,
|
||||
"Mithalas Cathedral, urn below the left entrance": 698198,
|
||||
}
|
||||
|
||||
locations_cathedral_underground = {
|
||||
@@ -239,7 +243,7 @@ class AquariaLocations:
|
||||
}
|
||||
|
||||
locations_cathedral_boss = {
|
||||
"Cathedral boss area, beating Mithalan God": 698202,
|
||||
"Mithalas boss area, beating Mithalan God": 698202,
|
||||
}
|
||||
|
||||
locations_forest_tl = {
|
||||
@@ -268,11 +272,14 @@ class AquariaLocations:
|
||||
}
|
||||
|
||||
locations_forest_bl = {
|
||||
"Kelp Forest bottom left area, bulb close to the spirit crystals": 698054,
|
||||
"Kelp Forest bottom left area, Walker baby": 698186,
|
||||
"Kelp Forest bottom left area, Transturtle": 698212,
|
||||
}
|
||||
|
||||
locations_forest_bl_sc = {
|
||||
"Kelp Forest bottom left area, bulb close to the spirit crystals": 698054,
|
||||
"Kelp Forest bottom left area, Walker Baby": 698186,
|
||||
}
|
||||
|
||||
locations_forest_br = {
|
||||
"Kelp Forest bottom right area, Odd Container": 698168,
|
||||
}
|
||||
@@ -369,7 +376,7 @@ class AquariaLocations:
|
||||
|
||||
locations_sun_temple_r = {
|
||||
"Sun Temple, first bulb of the temple": 698091,
|
||||
"Sun Temple, bulb on the left part": 698092,
|
||||
"Sun Temple, bulb on the right part": 698092,
|
||||
"Sun Temple, bulb in the hidden room of the right part": 698093,
|
||||
"Sun Temple, Sun Key": 698182,
|
||||
}
|
||||
@@ -401,6 +408,9 @@ class AquariaLocations:
|
||||
"Abyss right area, bulb in the middle path": 698110,
|
||||
"Abyss right area, bulb behind the rock in the middle path": 698111,
|
||||
"Abyss right area, bulb in the left green room": 698112,
|
||||
}
|
||||
|
||||
locations_abyss_r_transturtle = {
|
||||
"Abyss right area, Transturtle": 698214,
|
||||
}
|
||||
|
||||
@@ -451,7 +461,7 @@ class AquariaLocations:
|
||||
|
||||
locations_body_c = {
|
||||
"The Body center area, breaking Li's cage": 698201,
|
||||
"The Body main area, bulb on the main path blocking tube": 698097,
|
||||
"The Body center area, bulb on the main path blocking tube": 698097,
|
||||
}
|
||||
|
||||
locations_body_l = {
|
||||
@@ -498,6 +508,7 @@ location_table = {
|
||||
**AquariaLocations.locations_skeleton_path_sc,
|
||||
**AquariaLocations.locations_arnassi,
|
||||
**AquariaLocations.locations_arnassi_path,
|
||||
**AquariaLocations.locations_arnassi_cave_transturtle,
|
||||
**AquariaLocations.locations_arnassi_crab_boss,
|
||||
**AquariaLocations.locations_sun_temple_l,
|
||||
**AquariaLocations.locations_sun_temple_r,
|
||||
@@ -508,6 +519,7 @@ location_table = {
|
||||
**AquariaLocations.locations_abyss_l,
|
||||
**AquariaLocations.locations_abyss_lb,
|
||||
**AquariaLocations.locations_abyss_r,
|
||||
**AquariaLocations.locations_abyss_r_transturtle,
|
||||
**AquariaLocations.locations_energy_temple_1,
|
||||
**AquariaLocations.locations_energy_temple_2,
|
||||
**AquariaLocations.locations_energy_temple_3,
|
||||
@@ -529,6 +541,7 @@ location_table = {
|
||||
**AquariaLocations.locations_forest_tr,
|
||||
**AquariaLocations.locations_forest_tr_fp,
|
||||
**AquariaLocations.locations_forest_bl,
|
||||
**AquariaLocations.locations_forest_bl_sc,
|
||||
**AquariaLocations.locations_forest_br,
|
||||
**AquariaLocations.locations_forest_boss,
|
||||
**AquariaLocations.locations_forest_boss_entrance,
|
||||
|
||||
@@ -5,7 +5,7 @@ Description: Manage options in the Aquaria game multiworld randomizer
|
||||
"""
|
||||
|
||||
from dataclasses import dataclass
|
||||
from Options import Toggle, Choice, Range, DeathLink, PerGameCommonOptions, DefaultOnToggle, StartInventoryPool
|
||||
from Options import Toggle, Choice, Range, PerGameCommonOptions, DefaultOnToggle, StartInventoryPool
|
||||
|
||||
|
||||
class IngredientRandomizer(Choice):
|
||||
@@ -111,6 +111,14 @@ class BindSongNeededToGetUnderRockBulb(Toggle):
|
||||
display_name = "Bind song needed to get sing bulbs under rocks"
|
||||
|
||||
|
||||
class BlindGoal(Toggle):
|
||||
"""
|
||||
Hide the goal's requirements from the help page so that you have to go to the last boss door to know
|
||||
what is needed to access the boss.
|
||||
"""
|
||||
display_name = "Hide the goal's requirements"
|
||||
|
||||
|
||||
class UnconfineHomeWater(Choice):
|
||||
"""
|
||||
Open the way out of the Home Water area so that Naija can go to open water and beyond without the bind song.
|
||||
@@ -142,4 +150,4 @@ class AquariaOptions(PerGameCommonOptions):
|
||||
dish_randomizer: DishRandomizer
|
||||
aquarian_translation: AquarianTranslation
|
||||
skip_first_vision: SkipFirstVision
|
||||
death_link: DeathLink
|
||||
blind_goal: BlindGoal
|
||||
|
||||
@@ -14,97 +14,112 @@ from worlds.generic.Rules import add_rule, set_rule
|
||||
|
||||
# Every condition to connect regions
|
||||
|
||||
def _has_hot_soup(state:CollectionState, player: int) -> bool:
|
||||
def _has_hot_soup(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has the hotsoup item"""
|
||||
return state.has("Hot soup", player)
|
||||
return state.has_any({"Hot soup", "Hot soup x 2"}, player)
|
||||
|
||||
|
||||
def _has_tongue_cleared(state:CollectionState, player: int) -> bool:
|
||||
def _has_tongue_cleared(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has the Body tongue cleared item"""
|
||||
return state.has("Body tongue cleared", player)
|
||||
|
||||
|
||||
def _has_sun_crystal(state:CollectionState, player: int) -> bool:
|
||||
def _has_sun_crystal(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has the Sun crystal item"""
|
||||
return state.has("Has sun crystal", player) and _has_bind_song(state, player)
|
||||
|
||||
|
||||
def _has_li(state:CollectionState, player: int) -> bool:
|
||||
def _has_li(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has Li in its team"""
|
||||
return state.has("Li and Li song", player)
|
||||
|
||||
|
||||
def _has_damaging_item(state:CollectionState, player: int) -> bool:
|
||||
def _has_damaging_item(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has the shield song item"""
|
||||
return state.has_any({"Energy form", "Nature form", "Beast form", "Li and Li song", "Baby Nautilus",
|
||||
"Baby Piranha", "Baby Blaster"}, player)
|
||||
return state.has_any({"Energy form", "Nature form", "Beast form", "Li and Li song", "Baby Nautilus",
|
||||
"Baby Piranha", "Baby Blaster"}, player)
|
||||
|
||||
|
||||
def _has_shield_song(state:CollectionState, player: int) -> bool:
|
||||
def _has_energy_attack_item(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has items that can do a lot of damage (enough to beat bosses)"""
|
||||
return _has_energy_form(state, player) or _has_dual_form(state, player)
|
||||
|
||||
|
||||
def _has_shield_song(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has the shield song item"""
|
||||
return state.has("Shield song", player)
|
||||
|
||||
|
||||
def _has_bind_song(state:CollectionState, player: int) -> bool:
|
||||
def _has_bind_song(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has the bind song item"""
|
||||
return state.has("Bind song", player)
|
||||
|
||||
|
||||
def _has_energy_form(state:CollectionState, player: int) -> bool:
|
||||
def _has_energy_form(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has the energy form item"""
|
||||
return state.has("Energy form", player)
|
||||
|
||||
|
||||
def _has_beast_form(state:CollectionState, player: int) -> bool:
|
||||
def _has_beast_form(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has the beast form item"""
|
||||
return state.has("Beast form", player)
|
||||
|
||||
|
||||
def _has_nature_form(state:CollectionState, player: int) -> bool:
|
||||
def _has_beast_and_soup_form(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has the beast form item"""
|
||||
return _has_beast_form(state, player) and _has_hot_soup(state, player)
|
||||
|
||||
|
||||
def _has_beast_form_or_arnassi_armor(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has the beast form item"""
|
||||
return _has_beast_form(state, player) or state.has("Arnassi Armor", player)
|
||||
|
||||
|
||||
def _has_nature_form(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has the nature form item"""
|
||||
return state.has("Nature form", player)
|
||||
|
||||
|
||||
def _has_sun_form(state:CollectionState, player: int) -> bool:
|
||||
def _has_sun_form(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has the sun form item"""
|
||||
return state.has("Sun form", player)
|
||||
|
||||
|
||||
def _has_light(state:CollectionState, player: int) -> bool:
|
||||
def _has_light(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has the light item"""
|
||||
return state.has("Baby Dumbo", player) or _has_sun_form(state, player)
|
||||
|
||||
|
||||
def _has_dual_form(state:CollectionState, player: int) -> bool:
|
||||
def _has_dual_form(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has the dual form item"""
|
||||
return _has_li(state, player) and state.has("Dual form", player)
|
||||
|
||||
|
||||
def _has_fish_form(state:CollectionState, player: int) -> bool:
|
||||
def _has_fish_form(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has the fish form item"""
|
||||
return state.has("Fish form", player)
|
||||
|
||||
|
||||
def _has_spirit_form(state:CollectionState, player: int) -> bool:
|
||||
def _has_spirit_form(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has the spirit form item"""
|
||||
return state.has("Spirit form", player)
|
||||
|
||||
|
||||
def _has_big_bosses(state:CollectionState, player: int) -> bool:
|
||||
def _has_big_bosses(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has beated every big bosses"""
|
||||
return state.has_all({"Fallen God beated", "Mithalan God beated", "Drunian God beated",
|
||||
"Sun God beated", "The Golem beated"}, player)
|
||||
"Sun God beated", "The Golem beated"}, player)
|
||||
|
||||
|
||||
def _has_mini_bosses(state:CollectionState, player: int) -> bool:
|
||||
def _has_mini_bosses(state: CollectionState, player: int) -> bool:
|
||||
"""`player` in `state` has beated every big bosses"""
|
||||
return state.has_all({"Nautilus Prime beated", "Blaster Peg Prime beated", "Mergog beated",
|
||||
"Mithalan priests beated", "Octopus Prime beated", "Crabbius Maximus beated",
|
||||
"Mantis Shrimp Prime beated", "King Jellyfish God Prime beated"}, player)
|
||||
"Mithalan priests beated", "Octopus Prime beated", "Crabbius Maximus beated",
|
||||
"Mantis Shrimp Prime beated", "King Jellyfish God Prime beated"}, player)
|
||||
|
||||
|
||||
def _has_secrets(state:CollectionState, player: int) -> bool:
|
||||
return state.has_all({"First secret obtained", "Second secret obtained", "Third secret obtained"},player)
|
||||
def _has_secrets(state: CollectionState, player: int) -> bool:
|
||||
return state.has_all({"First secret obtained", "Second secret obtained", "Third secret obtained"}, player)
|
||||
|
||||
|
||||
class AquariaRegions:
|
||||
@@ -134,6 +149,7 @@ class AquariaRegions:
|
||||
skeleton_path: Region
|
||||
skeleton_path_sc: Region
|
||||
arnassi: Region
|
||||
arnassi_cave_transturtle: Region
|
||||
arnassi_path: Region
|
||||
arnassi_crab_boss: Region
|
||||
simon: Region
|
||||
@@ -152,6 +168,7 @@ class AquariaRegions:
|
||||
forest_tr: Region
|
||||
forest_tr_fp: Region
|
||||
forest_bl: Region
|
||||
forest_bl_sc: Region
|
||||
forest_br: Region
|
||||
forest_boss: Region
|
||||
forest_boss_entrance: Region
|
||||
@@ -179,6 +196,7 @@ class AquariaRegions:
|
||||
abyss_l: Region
|
||||
abyss_lb: Region
|
||||
abyss_r: Region
|
||||
abyss_r_transturtle: Region
|
||||
ice_cave: Region
|
||||
bubble_cave: Region
|
||||
bubble_cave_boss: Region
|
||||
@@ -213,7 +231,7 @@ class AquariaRegions:
|
||||
"""
|
||||
|
||||
def __add_region(self, hint: str,
|
||||
locations: Optional[Dict[str, Optional[int]]]) -> Region:
|
||||
locations: Optional[Dict[str, int]]) -> Region:
|
||||
"""
|
||||
Create a new Region, add it to the `world` regions and return it.
|
||||
Be aware that this function have a side effect on ``world`.`regions`
|
||||
@@ -236,7 +254,7 @@ class AquariaRegions:
|
||||
self.home_water_nautilus = self.__add_region("Home Water, Nautilus nest",
|
||||
AquariaLocations.locations_home_water_nautilus)
|
||||
self.home_water_transturtle = self.__add_region("Home Water, turtle room",
|
||||
AquariaLocations.locations_home_water_transturtle)
|
||||
AquariaLocations.locations_home_water_transturtle)
|
||||
self.naija_home = self.__add_region("Naija's Home", AquariaLocations.locations_naija_home)
|
||||
self.song_cave = self.__add_region("Song Cave", AquariaLocations.locations_song_cave)
|
||||
|
||||
@@ -280,6 +298,8 @@ class AquariaRegions:
|
||||
self.arnassi = self.__add_region("Arnassi Ruins", AquariaLocations.locations_arnassi)
|
||||
self.arnassi_path = self.__add_region("Arnassi Ruins, back entrance path",
|
||||
AquariaLocations.locations_arnassi_path)
|
||||
self.arnassi_cave_transturtle = self.__add_region("Arnassi Ruins, transturtle area",
|
||||
AquariaLocations.locations_arnassi_cave_transturtle)
|
||||
self.arnassi_crab_boss = self.__add_region("Arnassi Ruins, Crabbius Maximus lair",
|
||||
AquariaLocations.locations_arnassi_crab_boss)
|
||||
|
||||
@@ -300,11 +320,11 @@ class AquariaRegions:
|
||||
AquariaLocations.locations_cathedral_l_sc)
|
||||
self.cathedral_r = self.__add_region("Mithalas Cathedral",
|
||||
AquariaLocations.locations_cathedral_r)
|
||||
self.cathedral_underground = self.__add_region("Mithalas Cathedral Underground area",
|
||||
self.cathedral_underground = self.__add_region("Mithalas Cathedral underground",
|
||||
AquariaLocations.locations_cathedral_underground)
|
||||
self.cathedral_boss_r = self.__add_region("Mithalas Cathedral, Mithalan God room",
|
||||
self.cathedral_boss_r = self.__add_region("Mithalas Cathedral, Mithalan God room", None)
|
||||
self.cathedral_boss_l = self.__add_region("Mithalas Cathedral, after Mithalan God room",
|
||||
AquariaLocations.locations_cathedral_boss)
|
||||
self.cathedral_boss_l = self.__add_region("Mithalas Cathedral, after Mithalan God room", None)
|
||||
|
||||
def __create_forest(self) -> None:
|
||||
"""
|
||||
@@ -320,6 +340,8 @@ class AquariaRegions:
|
||||
AquariaLocations.locations_forest_tr_fp)
|
||||
self.forest_bl = self.__add_region("Kelp Forest bottom left area",
|
||||
AquariaLocations.locations_forest_bl)
|
||||
self.forest_bl_sc = self.__add_region("Kelp Forest bottom left area, spirit crystals",
|
||||
AquariaLocations.locations_forest_bl_sc)
|
||||
self.forest_br = self.__add_region("Kelp Forest bottom right area",
|
||||
AquariaLocations.locations_forest_br)
|
||||
self.forest_sprite_cave = self.__add_region("Kelp Forest spirit cave",
|
||||
@@ -375,9 +397,9 @@ class AquariaRegions:
|
||||
self.sun_temple_r = self.__add_region("Sun Temple right area",
|
||||
AquariaLocations.locations_sun_temple_r)
|
||||
self.sun_temple_boss_path = self.__add_region("Sun Temple before boss area",
|
||||
AquariaLocations.locations_sun_temple_boss_path)
|
||||
AquariaLocations.locations_sun_temple_boss_path)
|
||||
self.sun_temple_boss = self.__add_region("Sun Temple boss area",
|
||||
AquariaLocations.locations_sun_temple_boss)
|
||||
AquariaLocations.locations_sun_temple_boss)
|
||||
|
||||
def __create_abyss(self) -> None:
|
||||
"""
|
||||
@@ -388,6 +410,8 @@ class AquariaRegions:
|
||||
AquariaLocations.locations_abyss_l)
|
||||
self.abyss_lb = self.__add_region("Abyss left bottom area", AquariaLocations.locations_abyss_lb)
|
||||
self.abyss_r = self.__add_region("Abyss right area", AquariaLocations.locations_abyss_r)
|
||||
self.abyss_r_transturtle = self.__add_region("Abyss right area, transturtle",
|
||||
AquariaLocations.locations_abyss_r_transturtle)
|
||||
self.ice_cave = self.__add_region("Ice Cave", AquariaLocations.locations_ice_cave)
|
||||
self.bubble_cave = self.__add_region("Bubble Cave", AquariaLocations.locations_bubble_cave)
|
||||
self.bubble_cave_boss = self.__add_region("Bubble Cave boss area", AquariaLocations.locations_bubble_cave_boss)
|
||||
@@ -407,7 +431,7 @@ class AquariaRegions:
|
||||
self.sunken_city_r = self.__add_region("Sunken City right area",
|
||||
AquariaLocations.locations_sunken_city_r)
|
||||
self.sunken_city_boss = self.__add_region("Sunken City boss area",
|
||||
AquariaLocations.locations_sunken_city_boss)
|
||||
AquariaLocations.locations_sunken_city_boss)
|
||||
|
||||
def __create_body(self) -> None:
|
||||
"""
|
||||
@@ -427,7 +451,7 @@ class AquariaRegions:
|
||||
self.final_boss_tube = self.__add_region("The Body, final boss area turtle room",
|
||||
AquariaLocations.locations_final_boss_tube)
|
||||
self.final_boss = self.__add_region("The Body, final boss",
|
||||
AquariaLocations.locations_final_boss)
|
||||
AquariaLocations.locations_final_boss)
|
||||
self.final_boss_end = self.__add_region("The Body, final boss area", None)
|
||||
|
||||
def __connect_one_way_regions(self, source_name: str, destination_name: str,
|
||||
@@ -455,8 +479,8 @@ class AquariaRegions:
|
||||
"""
|
||||
Connect entrances of the different regions around `home_water`
|
||||
"""
|
||||
self.__connect_regions("Menu", "Verse Cave right area",
|
||||
self.menu, self.verse_cave_r)
|
||||
self.__connect_one_way_regions("Menu", "Verse Cave right area",
|
||||
self.menu, self.verse_cave_r)
|
||||
self.__connect_regions("Verse Cave left area", "Verse Cave right area",
|
||||
self.verse_cave_l, self.verse_cave_r)
|
||||
self.__connect_regions("Verse Cave", "Home Water", self.verse_cave_l, self.home_water)
|
||||
@@ -464,7 +488,8 @@ class AquariaRegions:
|
||||
self.__connect_regions("Home Water", "Song Cave", self.home_water, self.song_cave)
|
||||
self.__connect_regions("Home Water", "Home Water, nautilus nest",
|
||||
self.home_water, self.home_water_nautilus,
|
||||
lambda state: _has_energy_form(state, self.player) and _has_bind_song(state, self.player))
|
||||
lambda state: _has_energy_attack_item(state, self.player) and
|
||||
_has_bind_song(state, self.player))
|
||||
self.__connect_regions("Home Water", "Home Water transturtle room",
|
||||
self.home_water, self.home_water_transturtle)
|
||||
self.__connect_regions("Home Water", "Energy Temple first area",
|
||||
@@ -472,7 +497,7 @@ class AquariaRegions:
|
||||
lambda state: _has_bind_song(state, self.player))
|
||||
self.__connect_regions("Home Water", "Energy Temple_altar",
|
||||
self.home_water, self.energy_temple_altar,
|
||||
lambda state: _has_energy_form(state, self.player) and
|
||||
lambda state: _has_energy_attack_item(state, self.player) and
|
||||
_has_bind_song(state, self.player))
|
||||
self.__connect_regions("Energy Temple first area", "Energy Temple second area",
|
||||
self.energy_temple_1, self.energy_temple_2,
|
||||
@@ -482,28 +507,28 @@ class AquariaRegions:
|
||||
lambda state: _has_fish_form(state, self.player))
|
||||
self.__connect_regions("Energy Temple idol room", "Energy Temple boss area",
|
||||
self.energy_temple_idol, self.energy_temple_boss,
|
||||
lambda state: _has_energy_form(state, self.player))
|
||||
lambda state: _has_energy_attack_item(state, self.player) and
|
||||
_has_fish_form(state, self.player))
|
||||
self.__connect_one_way_regions("Energy Temple first area", "Energy Temple boss area",
|
||||
self.energy_temple_1, self.energy_temple_boss,
|
||||
lambda state: _has_beast_form(state, self.player) and
|
||||
_has_energy_form(state, self.player))
|
||||
_has_energy_attack_item(state, self.player))
|
||||
self.__connect_one_way_regions("Energy Temple boss area", "Energy Temple first area",
|
||||
self.energy_temple_boss, self.energy_temple_1,
|
||||
lambda state: _has_energy_form(state, self.player))
|
||||
lambda state: _has_energy_attack_item(state, self.player))
|
||||
self.__connect_regions("Energy Temple second area", "Energy Temple third area",
|
||||
self.energy_temple_2, self.energy_temple_3,
|
||||
lambda state: _has_bind_song(state, self.player) and
|
||||
_has_energy_form(state, self.player))
|
||||
lambda state: _has_energy_form(state, self.player))
|
||||
self.__connect_regions("Energy Temple boss area", "Energy Temple blaster room",
|
||||
self.energy_temple_boss, self.energy_temple_blaster_room,
|
||||
lambda state: _has_nature_form(state, self.player) and
|
||||
_has_bind_song(state, self.player) and
|
||||
_has_energy_form(state, self.player))
|
||||
_has_energy_attack_item(state, self.player))
|
||||
self.__connect_regions("Energy Temple first area", "Energy Temple blaster room",
|
||||
self.energy_temple_1, self.energy_temple_blaster_room,
|
||||
lambda state: _has_nature_form(state, self.player) and
|
||||
_has_bind_song(state, self.player) and
|
||||
_has_energy_form(state, self.player) and
|
||||
_has_energy_attack_item(state, self.player) and
|
||||
_has_beast_form(state, self.player))
|
||||
self.__connect_regions("Home Water", "Open Water top left area",
|
||||
self.home_water, self.openwater_tl)
|
||||
@@ -520,7 +545,7 @@ class AquariaRegions:
|
||||
self.openwater_tl, self.forest_br)
|
||||
self.__connect_regions("Open Water top right area", "Open Water top right area, turtle room",
|
||||
self.openwater_tr, self.openwater_tr_turtle,
|
||||
lambda state: _has_beast_form(state, self.player))
|
||||
lambda state: _has_beast_form_or_arnassi_armor(state, self.player))
|
||||
self.__connect_regions("Open Water top right area", "Open Water bottom right area",
|
||||
self.openwater_tr, self.openwater_br)
|
||||
self.__connect_regions("Open Water top right area", "Mithalas City",
|
||||
@@ -529,10 +554,9 @@ class AquariaRegions:
|
||||
self.openwater_tr, self.veil_bl)
|
||||
self.__connect_one_way_regions("Open Water top right area", "Veil bottom right",
|
||||
self.openwater_tr, self.veil_br,
|
||||
lambda state: _has_beast_form(state, self.player))
|
||||
lambda state: _has_beast_form_or_arnassi_armor(state, self.player))
|
||||
self.__connect_one_way_regions("Veil bottom right", "Open Water top right area",
|
||||
self.veil_br, self.openwater_tr,
|
||||
lambda state: _has_beast_form(state, self.player))
|
||||
self.veil_br, self.openwater_tr)
|
||||
self.__connect_regions("Open Water bottom left area", "Open Water bottom right area",
|
||||
self.openwater_bl, self.openwater_br)
|
||||
self.__connect_regions("Open Water bottom left area", "Skeleton path",
|
||||
@@ -551,10 +575,14 @@ class AquariaRegions:
|
||||
self.arnassi, self.openwater_br)
|
||||
self.__connect_regions("Arnassi", "Arnassi path",
|
||||
self.arnassi, self.arnassi_path)
|
||||
self.__connect_regions("Arnassi ruins, transturtle area", "Arnassi path",
|
||||
self.arnassi_cave_transturtle, self.arnassi_path,
|
||||
lambda state: _has_fish_form(state, self.player))
|
||||
self.__connect_one_way_regions("Arnassi path", "Arnassi crab boss area",
|
||||
self.arnassi_path, self.arnassi_crab_boss,
|
||||
lambda state: _has_beast_form(state, self.player) and
|
||||
_has_energy_form(state, self.player))
|
||||
lambda state: _has_beast_form_or_arnassi_armor(state, self.player) and
|
||||
(_has_energy_attack_item(state, self.player) or
|
||||
_has_nature_form(state, self.player)))
|
||||
self.__connect_one_way_regions("Arnassi crab boss area", "Arnassi path",
|
||||
self.arnassi_crab_boss, self.arnassi_path)
|
||||
|
||||
@@ -564,61 +592,62 @@ class AquariaRegions:
|
||||
"""
|
||||
self.__connect_one_way_regions("Mithalas City", "Mithalas City top path",
|
||||
self.mithalas_city, self.mithalas_city_top_path,
|
||||
lambda state: _has_beast_form(state, self.player))
|
||||
lambda state: _has_beast_form_or_arnassi_armor(state, self.player))
|
||||
self.__connect_one_way_regions("Mithalas City_top_path", "Mithalas City",
|
||||
self.mithalas_city_top_path, self.mithalas_city)
|
||||
self.__connect_regions("Mithalas City", "Mithalas City home with fishpass",
|
||||
self.mithalas_city, self.mithalas_city_fishpass,
|
||||
lambda state: _has_fish_form(state, self.player))
|
||||
self.__connect_regions("Mithalas City", "Mithalas castle",
|
||||
self.mithalas_city, self.cathedral_l,
|
||||
lambda state: _has_fish_form(state, self.player))
|
||||
self.mithalas_city, self.cathedral_l)
|
||||
self.__connect_one_way_regions("Mithalas City top path", "Mithalas castle, flower tube",
|
||||
self.mithalas_city_top_path,
|
||||
self.cathedral_l_tube,
|
||||
lambda state: _has_nature_form(state, self.player) and
|
||||
_has_energy_form(state, self.player))
|
||||
_has_energy_attack_item(state, self.player))
|
||||
self.__connect_one_way_regions("Mithalas castle, flower tube area", "Mithalas City top path",
|
||||
self.cathedral_l_tube,
|
||||
self.mithalas_city_top_path,
|
||||
lambda state: _has_beast_form(state, self.player) and
|
||||
_has_nature_form(state, self.player))
|
||||
lambda state: _has_nature_form(state, self.player))
|
||||
self.__connect_one_way_regions("Mithalas castle flower tube area", "Mithalas castle, spirit crystals",
|
||||
self.cathedral_l_tube, self.cathedral_l_sc,
|
||||
lambda state: _has_spirit_form(state, self.player))
|
||||
self.cathedral_l_tube, self.cathedral_l_sc,
|
||||
lambda state: _has_spirit_form(state, self.player))
|
||||
self.__connect_one_way_regions("Mithalas castle_flower tube area", "Mithalas castle",
|
||||
self.cathedral_l_tube, self.cathedral_l,
|
||||
lambda state: _has_spirit_form(state, self.player))
|
||||
self.cathedral_l_tube, self.cathedral_l,
|
||||
lambda state: _has_spirit_form(state, self.player))
|
||||
self.__connect_regions("Mithalas castle", "Mithalas castle, spirit crystals",
|
||||
self.cathedral_l, self.cathedral_l_sc,
|
||||
lambda state: _has_spirit_form(state, self.player))
|
||||
self.__connect_regions("Mithalas castle", "Cathedral boss left area",
|
||||
self.cathedral_l, self.cathedral_boss_l,
|
||||
lambda state: _has_beast_form(state, self.player) and
|
||||
_has_energy_form(state, self.player) and
|
||||
_has_bind_song(state, self.player))
|
||||
self.__connect_regions("Mithalas castle", "Cathedral underground",
|
||||
self.__connect_one_way_regions("Mithalas castle", "Cathedral boss right area",
|
||||
self.cathedral_l, self.cathedral_boss_r,
|
||||
lambda state: _has_beast_form(state, self.player))
|
||||
self.__connect_one_way_regions("Cathedral boss left area", "Mithalas castle",
|
||||
self.cathedral_boss_l, self.cathedral_l,
|
||||
lambda state: _has_beast_form(state, self.player))
|
||||
self.__connect_regions("Mithalas castle", "Mithalas Cathedral underground",
|
||||
self.cathedral_l, self.cathedral_underground,
|
||||
lambda state: _has_beast_form(state, self.player) and
|
||||
_has_bind_song(state, self.player))
|
||||
self.__connect_regions("Mithalas castle", "Cathedral right area",
|
||||
self.cathedral_l, self.cathedral_r,
|
||||
lambda state: _has_bind_song(state, self.player) and
|
||||
_has_energy_form(state, self.player))
|
||||
self.__connect_regions("Cathedral right area", "Cathedral underground",
|
||||
self.cathedral_r, self.cathedral_underground,
|
||||
lambda state: _has_energy_form(state, self.player))
|
||||
self.__connect_one_way_regions("Cathedral underground", "Cathedral boss left area",
|
||||
self.cathedral_underground, self.cathedral_boss_r,
|
||||
lambda state: _has_energy_form(state, self.player) and
|
||||
_has_bind_song(state, self.player))
|
||||
self.__connect_one_way_regions("Cathedral boss left area", "Cathedral underground",
|
||||
lambda state: _has_beast_form(state, self.player))
|
||||
self.__connect_one_way_regions("Mithalas castle", "Mithalas Cathedral",
|
||||
self.cathedral_l, self.cathedral_r,
|
||||
lambda state: _has_bind_song(state, self.player) and
|
||||
_has_energy_attack_item(state, self.player))
|
||||
self.__connect_one_way_regions("Mithalas Cathedral", "Mithalas Cathedral underground",
|
||||
self.cathedral_r, self.cathedral_underground)
|
||||
self.__connect_one_way_regions("Mithalas Cathedral underground", "Mithalas Cathedral",
|
||||
self.cathedral_underground, self.cathedral_r,
|
||||
lambda state: _has_beast_form(state, self.player) and
|
||||
_has_energy_attack_item(state, self.player))
|
||||
self.__connect_one_way_regions("Mithalas Cathedral underground", "Cathedral boss right area",
|
||||
self.cathedral_underground, self.cathedral_boss_r)
|
||||
self.__connect_one_way_regions("Cathedral boss right area", "Mithalas Cathedral underground",
|
||||
self.cathedral_boss_r, self.cathedral_underground,
|
||||
lambda state: _has_beast_form(state, self.player))
|
||||
self.__connect_regions("Cathedral boss right area", "Cathedral boss left area",
|
||||
self.__connect_one_way_regions("Cathedral boss right area", "Cathedral boss left area",
|
||||
self.cathedral_boss_r, self.cathedral_boss_l,
|
||||
lambda state: _has_bind_song(state, self.player) and
|
||||
_has_energy_form(state, self.player))
|
||||
_has_energy_attack_item(state, self.player))
|
||||
self.__connect_one_way_regions("Cathedral boss left area", "Cathedral boss right area",
|
||||
self.cathedral_boss_l, self.cathedral_boss_r)
|
||||
|
||||
def __connect_forest_regions(self) -> None:
|
||||
"""
|
||||
@@ -628,6 +657,12 @@ class AquariaRegions:
|
||||
self.forest_br, self.veil_bl)
|
||||
self.__connect_regions("Forest bottom right", "Forest bottom left area",
|
||||
self.forest_br, self.forest_bl)
|
||||
self.__connect_one_way_regions("Forest bottom left area", "Forest bottom left area, spirit crystals",
|
||||
self.forest_bl, self.forest_bl_sc,
|
||||
lambda state: _has_energy_attack_item(state, self.player) or
|
||||
_has_fish_form(state, self.player))
|
||||
self.__connect_one_way_regions("Forest bottom left area, spirit crystals", "Forest bottom left area",
|
||||
self.forest_bl_sc, self.forest_bl)
|
||||
self.__connect_regions("Forest bottom right", "Forest top right area",
|
||||
self.forest_br, self.forest_tr)
|
||||
self.__connect_regions("Forest bottom left area", "Forest fish cave",
|
||||
@@ -641,7 +676,7 @@ class AquariaRegions:
|
||||
self.forest_tl, self.forest_tl_fp,
|
||||
lambda state: _has_nature_form(state, self.player) and
|
||||
_has_bind_song(state, self.player) and
|
||||
_has_energy_form(state, self.player) and
|
||||
_has_energy_attack_item(state, self.player) and
|
||||
_has_fish_form(state, self.player))
|
||||
self.__connect_regions("Forest top left area", "Forest top right area",
|
||||
self.forest_tl, self.forest_tr)
|
||||
@@ -649,7 +684,7 @@ class AquariaRegions:
|
||||
self.forest_tl, self.forest_boss_entrance)
|
||||
self.__connect_regions("Forest boss area", "Forest boss entrance",
|
||||
self.forest_boss, self.forest_boss_entrance,
|
||||
lambda state: _has_energy_form(state, self.player))
|
||||
lambda state: _has_energy_attack_item(state, self.player))
|
||||
self.__connect_regions("Forest top right area", "Forest top right area fish pass",
|
||||
self.forest_tr, self.forest_tr_fp,
|
||||
lambda state: _has_fish_form(state, self.player))
|
||||
@@ -663,7 +698,7 @@ class AquariaRegions:
|
||||
self.__connect_regions("Fermog cave", "Fermog boss",
|
||||
self.mermog_cave, self.mermog_boss,
|
||||
lambda state: _has_beast_form(state, self.player) and
|
||||
_has_energy_form(state, self.player))
|
||||
_has_energy_attack_item(state, self.player))
|
||||
|
||||
def __connect_veil_regions(self) -> None:
|
||||
"""
|
||||
@@ -681,8 +716,7 @@ class AquariaRegions:
|
||||
self.veil_b_sc, self.veil_br,
|
||||
lambda state: _has_spirit_form(state, self.player))
|
||||
self.__connect_regions("Veil bottom right", "Veil top left area",
|
||||
self.veil_br, self.veil_tl,
|
||||
lambda state: _has_beast_form(state, self.player))
|
||||
self.veil_br, self.veil_tl)
|
||||
self.__connect_regions("Veil top left area", "Veil_top left area, fish pass",
|
||||
self.veil_tl, self.veil_tl_fp,
|
||||
lambda state: _has_fish_form(state, self.player))
|
||||
@@ -691,20 +725,25 @@ class AquariaRegions:
|
||||
self.__connect_regions("Veil top left area", "Turtle cave",
|
||||
self.veil_tl, self.turtle_cave)
|
||||
self.__connect_regions("Turtle cave", "Turtle cave Bubble Cliff",
|
||||
self.turtle_cave, self.turtle_cave_bubble,
|
||||
lambda state: _has_beast_form(state, self.player))
|
||||
self.turtle_cave, self.turtle_cave_bubble)
|
||||
self.__connect_regions("Veil right of sun temple", "Sun Temple right area",
|
||||
self.veil_tr_r, self.sun_temple_r)
|
||||
self.__connect_regions("Sun Temple right area", "Sun Temple left area",
|
||||
self.sun_temple_r, self.sun_temple_l,
|
||||
lambda state: _has_bind_song(state, self.player))
|
||||
self.__connect_one_way_regions("Sun Temple right area", "Sun Temple left area",
|
||||
self.sun_temple_r, self.sun_temple_l,
|
||||
lambda state: _has_bind_song(state, self.player) or
|
||||
_has_light(state, self.player))
|
||||
self.__connect_one_way_regions("Sun Temple left area", "Sun Temple right area",
|
||||
self.sun_temple_l, self.sun_temple_r,
|
||||
lambda state: _has_light(state, self.player))
|
||||
self.__connect_regions("Sun Temple left area", "Veil left of sun temple",
|
||||
self.sun_temple_l, self.veil_tr_l)
|
||||
self.__connect_regions("Sun Temple left area", "Sun Temple before boss area",
|
||||
self.sun_temple_l, self.sun_temple_boss_path)
|
||||
self.sun_temple_l, self.sun_temple_boss_path,
|
||||
lambda state: _has_light(state, self.player) or
|
||||
_has_sun_crystal(state, self.player))
|
||||
self.__connect_regions("Sun Temple before boss area", "Sun Temple boss area",
|
||||
self.sun_temple_boss_path, self.sun_temple_boss,
|
||||
lambda state: _has_energy_form(state, self.player))
|
||||
lambda state: _has_energy_attack_item(state, self.player))
|
||||
self.__connect_one_way_regions("Sun Temple boss area", "Veil left of sun temple",
|
||||
self.sun_temple_boss, self.veil_tr_l)
|
||||
self.__connect_regions("Veil left of sun temple", "Octo cave top path",
|
||||
@@ -712,7 +751,7 @@ class AquariaRegions:
|
||||
lambda state: _has_fish_form(state, self.player) and
|
||||
_has_sun_form(state, self.player) and
|
||||
_has_beast_form(state, self.player) and
|
||||
_has_energy_form(state, self.player))
|
||||
_has_energy_attack_item(state, self.player))
|
||||
self.__connect_regions("Veil left of sun temple", "Octo cave bottom path",
|
||||
self.veil_tr_l, self.octo_cave_b,
|
||||
lambda state: _has_fish_form(state, self.player))
|
||||
@@ -728,16 +767,22 @@ class AquariaRegions:
|
||||
self.abyss_lb, self.sunken_city_r,
|
||||
lambda state: _has_li(state, self.player))
|
||||
self.__connect_one_way_regions("Abyss left bottom area", "Body center area",
|
||||
self.abyss_lb, self.body_c,
|
||||
lambda state: _has_tongue_cleared(state, self.player))
|
||||
self.abyss_lb, self.body_c,
|
||||
lambda state: _has_tongue_cleared(state, self.player))
|
||||
self.__connect_one_way_regions("Body center area", "Abyss left bottom area",
|
||||
self.body_c, self.abyss_lb)
|
||||
self.body_c, self.abyss_lb)
|
||||
self.__connect_regions("Abyss left area", "King jellyfish cave",
|
||||
self.abyss_l, self.king_jellyfish_cave,
|
||||
lambda state: _has_energy_form(state, self.player) and
|
||||
_has_beast_form(state, self.player))
|
||||
lambda state: (_has_energy_form(state, self.player) and
|
||||
_has_beast_form(state, self.player)) or
|
||||
_has_dual_form(state, self.player))
|
||||
self.__connect_regions("Abyss left area", "Abyss right area",
|
||||
self.abyss_l, self.abyss_r)
|
||||
self.__connect_one_way_regions("Abyss right area", "Abyss right area, transturtle",
|
||||
self.abyss_r, self.abyss_r_transturtle)
|
||||
self.__connect_one_way_regions("Abyss right area, transturtle", "Abyss right area",
|
||||
self.abyss_r_transturtle, self.abyss_r,
|
||||
lambda state: _has_light(state, self.player))
|
||||
self.__connect_regions("Abyss right area", "Inside the whale",
|
||||
self.abyss_r, self.whale,
|
||||
lambda state: _has_spirit_form(state, self.player) and
|
||||
@@ -747,13 +792,14 @@ class AquariaRegions:
|
||||
lambda state: _has_spirit_form(state, self.player) and
|
||||
_has_sun_form(state, self.player) and
|
||||
_has_bind_song(state, self.player) and
|
||||
_has_energy_form(state, self.player))
|
||||
_has_energy_attack_item(state, self.player))
|
||||
self.__connect_regions("Abyss right area", "Ice Cave",
|
||||
self.abyss_r, self.ice_cave,
|
||||
lambda state: _has_spirit_form(state, self.player))
|
||||
self.__connect_regions("Abyss right area", "Bubble Cave",
|
||||
self.__connect_regions("Ice cave", "Bubble Cave",
|
||||
self.ice_cave, self.bubble_cave,
|
||||
lambda state: _has_beast_form(state, self.player))
|
||||
lambda state: _has_beast_form(state, self.player) or
|
||||
_has_hot_soup(state, self.player))
|
||||
self.__connect_regions("Bubble Cave boss area", "Bubble Cave",
|
||||
self.bubble_cave, self.bubble_cave_boss,
|
||||
lambda state: _has_nature_form(state, self.player) and _has_bind_song(state, self.player)
|
||||
@@ -772,7 +818,7 @@ class AquariaRegions:
|
||||
self.sunken_city_l, self.sunken_city_boss,
|
||||
lambda state: _has_beast_form(state, self.player) and
|
||||
_has_sun_form(state, self.player) and
|
||||
_has_energy_form(state, self.player) and
|
||||
_has_energy_attack_item(state, self.player) and
|
||||
_has_bind_song(state, self.player))
|
||||
|
||||
def __connect_body_regions(self) -> None:
|
||||
@@ -780,11 +826,13 @@ class AquariaRegions:
|
||||
Connect entrances of the different regions around The Body
|
||||
"""
|
||||
self.__connect_regions("Body center area", "Body left area",
|
||||
self.body_c, self.body_l)
|
||||
self.body_c, self.body_l,
|
||||
lambda state: _has_energy_form(state, self.player))
|
||||
self.__connect_regions("Body center area", "Body right area top path",
|
||||
self.body_c, self.body_rt)
|
||||
self.__connect_regions("Body center area", "Body right area bottom path",
|
||||
self.body_c, self.body_rb)
|
||||
self.body_c, self.body_rb,
|
||||
lambda state: _has_energy_form(state, self.player))
|
||||
self.__connect_regions("Body center area", "Body bottom area",
|
||||
self.body_c, self.body_b,
|
||||
lambda state: _has_dual_form(state, self.player))
|
||||
@@ -803,22 +851,12 @@ class AquariaRegions:
|
||||
self.__connect_one_way_regions("final boss third form area", "final boss end",
|
||||
self.final_boss, self.final_boss_end)
|
||||
|
||||
def __connect_transturtle(self, item_source: str, item_target: str, region_source: Region, region_target: Region,
|
||||
rule=None) -> None:
|
||||
def __connect_transturtle(self, item_source: str, item_target: str, region_source: Region,
|
||||
region_target: Region) -> None:
|
||||
"""Connect a single transturtle to another one"""
|
||||
if item_source != item_target:
|
||||
if rule is None:
|
||||
self.__connect_one_way_regions(item_source, item_target, region_source, region_target,
|
||||
lambda state: state.has(item_target, self.player))
|
||||
else:
|
||||
self.__connect_one_way_regions(item_source, item_target, region_source, region_target, rule)
|
||||
|
||||
def __connect_arnassi_path_transturtle(self, item_source: str, item_target: str, region_source: Region,
|
||||
region_target: Region) -> None:
|
||||
"""Connect the Arnassi Ruins transturtle to another one"""
|
||||
self.__connect_one_way_regions(item_source, item_target, region_source, region_target,
|
||||
lambda state: state.has(item_target, self.player) and
|
||||
_has_fish_form(state, self.player))
|
||||
self.__connect_one_way_regions(item_source, item_target, region_source, region_target,
|
||||
lambda state: state.has(item_target, self.player))
|
||||
|
||||
def _connect_transturtle_to_other(self, item: str, region: Region) -> None:
|
||||
"""Connect a single transturtle to all others"""
|
||||
@@ -827,24 +865,10 @@ class AquariaRegions:
|
||||
self.__connect_transturtle(item, "Transturtle Open Water top right", region, self.openwater_tr_turtle)
|
||||
self.__connect_transturtle(item, "Transturtle Forest bottom left", region, self.forest_bl)
|
||||
self.__connect_transturtle(item, "Transturtle Home Water", region, self.home_water_transturtle)
|
||||
self.__connect_transturtle(item, "Transturtle Abyss right", region, self.abyss_r)
|
||||
self.__connect_transturtle(item, "Transturtle Abyss right", region, self.abyss_r_transturtle)
|
||||
self.__connect_transturtle(item, "Transturtle Final Boss", region, self.final_boss_tube)
|
||||
self.__connect_transturtle(item, "Transturtle Simon Says", region, self.simon)
|
||||
self.__connect_transturtle(item, "Transturtle Arnassi Ruins", region, self.arnassi_path,
|
||||
lambda state: state.has("Transturtle Arnassi Ruins", self.player) and
|
||||
_has_fish_form(state, self.player))
|
||||
|
||||
def _connect_arnassi_path_transturtle_to_other(self, item: str, region: Region) -> None:
|
||||
"""Connect the Arnassi Ruins transturtle to all others"""
|
||||
self.__connect_arnassi_path_transturtle(item, "Transturtle Veil top left", region, self.veil_tl)
|
||||
self.__connect_arnassi_path_transturtle(item, "Transturtle Veil top right", region, self.veil_tr_l)
|
||||
self.__connect_arnassi_path_transturtle(item, "Transturtle Open Water top right", region,
|
||||
self.openwater_tr_turtle)
|
||||
self.__connect_arnassi_path_transturtle(item, "Transturtle Forest bottom left", region, self.forest_bl)
|
||||
self.__connect_arnassi_path_transturtle(item, "Transturtle Home Water", region, self.home_water_transturtle)
|
||||
self.__connect_arnassi_path_transturtle(item, "Transturtle Abyss right", region, self.abyss_r)
|
||||
self.__connect_arnassi_path_transturtle(item, "Transturtle Final Boss", region, self.final_boss_tube)
|
||||
self.__connect_arnassi_path_transturtle(item, "Transturtle Simon Says", region, self.simon)
|
||||
self.__connect_transturtle(item, "Transturtle Arnassi Ruins", region, self.arnassi_cave_transturtle)
|
||||
|
||||
def __connect_transturtles(self) -> None:
|
||||
"""Connect every transturtle with others"""
|
||||
@@ -853,10 +877,10 @@ class AquariaRegions:
|
||||
self._connect_transturtle_to_other("Transturtle Open Water top right", self.openwater_tr_turtle)
|
||||
self._connect_transturtle_to_other("Transturtle Forest bottom left", self.forest_bl)
|
||||
self._connect_transturtle_to_other("Transturtle Home Water", self.home_water_transturtle)
|
||||
self._connect_transturtle_to_other("Transturtle Abyss right", self.abyss_r)
|
||||
self._connect_transturtle_to_other("Transturtle Abyss right", self.abyss_r_transturtle)
|
||||
self._connect_transturtle_to_other("Transturtle Final Boss", self.final_boss_tube)
|
||||
self._connect_transturtle_to_other("Transturtle Simon Says", self.simon)
|
||||
self._connect_arnassi_path_transturtle_to_other("Transturtle Arnassi Ruins", self.arnassi_path)
|
||||
self._connect_transturtle_to_other("Transturtle Arnassi Ruins", self.arnassi_cave_transturtle)
|
||||
|
||||
def connect_regions(self) -> None:
|
||||
"""
|
||||
@@ -893,7 +917,7 @@ class AquariaRegions:
|
||||
self.__add_event_location(self.energy_temple_boss,
|
||||
"Beating Fallen God",
|
||||
"Fallen God beated")
|
||||
self.__add_event_location(self.cathedral_boss_r,
|
||||
self.__add_event_location(self.cathedral_boss_l,
|
||||
"Beating Mithalan God",
|
||||
"Mithalan God beated")
|
||||
self.__add_event_location(self.forest_boss,
|
||||
@@ -970,8 +994,9 @@ class AquariaRegions:
|
||||
"""Since Urns need to be broken, add a damaging item to rules"""
|
||||
add_rule(self.multiworld.get_location("Open Water top right area, first urn in the Mithalas exit", self.player),
|
||||
lambda state: _has_damaging_item(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Open Water top right area, second urn in the Mithalas exit", self.player),
|
||||
lambda state: _has_damaging_item(state, self.player))
|
||||
add_rule(
|
||||
self.multiworld.get_location("Open Water top right area, second urn in the Mithalas exit", self.player),
|
||||
lambda state: _has_damaging_item(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Open Water top right area, third urn in the Mithalas exit", self.player),
|
||||
lambda state: _has_damaging_item(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Mithalas City, first urn in one of the homes", self.player),
|
||||
@@ -1019,66 +1044,46 @@ class AquariaRegions:
|
||||
Modify rules for location that need soup
|
||||
"""
|
||||
add_rule(self.multiworld.get_location("Turtle cave, Urchin Costume", self.player),
|
||||
lambda state: _has_hot_soup(state, self.player) and _has_beast_form(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Sun Worm path, first cliff bulb", self.player),
|
||||
lambda state: _has_hot_soup(state, self.player) and _has_beast_form(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Sun Worm path, second cliff bulb", self.player),
|
||||
lambda state: _has_hot_soup(state, self.player) and _has_beast_form(state, self.player))
|
||||
lambda state: _has_hot_soup(state, self.player))
|
||||
add_rule(self.multiworld.get_location("The Veil top right area, bulb at the top of the waterfall", self.player),
|
||||
lambda state: _has_hot_soup(state, self.player) and _has_beast_form(state, self.player))
|
||||
lambda state: _has_beast_and_soup_form(state, self.player))
|
||||
|
||||
def __adjusting_under_rock_location(self) -> None:
|
||||
"""
|
||||
Modify rules implying bind song needed for bulb under rocks
|
||||
"""
|
||||
add_rule(self.multiworld.get_location("Home Water, bulb under the rock in the left path from the Verse Cave",
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Verse Cave left area, bulb under the rock at the end of the path",
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Naija's Home, bulb under the rock at the right of the main path",
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Song Cave, bulb under the rock in the path to the singing statues",
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Song Cave, bulb under the rock close to the song door",
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Energy Temple second area, bulb under the rock",
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Open Water top left area, bulb under the rock in the right path",
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Open Water top left area, bulb under the rock in the left path",
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Kelp Forest top right area, bulb under the rock in the right path",
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(self.multiworld.get_location("The Veil top left area, bulb under the rock in the top right path",
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Abyss right area, bulb behind the rock in the whale room",
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Abyss right area, bulb in the middle path",
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(self.multiworld.get_location("The Veil top left area, bulb under the rock in the top right path",
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
|
||||
def __adjusting_light_in_dark_place_rules(self) -> None:
|
||||
add_rule(self.multiworld.get_location("Kelp Forest top right area, Black Pearl", self.player),
|
||||
lambda state: _has_light(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Kelp Forest bottom right area, Odd Container", self.player),
|
||||
lambda state: _has_light(state, self.player))
|
||||
add_rule(self.multiworld.get_entrance("Transturtle Veil top left to Transturtle Abyss right", self.player),
|
||||
lambda state: _has_light(state, self.player))
|
||||
add_rule(self.multiworld.get_entrance("Transturtle Open Water top right to Transturtle Abyss right", self.player),
|
||||
lambda state: _has_light(state, self.player))
|
||||
add_rule(self.multiworld.get_entrance("Transturtle Veil top right to Transturtle Abyss right", self.player),
|
||||
lambda state: _has_light(state, self.player))
|
||||
add_rule(self.multiworld.get_entrance("Transturtle Forest bottom left to Transturtle Abyss right", self.player),
|
||||
lambda state: _has_light(state, self.player))
|
||||
add_rule(self.multiworld.get_entrance("Transturtle Home Water to Transturtle Abyss right", self.player),
|
||||
lambda state: _has_light(state, self.player))
|
||||
add_rule(self.multiworld.get_entrance("Transturtle Final Boss to Transturtle Abyss right", self.player),
|
||||
lambda state: _has_light(state, self.player))
|
||||
add_rule(self.multiworld.get_entrance("Transturtle Simon Says to Transturtle Abyss right", self.player),
|
||||
lambda state: _has_light(state, self.player))
|
||||
add_rule(self.multiworld.get_entrance("Transturtle Arnassi Ruins to Transturtle Abyss right", self.player),
|
||||
lambda state: _has_light(state, self.player))
|
||||
add_rule(self.multiworld.get_entrance("Body center area to Abyss left bottom area", self.player),
|
||||
lambda state: _has_light(state, self.player))
|
||||
add_rule(self.multiworld.get_entrance("Veil left of sun temple to Octo cave top path", self.player),
|
||||
@@ -1097,12 +1102,14 @@ class AquariaRegions:
|
||||
def __adjusting_manual_rules(self) -> None:
|
||||
add_rule(self.multiworld.get_location("Mithalas Cathedral, Mithalan Dress", self.player),
|
||||
lambda state: _has_beast_form(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Open Water bottom left area, bulb inside the lowest fish pass", self.player),
|
||||
lambda state: _has_fish_form(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Kelp Forest bottom left area, Walker baby", self.player),
|
||||
add_rule(
|
||||
self.multiworld.get_location("Open Water bottom left area, bulb inside the lowest fish pass", self.player),
|
||||
lambda state: _has_fish_form(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Kelp Forest bottom left area, Walker Baby", self.player),
|
||||
lambda state: _has_spirit_form(state, self.player))
|
||||
add_rule(self.multiworld.get_location("The Veil top left area, bulb hidden behind the blocking rock", self.player),
|
||||
lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(
|
||||
self.multiworld.get_location("The Veil top left area, bulb hidden behind the blocking rock", self.player),
|
||||
lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Turtle cave, Turtle Egg", self.player),
|
||||
lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Abyss left area, bulb in the bottom fish pass", self.player),
|
||||
@@ -1114,103 +1121,119 @@ class AquariaRegions:
|
||||
add_rule(self.multiworld.get_location("Verse Cave right area, Big Seed", self.player),
|
||||
lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Arnassi Ruins, Song Plant Spore", self.player),
|
||||
lambda state: _has_beast_form(state, self.player))
|
||||
lambda state: _has_beast_form_or_arnassi_armor(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Energy Temple first area, bulb in the bottom room blocked by a rock",
|
||||
self.player), lambda state: _has_energy_form(state, self.player))
|
||||
self.player), lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Home Water, bulb in the bottom left room", self.player),
|
||||
lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Home Water, bulb in the path below Nautilus Prime", self.player),
|
||||
lambda state: _has_bind_song(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Naija's Home, bulb after the energy door", self.player),
|
||||
lambda state: _has_energy_form(state, self.player))
|
||||
lambda state: _has_energy_attack_item(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Abyss right area, bulb behind the rock in the whale room", self.player),
|
||||
lambda state: _has_spirit_form(state, self.player) and
|
||||
_has_sun_form(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Arnassi Ruins, Arnassi Armor", self.player),
|
||||
lambda state: _has_fish_form(state, self.player) and
|
||||
_has_spirit_form(state, self.player))
|
||||
lambda state: _has_fish_form(state, self.player) or
|
||||
_has_beast_and_soup_form(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Mithalas City, urn inside a home fish pass", self.player),
|
||||
lambda state: _has_damaging_item(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Mithalas City, urn in the Castle flower tube entrance", self.player),
|
||||
lambda state: _has_damaging_item(state, self.player))
|
||||
add_rule(self.multiworld.get_location(
|
||||
"The Veil top right area, bulb in the middle of the wall jump cliff", self.player
|
||||
), lambda state: _has_beast_form_or_arnassi_armor(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Kelp Forest top left area, Jelly Egg", self.player),
|
||||
lambda state: _has_beast_form(state, self.player))
|
||||
add_rule(self.multiworld.get_location("Sun Worm path, first cliff bulb", self.player),
|
||||
lambda state: state.has("Sun God beated", self.player))
|
||||
add_rule(self.multiworld.get_location("Sun Worm path, second cliff bulb", self.player),
|
||||
lambda state: state.has("Sun God beated", self.player))
|
||||
add_rule(self.multiworld.get_location("The Body center area, breaking Li's cage", self.player),
|
||||
lambda state: _has_tongue_cleared(state, self.player))
|
||||
|
||||
def __no_progression_hard_or_hidden_location(self) -> None:
|
||||
self.multiworld.get_location("Energy Temple boss area, Fallen God Tooth",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Cathedral boss area, beating Mithalan God",
|
||||
self.player).item_rule =\
|
||||
self.multiworld.get_location("Mithalas boss area, beating Mithalan God",
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Kelp Forest boss area, beating Drunian God",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Sun Temple boss area, beating Sun God",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Sunken City, bulb on top of the boss area",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Home Water, Nautilus Egg",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Energy Temple blaster room, Blaster Egg",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Mithalas City Castle, beating the Priests",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Mermog cave, Piranha Egg",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Octopus Cave, Dumbo Egg",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("King Jellyfish Cave, bulb in the right path from King Jelly",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("King Jellyfish Cave, Jellyfish Costume",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Final Boss area, bulb in the boss third form room",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Sun Worm path, first cliff bulb",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Sun Worm path, second cliff bulb",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("The Veil top right area, bulb at the top of the waterfall",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Bubble Cave, bulb in the left cave wall",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Bubble Cave, bulb in the right cave wall (behind the ice crystal)",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Bubble Cave, Verse Egg",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Kelp Forest bottom left area, bulb close to the spirit crystals",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Kelp Forest bottom left area, Walker baby",
|
||||
self.player).item_rule =\
|
||||
self.multiworld.get_location("Kelp Forest bottom left area, Walker Baby",
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Sun Temple, Sun Key",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("The Body bottom area, Mutant Costume",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Sun Temple, bulb in the hidden room of the right part",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
self.multiworld.get_location("Arnassi Ruins, Arnassi Armor",
|
||||
self.player).item_rule =\
|
||||
self.player).item_rule = \
|
||||
lambda item: item.classification != ItemClassification.progression
|
||||
|
||||
def adjusting_rules(self, options: AquariaOptions) -> None:
|
||||
"""
|
||||
Modify rules for single location or optional rules
|
||||
"""
|
||||
self.multiworld.get_entrance("Before Final Boss to Final Boss", self.player)
|
||||
self.__adjusting_urns_rules()
|
||||
self.__adjusting_crates_rules()
|
||||
self.__adjusting_soup_rules()
|
||||
@@ -1234,7 +1257,7 @@ class AquariaRegions:
|
||||
lambda state: _has_bind_song(state, self.player))
|
||||
if options.unconfine_home_water.value in [0, 2]:
|
||||
add_rule(self.multiworld.get_entrance("Home Water to Open Water top left area", self.player),
|
||||
lambda state: _has_bind_song(state, self.player) and _has_energy_form(state, self.player))
|
||||
lambda state: _has_bind_song(state, self.player) and _has_energy_attack_item(state, self.player))
|
||||
if options.early_energy_form:
|
||||
self.multiworld.early_items[self.player]["Energy form"] = 1
|
||||
|
||||
@@ -1274,6 +1297,7 @@ class AquariaRegions:
|
||||
self.multiworld.regions.append(self.arnassi)
|
||||
self.multiworld.regions.append(self.arnassi_path)
|
||||
self.multiworld.regions.append(self.arnassi_crab_boss)
|
||||
self.multiworld.regions.append(self.arnassi_cave_transturtle)
|
||||
self.multiworld.regions.append(self.simon)
|
||||
|
||||
def __add_mithalas_regions_to_world(self) -> None:
|
||||
@@ -1300,6 +1324,7 @@ class AquariaRegions:
|
||||
self.multiworld.regions.append(self.forest_tr)
|
||||
self.multiworld.regions.append(self.forest_tr_fp)
|
||||
self.multiworld.regions.append(self.forest_bl)
|
||||
self.multiworld.regions.append(self.forest_bl_sc)
|
||||
self.multiworld.regions.append(self.forest_br)
|
||||
self.multiworld.regions.append(self.forest_boss)
|
||||
self.multiworld.regions.append(self.forest_boss_entrance)
|
||||
@@ -1337,6 +1362,7 @@ class AquariaRegions:
|
||||
self.multiworld.regions.append(self.abyss_l)
|
||||
self.multiworld.regions.append(self.abyss_lb)
|
||||
self.multiworld.regions.append(self.abyss_r)
|
||||
self.multiworld.regions.append(self.abyss_r_transturtle)
|
||||
self.multiworld.regions.append(self.ice_cave)
|
||||
self.multiworld.regions.append(self.bubble_cave)
|
||||
self.multiworld.regions.append(self.bubble_cave_boss)
|
||||
|
||||
@@ -204,7 +204,8 @@ class AquariaWorld(World):
|
||||
|
||||
def fill_slot_data(self) -> Dict[str, Any]:
|
||||
return {"ingredientReplacement": self.ingredients_substitution,
|
||||
"aquarianTranslate": bool(self.options.aquarian_translation.value),
|
||||
"aquarian_translate": bool(self.options.aquarian_translation.value),
|
||||
"blind_goal": bool(self.options.blind_goal.value),
|
||||
"secret_needed": self.options.objective.value > 0,
|
||||
"minibosses_to_kill": self.options.mini_bosses_to_beat.value,
|
||||
"bigbosses_to_kill": self.options.big_bosses_to_beat.value,
|
||||
|
||||
@@ -60,7 +60,7 @@ after_home_water_locations = [
|
||||
"Mithalas City, Doll",
|
||||
"Mithalas City, urn inside a home fish pass",
|
||||
"Mithalas City Castle, bulb in the flesh hole",
|
||||
"Mithalas City Castle, Blue banner",
|
||||
"Mithalas City Castle, Blue Banner",
|
||||
"Mithalas City Castle, urn in the bedroom",
|
||||
"Mithalas City Castle, first urn of the single lamp path",
|
||||
"Mithalas City Castle, second urn of the single lamp path",
|
||||
@@ -82,14 +82,14 @@ after_home_water_locations = [
|
||||
"Mithalas Cathedral, third urn in the path behind the flesh vein",
|
||||
"Mithalas Cathedral, fourth urn in the top right room",
|
||||
"Mithalas Cathedral, Mithalan Dress",
|
||||
"Mithalas Cathedral right area, urn below the left entrance",
|
||||
"Mithalas Cathedral, urn below the left entrance",
|
||||
"Cathedral Underground, bulb in the center part",
|
||||
"Cathedral Underground, first bulb in the top left part",
|
||||
"Cathedral Underground, second bulb in the top left part",
|
||||
"Cathedral Underground, third bulb in the top left part",
|
||||
"Cathedral Underground, bulb close to the save crystal",
|
||||
"Cathedral Underground, bulb in the bottom right path",
|
||||
"Cathedral boss area, beating Mithalan God",
|
||||
"Mithalas boss area, beating Mithalan God",
|
||||
"Kelp Forest top left area, bulb in the bottom left clearing",
|
||||
"Kelp Forest top left area, bulb in the path down from the top left clearing",
|
||||
"Kelp Forest top left area, bulb in the top left clearing",
|
||||
@@ -104,7 +104,7 @@ after_home_water_locations = [
|
||||
"Kelp Forest top right area, Black Pearl",
|
||||
"Kelp Forest top right area, bulb in the top fish pass",
|
||||
"Kelp Forest bottom left area, bulb close to the spirit crystals",
|
||||
"Kelp Forest bottom left area, Walker baby",
|
||||
"Kelp Forest bottom left area, Walker Baby",
|
||||
"Kelp Forest bottom left area, Transturtle",
|
||||
"Kelp Forest bottom right area, Odd Container",
|
||||
"Kelp Forest boss area, beating Drunian God",
|
||||
@@ -141,7 +141,7 @@ after_home_water_locations = [
|
||||
"Sun Temple, bulb at the top of the high dark room",
|
||||
"Sun Temple, Golden Gear",
|
||||
"Sun Temple, first bulb of the temple",
|
||||
"Sun Temple, bulb on the left part",
|
||||
"Sun Temple, bulb on the right part",
|
||||
"Sun Temple, bulb in the hidden room of the right part",
|
||||
"Sun Temple, Sun Key",
|
||||
"Sun Worm path, first path bulb",
|
||||
@@ -175,7 +175,7 @@ after_home_water_locations = [
|
||||
"Sunken City left area, Girl Costume",
|
||||
"Sunken City, bulb on top of the boss area",
|
||||
"The Body center area, breaking Li's cage",
|
||||
"The Body main area, bulb on the main path blocking tube",
|
||||
"The Body center area, bulb on the main path blocking tube",
|
||||
"The Body left area, first bulb in the top face room",
|
||||
"The Body left area, second bulb in the top face room",
|
||||
"The Body left area, bulb below the water stream",
|
||||
|
||||
@@ -13,36 +13,16 @@ class BeastFormAccessTest(AquariaTestBase):
|
||||
def test_beast_form_location(self) -> None:
|
||||
"""Test locations that require beast form"""
|
||||
locations = [
|
||||
"Mithalas City Castle, beating the Priests",
|
||||
"Arnassi Ruins, Crab Armor",
|
||||
"Arnassi Ruins, Song Plant Spore",
|
||||
"Mithalas City, first bulb at the end of the top path",
|
||||
"Mithalas City, second bulb at the end of the top path",
|
||||
"Mithalas City, bulb in the top path",
|
||||
"Mithalas City, Mithalas Pot",
|
||||
"Mithalas City, urn in the Castle flower tube entrance",
|
||||
"Mermog cave, Piranha Egg",
|
||||
"Kelp Forest top left area, Jelly Egg",
|
||||
"Mithalas Cathedral, Mithalan Dress",
|
||||
"Turtle cave, bulb in Bubble Cliff",
|
||||
"Turtle cave, Urchin Costume",
|
||||
"Sun Worm path, first cliff bulb",
|
||||
"Sun Worm path, second cliff bulb",
|
||||
"The Veil top right area, bulb at the top of the waterfall",
|
||||
"Bubble Cave, bulb in the left cave wall",
|
||||
"Bubble Cave, bulb in the right cave wall (behind the ice crystal)",
|
||||
"Bubble Cave, Verse Egg",
|
||||
"Sunken City, bulb on top of the boss area",
|
||||
"Octopus Cave, Dumbo Egg",
|
||||
"Beating the Golem",
|
||||
"Beating Mergog",
|
||||
"Beating Crabbius Maximus",
|
||||
"Beating Octopus Prime",
|
||||
"Beating Mantis Shrimp Prime",
|
||||
"King Jellyfish Cave, Jellyfish Costume",
|
||||
"King Jellyfish Cave, bulb in the right path from King Jelly",
|
||||
"Beating King Jellyfish God Prime",
|
||||
"Beating Mithalan priests",
|
||||
"Sunken City cleared"
|
||||
"Sunken City cleared",
|
||||
]
|
||||
items = [["Beast form"]]
|
||||
self.assertAccessDependency(locations, items)
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
"""
|
||||
Author: Louis M
|
||||
Date: Thu, 18 Apr 2024 18:45:56 +0000
|
||||
Description: Unit test used to test accessibility of locations with and without the beast form or arnassi armor
|
||||
"""
|
||||
|
||||
from . import AquariaTestBase
|
||||
|
||||
|
||||
class BeastForArnassiArmormAccessTest(AquariaTestBase):
|
||||
"""Unit test used to test accessibility of locations with and without the beast form or arnassi armor"""
|
||||
|
||||
def test_beast_form_arnassi_armor_location(self) -> None:
|
||||
"""Test locations that require beast form or arnassi armor"""
|
||||
locations = [
|
||||
"Mithalas City Castle, beating the Priests",
|
||||
"Arnassi Ruins, Crab Armor",
|
||||
"Arnassi Ruins, Song Plant Spore",
|
||||
"Mithalas City, first bulb at the end of the top path",
|
||||
"Mithalas City, second bulb at the end of the top path",
|
||||
"Mithalas City, bulb in the top path",
|
||||
"Mithalas City, Mithalas Pot",
|
||||
"Mithalas City, urn in the Castle flower tube entrance",
|
||||
"Mermog cave, Piranha Egg",
|
||||
"Mithalas Cathedral, Mithalan Dress",
|
||||
"Kelp Forest top left area, Jelly Egg",
|
||||
"The Veil top right area, bulb in the middle of the wall jump cliff",
|
||||
"The Veil top right area, bulb at the top of the waterfall",
|
||||
"Sunken City, bulb on top of the boss area",
|
||||
"Octopus Cave, Dumbo Egg",
|
||||
"Beating the Golem",
|
||||
"Beating Mergog",
|
||||
"Beating Crabbius Maximus",
|
||||
"Beating Octopus Prime",
|
||||
"Beating Mithalan priests",
|
||||
"Sunken City cleared"
|
||||
]
|
||||
items = [["Beast form", "Arnassi Armor"]]
|
||||
self.assertAccessDependency(locations, items)
|
||||
@@ -17,55 +17,16 @@ class EnergyFormAccessTest(AquariaTestBase):
|
||||
def test_energy_form_location(self) -> None:
|
||||
"""Test locations that require Energy form"""
|
||||
locations = [
|
||||
"Home Water, Nautilus Egg",
|
||||
"Naija's Home, bulb after the energy door",
|
||||
"Energy Temple first area, bulb in the bottom room blocked by a rock",
|
||||
"Energy Temple second area, bulb under the rock",
|
||||
"Energy Temple bottom entrance, Krotite Armor",
|
||||
"Energy Temple third area, bulb in the bottom path",
|
||||
"Energy Temple boss area, Fallen God Tooth",
|
||||
"Energy Temple blaster room, Blaster Egg",
|
||||
"Mithalas City Castle, beating the Priests",
|
||||
"Mithalas Cathedral, first urn in the top right room",
|
||||
"Mithalas Cathedral, second urn in the top right room",
|
||||
"Mithalas Cathedral, third urn in the top right room",
|
||||
"Mithalas Cathedral, urn in the flesh room with fleas",
|
||||
"Mithalas Cathedral, first urn in the bottom right path",
|
||||
"Mithalas Cathedral, second urn in the bottom right path",
|
||||
"Mithalas Cathedral, urn behind the flesh vein",
|
||||
"Mithalas Cathedral, urn in the top left eyes boss room",
|
||||
"Mithalas Cathedral, first urn in the path behind the flesh vein",
|
||||
"Mithalas Cathedral, second urn in the path behind the flesh vein",
|
||||
"Mithalas Cathedral, third urn in the path behind the flesh vein",
|
||||
"Mithalas Cathedral, fourth urn in the top right room",
|
||||
"Mithalas Cathedral, Mithalan Dress",
|
||||
"Mithalas Cathedral right area, urn below the left entrance",
|
||||
"Cathedral boss area, beating Mithalan God",
|
||||
"Kelp Forest top left area, bulb close to the Verse Egg",
|
||||
"Kelp Forest top left area, Verse Egg",
|
||||
"Kelp Forest boss area, beating Drunian God",
|
||||
"Mermog cave, Piranha Egg",
|
||||
"Octopus Cave, Dumbo Egg",
|
||||
"Sun Temple boss area, beating Sun God",
|
||||
"Arnassi Ruins, Crab Armor",
|
||||
"King Jellyfish Cave, bulb in the right path from King Jelly",
|
||||
"King Jellyfish Cave, Jellyfish Costume",
|
||||
"Sunken City, bulb on top of the boss area",
|
||||
"The Body left area, first bulb in the top face room",
|
||||
"The Body left area, second bulb in the top face room",
|
||||
"The Body left area, bulb below the water stream",
|
||||
"The Body left area, bulb in the top path to the top face room",
|
||||
"The Body left area, bulb in the bottom face room",
|
||||
"The Body right area, bulb in the top path to the bottom face room",
|
||||
"The Body right area, bulb in the bottom face room",
|
||||
"Final Boss area, bulb in the boss third form room",
|
||||
"Beating Fallen God",
|
||||
"Beating Mithalan God",
|
||||
"Beating Drunian God",
|
||||
"Beating Sun God",
|
||||
"Beating the Golem",
|
||||
"Beating Nautilus Prime",
|
||||
"Beating Blaster Peg Prime",
|
||||
"Beating Mergog",
|
||||
"Beating Mithalan priests",
|
||||
"Beating Octopus Prime",
|
||||
"Beating Crabbius Maximus",
|
||||
"Beating King Jellyfish God Prime",
|
||||
"First secret",
|
||||
"Sunken City cleared",
|
||||
"Objective complete",
|
||||
]
|
||||
items = [["Energy form"]]
|
||||
|
||||
92
worlds/aquaria/test/test_energy_form_or_dual_form_access.py
Normal file
92
worlds/aquaria/test/test_energy_form_or_dual_form_access.py
Normal file
@@ -0,0 +1,92 @@
|
||||
"""
|
||||
Author: Louis M
|
||||
Date: Thu, 18 Apr 2024 18:45:56 +0000
|
||||
Description: Unit test used to test accessibility of locations with and without the energy form and dual form (and Li)
|
||||
"""
|
||||
|
||||
from . import AquariaTestBase
|
||||
|
||||
|
||||
class EnergyFormDualFormAccessTest(AquariaTestBase):
|
||||
"""Unit test used to test accessibility of locations with and without the energy form and dual form (and Li)"""
|
||||
options = {
|
||||
"early_energy_form": False,
|
||||
}
|
||||
|
||||
def test_energy_form_or_dual_form_location(self) -> None:
|
||||
"""Test locations that require Energy form or dual form"""
|
||||
locations = [
|
||||
"Naija's Home, bulb after the energy door",
|
||||
"Home Water, Nautilus Egg",
|
||||
"Energy Temple second area, bulb under the rock",
|
||||
"Energy Temple bottom entrance, Krotite Armor",
|
||||
"Energy Temple third area, bulb in the bottom path",
|
||||
"Energy Temple blaster room, Blaster Egg",
|
||||
"Energy Temple boss area, Fallen God Tooth",
|
||||
"Mithalas City Castle, beating the Priests",
|
||||
"Mithalas boss area, beating Mithalan God",
|
||||
"Mithalas Cathedral, first urn in the top right room",
|
||||
"Mithalas Cathedral, second urn in the top right room",
|
||||
"Mithalas Cathedral, third urn in the top right room",
|
||||
"Mithalas Cathedral, urn in the flesh room with fleas",
|
||||
"Mithalas Cathedral, first urn in the bottom right path",
|
||||
"Mithalas Cathedral, second urn in the bottom right path",
|
||||
"Mithalas Cathedral, urn behind the flesh vein",
|
||||
"Mithalas Cathedral, urn in the top left eyes boss room",
|
||||
"Mithalas Cathedral, first urn in the path behind the flesh vein",
|
||||
"Mithalas Cathedral, second urn in the path behind the flesh vein",
|
||||
"Mithalas Cathedral, third urn in the path behind the flesh vein",
|
||||
"Mithalas Cathedral, fourth urn in the top right room",
|
||||
"Mithalas Cathedral, Mithalan Dress",
|
||||
"Mithalas Cathedral, urn below the left entrance",
|
||||
"Kelp Forest top left area, bulb close to the Verse Egg",
|
||||
"Kelp Forest top left area, Verse Egg",
|
||||
"Kelp Forest boss area, beating Drunian God",
|
||||
"Mermog cave, Piranha Egg",
|
||||
"Octopus Cave, Dumbo Egg",
|
||||
"Sun Temple boss area, beating Sun God",
|
||||
"King Jellyfish Cave, bulb in the right path from King Jelly",
|
||||
"King Jellyfish Cave, Jellyfish Costume",
|
||||
"Sunken City right area, crate close to the save crystal",
|
||||
"Sunken City right area, crate in the left bottom room",
|
||||
"Sunken City left area, crate in the little pipe room",
|
||||
"Sunken City left area, crate close to the save crystal",
|
||||
"Sunken City left area, crate before the bedroom",
|
||||
"Sunken City left area, Girl Costume",
|
||||
"Sunken City, bulb on top of the boss area",
|
||||
"The Body center area, breaking Li's cage",
|
||||
"The Body center area, bulb on the main path blocking tube",
|
||||
"The Body left area, first bulb in the top face room",
|
||||
"The Body left area, second bulb in the top face room",
|
||||
"The Body left area, bulb below the water stream",
|
||||
"The Body left area, bulb in the top path to the top face room",
|
||||
"The Body left area, bulb in the bottom face room",
|
||||
"The Body right area, bulb in the top face room",
|
||||
"The Body right area, bulb in the top path to the bottom face room",
|
||||
"The Body right area, bulb in the bottom face room",
|
||||
"The Body bottom area, bulb in the Jelly Zap room",
|
||||
"The Body bottom area, bulb in the nautilus room",
|
||||
"The Body bottom area, Mutant Costume",
|
||||
"Final Boss area, bulb in the boss third form room",
|
||||
"Final Boss area, first bulb in the turtle room",
|
||||
"Final Boss area, second bulb in the turtle room",
|
||||
"Final Boss area, third bulb in the turtle room",
|
||||
"Final Boss area, Transturtle",
|
||||
"Beating Fallen God",
|
||||
"Beating Blaster Peg Prime",
|
||||
"Beating Mithalan God",
|
||||
"Beating Drunian God",
|
||||
"Beating Sun God",
|
||||
"Beating the Golem",
|
||||
"Beating Nautilus Prime",
|
||||
"Beating Mergog",
|
||||
"Beating Mithalan priests",
|
||||
"Beating Octopus Prime",
|
||||
"Beating King Jellyfish God Prime",
|
||||
"Beating the Golem",
|
||||
"Sunken City cleared",
|
||||
"First secret",
|
||||
"Objective complete"
|
||||
]
|
||||
items = [["Energy form", "Dual form", "Li and Li song", "Body tongue cleared"]]
|
||||
self.assertAccessDependency(locations, items)
|
||||
@@ -17,6 +17,7 @@ class FishFormAccessTest(AquariaTestBase):
|
||||
"""Test locations that require fish form"""
|
||||
locations = [
|
||||
"The Veil top left area, bulb inside the fish pass",
|
||||
"Energy Temple first area, Energy Idol",
|
||||
"Mithalas City, Doll",
|
||||
"Mithalas City, urn inside a home fish pass",
|
||||
"Kelp Forest top right area, bulb in the top fish pass",
|
||||
@@ -30,8 +31,7 @@ class FishFormAccessTest(AquariaTestBase):
|
||||
"Octopus Cave, Dumbo Egg",
|
||||
"Octopus Cave, bulb in the path below the Octopus Cave path",
|
||||
"Beating Octopus Prime",
|
||||
"Abyss left area, bulb in the bottom fish pass",
|
||||
"Arnassi Ruins, Arnassi Armor"
|
||||
"Abyss left area, bulb in the bottom fish pass"
|
||||
]
|
||||
items = [["Fish form"]]
|
||||
self.assertAccessDependency(locations, items)
|
||||
|
||||
@@ -24,7 +24,7 @@ class LiAccessTest(AquariaTestBase):
|
||||
"Sunken City left area, Girl Costume",
|
||||
"Sunken City, bulb on top of the boss area",
|
||||
"The Body center area, breaking Li's cage",
|
||||
"The Body main area, bulb on the main path blocking tube",
|
||||
"The Body center area, bulb on the main path blocking tube",
|
||||
"The Body left area, first bulb in the top face room",
|
||||
"The Body left area, second bulb in the top face room",
|
||||
"The Body left area, bulb below the water stream",
|
||||
|
||||
@@ -39,7 +39,6 @@ class LightAccessTest(AquariaTestBase):
|
||||
"Abyss right area, bulb in the middle path",
|
||||
"Abyss right area, bulb behind the rock in the middle path",
|
||||
"Abyss right area, bulb in the left green room",
|
||||
"Abyss right area, Transturtle",
|
||||
"Ice Cave, bulb in the room to the right",
|
||||
"Ice Cave, first bulb in the top exit room",
|
||||
"Ice Cave, second bulb in the top exit room",
|
||||
|
||||
@@ -38,7 +38,7 @@ class NatureFormAccessTest(AquariaTestBase):
|
||||
"Beating the Golem",
|
||||
"Sunken City cleared",
|
||||
"The Body center area, breaking Li's cage",
|
||||
"The Body main area, bulb on the main path blocking tube",
|
||||
"The Body center area, bulb on the main path blocking tube",
|
||||
"The Body left area, first bulb in the top face room",
|
||||
"The Body left area, second bulb in the top face room",
|
||||
"The Body left area, bulb below the water stream",
|
||||
|
||||
@@ -16,7 +16,7 @@ class UNoProgressionHardHiddenTest(AquariaTestBase):
|
||||
|
||||
unfillable_locations = [
|
||||
"Energy Temple boss area, Fallen God Tooth",
|
||||
"Cathedral boss area, beating Mithalan God",
|
||||
"Mithalas boss area, beating Mithalan God",
|
||||
"Kelp Forest boss area, beating Drunian God",
|
||||
"Sun Temple boss area, beating Sun God",
|
||||
"Sunken City, bulb on top of the boss area",
|
||||
@@ -35,7 +35,7 @@ class UNoProgressionHardHiddenTest(AquariaTestBase):
|
||||
"Bubble Cave, bulb in the right cave wall (behind the ice crystal)",
|
||||
"Bubble Cave, Verse Egg",
|
||||
"Kelp Forest bottom left area, bulb close to the spirit crystals",
|
||||
"Kelp Forest bottom left area, Walker baby",
|
||||
"Kelp Forest bottom left area, Walker Baby",
|
||||
"Sun Temple, Sun Key",
|
||||
"The Body bottom area, Mutant Costume",
|
||||
"Sun Temple, bulb in the hidden room of the right part",
|
||||
|
||||
@@ -15,7 +15,7 @@ class UNoProgressionHardHiddenTest(AquariaTestBase):
|
||||
|
||||
unfillable_locations = [
|
||||
"Energy Temple boss area, Fallen God Tooth",
|
||||
"Cathedral boss area, beating Mithalan God",
|
||||
"Mithalas boss area, beating Mithalan God",
|
||||
"Kelp Forest boss area, beating Drunian God",
|
||||
"Sun Temple boss area, beating Sun God",
|
||||
"Sunken City, bulb on top of the boss area",
|
||||
@@ -34,7 +34,7 @@ class UNoProgressionHardHiddenTest(AquariaTestBase):
|
||||
"Bubble Cave, bulb in the right cave wall (behind the ice crystal)",
|
||||
"Bubble Cave, Verse Egg",
|
||||
"Kelp Forest bottom left area, bulb close to the spirit crystals",
|
||||
"Kelp Forest bottom left area, Walker baby",
|
||||
"Kelp Forest bottom left area, Walker Baby",
|
||||
"Sun Temple, Sun Key",
|
||||
"The Body bottom area, Mutant Costume",
|
||||
"Sun Temple, bulb in the hidden room of the right part",
|
||||
|
||||
@@ -16,7 +16,7 @@ class SpiritFormAccessTest(AquariaTestBase):
|
||||
"The Veil bottom area, bulb in the spirit path",
|
||||
"Mithalas City Castle, Trident Head",
|
||||
"Open Water skeleton path, King Skull",
|
||||
"Kelp Forest bottom left area, Walker baby",
|
||||
"Kelp Forest bottom left area, Walker Baby",
|
||||
"Abyss right area, bulb behind the rock in the whale room",
|
||||
"The Whale, Verse Egg",
|
||||
"Ice Cave, bulb in the room to the right",
|
||||
@@ -30,7 +30,6 @@ class SpiritFormAccessTest(AquariaTestBase):
|
||||
"Sunken City left area, Girl Costume",
|
||||
"Beating Mantis Shrimp Prime",
|
||||
"First secret",
|
||||
"Arnassi Ruins, Arnassi Armor",
|
||||
]
|
||||
items = [["Spirit form"]]
|
||||
self.assertAccessDependency(locations, items)
|
||||
|
||||
@@ -762,7 +762,7 @@ location_table: List[LocationDict] = [
|
||||
'game_id': "graf385"},
|
||||
{'name': "Tagged 389 Graffiti Spots",
|
||||
'stage': Stages.Misc,
|
||||
'game_id': "graf379"},
|
||||
'game_id': "graf389"},
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -1006,6 +1006,8 @@ def rules(brcworld):
|
||||
lambda state: mataan_challenge2(state, player, limit, glitched))
|
||||
set_rule(multiworld.get_location("Mataan: Score challenge reward", player),
|
||||
lambda state: mataan_challenge3(state, player))
|
||||
set_rule(multiworld.get_location("Mataan: Coil joins the crew", player),
|
||||
lambda state: mataan_deepest(state, player, limit, glitched))
|
||||
if photos:
|
||||
set_rule(multiworld.get_location("Mataan: Trash Polo", player),
|
||||
lambda state: camera(state, player))
|
||||
|
||||
@@ -3,8 +3,8 @@ import typing
|
||||
|
||||
|
||||
class ItemData(typing.NamedTuple):
|
||||
code: typing.Optional[int]
|
||||
progression: bool
|
||||
code: int
|
||||
progression: bool = True
|
||||
|
||||
|
||||
class ChecksFinderItem(Item):
|
||||
@@ -12,16 +12,9 @@ class ChecksFinderItem(Item):
|
||||
|
||||
|
||||
item_table = {
|
||||
"Map Width": ItemData(80000, True),
|
||||
"Map Height": ItemData(80001, True),
|
||||
"Map Bombs": ItemData(80002, True),
|
||||
"Map Width": ItemData(80000),
|
||||
"Map Height": ItemData(80001),
|
||||
"Map Bombs": ItemData(80002),
|
||||
}
|
||||
|
||||
required_items = {
|
||||
}
|
||||
|
||||
item_frequencies = {
|
||||
|
||||
}
|
||||
|
||||
lookup_id_to_name: typing.Dict[int, str] = {data.code: item_name for item_name, data in item_table.items() if data.code}
|
||||
lookup_id_to_name: typing.Dict[int, str] = {data.code: item_name for item_name, data in item_table.items()}
|
||||
|
||||
@@ -3,46 +3,14 @@ import typing
|
||||
|
||||
|
||||
class AdvData(typing.NamedTuple):
|
||||
id: typing.Optional[int]
|
||||
region: str
|
||||
id: int
|
||||
region: str = "Board"
|
||||
|
||||
|
||||
class ChecksFinderAdvancement(Location):
|
||||
class ChecksFinderLocation(Location):
|
||||
game: str = "ChecksFinder"
|
||||
|
||||
|
||||
advancement_table = {
|
||||
"Tile 1": AdvData(81000, 'Board'),
|
||||
"Tile 2": AdvData(81001, 'Board'),
|
||||
"Tile 3": AdvData(81002, 'Board'),
|
||||
"Tile 4": AdvData(81003, 'Board'),
|
||||
"Tile 5": AdvData(81004, 'Board'),
|
||||
"Tile 6": AdvData(81005, 'Board'),
|
||||
"Tile 7": AdvData(81006, 'Board'),
|
||||
"Tile 8": AdvData(81007, 'Board'),
|
||||
"Tile 9": AdvData(81008, 'Board'),
|
||||
"Tile 10": AdvData(81009, 'Board'),
|
||||
"Tile 11": AdvData(81010, 'Board'),
|
||||
"Tile 12": AdvData(81011, 'Board'),
|
||||
"Tile 13": AdvData(81012, 'Board'),
|
||||
"Tile 14": AdvData(81013, 'Board'),
|
||||
"Tile 15": AdvData(81014, 'Board'),
|
||||
"Tile 16": AdvData(81015, 'Board'),
|
||||
"Tile 17": AdvData(81016, 'Board'),
|
||||
"Tile 18": AdvData(81017, 'Board'),
|
||||
"Tile 19": AdvData(81018, 'Board'),
|
||||
"Tile 20": AdvData(81019, 'Board'),
|
||||
"Tile 21": AdvData(81020, 'Board'),
|
||||
"Tile 22": AdvData(81021, 'Board'),
|
||||
"Tile 23": AdvData(81022, 'Board'),
|
||||
"Tile 24": AdvData(81023, 'Board'),
|
||||
"Tile 25": AdvData(81024, 'Board'),
|
||||
}
|
||||
|
||||
exclusion_table = {
|
||||
}
|
||||
|
||||
events_table = {
|
||||
}
|
||||
|
||||
lookup_id_to_name: typing.Dict[int, str] = {data.id: item_name for item_name, data in advancement_table.items() if data.id}
|
||||
base_id = 81000
|
||||
advancement_table = {f"Tile {i+1}": AdvData(base_id+i) for i in range(25)}
|
||||
lookup_id_to_name: typing.Dict[int, str] = {data.id: item_name for item_name, data in advancement_table.items()}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
import typing
|
||||
from Options import Option
|
||||
|
||||
|
||||
checksfinder_options: typing.Dict[str, type(Option)] = {
|
||||
}
|
||||
@@ -1,44 +1,24 @@
|
||||
from ..generic.Rules import set_rule
|
||||
from BaseClasses import MultiWorld, CollectionState
|
||||
from worlds.generic.Rules import set_rule
|
||||
from BaseClasses import MultiWorld
|
||||
|
||||
|
||||
def _has_total(state: CollectionState, player: int, total: int):
|
||||
return (state.count('Map Width', player) + state.count('Map Height', player) +
|
||||
state.count('Map Bombs', player)) >= total
|
||||
items = ["Map Width", "Map Height", "Map Bombs"]
|
||||
|
||||
|
||||
# Sets rules on entrances and advancements that are always applied
|
||||
def set_rules(world: MultiWorld, player: int):
|
||||
set_rule(world.get_location("Tile 6", player), lambda state: _has_total(state, player, 1))
|
||||
set_rule(world.get_location("Tile 7", player), lambda state: _has_total(state, player, 2))
|
||||
set_rule(world.get_location("Tile 8", player), lambda state: _has_total(state, player, 3))
|
||||
set_rule(world.get_location("Tile 9", player), lambda state: _has_total(state, player, 4))
|
||||
set_rule(world.get_location("Tile 10", player), lambda state: _has_total(state, player, 5))
|
||||
set_rule(world.get_location("Tile 11", player), lambda state: _has_total(state, player, 6))
|
||||
set_rule(world.get_location("Tile 12", player), lambda state: _has_total(state, player, 7))
|
||||
set_rule(world.get_location("Tile 13", player), lambda state: _has_total(state, player, 8))
|
||||
set_rule(world.get_location("Tile 14", player), lambda state: _has_total(state, player, 9))
|
||||
set_rule(world.get_location("Tile 15", player), lambda state: _has_total(state, player, 10))
|
||||
set_rule(world.get_location("Tile 16", player), lambda state: _has_total(state, player, 11))
|
||||
set_rule(world.get_location("Tile 17", player), lambda state: _has_total(state, player, 12))
|
||||
set_rule(world.get_location("Tile 18", player), lambda state: _has_total(state, player, 13))
|
||||
set_rule(world.get_location("Tile 19", player), lambda state: _has_total(state, player, 14))
|
||||
set_rule(world.get_location("Tile 20", player), lambda state: _has_total(state, player, 15))
|
||||
set_rule(world.get_location("Tile 21", player), lambda state: _has_total(state, player, 16))
|
||||
set_rule(world.get_location("Tile 22", player), lambda state: _has_total(state, player, 17))
|
||||
set_rule(world.get_location("Tile 23", player), lambda state: _has_total(state, player, 18))
|
||||
set_rule(world.get_location("Tile 24", player), lambda state: _has_total(state, player, 19))
|
||||
set_rule(world.get_location("Tile 25", player), lambda state: _has_total(state, player, 20))
|
||||
def set_rules(multiworld: MultiWorld, player: int):
|
||||
for i in range(20):
|
||||
set_rule(multiworld.get_location(f"Tile {i+6}", player), lambda state, i=i: state.has_from_list(items, player, i+1))
|
||||
|
||||
|
||||
# Sets rules on completion condition
|
||||
def set_completion_rules(world: MultiWorld, player: int):
|
||||
|
||||
width_req = 10-5
|
||||
height_req = 10-5
|
||||
bomb_req = 20-5
|
||||
completion_requirements = lambda state: \
|
||||
state.has("Map Width", player, width_req) and \
|
||||
state.has("Map Height", player, height_req) and \
|
||||
state.has("Map Bombs", player, bomb_req)
|
||||
world.completion_condition[player] = lambda state: completion_requirements(state)
|
||||
def set_completion_rules(multiworld: MultiWorld, player: int):
|
||||
width_req = 5 # 10 - 5
|
||||
height_req = 5 # 10 - 5
|
||||
bomb_req = 15 # 20 - 5
|
||||
multiworld.completion_condition[player] = lambda state: state.has_all_counts(
|
||||
{
|
||||
"Map Width": width_req,
|
||||
"Map Height": height_req,
|
||||
"Map Bombs": bomb_req,
|
||||
}, player)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from BaseClasses import Region, Entrance, Item, Tutorial, ItemClassification
|
||||
from .Items import ChecksFinderItem, item_table, required_items
|
||||
from .Locations import ChecksFinderAdvancement, advancement_table, exclusion_table
|
||||
from .Options import checksfinder_options
|
||||
from BaseClasses import Region, Entrance, Tutorial, ItemClassification
|
||||
from .Items import ChecksFinderItem, item_table
|
||||
from .Locations import ChecksFinderLocation, advancement_table
|
||||
from Options import PerGameCommonOptions
|
||||
from .Rules import set_rules, set_completion_rules
|
||||
from ..AutoWorld import World, WebWorld
|
||||
from worlds.AutoWorld import World, WebWorld
|
||||
|
||||
client_version = 7
|
||||
|
||||
@@ -25,38 +25,34 @@ class ChecksFinderWorld(World):
|
||||
ChecksFinder is a game where you avoid mines and find checks inside the board
|
||||
with the mines! You win when you get all your items and beat the board!
|
||||
"""
|
||||
game: str = "ChecksFinder"
|
||||
option_definitions = checksfinder_options
|
||||
topology_present = True
|
||||
game = "ChecksFinder"
|
||||
options_dataclass = PerGameCommonOptions
|
||||
web = ChecksFinderWeb()
|
||||
|
||||
item_name_to_id = {name: data.code for name, data in item_table.items()}
|
||||
location_name_to_id = {name: data.id for name, data in advancement_table.items()}
|
||||
|
||||
def _get_checksfinder_data(self):
|
||||
return {
|
||||
'world_seed': self.multiworld.per_slot_randoms[self.player].getrandbits(32),
|
||||
'seed_name': self.multiworld.seed_name,
|
||||
'player_name': self.multiworld.get_player_name(self.player),
|
||||
'player_id': self.player,
|
||||
'client_version': client_version,
|
||||
'race': self.multiworld.is_race,
|
||||
}
|
||||
def create_regions(self):
|
||||
menu = Region("Menu", self.player, self.multiworld)
|
||||
board = Region("Board", self.player, self.multiworld)
|
||||
board.locations += [ChecksFinderLocation(self.player, loc_name, loc_data.id, board)
|
||||
for loc_name, loc_data in advancement_table.items()]
|
||||
|
||||
connection = Entrance(self.player, "New Board", menu)
|
||||
menu.exits.append(connection)
|
||||
connection.connect(board)
|
||||
self.multiworld.regions += [menu, board]
|
||||
|
||||
def create_items(self):
|
||||
|
||||
# Generate item pool
|
||||
itempool = []
|
||||
# Add all required progression items
|
||||
for (name, num) in required_items.items():
|
||||
itempool += [name] * num
|
||||
# Add the map width and height stuff
|
||||
itempool += ["Map Width"] * (10-5)
|
||||
itempool += ["Map Height"] * (10-5)
|
||||
itempool += ["Map Width"] * 5 # 10 - 5
|
||||
itempool += ["Map Height"] * 5 # 10 - 5
|
||||
# Add the map bombs
|
||||
itempool += ["Map Bombs"] * (20-5)
|
||||
itempool += ["Map Bombs"] * 15 # 20 - 5
|
||||
# Convert itempool into real items
|
||||
itempool = [item for item in map(lambda name: self.create_item(name), itempool)]
|
||||
itempool = [self.create_item(item) for item in itempool]
|
||||
|
||||
self.multiworld.itempool += itempool
|
||||
|
||||
@@ -64,28 +60,16 @@ class ChecksFinderWorld(World):
|
||||
set_rules(self.multiworld, self.player)
|
||||
set_completion_rules(self.multiworld, self.player)
|
||||
|
||||
def create_regions(self):
|
||||
menu = Region("Menu", self.player, self.multiworld)
|
||||
board = Region("Board", self.player, self.multiworld)
|
||||
board.locations += [ChecksFinderAdvancement(self.player, loc_name, loc_data.id, board)
|
||||
for loc_name, loc_data in advancement_table.items() if loc_data.region == board.name]
|
||||
|
||||
connection = Entrance(self.player, "New Board", menu)
|
||||
menu.exits.append(connection)
|
||||
connection.connect(board)
|
||||
self.multiworld.regions += [menu, board]
|
||||
|
||||
def fill_slot_data(self):
|
||||
slot_data = self._get_checksfinder_data()
|
||||
for option_name in checksfinder_options:
|
||||
option = getattr(self.multiworld, option_name)[self.player]
|
||||
if slot_data.get(option_name, None) is None and type(option.value) in {str, int}:
|
||||
slot_data[option_name] = int(option.value)
|
||||
return slot_data
|
||||
return {
|
||||
"world_seed": self.random.getrandbits(32),
|
||||
"seed_name": self.multiworld.seed_name,
|
||||
"player_name": self.player_name,
|
||||
"player_id": self.player,
|
||||
"client_version": client_version,
|
||||
"race": self.multiworld.is_race,
|
||||
}
|
||||
|
||||
def create_item(self, name: str) -> Item:
|
||||
def create_item(self, name: str) -> ChecksFinderItem:
|
||||
item_data = item_table[name]
|
||||
item = ChecksFinderItem(name,
|
||||
ItemClassification.progression if item_data.progression else ItemClassification.filler,
|
||||
item_data.code, self.player)
|
||||
return item
|
||||
return ChecksFinderItem(name, ItemClassification.progression, item_data.code, self.player)
|
||||
|
||||
@@ -24,8 +24,3 @@ next to an icon, the number is how many you have gotten and the icon represents
|
||||
Victory is achieved when the player wins a board they were given after they have received all of their Map Width, Map
|
||||
Height, and Map Bomb items. The game will say at the bottom of the screen how many of each you have received.
|
||||
|
||||
## Unique Local Commands
|
||||
|
||||
The following command is only available when using the ChecksFinderClient to play with Archipelago.
|
||||
|
||||
- `/resync` Manually trigger a resync.
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
- ChecksFinder from
|
||||
the [Github releases Page for the game](https://github.com/jonloveslegos/ChecksFinder/releases) (latest version)
|
||||
- Archipelago from the [Archipelago Releases Page](https://github.com/ArchipelagoMW/Archipelago/releases)
|
||||
|
||||
## Configuring your YAML file
|
||||
|
||||
@@ -17,28 +16,15 @@ guide: [Basic Multiworld Setup Guide](/tutorial/Archipelago/setup/en)
|
||||
|
||||
You can customize your options by visiting the [ChecksFinder Player Options Page](/games/ChecksFinder/player-options)
|
||||
|
||||
### Generating a ChecksFinder game
|
||||
## Joining a MultiWorld Game
|
||||
|
||||
**ChecksFinder is meant to be played _alongside_ another game! You may not be playing it for long periods of time if
|
||||
you play it by itself with another person!**
|
||||
|
||||
When you join a multiworld game, you will be asked to provide your YAML file to whoever is hosting. Once that is done,
|
||||
the host will provide you with either a link to download your data file, or with a zip file containing everyone's data
|
||||
files. You do not have a file inside that zip though!
|
||||
|
||||
You need to start ChecksFinder client yourself, it is located within the Archipelago folder.
|
||||
|
||||
### Connect to the MultiServer
|
||||
|
||||
First start ChecksFinder.
|
||||
|
||||
Once both ChecksFinder and the client are started. In the client at the top type in the spot labeled `Server` type the
|
||||
`Ip Address` and `Port` separated with a `:` symbol.
|
||||
|
||||
The client will then ask for the username you chose, input that in the text box at the bottom of the client.
|
||||
|
||||
### Play the game
|
||||
|
||||
When the console tells you that you have joined the room, you're all set. Congratulations on successfully joining a
|
||||
multiworld game!
|
||||
1. Start ChecksFinder
|
||||
2. Enter the following information:
|
||||
- Enter the server url (starting from `wss://` for https connection like archipelago.gg, and starting from `ws://` for http connection and local multiserver)
|
||||
- Enter server port
|
||||
- Enter the name of the slot you wish to connect to
|
||||
- Enter the room password (optional)
|
||||
- Press `Play Online` to connect
|
||||
3. Start playing!
|
||||
|
||||
Game options and controls are described in the readme on the github repository for the game
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from dataclasses import dataclass
|
||||
from Options import OptionGroup, Choice, DefaultOnToggle, Range, Toggle, PerGameCommonOptions, StartInventoryPool
|
||||
from Options import (OptionGroup, Choice, DefaultOnToggle, ItemsAccessibility, PerGameCommonOptions, Range, Toggle,
|
||||
StartInventoryPool)
|
||||
|
||||
|
||||
class CharacterStages(Choice):
|
||||
@@ -521,6 +522,7 @@ class DeathLink(Choice):
|
||||
|
||||
@dataclass
|
||||
class CV64Options(PerGameCommonOptions):
|
||||
accessibility: ItemsAccessibility
|
||||
start_inventory_from_pool: StartInventoryPool
|
||||
character_stages: CharacterStages
|
||||
stage_shuffle: StageShuffle
|
||||
|
||||
@@ -8,11 +8,15 @@ from .Locations import DLCQuestLocation, location_table
|
||||
from .Options import DLCQuestOptions
|
||||
from .Regions import create_regions
|
||||
from .Rules import set_rules
|
||||
from .presets import dlcq_options_presets
|
||||
from .option_groups import dlcq_option_groups
|
||||
|
||||
client_version = 0
|
||||
|
||||
|
||||
class DLCqwebworld(WebWorld):
|
||||
options_presets = dlcq_options_presets
|
||||
option_groups = dlcq_option_groups
|
||||
setup_en = Tutorial(
|
||||
"Multiworld Setup Guide",
|
||||
"A guide to setting up the Archipelago DLCQuest game on your computer.",
|
||||
|
||||
27
worlds/dlcquest/option_groups.py
Normal file
27
worlds/dlcquest/option_groups.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from typing import List
|
||||
|
||||
from Options import ProgressionBalancing, Accessibility, OptionGroup
|
||||
from .Options import (Campaign, ItemShuffle, TimeIsMoney, EndingChoice, PermanentCoins, DoubleJumpGlitch, CoinSanity,
|
||||
CoinSanityRange, DeathLink)
|
||||
|
||||
dlcq_option_groups: List[OptionGroup] = [
|
||||
OptionGroup("General", [
|
||||
Campaign,
|
||||
ItemShuffle,
|
||||
CoinSanity,
|
||||
]),
|
||||
OptionGroup("Customization", [
|
||||
EndingChoice,
|
||||
PermanentCoins,
|
||||
CoinSanityRange,
|
||||
]),
|
||||
OptionGroup("Tedious and Grind", [
|
||||
TimeIsMoney,
|
||||
DoubleJumpGlitch,
|
||||
]),
|
||||
OptionGroup("Advanced Options", [
|
||||
DeathLink,
|
||||
ProgressionBalancing,
|
||||
Accessibility,
|
||||
]),
|
||||
]
|
||||
68
worlds/dlcquest/presets.py
Normal file
68
worlds/dlcquest/presets.py
Normal file
@@ -0,0 +1,68 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
from .Options import DoubleJumpGlitch, CoinSanity, CoinSanityRange, PermanentCoins, TimeIsMoney, EndingChoice, Campaign, ItemShuffle
|
||||
|
||||
all_random_settings = {
|
||||
DoubleJumpGlitch.internal_name: "random",
|
||||
CoinSanity.internal_name: "random",
|
||||
CoinSanityRange.internal_name: "random",
|
||||
PermanentCoins.internal_name: "random",
|
||||
TimeIsMoney.internal_name: "random",
|
||||
EndingChoice.internal_name: "random",
|
||||
Campaign.internal_name: "random",
|
||||
ItemShuffle.internal_name: "random",
|
||||
"death_link": "random",
|
||||
}
|
||||
|
||||
main_campaign_settings = {
|
||||
DoubleJumpGlitch.internal_name: DoubleJumpGlitch.option_none,
|
||||
CoinSanity.internal_name: CoinSanity.option_coin,
|
||||
CoinSanityRange.internal_name: 30,
|
||||
PermanentCoins.internal_name: PermanentCoins.option_false,
|
||||
TimeIsMoney.internal_name: TimeIsMoney.option_required,
|
||||
EndingChoice.internal_name: EndingChoice.option_true,
|
||||
Campaign.internal_name: Campaign.option_basic,
|
||||
ItemShuffle.internal_name: ItemShuffle.option_shuffled,
|
||||
}
|
||||
|
||||
lfod_campaign_settings = {
|
||||
DoubleJumpGlitch.internal_name: DoubleJumpGlitch.option_none,
|
||||
CoinSanity.internal_name: CoinSanity.option_coin,
|
||||
CoinSanityRange.internal_name: 30,
|
||||
PermanentCoins.internal_name: PermanentCoins.option_false,
|
||||
TimeIsMoney.internal_name: TimeIsMoney.option_required,
|
||||
EndingChoice.internal_name: EndingChoice.option_true,
|
||||
Campaign.internal_name: Campaign.option_live_freemium_or_die,
|
||||
ItemShuffle.internal_name: ItemShuffle.option_shuffled,
|
||||
}
|
||||
|
||||
easy_settings = {
|
||||
DoubleJumpGlitch.internal_name: DoubleJumpGlitch.option_none,
|
||||
CoinSanity.internal_name: CoinSanity.option_none,
|
||||
CoinSanityRange.internal_name: 40,
|
||||
PermanentCoins.internal_name: PermanentCoins.option_true,
|
||||
TimeIsMoney.internal_name: TimeIsMoney.option_required,
|
||||
EndingChoice.internal_name: EndingChoice.option_true,
|
||||
Campaign.internal_name: Campaign.option_both,
|
||||
ItemShuffle.internal_name: ItemShuffle.option_shuffled,
|
||||
}
|
||||
|
||||
hard_settings = {
|
||||
DoubleJumpGlitch.internal_name: DoubleJumpGlitch.option_simple,
|
||||
CoinSanity.internal_name: CoinSanity.option_coin,
|
||||
CoinSanityRange.internal_name: 30,
|
||||
PermanentCoins.internal_name: PermanentCoins.option_false,
|
||||
TimeIsMoney.internal_name: TimeIsMoney.option_optional,
|
||||
EndingChoice.internal_name: EndingChoice.option_true,
|
||||
Campaign.internal_name: Campaign.option_both,
|
||||
ItemShuffle.internal_name: ItemShuffle.option_shuffled,
|
||||
}
|
||||
|
||||
|
||||
dlcq_options_presets: Dict[str, Dict[str, Any]] = {
|
||||
"All random": all_random_settings,
|
||||
"Main campaign": main_campaign_settings,
|
||||
"LFOD campaign": lfod_campaign_settings,
|
||||
"Both easy": easy_settings,
|
||||
"Both hard": hard_settings,
|
||||
}
|
||||
@@ -660,11 +660,18 @@ commands.add_command("ap-get-technology", "Grant a technology, used by the Archi
|
||||
end
|
||||
local tech
|
||||
local force = game.forces["player"]
|
||||
if call.parameter == nil then
|
||||
game.print("ap-get-technology is only to be used by the Archipelago Factorio Client")
|
||||
return
|
||||
end
|
||||
chunks = split(call.parameter, "\t")
|
||||
local item_name = chunks[1]
|
||||
local index = chunks[2]
|
||||
local source = chunks[3] or "Archipelago"
|
||||
if index == -1 then -- for coop sync and restoring from an older savegame
|
||||
if index == nil then
|
||||
game.print("ap-get-technology is only to be used by the Archipelago Factorio Client")
|
||||
return
|
||||
elseif index == -1 then -- for coop sync and restoring from an older savegame
|
||||
tech = force.technologies[item_name]
|
||||
if tech.researched ~= true then
|
||||
game.print({"", "Received [technology=" .. tech.name .. "] as it is already checked."})
|
||||
|
||||
@@ -71,7 +71,7 @@ class FFMQClient(SNIClient):
|
||||
received = await snes_read(ctx, RECEIVED_DATA[0], RECEIVED_DATA[1])
|
||||
data = await snes_read(ctx, READ_DATA_START, READ_DATA_END - READ_DATA_START)
|
||||
check_2 = await snes_read(ctx, 0xF53749, 1)
|
||||
if check_1 in (b'\x00', b'\x55') or check_2 in (b'\x00', b'\x55'):
|
||||
if check_1 != b'\x01' or check_2 != b'\x01':
|
||||
return
|
||||
|
||||
def get_range(data_range):
|
||||
|
||||
@@ -222,10 +222,10 @@ for item, data in item_table.items():
|
||||
|
||||
def create_items(self) -> None:
|
||||
items = []
|
||||
starting_weapon = self.multiworld.starting_weapon[self.player].current_key.title().replace("_", " ")
|
||||
starting_weapon = self.options.starting_weapon.current_key.title().replace("_", " ")
|
||||
self.multiworld.push_precollected(self.create_item(starting_weapon))
|
||||
self.multiworld.push_precollected(self.create_item("Steel Armor"))
|
||||
if self.multiworld.sky_coin_mode[self.player] == "start_with":
|
||||
if self.options.sky_coin_mode == "start_with":
|
||||
self.multiworld.push_precollected(self.create_item("Sky Coin"))
|
||||
|
||||
precollected_item_names = {item.name for item in self.multiworld.precollected_items[self.player]}
|
||||
@@ -233,28 +233,28 @@ def create_items(self) -> None:
|
||||
def add_item(item_name):
|
||||
if item_name in ["Steel Armor", "Sky Fragment"] or "Progressive" in item_name:
|
||||
return
|
||||
if item_name.lower().replace(" ", "_") == self.multiworld.starting_weapon[self.player].current_key:
|
||||
if item_name.lower().replace(" ", "_") == self.options.starting_weapon.current_key:
|
||||
return
|
||||
if self.multiworld.progressive_gear[self.player]:
|
||||
if self.options.progressive_gear:
|
||||
for item_group in prog_map:
|
||||
if item_name in self.item_name_groups[item_group]:
|
||||
item_name = prog_map[item_group]
|
||||
break
|
||||
if item_name == "Sky Coin":
|
||||
if self.multiworld.sky_coin_mode[self.player] == "shattered_sky_coin":
|
||||
if self.options.sky_coin_mode == "shattered_sky_coin":
|
||||
for _ in range(40):
|
||||
items.append(self.create_item("Sky Fragment"))
|
||||
return
|
||||
elif self.multiworld.sky_coin_mode[self.player] == "save_the_crystals":
|
||||
elif self.options.sky_coin_mode == "save_the_crystals":
|
||||
items.append(self.create_filler())
|
||||
return
|
||||
if item_name in precollected_item_names:
|
||||
items.append(self.create_filler())
|
||||
return
|
||||
i = self.create_item(item_name)
|
||||
if self.multiworld.logic[self.player] != "friendly" and item_name in ("Magic Mirror", "Mask"):
|
||||
if self.options.logic != "friendly" and item_name in ("Magic Mirror", "Mask"):
|
||||
i.classification = ItemClassification.useful
|
||||
if (self.multiworld.logic[self.player] == "expert" and self.multiworld.map_shuffle[self.player] == "none" and
|
||||
if (self.options.logic == "expert" and self.options.map_shuffle == "none" and
|
||||
item_name == "Exit Book"):
|
||||
i.classification = ItemClassification.progression
|
||||
items.append(i)
|
||||
@@ -263,11 +263,11 @@ def create_items(self) -> None:
|
||||
for item in self.item_name_groups[item_group]:
|
||||
add_item(item)
|
||||
|
||||
if self.multiworld.brown_boxes[self.player] == "include":
|
||||
if self.options.brown_boxes == "include":
|
||||
filler_items = []
|
||||
for item, count in fillers.items():
|
||||
filler_items += [self.create_item(item) for _ in range(count)]
|
||||
if self.multiworld.sky_coin_mode[self.player] == "shattered_sky_coin":
|
||||
if self.options.sky_coin_mode == "shattered_sky_coin":
|
||||
self.multiworld.random.shuffle(filler_items)
|
||||
filler_items = filler_items[39:]
|
||||
items += filler_items
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from Options import Choice, FreeText, Toggle, Range
|
||||
from Options import Choice, FreeText, Toggle, Range, PerGameCommonOptions
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
class Logic(Choice):
|
||||
@@ -321,36 +322,36 @@ class KaelisMomFightsMinotaur(Toggle):
|
||||
default = 0
|
||||
|
||||
|
||||
option_definitions = {
|
||||
"logic": Logic,
|
||||
"brown_boxes": BrownBoxes,
|
||||
"sky_coin_mode": SkyCoinMode,
|
||||
"shattered_sky_coin_quantity": ShatteredSkyCoinQuantity,
|
||||
"starting_weapon": StartingWeapon,
|
||||
"progressive_gear": ProgressiveGear,
|
||||
"leveling_curve": LevelingCurve,
|
||||
"starting_companion": StartingCompanion,
|
||||
"available_companions": AvailableCompanions,
|
||||
"companions_locations": CompanionsLocations,
|
||||
"kaelis_mom_fight_minotaur": KaelisMomFightsMinotaur,
|
||||
"companion_leveling_type": CompanionLevelingType,
|
||||
"companion_spellbook_type": CompanionSpellbookType,
|
||||
"enemies_density": EnemiesDensity,
|
||||
"enemies_scaling_lower": EnemiesScalingLower,
|
||||
"enemies_scaling_upper": EnemiesScalingUpper,
|
||||
"bosses_scaling_lower": BossesScalingLower,
|
||||
"bosses_scaling_upper": BossesScalingUpper,
|
||||
"enemizer_attacks": EnemizerAttacks,
|
||||
"enemizer_groups": EnemizerGroups,
|
||||
"shuffle_res_weak_types": ShuffleResWeakType,
|
||||
"shuffle_enemies_position": ShuffleEnemiesPositions,
|
||||
"progressive_formations": ProgressiveFormations,
|
||||
"doom_castle_mode": DoomCastle,
|
||||
"doom_castle_shortcut": DoomCastleShortcut,
|
||||
"tweak_frustrating_dungeons": TweakFrustratingDungeons,
|
||||
"map_shuffle": MapShuffle,
|
||||
"crest_shuffle": CrestShuffle,
|
||||
"shuffle_battlefield_rewards": ShuffleBattlefieldRewards,
|
||||
"map_shuffle_seed": MapShuffleSeed,
|
||||
"battlefields_battles_quantities": BattlefieldsBattlesQuantities,
|
||||
}
|
||||
@dataclass
|
||||
class FFMQOptions(PerGameCommonOptions):
|
||||
logic: Logic
|
||||
brown_boxes: BrownBoxes
|
||||
sky_coin_mode: SkyCoinMode
|
||||
shattered_sky_coin_quantity: ShatteredSkyCoinQuantity
|
||||
starting_weapon: StartingWeapon
|
||||
progressive_gear: ProgressiveGear
|
||||
leveling_curve: LevelingCurve
|
||||
starting_companion: StartingCompanion
|
||||
available_companions: AvailableCompanions
|
||||
companions_locations: CompanionsLocations
|
||||
kaelis_mom_fight_minotaur: KaelisMomFightsMinotaur
|
||||
companion_leveling_type: CompanionLevelingType
|
||||
companion_spellbook_type: CompanionSpellbookType
|
||||
enemies_density: EnemiesDensity
|
||||
enemies_scaling_lower: EnemiesScalingLower
|
||||
enemies_scaling_upper: EnemiesScalingUpper
|
||||
bosses_scaling_lower: BossesScalingLower
|
||||
bosses_scaling_upper: BossesScalingUpper
|
||||
enemizer_attacks: EnemizerAttacks
|
||||
enemizer_groups: EnemizerGroups
|
||||
shuffle_res_weak_types: ShuffleResWeakType
|
||||
shuffle_enemies_position: ShuffleEnemiesPositions
|
||||
progressive_formations: ProgressiveFormations
|
||||
doom_castle_mode: DoomCastle
|
||||
doom_castle_shortcut: DoomCastleShortcut
|
||||
tweak_frustrating_dungeons: TweakFrustratingDungeons
|
||||
map_shuffle: MapShuffle
|
||||
crest_shuffle: CrestShuffle
|
||||
shuffle_battlefield_rewards: ShuffleBattlefieldRewards
|
||||
map_shuffle_seed: MapShuffleSeed
|
||||
battlefields_battles_quantities: BattlefieldsBattlesQuantities
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import yaml
|
||||
import os
|
||||
import zipfile
|
||||
import Utils
|
||||
from copy import deepcopy
|
||||
from .Regions import object_id_table
|
||||
from Utils import __version__
|
||||
from worlds.Files import APPatch
|
||||
import pkgutil
|
||||
|
||||
settings_template = yaml.load(pkgutil.get_data(__name__, "data/settings.yaml"), yaml.Loader)
|
||||
settings_template = Utils.parse_yaml(pkgutil.get_data(__name__, "data/settings.yaml"))
|
||||
|
||||
|
||||
def generate_output(self, output_directory):
|
||||
@@ -21,7 +21,7 @@ def generate_output(self, output_directory):
|
||||
item_name = "".join(item_name.split(" "))
|
||||
else:
|
||||
if item.advancement or item.useful or (item.trap and
|
||||
self.multiworld.per_slot_randoms[self.player].randint(0, 1)):
|
||||
self.random.randint(0, 1)):
|
||||
item_name = "APItem"
|
||||
else:
|
||||
item_name = "APItemFiller"
|
||||
@@ -46,60 +46,60 @@ def generate_output(self, output_directory):
|
||||
options = deepcopy(settings_template)
|
||||
options["name"] = self.multiworld.player_name[self.player]
|
||||
option_writes = {
|
||||
"enemies_density": cc(self.multiworld.enemies_density[self.player]),
|
||||
"enemies_density": cc(self.options.enemies_density),
|
||||
"chests_shuffle": "Include",
|
||||
"shuffle_boxes_content": self.multiworld.brown_boxes[self.player] == "shuffle",
|
||||
"shuffle_boxes_content": self.options.brown_boxes == "shuffle",
|
||||
"npcs_shuffle": "Include",
|
||||
"battlefields_shuffle": "Include",
|
||||
"logic_options": cc(self.multiworld.logic[self.player]),
|
||||
"shuffle_enemies_position": tf(self.multiworld.shuffle_enemies_position[self.player]),
|
||||
"enemies_scaling_lower": cc(self.multiworld.enemies_scaling_lower[self.player]),
|
||||
"enemies_scaling_upper": cc(self.multiworld.enemies_scaling_upper[self.player]),
|
||||
"bosses_scaling_lower": cc(self.multiworld.bosses_scaling_lower[self.player]),
|
||||
"bosses_scaling_upper": cc(self.multiworld.bosses_scaling_upper[self.player]),
|
||||
"enemizer_attacks": cc(self.multiworld.enemizer_attacks[self.player]),
|
||||
"leveling_curve": cc(self.multiworld.leveling_curve[self.player]),
|
||||
"battles_quantity": cc(self.multiworld.battlefields_battles_quantities[self.player]) if
|
||||
self.multiworld.battlefields_battles_quantities[self.player].value < 5 else
|
||||
"logic_options": cc(self.options.logic),
|
||||
"shuffle_enemies_position": tf(self.options.shuffle_enemies_position),
|
||||
"enemies_scaling_lower": cc(self.options.enemies_scaling_lower),
|
||||
"enemies_scaling_upper": cc(self.options.enemies_scaling_upper),
|
||||
"bosses_scaling_lower": cc(self.options.bosses_scaling_lower),
|
||||
"bosses_scaling_upper": cc(self.options.bosses_scaling_upper),
|
||||
"enemizer_attacks": cc(self.options.enemizer_attacks),
|
||||
"leveling_curve": cc(self.options.leveling_curve),
|
||||
"battles_quantity": cc(self.options.battlefields_battles_quantities) if
|
||||
self.options.battlefields_battles_quantities.value < 5 else
|
||||
"RandomLow" if
|
||||
self.multiworld.battlefields_battles_quantities[self.player].value == 5 else
|
||||
self.options.battlefields_battles_quantities.value == 5 else
|
||||
"RandomHigh",
|
||||
"shuffle_battlefield_rewards": tf(self.multiworld.shuffle_battlefield_rewards[self.player]),
|
||||
"shuffle_battlefield_rewards": tf(self.options.shuffle_battlefield_rewards),
|
||||
"random_starting_weapon": True,
|
||||
"progressive_gear": tf(self.multiworld.progressive_gear[self.player]),
|
||||
"tweaked_dungeons": tf(self.multiworld.tweak_frustrating_dungeons[self.player]),
|
||||
"doom_castle_mode": cc(self.multiworld.doom_castle_mode[self.player]),
|
||||
"doom_castle_shortcut": tf(self.multiworld.doom_castle_shortcut[self.player]),
|
||||
"sky_coin_mode": cc(self.multiworld.sky_coin_mode[self.player]),
|
||||
"sky_coin_fragments_qty": cc(self.multiworld.shattered_sky_coin_quantity[self.player]),
|
||||
"progressive_gear": tf(self.options.progressive_gear),
|
||||
"tweaked_dungeons": tf(self.options.tweak_frustrating_dungeons),
|
||||
"doom_castle_mode": cc(self.options.doom_castle_mode),
|
||||
"doom_castle_shortcut": tf(self.options.doom_castle_shortcut),
|
||||
"sky_coin_mode": cc(self.options.sky_coin_mode),
|
||||
"sky_coin_fragments_qty": cc(self.options.shattered_sky_coin_quantity),
|
||||
"enable_spoilers": False,
|
||||
"progressive_formations": cc(self.multiworld.progressive_formations[self.player]),
|
||||
"map_shuffling": cc(self.multiworld.map_shuffle[self.player]),
|
||||
"crest_shuffle": tf(self.multiworld.crest_shuffle[self.player]),
|
||||
"enemizer_groups": cc(self.multiworld.enemizer_groups[self.player]),
|
||||
"shuffle_res_weak_type": tf(self.multiworld.shuffle_res_weak_types[self.player]),
|
||||
"companion_leveling_type": cc(self.multiworld.companion_leveling_type[self.player]),
|
||||
"companion_spellbook_type": cc(self.multiworld.companion_spellbook_type[self.player]),
|
||||
"starting_companion": cc(self.multiworld.starting_companion[self.player]),
|
||||
"progressive_formations": cc(self.options.progressive_formations),
|
||||
"map_shuffling": cc(self.options.map_shuffle),
|
||||
"crest_shuffle": tf(self.options.crest_shuffle),
|
||||
"enemizer_groups": cc(self.options.enemizer_groups),
|
||||
"shuffle_res_weak_type": tf(self.options.shuffle_res_weak_types),
|
||||
"companion_leveling_type": cc(self.options.companion_leveling_type),
|
||||
"companion_spellbook_type": cc(self.options.companion_spellbook_type),
|
||||
"starting_companion": cc(self.options.starting_companion),
|
||||
"available_companions": ["Zero", "One", "Two",
|
||||
"Three", "Four"][self.multiworld.available_companions[self.player].value],
|
||||
"companions_locations": cc(self.multiworld.companions_locations[self.player]),
|
||||
"kaelis_mom_fight_minotaur": tf(self.multiworld.kaelis_mom_fight_minotaur[self.player]),
|
||||
"Three", "Four"][self.options.available_companions.value],
|
||||
"companions_locations": cc(self.options.companions_locations),
|
||||
"kaelis_mom_fight_minotaur": tf(self.options.kaelis_mom_fight_minotaur),
|
||||
}
|
||||
|
||||
for option, data in option_writes.items():
|
||||
options["Final Fantasy Mystic Quest"][option][data] = 1
|
||||
|
||||
rom_name = f'MQ{__version__.replace(".", "")[0:3]}_{self.player}_{self.multiworld.seed_name:11}'[:21]
|
||||
rom_name = f'MQ{Utils.__version__.replace(".", "")[0:3]}_{self.player}_{self.multiworld.seed_name:11}'[:21]
|
||||
self.rom_name = bytearray(rom_name,
|
||||
'utf8')
|
||||
self.rom_name_available_event.set()
|
||||
|
||||
setup = {"version": "1.5", "name": self.multiworld.player_name[self.player], "romname": rom_name, "seed":
|
||||
hex(self.multiworld.per_slot_randoms[self.player].randint(0, 0xFFFFFFFF)).split("0x")[1].upper()}
|
||||
hex(self.random.randint(0, 0xFFFFFFFF)).split("0x")[1].upper()}
|
||||
|
||||
starting_items = [output_item_name(item) for item in self.multiworld.precollected_items[self.player]]
|
||||
if self.multiworld.sky_coin_mode[self.player] == "shattered_sky_coin":
|
||||
if self.options.sky_coin_mode == "shattered_sky_coin":
|
||||
starting_items.append("SkyCoin")
|
||||
|
||||
file_path = os.path.join(output_directory, f"{self.multiworld.get_out_file_name_base(self.player)}.apmq")
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
from BaseClasses import Region, MultiWorld, Entrance, Location, LocationProgressType, ItemClassification
|
||||
from worlds.generic.Rules import add_rule
|
||||
from .data.rooms import rooms, entrances
|
||||
from .Items import item_groups, yaml_item
|
||||
import pkgutil
|
||||
import yaml
|
||||
|
||||
rooms = yaml.load(pkgutil.get_data(__name__, "data/rooms.yaml"), yaml.Loader)
|
||||
entrance_names = {entrance["id"]: entrance["name"] for entrance in yaml.load(pkgutil.get_data(__name__, "data/entrances.yaml"), yaml.Loader)}
|
||||
entrance_names = {entrance["id"]: entrance["name"] for entrance in entrances}
|
||||
|
||||
object_id_table = {}
|
||||
object_type_table = {}
|
||||
@@ -69,7 +67,7 @@ def create_regions(self):
|
||||
location_table else None, object["type"], object["access"],
|
||||
self.create_item(yaml_item(object["on_trigger"][0])) if object["type"] == "Trigger" else None) for object in
|
||||
room["game_objects"] if "Hero Chest" not in object["name"] and object["type"] not in ("BattlefieldGp",
|
||||
"BattlefieldXp") and (object["type"] != "Box" or self.multiworld.brown_boxes[self.player] == "include") and
|
||||
"BattlefieldXp") and (object["type"] != "Box" or self.options.brown_boxes == "include") and
|
||||
not (object["name"] == "Kaeli Companion" and not object["on_trigger"])], room["links"]))
|
||||
|
||||
dark_king_room = self.multiworld.get_region("Doom Castle Dark King Room", self.player)
|
||||
@@ -91,15 +89,13 @@ def create_regions(self):
|
||||
if "entrance" in link and link["entrance"] != -1:
|
||||
spoiler = False
|
||||
if link["entrance"] in crest_warps:
|
||||
if self.multiworld.crest_shuffle[self.player]:
|
||||
if self.options.crest_shuffle:
|
||||
spoiler = True
|
||||
elif self.multiworld.map_shuffle[self.player] == "everything":
|
||||
elif self.options.map_shuffle == "everything":
|
||||
spoiler = True
|
||||
elif "Subregion" in region.name and self.multiworld.map_shuffle[self.player] not in ("dungeons",
|
||||
"none"):
|
||||
elif "Subregion" in region.name and self.options.map_shuffle not in ("dungeons", "none"):
|
||||
spoiler = True
|
||||
elif "Subregion" not in region.name and self.multiworld.map_shuffle[self.player] not in ("none",
|
||||
"overworld"):
|
||||
elif "Subregion" not in region.name and self.options.map_shuffle not in ("none", "overworld"):
|
||||
spoiler = True
|
||||
|
||||
if spoiler:
|
||||
@@ -111,6 +107,7 @@ def create_regions(self):
|
||||
connection.connect(connect_room)
|
||||
break
|
||||
|
||||
|
||||
non_dead_end_crest_rooms = [
|
||||
'Libra Temple', 'Aquaria Gemini Room', "GrenadeMan's Mobius Room", 'Fireburg Gemini Room',
|
||||
'Sealed Temple', 'Alive Forest', 'Kaidge Temple Upper Ledge',
|
||||
@@ -140,7 +137,7 @@ def set_rules(self) -> None:
|
||||
add_rule(self.multiworld.get_location("Gidrah", self.player), hard_boss_logic)
|
||||
add_rule(self.multiworld.get_location("Dullahan", self.player), hard_boss_logic)
|
||||
|
||||
if self.multiworld.map_shuffle[self.player]:
|
||||
if self.options.map_shuffle:
|
||||
for boss in ("Freezer Crab", "Ice Golem", "Jinn", "Medusa", "Dualhead Hydra"):
|
||||
loc = self.multiworld.get_location(boss, self.player)
|
||||
checked_regions = {loc.parent_region}
|
||||
@@ -158,12 +155,12 @@ def set_rules(self) -> None:
|
||||
return True
|
||||
check_foresta(loc.parent_region)
|
||||
|
||||
if self.multiworld.logic[self.player] == "friendly":
|
||||
if self.options.logic == "friendly":
|
||||
process_rules(self.multiworld.get_entrance("Overworld - Ice Pyramid", self.player),
|
||||
["MagicMirror"])
|
||||
process_rules(self.multiworld.get_entrance("Overworld - Volcano", self.player),
|
||||
["Mask"])
|
||||
if self.multiworld.map_shuffle[self.player] in ("none", "overworld"):
|
||||
if self.options.map_shuffle in ("none", "overworld"):
|
||||
process_rules(self.multiworld.get_entrance("Overworld - Bone Dungeon", self.player),
|
||||
["Bomb"])
|
||||
process_rules(self.multiworld.get_entrance("Overworld - Wintry Cave", self.player),
|
||||
@@ -185,8 +182,8 @@ def set_rules(self) -> None:
|
||||
process_rules(self.multiworld.get_entrance("Overworld - Mac Ship Doom", self.player),
|
||||
["DragonClaw", "CaptainCap"])
|
||||
|
||||
if self.multiworld.logic[self.player] == "expert":
|
||||
if self.multiworld.map_shuffle[self.player] == "none" and not self.multiworld.crest_shuffle[self.player]:
|
||||
if self.options.logic == "expert":
|
||||
if self.options.map_shuffle == "none" and not self.options.crest_shuffle:
|
||||
inner_room = self.multiworld.get_region("Wintry Temple Inner Room", self.player)
|
||||
connection = Entrance(self.player, "Sealed Temple Exit Trick", inner_room)
|
||||
connection.connect(self.multiworld.get_region("Wintry Temple Outer Room", self.player))
|
||||
@@ -198,14 +195,14 @@ def set_rules(self) -> None:
|
||||
if entrance.connected_region.name in non_dead_end_crest_rooms:
|
||||
entrance.access_rule = lambda state: False
|
||||
|
||||
if self.multiworld.sky_coin_mode[self.player] == "shattered_sky_coin":
|
||||
logic_coins = [16, 24, 32, 32, 38][self.multiworld.shattered_sky_coin_quantity[self.player].value]
|
||||
if self.options.sky_coin_mode == "shattered_sky_coin":
|
||||
logic_coins = [16, 24, 32, 32, 38][self.options.shattered_sky_coin_quantity.value]
|
||||
self.multiworld.get_entrance("Focus Tower 1F - Sky Door", self.player).access_rule = \
|
||||
lambda state: state.has("Sky Fragment", self.player, logic_coins)
|
||||
elif self.multiworld.sky_coin_mode[self.player] == "save_the_crystals":
|
||||
elif self.options.sky_coin_mode == "save_the_crystals":
|
||||
self.multiworld.get_entrance("Focus Tower 1F - Sky Door", self.player).access_rule = \
|
||||
lambda state: state.has_all(["Flamerus Rex", "Dualhead Hydra", "Ice Golem", "Pazuzu"], self.player)
|
||||
elif self.multiworld.sky_coin_mode[self.player] in ("standard", "start_with"):
|
||||
elif self.options.sky_coin_mode in ("standard", "start_with"):
|
||||
self.multiworld.get_entrance("Focus Tower 1F - Sky Door", self.player).access_rule = \
|
||||
lambda state: state.has("Sky Coin", self.player)
|
||||
|
||||
@@ -213,26 +210,24 @@ def set_rules(self) -> None:
|
||||
def stage_set_rules(multiworld):
|
||||
# If there's no enemies, there's no repeatable income sources
|
||||
no_enemies_players = [player for player in multiworld.get_game_players("Final Fantasy Mystic Quest")
|
||||
if multiworld.enemies_density[player] == "none"]
|
||||
if multiworld.worlds[player].options.enemies_density == "none"]
|
||||
if (len([item for item in multiworld.itempool if item.classification in (ItemClassification.filler,
|
||||
ItemClassification.trap)]) > len([player for player in no_enemies_players if
|
||||
multiworld.accessibility[player] == "minimal"]) * 3):
|
||||
multiworld.worlds[player].options.accessibility == "minimal"]) * 3):
|
||||
for player in no_enemies_players:
|
||||
for location in vendor_locations:
|
||||
if multiworld.accessibility[player] == "locations":
|
||||
if multiworld.worlds[player].options.accessibility == "full":
|
||||
multiworld.get_location(location, player).progress_type = LocationProgressType.EXCLUDED
|
||||
else:
|
||||
multiworld.get_location(location, player).access_rule = lambda state: False
|
||||
else:
|
||||
# There are not enough junk items to fill non-minimal players' vendors. Just set an item rule not allowing
|
||||
# advancement items so that useful items can be placed
|
||||
# advancement items so that useful items can be placed.
|
||||
for player in no_enemies_players:
|
||||
for location in vendor_locations:
|
||||
multiworld.get_location(location, player).item_rule = lambda item: not item.advancement
|
||||
|
||||
|
||||
|
||||
|
||||
class FFMQLocation(Location):
|
||||
game = "Final Fantasy Mystic Quest"
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ from .Regions import create_regions, location_table, set_rules, stage_set_rules,
|
||||
non_dead_end_crest_warps
|
||||
from .Items import item_table, item_groups, create_items, FFMQItem, fillers
|
||||
from .Output import generate_output
|
||||
from .Options import option_definitions
|
||||
from .Options import FFMQOptions
|
||||
from .Client import FFMQClient
|
||||
|
||||
|
||||
@@ -25,14 +25,25 @@ from .Client import FFMQClient
|
||||
|
||||
|
||||
class FFMQWebWorld(WebWorld):
|
||||
tutorials = [Tutorial(
|
||||
setup_en = Tutorial(
|
||||
"Multiworld Setup Guide",
|
||||
"A guide to playing Final Fantasy Mystic Quest with Archipelago.",
|
||||
"English",
|
||||
"setup_en.md",
|
||||
"setup/en",
|
||||
["Alchav"]
|
||||
)]
|
||||
)
|
||||
|
||||
setup_fr = Tutorial(
|
||||
setup_en.tutorial_name,
|
||||
setup_en.description,
|
||||
"Français",
|
||||
"setup_fr.md",
|
||||
"setup/fr",
|
||||
["Artea"]
|
||||
)
|
||||
|
||||
tutorials = [setup_en, setup_fr]
|
||||
|
||||
|
||||
class FFMQWorld(World):
|
||||
@@ -45,7 +56,8 @@ class FFMQWorld(World):
|
||||
|
||||
item_name_to_id = {name: data.id for name, data in item_table.items() if data.id is not None}
|
||||
location_name_to_id = location_table
|
||||
option_definitions = option_definitions
|
||||
options_dataclass = FFMQOptions
|
||||
options: FFMQOptions
|
||||
|
||||
topology_present = True
|
||||
|
||||
@@ -67,20 +79,14 @@ class FFMQWorld(World):
|
||||
super().__init__(world, player)
|
||||
|
||||
def generate_early(self):
|
||||
if self.multiworld.sky_coin_mode[self.player] == "shattered_sky_coin":
|
||||
self.multiworld.brown_boxes[self.player].value = 1
|
||||
if self.multiworld.enemies_scaling_lower[self.player].value > \
|
||||
self.multiworld.enemies_scaling_upper[self.player].value:
|
||||
(self.multiworld.enemies_scaling_lower[self.player].value,
|
||||
self.multiworld.enemies_scaling_upper[self.player].value) =\
|
||||
(self.multiworld.enemies_scaling_upper[self.player].value,
|
||||
self.multiworld.enemies_scaling_lower[self.player].value)
|
||||
if self.multiworld.bosses_scaling_lower[self.player].value > \
|
||||
self.multiworld.bosses_scaling_upper[self.player].value:
|
||||
(self.multiworld.bosses_scaling_lower[self.player].value,
|
||||
self.multiworld.bosses_scaling_upper[self.player].value) =\
|
||||
(self.multiworld.bosses_scaling_upper[self.player].value,
|
||||
self.multiworld.bosses_scaling_lower[self.player].value)
|
||||
if self.options.sky_coin_mode == "shattered_sky_coin":
|
||||
self.options.brown_boxes.value = 1
|
||||
if self.options.enemies_scaling_lower.value > self.options.enemies_scaling_upper.value:
|
||||
self.options.enemies_scaling_lower.value, self.options.enemies_scaling_upper.value = \
|
||||
self.options.enemies_scaling_upper.value, self.options.enemies_scaling_lower.value
|
||||
if self.options.bosses_scaling_lower.value > self.options.bosses_scaling_upper.value:
|
||||
self.options.bosses_scaling_lower.value, self.options.bosses_scaling_upper.value = \
|
||||
self.options.bosses_scaling_upper.value, self.options.bosses_scaling_lower.value
|
||||
|
||||
@classmethod
|
||||
def stage_generate_early(cls, multiworld):
|
||||
@@ -94,20 +100,20 @@ class FFMQWorld(World):
|
||||
rooms_data = {}
|
||||
|
||||
for world in multiworld.get_game_worlds("Final Fantasy Mystic Quest"):
|
||||
if (world.multiworld.map_shuffle[world.player] or world.multiworld.crest_shuffle[world.player] or
|
||||
world.multiworld.crest_shuffle[world.player]):
|
||||
if world.multiworld.map_shuffle_seed[world.player].value.isdigit():
|
||||
multiworld.random.seed(int(world.multiworld.map_shuffle_seed[world.player].value))
|
||||
elif world.multiworld.map_shuffle_seed[world.player].value != "random":
|
||||
multiworld.random.seed(int(hash(world.multiworld.map_shuffle_seed[world.player].value))
|
||||
+ int(world.multiworld.seed))
|
||||
if (world.options.map_shuffle or world.options.crest_shuffle or world.options.shuffle_battlefield_rewards
|
||||
or world.options.companions_locations):
|
||||
if world.options.map_shuffle_seed.value.isdigit():
|
||||
multiworld.random.seed(int(world.options.map_shuffle_seed.value))
|
||||
elif world.options.map_shuffle_seed.value != "random":
|
||||
multiworld.random.seed(int(hash(world.options.map_shuffle_seed.value))
|
||||
+ int(world.multiworld.seed))
|
||||
|
||||
seed = hex(multiworld.random.randint(0, 0xFFFFFFFF)).split("0x")[1].upper()
|
||||
map_shuffle = multiworld.map_shuffle[world.player].value
|
||||
crest_shuffle = multiworld.crest_shuffle[world.player].current_key
|
||||
battlefield_shuffle = multiworld.shuffle_battlefield_rewards[world.player].current_key
|
||||
companion_shuffle = multiworld.companions_locations[world.player].value
|
||||
kaeli_mom = multiworld.kaelis_mom_fight_minotaur[world.player].current_key
|
||||
map_shuffle = world.options.map_shuffle.value
|
||||
crest_shuffle = world.options.crest_shuffle.current_key
|
||||
battlefield_shuffle = world.options.shuffle_battlefield_rewards.current_key
|
||||
companion_shuffle = world.options.companions_locations.value
|
||||
kaeli_mom = world.options.kaelis_mom_fight_minotaur.current_key
|
||||
|
||||
query = f"s={seed}&m={map_shuffle}&c={crest_shuffle}&b={battlefield_shuffle}&cs={companion_shuffle}&km={kaeli_mom}"
|
||||
|
||||
@@ -175,14 +181,14 @@ class FFMQWorld(World):
|
||||
|
||||
def extend_hint_information(self, hint_data):
|
||||
hint_data[self.player] = {}
|
||||
if self.multiworld.map_shuffle[self.player]:
|
||||
if self.options.map_shuffle:
|
||||
single_location_regions = ["Subregion Volcano Battlefield", "Subregion Mac's Ship", "Subregion Doom Castle"]
|
||||
for subregion in ["Subregion Foresta", "Subregion Aquaria", "Subregion Frozen Fields", "Subregion Fireburg",
|
||||
"Subregion Volcano Battlefield", "Subregion Windia", "Subregion Mac's Ship",
|
||||
"Subregion Doom Castle"]:
|
||||
region = self.multiworld.get_region(subregion, self.player)
|
||||
for location in region.locations:
|
||||
if location.address and self.multiworld.map_shuffle[self.player] != "dungeons":
|
||||
if location.address and self.options.map_shuffle != "dungeons":
|
||||
hint_data[self.player][location.address] = (subregion.split("Subregion ")[-1]
|
||||
+ (" Region" if subregion not in
|
||||
single_location_regions else ""))
|
||||
@@ -202,14 +208,13 @@ class FFMQWorld(World):
|
||||
for location in exit_check.connected_region.locations:
|
||||
if location.address:
|
||||
hint = []
|
||||
if self.multiworld.map_shuffle[self.player] != "dungeons":
|
||||
if self.options.map_shuffle != "dungeons":
|
||||
hint.append((subregion.split("Subregion ")[-1] + (" Region" if subregion not
|
||||
in single_location_regions else "")))
|
||||
if self.multiworld.map_shuffle[self.player] != "overworld" and subregion not in \
|
||||
("Subregion Mac's Ship", "Subregion Doom Castle"):
|
||||
if self.options.map_shuffle != "overworld":
|
||||
hint.append(overworld_spot.name.split("Overworld - ")[-1].replace("Pazuzu",
|
||||
"Pazuzu's"))
|
||||
hint = " - ".join(hint)
|
||||
hint = " - ".join(hint).replace(" - Mac Ship", "")
|
||||
if location.address in hint_data[self.player]:
|
||||
hint_data[self.player][location.address] += f"/{hint}"
|
||||
else:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
2
worlds/ffmq/data/rooms.py
Normal file
2
worlds/ffmq/data/rooms.py
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,8 @@
|
||||
# Final Fantasy Mystic Quest
|
||||
|
||||
## Game page in other languages:
|
||||
* [Français](/games/Final%20Fantasy%20Mystic%20Quest/info/fr)
|
||||
|
||||
## Where is the options page?
|
||||
|
||||
The [player options page for this game](../player-options) contains all the options you need to configure and export a
|
||||
|
||||
36
worlds/ffmq/docs/fr_Final Fantasy Mystic Quest.md
Normal file
36
worlds/ffmq/docs/fr_Final Fantasy Mystic Quest.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# Final Fantasy Mystic Quest
|
||||
|
||||
## Page d'info dans d'autres langues :
|
||||
* [English](/games/Final%20Fantasy%20Mystic%20Quest/info/en)
|
||||
|
||||
## Où se situe la page d'options?
|
||||
|
||||
La [page de configuration](../player-options) contient toutes les options nécessaires pour créer un fichier de configuration.
|
||||
|
||||
## Qu'est-ce qui est rendu aléatoire dans ce jeu?
|
||||
|
||||
Outre les objets mélangés, il y a plusieurs options pour aussi mélanger les villes et donjons, les pièces dans les donjons, les téléporteurs et les champs de bataille.
|
||||
Il y a aussi plusieurs autres options afin d'ajuster la difficulté du jeu et la vitesse d'une partie.
|
||||
|
||||
## Quels objets et emplacements sont mélangés?
|
||||
|
||||
Les objets normalement reçus des coffres rouges, des PNJ et des champs de bataille sont mélangés. Vous pouvez aussi
|
||||
inclure les objets des coffres bruns (qui contiennent normalement des consommables) dans les objets mélangés.
|
||||
|
||||
## Quels objets peuvent être dans les mondes des autres joueurs?
|
||||
|
||||
Tous les objets qui ont été déterminés mélangés dans les options peuvent être placés dans d'autres mondes.
|
||||
|
||||
## À quoi ressemblent les objets des autres joueurs dans Final Fantasy Mystic Quest?
|
||||
|
||||
Les emplacements qui étaient à l'origine des coffres (rouges ou bruns si ceux-ci sont inclus) apparaîtront comme des coffres.
|
||||
Les coffres rouges seront des objets utiles ou de progression, alors que les coffres bruns seront des objets de remplissage.
|
||||
Les pièges peuvent apparaître comme des coffres rouges ou bruns.
|
||||
Lorsque vous ouvrirez un coffre contenant un objet d'un autre joueur, vous recevrez l'icône d'Archipelago et
|
||||
la boîte de dialogue vous indiquera avoir reçu un "Archipelago Item".
|
||||
|
||||
|
||||
## Lorsqu'un joueur reçoit un objet, qu'arrive-t-il?
|
||||
|
||||
Une boîte de dialogue apparaîtra pour vous montrer l'objet que vous avez reçu. Vous ne pourrez pas recevoir d'objet si vous êtes
|
||||
en combat, dans la mappemonde ou dans les menus (à l'exception de lorsque vous fermez le menu).
|
||||
@@ -17,6 +17,12 @@ The Archipelago community cannot supply you with this.
|
||||
|
||||
## Installation Procedures
|
||||
|
||||
### Linux Setup
|
||||
|
||||
1. Download and install [Archipelago](<https://github.com/ArchipelagoMW/Archipelago/releases/latest>). **The installer
|
||||
file is located in the assets section at the bottom of the version information. You'll likely be looking for the `.AppImage`.**
|
||||
2. It is recommended to use either RetroArch or BizHawk if you run on linux, as snes9x-rr isn't compatible.
|
||||
|
||||
### Windows Setup
|
||||
|
||||
1. Download and install [Archipelago](<https://github.com/ArchipelagoMW/Archipelago/releases/latest>). **The installer
|
||||
@@ -75,8 +81,7 @@ Manually launch the SNI Client, and run the patched ROM in your chosen software
|
||||
|
||||
#### With an emulator
|
||||
|
||||
When the client launched automatically, SNI should have also automatically launched in the background. If this is its
|
||||
first time launching, you may be prompted to allow it to communicate through the Windows Firewall.
|
||||
If this is the first time SNI launches, you may be prompted to allow it to communicate through the Windows Firewall.
|
||||
|
||||
##### snes9x-rr
|
||||
|
||||
@@ -133,10 +138,10 @@ page: [usb2snes Supported Platforms Page](http://usb2snes.com/#supported-platfor
|
||||
|
||||
### Connect to the Archipelago Server
|
||||
|
||||
The patch file which launched your client should have automatically connected you to the AP Server. There are a few
|
||||
reasons this may not happen however, including if the game is hosted on the website but was generated elsewhere. If the
|
||||
client window shows "Server Status: Not Connected", simply ask the host for the address of the server, and copy/paste it
|
||||
into the "Server" input field then press enter.
|
||||
SNI serves as the interface between your emulator and the server. Since you launched it manually, you need to tell it what server to connect to.
|
||||
If the server is hosted on Archipelago.gg, get the port the server hosts your game on at the top of the game room (last line before the worlds are listed).
|
||||
In the SNI client, either type `/connect address` (where `address` is the address of the server, for example `/connect archipelago.gg:12345`), or type the address and port on the "Server" input field, then press `Connect`.
|
||||
If the server is hosted locally, simply ask the host for the address of the server, and copy/paste it into the "Server" input field then press `Connect`.
|
||||
|
||||
The client will attempt to reconnect to the new server address, and should momentarily show "Server Status: Connected".
|
||||
|
||||
|
||||
178
worlds/ffmq/docs/setup_fr.md
Normal file
178
worlds/ffmq/docs/setup_fr.md
Normal file
@@ -0,0 +1,178 @@
|
||||
# Final Fantasy Mystic Quest Setup Guide
|
||||
|
||||
## Logiciels requis
|
||||
|
||||
- [Archipelago](https://github.com/ArchipelagoMW/Archipelago/releases)
|
||||
- Une solution logicielle ou matérielle capable de charger et de lancer des fichiers ROM de SNES
|
||||
- Un émulateur capable d'éxécuter des scripts Lua
|
||||
- snes9x-rr de: [snes9x rr](https://github.com/gocha/snes9x-rr/releases),
|
||||
- BizHawk from: [BizHawk Website](http://tasvideos.org/BizHawk.html),
|
||||
- RetroArch 1.10.1 or newer from: [RetroArch Website](https://retroarch.com?page=platforms). Ou,
|
||||
- Un SD2SNES, [FXPak Pro](https://krikzz.com/store/home/54-fxpak-pro.html), ou une autre solution matérielle
|
||||
compatible
|
||||
- Le fichier ROM de la v1.0 ou v1.1 NA de Final Fantasy Mystic Quest obtenu légalement, sûrement nommé `Final Fantasy - Mystic Quest (U) (V1.0).sfc` ou `Final Fantasy - Mystic Quest (U) (V1.1).sfc`
|
||||
La communauté d'Archipelago ne peut vous fournir avec ce fichier.
|
||||
|
||||
## Procédure d'installation
|
||||
|
||||
### Installation sur Linux
|
||||
|
||||
1. Téléchargez et installez [Archipelago](<https://github.com/ArchipelagoMW/Archipelago/releases/latest>).
|
||||
** Le fichier d'installation est situé dans la section "assets" dans le bas de la fenêtre d'information de la version. Vous voulez probablement le `.AppImage`**
|
||||
2. L'utilisation de RetroArch ou BizHawk est recommandé pour les utilisateurs linux, puisque snes9x-rr n'est pas compatible.
|
||||
|
||||
### Installation sur Windows
|
||||
|
||||
1. Téléchargez et installez [Archipelago](<https://github.com/ArchipelagoMW/Archipelago/releases/latest>).
|
||||
** Le fichier d'installation est situé dans la section "assets" dans le bas de la fenêtre d'information de la version.**
|
||||
2. Si vous utilisez un émulateur, il est recommandé d'assigner votre émulateur capable d'éxécuter des scripts Lua comme
|
||||
programme par défaut pour ouvrir vos ROMs.
|
||||
1. Extrayez votre dossier d'émulateur sur votre Bureau, ou à un endroit dont vous vous souviendrez.
|
||||
2. Faites un clic droit sur un fichier ROM et sélectionnez **Ouvrir avec...**
|
||||
3. Cochez la case à côté de **Toujours utiliser cette application pour ouvrir les fichiers `.sfc`**
|
||||
4. Descendez jusqu'en bas de la liste et sélectionnez **Rechercher une autre application sur ce PC**
|
||||
5. Naviguez dans les dossiers jusqu'au fichier `.exe` de votre émulateur et choisissez **Ouvrir**. Ce fichier
|
||||
devrait se trouver dans le dossier que vous avez extrait à la première étape.
|
||||
|
||||
|
||||
## Créer son fichier de configuration (.yaml)
|
||||
|
||||
### Qu'est-ce qu'un fichier de configuration et pourquoi en ai-je besoin ?
|
||||
|
||||
Votre fichier de configuration contient un ensemble d'options de configuration pour indiquer au générateur
|
||||
comment il devrait générer votre seed. Chaque joueur d'un multiworld devra fournir son propre fichier de configuration. Cela permet
|
||||
à chaque joueur d'apprécier une expérience personalisée. Les différents joueurs d'un même multiworld
|
||||
pouront avoir des options de génération différentes.
|
||||
Vous pouvez lire le [guide pour créer un YAML de base](/tutorial/Archipelago/setup/en) en anglais.
|
||||
|
||||
### Où est-ce que j'obtiens un fichier de configuration ?
|
||||
|
||||
La [page d'options sur le site](/games/Final%20Fantasy%20Mystic%20Quest/player-options) vous permet de choisir vos
|
||||
options de génération et de les exporter vers un fichier de configuration.
|
||||
Il vous est aussi possible de trouver le fichier de configuration modèle de Mystic Quest dans votre répertoire d'installation d'Archipelago,
|
||||
dans le dossier Players/Templates.
|
||||
|
||||
### Vérifier son fichier de configuration
|
||||
|
||||
Si vous voulez valider votre fichier de configuration pour être sûr qu'il fonctionne, vous pouvez le vérifier sur la page du
|
||||
[Validateur de YAML](/mysterycheck).
|
||||
|
||||
## Générer une partie pour un joueur
|
||||
|
||||
1. Aller sur la page [Génération de partie](/games/Final%20Fantasy%20Mystic%20Quest/player-options), configurez vos options,
|
||||
et cliquez sur le bouton "Generate Game".
|
||||
2. Il vous sera alors présenté une page d'informations sur la seed
|
||||
3. Cliquez sur le lien "Create New Room".
|
||||
4. Vous verrez s'afficher la page du server, de laquelle vous pourrez télécharger votre fichier patch `.apmq`.
|
||||
5. Rendez-vous sur le [site FFMQR](https://ffmqrando.net/Archipelago).
|
||||
Sur cette page, sélectionnez votre ROM Final Fantasy Mystic Quest original dans le boîte "ROM", puis votre ficher patch `.apmq` dans la boîte "Load Archipelago Config File".
|
||||
Cliquez sur "Generate". Un téléchargement avec votre ROM aléatoire devrait s'amorcer.
|
||||
6. Puisque cette partie est à un seul joueur, vous n'avez plus besoin du client Archipelago ni du serveur, sentez-vous libre de les fermer.
|
||||
|
||||
## Rejoindre un MultiWorld
|
||||
|
||||
### Obtenir son patch et créer sa ROM
|
||||
|
||||
Quand vous rejoignez un multiworld, il vous sera demandé de fournir votre fichier de configuration à celui qui héberge la partie ou
|
||||
s'occupe de la génération. Une fois cela fait, l'hôte vous fournira soit un lien pour télécharger votre patch, soit un
|
||||
fichier `.zip` contenant les patchs de tous les joueurs. Votre patch devrait avoir l'extension `.apmq`.
|
||||
|
||||
Allez au [site FFMQR](https://ffmqrando.net/Archipelago) et sélectionnez votre ROM Final Fantasy Mystic Quest original dans le boîte "ROM", puis votre ficher patch `.apmq` dans la boîte "Load Archipelago Config File".
|
||||
Cliquez sur "Generate". Un téléchargement avec votre ROM aléatoire devrait s'amorcer.
|
||||
|
||||
Ouvrez le client SNI (sur Windows ArchipelagoSNIClient.exe, sur Linux ouvrez le `.appImage` puis cliquez sur SNI Client), puis ouvrez le ROM téléchargé avec votre émulateur choisi.
|
||||
|
||||
### Se connecter au client
|
||||
|
||||
#### Avec un émulateur
|
||||
|
||||
Quand le client se lance automatiquement, QUsb2Snes devrait également se lancer automatiquement en arrière-plan. Si
|
||||
c'est la première fois qu'il démarre, il vous sera peut-être demandé de l'autoriser à communiquer à travers le pare-feu
|
||||
Windows.
|
||||
|
||||
##### snes9x-rr
|
||||
|
||||
1. Chargez votre ROM si ce n'est pas déjà fait.
|
||||
2. Cliquez sur le menu "File" et survolez l'option **Lua Scripting**
|
||||
3. Cliquez alors sur **New Lua Script Window...**
|
||||
4. Dans la nouvelle fenêtre, sélectionnez **Browse...**
|
||||
5. Sélectionnez le fichier connecteur lua fourni avec votre client
|
||||
- Regardez dans le dossier Archipelago et cherchez `/SNI/lua/x64` ou `/SNI/lua/x86`, dépendemment de si votre emulateur
|
||||
est 64-bit ou 32-bit.
|
||||
6. Si vous obtenez une erreur `socket.dll missing` ou une erreur similaire lorsque vous chargez le script lua, vous devez naviguer dans le dossier
|
||||
contenant le script lua, puis copier le fichier `socket.dll` dans le dossier d'installation de votre emulateur snes9x.
|
||||
|
||||
##### BizHawk
|
||||
|
||||
1. Assurez vous d'avoir le coeur BSNES chargé. Cela est possible en cliquant sur le menu "Tools" de BizHawk et suivant
|
||||
ces options de menu :
|
||||
`Config --> Cores --> SNES --> BSNES`
|
||||
Une fois le coeur changé, vous devez redémarrer BizHawk.
|
||||
2. Chargez votre ROM si ce n'est pas déjà fait.
|
||||
3. Cliquez sur le menu "Tools" et cliquez sur **Lua Console**
|
||||
4. Cliquez sur le bouton pour ouvrir un nouveau script Lua, soit par le bouton avec un icône "Ouvrir un dossier",
|
||||
en cliquant `Open Script...` dans le menu Script ou en appuyant sur `ctrl-O`.
|
||||
5. Sélectionnez le fichier `Connector.lua` inclus avec le client
|
||||
- Regardez dans le dossier Archipelago et cherchez `/SNI/lua/x64` ou `/SNI/lua/x86`, dépendemment de si votre emulateur
|
||||
est 64-bit ou 32-bit. Notez que les versions les plus récentes de BizHawk ne sont que 64-bit.
|
||||
|
||||
##### RetroArch 1.10.1 ou plus récent
|
||||
|
||||
Vous ne devez faire ces étapes qu'une fois. À noter que RetroArch 1.9.x ne fonctionnera pas puisqu'il s'agit d'une version moins récente que 1.10.1.
|
||||
|
||||
1. Entrez dans le menu principal de RetroArch.
|
||||
2. Allez dans Settings --> User Interface. Activez l'option "Show Advanced Settings".
|
||||
3. Allez dans Settings --> Network. Activez l'option "Network Commands", qui se trouve sous "Request Device 16".
|
||||
Laissez le "Network Command Port" à sa valeur par defaut, qui devrait être 55355.
|
||||
|
||||
|
||||

|
||||
4. Allez dans le Menu Principal --> Online Updater --> Core Downloader. Trouvez et sélectionnez "Nintendo - SNES / SFC (bsnes-mercury
|
||||
Performance)".
|
||||
|
||||
Lorsque vous chargez un ROM pour Archipelago, assurez vous de toujours sélectionner le coeur **bsnes-mercury**.
|
||||
Ce sont les seuls coeurs qui permettent à des outils extérieurs de lire les données du ROM.
|
||||
|
||||
#### Avec une solution matérielle
|
||||
|
||||
Ce guide suppose que vous avez téléchargé le bon micro-logiciel pour votre appareil. Si ce n'est pas déjà le cas, faites
|
||||
le maintenant. Les utilisateurs de SD2SNES et de FXPak Pro peuvent télécharger le micro-logiciel approprié
|
||||
[ici](https://github.com/RedGuyyyy/sd2snes/releases). Pour les autres solutions, de l'aide peut être trouvée
|
||||
[sur cette page](http://usb2snes.com/#supported-platforms).
|
||||
|
||||
1. Fermez votre émulateur, qui s'est potentiellement lancé automatiquement.
|
||||
2. Ouvrez votre appareil et chargez le ROM.
|
||||
|
||||
### Se connecter au MultiServer
|
||||
|
||||
Puisque vous avez lancé SNI manuellement, vous devrez probablement lui indiquer l'adresse à laquelle il doit se connecter.
|
||||
Si le serveur est hébergé sur le site d'Archipelago, vous verrez l'adresse à laquelle vous connecter dans le haut de la page, dernière ligne avant la liste des mondes.
|
||||
Tapez `/connect adresse` (ou le "adresse" est remplacé par l'adresse archipelago, par exemple `/connect archipelago.gg:12345`) dans la boîte de commande au bas de votre client SNI, ou encore écrivez l'adresse dans la boîte "server" dans le haut du client, puis cliquez `Connect`.
|
||||
Si le serveur n'est pas hébergé sur le site d'Archipelago, demandez à l'hôte l'adresse du serveur, puis tapez `/connect adresse` (ou "adresse" est remplacé par l'adresse fourni par l'hôte) ou copiez/collez cette adresse dans le champ "Server" puis appuyez sur "Connect".
|
||||
|
||||
Le client essaiera de vous reconnecter à la nouvelle adresse du serveur, et devrait mentionner "Server Status:
|
||||
Connected". Si le client ne se connecte pas après quelques instants, il faudra peut-être rafraîchir la page de
|
||||
l'interface Web.
|
||||
|
||||
### Jouer au jeu
|
||||
|
||||
Une fois que l'interface Web affiche que la SNES et le serveur sont connectés, vous êtes prêt à jouer. Félicitations
|
||||
pour avoir rejoint un multiworld !
|
||||
|
||||
## Héberger un MultiWorld
|
||||
|
||||
La méthode recommandée pour héberger une partie est d'utiliser le service d'hébergement fourni par
|
||||
Archipelago. Le processus est relativement simple :
|
||||
|
||||
1. Récupérez les fichiers de configuration (.yaml) des joueurs.
|
||||
2. Créez une archive zip contenant ces fichiers de configuration.
|
||||
3. Téléversez l'archive zip sur le lien ci-dessous.
|
||||
- Generate page: [WebHost Seed Generation Page](/generate)
|
||||
4. Attendez un moment que la seed soit générée.
|
||||
5. Lorsque la seed est générée, vous serez redirigé vers une page d'informations "Seed Info".
|
||||
6. Cliquez sur "Create New Room". Cela vous amènera à la page du serveur. Fournissez le lien de cette page aux autres
|
||||
joueurs afin qu'ils puissent récupérer leurs patchs.
|
||||
7. Remarquez qu'un lien vers le traqueur du MultiWorld est en haut de la page de la salle. Vous devriez également
|
||||
fournir ce lien aux joueurs pour qu'ils puissent suivre la progression de la partie. N'importe quelle personne voulant
|
||||
observer devrait avoir accès à ce lien.
|
||||
8. Une fois que tous les joueurs ont rejoint, vous pouvez commencer à jouer.
|
||||
@@ -102,10 +102,10 @@ See the plando guide for more info on plando options. Plando
|
||||
guide: [Archipelago Plando Guide](/tutorial/Archipelago/plando/en)
|
||||
|
||||
* `accessibility` determines the level of access to the game the generation will expect you to have in order to reach
|
||||
your completion goal. This supports `items`, `locations`, and `minimal` and is set to `locations` by default.
|
||||
* `locations` will guarantee all locations are accessible in your world.
|
||||
your completion goal. This supports `full`, `items`, and `minimal` and is set to `full` by default.
|
||||
* `full` will guarantee all locations are accessible in your world.
|
||||
* `items` will guarantee you can acquire all logically relevant items in your world. Some items, such as keys, may
|
||||
be self-locking.
|
||||
be self-locking. This value only exists in and affects some worlds.
|
||||
* `minimal` will only guarantee that the seed is beatable. You will be guaranteed able to finish the seed logically
|
||||
but may not be able to access all locations or acquire all items. A good example of this is having a big key in
|
||||
the big chest in a dungeon in ALTTP making it impossible to get and finish the dungeon.
|
||||
|
||||
@@ -12,7 +12,7 @@ Some steps also assume use of Windows, so may vary with your OS.
|
||||
## Installing the Archipelago software
|
||||
|
||||
The most recent public release of Archipelago can be found on GitHub:
|
||||
[Archipelago Lastest Release](https://github.com/ArchipelagoMW/Archipelago/releases/latest).
|
||||
[Archipelago Latest Release](https://github.com/ArchipelagoMW/Archipelago/releases/latest).
|
||||
|
||||
Run the exe file, and after accepting the license agreement you will be asked which components you would like to
|
||||
install.
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import typing
|
||||
import re
|
||||
from dataclasses import dataclass, make_dataclass
|
||||
|
||||
from .ExtractedData import logic_options, starts, pool_options
|
||||
from .Rules import cost_terms
|
||||
from schema import And, Schema, Optional
|
||||
|
||||
from Options import Option, DefaultOnToggle, Toggle, Choice, Range, OptionDict, NamedRange, DeathLink
|
||||
from Options import Option, DefaultOnToggle, Toggle, Choice, Range, OptionDict, NamedRange, DeathLink, PerGameCommonOptions
|
||||
from .Charms import vanilla_costs, names as charm_names
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
@@ -403,9 +405,20 @@ class Goal(Choice):
|
||||
option_radiance = 3
|
||||
option_godhome = 4
|
||||
option_godhome_flower = 5
|
||||
option_grub_hunt = 6
|
||||
default = 0
|
||||
|
||||
|
||||
class GrubHuntGoal(NamedRange):
|
||||
"""The amount of grubs required to finish Grub Hunt.
|
||||
On 'All' any grubs from item links replacements etc. will be counted"""
|
||||
display_name = "Grub Hunt Goal"
|
||||
range_start = 1
|
||||
range_end = 46
|
||||
special_range_names = {"all": -1}
|
||||
default = 46
|
||||
|
||||
|
||||
class WhitePalace(Choice):
|
||||
"""
|
||||
Whether or not to include White Palace or not. Note: Even if excluded, the King Fragment check may still be
|
||||
@@ -520,7 +533,7 @@ hollow_knight_options: typing.Dict[str, type(Option)] = {
|
||||
**{
|
||||
option.__name__: option
|
||||
for option in (
|
||||
StartLocation, Goal, WhitePalace, ExtraPlatforms, AddUnshuffledLocations, StartingGeo,
|
||||
StartLocation, Goal, GrubHuntGoal, WhitePalace, ExtraPlatforms, AddUnshuffledLocations, StartingGeo,
|
||||
DeathLink, DeathLinkShade, DeathLinkBreaksFragileCharms,
|
||||
MinimumGeoPrice, MaximumGeoPrice,
|
||||
MinimumGrubPrice, MaximumGrubPrice,
|
||||
@@ -538,3 +551,5 @@ hollow_knight_options: typing.Dict[str, type(Option)] = {
|
||||
},
|
||||
**cost_sanity_weights
|
||||
}
|
||||
|
||||
HKOptions = make_dataclass("HKOptions", [(name, option) for name, option in hollow_knight_options.items()], bases=(PerGameCommonOptions,))
|
||||
|
||||
@@ -49,3 +49,42 @@ def set_rules(hk_world: World):
|
||||
if term == "GEO": # No geo logic!
|
||||
continue
|
||||
add_rule(location, lambda state, term=term, amount=amount: state.count(term, player) >= amount)
|
||||
|
||||
|
||||
def _hk_nail_combat(state, player) -> bool:
|
||||
return state.has_any({'LEFTSLASH', 'RIGHTSLASH', 'UPSLASH'}, player)
|
||||
|
||||
|
||||
def _hk_can_beat_thk(state, player) -> bool:
|
||||
return (
|
||||
state.has('Opened_Black_Egg_Temple', player)
|
||||
and (state.count('FIREBALL', player) + state.count('SCREAM', player) + state.count('QUAKE', player)) > 1
|
||||
and _hk_nail_combat(state, player)
|
||||
and (
|
||||
state.has_any({'LEFTDASH', 'RIGHTDASH'}, player)
|
||||
or state._hk_option(player, 'ProficientCombat')
|
||||
)
|
||||
and state.has('FOCUS', player)
|
||||
)
|
||||
|
||||
|
||||
def _hk_siblings_ending(state, player) -> bool:
|
||||
return _hk_can_beat_thk(state, player) and state.has('WHITEFRAGMENT', player, 3)
|
||||
|
||||
|
||||
def _hk_can_beat_radiance(state, player) -> bool:
|
||||
return (
|
||||
state.has('Opened_Black_Egg_Temple', player)
|
||||
and _hk_nail_combat(state, player)
|
||||
and state.has('WHITEFRAGMENT', player, 3)
|
||||
and state.has('DREAMNAIL', player)
|
||||
and (
|
||||
(state.has('LEFTCLAW', player) and state.has('RIGHTCLAW', player))
|
||||
or state.has('WINGS', player)
|
||||
)
|
||||
and (state.count('FIREBALL', player) + state.count('SCREAM', player) + state.count('QUAKE', player)) > 1
|
||||
and (
|
||||
(state.has('LEFTDASH', player, 2) and state.has('RIGHTDASH', player, 2)) # Both Shade Cloaks
|
||||
or (state._hk_option(player, 'ProficientCombat') and state.has('QUAKE', player)) # or Dive
|
||||
)
|
||||
)
|
||||
|
||||
@@ -5,19 +5,20 @@ import typing
|
||||
from copy import deepcopy
|
||||
import itertools
|
||||
import operator
|
||||
from collections import defaultdict, Counter
|
||||
|
||||
logger = logging.getLogger("Hollow Knight")
|
||||
|
||||
from .Items import item_table, lookup_type_to_names, item_name_groups
|
||||
from .Regions import create_regions
|
||||
from .Rules import set_rules, cost_terms
|
||||
from .Rules import set_rules, cost_terms, _hk_can_beat_thk, _hk_siblings_ending, _hk_can_beat_radiance
|
||||
from .Options import hollow_knight_options, hollow_knight_randomize_options, Goal, WhitePalace, CostSanity, \
|
||||
shop_to_option
|
||||
shop_to_option, HKOptions, GrubHuntGoal
|
||||
from .ExtractedData import locations, starts, multi_locations, location_to_region_lookup, \
|
||||
event_names, item_effects, connectors, one_ways, vanilla_shop_costs, vanilla_location_costs
|
||||
from .Charms import names as charm_names
|
||||
|
||||
from BaseClasses import Region, Location, MultiWorld, Item, LocationProgressType, Tutorial, ItemClassification
|
||||
from BaseClasses import Region, Location, MultiWorld, Item, LocationProgressType, Tutorial, ItemClassification, CollectionState
|
||||
from worlds.AutoWorld import World, LogicMixin, WebWorld
|
||||
|
||||
path_of_pain_locations = {
|
||||
@@ -142,7 +143,8 @@ class HKWorld(World):
|
||||
As the enigmatic Knight, you’ll traverse the depths, unravel its mysteries and conquer its evils.
|
||||
""" # from https://www.hollowknight.com
|
||||
game: str = "Hollow Knight"
|
||||
option_definitions = hollow_knight_options
|
||||
options_dataclass = HKOptions
|
||||
options: HKOptions
|
||||
|
||||
web = HKWeb()
|
||||
|
||||
@@ -154,40 +156,42 @@ class HKWorld(World):
|
||||
ranges: typing.Dict[str, typing.Tuple[int, int]]
|
||||
charm_costs: typing.List[int]
|
||||
cached_filler_items = {}
|
||||
grub_count: int
|
||||
|
||||
def __init__(self, world, player):
|
||||
super(HKWorld, self).__init__(world, player)
|
||||
def __init__(self, multiworld, player):
|
||||
super(HKWorld, self).__init__(multiworld, player)
|
||||
self.created_multi_locations: typing.Dict[str, typing.List[HKLocation]] = {
|
||||
location: list() for location in multi_locations
|
||||
}
|
||||
self.ranges = {}
|
||||
self.created_shop_items = 0
|
||||
self.vanilla_shop_costs = deepcopy(vanilla_shop_costs)
|
||||
self.grub_count = 0
|
||||
|
||||
def generate_early(self):
|
||||
world = self.multiworld
|
||||
charm_costs = world.RandomCharmCosts[self.player].get_costs(world.random)
|
||||
self.charm_costs = world.PlandoCharmCosts[self.player].get_costs(charm_costs)
|
||||
# world.exclude_locations[self.player].value.update(white_palace_locations)
|
||||
options = self.options
|
||||
charm_costs = options.RandomCharmCosts.get_costs(self.random)
|
||||
self.charm_costs = options.PlandoCharmCosts.get_costs(charm_costs)
|
||||
# options.exclude_locations.value.update(white_palace_locations)
|
||||
for term, data in cost_terms.items():
|
||||
mini = getattr(world, f"Minimum{data.option}Price")[self.player]
|
||||
maxi = getattr(world, f"Maximum{data.option}Price")[self.player]
|
||||
mini = getattr(options, f"Minimum{data.option}Price")
|
||||
maxi = getattr(options, f"Maximum{data.option}Price")
|
||||
# if minimum > maximum, set minimum to maximum
|
||||
mini.value = min(mini.value, maxi.value)
|
||||
self.ranges[term] = mini.value, maxi.value
|
||||
world.push_precollected(HKItem(starts[world.StartLocation[self.player].current_key],
|
||||
self.multiworld.push_precollected(HKItem(starts[options.StartLocation.current_key],
|
||||
True, None, "Event", self.player))
|
||||
|
||||
def white_palace_exclusions(self):
|
||||
exclusions = set()
|
||||
wp = self.multiworld.WhitePalace[self.player]
|
||||
wp = self.options.WhitePalace
|
||||
if wp <= WhitePalace.option_nopathofpain:
|
||||
exclusions.update(path_of_pain_locations)
|
||||
if wp <= WhitePalace.option_kingfragment:
|
||||
exclusions.update(white_palace_checks)
|
||||
if wp == WhitePalace.option_exclude:
|
||||
exclusions.add("King_Fragment")
|
||||
if self.multiworld.RandomizeCharms[self.player]:
|
||||
if self.options.RandomizeCharms:
|
||||
# If charms are randomized, this will be junk-filled -- so transitions and events are not progression
|
||||
exclusions.update(white_palace_transitions)
|
||||
exclusions.update(white_palace_events)
|
||||
@@ -200,7 +204,7 @@ class HKWorld(World):
|
||||
|
||||
# check for any goal that godhome events are relevant to
|
||||
all_event_names = event_names.copy()
|
||||
if self.multiworld.Goal[self.player] in [Goal.option_godhome, Goal.option_godhome_flower]:
|
||||
if self.options.Goal in [Goal.option_godhome, Goal.option_godhome_flower, Goal.option_any]:
|
||||
from .GodhomeData import godhome_event_names
|
||||
all_event_names.update(set(godhome_event_names))
|
||||
|
||||
@@ -230,12 +234,12 @@ class HKWorld(World):
|
||||
pool: typing.List[HKItem] = []
|
||||
wp_exclusions = self.white_palace_exclusions()
|
||||
junk_replace: typing.Set[str] = set()
|
||||
if self.multiworld.RemoveSpellUpgrades[self.player]:
|
||||
if self.options.RemoveSpellUpgrades:
|
||||
junk_replace.update(("Abyss_Shriek", "Shade_Soul", "Descending_Dark"))
|
||||
|
||||
randomized_starting_items = set()
|
||||
for attr, items in randomizable_starting_items.items():
|
||||
if getattr(self.multiworld, attr)[self.player]:
|
||||
if getattr(self.options, attr):
|
||||
randomized_starting_items.update(items)
|
||||
|
||||
# noinspection PyShadowingNames
|
||||
@@ -257,7 +261,7 @@ class HKWorld(World):
|
||||
if item_name in junk_replace:
|
||||
item_name = self.get_filler_item_name()
|
||||
|
||||
item = self.create_item(item_name) if not vanilla or location_name == "Start" or self.multiworld.AddUnshuffledLocations[self.player] else self.create_event(item_name)
|
||||
item = self.create_item(item_name) if not vanilla or location_name == "Start" or self.options.AddUnshuffledLocations else self.create_event(item_name)
|
||||
|
||||
if location_name == "Start":
|
||||
if item_name in randomized_starting_items:
|
||||
@@ -281,55 +285,55 @@ class HKWorld(World):
|
||||
location.progress_type = LocationProgressType.EXCLUDED
|
||||
|
||||
for option_key, option in hollow_knight_randomize_options.items():
|
||||
randomized = getattr(self.multiworld, option_key)[self.player]
|
||||
if all([not randomized, option_key in logicless_options, not self.multiworld.AddUnshuffledLocations[self.player]]):
|
||||
randomized = getattr(self.options, option_key)
|
||||
if all([not randomized, option_key in logicless_options, not self.options.AddUnshuffledLocations]):
|
||||
continue
|
||||
for item_name, location_name in zip(option.items, option.locations):
|
||||
if item_name in junk_replace:
|
||||
item_name = self.get_filler_item_name()
|
||||
|
||||
if (item_name == "Crystal_Heart" and self.multiworld.SplitCrystalHeart[self.player]) or \
|
||||
(item_name == "Mothwing_Cloak" and self.multiworld.SplitMothwingCloak[self.player]):
|
||||
if (item_name == "Crystal_Heart" and self.options.SplitCrystalHeart) or \
|
||||
(item_name == "Mothwing_Cloak" and self.options.SplitMothwingCloak):
|
||||
_add("Left_" + item_name, location_name, randomized)
|
||||
_add("Right_" + item_name, "Split_" + location_name, randomized)
|
||||
continue
|
||||
if item_name == "Mantis_Claw" and self.multiworld.SplitMantisClaw[self.player]:
|
||||
if item_name == "Mantis_Claw" and self.options.SplitMantisClaw:
|
||||
_add("Left_" + item_name, "Left_" + location_name, randomized)
|
||||
_add("Right_" + item_name, "Right_" + location_name, randomized)
|
||||
continue
|
||||
if item_name == "Shade_Cloak" and self.multiworld.SplitMothwingCloak[self.player]:
|
||||
if self.multiworld.random.randint(0, 1):
|
||||
if item_name == "Shade_Cloak" and self.options.SplitMothwingCloak:
|
||||
if self.random.randint(0, 1):
|
||||
item_name = "Left_Mothwing_Cloak"
|
||||
else:
|
||||
item_name = "Right_Mothwing_Cloak"
|
||||
if item_name == "Grimmchild2" and self.multiworld.RandomizeGrimmkinFlames[self.player] and self.multiworld.RandomizeCharms[self.player]:
|
||||
if item_name == "Grimmchild2" and self.options.RandomizeGrimmkinFlames and self.options.RandomizeCharms:
|
||||
_add("Grimmchild1", location_name, randomized)
|
||||
continue
|
||||
|
||||
_add(item_name, location_name, randomized)
|
||||
|
||||
if self.multiworld.RandomizeElevatorPass[self.player]:
|
||||
if self.options.RandomizeElevatorPass:
|
||||
randomized = True
|
||||
_add("Elevator_Pass", "Elevator_Pass", randomized)
|
||||
|
||||
for shop, locations in self.created_multi_locations.items():
|
||||
for _ in range(len(locations), getattr(self.multiworld, shop_to_option[shop])[self.player].value):
|
||||
for _ in range(len(locations), getattr(self.options, shop_to_option[shop]).value):
|
||||
loc = self.create_location(shop)
|
||||
unfilled_locations += 1
|
||||
|
||||
# Balance the pool
|
||||
item_count = len(pool)
|
||||
additional_shop_items = max(item_count - unfilled_locations, self.multiworld.ExtraShopSlots[self.player].value)
|
||||
additional_shop_items = max(item_count - unfilled_locations, self.options.ExtraShopSlots.value)
|
||||
|
||||
# Add additional shop items, as needed.
|
||||
if additional_shop_items > 0:
|
||||
shops = list(shop for shop, locations in self.created_multi_locations.items() if len(locations) < 16)
|
||||
if not self.multiworld.EggShopSlots[self.player].value: # No eggshop, so don't place items there
|
||||
if not self.options.EggShopSlots: # No eggshop, so don't place items there
|
||||
shops.remove('Egg_Shop')
|
||||
|
||||
if shops:
|
||||
for _ in range(additional_shop_items):
|
||||
shop = self.multiworld.random.choice(shops)
|
||||
shop = self.random.choice(shops)
|
||||
loc = self.create_location(shop)
|
||||
unfilled_locations += 1
|
||||
if len(self.created_multi_locations[shop]) >= 16:
|
||||
@@ -355,7 +359,7 @@ class HKWorld(World):
|
||||
loc.costs = costs
|
||||
|
||||
def apply_costsanity(self):
|
||||
setting = self.multiworld.CostSanity[self.player].value
|
||||
setting = self.options.CostSanity.value
|
||||
if not setting:
|
||||
return # noop
|
||||
|
||||
@@ -369,10 +373,10 @@ class HKWorld(World):
|
||||
|
||||
return {k: v for k, v in weights.items() if v}
|
||||
|
||||
random = self.multiworld.random
|
||||
hybrid_chance = getattr(self.multiworld, f"CostSanityHybridChance")[self.player].value
|
||||
random = self.random
|
||||
hybrid_chance = getattr(self.options, f"CostSanityHybridChance").value
|
||||
weights = {
|
||||
data.term: getattr(self.multiworld, f"CostSanity{data.option}Weight")[self.player].value
|
||||
data.term: getattr(self.options, f"CostSanity{data.option}Weight").value
|
||||
for data in cost_terms.values()
|
||||
}
|
||||
weights_geoless = dict(weights)
|
||||
@@ -427,31 +431,86 @@ class HKWorld(World):
|
||||
location.sort_costs()
|
||||
|
||||
def set_rules(self):
|
||||
world = self.multiworld
|
||||
multiworld = self.multiworld
|
||||
player = self.player
|
||||
goal = world.Goal[player]
|
||||
goal = self.options.Goal
|
||||
if goal == Goal.option_hollowknight:
|
||||
world.completion_condition[player] = lambda state: state._hk_can_beat_thk(player)
|
||||
multiworld.completion_condition[player] = lambda state: _hk_can_beat_thk(state, player)
|
||||
elif goal == Goal.option_siblings:
|
||||
world.completion_condition[player] = lambda state: state._hk_siblings_ending(player)
|
||||
multiworld.completion_condition[player] = lambda state: _hk_siblings_ending(state, player)
|
||||
elif goal == Goal.option_radiance:
|
||||
world.completion_condition[player] = lambda state: state._hk_can_beat_radiance(player)
|
||||
multiworld.completion_condition[player] = lambda state: _hk_can_beat_radiance(state, player)
|
||||
elif goal == Goal.option_godhome:
|
||||
world.completion_condition[player] = lambda state: state.count("Defeated_Pantheon_5", player)
|
||||
multiworld.completion_condition[player] = lambda state: state.count("Defeated_Pantheon_5", player)
|
||||
elif goal == Goal.option_godhome_flower:
|
||||
world.completion_condition[player] = lambda state: state.count("Godhome_Flower_Quest", player)
|
||||
multiworld.completion_condition[player] = lambda state: state.count("Godhome_Flower_Quest", player)
|
||||
elif goal == Goal.option_grub_hunt:
|
||||
pass # will set in stage_pre_fill()
|
||||
else:
|
||||
# Any goal
|
||||
world.completion_condition[player] = lambda state: state._hk_can_beat_thk(player) or state._hk_can_beat_radiance(player)
|
||||
multiworld.completion_condition[player] = lambda state: _hk_siblings_ending(state, player) and \
|
||||
_hk_can_beat_radiance(state, player) and state.count("Godhome_Flower_Quest", player)
|
||||
|
||||
set_rules(self)
|
||||
|
||||
@classmethod
|
||||
def stage_pre_fill(cls, multiworld: "MultiWorld"):
|
||||
def set_goal(player, grub_rule: typing.Callable[[CollectionState], bool]):
|
||||
world = multiworld.worlds[player]
|
||||
|
||||
if world.options.Goal == "grub_hunt":
|
||||
multiworld.completion_condition[player] = grub_rule
|
||||
else:
|
||||
old_rule = multiworld.completion_condition[player]
|
||||
multiworld.completion_condition[player] = lambda state: old_rule(state) and grub_rule(state)
|
||||
|
||||
worlds = [world for world in multiworld.get_game_worlds(cls.game) if world.options.Goal in ["any", "grub_hunt"]]
|
||||
if worlds:
|
||||
grubs = [item for item in multiworld.get_items() if item.name == "Grub"]
|
||||
all_grub_players = [world.player for world in multiworld.worlds.values() if world.options.GrubHuntGoal == GrubHuntGoal.special_range_names["all"]]
|
||||
|
||||
if all_grub_players:
|
||||
group_lookup = defaultdict(set)
|
||||
for group_id, group in multiworld.groups.items():
|
||||
for player in group["players"]:
|
||||
group_lookup[group_id].add(player)
|
||||
|
||||
grub_count_per_player = Counter()
|
||||
per_player_grubs_per_player = defaultdict(Counter)
|
||||
|
||||
for grub in grubs:
|
||||
player = grub.player
|
||||
if player in group_lookup:
|
||||
for real_player in group_lookup[player]:
|
||||
per_player_grubs_per_player[real_player][player] += 1
|
||||
else:
|
||||
per_player_grubs_per_player[player][player] += 1
|
||||
|
||||
if grub.location and grub.location.player in group_lookup.keys():
|
||||
for real_player in group_lookup[grub.location.player]:
|
||||
grub_count_per_player[real_player] += 1
|
||||
else:
|
||||
grub_count_per_player[player] += 1
|
||||
|
||||
for player, count in grub_count_per_player.items():
|
||||
multiworld.worlds[player].grub_count = count
|
||||
|
||||
for player, grub_player_count in per_player_grubs_per_player.items():
|
||||
if player in all_grub_players:
|
||||
set_goal(player, lambda state, g=grub_player_count: all(state.has("Grub", owner, count) for owner, count in g.items()))
|
||||
|
||||
for world in worlds:
|
||||
if world.player not in all_grub_players:
|
||||
world.grub_count = world.options.GrubHuntGoal.value
|
||||
player = world.player
|
||||
set_goal(player, lambda state, p=player, c=world.grub_count: state.has("Grub", p, c))
|
||||
|
||||
def fill_slot_data(self):
|
||||
slot_data = {}
|
||||
|
||||
options = slot_data["options"] = {}
|
||||
for option_name in self.option_definitions:
|
||||
option = getattr(self.multiworld, option_name)[self.player]
|
||||
for option_name in hollow_knight_options:
|
||||
option = getattr(self.options, option_name)
|
||||
try:
|
||||
optionvalue = int(option.value)
|
||||
except TypeError:
|
||||
@@ -460,10 +519,10 @@ class HKWorld(World):
|
||||
options[option_name] = optionvalue
|
||||
|
||||
# 32 bit int
|
||||
slot_data["seed"] = self.multiworld.per_slot_randoms[self.player].randint(-2147483647, 2147483646)
|
||||
slot_data["seed"] = self.random.randint(-2147483647, 2147483646)
|
||||
|
||||
# Backwards compatibility for shop cost data (HKAP < 0.1.0)
|
||||
if not self.multiworld.CostSanity[self.player]:
|
||||
if not self.options.CostSanity:
|
||||
for shop, terms in shop_cost_types.items():
|
||||
unit = cost_terms[next(iter(terms))].option
|
||||
if unit == "Geo":
|
||||
@@ -483,6 +542,8 @@ class HKWorld(World):
|
||||
|
||||
slot_data["notch_costs"] = self.charm_costs
|
||||
|
||||
slot_data["grub_count"] = self.grub_count
|
||||
|
||||
return slot_data
|
||||
|
||||
def create_item(self, name: str) -> HKItem:
|
||||
@@ -498,7 +559,7 @@ class HKWorld(World):
|
||||
basename = name
|
||||
if name in shop_cost_types:
|
||||
costs = {
|
||||
term: self.multiworld.random.randint(*self.ranges[term])
|
||||
term: self.random.randint(*self.ranges[term])
|
||||
for term in shop_cost_types[name]
|
||||
}
|
||||
elif name in vanilla_location_costs:
|
||||
@@ -512,7 +573,7 @@ class HKWorld(World):
|
||||
|
||||
region = self.multiworld.get_region("Menu", self.player)
|
||||
|
||||
if vanilla and not self.multiworld.AddUnshuffledLocations[self.player]:
|
||||
if vanilla and not self.options.AddUnshuffledLocations:
|
||||
loc = HKLocation(self.player, name,
|
||||
None, region, costs=costs, vanilla=vanilla,
|
||||
basename=basename)
|
||||
@@ -554,31 +615,32 @@ class HKWorld(World):
|
||||
for effect_name, effect_value in item_effects.get(item.name, {}).items():
|
||||
if state.prog_items[item.player][effect_name] == effect_value:
|
||||
del state.prog_items[item.player][effect_name]
|
||||
state.prog_items[item.player][effect_name] -= effect_value
|
||||
else:
|
||||
state.prog_items[item.player][effect_name] -= effect_value
|
||||
|
||||
return change
|
||||
|
||||
@classmethod
|
||||
def stage_write_spoiler(cls, world: MultiWorld, spoiler_handle):
|
||||
hk_players = world.get_game_players(cls.game)
|
||||
def stage_write_spoiler(cls, multiworld: MultiWorld, spoiler_handle):
|
||||
hk_players = multiworld.get_game_players(cls.game)
|
||||
spoiler_handle.write('\n\nCharm Notches:')
|
||||
for player in hk_players:
|
||||
name = world.get_player_name(player)
|
||||
name = multiworld.get_player_name(player)
|
||||
spoiler_handle.write(f'\n{name}\n')
|
||||
hk_world: HKWorld = world.worlds[player]
|
||||
hk_world: HKWorld = multiworld.worlds[player]
|
||||
for charm_number, cost in enumerate(hk_world.charm_costs):
|
||||
spoiler_handle.write(f"\n{charm_names[charm_number]}: {cost}")
|
||||
|
||||
spoiler_handle.write('\n\nShop Prices:')
|
||||
for player in hk_players:
|
||||
name = world.get_player_name(player)
|
||||
name = multiworld.get_player_name(player)
|
||||
spoiler_handle.write(f'\n{name}\n')
|
||||
hk_world: HKWorld = world.worlds[player]
|
||||
hk_world: HKWorld = multiworld.worlds[player]
|
||||
|
||||
if world.CostSanity[player].value:
|
||||
if hk_world.options.CostSanity:
|
||||
for loc in sorted(
|
||||
(
|
||||
loc for loc in itertools.chain(*(region.locations for region in world.get_regions(player)))
|
||||
loc for loc in itertools.chain(*(region.locations for region in multiworld.get_regions(player)))
|
||||
if loc.costs
|
||||
), key=operator.attrgetter('name')
|
||||
):
|
||||
@@ -602,15 +664,15 @@ class HKWorld(World):
|
||||
'RandomizeGeoRocks', 'RandomizeSoulTotems', 'RandomizeLoreTablets', 'RandomizeJunkPitChests',
|
||||
'RandomizeRancidEggs'
|
||||
):
|
||||
if getattr(self.multiworld, group):
|
||||
if getattr(self.options, group):
|
||||
fillers.extend(item for item in hollow_knight_randomize_options[group].items if item not in
|
||||
exclusions)
|
||||
self.cached_filler_items[self.player] = fillers
|
||||
return self.multiworld.random.choice(self.cached_filler_items[self.player])
|
||||
return self.random.choice(self.cached_filler_items[self.player])
|
||||
|
||||
|
||||
def create_region(world: MultiWorld, player: int, name: str, location_names=None) -> Region:
|
||||
ret = Region(name, player, world)
|
||||
def create_region(multiworld: MultiWorld, player: int, name: str, location_names=None) -> Region:
|
||||
ret = Region(name, player, multiworld)
|
||||
if location_names:
|
||||
for location in location_names:
|
||||
loc_id = HKWorld.location_name_to_id.get(location, None)
|
||||
@@ -683,42 +745,7 @@ class HKLogicMixin(LogicMixin):
|
||||
return sum(self.multiworld.worlds[player].charm_costs[notch] for notch in notches)
|
||||
|
||||
def _hk_option(self, player: int, option_name: str) -> int:
|
||||
return getattr(self.multiworld, option_name)[player].value
|
||||
return getattr(self.multiworld.worlds[player].options, option_name).value
|
||||
|
||||
def _hk_start(self, player, start_location: str) -> bool:
|
||||
return self.multiworld.StartLocation[player] == start_location
|
||||
|
||||
def _hk_nail_combat(self, player: int) -> bool:
|
||||
return self.has_any({'LEFTSLASH', 'RIGHTSLASH', 'UPSLASH'}, player)
|
||||
|
||||
def _hk_can_beat_thk(self, player: int) -> bool:
|
||||
return (
|
||||
self.has('Opened_Black_Egg_Temple', player)
|
||||
and (self.count('FIREBALL', player) + self.count('SCREAM', player) + self.count('QUAKE', player)) > 1
|
||||
and self._hk_nail_combat(player)
|
||||
and (
|
||||
self.has_any({'LEFTDASH', 'RIGHTDASH'}, player)
|
||||
or self._hk_option(player, 'ProficientCombat')
|
||||
)
|
||||
and self.has('FOCUS', player)
|
||||
)
|
||||
|
||||
def _hk_siblings_ending(self, player: int) -> bool:
|
||||
return self._hk_can_beat_thk(player) and self.has('WHITEFRAGMENT', player, 3)
|
||||
|
||||
def _hk_can_beat_radiance(self, player: int) -> bool:
|
||||
return (
|
||||
self.has('Opened_Black_Egg_Temple', player)
|
||||
and self._hk_nail_combat(player)
|
||||
and self.has('WHITEFRAGMENT', player, 3)
|
||||
and self.has('DREAMNAIL', player)
|
||||
and (
|
||||
(self.has('LEFTCLAW', player) and self.has('RIGHTCLAW', player))
|
||||
or self.has('WINGS', player)
|
||||
)
|
||||
and (self.count('FIREBALL', player) + self.count('SCREAM', player) + self.count('QUAKE', player)) > 1
|
||||
and (
|
||||
(self.has('LEFTDASH', player, 2) and self.has('RIGHTDASH', player, 2)) # Both Shade Cloaks
|
||||
or (self._hk_option(player, 'ProficientCombat') and self.has('QUAKE', player)) # or Dive
|
||||
)
|
||||
)
|
||||
return self.multiworld.worlds[player].options.StartLocation == start_location
|
||||
|
||||
@@ -116,12 +116,19 @@ class KH2Context(CommonContext):
|
||||
# self.inBattle = 0x2A0EAC4 + 0x40
|
||||
# self.onDeath = 0xAB9078
|
||||
# PC Address anchors
|
||||
self.Now = 0x0714DB8
|
||||
self.Save = 0x09A70B0
|
||||
# self.Now = 0x0714DB8 old address
|
||||
# epic addresses
|
||||
self.Now = 0x0716DF8
|
||||
self.Save = 0x09A92F0
|
||||
self.Journal = 0x743260
|
||||
self.Shop = 0x743350
|
||||
self.Slot1 = 0x2A22FD8
|
||||
# self.Sys3 = 0x2A59DF0
|
||||
# self.Bt10 = 0x2A74880
|
||||
# self.BtlEnd = 0x2A0D3E0
|
||||
self.Slot1 = 0x2A20C98
|
||||
# self.Slot1 = 0x2A20C98 old address
|
||||
|
||||
self.kh2_game_version = None # can be egs or steam
|
||||
|
||||
self.chest_set = set(exclusion_table["Chests"])
|
||||
self.keyblade_set = set(CheckDupingItems["Weapons"]["Keyblades"])
|
||||
@@ -228,6 +235,9 @@ class KH2Context(CommonContext):
|
||||
def kh2_write_int(self, address, value):
|
||||
self.kh2.write_int(self.kh2.base_address + address, value)
|
||||
|
||||
def kh2_read_string(self, address, length):
|
||||
return self.kh2.read_string(self.kh2.base_address + address, length)
|
||||
|
||||
def on_package(self, cmd: str, args: dict):
|
||||
if cmd in {"RoomInfo"}:
|
||||
self.kh2seedname = args['seed_name']
|
||||
@@ -367,10 +377,26 @@ class KH2Context(CommonContext):
|
||||
for weapon_location in all_weapon_slot:
|
||||
all_weapon_location_id.append(self.kh2_loc_name_to_id[weapon_location])
|
||||
self.all_weapon_location_id = set(all_weapon_location_id)
|
||||
|
||||
try:
|
||||
self.kh2 = pymem.Pymem(process_name="KINGDOM HEARTS II FINAL MIX")
|
||||
logger.info("You are now auto-tracking")
|
||||
self.kh2connected = True
|
||||
if self.kh2_game_version is None:
|
||||
if self.kh2_read_string(0x09A9830, 4) == "KH2J":
|
||||
self.kh2_game_version = "STEAM"
|
||||
self.Now = 0x0717008
|
||||
self.Save = 0x09A9830
|
||||
self.Slot1 = 0x2A23518
|
||||
self.Journal = 0x7434E0
|
||||
self.Shop = 0x7435D0
|
||||
|
||||
elif self.kh2_read_string(0x09A92F0, 4) == "KH2J":
|
||||
self.kh2_game_version = "EGS"
|
||||
else:
|
||||
self.kh2_game_version = None
|
||||
logger.info("Your game version is out of date. Please update your game via The Epic Games Store or Steam.")
|
||||
if self.kh2_game_version is not None:
|
||||
logger.info(f"You are now auto-tracking. {self.kh2_game_version}")
|
||||
self.kh2connected = True
|
||||
|
||||
except Exception as e:
|
||||
if self.kh2connected:
|
||||
@@ -589,8 +615,8 @@ class KH2Context(CommonContext):
|
||||
# if journal=-1 and shop = 5 then in shop
|
||||
# if journal !=-1 and shop = 10 then journal
|
||||
|
||||
journal = self.kh2_read_short(0x741230)
|
||||
shop = self.kh2_read_short(0x741320)
|
||||
journal = self.kh2_read_short(self.Journal)
|
||||
shop = self.kh2_read_short(self.Shop)
|
||||
if (journal == -1 and shop == 5) or (journal != -1 and shop == 10):
|
||||
# print("your in the shop")
|
||||
sellable_dict = {}
|
||||
@@ -599,8 +625,8 @@ class KH2Context(CommonContext):
|
||||
amount = self.kh2_read_byte(self.Save + itemdata.memaddr)
|
||||
sellable_dict[itemName] = amount
|
||||
while (journal == -1 and shop == 5) or (journal != -1 and shop == 10):
|
||||
journal = self.kh2_read_short(0x741230)
|
||||
shop = self.kh2_read_short(0x741320)
|
||||
journal = self.kh2_read_short(self.Journal)
|
||||
shop = self.kh2_read_short(self.Shop)
|
||||
await asyncio.sleep(0.5)
|
||||
for item, amount in sellable_dict.items():
|
||||
itemdata = self.item_name_to_data[item]
|
||||
@@ -750,7 +776,7 @@ class KH2Context(CommonContext):
|
||||
item_data = self.item_name_to_data[item_name]
|
||||
amount_of_items = 0
|
||||
amount_of_items += self.kh2_seed_save_cache["AmountInvo"]["Magic"][item_name]
|
||||
if self.kh2_read_byte(self.Save + item_data.memaddr) != amount_of_items and self.kh2_read_byte(0x741320) in {10, 8}:
|
||||
if self.kh2_read_byte(self.Save + item_data.memaddr) != amount_of_items and self.kh2_read_byte(self.Shop) in {10, 8}:
|
||||
self.kh2_write_byte(self.Save + item_data.memaddr, amount_of_items)
|
||||
|
||||
for item_name in master_stat:
|
||||
@@ -802,7 +828,7 @@ class KH2Context(CommonContext):
|
||||
self.kh2_write_byte(self.Save + 0x2502, current_item_slots + 1)
|
||||
elif self.base_item_slots + amount_of_items < 8:
|
||||
self.kh2_write_byte(self.Save + 0x2502, self.base_item_slots + amount_of_items)
|
||||
|
||||
|
||||
# if self.kh2_read_byte(self.Save + item_data.memaddr) != amount_of_items \
|
||||
# and self.kh2_read_byte(self.Slot1 + 0x1B2) >= 5 and \
|
||||
# self.kh2_read_byte(self.Save + 0x23DF) & 0x1 << 3 > 0 and self.kh2_read_byte(0x741320) in {10, 8}:
|
||||
@@ -905,8 +931,23 @@ async def kh2_watcher(ctx: KH2Context):
|
||||
await asyncio.sleep(15)
|
||||
ctx.kh2 = pymem.Pymem(process_name="KINGDOM HEARTS II FINAL MIX")
|
||||
if ctx.kh2 is not None:
|
||||
logger.info("You are now auto-tracking")
|
||||
ctx.kh2connected = True
|
||||
if ctx.kh2_game_version is None:
|
||||
if ctx.kh2_read_string(0x09A9830, 4) == "KH2J":
|
||||
ctx.kh2_game_version = "STEAM"
|
||||
ctx.Now = 0x0717008
|
||||
ctx.Save = 0x09A9830
|
||||
ctx.Slot1 = 0x2A23518
|
||||
ctx.Journal = 0x7434E0
|
||||
ctx.Shop = 0x7435D0
|
||||
|
||||
elif ctx.kh2_read_string(0x09A92F0, 4) == "KH2J":
|
||||
ctx.kh2_game_version = "EGS"
|
||||
else:
|
||||
ctx.kh2_game_version = None
|
||||
logger.info("Your game version is out of date. Please update your game via The Epic Games Store or Steam.")
|
||||
if ctx.kh2_game_version is not None:
|
||||
logger.info(f"You are now auto-tracking {ctx.kh2_game_version}")
|
||||
ctx.kh2connected = True
|
||||
except Exception as e:
|
||||
if ctx.kh2connected:
|
||||
ctx.kh2connected = False
|
||||
|
||||
@@ -1,22 +1,25 @@
|
||||
# Kingdom Hearts 2 Archipelago Setup Guide
|
||||
|
||||
<h2 style="text-transform:none";>Quick Links</h2>
|
||||
|
||||
- [Game Info Page](../../../../games/Kingdom%20Hearts%202/info/en)
|
||||
- [Player Options Page](../../../../games/Kingdom%20Hearts%202/player-options)
|
||||
|
||||
<h2 style="text-transform:none";>Required Software:</h2>
|
||||
`Kingdom Hearts II Final Mix` from the [Epic Games Store](https://store.epicgames.com/en-US/discover/kingdom-hearts)
|
||||
- Follow this Guide to set up these requirements [KH2Rando.com](https://tommadness.github.io/KH2Randomizer/setup/Panacea-ModLoader/)<br>
|
||||
1. `3.2.0 OpenKH Mod Manager with Panacea`<br>
|
||||
2. `Lua Backend from the OpenKH Mod Manager`
|
||||
3. `Install the mod KH2FM-Mods-Num/GoA-ROM-Edition using OpenKH Mod Manager`<br>
|
||||
|
||||
`Kingdom Hearts II Final Mix` from the [Epic Games Store](https://store.epicgames.com/en-US/discover/kingdom-hearts) or [Steam](https://store.steampowered.com/app/2552430/KINGDOM_HEARTS_HD_1525_ReMIX/)
|
||||
|
||||
- Follow this Guide to set up these requirements [KH2Rando.com](https://tommadness.github.io/KH2Randomizer/setup/Panacea-ModLoader/)
|
||||
1. `Version 3.3.0 or greater OpenKH Mod Manager with Panacea`
|
||||
2. `Lua Backend from the OpenKH Mod Manager`
|
||||
3. `Install the mod KH2FM-Mods-Num/GoA-ROM-Edition using OpenKH Mod Manager`
|
||||
- Needed for Archipelago
|
||||
1. [`ArchipelagoKH2Client.exe`](https://github.com/ArchipelagoMW/Archipelago/releases)<br>
|
||||
2. `Install the Archipelago Companion mod from JaredWeakStrike/APCompanion using OpenKH Mod Manager`<br>
|
||||
3. `Install the Archipelago Quality Of Life mod from JaredWeakStrike/AP_QOL using OpenKH Mod Manager` <br>
|
||||
4. `Install the mod from KH2FM-Mods-equations19/auto-save using OpenKH Mod Manager`<br>
|
||||
1. [`ArchipelagoKH2Client.exe`](https://github.com/ArchipelagoMW/Archipelago/releases)
|
||||
2. `Install the Archipelago Companion mod from JaredWeakStrike/APCompanion using OpenKH Mod Manager`
|
||||
3. `Install the Archipelago Quality Of Life mod from JaredWeakStrike/AP_QOL using OpenKH Mod Manager`
|
||||
4. `Install the mod from KH2FM-Mods-equations19/auto-save using OpenKH Mod Manager`
|
||||
5. `AP Randomizer Seed`
|
||||
|
||||
<h3 style="text-transform:none";>Required: Archipelago Companion Mod</h3>
|
||||
|
||||
Load this mod just like the <b>GoA ROM</b> you did during the KH2 Rando setup. `JaredWeakStrike/APCompanion`<br>
|
||||
@@ -24,6 +27,7 @@ Have this mod second-highest priority below the .zip seed.<br>
|
||||
This mod is based upon Num's Garden of Assemblege Mod and requires it to work. Without Num this could not be possible.
|
||||
|
||||
<h3 style="text-transform:none";>Required: Auto Save Mod</h3>
|
||||
|
||||
Load this mod just like the GoA ROM you did during the KH2 Rando setup. `KH2FM-Mods-equations19/auto-save` Location doesn't matter, required in case of crashes. See [Best Practices](en#best-practices) on how to load the auto save
|
||||
|
||||
<h3 style="text-transform:none";>Installing A Seed</h3>
|
||||
@@ -33,33 +37,33 @@ Make sure the seed is on the top of the list (Highest Priority)<br>
|
||||
After Installing the seed click `Mod Loader -> Build/Build and Run`. Every slot is a unique mod to install and will be needed be repatched for different slots/rooms.
|
||||
|
||||
<h2 style="text-transform:none";>What the Mod Manager Should Look Like.</h2>
|
||||
|
||||

|
||||
|
||||
<h2 style="text-transform:none";>Using the KH2 Client</h2>
|
||||
|
||||
Once you have started the game through OpenKH Mod Manager and are on the title screen run the [ArchipelagoKH2Client.exe](https://github.com/ArchipelagoMW/Archipelago/releases). <br>
|
||||
Once you have started the game through OpenKH Mod Manager and are on the title screen run the [ArchipelagoKH2Client.exe](https://github.com/ArchipelagoMW/Archipelago/releases).<br>
|
||||
When you successfully connect to the server the client will automatically hook into the game to send/receive checks. <br>
|
||||
If the client ever loses connection to the game, it will also disconnect from the server and you will need to reconnect.<br>
|
||||
`Make sure the game is open whenever you try to connect the client to the server otherwise it will immediately disconnect you.`<br>
|
||||
Most checks will be sent to you anywhere outside a load or cutscene.<br>
|
||||
`If you obtain magic, you will need to pause your game to have it show up in your inventory, then enter a new room for it to become properly usable.`
|
||||
<br>
|
||||
|
||||
<h2 style="text-transform:none";>KH2 Client should look like this: </h2>
|
||||
|
||||

|
||||
<br>
|
||||
|
||||
Enter `The room's port number` into the top box <b> where the x's are</b> and press "Connect". Follow the prompts there and you should be connected
|
||||
|
||||
|
||||
<h2 style="text-transform:none";>Common Pitfalls</h2>
|
||||
- Having an old GOA Lua Script in your `C:\Users\*YourName*\Documents\KINGDOM HEARTS HD 1.5+2.5 ReMIX\scripts\kh2` folder.
|
||||
- Pressing F2 while in game should look like this. 
|
||||
<br>
|
||||
- Not having Lua Backend Configured Correctly.
|
||||
- To fix this look over the guide at [KH2Rando.com](https://tommadness.github.io/KH2Randomizer/setup/Panacea-ModLoader/). Specifically the Lua Backend Configuration Step.
|
||||
<br>
|
||||
- Loading into Simulated Twilight Town Instead of the GOA.
|
||||
- To fix this look over the guide at [KH2Rando.com](https://tommadness.github.io/KH2Randomizer/setup/Panacea-ModLoader/). Specifically the Panacea and Lua Backend Steps.
|
||||
|
||||
- Having an old GOA Lua Script in your `C:\Users\*YourName*\Documents\KINGDOM HEARTS HD 1.5+2.5 ReMIX\scripts\kh2` folder.
|
||||
- Pressing F2 while in game should look like this. 
|
||||
- Not having Lua Backend Configured Correctly.
|
||||
- To fix this look over the guide at [KH2Rando.com](https://tommadness.github.io/KH2Randomizer/setup/Panacea-ModLoader/). Specifically the Lua Backend Configuration Step.
|
||||
|
||||
- Loading into Simulated Twilight Town Instead of the GOA.
|
||||
- To fix this look over the guide at [KH2Rando.com](https://tommadness.github.io/KH2Randomizer/setup/Panacea-ModLoader/). Specifically the Panacea and Lua Backend Steps.
|
||||
|
||||
<h2 style="text-transform:none"; >Best Practices</h2>
|
||||
|
||||
@@ -70,8 +74,11 @@ Enter `The room's port number` into the top box <b> where the x's are</b> and pr
|
||||
- Make sure to save in a different save slot when playing in an async or disconnecting from the server to play a different seed
|
||||
|
||||
<h2 style="text-transform:none";>Logic Sheet</h2>
|
||||
|
||||
Have any questions on what's in logic? This spreadsheet made by Bulcon has the answer [Requirements/logic sheet](https://docs.google.com/spreadsheets/d/1nNi8ohEs1fv-sDQQRaP45o6NoRcMlLJsGckBonweDMY/edit?usp=sharing)
|
||||
|
||||
<h2 style="text-transform:none";>F.A.Q.</h2>
|
||||
|
||||
- Why is my Client giving me a "Cannot Open Process: " error?
|
||||
- Due to how the client reads kingdom hearts 2 memory some people's computer flags it as a virus. Run the client as admin.
|
||||
- Why is my HP/MP continuously increasing without stopping?
|
||||
@@ -83,11 +90,13 @@ Have any questions on what's in logic? This spreadsheet made by Bulcon has the a
|
||||
- Why did I not load into the correct visit?
|
||||
- You need to trigger a cutscene or visit The World That Never Was for it to register that you have received the item.
|
||||
- What versions of Kingdom Hearts 2 are supported?
|
||||
- Currently `only` the most up to date version on the Epic Game Store is supported: version `1.0.0.8_WW`.
|
||||
- Currently the `only` supported versions are `Epic Games Version 1.0.0.9_WW` and `Steam Build Version 14716933`.
|
||||
- Why am I getting wallpapered while going into a world for the first time?
|
||||
- Your `Lua Backend` was not configured correctly. Look over the step in the [KH2Rando.com](https://tommadness.github.io/KH2Randomizer/setup/Panacea-ModLoader/) guide.
|
||||
- Your `Lua Backend` was not configured correctly. Look over the step in the [KH2Rando.com](https://tommadness.github.io/KH2Randomizer/setup/Panacea-ModLoader/) guide.
|
||||
- Why am I not getting magic?
|
||||
- If you obtain magic, you will need to pause your game to have it show up in your inventory, then enter a new room for it to become properly usable.
|
||||
- Why did I crash after picking my dream weapon?
|
||||
- This is normally caused by having an outdated GOA mod or having an outdated panacea and/or luabackend. To fix this rerun the setup wizard and reinstall luabackend and panacea. Also make sure all your mods are up-to-date.
|
||||
- Why did I crash?
|
||||
- The port of Kingdom Hearts 2 can and will randomly crash, this is the fault of the game not the randomizer or the archipelago client.
|
||||
- If you have a continuous/constant crash (in the same area/event every time) you will want to reverify your installed files. This can be done by doing the following: Open Epic Game Store --> Library --> Click Triple Dots --> Manage --> Verify
|
||||
@@ -99,5 +108,3 @@ Have any questions on what's in logic? This spreadsheet made by Bulcon has the a
|
||||
- Because Kingdom Hearts 2 is prone to crashes and will keep you from losing your progress.
|
||||
- How do I load an auto save?
|
||||
- To load an auto-save, hold down the Select or your equivalent on your prefered controller while choosing a file. Make sure to hold the button down the whole time.
|
||||
|
||||
|
||||
|
||||
@@ -98,9 +98,12 @@ class LinksAwakeningWorld(World):
|
||||
|
||||
# Items can be grouped using their names to allow easy checking if any item
|
||||
# from that group has been collected. Group names can also be used for !hint
|
||||
#item_name_groups = {
|
||||
# "weapons": {"sword", "lance"}
|
||||
#}
|
||||
item_name_groups = {
|
||||
"Instruments": {
|
||||
"Full Moon Cello", "Conch Horn", "Sea Lily's Bell", "Surf Harp",
|
||||
"Wind Marimba", "Coral Triangle", "Organ of Evening Calm", "Thunder Drum"
|
||||
},
|
||||
}
|
||||
|
||||
prefill_dungeon_items = None
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@ Archipelago init file for Lingo
|
||||
"""
|
||||
from logging import warning
|
||||
|
||||
from BaseClasses import Item, ItemClassification, Tutorial
|
||||
from BaseClasses import CollectionState, Item, ItemClassification, Tutorial
|
||||
from Options import OptionError
|
||||
from worlds.AutoWorld import WebWorld, World
|
||||
from .datatypes import Room, RoomEntrance
|
||||
from .items import ALL_ITEM_TABLE, ITEMS_BY_GROUP, TRAP_ITEMS, LingoItem
|
||||
from .locations import ALL_LOCATION_TABLE, LOCATIONS_BY_GROUP
|
||||
from .options import LingoOptions, lingo_option_groups
|
||||
from .options import LingoOptions, lingo_option_groups, SunwarpAccess, VictoryCondition
|
||||
from .player_logic import LingoPlayerLogic
|
||||
from .regions import create_regions
|
||||
|
||||
@@ -54,20 +54,54 @@ class LingoWorld(World):
|
||||
player_logic: LingoPlayerLogic
|
||||
|
||||
def generate_early(self):
|
||||
if not (self.options.shuffle_doors or self.options.shuffle_colors or self.options.shuffle_sunwarps):
|
||||
if not (self.options.shuffle_doors or self.options.shuffle_colors or
|
||||
(self.options.sunwarp_access >= SunwarpAccess.option_unlock and
|
||||
self.options.victory_condition == VictoryCondition.option_pilgrimage)):
|
||||
if self.multiworld.players == 1:
|
||||
warning(f"{self.multiworld.get_player_name(self.player)}'s Lingo world doesn't have any progression"
|
||||
f" items. Please turn on Door Shuffle, Color Shuffle, or Sunwarp Shuffle if that doesn't seem"
|
||||
f" right.")
|
||||
warning(f"{self.player_name}'s Lingo world doesn't have any progression items. Please turn on Door"
|
||||
f" Shuffle or Color Shuffle, or use item-blocked sunwarps with the Pilgrimage victory condition"
|
||||
f" if that doesn't seem right.")
|
||||
else:
|
||||
raise OptionError(f"{self.multiworld.get_player_name(self.player)}'s Lingo world doesn't have any"
|
||||
f" progression items. Please turn on Door Shuffle, Color Shuffle or Sunwarp Shuffle.")
|
||||
raise OptionError(f"{self.player_name}'s Lingo world doesn't have any progression items. Please turn on"
|
||||
f" Door Shuffle or Color Shuffle, or use item-blocked sunwarps with the Pilgrimage"
|
||||
f" victory condition.")
|
||||
|
||||
self.player_logic = LingoPlayerLogic(self)
|
||||
|
||||
def create_regions(self):
|
||||
create_regions(self)
|
||||
|
||||
if not self.options.shuffle_postgame:
|
||||
state = CollectionState(self.multiworld)
|
||||
state.collect(LingoItem("Prevent Victory", ItemClassification.progression, None, self.player), True)
|
||||
|
||||
# Note: relies on the assumption that real_items is a definitive list of real progression items in this
|
||||
# world, and is not modified after being created.
|
||||
for item in self.player_logic.real_items:
|
||||
state.collect(self.create_item(item), True)
|
||||
|
||||
# Exception to the above: a forced good item is not considered a "real item", but needs to be here anyway.
|
||||
if self.player_logic.forced_good_item != "":
|
||||
state.collect(self.create_item(self.player_logic.forced_good_item), True)
|
||||
|
||||
all_locations = self.multiworld.get_locations(self.player)
|
||||
state.sweep_for_events(locations=all_locations)
|
||||
|
||||
unreachable_locations = [location for location in all_locations
|
||||
if not state.can_reach_location(location.name, self.player)]
|
||||
|
||||
for location in unreachable_locations:
|
||||
if location.name in self.player_logic.event_loc_to_item.keys():
|
||||
continue
|
||||
|
||||
self.player_logic.real_locations.remove(location.name)
|
||||
location.parent_region.locations.remove(location)
|
||||
|
||||
if len(self.player_logic.real_items) > len(self.player_logic.real_locations):
|
||||
raise OptionError(f"{self.player_name}'s Lingo world does not have enough locations to fit the number"
|
||||
f" of required items without shuffling the postgame. Either enable postgame"
|
||||
f" shuffling, or choose different options.")
|
||||
|
||||
def create_items(self):
|
||||
pool = [self.create_item(name) for name in self.player_logic.real_items]
|
||||
|
||||
@@ -136,7 +170,8 @@ class LingoWorld(World):
|
||||
slot_options = [
|
||||
"death_link", "victory_condition", "shuffle_colors", "shuffle_doors", "shuffle_paintings", "shuffle_panels",
|
||||
"enable_pilgrimage", "sunwarp_access", "mastery_achievements", "level_2_requirement", "location_checks",
|
||||
"early_color_hallways", "pilgrimage_allows_roof_access", "pilgrimage_allows_paintings", "shuffle_sunwarps"
|
||||
"early_color_hallways", "pilgrimage_allows_roof_access", "pilgrimage_allows_paintings", "shuffle_sunwarps",
|
||||
"group_doors"
|
||||
]
|
||||
|
||||
slot_data = {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -272,8 +272,9 @@ panels:
|
||||
PAINTING (4): 445081
|
||||
PAINTING (5): 445082
|
||||
ROOM: 445083
|
||||
Orange Tower Seventh Floor:
|
||||
Ending Area:
|
||||
THE END: 444620
|
||||
Orange Tower Seventh Floor:
|
||||
THE MASTER: 444621
|
||||
MASTERY: 444622
|
||||
Behind A Smile:
|
||||
@@ -1477,3 +1478,145 @@ progression:
|
||||
Progressive Art Gallery: 444563
|
||||
Progressive Colorful: 444580
|
||||
Progressive Pilgrimage: 444583
|
||||
Progressive Suits Area: 444602
|
||||
Progressive Symmetry Room: 444608
|
||||
Progressive Number Hunt: 444654
|
||||
panel_doors:
|
||||
Starting Room:
|
||||
HIDDEN: 444589
|
||||
Hidden Room:
|
||||
OPEN: 444590
|
||||
Hub Room:
|
||||
ORDER: 444591
|
||||
SLAUGHTER: 444592
|
||||
TRACE: 444594
|
||||
RAT: 444595
|
||||
OPEN: 444596
|
||||
Crossroads:
|
||||
DECAY: 444597
|
||||
NOPE: 444598
|
||||
WE ROT: 444599
|
||||
WORDS SWORD: 444600
|
||||
BEND HI: 444601
|
||||
Lost Area:
|
||||
LOST: 444603
|
||||
Amen Name Area:
|
||||
AMEN NAME: 444604
|
||||
The Tenacious:
|
||||
Black Palindromes: 444605
|
||||
Near Far Area:
|
||||
NEAR FAR: 444606
|
||||
Warts Straw Area:
|
||||
WARTS STRAW: 444609
|
||||
Leaf Feel Area:
|
||||
LEAF FEEL: 444610
|
||||
Outside The Agreeable:
|
||||
MASSACRED: 444611
|
||||
BLACK: 444612
|
||||
CLOSE: 444613
|
||||
RIGHT: 444614
|
||||
Compass Room:
|
||||
Lookout: 444615
|
||||
Hedge Maze:
|
||||
DOWN: 444617
|
||||
The Perceptive:
|
||||
GAZE: 444618
|
||||
The Observant:
|
||||
BACKSIDE: 444619
|
||||
STAIRS: 444621
|
||||
The Incomparable:
|
||||
Giant Sevens: 444622
|
||||
Orange Tower:
|
||||
Access: 444623
|
||||
Orange Tower First Floor:
|
||||
SECRET: 444624
|
||||
Orange Tower Fourth Floor:
|
||||
HOT CRUSTS: 444625
|
||||
Orange Tower Fifth Floor:
|
||||
SIZE: 444626
|
||||
First Second Third Fourth:
|
||||
FIRST SECOND THIRD FOURTH: 444627
|
||||
The Colorful (White):
|
||||
BEGIN: 444628
|
||||
The Colorful (Black):
|
||||
FOUND: 444630
|
||||
The Colorful (Red):
|
||||
LOAF: 444631
|
||||
The Colorful (Yellow):
|
||||
CREAM: 444632
|
||||
The Colorful (Blue):
|
||||
SUN: 444633
|
||||
The Colorful (Purple):
|
||||
SPOON: 444634
|
||||
The Colorful (Orange):
|
||||
LETTERS: 444635
|
||||
The Colorful (Green):
|
||||
WALLS: 444636
|
||||
The Colorful (Brown):
|
||||
IRON: 444637
|
||||
The Colorful (Gray):
|
||||
OBSTACLE: 444638
|
||||
Owl Hallway:
|
||||
STRAYS: 444639
|
||||
Outside The Initiated:
|
||||
UNCOVER: 444640
|
||||
OXEN: 444641
|
||||
Outside The Bold:
|
||||
UNOPEN: 444642
|
||||
BEGIN: 444643
|
||||
Outside The Undeterred:
|
||||
ZERO: 444644
|
||||
PEN: 444645
|
||||
TWO: 444646
|
||||
THREE: 444647
|
||||
FOUR: 444648
|
||||
Number Hunt:
|
||||
FIVE: 444649
|
||||
SIX: 444650
|
||||
SEVEN: 444651
|
||||
EIGHT: 444652
|
||||
NINE: 444653
|
||||
Color Hunt:
|
||||
EXIT: 444655
|
||||
RED: 444656
|
||||
BLUE: 444658
|
||||
YELLOW: 444659
|
||||
ORANGE: 444660
|
||||
PURPLE: 444661
|
||||
GREEN: 444662
|
||||
The Bearer:
|
||||
FARTHER: 444663
|
||||
MIDDLE: 444664
|
||||
Knight Night (Final):
|
||||
TRUSTED: 444665
|
||||
Outside The Wondrous:
|
||||
SHRINK: 444666
|
||||
Hallway Room (1):
|
||||
CASTLE: 444667
|
||||
Hallway Room (2):
|
||||
COUNTERCLOCKWISE: 444669
|
||||
Hallway Room (3):
|
||||
TRANSFORMATION: 444670
|
||||
Hallway Room (4):
|
||||
WHEELBARROW: 444671
|
||||
Outside The Wanderer:
|
||||
WANDERLUST: 444672
|
||||
Art Gallery:
|
||||
ORDER: 444673
|
||||
Room Room:
|
||||
STAIRS: 444674
|
||||
Colors: 444676
|
||||
Outside The Wise:
|
||||
KITTEN CAT: 444677
|
||||
Outside The Scientific:
|
||||
OPEN: 444678
|
||||
Directional Gallery:
|
||||
TURN LEARN: 444679
|
||||
panel_groups:
|
||||
Tenacious Entrance Panels: 444593
|
||||
Symmetry Room Panels: 444607
|
||||
Backside Entrance Panels: 444620
|
||||
Colorful Panels: 444629
|
||||
Color Hunt Panels: 444657
|
||||
Hallway Room Panels: 444668
|
||||
Room Room Panels: 444675
|
||||
|
||||
@@ -12,6 +12,11 @@ class RoomAndPanel(NamedTuple):
|
||||
panel: str
|
||||
|
||||
|
||||
class RoomAndPanelDoor(NamedTuple):
|
||||
room: Optional[str]
|
||||
panel_door: str
|
||||
|
||||
|
||||
class EntranceType(Flag):
|
||||
NORMAL = auto()
|
||||
PAINTING = auto()
|
||||
@@ -63,9 +68,15 @@ class Panel(NamedTuple):
|
||||
exclude_reduce: bool
|
||||
achievement: bool
|
||||
non_counting: bool
|
||||
panel_door: Optional[RoomAndPanelDoor] # This will always be fully specified.
|
||||
location_name: Optional[str]
|
||||
|
||||
|
||||
class PanelDoor(NamedTuple):
|
||||
item_name: str
|
||||
panel_group: Optional[str]
|
||||
|
||||
|
||||
class Painting(NamedTuple):
|
||||
id: str
|
||||
room: str
|
||||
|
||||
@@ -3,7 +3,7 @@ from typing import Dict, List, NamedTuple, Set
|
||||
|
||||
from BaseClasses import Item, ItemClassification
|
||||
from .static_logic import DOORS_BY_ROOM, PROGRESSIVE_ITEMS, get_door_group_item_id, get_door_item_id, \
|
||||
get_progressive_item_id, get_special_item_id
|
||||
get_progressive_item_id, get_special_item_id, PANEL_DOORS_BY_ROOM, get_panel_door_item_id, get_panel_group_item_id
|
||||
|
||||
|
||||
class ItemType(Enum):
|
||||
@@ -65,6 +65,21 @@ def load_item_data():
|
||||
ItemClassification.progression, ItemType.NORMAL, True, [])
|
||||
ITEMS_BY_GROUP.setdefault("Doors", []).append(group)
|
||||
|
||||
panel_groups: Set[str] = set()
|
||||
for room_name, panel_doors in PANEL_DOORS_BY_ROOM.items():
|
||||
for panel_door_name, panel_door in panel_doors.items():
|
||||
if panel_door.panel_group is not None:
|
||||
panel_groups.add(panel_door.panel_group)
|
||||
|
||||
ALL_ITEM_TABLE[panel_door.item_name] = ItemData(get_panel_door_item_id(room_name, panel_door_name),
|
||||
ItemClassification.progression, ItemType.NORMAL, False, [])
|
||||
ITEMS_BY_GROUP.setdefault("Panels", []).append(panel_door.item_name)
|
||||
|
||||
for group in panel_groups:
|
||||
ALL_ITEM_TABLE[group] = ItemData(get_panel_group_item_id(group), ItemClassification.progression,
|
||||
ItemType.NORMAL, False, [])
|
||||
ITEMS_BY_GROUP.setdefault("Panels", []).append(group)
|
||||
|
||||
special_items: Dict[str, ItemClassification] = {
|
||||
":)": ItemClassification.filler,
|
||||
"The Feeling of Being Lost": ItemClassification.filler,
|
||||
|
||||
@@ -8,21 +8,31 @@ from .items import TRAP_ITEMS
|
||||
|
||||
|
||||
class ShuffleDoors(Choice):
|
||||
"""If on, opening doors will require their respective "keys".
|
||||
"""This option specifies how doors open.
|
||||
|
||||
- **Simple:** Doors are sorted into logical groups, which are all opened by
|
||||
receiving an item.
|
||||
- **Complex:** The items are much more granular, and will usually only open
|
||||
a single door each.
|
||||
- **None:** Doors in the game will open the way they do in vanilla.
|
||||
- **Panels:** Doors still open as in vanilla, but the panels that open the
|
||||
doors will be locked, and an item will be required to unlock the panels.
|
||||
- **Doors:** the doors themselves are locked behind items, and will open
|
||||
automatically without needing to solve a panel once the key is obtained.
|
||||
"""
|
||||
display_name = "Shuffle Doors"
|
||||
option_none = 0
|
||||
option_simple = 1
|
||||
option_complex = 2
|
||||
option_panels = 1
|
||||
option_doors = 2
|
||||
alias_simple = 2
|
||||
alias_complex = 2
|
||||
|
||||
|
||||
class GroupDoors(Toggle):
|
||||
"""By default, door shuffle in either panels or doors mode will create individual keys for every panel or door to be locked.
|
||||
|
||||
When group doors is on, some panels and doors are sorted into logical groups, which are opened together by receiving an item."""
|
||||
display_name = "Group Doors"
|
||||
|
||||
|
||||
class ProgressiveOrangeTower(DefaultOnToggle):
|
||||
"""When "Shuffle Doors" is on, this setting governs the manner in which the Orange Tower floors open up.
|
||||
"""When "Shuffle Doors" is on doors mode, this setting governs the manner in which the Orange Tower floors open up.
|
||||
|
||||
- **Off:** There is an item for each floor of the tower, and each floor's
|
||||
item is the only one needed to access that floor.
|
||||
@@ -33,7 +43,7 @@ class ProgressiveOrangeTower(DefaultOnToggle):
|
||||
|
||||
|
||||
class ProgressiveColorful(DefaultOnToggle):
|
||||
"""When "Shuffle Doors" is on "complex", this setting governs the manner in which The Colorful opens up.
|
||||
"""When "Shuffle Doors" is on either panels or doors mode and "Group Doors" is off, this setting governs the manner in which The Colorful opens up.
|
||||
|
||||
- **Off:** There is an item for each room of The Colorful, meaning that
|
||||
random rooms in the middle of the sequence can open up without giving you
|
||||
@@ -194,6 +204,11 @@ class EarlyColorHallways(Toggle):
|
||||
display_name = "Early Color Hallways"
|
||||
|
||||
|
||||
class ShufflePostgame(Toggle):
|
||||
"""When off, locations that could not be reached without also reaching your victory condition are removed."""
|
||||
display_name = "Shuffle Postgame"
|
||||
|
||||
|
||||
class TrapPercentage(Range):
|
||||
"""Replaces junk items with traps, at the specified rate."""
|
||||
display_name = "Trap Percentage"
|
||||
@@ -248,6 +263,7 @@ lingo_option_groups = [
|
||||
@dataclass
|
||||
class LingoOptions(PerGameCommonOptions):
|
||||
shuffle_doors: ShuffleDoors
|
||||
group_doors: GroupDoors
|
||||
progressive_orange_tower: ProgressiveOrangeTower
|
||||
progressive_colorful: ProgressiveColorful
|
||||
location_checks: LocationChecks
|
||||
@@ -263,6 +279,7 @@ class LingoOptions(PerGameCommonOptions):
|
||||
mastery_achievements: MasteryAchievements
|
||||
level_2_requirement: Level2Requirement
|
||||
early_color_hallways: EarlyColorHallways
|
||||
shuffle_postgame: ShufflePostgame
|
||||
trap_percentage: TrapPercentage
|
||||
trap_weights: TrapWeights
|
||||
puzzle_skip_percentage: PuzzleSkipPercentage
|
||||
|
||||
@@ -7,8 +7,8 @@ from .items import ALL_ITEM_TABLE, ItemType
|
||||
from .locations import ALL_LOCATION_TABLE, LocationClassification
|
||||
from .options import LocationChecks, ShuffleDoors, SunwarpAccess, VictoryCondition
|
||||
from .static_logic import DOORS_BY_ROOM, PAINTINGS, PAINTING_ENTRANCES, PAINTING_EXITS, \
|
||||
PANELS_BY_ROOM, PROGRESSION_BY_ROOM, REQUIRED_PAINTING_ROOMS, REQUIRED_PAINTING_WHEN_NO_DOORS_ROOMS, \
|
||||
SUNWARP_ENTRANCES, SUNWARP_EXITS
|
||||
PANELS_BY_ROOM, REQUIRED_PAINTING_ROOMS, REQUIRED_PAINTING_WHEN_NO_DOORS_ROOMS, PROGRESSIVE_DOORS_BY_ROOM, \
|
||||
PANEL_DOORS_BY_ROOM, PROGRESSIVE_PANELS_BY_ROOM, SUNWARP_ENTRANCES, SUNWARP_EXITS
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from . import LingoWorld
|
||||
@@ -18,23 +18,35 @@ class AccessRequirements:
|
||||
rooms: Set[str]
|
||||
doors: Set[RoomAndDoor]
|
||||
colors: Set[str]
|
||||
items: Set[str]
|
||||
progression: Dict[str, int]
|
||||
the_master: bool
|
||||
postgame: bool
|
||||
|
||||
def __init__(self):
|
||||
self.rooms = set()
|
||||
self.doors = set()
|
||||
self.colors = set()
|
||||
self.items = set()
|
||||
self.progression = dict()
|
||||
self.the_master = False
|
||||
self.postgame = False
|
||||
|
||||
def merge(self, other: "AccessRequirements"):
|
||||
self.rooms |= other.rooms
|
||||
self.doors |= other.doors
|
||||
self.colors |= other.colors
|
||||
self.items |= other.items
|
||||
self.the_master |= other.the_master
|
||||
self.postgame |= other.postgame
|
||||
|
||||
for progression, index in other.progression.items():
|
||||
if progression not in self.progression or index > self.progression[progression]:
|
||||
self.progression[progression] = index
|
||||
|
||||
def __str__(self):
|
||||
return f"AccessRequirements(rooms={self.rooms}, doors={self.doors}, colors={self.colors})," \
|
||||
f" the_master={self.the_master}"
|
||||
return f"AccessRequirements(rooms={self.rooms}, doors={self.doors}, colors={self.colors}, items={self.items}," \
|
||||
f" progression={self.progression}), the_master={self.the_master}, postgame={self.postgame}"
|
||||
|
||||
|
||||
class PlayerLocation(NamedTuple):
|
||||
@@ -114,15 +126,15 @@ class LingoPlayerLogic:
|
||||
self.item_by_door.setdefault(room, {})[door] = item
|
||||
|
||||
def handle_non_grouped_door(self, room_name: str, door_data: Door, world: "LingoWorld"):
|
||||
if room_name in PROGRESSION_BY_ROOM and door_data.name in PROGRESSION_BY_ROOM[room_name]:
|
||||
progression_name = PROGRESSION_BY_ROOM[room_name][door_data.name].item_name
|
||||
if room_name in PROGRESSIVE_DOORS_BY_ROOM and door_data.name in PROGRESSIVE_DOORS_BY_ROOM[room_name]:
|
||||
progression_name = PROGRESSIVE_DOORS_BY_ROOM[room_name][door_data.name].item_name
|
||||
progression_handling = should_split_progression(progression_name, world)
|
||||
|
||||
if progression_handling == ProgressiveItemBehavior.SPLIT:
|
||||
self.set_door_item(room_name, door_data.name, door_data.item_name)
|
||||
self.real_items.append(door_data.item_name)
|
||||
elif progression_handling == ProgressiveItemBehavior.PROGRESSIVE:
|
||||
progressive_item_name = PROGRESSION_BY_ROOM[room_name][door_data.name].item_name
|
||||
progressive_item_name = PROGRESSIVE_DOORS_BY_ROOM[room_name][door_data.name].item_name
|
||||
self.set_door_item(room_name, door_data.name, progressive_item_name)
|
||||
self.real_items.append(progressive_item_name)
|
||||
else:
|
||||
@@ -153,17 +165,31 @@ class LingoPlayerLogic:
|
||||
victory_condition = world.options.victory_condition
|
||||
early_color_hallways = world.options.early_color_hallways
|
||||
|
||||
if location_checks == LocationChecks.option_reduced and door_shuffle != ShuffleDoors.option_none:
|
||||
raise OptionError("You cannot have reduced location checks when door shuffle is on, because there would not"
|
||||
" be enough locations for all of the door items.")
|
||||
if location_checks == LocationChecks.option_reduced:
|
||||
if door_shuffle == ShuffleDoors.option_doors:
|
||||
raise OptionError(f"Slot \"{world.player_name}\" cannot have reduced location checks when door shuffle"
|
||||
f" is on, because there would not be enough locations for all of the door items.")
|
||||
if door_shuffle == ShuffleDoors.option_panels:
|
||||
if not world.options.group_doors:
|
||||
raise OptionError(f"Slot \"{world.player_name}\" cannot have reduced location checks when ungrouped"
|
||||
f" panels mode door shuffle is on, because there would not be enough locations for"
|
||||
f" all of the panel items.")
|
||||
if color_shuffle:
|
||||
raise OptionError(f"Slot \"{world.player_name}\" cannot have reduced location checks with both"
|
||||
f" panels mode door shuffle and color shuffle because there would not be enough"
|
||||
f" locations for all of the items.")
|
||||
if world.options.sunwarp_access >= SunwarpAccess.option_individual:
|
||||
raise OptionError(f"Slot \"{world.player_name}\" cannot have reduced location checks with both"
|
||||
f" panels mode door shuffle and individual or progressive sunwarp access because"
|
||||
f" there would not be enough locations for all of the items.")
|
||||
|
||||
# Create door items, where needed.
|
||||
door_groups: Set[str] = set()
|
||||
for room_name, room_data in DOORS_BY_ROOM.items():
|
||||
for door_name, door_data in room_data.items():
|
||||
if door_data.skip_item is False and door_data.event is False:
|
||||
if door_data.type == DoorType.NORMAL and door_shuffle != ShuffleDoors.option_none:
|
||||
if door_data.door_group is not None and door_shuffle == ShuffleDoors.option_simple:
|
||||
if door_data.type == DoorType.NORMAL and door_shuffle == ShuffleDoors.option_doors:
|
||||
if door_data.door_group is not None and world.options.group_doors:
|
||||
# Grouped doors are handled differently if shuffle doors is on simple.
|
||||
self.set_door_item(room_name, door_name, door_data.door_group)
|
||||
door_groups.add(door_data.door_group)
|
||||
@@ -185,21 +211,33 @@ class LingoPlayerLogic:
|
||||
self.real_items.append(door_data.item_name)
|
||||
|
||||
self.real_items += door_groups
|
||||
|
||||
|
||||
# Create panel items, where needed.
|
||||
if world.options.shuffle_doors == ShuffleDoors.option_panels:
|
||||
panel_groups: Set[str] = set()
|
||||
|
||||
for room_name, room_data in PANEL_DOORS_BY_ROOM.items():
|
||||
for panel_door_name, panel_door_data in room_data.items():
|
||||
if panel_door_data.panel_group is not None and world.options.group_doors:
|
||||
panel_groups.add(panel_door_data.panel_group)
|
||||
elif room_name in PROGRESSIVE_PANELS_BY_ROOM \
|
||||
and panel_door_name in PROGRESSIVE_PANELS_BY_ROOM[room_name]:
|
||||
progression_obj = PROGRESSIVE_PANELS_BY_ROOM[room_name][panel_door_name]
|
||||
progression_handling = should_split_progression(progression_obj.item_name, world)
|
||||
|
||||
if progression_handling == ProgressiveItemBehavior.SPLIT:
|
||||
self.real_items.append(panel_door_data.item_name)
|
||||
elif progression_handling == ProgressiveItemBehavior.PROGRESSIVE:
|
||||
self.real_items.append(progression_obj.item_name)
|
||||
else:
|
||||
self.real_items.append(panel_door_data.item_name)
|
||||
|
||||
self.real_items += panel_groups
|
||||
|
||||
# Create color items, if needed.
|
||||
if color_shuffle:
|
||||
self.real_items += [name for name, item in ALL_ITEM_TABLE.items() if item.type == ItemType.COLOR]
|
||||
|
||||
# Create events for each achievement panel, so that we can determine when THE MASTER is accessible.
|
||||
for room_name, room_data in PANELS_BY_ROOM.items():
|
||||
for panel_name, panel_data in room_data.items():
|
||||
if panel_data.achievement:
|
||||
access_req = AccessRequirements()
|
||||
access_req.merge(self.calculate_panel_requirements(room_name, panel_name, world))
|
||||
access_req.rooms.add(room_name)
|
||||
|
||||
self.mastery_reqs.append(access_req)
|
||||
|
||||
# Handle the victory condition. Victory conditions other than the chosen one become regular checks, so we need
|
||||
# to prevent the actual victory condition from becoming a check.
|
||||
self.mastery_location = "Orange Tower Seventh Floor - THE MASTER"
|
||||
@@ -207,7 +245,7 @@ class LingoPlayerLogic:
|
||||
|
||||
if victory_condition == VictoryCondition.option_the_end:
|
||||
self.victory_condition = "Orange Tower Seventh Floor - THE END"
|
||||
self.add_location("Orange Tower Seventh Floor", "The End (Solved)", None, [], world)
|
||||
self.add_location("Ending Area", "The End (Solved)", None, [], world)
|
||||
self.event_loc_to_item["The End (Solved)"] = "Victory"
|
||||
elif victory_condition == VictoryCondition.option_the_master:
|
||||
self.victory_condition = "Orange Tower Seventh Floor - THE MASTER"
|
||||
@@ -231,6 +269,16 @@ class LingoPlayerLogic:
|
||||
[RoomAndPanel("Pilgrim Antechamber", "PILGRIM")], world)
|
||||
self.event_loc_to_item["PILGRIM (Solved)"] = "Victory"
|
||||
|
||||
# Create events for each achievement panel, so that we can determine when THE MASTER is accessible.
|
||||
for room_name, room_data in PANELS_BY_ROOM.items():
|
||||
for panel_name, panel_data in room_data.items():
|
||||
if panel_data.achievement:
|
||||
access_req = AccessRequirements()
|
||||
access_req.merge(self.calculate_panel_requirements(room_name, panel_name, world))
|
||||
access_req.rooms.add(room_name)
|
||||
|
||||
self.mastery_reqs.append(access_req)
|
||||
|
||||
# Create groups of counting panel access requirements for the LEVEL 2 check.
|
||||
self.create_panel_hunt_events(world)
|
||||
|
||||
@@ -241,7 +289,7 @@ class LingoPlayerLogic:
|
||||
elif location_checks == LocationChecks.option_insanity:
|
||||
location_classification = LocationClassification.insanity
|
||||
|
||||
if door_shuffle != ShuffleDoors.option_none and not early_color_hallways:
|
||||
if door_shuffle == ShuffleDoors.option_doors and not early_color_hallways:
|
||||
location_classification |= LocationClassification.small_sphere_one
|
||||
|
||||
for location_name, location_data in ALL_LOCATION_TABLE.items():
|
||||
@@ -283,7 +331,7 @@ class LingoPlayerLogic:
|
||||
"iterations. This is very unlikely to happen on its own, and probably indicates some "
|
||||
"kind of logic error.")
|
||||
|
||||
if door_shuffle != ShuffleDoors.option_none and location_checks != LocationChecks.option_insanity \
|
||||
if door_shuffle == ShuffleDoors.option_doors and location_checks != LocationChecks.option_insanity \
|
||||
and not early_color_hallways and world.multiworld.players > 1:
|
||||
# Under the combination of door shuffle, normal location checks, and no early color hallways, sphere 1 is
|
||||
# only three checks. In a multiplayer situation, this can be frustrating for the player because they are
|
||||
@@ -298,19 +346,19 @@ class LingoPlayerLogic:
|
||||
# Starting Room - Exit Door gives access to OPEN and TRACE.
|
||||
good_item_options: List[str] = ["Starting Room - Back Right Door", "Second Room - Exit Door"]
|
||||
|
||||
if not color_shuffle and not world.options.enable_pilgrimage:
|
||||
# HOT CRUST and THIS.
|
||||
good_item_options.append("Pilgrim Room - Sun Painting")
|
||||
|
||||
if not color_shuffle:
|
||||
if door_shuffle == ShuffleDoors.option_simple:
|
||||
if not world.options.enable_pilgrimage:
|
||||
# HOT CRUST and THIS.
|
||||
good_item_options.append("Pilgrim Room - Sun Painting")
|
||||
|
||||
if world.options.group_doors:
|
||||
# WELCOME BACK, CLOCKWISE, and DRAWL + RUNS.
|
||||
good_item_options.append("Welcome Back Doors")
|
||||
else:
|
||||
# WELCOME BACK and CLOCKWISE.
|
||||
good_item_options.append("Welcome Back Area - Shortcut to Starting Room")
|
||||
|
||||
if door_shuffle == ShuffleDoors.option_simple:
|
||||
if world.options.group_doors:
|
||||
# Color hallways access (NOTE: reconsider when sunwarp shuffling exists).
|
||||
good_item_options.append("Rhyme Room Doors")
|
||||
|
||||
@@ -356,13 +404,11 @@ class LingoPlayerLogic:
|
||||
def randomize_paintings(self, world: "LingoWorld") -> bool:
|
||||
self.painting_mapping.clear()
|
||||
|
||||
door_shuffle = world.options.shuffle_doors
|
||||
|
||||
# First, assign mappings to the required-exit paintings. We ensure that req-blocked paintings do not lead to
|
||||
# required paintings.
|
||||
req_exits = []
|
||||
required_painting_rooms = REQUIRED_PAINTING_ROOMS
|
||||
if door_shuffle == ShuffleDoors.option_none:
|
||||
if world.options.shuffle_doors != ShuffleDoors.option_doors:
|
||||
required_painting_rooms += REQUIRED_PAINTING_WHEN_NO_DOORS_ROOMS
|
||||
req_exits = [painting_id for painting_id, painting in PAINTINGS.items() if painting.required_when_no_doors]
|
||||
|
||||
@@ -429,7 +475,7 @@ class LingoPlayerLogic:
|
||||
for painting_id, painting in PAINTINGS.items():
|
||||
if painting_id not in self.painting_mapping.values() \
|
||||
and (painting.required or (painting.required_when_no_doors and
|
||||
door_shuffle == ShuffleDoors.option_none)):
|
||||
world.options.shuffle_doors != ShuffleDoors.option_doors)):
|
||||
return False
|
||||
|
||||
return True
|
||||
@@ -444,12 +490,31 @@ class LingoPlayerLogic:
|
||||
access_reqs = AccessRequirements()
|
||||
panel_object = PANELS_BY_ROOM[room][panel]
|
||||
|
||||
if world.options.shuffle_doors == ShuffleDoors.option_panels and panel_object.panel_door is not None:
|
||||
panel_door_room = panel_object.panel_door.room
|
||||
panel_door_name = panel_object.panel_door.panel_door
|
||||
panel_door = PANEL_DOORS_BY_ROOM[panel_door_room][panel_door_name]
|
||||
|
||||
if panel_door.panel_group is not None and world.options.group_doors:
|
||||
access_reqs.items.add(panel_door.panel_group)
|
||||
elif panel_door_room in PROGRESSIVE_PANELS_BY_ROOM\
|
||||
and panel_door_name in PROGRESSIVE_PANELS_BY_ROOM[panel_door_room]:
|
||||
progression_obj = PROGRESSIVE_PANELS_BY_ROOM[panel_door_room][panel_door_name]
|
||||
progression_handling = should_split_progression(progression_obj.item_name, world)
|
||||
|
||||
if progression_handling == ProgressiveItemBehavior.SPLIT:
|
||||
access_reqs.items.add(panel_door.item_name)
|
||||
elif progression_handling == ProgressiveItemBehavior.PROGRESSIVE:
|
||||
access_reqs.progression[progression_obj.item_name] = progression_obj.index
|
||||
else:
|
||||
access_reqs.items.add(panel_door.item_name)
|
||||
|
||||
for req_room in panel_object.required_rooms:
|
||||
access_reqs.rooms.add(req_room)
|
||||
|
||||
for req_door in panel_object.required_doors:
|
||||
door_object = DOORS_BY_ROOM[room if req_door.room is None else req_door.room][req_door.door]
|
||||
if door_object.event or world.options.shuffle_doors == ShuffleDoors.option_none:
|
||||
if door_object.event or world.options.shuffle_doors != ShuffleDoors.option_doors:
|
||||
sub_access_reqs = self.calculate_door_requirements(
|
||||
room if req_door.room is None else req_door.room, req_door.door, world)
|
||||
access_reqs.merge(sub_access_reqs)
|
||||
@@ -470,6 +535,11 @@ class LingoPlayerLogic:
|
||||
if panel == "THE MASTER":
|
||||
access_reqs.the_master = True
|
||||
|
||||
# Evil python magic (so sayeth NewSoupVi): this checks victory_condition against the panel's location name
|
||||
# override if it exists, or the auto-generated location name if it's None.
|
||||
if self.victory_condition == (panel_object.location_name or f"{room} - {panel}"):
|
||||
access_reqs.postgame = True
|
||||
|
||||
self.panel_reqs[room][panel] = access_reqs
|
||||
|
||||
return self.panel_reqs[room][panel]
|
||||
@@ -514,11 +584,14 @@ class LingoPlayerLogic:
|
||||
continue
|
||||
|
||||
# We won't coalesce any panels that have requirements beyond colors. To simplify things for now, we will
|
||||
# only coalesce single-color panels. Chains/stacks/combo puzzles will be separate. THE MASTER has
|
||||
# special access rules and is handled separately.
|
||||
# only coalesce single-color panels. Chains/stacks/combo puzzles will be separate. Panel door locked
|
||||
# puzzles will be separate if panels mode is on. THE MASTER has special access rules and is handled
|
||||
# separately.
|
||||
if len(panel_data.required_panels) > 0 or len(panel_data.required_doors) > 0\
|
||||
or len(panel_data.required_rooms) > 0\
|
||||
or (world.options.shuffle_colors and len(panel_data.colors) > 1)\
|
||||
or (world.options.shuffle_doors == ShuffleDoors.option_panels
|
||||
and panel_data.panel_door is not None)\
|
||||
or panel_name == "THE MASTER":
|
||||
self.counting_panel_reqs.setdefault(room_name, []).append(
|
||||
(self.calculate_panel_requirements(room_name, panel_name, world), 1))
|
||||
|
||||
@@ -159,7 +159,7 @@ def create_regions(world: "LingoWorld") -> None:
|
||||
RoomAndDoor("Pilgrim Antechamber", "Sun Painting"), EntranceType.PAINTING, False, world)
|
||||
|
||||
if early_color_hallways:
|
||||
connect_entrance(regions, regions["Starting Room"], regions["Outside The Undeterred"], "Early Color Hallways",
|
||||
connect_entrance(regions, regions["Starting Room"], regions["Color Hallways"], "Early Color Hallways",
|
||||
None, EntranceType.PAINTING, False, world)
|
||||
|
||||
if painting_shuffle:
|
||||
|
||||
@@ -3,7 +3,7 @@ from typing import TYPE_CHECKING
|
||||
from BaseClasses import CollectionState
|
||||
from .datatypes import RoomAndDoor
|
||||
from .player_logic import AccessRequirements, PlayerLocation
|
||||
from .static_logic import PROGRESSION_BY_ROOM, PROGRESSIVE_ITEMS
|
||||
from .static_logic import PROGRESSIVE_DOORS_BY_ROOM, PROGRESSIVE_ITEMS
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from . import LingoWorld
|
||||
@@ -59,9 +59,18 @@ def _lingo_can_satisfy_requirements(state: CollectionState, access: AccessRequir
|
||||
if not state.has(color.capitalize(), world.player):
|
||||
return False
|
||||
|
||||
if not all(state.has(item, world.player) for item in access.items):
|
||||
return False
|
||||
|
||||
if not all(state.has(item, world.player, index) for item, index in access.progression.items()):
|
||||
return False
|
||||
|
||||
if access.the_master and not lingo_can_use_mastery_location(state, world):
|
||||
return False
|
||||
|
||||
if access.postgame and state.has("Prevent Victory", world.player):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
@@ -74,7 +83,7 @@ def _lingo_can_open_door(state: CollectionState, room: str, door: str, world: "L
|
||||
|
||||
item_name = world.player_logic.item_by_door[room][door]
|
||||
if item_name in PROGRESSIVE_ITEMS:
|
||||
progression = PROGRESSION_BY_ROOM[room][door]
|
||||
progression = PROGRESSIVE_DOORS_BY_ROOM[room][door]
|
||||
return state.has(item_name, world.player, progression.index)
|
||||
|
||||
return state.has(item_name, world.player)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user