Skip to content

Commit

Permalink
Merge branch 'main' into civ6-1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hesto2 authored Oct 12, 2024
2 parents 05a3c76 + ef4d1e7 commit 61968e8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
5 changes: 4 additions & 1 deletion MultiServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,10 @@ def __call__(self, raw: str) -> typing.Optional[bool]:
if not raw:
return
try:
command = shlex.split(raw, comments=False)
try:
command = shlex.split(raw, comments=False)
except ValueError: # most likely: "ValueError: No closing quotation"
command = raw.split()
basecommand = command[0]
if basecommand[0] == self.marker:
method = self.commands.get(basecommand[1:].lower(), None)
Expand Down
4 changes: 3 additions & 1 deletion worlds/dark_souls_3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def __init__(self, multiworld: MultiWorld, player: int):
self.all_excluded_locations = set()

def generate_early(self) -> None:
self.created_regions = set()
self.all_excluded_locations.update(self.options.exclude_locations.value)

# Inform Universal Tracker where Yhorm is being randomized to.
Expand Down Expand Up @@ -294,6 +295,7 @@ def create_region(self, region_name, location_table) -> Region:
new_region.locations.append(new_location)

self.multiworld.regions.append(new_region)
self.created_regions.add(region_name)
return new_region

def create_items(self) -> None:
Expand Down Expand Up @@ -1305,7 +1307,7 @@ def _add_location_rule(self, location: Union[str, List[str]], rule: Union[Collec
def _add_entrance_rule(self, region: str, rule: Union[CollectionRule, str]) -> None:
"""Sets a rule for the entrance to the given region."""
assert region in location_tables
if not any(region == reg for reg in self.multiworld.regions.region_cache[self.player]): return
if region not in self.created_regions: return
if isinstance(rule, str):
if " -> " not in rule:
assert item_dictionary[rule].classification == ItemClassification.progression
Expand Down
2 changes: 2 additions & 0 deletions worlds/messenger/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ def __init__(self, world: "MessengerWorld") -> None:
}

self.location_rules = {
# hq
"Money Wrench": self.can_shop,
# ninja village
"Ninja Village Seal - Tree House":
self.has_dart,
Expand Down
13 changes: 13 additions & 0 deletions worlds/messenger/test/test_shop.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import Dict

from BaseClasses import CollectionState
from . import MessengerTestBase
from ..shop import SHOP_ITEMS, FIGURINES

Expand Down Expand Up @@ -89,3 +90,15 @@ def test_costs(self) -> None:

self.assertTrue(loc in FIGURINES)
self.assertEqual(len(figures), len(FIGURINES))

max_cost_state = CollectionState(self.multiworld)
self.assertFalse(self.world.get_location("Money Wrench").can_reach(max_cost_state))
prog_shards = []
for item in self.multiworld.itempool:
if "Time Shard " in item.name:
value = int(item.name.strip("Time Shard ()"))
if value >= 100:
prog_shards.append(item)
for shard in prog_shards:
max_cost_state.collect(shard, True)
self.assertTrue(self.world.get_location("Money Wrench").can_reach(max_cost_state))

0 comments on commit 61968e8

Please sign in to comment.