Compare commits

..

20 Commits

Author SHA1 Message Date
NewSoupVi
b350521893 Update docs/apworld_dev_faq.md
Co-authored-by: qwint <qwint.42@gmail.com>
2024-09-05 22:21:51 +02:00
NewSoupVi
a2ba2f3dbf Update docs/apworld_dev_faq.md
Co-authored-by: qwint <qwint.42@gmail.com>
2024-09-05 21:30:30 +02:00
NewSoupVi
ce8d254912 Update apworld_dev_faq.md 2024-09-05 21:23:33 +02:00
NewSoupVi
153f454fb8 Update docs/apworld_dev_faq.md
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-09-05 21:22:36 +02:00
NewSoupVi
df1f3dc730 Update docs/apworld_dev_faq.md
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-09-05 21:21:24 +02:00
NewSoupVi
8cefe85630 Update docs/apworld_dev_faq.md
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-09-05 21:20:51 +02:00
NewSoupVi
a1779c1924 Update apworld_dev_faq.md 2024-09-05 21:20:35 +02:00
NewSoupVi
663b5a28a5 Update docs/apworld_dev_faq.md
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-09-05 21:20:10 +02:00
NewSoupVi
cf3d4ff837 Update apworld_dev_faq.md 2024-09-05 19:04:07 +02:00
NewSoupVi
1d8d04ea03 Update docs/apworld_dev_faq.md
Co-authored-by: qwint <qwint.42@gmail.com>
2024-09-05 18:56:33 +02:00
NewSoupVi
49394bebda Update docs/apworld_dev_faq.md
Co-authored-by: qwint <qwint.42@gmail.com>
2024-09-05 18:55:58 +02:00
NewSoupVi
9ec1f8de6e Update docs/apworld_dev_faq.md
Co-authored-by: Scipio Wright <scipiowright@gmail.com>
2024-08-13 18:19:21 +02:00
NewSoupVi
e74e472e3f Update docs/apworld_dev_faq.md
Co-authored-by: Scipio Wright <scipiowright@gmail.com>
2024-08-13 18:18:55 +02:00
NewSoupVi
850033b311 Update docs/apworld_dev_faq.md
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-07-31 22:34:10 +02:00
NewSoupVi
3a70bf9f4f Update docs/apworld_dev_faq.md
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-07-31 22:33:57 +02:00
NewSoupVi
205fa71cc7 Update docs/apworld_dev_faq.md
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-07-31 22:33:50 +02:00
NewSoupVi
8420c72ec4 Update docs/apworld_dev_faq.md
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-07-31 22:33:44 +02:00
NewSoupVi
f9b07a5b9a Update docs/apworld_dev_faq.md
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-07-31 22:33:36 +02:00
NewSoupVi
295e719ef3 Actually copy in the text 2024-07-31 19:34:37 +02:00
NewSoupVi
db5be6a411 Docs: Dev FAQ - About indirect conditions
I wrote up a big effortpost about indirect conditions for nex on the [DS3 3.0 PR](https://github.com/ArchipelagoMW/Archipelago/pull/3128#discussion_r1693843193).

The version I'm [PRing to the world API document](https://github.com/ArchipelagoMW/Archipelago/pull/3552) is very brief and unnuanced, because I'd rather people use too many indirect conditions than too few.
But that might leave some devs wanting to know more.

I think that comment on nex's DS3 PR is probably the best detailed explanation for indirect conditions that exists currently.

So I think it's good if it exists somewhere. And the FAQ doc seems like the best place right now, because I don't want to write an entirely new doc at the moment.
2024-07-27 08:18:00 +02:00
128 changed files with 3784 additions and 13564 deletions

View File

@@ -1,6 +1,6 @@
from __future__ import annotations
import collections
import copy
import itertools
import functools
import logging
@@ -63,6 +63,7 @@ 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]
@@ -287,86 +288,6 @@ 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
@@ -602,22 +523,26 @@ class MultiWorld():
players: Dict[str, Set[int]] = {
"minimal": set(),
"items": set(),
"full": set()
"locations": set()
}
for player, world in self.worlds.items():
players[world.options.accessibility.current_key].add(player)
for player, access in self.accessibility.items():
players[access.current_key].add(player)
beatable_fulfilled = False
def location_condition(location: Location) -> bool:
def location_condition(location: Location):
"""Determine if this location has to be accessible, location is already filtered by location_relevant"""
return location.player in players["full"] or \
(location.item and location.item.player not in players["minimal"])
if location.player in players["locations"] or (location.item and location.item.player not in
players["minimal"]):
return True
return False
def location_relevant(location: Location) -> bool:
def location_relevant(location: Location):
"""Determine if this location is relevant to sweep."""
return location.progress_type != LocationProgressType.EXCLUDED \
and (location.player in players["full"] or location.advancement)
if location.progress_type != LocationProgressType.EXCLUDED \
and (location.player in players["locations"] or location.advancement):
return True
return False
def all_done() -> bool:
"""Check if all access rules are fulfilled"""
@@ -718,14 +643,14 @@ class CollectionState():
def copy(self) -> CollectionState:
ret = CollectionState(self.multiworld)
ret.prog_items = {player: counter.copy() for player, counter in self.prog_items.items()}
ret.reachable_regions = {player: region_set.copy() for player, region_set in
self.reachable_regions.items()}
ret.blocked_connections = {player: entrance_set.copy() for player, entrance_set in
self.blocked_connections.items()}
ret.events = self.events.copy()
ret.path = self.path.copy()
ret.locations_checked = self.locations_checked.copy()
ret.prog_items = copy.deepcopy(self.prog_items)
ret.reachable_regions = {player: copy.copy(self.reachable_regions[player]) for player in
self.reachable_regions}
ret.blocked_connections = {player: copy.copy(self.blocked_connections[player]) for player in
self.blocked_connections}
ret.events = copy.copy(self.events)
ret.path = copy.copy(self.path)
ret.locations_checked = copy.copy(self.locations_checked)
for function in self.additional_copy_functions:
ret = function(self, ret)
return ret
@@ -755,13 +680,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, locations: Optional[Iterable[Location]] = None) -> None:
def sweep_for_events(self, key_only: bool = False, 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}
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)}
while reachable_events:
reachable_events = {location for location in locations if location.can_reach(self)}
locations -= reachable_events
@@ -1127,9 +1052,9 @@ class Location:
and (not check_access or self.can_reach(state))))
def can_reach(self, state: CollectionState) -> bool:
# Region.can_reach is just a cache lookup, so placing it first for faster abort on average
# self.access_rule computes faster on average, so placing it first for faster abort
assert self.parent_region, "Can't reach location without region"
return self.parent_region.can_reach(state) and self.access_rule(state)
return self.access_rule(state) and self.parent_region.can_reach(state)
def place_locked_item(self, item: Item):
if self.item:
@@ -1366,6 +1291,8 @@ 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:

View File

@@ -646,6 +646,7 @@ 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:

92
Main.py
View File

@@ -151,7 +151,6 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No
# Because some worlds don't actually create items during create_items this has to be as late as possible.
if any(getattr(multiworld.worlds[player].options, "start_inventory_from_pool", None) for player in multiworld.player_ids):
new_items: List[Item] = []
old_items: List[Item] = []
depletion_pool: Dict[int, Dict[str, int]] = {
player: getattr(multiworld.worlds[player].options,
"start_inventory_from_pool",
@@ -170,26 +169,97 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No
depletion_pool[item.player][item.name] -= 1
# quick abort if we have found all items
if not target:
old_items.extend(multiworld.itempool[i+1:])
new_items.extend(multiworld.itempool[i+1:])
break
else:
old_items.append(item)
new_items.append(item)
# leftovers?
if target:
for player, remaining_items in depletion_pool.items():
remaining_items = {name: count for name, count in remaining_items.items() if count}
if remaining_items:
logger.warning(f"{multiworld.get_player_name(player)}"
raise Exception(f"{multiworld.get_player_name(player)}"
f" is trying to remove items from their pool that don't exist: {remaining_items}")
# find all filler we generated for the current player and remove until it matches
removables = [item for item in new_items if item.player == player]
for _ in range(sum(remaining_items.values())):
new_items.remove(removables.pop())
assert len(multiworld.itempool) == len(new_items + old_items), "Item Pool amounts should not change."
multiworld.itempool[:] = new_items + old_items
assert len(multiworld.itempool) == len(new_items), "Item Pool amounts should not change."
multiworld.itempool[:] = new_items
multiworld.link_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)])
if any(multiworld.item_links.values()):
multiworld._all_state = None

View File

@@ -786,22 +786,17 @@ class VerifyKeys(metaclass=FreezeValidKeys):
verify_location_name: bool = False
value: typing.Any
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
@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
if extra:
raise OptionError(
f"Found unexpected key {', '.join(extra)} in {getattr(self, 'display_name', self)}. "
f"Allowed keys: {self._valid_keys}."
)
raise Exception(f"Found unexpected key {', '.join(extra)} in {cls}. "
f"Allowed keys: {cls._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:
@@ -838,6 +833,7 @@ 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)}")
@@ -883,6 +879,7 @@ 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))
@@ -908,6 +905,7 @@ 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))
@@ -950,19 +948,6 @@ 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:
@@ -986,6 +971,7 @@ 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)}")
@@ -1158,35 +1144,18 @@ class PlandoConnections(Option[typing.List[PlandoConnection]], metaclass=Connect
class Accessibility(Choice):
"""
Set rules for reachability of your items/locations.
**Full:** ensure everything can be reached and acquired.
"""Set rules for reachability of your items/locations.
**Minimal:** ensure what is needed to reach your goal can be 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.
"""
display_name = "Accessibility"
rich_text_doc = True
option_full = 0
option_locations = 0
option_items = 1
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
@@ -1236,7 +1205,6 @@ class CommonOptions(metaclass=OptionsMetaProperty):
:param option_names: names of the options to return
:param casing: case of the keys to return. Supports `snake`, `camel`, `pascal`, `kebab`
"""
assert option_names, "options.as_dict() was used without any option names."
option_results = {}
for option_name in option_names:
if option_name in type(self).type_hints:
@@ -1518,3 +1486,31 @@ def generate_yaml_templates(target_folder: typing.Union[str, "pathlib.Path"], ge
with open(os.path.join(target_folder, game_name + ".yaml"), "w", encoding="utf-8-sig") as f:
f.write(res)
if __name__ == "__main__":
from worlds.alttp.Options import Logic
import argparse
map_shuffle = Toggle
compass_shuffle = Toggle
key_shuffle = Toggle
big_key_shuffle = Toggle
hints = Toggle
test = argparse.Namespace()
test.logic = Logic.from_text("no_logic")
test.map_shuffle = map_shuffle.from_text("ON")
test.hints = hints.from_text('OFF')
try:
test.logic = Logic.from_text("overworld_glitches_typo")
except KeyError as e:
print(e)
try:
test.logic_owg = Logic.from_text("owg")
except KeyError as e:
print(e)
if test.map_shuffle:
print("map_shuffle is on")
print(f"Hints are {bool(test.hints)}")
print(test)

View File

@@ -72,7 +72,6 @@ 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

View File

@@ -231,13 +231,6 @@ 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-"):

View File

@@ -54,7 +54,7 @@
{% macro NamedRange(option_name, option) %}
{{ OptionTitle(option_name, option) }}
<div class="named-range-container">
<select id="{{ option_name }}-select" name="{{ option_name }}" data-option-name="{{ option_name }}" {{ "disabled" if option.default == "random" }}>
<select id="{{ option_name }}-select" 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 js-required">
<div class="named-range-wrapper">
<input
type="range"
id="{{ option_name }}"
name="{{ option_name }}-range"
name="{{ option_name }}"
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">
<span id="{{ option_name }}-value" class="range-value js-required">
{{ option.default | default(option.range_start) if option.default != "random" else option.range_start }}
</span>
{{ RandomizeButton(option_name, option) }}

View File

@@ -11,7 +11,7 @@
<noscript>
<style>
.js-required{
display: none !important;
display: none;
}
</style>
</noscript>

View File

@@ -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["location_name_to_id"]
self.location_name_to_id[game] = game_package["item_name_to_id"]
def get_seed_name(self) -> str:
"""Retrieves the seed name."""

View File

@@ -115,9 +115,6 @@
# Ocarina of Time
/worlds/oot/ @espeon65536
# Old School Runescape
/worlds/osrs @digiholic
# Overcooked! 2
/worlds/overcooked2/ @toasterparty

View File

@@ -43,3 +43,26 @@ A faster alternative to the `for` loop would be to use a [list comprehension](ht
```py
item_pool += [self.create_filler() for _ in range(total_locations - len(item_pool))]
```
---
### I learned about indirect conditions in the world API document, but I want to know more. What are they and why are they necessary?
The world API document mentions indirect conditions and **when** you should use them, but not *how* they work and *why* they are necessary. This is because the explanation is quite complicated.
Region sweep (the algorithm that determines which regions are reachable) is a Breadth-First Search of the region graph from the origin region, checking entrances one by one and adding newly reached nodes (regions) and their entrances to the queue until there is nothing more to check.
For performance reasons, AP only checks every entrance once. However, if an entrance's access condition depends on regions, then it is possible for this to happen:
1. An entrance that depends on a region is checked and determined to be nontraversable because the region hasn't been reached yet during the graph search.
2. After that, the region is reached by the graph search.
The entrance *would* now be determined to be traversable if it were rechecked, but it is not.
To account for this case, AP would have to recheck all entrances every time a new region is reached until no new regions are reached.
However, there is a way to **manually** define that a *specific* entrance needs to be rechecked during region sweep if a *specific* region is reached during it. This is what an indirect condition is.
This keeps almost all of the performance upsides. Even a game making heavy use of indirect conditions (See: The Witness) is still significantly faster than if it just blanket "rechecked all entrances until nothing new is found".
The reason entrance access rules using `location.can_reach` and `entrance.can_reach` are also affected is simple: They call `region.can_reach` on their respective parent/source region.
We recognize it can feel like a trap since it will not alert you when you are missing an indirect condition, and that some games have very complex access rules.
As of [PR #3682 (Core: Region handling customization)](https://github.com/ArchipelagoMW/Archipelago/pull/3682) being merged, it is also possible for a world to opt out of indirect conditions entirely, although it does come at a flat performance cost.
It should only be used by games that *really* need it. For most games, it should be reasonable to know all entrance &rarr; region dependencies, and in this case, indirect conditions are still preferred because they are faster.

View File

@@ -66,6 +66,7 @@ non_apworlds: set = {
"Adventure",
"ArchipIDLE",
"Archipelago",
"ChecksFinder",
"Clique",
"Final Fantasy",
"Lufia II Ancient Cave",

View File

@@ -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.worlds[player1.id].options.accessibility.value = Accessibility.option_minimal
multiworld.worlds[player2.id].options.accessibility.value = Accessibility.option_full
multiworld.accessibility[player1.id].value = multiworld.accessibility[player1.id].option_minimal
multiworld.accessibility[player2.id].value = multiworld.accessibility[player2.id].option_locations
multiworld.completion_condition[player1.id] = lambda state: True
multiworld.completion_condition[player2.id] = lambda state: state.has(player2.prog_items[2].name, player2.id)

View File

@@ -1,6 +1,6 @@
import unittest
from BaseClasses import MultiWorld, PlandoOptions
from BaseClasses import PlandoOptions
from Options import ItemLinks
from worlds.AutoWorld import AutoWorldRegister
@@ -47,15 +47,3 @@ 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])

View File

@@ -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_full
world.options.accessibility.value = Accessibility.option_locations
self.assertSteps(gen_steps)
with self.subTest("filling multiworld", seed=self.multiworld.seed):
distribute_items_restrictive(self.multiworld)

View File

@@ -73,12 +73,7 @@ class WorldSource:
else: # TODO: remove with 3.8 support
mod = importer.load_module(os.path.basename(self.path).rsplit(".", 1)[0])
if mod.__package__ is not None:
mod.__package__ = f"worlds.{mod.__package__}"
else:
# load_module does not populate package, we'll have to assume mod.__name__ is correct here
# probably safe to remove with 3.8 support
mod.__package__ = f"worlds.{mod.__name__}"
mod.__package__ = f"worlds.{mod.__package__}"
mod.__name__ = f"worlds.{mod.__name__}"
sys.modules[mod.__name__] = mod
with warnings.catch_warnings():

View File

@@ -39,7 +39,7 @@ def create_itempool(world: "HatInTimeWorld") -> List[Item]:
continue
else:
if name == "Scooter Badge":
if world.options.CTRLogic == CTRLogic.option_scooter or get_difficulty(world) >= Difficulty.MODERATE:
if world.options.CTRLogic is 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

View File

@@ -659,10 +659,6 @@ 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
@@ -688,12 +684,9 @@ 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 == ChapterIndex.ALPINE or start_chapter == ChapterIndex.SUBCON:
if start_chapter is ChapterIndex.ALPINE or start_chapter is ChapterIndex.SUBCON:
if "Time Rift" in act.name:
return False
@@ -730,8 +723,7 @@ 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 "Time Rift" not in act.name \
and act_chapters.get(act.name, "") == "Subcon Forest":
if world.options.ShuffleSubconPaintings 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

View File

@@ -1,6 +1,7 @@
from worlds.AutoWorld import CollectionState
from worlds.generic.Rules import add_rule, set_rule
from .Locations import location_table, zipline_unlocks, is_location_valid, shop_locations, event_locs
from .Locations import location_table, zipline_unlocks, is_location_valid, contract_locations, \
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
@@ -147,14 +148,14 @@ def set_rules(world: "HatInTimeWorld"):
if world.is_dlc1():
chapter_list.append(ChapterIndex.CRUISE)
if world.is_dlc2() and final_chapter != ChapterIndex.METRO:
if world.is_dlc2() and final_chapter is not 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 != ChapterIndex.ALPINE and (world.is_dlc1() or world.is_dlc2()):
if starting_chapter is not ChapterIndex.ALPINE and (world.is_dlc1() or world.is_dlc2()):
index1 = 69
index2 = 69
pos: int
@@ -164,7 +165,7 @@ def set_rules(world: "HatInTimeWorld"):
if world.is_dlc1():
index1 = chapter_list.index(ChapterIndex.CRUISE)
if world.is_dlc2() and final_chapter != ChapterIndex.METRO:
if world.is_dlc2() and final_chapter is not ChapterIndex.METRO:
index2 = chapter_list.index(ChapterIndex.METRO)
lowest_index = min(index1, index2)
@@ -241,6 +242,9 @@ 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:
@@ -252,7 +256,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 != HitType.none and world.options.UmbrellaLogic:
if data.hit_type is not HitType.none and world.options.UmbrellaLogic:
if data.hit_type == HitType.umbrella:
add_rule(loc, lambda state: state.has("Umbrella", world.player))
@@ -514,7 +518,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 != NoTicketSkips.option_true:
if world.options.NoTicketSkips is not 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:

View File

@@ -1,16 +1,15 @@
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, alps_hooks
calculate_yarn_costs
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, has_paintings
from .Rules import set_rules
from .Options import AHITOptions, slot_data_options, adjust_options, RandomizeHatOrder, EndGoal, create_option_groups
from .Types import HatType, ChapterIndex, HatInTimeItem, hat_type_to_item, Difficulty
from .Types import HatType, ChapterIndex, HatInTimeItem, hat_type_to_item
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
@@ -87,27 +86,19 @@ class HatInTimeWorld(World):
if self.is_dw_only():
return
# 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 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)
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:
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"))
elif self.options.LogicDifficulty < Difficulty.MODERATE:
self.multiworld.push_precollected(self.create_item("Umbrella"))
if start_chapter == ChapterIndex.SUBCON and self.options.ShuffleSubconPaintings:
self.multiworld.push_precollected(self.create_item("Progressive Painting Unlock"))
def create_regions(self):
# noinspection PyClassVar
@@ -128,10 +119,7 @@ class HatInTimeWorld(World):
# place vanilla contract locations if contract shuffle is off
if not self.options.ShuffleActContracts:
for name in contract_locations.keys():
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))
self.multiworld.get_location(name, self.player).place_locked_item(create_item(self, name))
def create_items(self):
if self.has_yarn():
@@ -329,7 +317,7 @@ class HatInTimeWorld(World):
def remove(self, state: "CollectionState", item: "Item") -> bool:
old_count: int = state.count(item.name, self.player)
change = super().remove(state, item)
change = super().collect(state, item)
if change and old_count == 1:
if "Stamp" in item.name:
if "2 Stamp" in item.name:

View File

@@ -1,8 +1,8 @@
import typing
from BaseClasses import MultiWorld
from Options import Choice, Range, DeathLink, DefaultOnToggle, FreeText, ItemsAccessibility, Option, \
PlandoBosses, PlandoConnections, PlandoTexts, Removed, StartInventoryPool, Toggle
from Options import Choice, Range, Option, Toggle, DefaultOnToggle, DeathLink, \
StartInventoryPool, PlandoBosses, PlandoConnections, PlandoTexts, FreeText, Removed
from .EntranceShuffle import default_connections, default_dungeon_connections, \
inverted_default_connections, inverted_default_dungeon_connections
from .Text import TextTable
@@ -743,7 +743,6 @@ class ALttPPlandoTexts(PlandoTexts):
alttp_options: typing.Dict[str, type(Option)] = {
"accessibility": ItemsAccessibility,
"plando_connections": ALttPPlandoConnections,
"plando_texts": ALttPPlandoTexts,
"start_inventory_from_pool": StartInventoryPool,

View File

@@ -2,7 +2,6 @@ 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)
@@ -40,7 +39,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].value = ItemsAccessibility.option_minimal
world.accessibility[player] = world.accessibility[player].from_text("minimal")
world.progression_balancing[player].value = 0
else:
@@ -378,7 +377,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] != 'full':
if multiworld.accessibility[player] != 'locations':
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))
@@ -394,7 +393,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] != 'full':
if multiworld.accessibility[player] != 'locations':
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']:
@@ -424,7 +423,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] != 'full':
if multiworld.accessibility[player] != 'locations':
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))
@@ -523,12 +522,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] != 'full':
if multiworld.accessibility[player] != 'locations':
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] != 'full':
if multiworld.accessibility[player] != 'locations':
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))
@@ -1201,7 +1200,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] == 'full':
if world.accessibility[player] == 'locations':
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',
@@ -1215,7 +1214,7 @@ def set_trock_key_rules(world, player):
location.place_locked_item(item)
toss_junk_item(world, player)
if world.accessibility[player] != 'full':
if world.accessibility[player] != 'locations':
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)))

View File

@@ -76,6 +76,10 @@ 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

View File

@@ -1,11 +1,11 @@
from worlds.alttp.Dungeons import get_dungeon_item_pool
from worlds.alttp.Dungeons import create_dungeons, 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.bases import TestBase
from test.TestBase import TestBase
from worlds.alttp.test import LTTPTestBase

View File

@@ -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.bases import TestBase
from test.TestBase import TestBase
from worlds.alttp.test import LTTPTestBase

View File

@@ -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.bases import TestBase
from test.TestBase import TestBase
from worlds.alttp.test import LTTPTestBase

View File

@@ -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.PROGRESSION, ItemGroup.UTILITY), # collectible_seahorse_costume
"Arnassi Armor": ItemData(698023, 1, ItemType.NORMAL, 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

View File

@@ -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 path close to the Verse Cave": 698061,
"Home Water, bulb in the end of the left path from 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 right part": 698071,
"Song Cave, bulb in the top left 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,
@@ -152,9 +152,6 @@ class AquariaLocations:
locations_arnassi_path = {
"Arnassi Ruins, Arnassi Statue": 698164,
}
locations_arnassi_cave_transturtle = {
"Arnassi Ruins, Transturtle": 698217,
}
@@ -272,12 +269,9 @@ class AquariaLocations:
}
locations_forest_bl = {
"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,
"Kelp Forest bottom left area, Transturtle": 698212,
}
locations_forest_br = {
@@ -376,7 +370,7 @@ class AquariaLocations:
locations_sun_temple_r = {
"Sun Temple, first bulb of the temple": 698091,
"Sun Temple, bulb on the right part": 698092,
"Sun Temple, bulb on the left part": 698092,
"Sun Temple, bulb in the hidden room of the right part": 698093,
"Sun Temple, Sun Key": 698182,
}
@@ -408,9 +402,6 @@ 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,
}
@@ -508,7 +499,6 @@ 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,
@@ -519,7 +509,6 @@ 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,
@@ -541,7 +530,6 @@ 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,

View File

@@ -14,112 +14,97 @@ 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_any({"Hot soup", "Hot soup x 2"}, player)
return state.has("Hot soup", 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_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:
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_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:
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:
@@ -149,7 +134,6 @@ class AquariaRegions:
skeleton_path: Region
skeleton_path_sc: Region
arnassi: Region
arnassi_cave_transturtle: Region
arnassi_path: Region
arnassi_crab_boss: Region
simon: Region
@@ -168,7 +152,6 @@ 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
@@ -196,7 +179,6 @@ 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
@@ -231,7 +213,7 @@ class AquariaRegions:
"""
def __add_region(self, hint: str,
locations: Optional[Dict[str, int]]) -> Region:
locations: Optional[Dict[str, Optional[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`
@@ -254,7 +236,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)
@@ -298,8 +280,6 @@ 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)
@@ -322,9 +302,9 @@ class AquariaRegions:
AquariaLocations.locations_cathedral_r)
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", None)
self.cathedral_boss_l = self.__add_region("Mithalas Cathedral, after Mithalan God room",
self.cathedral_boss_r = self.__add_region("Mithalas Cathedral, 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:
"""
@@ -340,8 +320,6 @@ 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",
@@ -397,9 +375,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:
"""
@@ -410,8 +388,6 @@ 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)
@@ -431,7 +407,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:
"""
@@ -451,7 +427,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,
@@ -479,8 +455,8 @@ class AquariaRegions:
"""
Connect entrances of the different regions around `home_water`
"""
self.__connect_one_way_regions("Menu", "Verse Cave right area",
self.menu, self.verse_cave_r)
self.__connect_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)
@@ -488,8 +464,7 @@ 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_attack_item(state, self.player) and
_has_bind_song(state, self.player))
lambda state: _has_energy_form(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",
@@ -497,7 +472,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_attack_item(state, self.player) and
lambda state: _has_energy_form(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,
@@ -507,28 +482,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_attack_item(state, self.player) and
_has_fish_form(state, self.player))
lambda state: _has_energy_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_attack_item(state, self.player))
_has_energy_form(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_attack_item(state, self.player))
lambda state: _has_energy_form(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_energy_form(state, self.player))
lambda state: _has_bind_song(state, self.player) and
_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_attack_item(state, self.player))
_has_energy_form(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_attack_item(state, self.player) and
_has_energy_form(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)
@@ -545,7 +520,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_or_arnassi_armor(state, self.player))
lambda state: _has_beast_form(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",
@@ -554,9 +529,10 @@ 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_or_arnassi_armor(state, self.player))
lambda state: _has_beast_form(state, self.player))
self.__connect_one_way_regions("Veil bottom right", "Open Water top right area",
self.veil_br, self.openwater_tr)
self.veil_br, self.openwater_tr,
lambda state: _has_beast_form(state, self.player))
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",
@@ -575,14 +551,10 @@ 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_or_arnassi_armor(state, self.player) and
(_has_energy_attack_item(state, self.player) or
_has_nature_form(state, self.player)))
lambda state: _has_beast_form(state, self.player) and
_has_energy_form(state, self.player))
self.__connect_one_way_regions("Arnassi crab boss area", "Arnassi path",
self.arnassi_crab_boss, self.arnassi_path)
@@ -592,62 +564,61 @@ 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_or_arnassi_armor(state, self.player))
lambda state: _has_beast_form(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)
self.mithalas_city, self.cathedral_l,
lambda state: _has_fish_form(state, self.player))
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_attack_item(state, self.player))
_has_energy_form(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_nature_form(state, self.player))
lambda state: _has_beast_form(state, self.player) and
_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_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", "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", "Mithalas Cathedral underground",
self.cathedral_l, self.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",
lambda state: _has_beast_form(state, self.player) and
_has_bind_song(state, self.player))
self.__connect_regions("Mithalas castle", "Mithalas Cathedral",
self.cathedral_l, self.cathedral_r,
lambda state: _has_bind_song(state, self.player) and
_has_energy_form(state, self.player))
self.__connect_regions("Mithalas Cathedral", "Mithalas Cathedral underground",
self.cathedral_r, self.cathedral_underground,
lambda state: _has_energy_form(state, self.player))
self.__connect_one_way_regions("Mithalas 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", "Mithalas Cathedral underground",
self.cathedral_boss_r, self.cathedral_underground,
lambda state: _has_beast_form(state, self.player))
self.__connect_one_way_regions("Cathedral boss right area", "Cathedral boss left area",
self.__connect_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_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)
_has_energy_form(state, self.player))
def __connect_forest_regions(self) -> None:
"""
@@ -657,12 +628,6 @@ 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",
@@ -676,7 +641,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_attack_item(state, self.player) and
_has_energy_form(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)
@@ -684,7 +649,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_attack_item(state, self.player))
lambda state: _has_energy_form(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))
@@ -698,7 +663,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_attack_item(state, self.player))
_has_energy_form(state, self.player))
def __connect_veil_regions(self) -> None:
"""
@@ -716,7 +681,8 @@ 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)
self.veil_br, self.veil_tl,
lambda state: _has_beast_form(state, self.player))
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))
@@ -725,25 +691,20 @@ 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)
self.turtle_cave, self.turtle_cave_bubble,
lambda state: _has_beast_form(state, self.player))
self.__connect_regions("Veil right of sun temple", "Sun Temple right area",
self.veil_tr_r, self.sun_temple_r)
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 right area", "Sun Temple left area",
self.sun_temple_r, self.sun_temple_l,
lambda state: _has_bind_song(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,
lambda state: _has_light(state, self.player) or
_has_sun_crystal(state, self.player))
self.sun_temple_l, self.sun_temple_boss_path)
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_attack_item(state, self.player))
lambda state: _has_energy_form(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",
@@ -751,7 +712,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_attack_item(state, self.player))
_has_energy_form(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))
@@ -767,22 +728,16 @@ 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)) or
_has_dual_form(state, self.player))
lambda state: _has_energy_form(state, self.player) and
_has_beast_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
@@ -792,14 +747,13 @@ 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_attack_item(state, self.player))
_has_energy_form(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("Ice cave", "Bubble Cave",
self.__connect_regions("Abyss right area", "Bubble Cave",
self.ice_cave, self.bubble_cave,
lambda state: _has_beast_form(state, self.player) or
_has_hot_soup(state, self.player))
lambda state: _has_beast_form(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)
@@ -818,7 +772,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_attack_item(state, self.player) and
_has_energy_form(state, self.player) and
_has_bind_song(state, self.player))
def __connect_body_regions(self) -> None:
@@ -826,13 +780,11 @@ 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,
lambda state: _has_energy_form(state, self.player))
self.body_c, self.body_l)
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,
lambda state: _has_energy_form(state, self.player))
self.body_c, self.body_rb)
self.__connect_regions("Body center area", "Body bottom area",
self.body_c, self.body_b,
lambda state: _has_dual_form(state, self.player))
@@ -851,12 +803,22 @@ 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) -> None:
def __connect_transturtle(self, item_source: str, item_target: str, region_source: Region, region_target: Region,
rule=None) -> None:
"""Connect a single transturtle to another one"""
if item_source != item_target:
self.__connect_one_way_regions(item_source, item_target, region_source, region_target,
lambda state: state.has(item_target, self.player))
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))
def _connect_transturtle_to_other(self, item: str, region: Region) -> None:
"""Connect a single transturtle to all others"""
@@ -865,10 +827,24 @@ 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_transturtle)
self.__connect_transturtle(item, "Transturtle Abyss right", region, self.abyss_r)
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_cave_transturtle)
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)
def __connect_transturtles(self) -> None:
"""Connect every transturtle with others"""
@@ -877,10 +853,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_transturtle)
self._connect_transturtle_to_other("Transturtle Abyss right", self.abyss_r)
self._connect_transturtle_to_other("Transturtle Final Boss", self.final_boss_tube)
self._connect_transturtle_to_other("Transturtle Simon Says", self.simon)
self._connect_transturtle_to_other("Transturtle Arnassi Ruins", self.arnassi_cave_transturtle)
self._connect_arnassi_path_transturtle_to_other("Transturtle Arnassi Ruins", self.arnassi_path)
def connect_regions(self) -> None:
"""
@@ -917,7 +893,7 @@ class AquariaRegions:
self.__add_event_location(self.energy_temple_boss,
"Beating Fallen God",
"Fallen God beated")
self.__add_event_location(self.cathedral_boss_l,
self.__add_event_location(self.cathedral_boss_r,
"Beating Mithalan God",
"Mithalan God beated")
self.__add_event_location(self.forest_boss,
@@ -994,9 +970,8 @@ 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),
@@ -1044,46 +1019,66 @@ 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))
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))
add_rule(self.multiworld.get_location("The Veil top right area, bulb at the top of the waterfall", self.player),
lambda state: _has_beast_and_soup_form(state, self.player))
lambda state: _has_hot_soup(state, self.player) and _has_beast_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),
@@ -1102,14 +1097,12 @@ 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("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),
@@ -1121,119 +1114,103 @@ 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_or_arnassi_armor(state, self.player))
lambda state: _has_beast_form(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_bind_song(state, self.player))
self.player), lambda state: _has_energy_form(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_attack_item(state, self.player))
lambda state: _has_energy_form(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) 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))
lambda state: _has_fish_form(state, self.player) and
_has_spirit_form(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("Mithalas boss area, beating Mithalan God",
self.player).item_rule = \
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.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()
@@ -1257,7 +1234,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_attack_item(state, self.player))
lambda state: _has_bind_song(state, self.player) and _has_energy_form(state, self.player))
if options.early_energy_form:
self.multiworld.early_items[self.player]["Energy form"] = 1
@@ -1297,7 +1274,6 @@ 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:
@@ -1324,7 +1300,6 @@ 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)
@@ -1362,7 +1337,6 @@ 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)

View File

@@ -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 right part",
"Sun Temple, bulb on the left part",
"Sun Temple, bulb in the hidden room of the right part",
"Sun Temple, Sun Key",
"Sun Worm path, first path bulb",

View File

@@ -13,16 +13,36 @@ 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",
"Sunken City cleared",
"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"
]
items = [["Beast form"]]
self.assertAccessDependency(locations, items)

View File

@@ -1,39 +0,0 @@
"""
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)

View File

@@ -17,16 +17,55 @@ 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",
"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",
"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, urn below the left entrance",
"Mithalas 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",
"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"]]

View File

@@ -1,92 +0,0 @@
"""
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)

View File

@@ -17,7 +17,6 @@ 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",
@@ -31,7 +30,8 @@ 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"
"Abyss left area, bulb in the bottom fish pass",
"Arnassi Ruins, Arnassi Armor"
]
items = [["Fish form"]]
self.assertAccessDependency(locations, items)

View File

@@ -39,6 +39,7 @@ 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",

View File

@@ -30,6 +30,7 @@ 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)

View File

@@ -1006,8 +1006,6 @@ 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))

View File

@@ -3,8 +3,8 @@ import typing
class ItemData(typing.NamedTuple):
code: int
progression: bool = True
code: typing.Optional[int]
progression: bool
class ChecksFinderItem(Item):
@@ -12,9 +12,16 @@ class ChecksFinderItem(Item):
item_table = {
"Map Width": ItemData(80000),
"Map Height": ItemData(80001),
"Map Bombs": ItemData(80002),
"Map Width": ItemData(80000, True),
"Map Height": ItemData(80001, True),
"Map Bombs": ItemData(80002, True),
}
lookup_id_to_name: typing.Dict[int, str] = {data.code: item_name for item_name, data in item_table.items()}
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}

View File

@@ -3,14 +3,46 @@ import typing
class AdvData(typing.NamedTuple):
id: int
region: str = "Board"
id: typing.Optional[int]
region: str
class ChecksFinderLocation(Location):
class ChecksFinderAdvancement(Location):
game: str = "ChecksFinder"
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()}
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}

View File

@@ -0,0 +1,6 @@
import typing
from Options import Option
checksfinder_options: typing.Dict[str, type(Option)] = {
}

View File

@@ -1,24 +1,44 @@
from worlds.generic.Rules import set_rule
from BaseClasses import MultiWorld
from ..generic.Rules import set_rule
from BaseClasses import MultiWorld, CollectionState
items = ["Map Width", "Map Height", "Map Bombs"]
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
# Sets rules on entrances and advancements that are always applied
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))
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))
# Sets rules on completion condition
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)
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)

View File

@@ -1,9 +1,9 @@
from BaseClasses import Region, Entrance, Tutorial, ItemClassification
from .Items import ChecksFinderItem, item_table
from .Locations import ChecksFinderLocation, advancement_table
from Options import PerGameCommonOptions
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 .Rules import set_rules, set_completion_rules
from worlds.AutoWorld import World, WebWorld
from ..AutoWorld import World, WebWorld
client_version = 7
@@ -25,34 +25,38 @@ 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 = "ChecksFinder"
options_dataclass = PerGameCommonOptions
game: str = "ChecksFinder"
option_definitions = checksfinder_options
topology_present = True
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 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 _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_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"] * 5 # 10 - 5
itempool += ["Map Height"] * 5 # 10 - 5
itempool += ["Map Width"] * (10-5)
itempool += ["Map Height"] * (10-5)
# Add the map bombs
itempool += ["Map Bombs"] * 15 # 20 - 5
itempool += ["Map Bombs"] * (20-5)
# Convert itempool into real items
itempool = [self.create_item(item) for item in itempool]
itempool = [item for item in map(lambda name: self.create_item(name), itempool)]
self.multiworld.itempool += itempool
@@ -60,16 +64,28 @@ class ChecksFinderWorld(World):
set_rules(self.multiworld, self.player)
set_completion_rules(self.multiworld, self.player)
def fill_slot_data(self):
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_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]
def create_item(self, name: str) -> ChecksFinderItem:
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
def create_item(self, name: str) -> Item:
item_data = item_table[name]
return ChecksFinderItem(name, ItemClassification.progression, item_data.code, self.player)
item = ChecksFinderItem(name,
ItemClassification.progression if item_data.progression else ItemClassification.filler,
item_data.code, self.player)
return item

View File

@@ -24,3 +24,8 @@ 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.

View File

@@ -4,6 +4,7 @@
- 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
@@ -16,15 +17,28 @@ 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)
## Joining a MultiWorld Game
### Generating a ChecksFinder 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!
**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!
Game options and controls are described in the readme on the github repository for the game

View File

@@ -1,9 +1,6 @@
from typing import Callable, Dict, NamedTuple, Optional, TYPE_CHECKING
from typing import Callable, Dict, NamedTuple, Optional
from BaseClasses import Item, ItemClassification
if TYPE_CHECKING:
from . import CliqueWorld
from BaseClasses import Item, ItemClassification, MultiWorld
class CliqueItem(Item):
@@ -13,7 +10,7 @@ class CliqueItem(Item):
class CliqueItemData(NamedTuple):
code: Optional[int] = None
type: ItemClassification = ItemClassification.filler
can_create: Callable[["CliqueWorld"], bool] = lambda world: True
can_create: Callable[[MultiWorld, int], bool] = lambda multiworld, player: True
item_data_table: Dict[str, CliqueItemData] = {
@@ -24,11 +21,11 @@ item_data_table: Dict[str, CliqueItemData] = {
"Button Activation": CliqueItemData(
code=69696968,
type=ItemClassification.progression,
can_create=lambda world: world.options.hard_mode,
can_create=lambda multiworld, player: bool(getattr(multiworld, "hard_mode")[player]),
),
"A Cool Filler Item (No Satisfaction Guaranteed)": CliqueItemData(
code=69696967,
can_create=lambda world: False # Only created from `get_filler_item_name`.
can_create=lambda multiworld, player: False # Only created from `get_filler_item_name`.
),
"The Urge to Push": CliqueItemData(
type=ItemClassification.progression,

View File

@@ -1,9 +1,6 @@
from typing import Callable, Dict, NamedTuple, Optional, TYPE_CHECKING
from typing import Callable, Dict, NamedTuple, Optional
from BaseClasses import Location
if TYPE_CHECKING:
from . import CliqueWorld
from BaseClasses import Location, MultiWorld
class CliqueLocation(Location):
@@ -13,7 +10,7 @@ class CliqueLocation(Location):
class CliqueLocationData(NamedTuple):
region: str
address: Optional[int] = None
can_create: Callable[["CliqueWorld"], bool] = lambda world: True
can_create: Callable[[MultiWorld, int], bool] = lambda multiworld, player: True
locked_item: Optional[str] = None
@@ -25,7 +22,7 @@ location_data_table: Dict[str, CliqueLocationData] = {
"The Item on the Desk": CliqueLocationData(
region="The Button Realm",
address=69696968,
can_create=lambda world: world.options.hard_mode,
can_create=lambda multiworld, player: bool(getattr(multiworld, "hard_mode")[player]),
),
"In the Player's Mind": CliqueLocationData(
region="The Button Realm",

View File

@@ -1,5 +1,6 @@
from dataclasses import dataclass
from Options import Choice, Toggle, PerGameCommonOptions, StartInventoryPool
from typing import Dict
from Options import Choice, Option, Toggle
class HardMode(Toggle):
@@ -24,11 +25,10 @@ class ButtonColor(Choice):
option_black = 11
@dataclass
class CliqueOptions(PerGameCommonOptions):
color: ButtonColor
hard_mode: HardMode
start_inventory_from_pool: StartInventoryPool
clique_options: Dict[str, type(Option)] = {
"color": ButtonColor,
"hard_mode": HardMode,
# DeathLink is always on. Always.
# death_link: DeathLink
# "death_link": DeathLink,
}

View File

@@ -1,13 +1,10 @@
from typing import Callable, TYPE_CHECKING
from typing import Callable
from BaseClasses import CollectionState
if TYPE_CHECKING:
from . import CliqueWorld
from BaseClasses import CollectionState, MultiWorld
def get_button_rule(world: "CliqueWorld") -> Callable[[CollectionState], bool]:
if world.options.hard_mode:
return lambda state: state.has("Button Activation", world.player)
def get_button_rule(multiworld: MultiWorld, player: int) -> Callable[[CollectionState], bool]:
if getattr(multiworld, "hard_mode")[player]:
return lambda state: state.has("Button Activation", player)
return lambda state: True

View File

@@ -1,10 +1,10 @@
from typing import List, Dict, Any
from typing import List
from BaseClasses import Region, Tutorial
from worlds.AutoWorld import WebWorld, World
from .Items import CliqueItem, item_data_table, item_table
from .Locations import CliqueLocation, location_data_table, location_table, locked_locations
from .Options import CliqueOptions
from .Options import clique_options
from .Regions import region_data_table
from .Rules import get_button_rule
@@ -38,8 +38,7 @@ class CliqueWorld(World):
game = "Clique"
web = CliqueWebWorld()
options: CliqueOptions
options_dataclass = CliqueOptions
option_definitions = clique_options
location_name_to_id = location_table
item_name_to_id = item_table
@@ -49,7 +48,7 @@ class CliqueWorld(World):
def create_items(self) -> None:
item_pool: List[CliqueItem] = []
for name, item in item_data_table.items():
if item.code and item.can_create(self):
if item.code and item.can_create(self.multiworld, self.player):
item_pool.append(self.create_item(name))
self.multiworld.itempool += item_pool
@@ -62,40 +61,41 @@ class CliqueWorld(World):
# Create locations.
for region_name, region_data in region_data_table.items():
region = self.get_region(region_name)
region = self.multiworld.get_region(region_name, self.player)
region.add_locations({
location_name: location_data.address for location_name, location_data in location_data_table.items()
if location_data.region == region_name and location_data.can_create(self)
if location_data.region == region_name and location_data.can_create(self.multiworld, self.player)
}, CliqueLocation)
region.add_exits(region_data_table[region_name].connecting_regions)
# Place locked locations.
for location_name, location_data in locked_locations.items():
# Ignore locations we never created.
if not location_data.can_create(self):
if not location_data.can_create(self.multiworld, self.player):
continue
locked_item = self.create_item(location_data_table[location_name].locked_item)
self.get_location(location_name).place_locked_item(locked_item)
self.multiworld.get_location(location_name, self.player).place_locked_item(locked_item)
# Set priority location for the Big Red Button!
self.options.priority_locations.value.add("The Big Red Button")
self.multiworld.priority_locations[self.player].value.add("The Big Red Button")
def get_filler_item_name(self) -> str:
return "A Cool Filler Item (No Satisfaction Guaranteed)"
def set_rules(self) -> None:
button_rule = get_button_rule(self)
self.get_location("The Big Red Button").access_rule = button_rule
self.get_location("In the Player's Mind").access_rule = button_rule
button_rule = get_button_rule(self.multiworld, self.player)
self.multiworld.get_location("The Big Red Button", self.player).access_rule = button_rule
self.multiworld.get_location("In the Player's Mind", self.player).access_rule = button_rule
# Do not allow button activations on buttons.
self.get_location("The Big Red Button").item_rule = lambda item: item.name != "Button Activation"
self.multiworld.get_location("The Big Red Button", self.player).item_rule =\
lambda item: item.name != "Button Activation"
# Completion condition.
self.multiworld.completion_condition[self.player] = lambda state: state.has("The Urge to Push", self.player)
def fill_slot_data(self) -> Dict[str, Any]:
def fill_slot_data(self):
return {
"color": self.options.color.current_key
"color": getattr(self.multiworld, "color")[self.player].current_key
}

View File

@@ -1,6 +1,5 @@
from dataclasses import dataclass
from Options import (OptionGroup, Choice, DefaultOnToggle, ItemsAccessibility, PerGameCommonOptions, Range, Toggle,
StartInventoryPool)
from Options import OptionGroup, Choice, DefaultOnToggle, Range, Toggle, PerGameCommonOptions, StartInventoryPool
class CharacterStages(Choice):
@@ -522,7 +521,6 @@ class DeathLink(Choice):
@dataclass
class CV64Options(PerGameCommonOptions):
accessibility: ItemsAccessibility
start_inventory_from_pool: StartInventoryPool
character_stages: CharacterStages
stage_shuffle: StageShuffle

View File

@@ -1,264 +0,0 @@
# In almost all cases, we leave boss and enemy randomization up to the static randomizer. But for
# Yhorm specifically we need to know where he ends up in order to ensure that the Storm Ruler is
# available before his fight.
from dataclasses import dataclass, field
from typing import Set
@dataclass
class DS3BossInfo:
"""The set of locations a given boss location blocks access to."""
name: str
"""The boss's name."""
id: int
"""The game's ID for this particular boss."""
dlc: bool = False
"""This boss appears in one of the game's DLCs."""
before_storm_ruler: bool = False
"""Whether this location appears before it's possible to get Storm Ruler in vanilla.
This is used to determine whether it's safe to place Yhorm here if weapons
aren't randomized.
"""
locations: Set[str] = field(default_factory=set)
"""Additional individual locations that can't be accessed until the boss is dead."""
# Note: the static randomizer splits up some bosses into separate fights for separate phases, each
# of which can be individually replaced by Yhorm.
all_bosses = [
DS3BossInfo("Iudex Gundyr", 4000800, before_storm_ruler = True, locations = {
"CA: Coiled Sword - boss drop"
}),
DS3BossInfo("Vordt of the Boreal Valley", 3000800, before_storm_ruler = True, locations = {
"HWL: Soul of Boreal Valley Vordt"
}),
DS3BossInfo("Curse-rotted Greatwood", 3100800, locations = {
"US: Soul of the Rotted Greatwood",
"US: Transposing Kiln - boss drop",
"US: Wargod Wooden Shield - Pit of Hollows",
"FS: Hawkwood's Shield - gravestone after Hawkwood leaves",
"FS: Sunset Shield - by grave after killing Hodrick w/Sirris",
"US: Sunset Helm - Pit of Hollows after killing Hodrick w/Sirris",
"US: Sunset Armor - pit of hollows after killing Hodrick w/Sirris",
"US: Sunset Gauntlets - pit of hollows after killing Hodrick w/Sirris",
"US: Sunset Leggings - pit of hollows after killing Hodrick w/Sirris",
"FS: Sunless Talisman - Sirris, kill GA boss",
"FS: Sunless Veil - shop, Sirris quest, kill GA boss",
"FS: Sunless Armor - shop, Sirris quest, kill GA boss",
"FS: Sunless Gauntlets - shop, Sirris quest, kill GA boss",
"FS: Sunless Leggings - shop, Sirris quest, kill GA boss",
}),
DS3BossInfo("Crystal Sage", 3300850, locations = {
"RS: Soul of a Crystal Sage",
"FS: Sage's Big Hat - shop after killing RS boss",
"FS: Hawkwood's Shield - gravestone after Hawkwood leaves",
}),
DS3BossInfo("Deacons of the Deep", 3500800, locations = {
"CD: Soul of the Deacons of the Deep",
"CD: Small Doll - boss drop",
"FS: Hawkwood's Shield - gravestone after Hawkwood leaves",
}),
DS3BossInfo("Abyss Watchers", 3300801, before_storm_ruler = True, locations = {
"FK: Soul of the Blood of the Wolf",
"FK: Cinders of a Lord - Abyss Watcher",
"FS: Undead Legion Helm - shop after killing FK boss",
"FS: Undead Legion Armor - shop after killing FK boss",
"FS: Undead Legion Gauntlet - shop after killing FK boss",
"FS: Undead Legion Leggings - shop after killing FK boss",
"FS: Farron Ring - Hawkwood",
"FS: Hawkwood's Shield - gravestone after Hawkwood leaves",
}),
DS3BossInfo("High Lord Wolnir", 3800800, before_storm_ruler = True, locations = {
"CC: Soul of High Lord Wolnir",
"FS: Wolnir's Crown - shop after killing CC boss",
"CC: Homeward Bone - Irithyll bridge",
"CC: Pontiff's Right Eye - Irithyll bridge, miniboss drop",
}),
DS3BossInfo("Pontiff Sulyvahn", 3700850, locations = {
"IBV: Soul of Pontiff Sulyvahn",
}),
DS3BossInfo("Old Demon King", 3800830, locations = {
"SL: Soul of the Old Demon King",
}),
DS3BossInfo("Aldrich, Devourer of Gods", 3700800, locations = {
"AL: Soul of Aldrich",
"AL: Cinders of a Lord - Aldrich",
"FS: Smough's Helm - shop after killing AL boss",
"FS: Smough's Armor - shop after killing AL boss",
"FS: Smough's Gauntlets - shop after killing AL boss",
"FS: Smough's Leggings - shop after killing AL boss",
"AL: Sun Princess Ring - dark cathedral, after boss",
"FS: Leonhard's Garb - shop after killing Leonhard",
"FS: Leonhard's Gauntlets - shop after killing Leonhard",
"FS: Leonhard's Trousers - shop after killing Leonhard",
}),
DS3BossInfo("Dancer of the Boreal Valley", 3000899, locations = {
"HWL: Soul of the Dancer",
"FS: Dancer's Crown - shop after killing LC entry boss",
"FS: Dancer's Armor - shop after killing LC entry boss",
"FS: Dancer's Gauntlets - shop after killing LC entry boss",
"FS: Dancer's Leggings - shop after killing LC entry boss",
}),
DS3BossInfo("Dragonslayer Armour", 3010800, locations = {
"LC: Soul of Dragonslayer Armour",
"FS: Morne's Helm - shop after killing Eygon or LC boss",
"FS: Morne's Armor - shop after killing Eygon or LC boss",
"FS: Morne's Gauntlets - shop after killing Eygon or LC boss",
"FS: Morne's Leggings - shop after killing Eygon or LC boss",
"LC: Titanite Chunk - down stairs after boss",
}),
DS3BossInfo("Consumed King Oceiros", 3000830, locations = {
"CKG: Soul of Consumed Oceiros",
"CKG: Titanite Scale - tomb, chest #1",
"CKG: Titanite Scale - tomb, chest #2",
"CKG: Drakeblood Helm - tomb, after killing AP mausoleum NPC",
"CKG: Drakeblood Armor - tomb, after killing AP mausoleum NPC",
"CKG: Drakeblood Gauntlets - tomb, after killing AP mausoleum NPC",
"CKG: Drakeblood Leggings - tomb, after killing AP mausoleum NPC",
}),
DS3BossInfo("Champion Gundyr", 4000830, locations = {
"UG: Soul of Champion Gundyr",
"FS: Gundyr's Helm - shop after killing UG boss",
"FS: Gundyr's Armor - shop after killing UG boss",
"FS: Gundyr's Gauntlets - shop after killing UG boss",
"FS: Gundyr's Leggings - shop after killing UG boss",
"UG: Hornet Ring - environs, right of main path after killing FK boss",
"UG: Chaos Blade - environs, left of shrine",
"UG: Blacksmith Hammer - shrine, Andre's room",
"UG: Eyes of a Fire Keeper - shrine, Irina's room",
"UG: Coiled Sword Fragment - shrine, dead bonfire",
"UG: Soul of a Crestfallen Knight - environs, above shrine entrance",
"UG: Life Ring+3 - shrine, behind big throne",
"UG: Ring of Steel Protection+1 - environs, behind bell tower",
"FS: Ring of Sacrifice - Yuria shop",
"UG: Ember - shop",
"UG: Priestess Ring - shop",
"UG: Wolf Knight Helm - shop after killing FK boss",
"UG: Wolf Knight Armor - shop after killing FK boss",
"UG: Wolf Knight Gauntlets - shop after killing FK boss",
"UG: Wolf Knight Leggings - shop after killing FK boss",
}),
DS3BossInfo("Ancient Wyvern", 3200800),
DS3BossInfo("King of the Storm", 3200850, locations = {
"AP: Soul of the Nameless King",
"FS: Golden Crown - shop after killing AP boss",
"FS: Dragonscale Armor - shop after killing AP boss",
"FS: Golden Bracelets - shop after killing AP boss",
"FS: Dragonscale Waistcloth - shop after killing AP boss",
"AP: Titanite Slab - plaza",
"AP: Covetous Gold Serpent Ring+2 - plaza",
"AP: Dragonslayer Helm - plaza",
"AP: Dragonslayer Armor - plaza",
"AP: Dragonslayer Gauntlets - plaza",
"AP: Dragonslayer Leggings - plaza",
}),
DS3BossInfo("Nameless King", 3200851, locations = {
"AP: Soul of the Nameless King",
"FS: Golden Crown - shop after killing AP boss",
"FS: Dragonscale Armor - shop after killing AP boss",
"FS: Golden Bracelets - shop after killing AP boss",
"FS: Dragonscale Waistcloth - shop after killing AP boss",
"AP: Titanite Slab - plaza",
"AP: Covetous Gold Serpent Ring+2 - plaza",
"AP: Dragonslayer Helm - plaza",
"AP: Dragonslayer Armor - plaza",
"AP: Dragonslayer Gauntlets - plaza",
"AP: Dragonslayer Leggings - plaza",
}),
DS3BossInfo("Lothric, Younger Prince", 3410830, locations = {
"GA: Soul of the Twin Princes",
"GA: Cinders of a Lord - Lothric Prince",
}),
DS3BossInfo("Lorian, Elder Prince", 3410832, locations = {
"GA: Soul of the Twin Princes",
"GA: Cinders of a Lord - Lothric Prince",
"FS: Lorian's Helm - shop after killing GA boss",
"FS: Lorian's Armor - shop after killing GA boss",
"FS: Lorian's Gauntlets - shop after killing GA boss",
"FS: Lorian's Leggings - shop after killing GA boss",
}),
DS3BossInfo("Champion's Gravetender and Gravetender Greatwolf", 4500860, dlc = True,
locations = {"PW1: Valorheart - boss drop"}),
DS3BossInfo("Sister Friede", 4500801, dlc = True, locations = {
"PW2: Soul of Sister Friede",
"PW2: Titanite Slab - boss drop",
"PW1: Titanite Slab - Corvian",
"FS: Ordained Hood - shop after killing PW2 boss",
"FS: Ordained Dress - shop after killing PW2 boss",
"FS: Ordained Trousers - shop after killing PW2 boss",
}),
DS3BossInfo("Blackflame Friede", 4500800, dlc = True, locations = {
"PW2: Soul of Sister Friede",
"PW1: Titanite Slab - Corvian",
"FS: Ordained Hood - shop after killing PW2 boss",
"FS: Ordained Dress - shop after killing PW2 boss",
"FS: Ordained Trousers - shop after killing PW2 boss",
}),
DS3BossInfo("Demon Prince", 5000801, dlc = True, locations = {
"DH: Soul of the Demon Prince",
"DH: Small Envoy Banner - boss drop",
}),
DS3BossInfo("Halflight, Spear of the Church", 5100800, dlc = True, locations = {
"RC: Titanite Slab - mid boss drop",
"RC: Titanite Slab - ashes, NPC drop",
"RC: Titanite Slab - ashes, mob drop",
"RC: Filianore's Spear Ornament - mid boss drop",
"RC: Crucifix of the Mad King - ashes, NPC drop",
"RC: Shira's Crown - Shira's room after killing ashes NPC",
"RC: Shira's Armor - Shira's room after killing ashes NPC",
"RC: Shira's Gloves - Shira's room after killing ashes NPC",
"RC: Shira's Trousers - Shira's room after killing ashes NPC",
}),
DS3BossInfo("Darkeater Midir", 5100850, dlc = True, locations = {
"RC: Soul of Darkeater Midir",
"RC: Spears of the Church - hidden boss drop",
}),
DS3BossInfo("Slave Knight Gael 1", 5110801, dlc = True, locations = {
"RC: Soul of Slave Knight Gael",
"RC: Blood of the Dark Soul - end boss drop",
# These are accessible before you trigger the boss, but once you do you
# have to beat it before getting them.
"RC: Titanite Slab - ashes, mob drop",
"RC: Titanite Slab - ashes, NPC drop",
"RC: Sacred Chime of Filianore - ashes, NPC drop",
"RC: Crucifix of the Mad King - ashes, NPC drop",
"RC: Shira's Crown - Shira's room after killing ashes NPC",
"RC: Shira's Armor - Shira's room after killing ashes NPC",
"RC: Shira's Gloves - Shira's room after killing ashes NPC",
"RC: Shira's Trousers - Shira's room after killing ashes NPC",
}),
DS3BossInfo("Slave Knight Gael 2", 5110800, dlc = True, locations = {
"RC: Soul of Slave Knight Gael",
"RC: Blood of the Dark Soul - end boss drop",
# These are accessible before you trigger the boss, but once you do you
# have to beat it before getting them.
"RC: Titanite Slab - ashes, mob drop",
"RC: Titanite Slab - ashes, NPC drop",
"RC: Sacred Chime of Filianore - ashes, NPC drop",
"RC: Crucifix of the Mad King - ashes, NPC drop",
"RC: Shira's Crown - Shira's room after killing ashes NPC",
"RC: Shira's Armor - Shira's room after killing ashes NPC",
"RC: Shira's Gloves - Shira's room after killing ashes NPC",
"RC: Shira's Trousers - Shira's room after killing ashes NPC",
}),
DS3BossInfo("Lords of Cinder", 4100800, locations = {
"KFF: Soul of the Lords",
"FS: Billed Mask - Yuria after killing KFF boss",
"FS: Black Dress - Yuria after killing KFF boss",
"FS: Black Gauntlets - Yuria after killing KFF boss",
"FS: Black Leggings - Yuria after killing KFF boss"
}),
]
default_yhorm_location = DS3BossInfo("Yhorm the Giant", 3900800, locations = {
"PC: Soul of Yhorm the Giant",
"PC: Cinders of a Lord - Yhorm the Giant",
"PC: Siegbräu - Siegward after killing boss",
})

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,78 +1,80 @@
from dataclasses import dataclass
import json
from typing import Any, Dict
import typing
from Options import Choice, DeathLink, DefaultOnToggle, ExcludeLocations, NamedRange, OptionDict, \
OptionGroup, PerGameCommonOptions, Range, Removed, Toggle
## Game Options
from Options import Toggle, DefaultOnToggle, Option, Range, Choice, ItemDict, DeathLink
class EarlySmallLothricBanner(Choice):
"""Force Small Lothric Banner into an early sphere in your world or across all worlds."""
display_name = "Early Small Lothric Banner"
option_off = 0
option_early_global = 1
option_early_local = 2
default = option_off
class RandomizeWeaponLocations(DefaultOnToggle):
"""Randomizes weapons (+76 locations)"""
display_name = "Randomize Weapon Locations"
class LateBasinOfVowsOption(Choice):
"""Guarantee that you don't need to enter Lothric Castle until later in the run.
- **Off:** You may have to enter Lothric Castle and the areas beyond it immediately after High
Wall of Lothric.
- **After Small Lothric Banner:** You may have to enter Lothric Castle after Catacombs of
Carthus.
- **After Small Doll:** You won't have to enter Lothric Castle until after Irithyll of the
Boreal Valley.
"""
display_name = "Late Basin of Vows"
option_off = 0
alias_false = 0
option_after_small_lothric_banner = 1
alias_true = 1
option_after_small_doll = 2
class RandomizeShieldLocations(DefaultOnToggle):
"""Randomizes shields (+24 locations)"""
display_name = "Randomize Shield Locations"
class LateDLCOption(Choice):
"""Guarantee that you don't need to enter the DLC until later in the run.
- **Off:** You may have to enter the DLC after Catacombs of Carthus.
- **After Small Doll:** You may have to enter the DLC after Irithyll of the Boreal Valley.
- **After Basin:** You won't have to enter the DLC until after Lothric Castle.
"""
display_name = "Late DLC"
option_off = 0
alias_false = 0
option_after_small_doll = 1
alias_true = 1
option_after_basin = 2
class RandomizeArmorLocations(DefaultOnToggle):
"""Randomizes armor pieces (+97 locations)"""
display_name = "Randomize Armor Locations"
class EnableDLCOption(Toggle):
"""Include DLC locations, items, and enemies in the randomized pools.
To use this option, you must own both the "Ashes of Ariandel" and the "Ringed City" DLCs.
"""
display_name = "Enable DLC"
class RandomizeRingLocations(DefaultOnToggle):
"""Randomizes rings (+49 locations)"""
display_name = "Randomize Ring Locations"
class EnableNGPOption(Toggle):
"""Include items and locations exclusive to NG+ cycles."""
display_name = "Enable NG+"
class RandomizeSpellLocations(DefaultOnToggle):
"""Randomizes spells (+18 locations)"""
display_name = "Randomize Spell Locations"
## Equipment
class RandomizeStartingLoadout(DefaultOnToggle):
"""Randomizes the equipment characters begin with."""
display_name = "Randomize Starting Loadout"
class RandomizeKeyLocations(DefaultOnToggle):
"""Randomizes items which unlock doors or bypass barriers"""
display_name = "Randomize Key Locations"
class RequireOneHandedStartingWeapons(DefaultOnToggle):
"""Require starting equipment to be usable one-handed."""
display_name = "Require One-Handed Starting Weapons"
class RandomizeBossSoulLocations(DefaultOnToggle):
"""Randomizes Boss Souls (+18 Locations)"""
display_name = "Randomize Boss Soul Locations"
class RandomizeNPCLocations(Toggle):
"""Randomizes friendly NPC drops (meaning you will probably have to kill them) (+14 locations)"""
display_name = "Randomize NPC Locations"
class RandomizeMiscLocations(Toggle):
"""Randomizes miscellaneous items (ashes, tomes, scrolls, etc.) to the pool. (+36 locations)"""
display_name = "Randomize Miscellaneous Locations"
class RandomizeHealthLocations(Toggle):
"""Randomizes health upgrade items. (+21 locations)"""
display_name = "Randomize Health Upgrade Locations"
class RandomizeProgressiveLocationsOption(Toggle):
"""Randomizes upgrade materials and consumables such as the titanite shards, firebombs, resin, etc...
Instead of specific locations, these are progressive, so Titanite Shard #1 is the first titanite shard
you pick up, regardless of whether it's from an enemy drop late in the game or an item on the ground in the
first 5 minutes."""
display_name = "Randomize Progressive Locations"
class PoolTypeOption(Choice):
"""Changes which non-progression items you add to the pool
Shuffle: Items are picked from the locations being randomized
Various: Items are picked from a list of all items in the game, but are the same type of item they replace"""
display_name = "Pool Type"
option_shuffle = 0
option_various = 1
class GuaranteedItemsOption(ItemDict):
"""Guarantees that the specified items will be in the item pool"""
display_name = "Guaranteed Items"
class AutoEquipOption(Toggle):
@@ -81,56 +83,47 @@ class AutoEquipOption(Toggle):
class LockEquipOption(Toggle):
"""Lock the equipment slots so you cannot change your armor or your left/right weapons.
Works great with the Auto-equip option.
"""
"""Lock the equipment slots so you cannot change your armor or your left/right weapons. Works great with the
Auto-equip option."""
display_name = "Lock Equipment Slots"
class NoEquipLoadOption(Toggle):
"""Disable the equip load constraint from the game."""
display_name = "No Equip Load"
class NoWeaponRequirementsOption(Toggle):
"""Disable the weapon requirements by removing any movement or damage penalties, permitting you
to use any weapon early.
"""
"""Disable the weapon requirements by removing any movement or damage penalties.
Permitting you to use any weapon early"""
display_name = "No Weapon Requirements"
class NoSpellRequirementsOption(Toggle):
"""Disable the spell requirements permitting you to use any spell."""
"""Disable the spell requirements permitting you to use any spell"""
display_name = "No Spell Requirements"
## Weapons
class NoEquipLoadOption(Toggle):
"""Disable the equip load constraint from the game"""
display_name = "No Equip Load"
class RandomizeInfusionOption(Toggle):
"""Enable this option to infuse a percentage of the pool of weapons and shields."""
display_name = "Randomize Infusion"
class RandomizeInfusionPercentageOption(NamedRange):
"""The percentage of weapons/shields in the pool to be infused if Randomize Infusion is toggled.
"""
class RandomizeInfusionPercentageOption(Range):
"""The percentage of weapons/shields in the pool to be infused if Randomize Infusion is toggled"""
display_name = "Percentage of Infused Weapons"
range_start = 0
range_end = 100
default = 33
# 3/155 weapons are infused in the base game, or about 2%
special_range_names = {"similar to base game": 2}
class RandomizeWeaponLevelOption(Choice):
"""Enable this option to upgrade a percentage of the pool of weapons to a random value between
the minimum and maximum levels defined.
"""Enable this option to upgrade a percentage of the pool of weapons to a random value between the minimum and
maximum levels defined.
- **All:** All weapons are eligible, both basic and epic
- **Basic:** Only weapons that can be upgraded to +10
- **Epic:** Only weapons that can be upgraded to +5
"""
All: All weapons are eligible, both basic and epic
Basic: Only weapons that can be upgraded to +10
Epic: Only weapons that can be upgraded to +5"""
display_name = "Randomize Weapon Level"
option_none = 0
option_all = 1
@@ -139,7 +132,7 @@ class RandomizeWeaponLevelOption(Choice):
class RandomizeWeaponLevelPercentageOption(Range):
"""The percentage of weapons in the pool to be upgraded if randomize weapons level is toggled."""
"""The percentage of weapons in the pool to be upgraded if randomize weapons level is toggled"""
display_name = "Percentage of Randomized Weapons"
range_start = 0
range_end = 100
@@ -147,7 +140,7 @@ class RandomizeWeaponLevelPercentageOption(Range):
class MinLevelsIn5WeaponPoolOption(Range):
"""The minimum upgraded value of a weapon in the pool of weapons that can only reach +5."""
"""The minimum upgraded value of a weapon in the pool of weapons that can only reach +5"""
display_name = "Minimum Level of +5 Weapons"
range_start = 0
range_end = 5
@@ -155,7 +148,7 @@ class MinLevelsIn5WeaponPoolOption(Range):
class MaxLevelsIn5WeaponPoolOption(Range):
"""The maximum upgraded value of a weapon in the pool of weapons that can only reach +5."""
"""The maximum upgraded value of a weapon in the pool of weapons that can only reach +5"""
display_name = "Maximum Level of +5 Weapons"
range_start = 0
range_end = 5
@@ -163,7 +156,7 @@ class MaxLevelsIn5WeaponPoolOption(Range):
class MinLevelsIn10WeaponPoolOption(Range):
"""The minimum upgraded value of a weapon in the pool of weapons that can reach +10."""
"""The minimum upgraded value of a weapon in the pool of weapons that can reach +10"""
display_name = "Minimum Level of +10 Weapons"
range_start = 0
range_end = 10
@@ -171,308 +164,72 @@ class MinLevelsIn10WeaponPoolOption(Range):
class MaxLevelsIn10WeaponPoolOption(Range):
"""The maximum upgraded value of a weapon in the pool of weapons that can reach +10."""
"""The maximum upgraded value of a weapon in the pool of weapons that can reach +10"""
display_name = "Maximum Level of +10 Weapons"
range_start = 0
range_end = 10
default = 10
## Item Smoothing
class SmoothSoulItemsOption(DefaultOnToggle):
"""Distribute soul items in a similar order as the base game.
By default, soul items will be distributed totally randomly. If this is set, less valuable soul
items will generally appear in earlier spheres and more valuable ones will generally appear
later.
"""
display_name = "Smooth Soul Items"
class SmoothUpgradeItemsOption(DefaultOnToggle):
"""Distribute upgrade items in a similar order as the base game.
By default, upgrade items will be distributed totally randomly. If this is set, lower-level
upgrade items will generally appear in earlier spheres and higher-level ones will generally
appear later.
"""
display_name = "Smooth Upgrade Items"
class SmoothUpgradedWeaponsOption(DefaultOnToggle):
"""Distribute upgraded weapons in a similar order as the base game.
By default, upgraded weapons will be distributed totally randomly. If this is set, lower-level
weapons will generally appear in earlier spheres and higher-level ones will generally appear
later.
"""
display_name = "Smooth Upgraded Weapons"
### Enemies
class RandomizeEnemiesOption(DefaultOnToggle):
"""Randomize enemy and boss placements."""
display_name = "Randomize Enemies"
class SimpleEarlyBossesOption(DefaultOnToggle):
"""Avoid replacing Iudex Gundyr and Vordt with late bosses.
This excludes all bosses after Dancer of the Boreal Valley from these two boss fights. Disable
it for a chance at a much harder early game.
This is ignored unless enemies are randomized.
"""
display_name = "Simple Early Bosses"
class ScaleEnemiesOption(DefaultOnToggle):
"""Scale randomized enemy stats to match the areas in which they appear.
Disabling this will tend to make the early game much more difficult and the late game much
easier.
This is ignored unless enemies are randomized.
"""
display_name = "Scale Enemies"
class RandomizeMimicsWithEnemiesOption(Toggle):
"""Mix Mimics into the main enemy pool.
If this is enabled, Mimics will be replaced by normal enemies who drop the Mimic rewards on
death, and Mimics will be placed randomly in place of normal enemies. It's recommended to enable
Impatient Mimics as well if you enable this.
This is ignored unless enemies are randomized.
"""
display_name = "Randomize Mimics With Enemies"
class RandomizeSmallCrystalLizardsWithEnemiesOption(Toggle):
"""Mix small Crystal Lizards into the main enemy pool.
If this is enabled, Crystal Lizards will be replaced by normal enemies who drop the Crystal
Lizard rewards on death, and Crystal Lizards will be placed randomly in place of normal enemies.
This is ignored unless enemies are randomized.
"""
display_name = "Randomize Small Crystal Lizards With Enemies"
class ReduceHarmlessEnemiesOption(Toggle):
"""Reduce the frequency that "harmless" enemies appear.
Enable this to add a bit of extra challenge. This severely limits the number of enemies that are
slow to aggro, slow to attack, and do very little damage that appear in the enemy pool.
This is ignored unless enemies are randomized.
"""
display_name = "Reduce Harmless Enemies"
class AllChestsAreMimicsOption(Toggle):
"""Replace all chests with mimics that drop the same items.
If "Randomize Mimics With Enemies" is set, these chests will instead be replaced with random
enemies that drop the same items.
This is ignored unless enemies are randomized.
"""
display_name = "All Chests Are Mimics"
class ImpatientMimicsOption(Toggle):
"""Mimics attack as soon as you get close instead of waiting for you to open them.
This is ignored unless enemies are randomized.
"""
display_name = "Impatient Mimics"
class RandomEnemyPresetOption(OptionDict):
"""The YAML preset for the static enemy randomizer.
See the static randomizer documentation in `randomizer\\presets\\README.txt` for details.
Include this as nested YAML. For example:
.. code-block:: YAML
random_enemy_preset:
RemoveSource: Ancient Wyvern; Darkeater Midir
DontRandomize: Iudex Gundyr
"""
display_name = "Random Enemy Preset"
supports_weighting = False
default = {}
valid_keys = ["Description", "RecommendFullRandomization", "RecommendNoEnemyProgression",
"OopsAll", "Boss", "Miniboss", "Basic", "BuffBasicEnemiesAsBosses",
"DontRandomize", "RemoveSource", "Enemies"]
@classmethod
def get_option_name(cls, value: Dict[str, Any]) -> str:
return json.dumps(value)
## Item & Location
class DS3ExcludeLocations(ExcludeLocations):
"""Prevent these locations from having an important item."""
default = frozenset({"Hidden", "Small Crystal Lizards", "Upgrade", "Small Souls", "Miscellaneous"})
class ExcludedLocationBehaviorOption(Choice):
"""How to choose items for excluded locations in DS3.
- **Allow Useful:** Excluded locations can't have progression items, but they can have useful
items.
- **Forbid Useful:** Neither progression items nor useful items can be placed in excluded
locations.
- **Do Not Randomize:** Excluded locations always contain the same item as in vanilla Dark Souls
III.
A "progression item" is anything that's required to unlock another location in some game. A
"useful item" is something each game defines individually, usually items that are quite
desirable but not strictly necessary.
"""
display_name = "Excluded Locations Behavior"
option_allow_useful = 1
option_forbid_useful = 2
option_do_not_randomize = 3
default = 2
class MissableLocationBehaviorOption(Choice):
"""Which items can be placed in locations that can be permanently missed.
- **Allow Useful:** Missable locations can't have progression items, but they can have useful
items.
- **Forbid Useful:** Neither progression items nor useful items can be placed in missable
locations.
- **Do Not Randomize:** Missable locations always contain the same item as in vanilla Dark Souls
III.
A "progression item" is anything that's required to unlock another location in some game. A
"useful item" is something each game defines individually, usually items that are quite
desirable but not strictly necessary.
"""
display_name = "Missable Locations Behavior"
option_allow_useful = 1
option_forbid_useful = 2
option_do_not_randomize = 3
default = 2
@dataclass
class DarkSouls3Options(PerGameCommonOptions):
# Game Options
early_banner: EarlySmallLothricBanner
late_basin_of_vows: LateBasinOfVowsOption
late_dlc: LateDLCOption
death_link: DeathLink
enable_dlc: EnableDLCOption
enable_ngp: EnableNGPOption
# Equipment
random_starting_loadout: RandomizeStartingLoadout
require_one_handed_starting_weapons: RequireOneHandedStartingWeapons
auto_equip: AutoEquipOption
lock_equip: LockEquipOption
no_equip_load: NoEquipLoadOption
no_weapon_requirements: NoWeaponRequirementsOption
no_spell_requirements: NoSpellRequirementsOption
# Weapons
randomize_infusion: RandomizeInfusionOption
randomize_infusion_percentage: RandomizeInfusionPercentageOption
randomize_weapon_level: RandomizeWeaponLevelOption
randomize_weapon_level_percentage: RandomizeWeaponLevelPercentageOption
min_levels_in_5: MinLevelsIn5WeaponPoolOption
max_levels_in_5: MaxLevelsIn5WeaponPoolOption
min_levels_in_10: MinLevelsIn10WeaponPoolOption
max_levels_in_10: MaxLevelsIn10WeaponPoolOption
# Item Smoothing
smooth_soul_items: SmoothSoulItemsOption
smooth_upgrade_items: SmoothUpgradeItemsOption
smooth_upgraded_weapons: SmoothUpgradedWeaponsOption
# Enemies
randomize_enemies: RandomizeEnemiesOption
simple_early_bosses: SimpleEarlyBossesOption
scale_enemies: ScaleEnemiesOption
randomize_mimics_with_enemies: RandomizeMimicsWithEnemiesOption
randomize_small_crystal_lizards_with_enemies: RandomizeSmallCrystalLizardsWithEnemiesOption
reduce_harmless_enemies: ReduceHarmlessEnemiesOption
all_chests_are_mimics: AllChestsAreMimicsOption
impatient_mimics: ImpatientMimicsOption
random_enemy_preset: RandomEnemyPresetOption
# Item & Location
exclude_locations: DS3ExcludeLocations
excluded_location_behavior: ExcludedLocationBehaviorOption
missable_location_behavior: MissableLocationBehaviorOption
# Removed
pool_type: Removed
enable_weapon_locations: Removed
enable_shield_locations: Removed
enable_armor_locations: Removed
enable_ring_locations: Removed
enable_spell_locations: Removed
enable_key_locations: Removed
enable_boss_locations: Removed
enable_npc_locations: Removed
enable_misc_locations: Removed
enable_health_upgrade_locations: Removed
enable_progressive_locations: Removed
guaranteed_items: Removed
excluded_locations: Removed
missable_locations: Removed
option_groups = [
OptionGroup("Equipment", [
RandomizeStartingLoadout,
RequireOneHandedStartingWeapons,
AutoEquipOption,
LockEquipOption,
NoEquipLoadOption,
NoWeaponRequirementsOption,
NoSpellRequirementsOption,
]),
OptionGroup("Weapons", [
RandomizeInfusionOption,
RandomizeInfusionPercentageOption,
RandomizeWeaponLevelOption,
RandomizeWeaponLevelPercentageOption,
MinLevelsIn5WeaponPoolOption,
MaxLevelsIn5WeaponPoolOption,
MinLevelsIn10WeaponPoolOption,
MaxLevelsIn10WeaponPoolOption,
]),
OptionGroup("Item Smoothing", [
SmoothSoulItemsOption,
SmoothUpgradeItemsOption,
SmoothUpgradedWeaponsOption,
]),
OptionGroup("Enemies", [
RandomizeEnemiesOption,
SimpleEarlyBossesOption,
ScaleEnemiesOption,
RandomizeMimicsWithEnemiesOption,
RandomizeSmallCrystalLizardsWithEnemiesOption,
ReduceHarmlessEnemiesOption,
AllChestsAreMimicsOption,
ImpatientMimicsOption,
RandomEnemyPresetOption,
]),
OptionGroup("Item & Location Options", [
DS3ExcludeLocations,
ExcludedLocationBehaviorOption,
MissableLocationBehaviorOption,
])
]
class EarlySmallLothricBanner(Choice):
"""This option makes it so the user can choose to force the Small Lothric Banner into an early sphere in their world or
into an early sphere across all worlds."""
display_name = "Early Small Lothric Banner"
option_off = 0
option_early_global = 1
option_early_local = 2
default = option_off
class LateBasinOfVowsOption(Toggle):
"""This option makes it so the Basin of Vows is still randomized, but guarantees you that you wont have to venture into
Lothric Castle to find your Small Lothric Banner to get out of High Wall of Lothric. So you may find Basin of Vows early,
but you wont have to fight Dancer to find your Small Lothric Banner."""
display_name = "Late Basin of Vows"
class LateDLCOption(Toggle):
"""This option makes it so you are guaranteed to find your Small Doll without having to venture off into the DLC,
effectively putting anything in the DLC in logic after finding both Contraption Key and Small Doll,
and being able to get into Irithyll of the Boreal Valley."""
display_name = "Late DLC"
class EnableDLCOption(Toggle):
"""To use this option, you must own both the ASHES OF ARIANDEL and the RINGED CITY DLC"""
display_name = "Enable DLC"
dark_souls_options: typing.Dict[str, Option] = {
"enable_weapon_locations": RandomizeWeaponLocations,
"enable_shield_locations": RandomizeShieldLocations,
"enable_armor_locations": RandomizeArmorLocations,
"enable_ring_locations": RandomizeRingLocations,
"enable_spell_locations": RandomizeSpellLocations,
"enable_key_locations": RandomizeKeyLocations,
"enable_boss_locations": RandomizeBossSoulLocations,
"enable_npc_locations": RandomizeNPCLocations,
"enable_misc_locations": RandomizeMiscLocations,
"enable_health_upgrade_locations": RandomizeHealthLocations,
"enable_progressive_locations": RandomizeProgressiveLocationsOption,
"pool_type": PoolTypeOption,
"guaranteed_items": GuaranteedItemsOption,
"auto_equip": AutoEquipOption,
"lock_equip": LockEquipOption,
"no_weapon_requirements": NoWeaponRequirementsOption,
"randomize_infusion": RandomizeInfusionOption,
"randomize_infusion_percentage": RandomizeInfusionPercentageOption,
"randomize_weapon_level": RandomizeWeaponLevelOption,
"randomize_weapon_level_percentage": RandomizeWeaponLevelPercentageOption,
"min_levels_in_5": MinLevelsIn5WeaponPoolOption,
"max_levels_in_5": MaxLevelsIn5WeaponPoolOption,
"min_levels_in_10": MinLevelsIn10WeaponPoolOption,
"max_levels_in_10": MaxLevelsIn10WeaponPoolOption,
"early_banner": EarlySmallLothricBanner,
"late_basin_of_vows": LateBasinOfVowsOption,
"late_dlc": LateDLCOption,
"no_spell_requirements": NoSpellRequirementsOption,
"no_equip_load": NoEquipLoadOption,
"death_link": DeathLink,
"enable_dlc": EnableDLCOption,
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,97 +0,0 @@
# python -m worlds.dark_souls_3.detailed_location_descriptions \
# worlds/dark_souls_3/detailed_location_descriptions.py
#
# This script downloads the static randomizer's descriptions for each location and adds them to
# the location documentation.
from collections import defaultdict
import html
import os
import re
import requests
import yaml
from .Locations import location_dictionary
location_re = re.compile(r'^([A-Z0-9]+): (.*?)(?:$| - )')
if __name__ == '__main__':
# TODO: update this to the main branch of the main randomizer once Archipelago support is merged
url = 'https://raw.githubusercontent.com/nex3/SoulsRandomizers/archipelago-server/dist/Base/annotations.txt'
response = requests.get(url)
if response.status_code != 200:
raise Exception(f"Got {response.status_code} when downloading static randomizer locations")
annotations = yaml.load(response.text, Loader=yaml.Loader)
static_to_archi_regions = {
area['Name']: area['Archipelago']
for area in annotations['Areas']
}
descriptions_by_key = {slot['Key']: slot['Text'] for slot in annotations['Slots']}
# A map from (region, item name) pairs to all the descriptions that match those pairs.
descriptions_by_location = defaultdict(list)
# A map from item names to all the descriptions for those item names.
descriptions_by_item = defaultdict(list)
for slot in annotations['Slots']:
region = static_to_archi_regions[slot['Area']]
for item in slot['DebugText']:
name = item.split(" - ")[0]
descriptions_by_location[(region, name)].append(slot['Text'])
descriptions_by_item[name].append(slot['Text'])
counts_by_location = {
location: len(descriptions) for (location, descriptions) in descriptions_by_location.items()
}
location_names_to_descriptions = {}
for location in location_dictionary.values():
if location.ap_code is None: continue
if location.static:
location_names_to_descriptions[location.name] = descriptions_by_key[location.static]
continue
match = location_re.match(location.name)
if not match:
raise Exception(f"Location name \"{location.name}\" doesn't match expected format.")
item_candidates = descriptions_by_item[match[2]]
if len(item_candidates) == 1:
location_names_to_descriptions[location.name] = item_candidates[0]
continue
key = (match[1], match[2])
if key not in descriptions_by_location:
raise Exception(f'No static randomizer location found matching "{match[1]}: {match[2]}".')
candidates = descriptions_by_location[key]
if len(candidates) == 0:
raise Exception(
f'There are only {counts_by_location[key]} locations in the static randomizer ' +
f'matching "{match[1]}: {match[2]}", but there are more in Archipelago.'
)
location_names_to_descriptions[location.name] = candidates.pop(0)
table = "<table><tr><th>Location name</th><th>Detailed description</th>\n"
for (name, description) in sorted(
location_names_to_descriptions.items(),
key = lambda pair: pair[0]
):
table += f"<tr><td>{html.escape(name)}</td><td>{html.escape(description)}</td></tr>\n"
table += "</table>\n"
with open(os.path.join(os.path.dirname(__file__), 'docs/locations_en.md'), 'r+') as f:
original = f.read()
start_flag = "<!-- begin location table -->\n"
start = original.index(start_flag) + len(start_flag)
end = original.index("<!-- end location table -->")
f.seek(0)
f.write(original[:start] + table + original[end:])
f.truncate()
print("Updated docs/locations_en.md!")

View File

@@ -1,201 +1,28 @@
# Dark Souls III
Game Page | [Items] | [Locations]
[Items]: /tutorial/Dark%20Souls%20III/items/en
[Locations]: /tutorial/Dark%20Souls%20III/locations/en
## What do I need to do to randomize DS3?
See full instructions on [the setup page].
[the setup page]: /tutorial/Dark%20Souls%20III/setup/en
## Where is the options page?
The [player options page for this game][options] contains all the options you
need to configure and export a config file.
[options]: ../player-options
The [player options page for this game](../player-options) contains all the options you need to configure and export a
config file.
## What does randomization do to this game?
1. All item locations are randomized, including those in the overworld, in
shops, and dropped by enemies. Most locations can contain games from other
worlds, and any items from your world can appear in other players' worlds.
Items that can be picked up from static corpses, taken from chests, or earned from defeating enemies or NPCs can be
randomized. Common pickups like titanite shards or firebombs can be randomized as "progressive" items. That is, the
location "Titanite Shard #5" is the fifth titanite shard you pick up, no matter where it was from. This is also what
happens when you randomize Estus Shards and Undead Bone Shards.
2. By default, all enemies and bosses are randomized. This can be disabled by
setting "Randomize Enemies" to false.
It's also possible to randomize the upgrade level of weapons and shields as well as their infusions (if they can have
one). Additionally, there are options that can make the randomized experience more convenient or more interesting, such as
removing weapon requirements or auto-equipping whatever equipment you most recently received.
3. By default, the starting equipment for each class is randomized. This can be
disabled by setting "Randomize Starting Loadout" to false.
The goal is to find the four "Cinders of a Lord" items randomized into the multiworld and defeat the Soul of Cinder.
4. By setting the "Randomize Weapon Level" or "Randomize Infusion" options, you
can randomize whether the weapons you find will be upgraded or infused.
## What Dark Souls III items can appear in other players' worlds?
There are also options that can make playing the game more convenient or
bring a new experience, like removing equip loads or auto-equipping weapons as
you pick them up. Check out [the options page][options] for more!
Practically anything can be found in other worlds including pieces of armor, upgraded weapons, key items, consumables,
spells, upgrade materials, etc...
## What's the goal?
## What does another world's item look like in Dark Souls III?
Your goal is to find the four "Cinders of a Lord" items randomized into the
multiworld and defeat the boss in the Kiln of the First Flame.
## Do I have to check every item in every area?
Dark Souls III has about 1500 item locations, which is a lot of checks for a
single run! But you don't necessarily need to check all of them. Locations that
you can potentially miss, such as rewards for failable quests or soul
transposition items, will _never_ have items required for any game to progress.
The following types of locations are also guaranteed not to contain progression
items by default:
* **Hidden:** Locations that are particularly difficult to find, such as behind
illusory walls, down hidden drops, and so on. Does not include large locations
like Untended Graves or Archdragon Peak.
* **Small Crystal Lizards:** Drops from small crystal lizards.
* **Upgrade:** Locations that contain upgrade items in vanilla, including
titanite, gems, and Shriving Stones.
* **Small Souls:** Locations that contain soul items in vanilla, not including
boss souls.
* **Miscellaneous:** Locations that contain generic stackable items in vanilla,
such as arrows, firebombs, buffs, and so on.
You can customize which locations are guaranteed not to contain progression
items by setting the `exclude_locations` field in your YAML to the [location
groups] you want to omit. For example, this is the default setting but without
"Hidden" so that hidden locations can contain progression items:
[location groups]: /tutorial/Dark%20Souls%20III/locations/en#location-groups
```yaml
Dark Souls III:
exclude_locations:
- Small Crystal Lizards
- Upgrade
- Small Souls
- Miscellaneous
```
This allows _all_ non-missable locations to have progression items, if you're in
for the long haul:
```yaml
Dark Souls III:
exclude_locations: []
```
## What if I don't want to do the whole game?
If you want a shorter DS3 randomizer experience, you can exclude entire regions
from containing progression items. The items and enemies from those regions will
still be included in the randomization pool, but none of them will be mandatory.
For example, the following configuration just requires you to play the game
through Irithyll of the Boreal Valley:
```yaml
Dark Souls III:
# Enable the DLC so it's included in the randomization pool
enable_dlc: true
exclude_locations:
# Exclude late-game and DLC regions
- Anor Londo
- Lothric Castle
- Consumed King's Garden
- Untended Graves
- Grand Archives
- Archdragon Peak
- Painted World of Ariandel
- Dreg Heap
- Ringed City
# Default exclusions
- Hidden
- Small Crystal Lizards
- Upgrade
- Small Souls
- Miscellaneous
```
## Where can I learn more about Dark Souls III locations?
Location names have to pack a lot of information into very little space. To
better understand them, check out the [location guide], which explains all the
names used in locations and provides more detailed descriptions for each
individual location.
[location guide]: /tutorial/Dark%20Souls%20III/locations/en
## Where can I learn more about Dark Souls III items?
Check out the [item guide], which explains the named groups available for items.
[item guide]: /tutorial/Dark%20Souls%20III/items/en
## What's new from 2.x.x?
Version 3.0.0 of the Dark Souls III Archipelago client has a number of
substantial differences with the older 2.x.x versions. Improvements include:
* Support for randomizing all item locations, not just unique items.
* Support for randomizing items in shops, starting loadouts, Path of the Dragon,
and more.
* Built-in integration with the enemy randomizer, including consistent seeding
for races.
* Support for the latest patch for Dark Souls III, 1.15.2. Older patches are
*not* supported.
* Optional smooth distribution for upgrade items, upgraded weapons, and soul
items so you're more likely to see weaker items earlier and more powerful
items later.
* More detailed location names that indicate where a location is, not just what
it replaces.
* Other players' item names are visible in DS3.
* If you pick up items while static, they'll still send once you reconnect.
However, 2.x.x YAMLs are not compatible with 3.0.0. You'll need to [generate a
new YAML configuration] for use with 3.x.x.
[generating a new YAML configuration]: /games/Dark%20Souls%20III/player-options
The following options have been removed:
* `enable_boss_locations` is now controlled by the `soul_locations` option.
* `enable_progressive_locations` was removed because all locations are now
individually randomized rather than replaced with a progressive list.
* `pool_type` has been removed. Since there are no longer any non-randomized
items in randomized categories, there's not a meaningful distinction between
"shuffle" and "various" mode.
* `enable_*_locations` options have all been removed. Instead, you can now add
[location group names] to the `exclude_locations` option to prevent them from
containing important items.
[location group names]: /tutorial/Dark%20Souls%20III/locations/en#location-groups
By default, the Hidden, Small Crystal Lizards, Upgrade, Small Souls, and
Miscellaneous groups are in `exclude_locations`. Once you've chosen your
excluded locations, you can set `excluded_locations: unrandomized` to preserve
the default vanilla item placements for all excluded locations.
* `guaranteed_items`: In almost all cases, all items from the base game are now
included somewhere in the multiworld.
In addition, the following options have changed:
* The location names used in options like `exclude_locations` have changed. See
the [location guide] for a full description.
In Dark Souls III, items which are sent to other worlds appear as Prism Stones.

View File

@@ -1,24 +0,0 @@
# Dark Souls III Items
[Game Page] | Items | [Locations]
[Game Page]: /games/Dark%20Souls%20III/info/en
[Locations]: /tutorial/Dark%20Souls%20III/locations/en
## Item Groups
The Dark Souls III randomizer supports a number of item group names, which can
be used in YAML options like `local_items` to refer to many items at once:
* **Progression:** Items which unlock locations.
* **Cinders:** All four Cinders of a Lord. Once you have these four, you can
fight Soul of Cinder and win the game.
* **Miscellaneous:** Generic stackable items, such as arrows, firebombs, buffs,
and so on.
* **Unique:** Items that are unique per NG cycle, such as scrolls, keys, ashes,
and so on. Doesn't include equipment, spells, or souls.
* **Boss Souls:** Souls that can be traded with Ludleth, including Soul of
Rosaria.
* **Small Souls:** Soul items, not including boss souls.
* **Upgrade:** Upgrade items, including titanite, gems, and Shriving Stones.
* **Healing:** Undead Bone Shards and Estus Shards.

File diff suppressed because it is too large Load Diff

View File

@@ -7,49 +7,48 @@
## Optional Software
- Map tracker not yet updated for 3.0.0
- [Dark Souls III Maptracker Pack](https://github.com/Br00ty/DS3_AP_Maptracker/releases/latest), for use with [Poptracker](https://github.com/black-sliver/PopTracker/releases)
## Setting Up
## General Concept
First, download the client from the link above. It doesn't need to go into any particular directory;
it'll automatically locate _Dark Souls III_ in your Steam installation folder.
<span style="color:#ff7800">
**This mod can ban you permanently from the FromSoftware servers if used online.**
</span>
The Dark Souls III AP Client is a dinput8.dll triggered when launching Dark Souls III. This .dll file will launch a command
prompt where you can read information about your run and write any command to interact with the Archipelago server.
Version 3.0.0 of the randomizer _only_ supports the latest version of _Dark Souls III_, 1.15.2. This
is the latest version, so you don't need to do any downpatching! However, if you've already
downpatched your game to use an older version of the randomizer, you'll need to reinstall the latest
version before using this version.
This client has only been tested with the Official Steam version of the game at version 1.15. It does not matter which DLCs are installed. However, you will have to downpatch your Dark Souls III installation from current patch.
### One-Time Setup
## Downpatching Dark Souls III
Before you first connect to a multiworld, you need to generate the local data files for your world's
randomized item and (optionally) enemy locations. You only need to do this once per multiworld.
To downpatch DS3 for use with Archipelago, use the following instructions from the speedsouls wiki database.
1. Before you first connect to a multiworld, run `randomizer\DS3Randomizer.exe`.
1. Launch Steam (in online mode).
2. Press the Windows Key + R. This will open the Run window.
3. Open the Steam console by typing the following string: `steam://open/console`. Steam should now open in Console Mode.
4. Insert the string of the depot you wish to download. For the AP-supported v1.15, you will want to use: `download_depot 374320 374321 4471176929659548333`.
5. Steam will now download the depot. Note: There is no progress bar for the download in Steam, but it is still downloading in the background.
6. Back up your existing game executable (`DarkSoulsIII.exe`) found in `\Steam\steamapps\common\DARK SOULS III\Game`. Easiest way to do this is to move it to another directory. If you have file extensions enabled, you can instead rename the executable to `DarkSoulsIII.exe.bak`.
7. Return to the Steam console. Once the download is complete, it should say so along with the temporary local directory in which the depot has been stored. This is usually something like `\Steam\steamapps\content\app_XXXXXX\depot_XXXXXX`.
8. Take the `DarkSoulsIII.exe` from that folder and place it in `\Steam\steamapps\common\DARK SOULS III\Game`.
9. Back up and delete your save file (`DS30000.sl2`) in AppData. AppData is hidden by default. To locate it, press Windows Key + R, type `%appdata%` and hit enter. Alternatively: open File Explorer > View > Hidden Items and follow `C:\Users\<your_username>\AppData\Roaming\DarkSoulsIII\<numbers>`.
10. If you did all these steps correctly, you should be able to confirm your game version in the upper-left corner after launching Dark Souls III.
2. Put in your Archipelago room address (usually something like `archipelago.gg:12345`), your player
name (also known as your "slot name"), and your password if you have one.
3. Click "Load" and wait a minute or two.
## Installing the Archipelago mod
### Running and Connecting the Game
Get the `dinput8.dll` from the [Dark Souls III AP Client](https://github.com/Marechal-L/Dark-Souls-III-Archipelago-client/releases) and
add it at the root folder of your game (e.g. `SteamLibrary\steamapps\common\DARK SOULS III\Game`)
To run _Dark Souls III_ in Archipelago mode:
## Joining a MultiWorld Game
1. Start Steam. **Do not run in offline mode.** The mod will make sure you don't connect to the
DS3 servers, and running Steam in offline mode will make certain scripted invaders fail to spawn.
1. Run Steam in offline mode to avoid being banned.
2. Launch Dark Souls III.
3. Type in `/connect {SERVER_IP}:{SERVER_PORT} {SLOT_NAME} password:{PASSWORD}` in the "Windows Command Prompt" that opened. For example: `/connect archipelago.gg:38281 "Example Name" password:"Example Password"`. The password parameter is only necessary if your game requires one.
4. Once connected, create a new game, choose a class and wait for the others before starting.
5. You can quit and launch at anytime during a game.
2. Run `launchmod_darksouls3.bat`. This will start _Dark Souls III_ as well as a command prompt that
you can use to interact with the Archipelago server.
3. Type `/connect {SERVER_IP}:{SERVER_PORT} {SLOT_NAME}` into the command prompt, with the
appropriate values filled in. For example: `/connect archipelago.gg:24242 PlayerName`.
4. Start playing as normal. An "Archipelago connected" message will appear onscreen once you have
control of your character and the connection is established.
## Frequently Asked Questions
### Where do I get a config file?
## Where do I get a config file?
The [Player Options](/games/Dark%20Souls%20III/player-options) page on the website allows you to
configure your personal options and export them into a config file.

View File

@@ -1,27 +0,0 @@
from test.TestBase import WorldTestBase
from worlds.dark_souls_3.Items import item_dictionary
from worlds.dark_souls_3.Locations import location_tables
from worlds.dark_souls_3.Bosses import all_bosses
class DarkSouls3Test(WorldTestBase):
game = "Dark Souls III"
def testLocationDefaultItems(self):
for locations in location_tables.values():
for location in locations:
if location.default_item_name:
self.assertIn(location.default_item_name, item_dictionary)
def testLocationsUnique(self):
names = set()
for locations in location_tables.values():
for location in locations:
self.assertNotIn(location.name, names)
names.add(location.name)
def testBossLocations(self):
all_locations = {location.name for locations in location_tables.values() for location in locations}
for boss in all_bosses:
for location in boss.locations:
self.assertIn(location, all_locations)

View File

@@ -2,7 +2,7 @@
## Required Software
- [DOOM 1993 (e.g. Steam version)](https://store.steampowered.com/app/2280/DOOM__DOOM_II/)
- [DOOM 1993 (e.g. Steam version)](https://store.steampowered.com/app/2280/DOOM_1993/)
- [Archipelago Crispy DOOM](https://github.com/Daivuk/apdoom/releases)
## Optional Software

View File

@@ -2,7 +2,7 @@
## Required Software
- [DOOM II (e.g. Steam version)](https://store.steampowered.com/app/2280/DOOM__DOOM_II/)
- [DOOM II (e.g. Steam version)](https://store.steampowered.com/app/2300/DOOM_II/)
- [Archipelago Crispy DOOM](https://github.com/Daivuk/apdoom/releases)
## Optional Software

View File

@@ -660,18 +660,11 @@ 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 == 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
if 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."})

View File

@@ -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 != b'\x01' or check_2 != b'\x01':
if check_1 != b'01' or check_2 != b'01':
return
def get_range(data_range):

View File

@@ -216,7 +216,7 @@ def stage_set_rules(multiworld):
multiworld.worlds[player].options.accessibility == "minimal"]) * 3):
for player in no_enemies_players:
for location in vendor_locations:
if multiworld.worlds[player].options.accessibility == "full":
if multiworld.worlds[player].options.accessibility == "locations":
multiworld.get_location(location, player).progress_type = LocationProgressType.EXCLUDED
else:
multiworld.get_location(location, player).access_rule = lambda state: False

View File

@@ -25,25 +25,14 @@ from .Client import FFMQClient
class FFMQWebWorld(WebWorld):
setup_en = Tutorial(
tutorials = [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):

View File

@@ -1,8 +1,5 @@
# 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

View File

@@ -1,36 +0,0 @@
# 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).

View File

@@ -17,12 +17,6 @@ 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
@@ -81,7 +75,8 @@ Manually launch the SNI Client, and run the patched ROM in your chosen software
#### With an emulator
If this is the first time SNI launches, you may be prompted to allow it to communicate through the Windows Firewall.
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.
##### snes9x-rr
@@ -138,10 +133,10 @@ page: [usb2snes Supported Platforms Page](http://usb2snes.com/#supported-platfor
### Connect to the Archipelago Server
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 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.
The client will attempt to reconnect to the new server address, and should momentarily show "Server Status: Connected".

View File

@@ -1,178 +0,0 @@
# 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.
![Capture d'écran du menu Network Commands setting](/static/generated/docs/A%20Link%20to%20the%20Past/retroarch-network-commands-en.png)
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.

View File

@@ -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 `full`, `items`, and `minimal` and is set to `full` by default.
* `full` will guarantee all locations are accessible in your world.
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.
* `items` will guarantee you can acquire all logically relevant items in your world. Some items, such as keys, may
be self-locking. This value only exists in and affects some worlds.
be self-locking.
* `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.

View File

@@ -1,12 +1,10 @@
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, PerGameCommonOptions
from Options import Option, DefaultOnToggle, Toggle, Choice, Range, OptionDict, NamedRange, DeathLink
from .Charms import vanilla_costs, names as charm_names
if typing.TYPE_CHECKING:
@@ -405,20 +403,9 @@ 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
@@ -533,7 +520,7 @@ hollow_knight_options: typing.Dict[str, type(Option)] = {
**{
option.__name__: option
for option in (
StartLocation, Goal, GrubHuntGoal, WhitePalace, ExtraPlatforms, AddUnshuffledLocations, StartingGeo,
StartLocation, Goal, WhitePalace, ExtraPlatforms, AddUnshuffledLocations, StartingGeo,
DeathLink, DeathLinkShade, DeathLinkBreaksFragileCharms,
MinimumGeoPrice, MaximumGeoPrice,
MinimumGrubPrice, MaximumGrubPrice,
@@ -551,5 +538,3 @@ 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,))

View File

@@ -49,42 +49,3 @@ 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
)
)

View File

@@ -5,20 +5,19 @@ 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, _hk_can_beat_thk, _hk_siblings_ending, _hk_can_beat_radiance
from .Rules import set_rules, cost_terms
from .Options import hollow_knight_options, hollow_knight_randomize_options, Goal, WhitePalace, CostSanity, \
shop_to_option, HKOptions, GrubHuntGoal
shop_to_option
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, CollectionState
from BaseClasses import Region, Location, MultiWorld, Item, LocationProgressType, Tutorial, ItemClassification
from worlds.AutoWorld import World, LogicMixin, WebWorld
path_of_pain_locations = {
@@ -143,8 +142,7 @@ class HKWorld(World):
As the enigmatic Knight, youll traverse the depths, unravel its mysteries and conquer its evils.
""" # from https://www.hollowknight.com
game: str = "Hollow Knight"
options_dataclass = HKOptions
options: HKOptions
option_definitions = hollow_knight_options
web = HKWeb()
@@ -156,42 +154,40 @@ 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, multiworld, player):
super(HKWorld, self).__init__(multiworld, player)
def __init__(self, world, player):
super(HKWorld, self).__init__(world, 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):
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)
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)
for term, data in cost_terms.items():
mini = getattr(options, f"Minimum{data.option}Price")
maxi = getattr(options, f"Maximum{data.option}Price")
mini = getattr(world, f"Minimum{data.option}Price")[self.player]
maxi = getattr(world, f"Maximum{data.option}Price")[self.player]
# if minimum > maximum, set minimum to maximum
mini.value = min(mini.value, maxi.value)
self.ranges[term] = mini.value, maxi.value
self.multiworld.push_precollected(HKItem(starts[options.StartLocation.current_key],
world.push_precollected(HKItem(starts[world.StartLocation[self.player].current_key],
True, None, "Event", self.player))
def white_palace_exclusions(self):
exclusions = set()
wp = self.options.WhitePalace
wp = self.multiworld.WhitePalace[self.player]
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.options.RandomizeCharms:
if self.multiworld.RandomizeCharms[self.player]:
# 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)
@@ -204,7 +200,7 @@ class HKWorld(World):
# check for any goal that godhome events are relevant to
all_event_names = event_names.copy()
if self.options.Goal in [Goal.option_godhome, Goal.option_godhome_flower, Goal.option_any]:
if self.multiworld.Goal[self.player] in [Goal.option_godhome, Goal.option_godhome_flower]:
from .GodhomeData import godhome_event_names
all_event_names.update(set(godhome_event_names))
@@ -234,12 +230,12 @@ class HKWorld(World):
pool: typing.List[HKItem] = []
wp_exclusions = self.white_palace_exclusions()
junk_replace: typing.Set[str] = set()
if self.options.RemoveSpellUpgrades:
if self.multiworld.RemoveSpellUpgrades[self.player]:
junk_replace.update(("Abyss_Shriek", "Shade_Soul", "Descending_Dark"))
randomized_starting_items = set()
for attr, items in randomizable_starting_items.items():
if getattr(self.options, attr):
if getattr(self.multiworld, attr)[self.player]:
randomized_starting_items.update(items)
# noinspection PyShadowingNames
@@ -261,7 +257,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.options.AddUnshuffledLocations else self.create_event(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)
if location_name == "Start":
if item_name in randomized_starting_items:
@@ -285,55 +281,55 @@ class HKWorld(World):
location.progress_type = LocationProgressType.EXCLUDED
for option_key, option in hollow_knight_randomize_options.items():
randomized = getattr(self.options, option_key)
if all([not randomized, option_key in logicless_options, not self.options.AddUnshuffledLocations]):
randomized = getattr(self.multiworld, option_key)[self.player]
if all([not randomized, option_key in logicless_options, not self.multiworld.AddUnshuffledLocations[self.player]]):
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.options.SplitCrystalHeart) or \
(item_name == "Mothwing_Cloak" and self.options.SplitMothwingCloak):
if (item_name == "Crystal_Heart" and self.multiworld.SplitCrystalHeart[self.player]) or \
(item_name == "Mothwing_Cloak" and self.multiworld.SplitMothwingCloak[self.player]):
_add("Left_" + item_name, location_name, randomized)
_add("Right_" + item_name, "Split_" + location_name, randomized)
continue
if item_name == "Mantis_Claw" and self.options.SplitMantisClaw:
if item_name == "Mantis_Claw" and self.multiworld.SplitMantisClaw[self.player]:
_add("Left_" + item_name, "Left_" + location_name, randomized)
_add("Right_" + item_name, "Right_" + location_name, randomized)
continue
if item_name == "Shade_Cloak" and self.options.SplitMothwingCloak:
if self.random.randint(0, 1):
if item_name == "Shade_Cloak" and self.multiworld.SplitMothwingCloak[self.player]:
if self.multiworld.random.randint(0, 1):
item_name = "Left_Mothwing_Cloak"
else:
item_name = "Right_Mothwing_Cloak"
if item_name == "Grimmchild2" and self.options.RandomizeGrimmkinFlames and self.options.RandomizeCharms:
if item_name == "Grimmchild2" and self.multiworld.RandomizeGrimmkinFlames[self.player] and self.multiworld.RandomizeCharms[self.player]:
_add("Grimmchild1", location_name, randomized)
continue
_add(item_name, location_name, randomized)
if self.options.RandomizeElevatorPass:
if self.multiworld.RandomizeElevatorPass[self.player]:
randomized = True
_add("Elevator_Pass", "Elevator_Pass", randomized)
for shop, locations in self.created_multi_locations.items():
for _ in range(len(locations), getattr(self.options, shop_to_option[shop]).value):
for _ in range(len(locations), getattr(self.multiworld, shop_to_option[shop])[self.player].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.options.ExtraShopSlots.value)
additional_shop_items = max(item_count - unfilled_locations, self.multiworld.ExtraShopSlots[self.player].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.options.EggShopSlots: # No eggshop, so don't place items there
if not self.multiworld.EggShopSlots[self.player].value: # No eggshop, so don't place items there
shops.remove('Egg_Shop')
if shops:
for _ in range(additional_shop_items):
shop = self.random.choice(shops)
shop = self.multiworld.random.choice(shops)
loc = self.create_location(shop)
unfilled_locations += 1
if len(self.created_multi_locations[shop]) >= 16:
@@ -359,7 +355,7 @@ class HKWorld(World):
loc.costs = costs
def apply_costsanity(self):
setting = self.options.CostSanity.value
setting = self.multiworld.CostSanity[self.player].value
if not setting:
return # noop
@@ -373,10 +369,10 @@ class HKWorld(World):
return {k: v for k, v in weights.items() if v}
random = self.random
hybrid_chance = getattr(self.options, f"CostSanityHybridChance").value
random = self.multiworld.random
hybrid_chance = getattr(self.multiworld, f"CostSanityHybridChance")[self.player].value
weights = {
data.term: getattr(self.options, f"CostSanity{data.option}Weight").value
data.term: getattr(self.multiworld, f"CostSanity{data.option}Weight")[self.player].value
for data in cost_terms.values()
}
weights_geoless = dict(weights)
@@ -431,86 +427,31 @@ class HKWorld(World):
location.sort_costs()
def set_rules(self):
multiworld = self.multiworld
world = self.multiworld
player = self.player
goal = self.options.Goal
goal = world.Goal[player]
if goal == Goal.option_hollowknight:
multiworld.completion_condition[player] = lambda state: _hk_can_beat_thk(state, player)
world.completion_condition[player] = lambda state: state._hk_can_beat_thk(player)
elif goal == Goal.option_siblings:
multiworld.completion_condition[player] = lambda state: _hk_siblings_ending(state, player)
world.completion_condition[player] = lambda state: state._hk_siblings_ending(player)
elif goal == Goal.option_radiance:
multiworld.completion_condition[player] = lambda state: _hk_can_beat_radiance(state, player)
world.completion_condition[player] = lambda state: state._hk_can_beat_radiance(player)
elif goal == Goal.option_godhome:
multiworld.completion_condition[player] = lambda state: state.count("Defeated_Pantheon_5", player)
world.completion_condition[player] = lambda state: state.count("Defeated_Pantheon_5", player)
elif goal == Goal.option_godhome_flower:
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()
world.completion_condition[player] = lambda state: state.count("Godhome_Flower_Quest", player)
else:
# Any goal
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)
world.completion_condition[player] = lambda state: state._hk_can_beat_thk(player) or state._hk_can_beat_radiance(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 worlds 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 hollow_knight_options:
option = getattr(self.options, option_name)
for option_name in self.option_definitions:
option = getattr(self.multiworld, option_name)[self.player]
try:
optionvalue = int(option.value)
except TypeError:
@@ -519,10 +460,10 @@ class HKWorld(World):
options[option_name] = optionvalue
# 32 bit int
slot_data["seed"] = self.random.randint(-2147483647, 2147483646)
slot_data["seed"] = self.multiworld.per_slot_randoms[self.player].randint(-2147483647, 2147483646)
# Backwards compatibility for shop cost data (HKAP < 0.1.0)
if not self.options.CostSanity:
if not self.multiworld.CostSanity[self.player]:
for shop, terms in shop_cost_types.items():
unit = cost_terms[next(iter(terms))].option
if unit == "Geo":
@@ -542,8 +483,6 @@ 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:
@@ -559,7 +498,7 @@ class HKWorld(World):
basename = name
if name in shop_cost_types:
costs = {
term: self.random.randint(*self.ranges[term])
term: self.multiworld.random.randint(*self.ranges[term])
for term in shop_cost_types[name]
}
elif name in vanilla_location_costs:
@@ -573,7 +512,7 @@ class HKWorld(World):
region = self.multiworld.get_region("Menu", self.player)
if vanilla and not self.options.AddUnshuffledLocations:
if vanilla and not self.multiworld.AddUnshuffledLocations[self.player]:
loc = HKLocation(self.player, name,
None, region, costs=costs, vanilla=vanilla,
basename=basename)
@@ -621,26 +560,26 @@ class HKWorld(World):
return change
@classmethod
def stage_write_spoiler(cls, multiworld: MultiWorld, spoiler_handle):
hk_players = multiworld.get_game_players(cls.game)
def stage_write_spoiler(cls, world: MultiWorld, spoiler_handle):
hk_players = world.get_game_players(cls.game)
spoiler_handle.write('\n\nCharm Notches:')
for player in hk_players:
name = multiworld.get_player_name(player)
name = world.get_player_name(player)
spoiler_handle.write(f'\n{name}\n')
hk_world: HKWorld = multiworld.worlds[player]
hk_world: HKWorld = world.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 = multiworld.get_player_name(player)
name = world.get_player_name(player)
spoiler_handle.write(f'\n{name}\n')
hk_world: HKWorld = multiworld.worlds[player]
hk_world: HKWorld = world.worlds[player]
if hk_world.options.CostSanity:
if world.CostSanity[player].value:
for loc in sorted(
(
loc for loc in itertools.chain(*(region.locations for region in multiworld.get_regions(player)))
loc for loc in itertools.chain(*(region.locations for region in world.get_regions(player)))
if loc.costs
), key=operator.attrgetter('name')
):
@@ -664,15 +603,15 @@ class HKWorld(World):
'RandomizeGeoRocks', 'RandomizeSoulTotems', 'RandomizeLoreTablets', 'RandomizeJunkPitChests',
'RandomizeRancidEggs'
):
if getattr(self.options, group):
if getattr(self.multiworld, 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.random.choice(self.cached_filler_items[self.player])
return self.multiworld.random.choice(self.cached_filler_items[self.player])
def create_region(multiworld: MultiWorld, player: int, name: str, location_names=None) -> Region:
ret = Region(name, player, multiworld)
def create_region(world: MultiWorld, player: int, name: str, location_names=None) -> Region:
ret = Region(name, player, world)
if location_names:
for location in location_names:
loc_id = HKWorld.location_name_to_id.get(location, None)
@@ -745,7 +684,42 @@ 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.worlds[player].options, option_name).value
return getattr(self.multiworld, option_name)[player].value
def _hk_start(self, player, start_location: str) -> bool:
return self.multiworld.worlds[player].options.StartLocation == start_location
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
)
)

View File

@@ -1,25 +1,22 @@
# 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) 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`
`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`
- Needed for Archipelago
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`
3. `Install the mod KH2FM-Mods-Num/GoA-ROM-Edition using OpenKH Mod Manager`<br>
- 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>
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>
@@ -27,7 +24,6 @@ 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>
@@ -37,33 +33,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>
![image](https://i.imgur.com/Si4oZ8w.png)
<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>
![image](https://i.imgur.com/qP6CmV8.png)
<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. ![image](https://i.imgur.com/ABSdtPC.png)
- Pressing F2 while in game should look like this. ![image](https://i.imgur.com/ABSdtPC.png)
<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.
- 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.
- 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>
@@ -74,11 +70,8 @@ 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?
@@ -90,13 +83,11 @@ 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 the `only` supported versions are `Epic Games Version 1.0.0.9_WW` and `Steam Build Version 14716933`.
- Currently `only` the most up to date version on the Epic Game Store is supported: version `1.0.0.8_WW`.
- 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
@@ -108,3 +99,5 @@ 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.

View File

@@ -1556,8 +1556,6 @@
room: Owl Hallway
door: Shortcut to Hedge Maze
Roof: True
The Incomparable:
door: Observant Entrance
panels:
DOWN:
id: Maze Room/Panel_down_up
@@ -1969,9 +1967,6 @@
door: Eight Door
Orange Tower Sixth Floor:
painting: True
Hedge Maze:
room: Hedge Maze
door: Observant Entrance
panels:
Achievement:
id: Countdown Panels/Panel_incomparable_incomparable
@@ -7654,8 +7649,6 @@
LEAP:
id: Double Room/Panel_leap_leap
tag: midwhite
required_door:
door: Door to Cross
doors:
Door to Cross:
id: Double Room Area Doors/Door_room_4a

Binary file not shown.

View File

@@ -3,15 +3,15 @@ from typing import Dict
from schema import And, Optional, Or, Schema
from Options import Choice, DeathLinkMixin, DefaultOnToggle, ItemsAccessibility, OptionDict, PerGameCommonOptions, \
from Options import Accessibility, Choice, DeathLinkMixin, DefaultOnToggle, OptionDict, PerGameCommonOptions, \
PlandoConnections, Range, StartInventoryPool, Toggle, Visibility
from .portals import CHECKPOINTS, PORTALS, SHOP_POINTS
class MessengerAccessibility(ItemsAccessibility):
class MessengerAccessibility(Accessibility):
default = Accessibility.option_locations
# defaulting to locations accessibility since items makes certain items self-locking
default = ItemsAccessibility.option_full
__doc__ = ItemsAccessibility.__doc__
__doc__ = Accessibility.__doc__.replace(f"default {Accessibility.default}", f"default {default}")
class PortalPlando(PlandoConnections):

View File

@@ -29,7 +29,7 @@ name: TuNombre
game: Minecraft
# Opciones compartidas por todos los juegos:
accessibility: full
accessibility: locations
progression_balancing: 50
# Opciones Especficicas para Minecraft

View File

@@ -79,7 +79,7 @@ description: Template Name
# Ditt spelnamn. Mellanslag kommer bli omplacerad med understräck och det är en 16-karaktärsgräns.
name: YourName
game: Minecraft
accessibility: full
accessibility: locations
progression_balancing: 0
advancement_goal:
few: 0

View File

@@ -1,85 +0,0 @@
import typing
from BaseClasses import Item, ItemClassification
from .Names import ItemNames
class ItemRow(typing.NamedTuple):
name: str
amount: int
progression: ItemClassification
class OSRSItem(Item):
game: str = "Old School Runescape"
QP_Items: typing.List[str] = [
ItemNames.QP_Cooks_Assistant,
ItemNames.QP_Demon_Slayer,
ItemNames.QP_Restless_Ghost,
ItemNames.QP_Romeo_Juliet,
ItemNames.QP_Sheep_Shearer,
ItemNames.QP_Shield_of_Arrav,
ItemNames.QP_Ernest_the_Chicken,
ItemNames.QP_Vampyre_Slayer,
ItemNames.QP_Imp_Catcher,
ItemNames.QP_Prince_Ali_Rescue,
ItemNames.QP_Dorics_Quest,
ItemNames.QP_Black_Knights_Fortress,
ItemNames.QP_Witchs_Potion,
ItemNames.QP_Knights_Sword,
ItemNames.QP_Goblin_Diplomacy,
ItemNames.QP_Pirates_Treasure,
ItemNames.QP_Rune_Mysteries,
ItemNames.QP_Misthalin_Mystery,
ItemNames.QP_Corsair_Curse,
ItemNames.QP_X_Marks_the_Spot,
ItemNames.QP_Below_Ice_Mountain
]
starting_area_dict: typing.Dict[int, str] = {
0: ItemNames.Lumbridge,
1: ItemNames.Al_Kharid,
2: ItemNames.Central_Varrock,
3: ItemNames.West_Varrock,
4: ItemNames.Edgeville,
5: ItemNames.Falador,
6: ItemNames.Draynor_Village,
7: ItemNames.Wilderness,
}
chunksanity_starting_chunks: typing.List[str] = [
ItemNames.Lumbridge,
ItemNames.Lumbridge_Swamp,
ItemNames.Lumbridge_Farms,
ItemNames.HAM_Hideout,
ItemNames.Draynor_Village,
ItemNames.Draynor_Manor,
ItemNames.Wizards_Tower,
ItemNames.Al_Kharid,
ItemNames.Citharede_Abbey,
ItemNames.South_Of_Varrock,
ItemNames.Central_Varrock,
ItemNames.Varrock_Palace,
ItemNames.East_Of_Varrock,
ItemNames.West_Varrock,
ItemNames.Edgeville,
ItemNames.Barbarian_Village,
ItemNames.Monastery,
ItemNames.Ice_Mountain,
ItemNames.Dwarven_Mines,
ItemNames.Falador,
ItemNames.Falador_Farm,
ItemNames.Crafting_Guild,
ItemNames.Rimmington,
ItemNames.Port_Sarim,
ItemNames.Mudskipper_Point,
ItemNames.Wilderness
]
# Some starting areas contain multiple regions, so if that area is rolled for Chunksanity, we need to map it to one
chunksanity_special_region_names: typing.Dict[str, str] = {
ItemNames.Lumbridge_Farms: 'Lumbridge Farms East',
ItemNames.Crafting_Guild: 'Crafting Guild Outskirts',
}

View File

@@ -1,21 +0,0 @@
import typing
from BaseClasses import Location
class SkillRequirement(typing.NamedTuple):
skill: str
level: int
class LocationRow(typing.NamedTuple):
name: str
category: str
regions: typing.List[str]
skills: typing.List[SkillRequirement]
items: typing.List[str]
qp: int
class OSRSLocation(Location):
game: str = "Old School Runescape"

View File

@@ -1,144 +0,0 @@
"""
This is a utility file that converts logic in the form of CSV files into Python files that can be imported and used
directly by the world implementation. Whenever the logic files are updated, this script should be run to re-generate
the python files containing the data.
"""
import requests
# The CSVs are updated at this repository to be shared between generator and client.
data_repository_address = "https://raw.githubusercontent.com/digiholic/osrs-archipelago-logic/"
# The Github tag of the CSVs this was generated with
data_csv_tag = "v1.5"
if __name__ == "__main__":
import sys
import os
import csv
import typing
# makes this module runnable from its world folder. Shamelessly stolen from Subnautica
sys.path.remove(os.path.dirname(__file__))
new_home = os.path.normpath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
os.chdir(new_home)
sys.path.append(new_home)
def load_location_csv():
this_dir = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(this_dir, "locations_generated.py"), 'w+') as locPyFile:
locPyFile.write('"""\nThis file was auto generated by LogicCSVToPython.py\n"""\n')
locPyFile.write("from ..Locations import LocationRow, SkillRequirement\n")
locPyFile.write("\n")
locPyFile.write("location_rows = [\n")
with requests.get(data_repository_address + "/" + data_csv_tag + "/locations.csv") as req:
locations_reader = csv.reader(req.text.splitlines())
for row in locations_reader:
row_line = "LocationRow("
row_line += str_format(row[0])
row_line += str_format(row[1].lower())
region_strings = row[2].split(", ") if row[2] else []
row_line += f"{str_list_to_py(region_strings)}, "
skill_strings = row[3].split(", ")
row_line += "["
if skill_strings:
split_skills = [skill.split(" ") for skill in skill_strings if skill != ""]
if split_skills:
for split in split_skills:
row_line += f"SkillRequirement('{split[0]}', {split[1]}), "
row_line += "], "
item_strings = row[4].split(", ") if row[4] else []
row_line += f"{str_list_to_py(item_strings)}, "
row_line += f"{row[5]})" if row[5] != "" else "0)"
locPyFile.write(f"\t{row_line},\n")
locPyFile.write("]\n")
def load_region_csv():
this_dir = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(this_dir, "regions_generated.py"), 'w+') as regPyFile:
regPyFile.write('"""\nThis file was auto generated by LogicCSVToPython.py\n"""\n')
regPyFile.write("from ..Regions import RegionRow\n")
regPyFile.write("\n")
regPyFile.write("region_rows = [\n")
with requests.get(data_repository_address + "/" + data_csv_tag + "/regions.csv") as req:
regions_reader = csv.reader(req.text.splitlines())
for row in regions_reader:
row_line = "RegionRow("
row_line += str_format(row[0])
row_line += str_format(row[1])
connections = row[2].replace("'", "\\'")
row_line += f"{str_list_to_py(connections.split(', '))}, "
resources = row[3].replace("'", "\\'")
row_line += f"{str_list_to_py(resources.split(', '))})"
regPyFile.write(f"\t{row_line},\n")
regPyFile.write("]\n")
def load_resource_csv():
this_dir = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(this_dir, "resources_generated.py"), 'w+') as resPyFile:
resPyFile.write('"""\nThis file was auto generated by LogicCSVToPython.py\n"""\n')
resPyFile.write("from ..Regions import ResourceRow\n")
resPyFile.write("\n")
resPyFile.write("resource_rows = [\n")
with requests.get(data_repository_address + "/" + data_csv_tag + "/resources.csv") as req:
resource_reader = csv.reader(req.text.splitlines())
for row in resource_reader:
name = row[0].replace("'", "\\'")
row_line = f"ResourceRow('{name}')"
resPyFile.write(f"\t{row_line},\n")
resPyFile.write("]\n")
def load_item_csv():
this_dir = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(this_dir, "items_generated.py"), 'w+') as itemPyfile:
itemPyfile.write('"""\nThis file was auto generated by LogicCSVToPython.py\n"""\n')
itemPyfile.write("from BaseClasses import ItemClassification\n")
itemPyfile.write("from ..Items import ItemRow\n")
itemPyfile.write("\n")
itemPyfile.write("item_rows = [\n")
with requests.get(data_repository_address + "/" + data_csv_tag + "/items.csv") as req:
item_reader = csv.reader(req.text.splitlines())
for row in item_reader:
row_line = "ItemRow("
row_line += str_format(row[0])
row_line += f"{row[1]}, "
row_line += f"ItemClassification.{row[2]})"
itemPyfile.write(f"\t{row_line},\n")
itemPyfile.write("]\n")
def str_format(s) -> str:
ret_str = s.replace("'", "\\'")
return f"'{ret_str}', "
def str_list_to_py(str_list) -> str:
ret_str = "["
for s in str_list:
ret_str += f"'{s}', "
ret_str += "]"
return ret_str
load_location_csv()
print("Generated locations py")
load_region_csv()
print("Generated regions py")
load_resource_csv()
print("Generated resource py")
load_item_csv()
print("Generated item py")

View File

@@ -1,43 +0,0 @@
"""
This file was auto generated by LogicCSVToPython.py
"""
from BaseClasses import ItemClassification
from ..Items import ItemRow
item_rows = [
ItemRow('Area: Lumbridge', 1, ItemClassification.progression),
ItemRow('Area: Lumbridge Swamp', 1, ItemClassification.progression),
ItemRow('Area: HAM Hideout', 1, ItemClassification.progression),
ItemRow('Area: Lumbridge Farms', 1, ItemClassification.progression),
ItemRow('Area: South of Varrock', 1, ItemClassification.progression),
ItemRow('Area: East Varrock', 1, ItemClassification.progression),
ItemRow('Area: Central Varrock', 1, ItemClassification.progression),
ItemRow('Area: Varrock Palace', 1, ItemClassification.progression),
ItemRow('Area: West Varrock', 1, ItemClassification.progression),
ItemRow('Area: Edgeville', 1, ItemClassification.progression),
ItemRow('Area: Barbarian Village', 1, ItemClassification.progression),
ItemRow('Area: Draynor Manor', 1, ItemClassification.progression),
ItemRow('Area: Falador', 1, ItemClassification.progression),
ItemRow('Area: Dwarven Mines', 1, ItemClassification.progression),
ItemRow('Area: Ice Mountain', 1, ItemClassification.progression),
ItemRow('Area: Monastery', 1, ItemClassification.progression),
ItemRow('Area: Falador Farms', 1, ItemClassification.progression),
ItemRow('Area: Port Sarim', 1, ItemClassification.progression),
ItemRow('Area: Mudskipper Point', 1, ItemClassification.progression),
ItemRow('Area: Karamja', 1, ItemClassification.progression),
ItemRow('Area: Crandor', 1, ItemClassification.progression),
ItemRow('Area: Rimmington', 1, ItemClassification.progression),
ItemRow('Area: Crafting Guild', 1, ItemClassification.progression),
ItemRow('Area: Draynor Village', 1, ItemClassification.progression),
ItemRow('Area: Wizard Tower', 1, ItemClassification.progression),
ItemRow('Area: Corsair Cove', 1, ItemClassification.progression),
ItemRow('Area: Al Kharid', 1, ItemClassification.progression),
ItemRow('Area: Citharede Abbey', 1, ItemClassification.progression),
ItemRow('Area: Wilderness', 1, ItemClassification.progression),
ItemRow('Progressive Armor', 6, ItemClassification.progression),
ItemRow('Progressive Weapons', 6, ItemClassification.progression),
ItemRow('Progressive Tools', 6, ItemClassification.useful),
ItemRow('Progressive Ranged Weapons', 3, ItemClassification.useful),
ItemRow('Progressive Ranged Armor', 3, ItemClassification.useful),
ItemRow('Progressive Magic', 2, ItemClassification.useful),
]

View File

@@ -1,127 +0,0 @@
"""
This file was auto generated by LogicCSVToPython.py
"""
from ..Locations import LocationRow, SkillRequirement
location_rows = [
LocationRow('Quest: Cook\'s Assistant', 'quest', ['Lumbridge', 'Wheat', 'Windmill', 'Egg', 'Milk', ], [], [], 0),
LocationRow('Quest: Demon Slayer', 'quest', ['Central Varrock', 'Varrock Palace', 'Wizard Tower', 'South of Varrock', ], [], [], 0),
LocationRow('Quest: The Restless Ghost', 'quest', ['Lumbridge', 'Lumbridge Swamp', 'Wizard Tower', ], [], [], 0),
LocationRow('Quest: Romeo & Juliet', 'quest', ['Central Varrock', 'Varrock Palace', 'South of Varrock', 'West Varrock', ], [], [], 0),
LocationRow('Quest: Sheep Shearer', 'quest', ['Lumbridge Farms West', 'Spinning Wheel', ], [], [], 0),
LocationRow('Quest: Shield of Arrav', 'quest', ['Central Varrock', 'Varrock Palace', 'South of Varrock', 'West Varrock', ], [], [], 0),
LocationRow('Quest: Ernest the Chicken', 'quest', ['Draynor Manor', ], [], [], 0),
LocationRow('Quest: Vampyre Slayer', 'quest', ['Draynor Village', 'Central Varrock', 'Draynor Manor', ], [], [], 0),
LocationRow('Quest: Imp Catcher', 'quest', ['Wizard Tower', 'Imps', ], [], [], 0),
LocationRow('Quest: Prince Ali Rescue', 'quest', ['Al Kharid', 'Central Varrock', 'Bronze Ores', 'Clay Ore', 'Sheep', 'Spinning Wheel', 'Draynor Village', ], [], [], 0),
LocationRow('Quest: Doric\'s Quest', 'quest', ['Dwarven Mountain Pass', 'Clay Ore', 'Iron Ore', 'Bronze Ores', ], [SkillRequirement('Mining', 15), ], [], 0),
LocationRow('Quest: Black Knights\' Fortress', 'quest', ['Dwarven Mines', 'Falador', 'Monastery', 'Ice Mountain', 'Falador Farms', ], [], ['Progressive Armor', ], 12),
LocationRow('Quest: Witch\'s Potion', 'quest', ['Rimmington', 'Port Sarim', ], [], [], 0),
LocationRow('Quest: The Knight\'s Sword', 'quest', ['Falador', 'Varrock Palace', 'Mudskipper Point', 'South of Varrock', 'Windmill', 'Pie Dish', 'Port Sarim', ], [SkillRequirement('Cooking', 10), SkillRequirement('Mining', 10), ], [], 0),
LocationRow('Quest: Goblin Diplomacy', 'quest', ['Goblin Village', 'Draynor Village', 'Falador', 'South of Varrock', 'Onion', ], [], [], 0),
LocationRow('Quest: Pirate\'s Treasure', 'quest', ['Port Sarim', 'Karamja', 'Falador', ], [], [], 0),
LocationRow('Quest: Rune Mysteries', 'quest', ['Lumbridge', 'Wizard Tower', 'Central Varrock', ], [], [], 0),
LocationRow('Quest: Misthalin Mystery', 'quest', ['Lumbridge Swamp', ], [], [], 0),
LocationRow('Quest: The Corsair Curse', 'quest', ['Rimmington', 'Falador Farms', 'Corsair Cove', ], [], [], 0),
LocationRow('Quest: X Marks the Spot', 'quest', ['Lumbridge', 'Draynor Village', 'Port Sarim', ], [], [], 0),
LocationRow('Quest: Below Ice Mountain', 'quest', ['Dwarven Mines', 'Dwarven Mountain Pass', 'Ice Mountain', 'Barbarian Village', 'Falador', 'Central Varrock', 'Edgeville', ], [], [], 16),
LocationRow('Quest: Dragon Slayer', 'goal', ['Crandor', 'South of Varrock', 'Edgeville', 'Lumbridge', 'Rimmington', 'Monastery', 'Dwarven Mines', 'Port Sarim', 'Draynor Village', ], [], [], 32),
LocationRow('Activate the "Rock Skin" Prayer', 'prayer', [], [SkillRequirement('Prayer', 10), ], [], 0),
LocationRow('Activate the "Protect Item" Prayer', 'prayer', [], [SkillRequirement('Prayer', 25), ], [], 2),
LocationRow('Pray at the Edgeville Monastery', 'prayer', ['Monastery', ], [SkillRequirement('Prayer', 31), ], [], 6),
LocationRow('Cast Bones To Bananas', 'magic', ['Nature Runes', ], [SkillRequirement('Magic', 15), ], [], 0),
LocationRow('Teleport to Varrock', 'magic', ['Central Varrock', 'Law Runes', ], [SkillRequirement('Magic', 25), ], [], 0),
LocationRow('Teleport to Lumbridge', 'magic', ['Lumbridge', 'Law Runes', ], [SkillRequirement('Magic', 31), ], [], 2),
LocationRow('Teleport to Falador', 'magic', ['Falador', 'Law Runes', ], [SkillRequirement('Magic', 37), ], [], 6),
LocationRow('Craft an Air Rune', 'runecraft', ['Rune Essence', 'Falador Farms', ], [SkillRequirement('Runecraft', 1), ], [], 0),
LocationRow('Craft runes with a Mind Core', 'runecraft', ['Camdozaal', 'Goblin Village', ], [SkillRequirement('Runecraft', 2), ], [], 0),
LocationRow('Craft runes with a Body Core', 'runecraft', ['Camdozaal', 'Dwarven Mountain Pass', ], [SkillRequirement('Runecraft', 20), ], [], 0),
LocationRow('Make an Unblessed Symbol', 'crafting', ['Silver Ore', 'Furnace', 'Al Kharid', 'Sheep', 'Spinning Wheel', ], [SkillRequirement('Crafting', 16), ], [], 0),
LocationRow('Cut a Sapphire', 'crafting', ['Chisel', ], [SkillRequirement('Crafting', 20), ], [], 0),
LocationRow('Cut an Emerald', 'crafting', ['Chisel', ], [SkillRequirement('Crafting', 27), ], [], 0),
LocationRow('Cut a Ruby', 'crafting', ['Chisel', ], [SkillRequirement('Crafting', 34), ], [], 4),
LocationRow('Cut a Diamond', 'crafting', ['Chisel', ], [SkillRequirement('Crafting', 43), ], [], 8),
LocationRow('Mine a Blurite Ore', 'mining', ['Mudskipper Point', 'Port Sarim', ], [SkillRequirement('Mining', 10), ], [], 0),
LocationRow('Crush a Barronite Deposit', 'mining', ['Camdozaal', ], [SkillRequirement('Mining', 14), ], [], 0),
LocationRow('Mine Silver', 'mining', ['Silver Ore', ], [SkillRequirement('Mining', 20), ], [], 0),
LocationRow('Mine Coal', 'mining', ['Coal Ore', ], [SkillRequirement('Mining', 30), ], [], 2),
LocationRow('Mine Gold', 'mining', ['Gold Ore', ], [SkillRequirement('Mining', 40), ], [], 6),
LocationRow('Smelt an Iron Bar', 'smithing', ['Iron Ore', 'Furnace', ], [SkillRequirement('Smithing', 15), SkillRequirement('Mining', 15), ], [], 0),
LocationRow('Smelt a Silver Bar', 'smithing', ['Silver Ore', 'Furnace', ], [SkillRequirement('Smithing', 20), SkillRequirement('Mining', 20), ], [], 0),
LocationRow('Smelt a Steel Bar', 'smithing', ['Coal Ore', 'Iron Ore', 'Furnace', ], [SkillRequirement('Smithing', 30), SkillRequirement('Mining', 30), ], [], 2),
LocationRow('Smelt a Gold Bar', 'smithing', ['Gold Ore', 'Furnace', ], [SkillRequirement('Smithing', 40), SkillRequirement('Mining', 40), ], [], 6),
LocationRow('Catch some Anchovies', 'fishing', ['Shrimp Spot', ], [SkillRequirement('Fishing', 15), ], [], 0),
LocationRow('Catch a Trout', 'fishing', ['Fly Fishing Spot', ], [SkillRequirement('Fishing', 20), ], [], 0),
LocationRow('Prepare a Tetra', 'fishing', ['Camdozaal', ], [SkillRequirement('Fishing', 33), SkillRequirement('Cooking', 33), ], [], 2),
LocationRow('Catch a Lobster', 'fishing', ['Lobster Spot', ], [SkillRequirement('Fishing', 40), ], [], 6),
LocationRow('Catch a Swordfish', 'fishing', ['Lobster Spot', ], [SkillRequirement('Fishing', 50), ], [], 12),
LocationRow('Bake a Redberry Pie', 'cooking', ['Redberry Bush', 'Wheat', 'Windmill', 'Pie Dish', ], [SkillRequirement('Cooking', 10), ], [], 0),
LocationRow('Cook some Stew', 'cooking', ['Bowl', 'Meat', 'Potato', ], [SkillRequirement('Cooking', 25), ], [], 0),
LocationRow('Bake an Apple Pie', 'cooking', ['Cooking Apple', 'Wheat', 'Windmill', 'Pie Dish', ], [SkillRequirement('Cooking', 30), ], [], 2),
LocationRow('Bake a Cake', 'cooking', ['Wheat', 'Windmill', 'Egg', 'Milk', 'Cake Tin', ], [SkillRequirement('Cooking', 40), ], [], 6),
LocationRow('Bake a Meat Pizza', 'cooking', ['Wheat', 'Windmill', 'Cheese', 'Tomato', 'Meat', ], [SkillRequirement('Cooking', 45), ], [], 8),
LocationRow('Burn some Oak Logs', 'firemaking', ['Oak Tree', ], [SkillRequirement('Firemaking', 15), ], [], 0),
LocationRow('Burn some Willow Logs', 'firemaking', ['Willow Tree', ], [SkillRequirement('Firemaking', 30), ], [], 0),
LocationRow('Travel on a Canoe', 'woodcutting', ['Canoe Tree', ], [SkillRequirement('Woodcutting', 12), ], [], 0),
LocationRow('Cut an Oak Log', 'woodcutting', ['Oak Tree', ], [SkillRequirement('Woodcutting', 15), ], [], 0),
LocationRow('Cut a Willow Log', 'woodcutting', ['Willow Tree', ], [SkillRequirement('Woodcutting', 30), ], [], 0),
LocationRow('Kill Jeff', 'combat', ['Dwarven Mountain Pass', ], [SkillRequirement('Combat', 2), ], [], 0),
LocationRow('Kill a Goblin', 'combat', ['Goblin', ], [SkillRequirement('Combat', 2), ], [], 0),
LocationRow('Kill a Monkey', 'combat', ['Karamja', ], [SkillRequirement('Combat', 3), ], [], 0),
LocationRow('Kill a Barbarian', 'combat', ['Barbarian', ], [SkillRequirement('Combat', 10), ], [], 0),
LocationRow('Kill a Giant Frog', 'combat', ['Lumbridge Swamp', ], [SkillRequirement('Combat', 13), ], [], 0),
LocationRow('Kill a Zombie', 'combat', ['Zombie', ], [SkillRequirement('Combat', 13), ], [], 0),
LocationRow('Kill a Guard', 'combat', ['Guard', ], [SkillRequirement('Combat', 21), ], [], 0),
LocationRow('Kill a Hill Giant', 'combat', ['Hill Giant', ], [SkillRequirement('Combat', 28), ], [], 2),
LocationRow('Kill a Deadly Red Spider', 'combat', ['Deadly Red Spider', ], [SkillRequirement('Combat', 34), ], [], 2),
LocationRow('Kill a Moss Giant', 'combat', ['Moss Giant', ], [SkillRequirement('Combat', 42), ], [], 2),
LocationRow('Kill a Catablepon', 'combat', ['Barbarian Village', ], [SkillRequirement('Combat', 49), ], [], 4),
LocationRow('Kill an Ice Giant', 'combat', ['Ice Giant', ], [SkillRequirement('Combat', 53), ], [], 4),
LocationRow('Kill a Lesser Demon', 'combat', ['Lesser Demon', ], [SkillRequirement('Combat', 82), ], [], 8),
LocationRow('Kill an Ogress Shaman', 'combat', ['Corsair Cove', ], [SkillRequirement('Combat', 82), ], [], 8),
LocationRow('Kill Obor', 'combat', ['Edgeville', ], [SkillRequirement('Combat', 106), ], [], 28),
LocationRow('Kill Bryophyta', 'combat', ['Central Varrock', ], [SkillRequirement('Combat', 128), ], [], 28),
LocationRow('Total XP 5,000', 'general', [], [], [], 0),
LocationRow('Combat Level 5', 'general', [], [], [], 0),
LocationRow('Total XP 10,000', 'general', [], [], [], 0),
LocationRow('Total Level 50', 'general', [], [], [], 0),
LocationRow('Total XP 25,000', 'general', [], [], [], 0),
LocationRow('Total Level 100', 'general', [], [], [], 0),
LocationRow('Total XP 50,000', 'general', [], [], [], 0),
LocationRow('Combat Level 15', 'general', [], [], [], 0),
LocationRow('Total Level 150', 'general', [], [], [], 2),
LocationRow('Total XP 75,000', 'general', [], [], [], 2),
LocationRow('Combat Level 25', 'general', [], [], [], 2),
LocationRow('Total XP 100,000', 'general', [], [], [], 6),
LocationRow('Total Level 200', 'general', [], [], [], 6),
LocationRow('Total XP 125,000', 'general', [], [], [], 6),
LocationRow('Combat Level 30', 'general', [], [], [], 10),
LocationRow('Total Level 250', 'general', [], [], [], 10),
LocationRow('Total XP 150,000', 'general', [], [], [], 10),
LocationRow('Total Level 300', 'general', [], [], [], 16),
LocationRow('Combat Level 40', 'general', [], [], [], 16),
LocationRow('Open a Simple Lockbox', 'general', ['Camdozaal', ], [], [], 0),
LocationRow('Open an Elaborate Lockbox', 'general', ['Camdozaal', ], [], [], 0),
LocationRow('Open an Ornate Lockbox', 'general', ['Camdozaal', ], [], [], 0),
LocationRow('Points: Cook\'s Assistant', 'points', [], [], [], 0),
LocationRow('Points: Demon Slayer', 'points', [], [], [], 0),
LocationRow('Points: The Restless Ghost', 'points', [], [], [], 0),
LocationRow('Points: Romeo & Juliet', 'points', [], [], [], 0),
LocationRow('Points: Sheep Shearer', 'points', [], [], [], 0),
LocationRow('Points: Shield of Arrav', 'points', [], [], [], 0),
LocationRow('Points: Ernest the Chicken', 'points', [], [], [], 0),
LocationRow('Points: Vampyre Slayer', 'points', [], [], [], 0),
LocationRow('Points: Imp Catcher', 'points', [], [], [], 0),
LocationRow('Points: Prince Ali Rescue', 'points', [], [], [], 0),
LocationRow('Points: Doric\'s Quest', 'points', [], [], [], 0),
LocationRow('Points: Black Knights\' Fortress', 'points', [], [], [], 0),
LocationRow('Points: Witch\'s Potion', 'points', [], [], [], 0),
LocationRow('Points: The Knight\'s Sword', 'points', [], [], [], 0),
LocationRow('Points: Goblin Diplomacy', 'points', [], [], [], 0),
LocationRow('Points: Pirate\'s Treasure', 'points', [], [], [], 0),
LocationRow('Points: Rune Mysteries', 'points', [], [], [], 0),
LocationRow('Points: Misthalin Mystery', 'points', [], [], [], 0),
LocationRow('Points: The Corsair Curse', 'points', [], [], [], 0),
LocationRow('Points: X Marks the Spot', 'points', [], [], [], 0),
LocationRow('Points: Below Ice Mountain', 'points', [], [], [], 0),
]

View File

@@ -1,47 +0,0 @@
"""
This file was auto generated by LogicCSVToPython.py
"""
from ..Regions import RegionRow
region_rows = [
RegionRow('Lumbridge', 'Area: Lumbridge', ['Lumbridge Farms East', 'Lumbridge Farms West', 'Al Kharid', 'Lumbridge Swamp', 'HAM Hideout', 'South of Varrock', 'Barbarian Village', 'Edgeville', 'Wilderness', ], ['Mind Runes', 'Spinning Wheel', 'Furnace', 'Chisel', 'Bronze Anvil', 'Fly Fishing Spot', 'Bowl', 'Cake Tin', 'Oak Tree', 'Willow Tree', 'Canoe Tree', 'Goblin', 'Imps', ]),
RegionRow('Lumbridge Swamp', 'Area: Lumbridge Swamp', ['Lumbridge', 'HAM Hideout', ], ['Bronze Ores', 'Coal Ore', 'Shrimp Spot', 'Meat', 'Goblin', 'Imps', ]),
RegionRow('HAM Hideout', 'Area: HAM Hideout', ['Lumbridge Farms West', 'Lumbridge', 'Lumbridge Swamp', 'Draynor Village', ], ['Goblin', ]),
RegionRow('Lumbridge Farms West', 'Area: Lumbridge Farms', ['Sourhog\'s Lair', 'HAM Hideout', 'Draynor Village', ], ['Sheep', 'Meat', 'Wheat', 'Windmill', 'Egg', 'Milk', 'Willow Tree', 'Imps', 'Potato', ]),
RegionRow('Lumbridge Farms East', 'Area: Lumbridge Farms', ['South of Varrock', 'Lumbridge', ], ['Meat', 'Egg', 'Milk', 'Willow Tree', 'Goblin', 'Imps', 'Potato', ]),
RegionRow('Sourhog\'s Lair', 'Area: South of Varrock', ['Lumbridge Farms West', 'Draynor Manor Outskirts', ], ['', ]),
RegionRow('South of Varrock', 'Area: South of Varrock', ['Al Kharid', 'West Varrock', 'Central Varrock', 'East Varrock', 'Lumbridge Farms East', 'Lumbridge', 'Barbarian Village', 'Edgeville', 'Wilderness', ], ['Sheep', 'Bronze Ores', 'Iron Ore', 'Silver Ore', 'Redberry Bush', 'Meat', 'Wheat', 'Oak Tree', 'Willow Tree', 'Canoe Tree', 'Guard', 'Imps', 'Clay Ore', ]),
RegionRow('East Varrock', 'Area: East Varrock', ['Wilderness', 'South of Varrock', 'Central Varrock', 'Varrock Palace', ], ['Guard', ]),
RegionRow('Central Varrock', 'Area: Central Varrock', ['Varrock Palace', 'East Varrock', 'South of Varrock', 'West Varrock', ], ['Mind Runes', 'Chisel', 'Anvil', 'Bowl', 'Cake Tin', 'Oak Tree', 'Barbarian', 'Guard', 'Rune Essence', 'Imps', ]),
RegionRow('Varrock Palace', 'Area: Varrock Palace', ['Wilderness', 'East Varrock', 'Central Varrock', 'West Varrock', ], ['Pie Dish', 'Oak Tree', 'Zombie', 'Guard', 'Deadly Red Spider', 'Moss Giant', 'Nature Runes', 'Law Runes', ]),
RegionRow('West Varrock', 'Area: West Varrock', ['Wilderness', 'Varrock Palace', 'South of Varrock', 'Barbarian Village', 'Edgeville', 'Cook\'s Guild', ], ['Anvil', 'Wheat', 'Oak Tree', 'Goblin', 'Guard', 'Onion', ]),
RegionRow('Cook\'s Guild', 'Area: West Varrock*', ['West Varrock', ], ['Bowl', 'Cooking Apple', 'Pie Dish', 'Cake Tin', 'Windmill', ]),
RegionRow('Edgeville', 'Area: Edgeville', ['Wilderness', 'West Varrock', 'Barbarian Village', 'South of Varrock', 'Lumbridge', ], ['Furnace', 'Chisel', 'Bronze Ores', 'Iron Ore', 'Coal Ore', 'Bowl', 'Meat', 'Cake Tin', 'Willow Tree', 'Canoe Tree', 'Zombie', 'Guard', 'Hill Giant', 'Nature Runes', 'Law Runes', 'Imps', ]),
RegionRow('Barbarian Village', 'Area: Barbarian Village', ['Edgeville', 'West Varrock', 'Draynor Manor Outskirts', 'Dwarven Mountain Pass', ], ['Spinning Wheel', 'Coal Ore', 'Anvil', 'Fly Fishing Spot', 'Meat', 'Canoe Tree', 'Barbarian', 'Zombie', 'Law Runes', ]),
RegionRow('Draynor Manor Outskirts', 'Area: Draynor Manor', ['Barbarian Village', 'Sourhog\'s Lair', 'Draynor Village', 'Falador East Outskirts', ], ['Goblin', ]),
RegionRow('Draynor Manor', 'Area: Draynor Manor', ['Draynor Village', ], ['', ]),
RegionRow('Falador East Outskirts', 'Area: Falador', ['Dwarven Mountain Pass', 'Draynor Manor Outskirts', 'Falador Farms', ], ['', ]),
RegionRow('Dwarven Mountain Pass', 'Area: Dwarven Mines', ['Goblin Village', 'Monastery', 'Barbarian Village', 'Falador East Outskirts', 'Falador', ], ['Anvil*', 'Wheat', ]),
RegionRow('Dwarven Mines', 'Area: Dwarven Mines', ['Monastery', 'Ice Mountain', 'Falador', ], ['Chisel', 'Bronze Ores', 'Iron Ore', 'Coal Ore', 'Gold Ore', 'Anvil', 'Pie Dish', 'Clay Ore', ]),
RegionRow('Goblin Village', 'Area: Ice Mountain', ['Wilderness', 'Dwarven Mountain Pass', ], ['Meat', ]),
RegionRow('Ice Mountain', 'Area: Ice Mountain', ['Wilderness', 'Monastery', 'Dwarven Mines', 'Camdozaal*', ], ['', ]),
RegionRow('Camdozaal', 'Area: Ice Mountain', ['Ice Mountain', ], ['Clay Ore', ]),
RegionRow('Monastery', 'Area: Monastery', ['Wilderness', 'Dwarven Mountain Pass', 'Dwarven Mines', 'Ice Mountain', ], ['Sheep', ]),
RegionRow('Falador', 'Area: Falador', ['Dwarven Mountain Pass', 'Falador Farms', 'Dwarven Mines', ], ['Furnace', 'Chisel', 'Bowl', 'Cake Tin', 'Oak Tree', 'Guard', 'Imps', ]),
RegionRow('Falador Farms', 'Area: Falador Farms', ['Falador', 'Falador East Outskirts', 'Draynor Village', 'Port Sarim', 'Rimmington', 'Crafting Guild Outskirts', ], ['Spinning Wheel', 'Meat', 'Egg', 'Milk', 'Oak Tree', 'Imps', ]),
RegionRow('Port Sarim', 'Area: Port Sarim', ['Falador Farms', 'Mudskipper Point', 'Rimmington', 'Karamja Docks', 'Crandor', ], ['Mind Runes', 'Shrimp Spot', 'Meat', 'Cheese', 'Tomato', 'Oak Tree', 'Willow Tree', 'Goblin', 'Potato', ]),
RegionRow('Karamja Docks', 'Area: Mudskipper Point', ['Port Sarim', 'Karamja', ], ['', ]),
RegionRow('Mudskipper Point', 'Area: Mudskipper Point', ['Rimmington', 'Port Sarim', ], ['Anvil', 'Ice Giant', 'Nature Runes', 'Law Runes', ]),
RegionRow('Karamja', 'Area: Karamja', ['Karamja Docks', 'Crandor', ], ['Gold Ore', 'Lobster Spot', 'Bowl', 'Cake Tin', 'Deadly Red Spider', 'Imps', ]),
RegionRow('Crandor', 'Area: Crandor', ['Karamja', 'Port Sarim', ], ['Coal Ore', 'Gold Ore', 'Moss Giant', 'Lesser Demon', 'Nature Runes', 'Law Runes', ]),
RegionRow('Rimmington', 'Area: Rimmington', ['Falador Farms', 'Port Sarim', 'Mudskipper Point', 'Crafting Guild Peninsula', 'Corsair Cove', ], ['Chisel', 'Bronze Ores', 'Iron Ore', 'Gold Ore', 'Bowl', 'Cake Tin', 'Wheat', 'Oak Tree', 'Willow Tree', 'Crafting Moulds', 'Imps', 'Clay Ore', 'Onion', ]),
RegionRow('Crafting Guild Peninsula', 'Area: Crafting Guild', ['Falador Farms', 'Rimmington', ], ['', ]),
RegionRow('Crafting Guild Outskirts', 'Area: Crafting Guild', ['Falador Farms', 'Crafting Guild', ], ['Sheep', 'Willow Tree', 'Oak Tree', ]),
RegionRow('Crafting Guild', 'Area: Crafting Guild*', ['Crafting Guild', ], ['Spinning Wheel', 'Chisel', 'Silver Ore', 'Gold Ore', 'Meat', 'Milk', 'Clay Ore', ]),
RegionRow('Draynor Village', 'Area: Draynor Village', ['Draynor Manor', 'Lumbridge Farms West', 'HAM Hideout', 'Wizard Tower', ], ['Anvil', 'Shrimp Spot', 'Wheat', 'Cheese', 'Tomato', 'Willow Tree', 'Goblin', 'Zombie', 'Nature Runes', 'Law Runes', 'Imps', ]),
RegionRow('Wizard Tower', 'Area: Wizard Tower', ['Draynor Village', ], ['Lesser Demon', 'Rune Essence', ]),
RegionRow('Corsair Cove', 'Area: Corsair Cove*', ['Rimmington', ], ['Anvil', 'Meat', ]),
RegionRow('Al Kharid', 'Area: Al Kharid', ['South of Varrock', 'Citharede Abbey', 'Lumbridge', 'Port Sarim', ], ['Furnace', 'Chisel', 'Bronze Ores', 'Iron Ore', 'Silver Ore', 'Coal Ore', 'Gold Ore', 'Shrimp Spot', 'Bowl', 'Cake Tin', 'Cheese', 'Crafting Moulds', 'Imps', ]),
RegionRow('Citharede Abbey', 'Area: Citharede Abbey', ['Al Kharid', ], ['Iron Ore', 'Coal Ore', 'Anvil', 'Hill Giant', 'Nature Runes', 'Law Runes', ]),
RegionRow('Wilderness', 'Area: Wilderness', ['East Varrock', 'Varrock Palace', 'West Varrock', 'Edgeville', 'Monastery', 'Ice Mountain', 'Goblin Village', 'South of Varrock', 'Lumbridge', ], ['Furnace', 'Chisel', 'Iron Ore', 'Coal Ore', 'Anvil', 'Meat', 'Cake Tin', 'Cheese', 'Tomato', 'Oak Tree', 'Canoe Tree', 'Zombie', 'Hill Giant', 'Deadly Red Spider', 'Moss Giant', 'Ice Giant', 'Lesser Demon', 'Nature Runes', 'Law Runes', ]),
]

View File

@@ -1,54 +0,0 @@
"""
This file was auto generated by LogicCSVToPython.py
"""
from ..Regions import ResourceRow
resource_rows = [
ResourceRow('Mind Runes'),
ResourceRow('Spinning Wheel'),
ResourceRow('Sheep'),
ResourceRow('Furnace'),
ResourceRow('Chisel'),
ResourceRow('Bronze Ores'),
ResourceRow('Iron Ore'),
ResourceRow('Silver Ore'),
ResourceRow('Coal Ore'),
ResourceRow('Gold Ore'),
ResourceRow('Bronze Anvil'),
ResourceRow('Anvil'),
ResourceRow('Shrimp Spot'),
ResourceRow('Fly Fishing Spot'),
ResourceRow('Lobster Spot'),
ResourceRow('Redberry Bush'),
ResourceRow('Bowl'),
ResourceRow('Meat'),
ResourceRow('Cooking Apple'),
ResourceRow('Pie Dish'),
ResourceRow('Cake Tin'),
ResourceRow('Wheat'),
ResourceRow('Windmill'),
ResourceRow('Egg'),
ResourceRow('Milk'),
ResourceRow('Cheese'),
ResourceRow('Tomato'),
ResourceRow('Oak Tree'),
ResourceRow('Willow Tree'),
ResourceRow('Canoe Tree'),
ResourceRow('Goblin'),
ResourceRow('Barbarian'),
ResourceRow('Zombie'),
ResourceRow('Guard'),
ResourceRow('Hill Giant'),
ResourceRow('Deadly Red Spider'),
ResourceRow('Moss Giant'),
ResourceRow('Ice Giant'),
ResourceRow('Lesser Demon'),
ResourceRow('Rune Essence'),
ResourceRow('Crafting Moulds'),
ResourceRow('Nature Runes'),
ResourceRow('Law Runes'),
ResourceRow('Imps'),
ResourceRow('Clay Ore'),
ResourceRow('Onion'),
ResourceRow('Potato'),
]

View File

@@ -1,212 +0,0 @@
from enum import Enum
class RegionNames(str, Enum):
Lumbridge = "Lumbridge"
Lumbridge_Swamp = "Lumbridge Swamp"
Lumbridge_Farms_East = "Lumbridge Farms East"
Lumbridge_Farms_West = "Lumbridge Farms West"
HAM_Hideout = "HAM Hideout"
Draynor_Village = "Draynor Village"
Draynor_Manor = "Draynor Manor"
Wizards_Tower = "Wizard Tower"
Al_Kharid = "Al Kharid"
Citharede_Abbey = "Citharede Abbey"
South_Of_Varrock = "South of Varrock"
Central_Varrock = "Central Varrock"
Varrock_Palace = "Varrock Palace"
East_Of_Varrock = "East Varrock"
West_Varrock = "West Varrock"
Edgeville = "Edgeville"
Barbarian_Village = "Barbarian Village"
Monastery = "Monastery"
Ice_Mountain = "Ice Mountain"
Dwarven_Mines = "Dwarven Mines"
Falador = "Falador"
Falador_Farm = "Falador Farms"
Crafting_Guild = "Crafting Guild"
Cooks_Guild = "Cook's Guild"
Rimmington = "Rimmington"
Port_Sarim = "Port Sarim"
Mudskipper_Point = "Mudskipper Point"
Karamja = "Karamja"
Corsair_Cove = "Corsair Cove"
Wilderness = "The Wilderness"
Crandor = "Crandor"
# Resource Regions
Egg = "Egg"
Sheep = "Sheep"
Milk = "Milk"
Wheat = "Wheat"
Windmill = "Windmill"
Spinning_Wheel = "Spinning Wheel"
Imp = "Imp"
Bronze_Ores = "Bronze Ores"
Clay_Rock = "Clay Ore"
Coal_Rock = "Coal Ore"
Iron_Rock = "Iron Ore"
Silver_Rock = "Silver Ore"
Gold_Rock = "Gold Ore"
Furnace = "Furnace"
Anvil = "Anvil"
Oak_Tree = "Oak Tree"
Willow_Tree = "Willow Tree"
Shrimp = "Shrimp Spot"
Fly_Fish = "Fly Fishing Spot"
Lobster = "Lobster Spot"
Mind_Runes = "Mind Runes"
Canoe_Tree = "Canoe Tree"
__str__ = str.__str__
class ItemNames(str, Enum):
Lumbridge = "Area: Lumbridge"
Lumbridge_Swamp = "Area: Lumbridge Swamp"
Lumbridge_Farms = "Area: Lumbridge Farms"
HAM_Hideout = "Area: HAM Hideout"
Draynor_Village = "Area: Draynor Village"
Draynor_Manor = "Area: Draynor Manor"
Wizards_Tower = "Area: Wizard Tower"
Al_Kharid = "Area: Al Kharid"
Citharede_Abbey = "Area: Citharede Abbey"
South_Of_Varrock = "Area: South of Varrock"
Central_Varrock = "Area: Central Varrock"
Varrock_Palace = "Area: Varrock Palace"
East_Of_Varrock = "Area: East Varrock"
West_Varrock = "Area: West Varrock"
Edgeville = "Area: Edgeville"
Barbarian_Village = "Area: Barbarian Village"
Monastery = "Area: Monastery"
Ice_Mountain = "Area: Ice Mountain"
Dwarven_Mines = "Area: Dwarven Mines"
Falador = "Area: Falador"
Falador_Farm = "Area: Falador Farms"
Crafting_Guild = "Area: Crafting Guild"
Rimmington = "Area: Rimmington"
Port_Sarim = "Area: Port Sarim"
Mudskipper_Point = "Area: Mudskipper Point"
Karamja = "Area: Karamja"
Crandor = "Area: Crandor"
Corsair_Cove = "Area: Corsair Cove"
Wilderness = "Area: Wilderness"
Progressive_Armor = "Progressive Armor"
Progressive_Weapons = "Progressive Weapons"
Progressive_Tools = "Progressive Tools"
Progressive_Range_Armor = "Progressive Range Armor"
Progressive_Range_Weapon = "Progressive Range Weapon"
Progressive_Magic = "Progressive Magic Spell"
Lobsters = "10 Lobsters"
Swordfish = "5 Swordfish"
Energy_Potions = "10 Energy Potions"
Coins = "5,000 Coins"
Mind_Runes = "50 Mind Runes"
Chaos_Runes = "25 Chaos Runes"
Death_Runes = "10 Death Runes"
Law_Runes = "10 Law Runes"
QP_Cooks_Assistant = "1 QP (Cook's Assistant)"
QP_Demon_Slayer = "3 QP (Demon Slayer)"
QP_Restless_Ghost = "1 QP (The Restless Ghost)"
QP_Romeo_Juliet = "5 QP (Romeo & Juliet)"
QP_Sheep_Shearer = "1 QP (Sheep Shearer)"
QP_Shield_of_Arrav = "1 QP (Shield of Arrav)"
QP_Ernest_the_Chicken = "4 QP (Ernest the Chicken)"
QP_Vampyre_Slayer = "3 QP (Vampyre Slayer)"
QP_Imp_Catcher = "1 QP (Imp Catcher)"
QP_Prince_Ali_Rescue = "3 QP (Prince Ali Rescue)"
QP_Dorics_Quest = "1 QP (Doric's Quest)"
QP_Black_Knights_Fortress = "3 QP (Black Knights' Fortress)"
QP_Witchs_Potion = "1 QP (Witch's Potion)"
QP_Knights_Sword = "1 QP (The Knight's Sword)"
QP_Goblin_Diplomacy = "5 QP (Goblin Diplomacy)"
QP_Pirates_Treasure = "2 QP (Pirate's Treasure)"
QP_Rune_Mysteries = "1 QP (Rune Mysteries)"
QP_Misthalin_Mystery = "1 QP (Misthalin Mystery)"
QP_Corsair_Curse = "2 QP (The Corsair Curse)"
QP_X_Marks_the_Spot = "1 QP (X Marks The Spot)"
QP_Below_Ice_Mountain = "1 QP (Below Ice Mountain)"
__str__ = str.__str__
class LocationNames(str, Enum):
Q_Cooks_Assistant = "Quest: Cook's Assistant"
Q_Demon_Slayer = "Quest: Demon Slayer"
Q_Restless_Ghost = "Quest: The Restless Ghost"
Q_Romeo_Juliet = "Quest: Romeo & Juliet"
Q_Sheep_Shearer = "Quest: Sheep Shearer"
Q_Shield_of_Arrav = "Quest: Shield of Arrav"
Q_Ernest_the_Chicken = "Quest: Ernest the Chicken"
Q_Vampyre_Slayer = "Quest: Vampyre Slayer"
Q_Imp_Catcher = "Quest: Imp Catcher"
Q_Prince_Ali_Rescue = "Quest: Prince Ali Rescue"
Q_Dorics_Quest = "Quest: Doric's Quest"
Q_Black_Knights_Fortress = "Quest: Black Knights' Fortress"
Q_Witchs_Potion = "Quest: Witch's Potion"
Q_Knights_Sword = "Quest: The Knight's Sword"
Q_Goblin_Diplomacy = "Quest: Goblin Diplomacy"
Q_Pirates_Treasure = "Quest: Pirate's Treasure"
Q_Rune_Mysteries = "Quest: Rune Mysteries"
Q_Misthalin_Mystery = "Quest: Misthalin Mystery"
Q_Corsair_Curse = "Quest: The Corsair Curse"
Q_X_Marks_the_Spot = "Quest: X Marks the Spot"
Q_Below_Ice_Mountain = "Quest: Below Ice Mountain"
QP_Cooks_Assistant = "Points: Cook's Assistant"
QP_Demon_Slayer = "Points: Demon Slayer"
QP_Restless_Ghost = "Points: The Restless Ghost"
QP_Romeo_Juliet = "Points: Romeo & Juliet"
QP_Sheep_Shearer = "Points: Sheep Shearer"
QP_Shield_of_Arrav = "Points: Shield of Arrav"
QP_Ernest_the_Chicken = "Points: Ernest the Chicken"
QP_Vampyre_Slayer = "Points: Vampyre Slayer"
QP_Imp_Catcher = "Points: Imp Catcher"
QP_Prince_Ali_Rescue = "Points: Prince Ali Rescue"
QP_Dorics_Quest = "Points: Doric's Quest"
QP_Black_Knights_Fortress = "Points: Black Knights' Fortress"
QP_Witchs_Potion = "Points: Witch's Potion"
QP_Knights_Sword = "Points: The Knight's Sword"
QP_Goblin_Diplomacy = "Points: Goblin Diplomacy"
QP_Pirates_Treasure = "Points: Pirate's Treasure"
QP_Rune_Mysteries = "Points: Rune Mysteries"
QP_Misthalin_Mystery = "Points: Misthalin Mystery"
QP_Corsair_Curse = "Points: The Corsair Curse"
QP_X_Marks_the_Spot = "Points: X Marks the Spot"
QP_Below_Ice_Mountain = "Points: Below Ice Mountain"
Guppy = "Prepare a Guppy"
Cavefish = "Prepare a Cavefish"
Tetra = "Prepare a Tetra"
Barronite_Deposit = "Crush a Barronite Deposit"
Oak_Log = "Cut an Oak Log"
Willow_Log = "Cut a Willow Log"
Catch_Lobster = "Catch a Lobster"
Mine_Silver = "Mine Silver"
Mine_Coal = "Mine Coal"
Mine_Gold = "Mine Gold"
Smelt_Silver = "Smelt a Silver Bar"
Smelt_Steel = "Smelt a Steel Bar"
Smelt_Gold = "Smelt a Gold Bar"
Cut_Sapphire = "Cut a Sapphire"
Cut_Emerald = "Cut an Emerald"
Cut_Ruby = "Cut a Ruby"
Cut_Diamond = "Cut a Diamond"
K_Lesser_Demon = "Kill a Lesser Demon"
K_Ogress_Shaman = "Kill an Ogress Shaman"
Bake_Apple_Pie = "Bake an Apple Pie"
Bake_Cake = "Bake a Cake"
Bake_Meat_Pizza = "Bake a Meat Pizza"
Total_XP_5000 = "5,000 Total XP"
Total_XP_10000 = "10,000 Total XP"
Total_XP_25000 = "25,000 Total XP"
Total_XP_50000 = "50,000 Total XP"
Total_XP_100000 = "100,000 Total XP"
Total_Level_50 = "Total Level 50"
Total_Level_100 = "Total Level 100"
Total_Level_150 = "Total Level 150"
Total_Level_200 = "Total Level 200"
Combat_Level_5 = "Combat Level 5"
Combat_Level_15 = "Combat Level 15"
Combat_Level_25 = "Combat Level 25"
Travel_on_a_Canoe = "Travel on a Canoe"
Q_Dragon_Slayer = "Quest: Dragon Slayer"
__str__ = str.__str__

View File

@@ -1,474 +0,0 @@
from dataclasses import dataclass
from Options import Choice, Toggle, Range, PerGameCommonOptions
MAX_COMBAT_TASKS = 16
MAX_PRAYER_TASKS = 3
MAX_MAGIC_TASKS = 4
MAX_RUNECRAFT_TASKS = 3
MAX_CRAFTING_TASKS = 5
MAX_MINING_TASKS = 5
MAX_SMITHING_TASKS = 4
MAX_FISHING_TASKS = 5
MAX_COOKING_TASKS = 5
MAX_FIREMAKING_TASKS = 2
MAX_WOODCUTTING_TASKS = 3
NON_QUEST_LOCATION_COUNT = 22
class StartingArea(Choice):
"""
Which chunks are available at the start. The player may need to move through locked chunks to reach the starting
area, but any areas that require quests, skills, or coins are not available as a starting location.
"Any Bank" rolls a random region that contains a bank.
Chunksanity can start you in any chunk. Hope you like woodcutting!
"""
display_name = "Starting Region"
option_lumbridge = 0
option_al_kharid = 1
option_varrock_east = 2
option_varrock_west = 3
option_edgeville = 4
option_falador = 5
option_draynor = 6
option_wilderness = 7
option_any_bank = 8
option_chunksanity = 9
default = 0
class BrutalGrinds(Toggle):
"""
Whether to allow skill tasks without having reasonable access to the usual skill training path.
For example, if enabled, you could be forced to train smithing without an anvil purely by smelting bars,
or training fishing to high levels entirely on shrimp.
"""
display_name = "Allow Brutal Grinds"
class ProgressiveTasks(Toggle):
"""
Whether skill tasks should always be generated in order of easiest to hardest.
If enabled, you would not be assigned "Mine Gold" without also being assigned
"Mine Silver", "Mine Coal", and "Mine Iron". Enabling this will result in a generally shorter seed, but with
a lower variety of tasks.
"""
display_name = "Progressive Tasks"
class MaxCombatLevel(Range):
"""
The highest combat level of monster to possibly be assigned as a task.
If set to 0, no combat tasks will be generated.
"""
range_start = 0
range_end = 1520
default = 50
class MaxCombatTasks(Range):
"""
The maximum number of Combat Tasks to possibly be assigned.
If set to 0, no combat tasks will be generated.
This only determines the maximum possible, fewer than the maximum could be assigned.
"""
range_start = 0
range_end = MAX_COMBAT_TASKS
default = MAX_COMBAT_TASKS
class CombatTaskWeight(Range):
"""
How much to favor generating combat tasks over other types of task.
Weights of all Task Types will be compared against each other, a task with 50 weight
is twice as likely to appear as one with 25.
"""
range_start = 0
range_end = 99
default = 50
class MaxPrayerLevel(Range):
"""
The highest Prayer requirement of any task generated.
If set to 0, no Prayer tasks will be generated.
"""
range_start = 0
range_end = 99
default = 50
class MaxPrayerTasks(Range):
"""
The maximum number of Prayer Tasks to possibly be assigned.
If set to 0, no Prayer tasks will be generated.
This only determines the maximum possible, fewer than the maximum could be assigned.
"""
range_start = 0
range_end = MAX_PRAYER_TASKS
default = MAX_PRAYER_TASKS
class PrayerTaskWeight(Range):
"""
How much to favor generating Prayer tasks over other types of task.
Weights of all Task Types will be compared against each other, a task with 50 weight
is twice as likely to appear as one with 25.
"""
range_start = 0
range_end = 99
default = 50
class MaxMagicLevel(Range):
"""
The highest Magic requirement of any task generated.
If set to 0, no Magic tasks will be generated.
"""
range_start = 0
range_end = 99
default = 50
class MaxMagicTasks(Range):
"""
The maximum number of Magic Tasks to possibly be assigned.
If set to 0, no Magic tasks will be generated.
This only determines the maximum possible, fewer than the maximum could be assigned.
"""
range_start = 0
range_end = MAX_MAGIC_TASKS
default = MAX_MAGIC_TASKS
class MagicTaskWeight(Range):
"""
How much to favor generating Magic tasks over other types of task.
Weights of all Task Types will be compared against each other, a task with 50 weight
is twice as likely to appear as one with 25.
"""
range_start = 0
range_end = 99
default = 50
class MaxRunecraftLevel(Range):
"""
The highest Runecraft requirement of any task generated.
If set to 0, no Runecraft tasks will be generated.
"""
range_start = 0
range_end = 99
default = 50
class MaxRunecraftTasks(Range):
"""
The maximum number of Runecraft Tasks to possibly be assigned.
If set to 0, no Runecraft tasks will be generated.
This only determines the maximum possible, fewer than the maximum could be assigned.
"""
range_start = 0
range_end = MAX_RUNECRAFT_TASKS
default = MAX_RUNECRAFT_TASKS
class RunecraftTaskWeight(Range):
"""
How much to favor generating Runecraft tasks over other types of task.
Weights of all Task Types will be compared against each other, a task with 50 weight
is twice as likely to appear as one with 25.
"""
range_start = 0
range_end = 99
default = 50
class MaxCraftingLevel(Range):
"""
The highest Crafting requirement of any task generated.
If set to 0, no Crafting tasks will be generated.
"""
range_start = 0
range_end = 99
default = 50
class MaxCraftingTasks(Range):
"""
The maximum number of Crafting Tasks to possibly be assigned.
If set to 0, no Crafting tasks will be generated.
This only determines the maximum possible, fewer than the maximum could be assigned.
"""
range_start = 0
range_end = MAX_CRAFTING_TASKS
default = MAX_CRAFTING_TASKS
class CraftingTaskWeight(Range):
"""
How much to favor generating Crafting tasks over other types of task.
Weights of all Task Types will be compared against each other, a task with 50 weight
is twice as likely to appear as one with 25.
"""
range_start = 0
range_end = 99
default = 50
class MaxMiningLevel(Range):
"""
The highest Mining requirement of any task generated.
If set to 0, no Mining tasks will be generated.
"""
range_start = 0
range_end = 99
default = 50
class MaxMiningTasks(Range):
"""
The maximum number of Mining Tasks to possibly be assigned.
If set to 0, no Mining tasks will be generated.
This only determines the maximum possible, fewer than the maximum could be assigned.
"""
range_start = 0
range_end = MAX_MINING_TASKS
default = MAX_MINING_TASKS
class MiningTaskWeight(Range):
"""
How much to favor generating Mining tasks over other types of task.
Weights of all Task Types will be compared against each other, a task with 50 weight
is twice as likely to appear as one with 25.
"""
range_start = 0
range_end = 99
default = 50
class MaxSmithingLevel(Range):
"""
The highest Smithing requirement of any task generated.
If set to 0, no Smithing tasks will be generated.
"""
range_start = 0
range_end = 99
default = 50
class MaxSmithingTasks(Range):
"""
The maximum number of Smithing Tasks to possibly be assigned.
If set to 0, no Smithing tasks will be generated.
This only determines the maximum possible, fewer than the maximum could be assigned.
"""
range_start = 0
range_end = MAX_SMITHING_TASKS
default = MAX_SMITHING_TASKS
class SmithingTaskWeight(Range):
"""
How much to favor generating Smithing tasks over other types of task.
Weights of all Task Types will be compared against each other, a task with 50 weight
is twice as likely to appear as one with 25.
"""
range_start = 0
range_end = 99
default = 50
class MaxFishingLevel(Range):
"""
The highest Fishing requirement of any task generated.
If set to 0, no Fishing tasks will be generated.
"""
range_start = 0
range_end = 99
default = 50
class MaxFishingTasks(Range):
"""
The maximum number of Fishing Tasks to possibly be assigned.
If set to 0, no Fishing tasks will be generated.
This only determines the maximum possible, fewer than the maximum could be assigned.
"""
range_start = 0
range_end = MAX_FISHING_TASKS
default = MAX_FISHING_TASKS
class FishingTaskWeight(Range):
"""
How much to favor generating Fishing tasks over other types of task.
Weights of all Task Types will be compared against each other, a task with 50 weight
is twice as likely to appear as one with 25.
"""
range_start = 0
range_end = 99
default = 50
class MaxCookingLevel(Range):
"""
The highest Cooking requirement of any task generated.
If set to 0, no Cooking tasks will be generated.
"""
range_start = 0
range_end = 99
default = 50
class MaxCookingTasks(Range):
"""
The maximum number of Cooking Tasks to possibly be assigned.
If set to 0, no Cooking tasks will be generated.
This only determines the maximum possible, fewer than the maximum could be assigned.
"""
range_start = 0
range_end = MAX_COOKING_TASKS
default = MAX_COOKING_TASKS
class CookingTaskWeight(Range):
"""
How much to favor generating Cooking tasks over other types of task.
Weights of all Task Types will be compared against each other, a task with 50 weight
is twice as likely to appear as one with 25.
"""
range_start = 0
range_end = 99
default = 50
class MaxFiremakingLevel(Range):
"""
The highest Firemaking requirement of any task generated.
If set to 0, no Firemaking tasks will be generated.
"""
range_start = 0
range_end = 99
default = 50
class MaxFiremakingTasks(Range):
"""
The maximum number of Firemaking Tasks to possibly be assigned.
If set to 0, no Firemaking tasks will be generated.
This only determines the maximum possible, fewer than the maximum could be assigned.
"""
range_start = 0
range_end = MAX_FIREMAKING_TASKS
default = MAX_FIREMAKING_TASKS
class FiremakingTaskWeight(Range):
"""
How much to favor generating Firemaking tasks over other types of task.
Weights of all Task Types will be compared against each other, a task with 50 weight
is twice as likely to appear as one with 25.
"""
range_start = 0
range_end = 99
default = 50
class MaxWoodcuttingLevel(Range):
"""
The highest Woodcutting requirement of any task generated.
If set to 0, no Woodcutting tasks will be generated.
"""
range_start = 0
range_end = 99
default = 50
class MaxWoodcuttingTasks(Range):
"""
The maximum number of Woodcutting Tasks to possibly be assigned.
If set to 0, no Woodcutting tasks will be generated.
This only determines the maximum possible, fewer than the maximum could be assigned.
"""
range_start = 0
range_end = MAX_WOODCUTTING_TASKS
default = MAX_WOODCUTTING_TASKS
class WoodcuttingTaskWeight(Range):
"""
How much to favor generating Woodcutting tasks over other types of task.
Weights of all Task Types will be compared against each other, a task with 50 weight
is twice as likely to appear as one with 25.
"""
range_start = 0
range_end = 99
default = 50
class MinimumGeneralTasks(Range):
"""
How many guaranteed general progression tasks to be assigned (total level, total XP, etc.).
General progression tasks will be used to fill out any holes caused by having fewer possible tasks than needed, so
there is no maximum.
"""
range_start = 0
range_end = NON_QUEST_LOCATION_COUNT
default = 10
class GeneralTaskWeight(Range):
"""
How much to favor generating General tasks over other types of task.
Weights of all Task Types will be compared against each other, a task with 50 weight
is twice as likely to appear as one with 25.
"""
range_start = 0
range_end = 99
default = 50
@dataclass
class OSRSOptions(PerGameCommonOptions):
starting_area: StartingArea
brutal_grinds: BrutalGrinds
progressive_tasks: ProgressiveTasks
max_combat_level: MaxCombatLevel
max_combat_tasks: MaxCombatTasks
combat_task_weight: CombatTaskWeight
max_prayer_level: MaxPrayerLevel
max_prayer_tasks: MaxPrayerTasks
prayer_task_weight: PrayerTaskWeight
max_magic_level: MaxMagicLevel
max_magic_tasks: MaxMagicTasks
magic_task_weight: MagicTaskWeight
max_runecraft_level: MaxRunecraftLevel
max_runecraft_tasks: MaxRunecraftTasks
runecraft_task_weight: RunecraftTaskWeight
max_crafting_level: MaxCraftingLevel
max_crafting_tasks: MaxCraftingTasks
crafting_task_weight: CraftingTaskWeight
max_mining_level: MaxMiningLevel
max_mining_tasks: MaxMiningTasks
mining_task_weight: MiningTaskWeight
max_smithing_level: MaxSmithingLevel
max_smithing_tasks: MaxSmithingTasks
smithing_task_weight: SmithingTaskWeight
max_fishing_level: MaxFishingLevel
max_fishing_tasks: MaxFishingTasks
fishing_task_weight: FishingTaskWeight
max_cooking_level: MaxCookingLevel
max_cooking_tasks: MaxCookingTasks
cooking_task_weight: CookingTaskWeight
max_firemaking_level: MaxFiremakingLevel
max_firemaking_tasks: MaxFiremakingTasks
firemaking_task_weight: FiremakingTaskWeight
max_woodcutting_level: MaxWoodcuttingLevel
max_woodcutting_tasks: MaxWoodcuttingTasks
woodcutting_task_weight: WoodcuttingTaskWeight
minimum_general_tasks: MinimumGeneralTasks
general_task_weight: GeneralTaskWeight

View File

@@ -1,12 +0,0 @@
import typing
class RegionRow(typing.NamedTuple):
name: str
itemReq: str
connections: typing.List[str]
resources: typing.List[str]
class ResourceRow(typing.NamedTuple):
name: str

View File

@@ -1,657 +0,0 @@
import typing
from BaseClasses import Item, Tutorial, ItemClassification, Region, MultiWorld
from worlds.AutoWorld import WebWorld, World
from worlds.generic.Rules import add_rule, CollectionRule
from .Items import OSRSItem, starting_area_dict, chunksanity_starting_chunks, QP_Items, ItemRow, \
chunksanity_special_region_names
from .Locations import OSRSLocation, LocationRow
from .Options import OSRSOptions, StartingArea
from .Names import LocationNames, ItemNames, RegionNames
from .LogicCSV.LogicCSVToPython import data_csv_tag
from .LogicCSV.items_generated import item_rows
from .LogicCSV.locations_generated import location_rows
from .LogicCSV.regions_generated import region_rows
from .LogicCSV.resources_generated import resource_rows
from .Regions import RegionRow, ResourceRow
class OSRSWeb(WebWorld):
theme = "stone"
setup_en = Tutorial(
"Multiworld Setup Guide",
"A guide to setting up the Old School Runescape Randomizer connected to an Archipelago Multiworld",
"English",
"docs/setup_en.md",
"setup/en",
["digiholic"]
)
tutorials = [setup_en]
class OSRSWorld(World):
game = "Old School Runescape"
options_dataclass = OSRSOptions
options: OSRSOptions
topology_present = True
web = OSRSWeb()
base_id = 0x070000
data_version = 1
item_name_to_id = {item_rows[i].name: 0x070000 + i for i in range(len(item_rows))}
location_name_to_id = {location_rows[i].name: 0x070000 + i for i in range(len(location_rows))}
region_name_to_data: typing.Dict[str, Region]
location_name_to_data: typing.Dict[str, OSRSLocation]
location_rows_by_name: typing.Dict[str, LocationRow]
region_rows_by_name: typing.Dict[str, RegionRow]
resource_rows_by_name: typing.Dict[str, ResourceRow]
item_rows_by_name: typing.Dict[str, ItemRow]
starting_area_item: str
locations_by_category: typing.Dict[str, typing.List[LocationRow]]
def __init__(self, world: MultiWorld, player: int):
super().__init__(world, player)
self.region_name_to_data = {}
self.location_name_to_data = {}
self.location_rows_by_name = {}
self.region_rows_by_name = {}
self.resource_rows_by_name = {}
self.item_rows_by_name = {}
self.starting_area_item = ""
self.locations_by_category = {}
def generate_early(self) -> None:
location_categories = [location_row.category for location_row in location_rows]
self.locations_by_category = {category:
[location_row for location_row in location_rows if
location_row.category == category]
for category in location_categories}
self.location_rows_by_name = {loc_row.name: loc_row for loc_row in location_rows}
self.region_rows_by_name = {reg_row.name: reg_row for reg_row in region_rows}
self.resource_rows_by_name = {rec_row.name: rec_row for rec_row in resource_rows}
self.item_rows_by_name = {it_row.name: it_row for it_row in item_rows}
rnd = self.random
starting_area = self.options.starting_area
if starting_area.value == StartingArea.option_any_bank:
self.starting_area_item = rnd.choice(starting_area_dict)
elif starting_area.value < StartingArea.option_chunksanity:
self.starting_area_item = starting_area_dict[starting_area.value]
else:
self.starting_area_item = rnd.choice(chunksanity_starting_chunks)
# Set Starting Chunk
self.multiworld.push_precollected(self.create_item(self.starting_area_item))
"""
This function pulls from LogicCSVToPython so that it sends the correct tag of the repository to the client.
_Make sure to update that value whenever the CSVs change!_
"""
def fill_slot_data(self):
data = self.options.as_dict("brutal_grinds")
data["data_csv_tag"] = data_csv_tag
return data
def create_regions(self) -> None:
"""
called to place player's regions into the MultiWorld's regions list. If it's hard to separate, this can be done
during generate_early or basic as well.
"""
# First, create the "Menu" region to start
menu_region = self.create_region("Menu")
for region_row in region_rows:
self.create_region(region_row.name)
for resource_row in resource_rows:
self.create_region(resource_row.name)
# Removes the word "Area: " from the item name to get the region it applies to.
# I figured tacking "Area: " at the beginning would make it _easier_ to tell apart. Turns out it made it worse
if self.starting_area_item in chunksanity_special_region_names:
starting_area_region = chunksanity_special_region_names[self.starting_area_item]
else:
starting_area_region = self.starting_area_item[6:] # len("Area: ")
starting_entrance = menu_region.create_exit(f"Start->{starting_area_region}")
starting_entrance.access_rule = lambda state: state.has(self.starting_area_item, self.player)
starting_entrance.connect(self.region_name_to_data[starting_area_region])
# Create entrances between regions
for region_row in region_rows:
region = self.region_name_to_data[region_row.name]
for outbound_region_name in region_row.connections:
parsed_outbound = outbound_region_name.replace('*', '')
entrance = region.create_exit(f"{region_row.name}->{parsed_outbound}")
entrance.connect(self.region_name_to_data[parsed_outbound])
item_name = self.region_rows_by_name[parsed_outbound].itemReq
if "*" not in outbound_region_name and "*" not in item_name:
entrance.access_rule = lambda state, item_name=item_name: state.has(item_name, self.player)
continue
self.generate_special_rules_for(entrance, region_row, outbound_region_name)
for resource_region in region_row.resources:
if not resource_region:
continue
entrance = region.create_exit(f"{region_row.name}->{resource_region.replace('*', '')}")
if "*" not in resource_region:
entrance.connect(self.region_name_to_data[resource_region])
else:
self.generate_special_rules_for(entrance, region_row, resource_region)
entrance.connect(self.region_name_to_data[resource_region.replace('*', '')])
self.roll_locations()
def generate_special_rules_for(self, entrance, region_row, outbound_region_name):
# print(f"Special rules required to access region {outbound_region_name} from {region_row.name}")
if outbound_region_name == RegionNames.Cooks_Guild:
item_name = self.region_rows_by_name[outbound_region_name].itemReq.replace('*', '')
cooking_level_rule = self.get_skill_rule("cooking", 32)
entrance.access_rule = lambda state: state.has(item_name, self.player) and \
cooking_level_rule(state)
return
if outbound_region_name == RegionNames.Crafting_Guild:
item_name = self.region_rows_by_name[outbound_region_name].itemReq.replace('*', '')
crafting_level_rule = self.get_skill_rule("crafting", 40)
entrance.access_rule = lambda state: state.has(item_name, self.player) and \
crafting_level_rule(state)
return
if outbound_region_name == RegionNames.Corsair_Cove:
item_name = self.region_rows_by_name[outbound_region_name].itemReq.replace('*', '')
# Need to be able to start Corsair Curse in addition to having the item
entrance.access_rule = lambda state: state.has(item_name, self.player) and \
state.can_reach(RegionNames.Falador_Farm, "Region", self.player)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.Falador_Farm, self.player), entrance)
return
if outbound_region_name == "Camdozaal*":
item_name = self.region_rows_by_name[outbound_region_name.replace('*', '')].itemReq
entrance.access_rule = lambda state: state.has(item_name, self.player) and \
state.has(ItemNames.QP_Below_Ice_Mountain, self.player)
return
if region_row.name == "Dwarven Mountain Pass" and outbound_region_name == "Anvil*":
entrance.access_rule = lambda state: state.has(ItemNames.QP_Dorics_Quest, self.player)
return
# Special logic for canoes
canoe_regions = [RegionNames.Lumbridge, RegionNames.South_Of_Varrock, RegionNames.Barbarian_Village,
RegionNames.Edgeville, RegionNames.Wilderness]
if region_row.name in canoe_regions:
# Skill rules for greater distances
woodcutting_rule_d1 = self.get_skill_rule("woodcutting", 12)
woodcutting_rule_d2 = self.get_skill_rule("woodcutting", 27)
woodcutting_rule_d3 = self.get_skill_rule("woodcutting", 42)
woodcutting_rule_all = self.get_skill_rule("woodcutting", 57)
if region_row.name == RegionNames.Lumbridge:
# Canoe Tree access for the Location
if outbound_region_name == RegionNames.Canoe_Tree:
entrance.access_rule = \
lambda state: (state.can_reach_region(RegionNames.South_Of_Varrock, self.player)
and woodcutting_rule_d1(state) and self.options.max_woodcutting_level >= 12) or \
(state.can_reach_region(RegionNames.Barbarian_Village)
and woodcutting_rule_d2(state) and self.options.max_woodcutting_level >= 27) or \
(state.can_reach_region(RegionNames.Edgeville)
and woodcutting_rule_d3(state) and self.options.max_woodcutting_level >= 42) or \
(state.can_reach_region(RegionNames.Wilderness)
and woodcutting_rule_all(state) and self.options.max_woodcutting_level >= 57)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.South_Of_Varrock, self.player), entrance)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.Barbarian_Village, self.player), entrance)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.Edgeville, self.player), entrance)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.Wilderness, self.player), entrance)
# Access to other chunks based on woodcutting settings
# South of Varrock does not need to be checked, because it's already adjacent
if outbound_region_name == RegionNames.Barbarian_Village:
entrance.access_rule = lambda state: woodcutting_rule_d2(state) \
and self.options.max_woodcutting_level >= 27
if outbound_region_name == RegionNames.Edgeville:
entrance.access_rule = lambda state: woodcutting_rule_d3(state) \
and self.options.max_woodcutting_level >= 42
if outbound_region_name == RegionNames.Wilderness:
entrance.access_rule = lambda state: woodcutting_rule_all(state) \
and self.options.max_woodcutting_level >= 57
if region_row.name == RegionNames.South_Of_Varrock:
if outbound_region_name == RegionNames.Canoe_Tree:
entrance.access_rule = \
lambda state: (state.can_reach_region(RegionNames.Lumbridge, self.player)
and woodcutting_rule_d1(state) and self.options.max_woodcutting_level >= 12) or \
(state.can_reach_region(RegionNames.Barbarian_Village)
and woodcutting_rule_d1(state) and self.options.max_woodcutting_level >= 12) or \
(state.can_reach_region(RegionNames.Edgeville)
and woodcutting_rule_d2(state) and self.options.max_woodcutting_level >= 27) or \
(state.can_reach_region(RegionNames.Wilderness)
and woodcutting_rule_d3(state) and self.options.max_woodcutting_level >= 42)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.Lumbridge, self.player), entrance)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.Barbarian_Village, self.player), entrance)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.Edgeville, self.player), entrance)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.Wilderness, self.player), entrance)
# Access to other chunks based on woodcutting settings
# Lumbridge does not need to be checked, because it's already adjacent
if outbound_region_name == RegionNames.Barbarian_Village:
entrance.access_rule = lambda state: woodcutting_rule_d1(state) \
and self.options.max_woodcutting_level >= 12
if outbound_region_name == RegionNames.Edgeville:
entrance.access_rule = lambda state: woodcutting_rule_d3(state) \
and self.options.max_woodcutting_level >= 27
if outbound_region_name == RegionNames.Wilderness:
entrance.access_rule = lambda state: woodcutting_rule_all(state) \
and self.options.max_woodcutting_level >= 42
if region_row.name == RegionNames.Barbarian_Village:
if outbound_region_name == RegionNames.Canoe_Tree:
entrance.access_rule = \
lambda state: (state.can_reach_region(RegionNames.Lumbridge, self.player)
and woodcutting_rule_d2(state) and self.options.max_woodcutting_level >= 27) or \
(state.can_reach_region(RegionNames.South_Of_Varrock)
and woodcutting_rule_d1(state) and self.options.max_woodcutting_level >= 12) or \
(state.can_reach_region(RegionNames.Edgeville)
and woodcutting_rule_d1(state) and self.options.max_woodcutting_level >= 12) or \
(state.can_reach_region(RegionNames.Wilderness)
and woodcutting_rule_d2(state) and self.options.max_woodcutting_level >= 27)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.Lumbridge, self.player), entrance)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.South_Of_Varrock, self.player), entrance)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.Edgeville, self.player), entrance)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.Wilderness, self.player), entrance)
# Access to other chunks based on woodcutting settings
if outbound_region_name == RegionNames.Lumbridge:
entrance.access_rule = lambda state: woodcutting_rule_d2(state) \
and self.options.max_woodcutting_level >= 27
if outbound_region_name == RegionNames.South_Of_Varrock:
entrance.access_rule = lambda state: woodcutting_rule_d1(state) \
and self.options.max_woodcutting_level >= 12
# Edgeville does not need to be checked, because it's already adjacent
if outbound_region_name == RegionNames.Wilderness:
entrance.access_rule = lambda state: woodcutting_rule_d3(state) \
and self.options.max_woodcutting_level >= 42
if region_row.name == RegionNames.Edgeville:
if outbound_region_name == RegionNames.Canoe_Tree:
entrance.access_rule = \
lambda state: (state.can_reach_region(RegionNames.Lumbridge, self.player)
and woodcutting_rule_d3(state) and self.options.max_woodcutting_level >= 42) or \
(state.can_reach_region(RegionNames.South_Of_Varrock)
and woodcutting_rule_d2(state) and self.options.max_woodcutting_level >= 27) or \
(state.can_reach_region(RegionNames.Barbarian_Village)
and woodcutting_rule_d1(state) and self.options.max_woodcutting_level >= 12) or \
(state.can_reach_region(RegionNames.Wilderness)
and woodcutting_rule_d1(state) and self.options.max_woodcutting_level >= 12)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.Lumbridge, self.player), entrance)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.South_Of_Varrock, self.player), entrance)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.Barbarian_Village, self.player), entrance)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.Wilderness, self.player), entrance)
# Access to other chunks based on woodcutting settings
if outbound_region_name == RegionNames.Lumbridge:
entrance.access_rule = lambda state: woodcutting_rule_d3(state) \
and self.options.max_woodcutting_level >= 42
if outbound_region_name == RegionNames.South_Of_Varrock:
entrance.access_rule = lambda state: woodcutting_rule_d2(state) \
and self.options.max_woodcutting_level >= 27
# Barbarian Village does not need to be checked, because it's already adjacent
# Wilderness does not need to be checked, because it's already adjacent
if region_row.name == RegionNames.Wilderness:
if outbound_region_name == RegionNames.Canoe_Tree:
entrance.access_rule = \
lambda state: (state.can_reach_region(RegionNames.Lumbridge, self.player)
and woodcutting_rule_all(state) and self.options.max_woodcutting_level >= 57) or \
(state.can_reach_region(RegionNames.South_Of_Varrock)
and woodcutting_rule_d3(state) and self.options.max_woodcutting_level >= 42) or \
(state.can_reach_region(RegionNames.Barbarian_Village)
and woodcutting_rule_d2(state) and self.options.max_woodcutting_level >= 27) or \
(state.can_reach_region(RegionNames.Edgeville)
and woodcutting_rule_d1(state) and self.options.max_woodcutting_level >= 12)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.Lumbridge, self.player), entrance)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.South_Of_Varrock, self.player), entrance)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.Barbarian_Village, self.player), entrance)
self.multiworld.register_indirect_condition(
self.multiworld.get_region(RegionNames.Edgeville, self.player), entrance)
# Access to other chunks based on woodcutting settings
if outbound_region_name == RegionNames.Lumbridge:
entrance.access_rule = lambda state: woodcutting_rule_all(state) \
and self.options.max_woodcutting_level >= 57
if outbound_region_name == RegionNames.South_Of_Varrock:
entrance.access_rule = lambda state: woodcutting_rule_d3(state) \
and self.options.max_woodcutting_level >= 42
if outbound_region_name == RegionNames.Barbarian_Village:
entrance.access_rule = lambda state: woodcutting_rule_d2(state) \
and self.options.max_woodcutting_level >= 27
# Edgeville does not need to be checked, because it's already adjacent
def roll_locations(self):
locations_required = 0
generation_is_fake = hasattr(self.multiworld, "generation_is_fake") # UT specific override
for item_row in item_rows:
locations_required += item_row.amount
locations_added = 1 # At this point we've already added the starting area, so we start at 1 instead of 0
# Quests are always added
for i, location_row in enumerate(location_rows):
if location_row.category in {"quest", "points", "goal"}:
self.create_and_add_location(i)
if location_row.category == "quest":
locations_added += 1
# Build up the weighted Task Pool
rnd = self.random
# Start with the minimum general tasks
general_tasks = [task for task in self.locations_by_category["general"]]
if not self.options.progressive_tasks:
rnd.shuffle(general_tasks)
else:
general_tasks.reverse()
for i in range(self.options.minimum_general_tasks):
task = general_tasks.pop()
self.add_location(task)
locations_added += 1
general_weight = self.options.general_task_weight if len(general_tasks) > 0 else 0
tasks_per_task_type: typing.Dict[str, typing.List[LocationRow]] = {}
weights_per_task_type: typing.Dict[str, int] = {}
task_types = ["prayer", "magic", "runecraft", "mining", "crafting",
"smithing", "fishing", "cooking", "firemaking", "woodcutting", "combat"]
for task_type in task_types:
max_level_for_task_type = getattr(self.options, f"max_{task_type}_level")
max_amount_for_task_type = getattr(self.options, f"max_{task_type}_tasks")
tasks_for_this_type = [task for task in self.locations_by_category[task_type]
if task.skills[0].level <= max_level_for_task_type]
if not self.options.progressive_tasks:
rnd.shuffle(tasks_for_this_type)
else:
tasks_for_this_type.reverse()
tasks_for_this_type = tasks_for_this_type[:max_amount_for_task_type]
weight_for_this_type = getattr(self.options,
f"{task_type}_task_weight")
if weight_for_this_type > 0 and tasks_for_this_type:
tasks_per_task_type[task_type] = tasks_for_this_type
weights_per_task_type[task_type] = weight_for_this_type
# Build a list of collections and weights in a matching order for rnd.choices later
all_tasks = []
all_weights = []
for task_type in task_types:
if task_type in tasks_per_task_type:
all_tasks.append(tasks_per_task_type[task_type])
all_weights.append(weights_per_task_type[task_type])
# Even after the initial forced generals, they can still be rolled randomly
if general_weight > 0:
all_tasks.append(general_tasks)
all_weights.append(general_weight)
while locations_added < locations_required or (generation_is_fake and len(all_tasks) > 0):
if all_tasks:
chosen_task = rnd.choices(all_tasks, all_weights)[0]
if chosen_task:
task = chosen_task.pop()
self.add_location(task)
locations_added += 1
# This isn't an else because chosen_task can become empty in the process of resolving the above block
# We still want to clear this list out while we're doing that
if not chosen_task:
index = all_tasks.index(chosen_task)
del all_tasks[index]
del all_weights[index]
else:
if len(general_tasks) == 0:
raise Exception(f"There are not enough available tasks to fill the remaining pool for OSRS " +
f"Please adjust {self.player_name}'s settings to be less restrictive of tasks.")
task = general_tasks.pop()
self.add_location(task)
locations_added += 1
def add_location(self, location):
index = [i for i in range(len(location_rows)) if location_rows[i].name == location.name][0]
self.create_and_add_location(index)
def create_items(self) -> None:
for item_row in item_rows:
if item_row.name != self.starting_area_item:
for c in range(item_row.amount):
item = self.create_item(item_row.name)
self.multiworld.itempool.append(item)
def get_filler_item_name(self) -> str:
return self.random.choice(
[ItemNames.Progressive_Armor, ItemNames.Progressive_Weapons, ItemNames.Progressive_Magic,
ItemNames.Progressive_Tools, ItemNames.Progressive_Range_Armor, ItemNames.Progressive_Range_Weapon])
def create_and_add_location(self, row_index) -> None:
location_row = location_rows[row_index]
# print(f"Adding task {location_row.name}")
# Create Location
location_id = self.base_id + row_index
if location_row.category == "points" or location_row.category == "goal":
location_id = None
location = OSRSLocation(self.player, location_row.name, location_id)
self.location_name_to_data[location_row.name] = location
# Add the location to its first region, or if it doesn't belong to one, to Menu
region = self.region_name_to_data["Menu"]
if location_row.regions:
region = self.region_name_to_data[location_row.regions[0]]
location.parent_region = region
region.locations.append(location)
def set_rules(self) -> None:
"""
called to set access and item rules on locations and entrances.
"""
quest_attr_names = ["Cooks_Assistant", "Demon_Slayer", "Restless_Ghost", "Romeo_Juliet",
"Sheep_Shearer", "Shield_of_Arrav", "Ernest_the_Chicken", "Vampyre_Slayer",
"Imp_Catcher", "Prince_Ali_Rescue", "Dorics_Quest", "Black_Knights_Fortress",
"Witchs_Potion", "Knights_Sword", "Goblin_Diplomacy", "Pirates_Treasure",
"Rune_Mysteries", "Misthalin_Mystery", "Corsair_Curse", "X_Marks_the_Spot",
"Below_Ice_Mountain"]
for qp_attr_name in quest_attr_names:
loc_name = getattr(LocationNames, f"QP_{qp_attr_name}")
item_name = getattr(ItemNames, f"QP_{qp_attr_name}")
self.multiworld.get_location(loc_name, self.player) \
.place_locked_item(self.create_event(item_name))
for quest_attr_name in quest_attr_names:
qp_loc_name = getattr(LocationNames, f"QP_{quest_attr_name}")
q_loc_name = getattr(LocationNames, f"Q_{quest_attr_name}")
add_rule(self.multiworld.get_location(qp_loc_name, self.player), lambda state, q_loc_name=q_loc_name: (
self.multiworld.get_location(q_loc_name, self.player).can_reach(state)
))
# place "Victory" at "Dragon Slayer" and set collection as win condition
self.multiworld.get_location(LocationNames.Q_Dragon_Slayer, self.player) \
.place_locked_item(self.create_event("Victory"))
self.multiworld.completion_condition[self.player] = lambda state: (state.has("Victory", self.player))
for location_name, location in self.location_name_to_data.items():
location_row = self.location_rows_by_name[location_name]
# Set up requirements for region
for region_required_name in location_row.regions:
region_required = self.region_name_to_data[region_required_name]
add_rule(location,
lambda state, region_required=region_required: state.can_reach(region_required, "Region",
self.player))
for skill_req in location_row.skills:
add_rule(location, self.get_skill_rule(skill_req.skill, skill_req.level))
for item_req in location_row.items:
add_rule(location, lambda state, item_req=item_req: state.has(item_req, self.player))
if location_row.qp:
add_rule(location, lambda state, location_row=location_row: self.quest_points(state) > location_row.qp)
def create_region(self, name: str) -> "Region":
region = Region(name, self.player, self.multiworld)
self.region_name_to_data[name] = region
self.multiworld.regions.append(region)
return region
def create_item(self, item_name: str) -> "Item":
item = [item for item in item_rows if item.name == item_name][0]
index = item_rows.index(item)
return OSRSItem(item.name, item.progression, self.base_id + index, self.player)
def create_event(self, event: str):
# while we are at it, we can also add a helper to create events
return OSRSItem(event, ItemClassification.progression, None, self.player)
def quest_points(self, state):
qp = 0
for qp_event in QP_Items:
if state.has(qp_event, self.player):
qp += int(qp_event[0])
return qp
"""
Ensures a target level can be reached with available resources
"""
def get_skill_rule(self, skill, level) -> CollectionRule:
if skill.lower() == "fishing":
if self.options.brutal_grinds or level < 5:
return lambda state: state.can_reach(RegionNames.Shrimp, "Region", self.player)
if level < 20:
return lambda state: state.can_reach(RegionNames.Shrimp, "Region", self.player) and \
state.can_reach(RegionNames.Port_Sarim, "Region", self.player)
else:
return lambda state: state.can_reach(RegionNames.Shrimp, "Region", self.player) and \
state.can_reach(RegionNames.Port_Sarim, "Region", self.player) and \
state.can_reach(RegionNames.Fly_Fish, "Region", self.player)
if skill.lower() == "mining":
if self.options.brutal_grinds or level < 15:
return lambda state: state.can_reach(RegionNames.Bronze_Ores, "Region", self.player) or \
state.can_reach(RegionNames.Clay_Rock, "Region", self.player)
else:
# Iron is the best way to train all the way to 99, so having access to iron is all you need to check for
return lambda state: (state.can_reach(RegionNames.Bronze_Ores, "Region", self.player) or
state.can_reach(RegionNames.Clay_Rock, "Region", self.player)) and \
state.can_reach(RegionNames.Iron_Rock, "Region", self.player)
if skill.lower() == "woodcutting":
if self.options.brutal_grinds or level < 15:
# I've checked. There is not a single chunk in the f2p that does not have at least one normal tree.
# Even the desert.
return lambda state: True
if level < 30:
return lambda state: state.can_reach(RegionNames.Oak_Tree, "Region", self.player)
else:
return lambda state: state.can_reach(RegionNames.Oak_Tree, "Region", self.player) and \
state.can_reach(RegionNames.Willow_Tree, "Region", self.player)
if skill.lower() == "smithing":
if self.options.brutal_grinds:
return lambda state: state.can_reach(RegionNames.Bronze_Ores, "Region", self.player) and \
state.can_reach(RegionNames.Furnace, "Region", self.player)
if level < 15:
# Lumbridge has a special bronze-only anvil. This is the only anvil of its type so it's not included
# in the "Anvil" resource region. We still need to check for it though.
return lambda state: state.can_reach(RegionNames.Bronze_Ores, "Region", self.player) and \
state.can_reach(RegionNames.Furnace, "Region", self.player) and \
(state.can_reach(RegionNames.Anvil, "Region", self.player) or
state.can_reach(RegionNames.Lumbridge, "Region", self.player))
if level < 30:
# For levels between 15 and 30, the lumbridge anvil won't cut it. Only a real one will do
return lambda state: state.can_reach(RegionNames.Bronze_Ores, "Region", self.player) and \
state.can_reach(RegionNames.Iron_Rock, "Region", self.player) and \
state.can_reach(RegionNames.Furnace, "Region", self.player) and \
state.can_reach(RegionNames.Anvil, "Region", self.player)
else:
return lambda state: state.can_reach(RegionNames.Bronze_Ores, "Region", self.player) and \
state.can_reach(RegionNames.Iron_Rock, "Region", self.player) and \
state.can_reach(RegionNames.Coal_Rock, "Region", self.player) and \
state.can_reach(RegionNames.Furnace, "Region", self.player) and \
state.can_reach(RegionNames.Anvil, "Region", self.player)
if skill.lower() == "crafting":
# Crafting is really complex. Need a lot of sub-rules to make this even remotely readable
def can_spin(state):
return state.can_reach(RegionNames.Sheep, "Region", self.player) and \
state.can_reach(RegionNames.Spinning_Wheel, "Region", self.player)
def can_pot(state):
return state.can_reach(RegionNames.Clay_Rock, "Region", self.player) and \
state.can_reach(RegionNames.Barbarian_Village, "Region", self.player)
def can_tan(state):
return state.can_reach(RegionNames.Milk, "Region", self.player) and \
state.can_reach(RegionNames.Al_Kharid, "Region", self.player)
def mould_access(state):
return state.can_reach(RegionNames.Al_Kharid, "Region", self.player) or \
state.can_reach(RegionNames.Rimmington, "Region", self.player)
def can_silver(state):
return state.can_reach(RegionNames.Silver_Rock, "Region", self.player) and \
state.can_reach(RegionNames.Furnace, "Region", self.player) and mould_access(state)
def can_gold(state):
return state.can_reach(RegionNames.Gold_Rock, "Region", self.player) and \
state.can_reach(RegionNames.Furnace, "Region", self.player) and mould_access(state)
if self.options.brutal_grinds or level < 5:
return lambda state: can_spin(state) or can_pot(state) or can_tan(state)
can_smelt_gold = self.get_skill_rule("smithing", 40)
can_smelt_silver = self.get_skill_rule("smithing", 20)
if level < 16:
return lambda state: can_pot(state) or can_tan(state) or (can_gold(state) and can_smelt_gold(state))
else:
return lambda state: can_tan(state) or (can_silver(state) and can_smelt_silver(state)) or \
(can_gold(state) and can_smelt_gold(state))
if skill.lower() == "Cooking":
if self.options.brutal_grinds or level < 15:
return lambda state: state.can_reach(RegionNames.Milk, "Region", self.player) or \
state.can_reach(RegionNames.Egg, "Region", self.player) or \
state.can_reach(RegionNames.Shrimp, "Region", self.player) or \
(state.can_reach(RegionNames.Wheat, "Region", self.player) and
state.can_reach(RegionNames.Windmill, "Region", self.player))
else:
can_catch_fly_fish = self.get_skill_rule("fishing", 20)
return lambda state: state.can_reach(RegionNames.Fly_Fish, "Region", self.player) and \
can_catch_fly_fish(state) and \
(state.can_reach(RegionNames.Milk, "Region", self.player) or
state.can_reach(RegionNames.Egg, "Region", self.player) or
state.can_reach(RegionNames.Shrimp, "Region", self.player) or
(state.can_reach(RegionNames.Wheat, "Region", self.player) and
state.can_reach(RegionNames.Windmill, "Region", self.player)))
if skill.lower() == "runecraft":
return lambda state: state.has(ItemNames.QP_Rune_Mysteries, self.player)
if skill.lower() == "magic":
return lambda state: state.can_reach(RegionNames.Mind_Runes, "Region", self.player)
return lambda state: True

View File

@@ -1,114 +0,0 @@
# Old School Runescape
## What is the Goal of this Randomizer?
The goal is to complete the quest "Dragon Slayer I" with limited access to gear and map chunks while following normal
Ironman/Group Ironman restrictions on a fresh free-to-play account.
## 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
config file. OSRS contains many options for a highly customizable experience. The options available to you are:
* **Starting Area** - The starting region of your run. This is the first region you will have available, and you can always
freely return to it (see the section below for when it is allowed to cross locked regions to access it)
* You may select a starting city from the list of Lumbridge, Al Kharid, Varrock (East or West), Edgeville, Falador,
Draynor Village, or The Wilderness (Ferox Enclave)
* The option "Any Bank" will choose one of the above regions at random
* The option "Chunksanity" can start you in _any_ chunk, regardless of whether it has access to a bank.
* **Brutal Grinds** - If enabled, the logic will assume you are willing to go to great lengths to train skills.
* As an example, when enabled, it might be in logic to obtain tin and copper from mob drops and smelt bronze bars to
reach Smithing Level 40 to smelt gold for a task.
* If left disabled, the logic will always ensure you have a reasonable method for training a skill to reach a specific
task, such as having access to intermediate-level training options
* **Progressive Tasks** - If enabled, tasks for a skill are generated in order from earliest to latest.
* For example, your first Smithing task would always be "Smelt an Iron Bar", then "Smelt a Silver Bar", and so on.
You would never have the task "Smelt a Gold Bar" without having every previous Smithing task as well.
This can lead to a more consistent length of run, and is generally shorter than disabling it, but with less variety.
* **Skill Category Weighting Options**
* These are available in each task category (all trainable skills plus "Combat" and "General")
* **Max [Category] Level** - The highest level you intend to have to reach in order to complete all tasks for this
category. For the Combat category, this is the max level of monster you are willing to fight.
General tasks do not have a level and thus do not have this option.
* **Max [Category] Tasks** - The highest number of tasks in this category you are willing to be assigned.
Note that you can end up with _less_ than this amount, but never more. The "General" category is used to fill remaining
spots so a maximum is not specified, instead it has a _minimum_ count.
* **[Category] Task Weighting** - The relative weighting of this category to all of the others. Increase this to make
tasks in this category more likely.
## What does randomization do to this game?
The OSRS Archipelago Randomizer takes the form of a "Chunkman" account, a form of challenge account
where you are limited to specific regions of the map (known as "chunks") until you complete tasks to unlock
more. The plugin will interface with the [Region Locker Plugin](https://github.com/slaytostay/region-locker) to
visually display these chunk borders and highlight them as locked or unlocked. The optional included GPU plugin for the
Region Locker can tint the locked areas gray, but is incompatible with other GPU plugins such as 117's HD OSRS.
If you choose not to include it, the world map will show locked and unlocked regions instead.
In order to access a region, you will need to access it entirely through unlocked regions. At no point are you
ever allowed to cross through locked regions, with the following exceptions:
* If your starting region is not Lumbridge, when you complete Tutorial Island, you will need to traverse locked regions
to reach your intended starting location.
* If your starting region is not Lumbridge, you are allowed to "Home Teleport" to your starting region by using the
Lumbridge Home Teleport Spell and then walking to your start location. This is to prevent you from getting "stuck" after
using one-way transportation such as the Port Sarim Jail Teleport from Shantay Pass and being locked out of progression.
* All of your starting Tutorial Island items are assumed to be available at all times. If you have lost an important
item such as a Tinderbox, and cannot re-obtain it in your unlocked region, you are allowed to enter locked regions to
replace it in the least obtrusive way possible.
* If you need to adjust Group Ironman settings, such as adding or removing a member, you may freely access The Node
to do so.
When passing through locked regions for such exceptions, do not interact with any NPCs, items, or enemies and attempt
to spend as little time in them as possible.
The plugin will prevent equipping items that you have not unlocked the ability to wield. For example, attempting
to equip an Iron Platebody before the first Progressive Armor unlock will display a chat message and will not
equip the item.
The plugin will show a list of your current tasks in the sidebar. The plugin will be able to detect the completion
of most tasks, but in the case that a task cannot be detected (for example, killing an enemy with no
drop table such as Deadly Red Spiders), the task can be marked as complete manually by clicking
on the button. This button can also be used to mark completed tasks you have done while playing OSRS mobile or
on a different client without having the plugin available. Simply click the button the next time you are logged in to
Runelite and connected to send the check.
Due to the nature of randomizing a live MMO with no ability to freely edit the character or adjust game logic or
balancing, this randomizer relies heavily on **the honor system**. The plugin cannot prevent you from walking through
locked regions or equipping locked items with the plugin disabled before connecting. It is important
to acknowledge before starting that the entire purpose of the randomizer is a self-imposed challenge, and there
is little point in cheating by circumventing the plugin's restrictions or marking a task complete without actually
completing it. If you wish to play OSRS with no restrictions, that is always available without the plugin.
In order to access the AP Text Client commands (such as `!hint` or to chat with other players in the seed), enter your
command in chat prefaced by the string `!ap`. Example commands:
`!ap buying gf 100k` -> Sends the message "buying gf 100k" to the server
`!ap !hint Area: Lumbridge` -> Attempts to hint for the "Area: Lumbridge" item. Results will appear in your chat box.
Other server messages, such as chat, will appear in your chat box, prefaced by the Archipelago icon.
## What items and locations get shuffled?
Items:
- Every map region (at least one chunk but sometimes more)
- Weapon tiers from iron to Rune (bronze is available from the start)
- Armor tiers from iron to Rune (bronze is available from the start)
- Two Spell Tiers (bolt and blast spells)
- Three tiers of Ranged Armor (leather, studded leather + vambraces, green dragonhide)
- Three tiers of Ranged Weapons (oak, willow, maple bows and their respective highest tier of arrows)
Locations:
* Every Quest is a location that will always be included in every seed
* A random assortment of tasks, separated into categories based on the skill required.
These task categories can have different weights, minimums, and maximums based on your options.
* For a full list of Locations, items, and regions, see the
[Logic Document](https://docs.google.com/spreadsheets/d/1R8Cm8L6YkRWeiN7uYrdru8Vc1DlJ0aFAinH_fwhV8aU/edit?usp=sharing)
## Which items can be in another player's world?
Any item or region unlock can be found in any player's world.
## What does another world's item look like in Old School Runescape?
Upon completing a task, the item and recipient will be listed in the player's chatbox.
## When the player receives an item, what happens?
In addition to the message appearing in the chatbox, a UI window will appear listing the item and who sent it.
These boxes also appear when connecting to a seed already in progress to list the items you have acquired while offline.
The sidebar will list all received items below the task list, starting with regions, then showing the highest tier of
equipment in each category.

View File

@@ -1,58 +0,0 @@
# Setup Guide for Old School Runescape
## Required Software
- [RuneLite](https://runelite.net/)
- If the account being used has been migrated to a Jagex Account, the [Jagex Launcher](https://www.jagex.com/en-GB/launcher)
will also be necessary to run RuneLite
## Configuring your YAML file
### What is a YAML file and why do I need one?
Your YAML file contains a set of configuration options which provide the generator with information about how it should
generate your game. Each player of a multiworld will provide their own YAML file. This setup allows each player to enjoy
an experience customized for their taste, and different players in the same multiworld can all have different options.
### Where do I get a YAML file?
You can customize your settings by visiting the
[Old School Runescape Player Options Page](/games/Old%20School%20Runescape/player-options).
## Joining a MultiWorld Game
### Install the RuneLite Plugins
Open RuneLite and click on the wrench icon on the right side. From there, click on the plug icon to access the
Plugin Hub. You will need to install the [Archipelago Plugin](https://github.com/digiholic/osrs-archipelago)
and [Region Locker Plugin](https://github.com/slaytostay/region-locker). The Region Locker plugin
will include three plugins; only the `Region Locker` plugin itself is required. The `Region Locker GPU` plugin can be
used to display locked chunks in gray, but is incompatible with other GPU plugins such as 117's HD OSRS and can be
disabled.
### Create a new OSRS Account
The OSRS Randomizer assumes you are playing on a newly created f2p Ironman account. As such, you will need to [create a
new Runescape account](https://secure.runescape.com/m=account-creation/create_account?theme=oldschool).
If you already have a [Jagex Account](https://www.jagex.com/en-GB/accounts) you can add up to 20 characters on
one account through the Jagex Launcher. Note that there is currently no way to _remove_ characters
from a Jagex Account, as such, you might want to create a separate account to hold your Archipelago
characters if you intend to use your main Jagex account for more characters in the future.
**Protip**: In order to avoid having to remember random email addresses for many accounts, take advantage of an email
alias, a feature supported by most email providers. Any text after a `+` in your email address will redirect to your
normal address, but the email will be recognized by the Jagex login as a new email address. For example, if your email
were `Archipelago@gmail.com`, entering `Archipelago+OSRSRandomizer@gmail.com` would cause the confirmation email to
be sent to your primary address, but the alias can be used to create a new account. One recommendation would be to
include the date of generation in the account, such as `Archipelago+APYYMMDD@gmail.com` for easy memorability.
After creating an account, you may run through Tutorial Island without connecting; the randomizer has no
effect on the Tutorial.
### Connect to the Multiserver
In the Archipelago Plugin, enter your server information. The `Auto Reconnect on Login For` field should remain blank;
it will be populated by the character name you first connect with, and it will reconnect to the AP server whenever that
character logs in. Open the Archipelago panel on the right-hand side to connect to the multiworld while logged in to
a game world to associate this character to the randomizer.
For further information about how to connect to the server in the RuneLite plugin,
please see the [Archipelago Plugin](https://github.com/digiholic/osrs-archipelago) instructions.

View File

@@ -443,7 +443,7 @@ class PokemonRedBlueWorld(World):
self.multiworld.elite_four_pokedex_condition[self.player].total = \
int((len(reachable_mons) / 100) * self.multiworld.elite_four_pokedex_condition[self.player].value)
if self.multiworld.accessibility[self.player] == "full":
if self.multiworld.accessibility[self.player] == "locations":
balls = [self.create_item(ball) for ball in ["Poke Ball", "Great Ball", "Ultra Ball"]]
traps = [self.create_item(trap) for trap in item_groups["Traps"]]
locations = [location for location in self.multiworld.get_locations(self.player) if "Pokedex - " in

View File

@@ -1,4 +1,4 @@
from Options import Toggle, Choice, Range, NamedRange, TextChoice, DeathLink, ItemsAccessibility
from Options import Toggle, Choice, Range, NamedRange, TextChoice, DeathLink
class GameVersion(Choice):
@@ -287,7 +287,7 @@ class AllPokemonSeen(Toggle):
class DexSanity(NamedRange):
"""Adds location checks for Pokemon flagged "owned" on your Pokedex. You may specify a percentage of Pokemon to
have checks added. If Accessibility is set to full, this will be the percentage of all logically reachable
have checks added. If Accessibility is set to locations, this will be the percentage of all logically reachable
Pokemon that will get a location check added to it. With items or minimal Accessibility, it will be the percentage
of all 151 Pokemon.
If Pokedex is required, the items for Pokemon acquired before acquiring the Pokedex can be found by talking to
@@ -418,10 +418,10 @@ class ExpModifier(NamedRange):
"""Modifier for EXP gained. When specifying a number, exp is multiplied by this amount and divided by 16."""
display_name = "Exp Modifier"
default = 16
range_start = default // 4
range_start = default / 4
range_end = 255
special_range_names = {
"half": default // 2,
"half": default / 2,
"normal": default,
"double": default * 2,
"triple": default * 3,
@@ -861,7 +861,6 @@ class RandomizePokemonPalettes(Choice):
pokemon_rb_options = {
"accessibility": ItemsAccessibility,
"game_version": GameVersion,
"trainer_name": TrainerName,
"rival_name": RivalName,
@@ -960,4 +959,4 @@ pokemon_rb_options = {
"ice_trap_weight": IceTrapWeight,
"randomize_pokemon_palettes": RandomizePokemonPalettes,
"death_link": DeathLink
}
}

View File

@@ -22,7 +22,7 @@ def set_rules(multiworld, player):
item_rules["Celadon Prize Corner - Item Prize 2"] = prize_rule
item_rules["Celadon Prize Corner - Item Prize 3"] = prize_rule
if multiworld.accessibility[player] != "full":
if multiworld.accessibility[player] != "locations":
multiworld.get_location("Cerulean Bicycle Shop", player).always_allow = (lambda state, item:
item.name == "Bike Voucher"
and item.player == player)

View File

@@ -31,17 +31,23 @@ def has_all_items(multiworld: MultiWorld, items: Set[str], region: str, player:
# Checks to see if chest/shrine are accessible
def has_location_access_rule(multiworld: MultiWorld, environment: str, player: int, item_number: int, item_type: str)\
-> None:
location_name = f"{environment}: {item_type} {item_number}"
if item_type == "Scavenger":
if item_number == 1:
multiworld.get_location(f"{environment}: {item_type} {item_number}", player).access_rule = \
lambda state: state.has(environment, player)
# scavengers need to be locked till after a full loop since that is when they are capable of spawning.
# (While technically the requirement is just beating 5 stages, this will ensure that the player will have
# a long enough run to have enough director credits for scavengers and
# help prevent being stuck in the same stages until that point).
multiworld.get_location(location_name, player).access_rule = \
lambda state: state.has(environment, player) and state.has("Stage 5", player)
if item_type == "Scavenger":
multiworld.get_location(f"{environment}: {item_type} {item_number}", player).access_rule = \
lambda state: state.has(environment, player) and state.has("Stage 5", player)
else:
multiworld.get_location(location_name, player).access_rule = \
lambda state: state.has(environment, player)
multiworld.get_location(f"{environment}: {item_type} {item_number}", player).access_rule = \
lambda state: check_location(state, environment, player, item_number, item_type)
def check_location(state, environment: str, player: int, item_number: int, item_name: str) -> bool:
return state.can_reach(f"{environment}: {item_name} {item_number - 1}", "Location", player)
def set_rules(ror2_world: "RiskOfRainWorld") -> None:

Some files were not shown because too many files have changed in this diff Show More