Skip to content

Commit

Permalink
Merge branch 'kp/ChestRename' of https://github.com/Kappatechy/Archip…
Browse files Browse the repository at this point in the history
…elago into kp/ChestRename
  • Loading branch information
Kappatechy committed Feb 14, 2024
2 parents 8a38588 + b2cb2af commit e44cf9d
Show file tree
Hide file tree
Showing 12 changed files with 162 additions and 114 deletions.
3 changes: 2 additions & 1 deletion LinksAwakeningClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ async def wait_for_retroarch_connection(self):
await asyncio.sleep(1.0)
continue
self.stop_bizhawk_spam = False
logger.info(f"Connected to Retroarch {version.decode('ascii')} running {rom_name.decode('ascii')}")
logger.info(f"Connected to Retroarch {version.decode('ascii', errors='replace')} "
f"running {rom_name.decode('ascii', errors='replace')}")
return
except (BlockingIOError, TimeoutError, ConnectionResetError):
await asyncio.sleep(1.0)
Expand Down
4 changes: 2 additions & 2 deletions worlds/ladx/LADXR/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def setReplacementName(key: str, value: str) -> None:

def formatText(instr: str, *, center: bool = False, ask: Optional[str] = None) -> bytes:
instr = instr.format(**_NAMES)
s = instr.encode("ascii")
s = instr.encode("ascii", errors="replace")
s = s.replace(b"'", b"^")

def padLine(line: bytes) -> bytes:
Expand All @@ -169,7 +169,7 @@ def padLine(line: bytes) -> bytes:
if result_line:
result += padLine(result_line)
if ask is not None:
askbytes = ask.encode("ascii")
askbytes = ask.encode("ascii", errors="replace")
result = result.rstrip()
while len(result) % 32 != 16:
result += b' '
Expand Down
93 changes: 42 additions & 51 deletions worlds/lingo/data/LL1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@
group: Color Hunt Barriers
skip_location: True
panels:
- room: Champion's Rest
- room: Color Hunt
panel: PURPLE
Hallway Door:
id: Red Blue Purple Room Area Doors/Door_room_2
Expand Down Expand Up @@ -1957,7 +1957,7 @@
group: Color Hunt Barriers
skip_location: True
panels:
- room: Champion's Rest
- room: Color Hunt
panel: RED
Rhyme Room Entrance:
id: Double Room Area Doors/Door_room_entry_stairs2
Expand All @@ -1975,9 +1975,9 @@
- Color Arrow Room Doors/Door_orange_hider_1
- Color Arrow Room Doors/Door_orange_hider_2
- Color Arrow Room Doors/Door_orange_hider_3
location_name: Color Hunt - RED and YELLOW
group: Champion's Rest - Color Barriers
item_name: Champion's Rest - Orange Barrier
location_name: Color Barriers - RED and YELLOW
group: Color Hunt Barriers
item_name: Color Hunt - Orange Barrier
panels:
- RED
- room: Directional Gallery
Expand Down Expand Up @@ -2382,7 +2382,7 @@
group: Color Hunt Barriers
skip_location: True
panels:
- room: Champion's Rest
- room: Color Hunt
panel: GREEN
paintings:
- id: flower_painting_7
Expand Down Expand Up @@ -2893,14 +2893,14 @@
group: Color Hunt Barriers
skip_location: True
panels:
- room: Champion's Rest
- room: Color Hunt
panel: BLUE
Orange Barrier:
id: Color Arrow Room Doors/Door_orange_3
group: Color Hunt Barriers
skip_location: True
panels:
- room: Champion's Rest
- room: Color Hunt
panel: ORANGE
Initiated Entrance:
id: Red Blue Purple Room Area Doors/Door_locked_knocked
Expand All @@ -2912,9 +2912,9 @@
# containing region.
Green Barrier:
id: Color Arrow Room Doors/Door_green_hider_1
location_name: Color Hunt - BLUE and YELLOW
item_name: Champion's Rest - Green Barrier
group: Champion's Rest - Color Barriers
location_name: Color Barriers - BLUE and YELLOW
item_name: Color Hunt - Green Barrier
group: Color Hunt Barriers
panels:
- BLUE
- room: Directional Gallery
Expand All @@ -2924,9 +2924,9 @@
- Color Arrow Room Doors/Door_purple_hider_1
- Color Arrow Room Doors/Door_purple_hider_2
- Color Arrow Room Doors/Door_purple_hider_3
location_name: Color Hunt - RED and BLUE
item_name: Champion's Rest - Purple Barrier
group: Champion's Rest - Color Barriers
location_name: Color Barriers - RED and BLUE
item_name: Color Hunt - Purple Barrier
group: Color Hunt Barriers
panels:
- BLUE
- room: Orange Tower Third Floor
Expand All @@ -2936,7 +2936,7 @@
- Color Arrow Room Doors/Door_all_hider_1
- Color Arrow Room Doors/Door_all_hider_2
- Color Arrow Room Doors/Door_all_hider_3
location_name: Color Hunt - GREEN, ORANGE and PURPLE
location_name: Color Barriers - GREEN, ORANGE and PURPLE
item_name: Champion's Rest - Entrance
panels:
- ORANGE
Expand Down Expand Up @@ -3176,8 +3176,8 @@
Outside The Bold:
entrances:
Color Hallways: True
Champion's Rest:
room: Champion's Rest
Color Hunt:
room: Color Hunt
door: Shortcut to The Steady
The Bearer:
room: The Bearer
Expand Down Expand Up @@ -4002,7 +4002,7 @@
group: Color Hunt Barriers
skip_location: True
panels:
- room: Champion's Rest
- room: Color Hunt
panel: YELLOW
paintings:
- id: smile_painting_7
Expand All @@ -4020,12 +4020,15 @@
orientation: south
- id: cherry_painting
orientation: east
Champion's Rest:
Color Hunt:
entrances:
Outside The Bold:
door: Shortcut to The Steady
Orange Tower Fourth Floor: True # sunwarp
Roof: True # through ceiling of sunwarp
Champion's Rest:
room: Outside The Initiated
door: Entrance
panels:
EXIT:
id: Rock Room/Panel_red_red
Expand Down Expand Up @@ -4066,61 +4069,49 @@
required_door:
room: Orange Tower Third Floor
door: Orange Barrier
YOU:
id: Color Arrow Room/Panel_you
doors:
Shortcut to The Steady:
id: Rock Room Doors/Door_hint
panels:
- EXIT
paintings:
- id: arrows_painting_7
orientation: east
- id: fruitbowl_painting3
orientation: west
enter_only: True
required_door:
room: Outside The Initiated
door: Entrance
Champion's Rest:
entrances:
Color Hunt:
room: Outside The Initiated
door: Entrance
panels:
YOU:
id: Color Arrow Room/Panel_you
check: True
colors: gray
tag: forbid
ME:
id: Color Arrow Room/Panel_me
colors: gray
tag: forbid
required_door:
room: Outside The Initiated
door: Entrance
SECRET BLUE:
# Pretend this and the other two are white, because they are snipes.
# TODO: Extract them and randomize them?
id: Color Arrow Room/Panel_secret_blue
tag: forbid
required_door:
room: Outside The Initiated
door: Entrance
SECRET YELLOW:
id: Color Arrow Room/Panel_secret_yellow
tag: forbid
required_door:
room: Outside The Initiated
door: Entrance
SECRET RED:
id: Color Arrow Room/Panel_secret_red
tag: forbid
required_door:
room: Outside The Initiated
door: Entrance
doors:
Shortcut to The Steady:
id: Rock Room Doors/Door_hint
panels:
- EXIT
paintings:
- id: arrows_painting_7
orientation: east
- id: fruitbowl_painting3
orientation: west
enter_only: True
required_door:
room: Outside The Initiated
door: Entrance
- id: colors_painting
orientation: south
enter_only: True
required_door:
room: Outside The Initiated
door: Entrance
The Bearer:
entrances:
Outside The Bold:
Expand Down Expand Up @@ -6193,6 +6184,7 @@
Exit:
id: Tower Room Area Doors/Door_painting_exit
include_reduce: True
item_name: Orange Tower Fifth Floor - Quadruple Intersection
panels:
- ONE ROAD MANY TURNS
paintings:
Expand All @@ -6212,7 +6204,6 @@
- Third Floor
- Fourth Floor
- Fifth Floor
- Exit
Art Gallery (Second Floor):
entrances:
Art Gallery:
Expand Down
6 changes: 3 additions & 3 deletions worlds/lingo/data/ids.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ panels:
WINDWARD: 444803
LIGHT: 444804
REWIND: 444805
Champion's Rest:
Color Hunt:
EXIT: 444806
HUES: 444807
RED: 444808
Expand All @@ -498,6 +498,7 @@ panels:
GREEN: 444811
PURPLE: 444812
ORANGE: 444813
Champion's Rest:
YOU: 444814
ME: 444815
SECRET BLUE: 444816
Expand Down Expand Up @@ -1286,7 +1287,7 @@ doors:
location: 445246
Yellow Barrier:
item: 444538
Champion's Rest:
Color Hunt:
Shortcut to The Steady:
item: 444539
location: 444806
Expand Down Expand Up @@ -1442,7 +1443,6 @@ door_groups:
Fearless Doors: 444469
Backside Doors: 444473
Orange Tower First Floor - Shortcuts: 444484
Champion's Rest - Color Barriers: 444489
Welcome Back Doors: 444492
Colorful Doors: 444498
Directional Gallery Doors: 444531
Expand Down
5 changes: 2 additions & 3 deletions worlds/lingo/player_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,8 @@ def __init__(self, world: "LingoWorld"):
["Orange Tower Fourth Floor", "Hot Crusts Door"], ["Outside The Initiated", "Shortcut to Hub Room"],
["Orange Tower First Floor", "Shortcut to Hub Room"], ["Directional Gallery", "Shortcut to The Undeterred"],
["Orange Tower First Floor", "Salt Pepper Door"], ["Hub Room", "Crossroads Entrance"],
["Champion's Rest", "Shortcut to The Steady"], ["The Bearer", "Shortcut to The Bold"],
["Art Gallery", "Exit"], ["The Tenacious", "Shortcut to Hub Room"],
["Outside The Agreeable", "Tenacious Entrance"]
["Color Hunt", "Shortcut to The Steady"], ["The Bearer", "Shortcut to The Bold"], ["Art Gallery", "Exit"],
["The Tenacious", "Shortcut to Hub Room"], ["Outside The Agreeable", "Tenacious Entrance"]
]
pilgrimage_reqs = AccessRequirements()
for door in fake_pilgrimage:
Expand Down
2 changes: 1 addition & 1 deletion worlds/lingo/test/TestProgressive.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def test_item(self):
self.assertTrue(self.can_reach_location("Art Gallery - ONE ROAD MANY TURNS"))
self.assertFalse(self.multiworld.state.can_reach("Orange Tower Fifth Floor", "Region", self.player))

self.collect(progressive_gallery_room[4])
self.collect_by_name("Orange Tower Fifth Floor - Quadruple Intersection")
self.assertTrue(self.multiworld.state.can_reach("Art Gallery", "Region", self.player))
self.assertTrue(self.multiworld.state.can_reach("Art Gallery (Second Floor)", "Region", self.player))
self.assertTrue(self.multiworld.state.can_reach("Art Gallery (Third Floor)", "Region", self.player))
Expand Down
2 changes: 2 additions & 0 deletions worlds/pokemon_emerald/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ def create_location_label_to_id_map() -> Dict[str, int]:
"Littleroot Town - S.S. Ticket from Norman",
"SS Tidal - Hidden Item in Lower Deck Trash Can",
"SS Tidal - TM49 from Thief",
"Safari Zone NE - Item on Ledge",
"Safari Zone NE - Hidden Item North",
"Safari Zone NE - Hidden Item East",
"Safari Zone SE - Item in Grass",
"Safari Zone SE - Hidden Item in South Grass 1",
"Safari Zone SE - Hidden Item in South Grass 2",
}
Expand Down
28 changes: 5 additions & 23 deletions worlds/witness/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,30 +112,12 @@ def __init__(self, world: "WitnessWorld", logic: WitnessPlayerLogic, locat: Witn
or name in logic.PROG_ITEMS_ACTUALLY_IN_THE_GAME
}

# Adjust item classifications based on game settings.
eps_shuffled = self._world.options.shuffle_EPs
come_to_you = self._world.options.elevators_come_to_you
difficulty = self._world.options.puzzle_randomization
# Downgrade door items
for item_name, item_data in self.item_data.items():
if not eps_shuffled and item_name in {"Monastery Garden Entry (Door)",
"Monastery Shortcuts",
"Quarry Boathouse Hook Control (Panel)",
"Windmill Turn Control (Panel)"}:
# Downgrade doors that only gate progress in EP shuffle.
item_data.classification = ItemClassification.useful
elif not come_to_you and not eps_shuffled and item_name in {"Quarry Elevator Control (Panel)",
"Swamp Long Bridge (Panel)"}:
# These Bridges/Elevators are not logical access because they may leave you stuck.
item_data.classification = ItemClassification.useful
elif item_name in {"River Monastery Garden Shortcut (Door)",
"Monastery Laser Shortcut (Door)",
"Orchard Second Gate (Door)",
"Jungle Bamboo Laser Shortcut (Door)",
"Caves Elevator Controls (Panel)"}:
# Downgrade doors that don't gate progress.
item_data.classification = ItemClassification.useful
elif item_name == "Keep Pressure Plates 2 Exit (Door)" and not (difficulty == "none" and eps_shuffled):
# PP2EP requires the door in vanilla puzzles, otherwise it's unnecessary
if not isinstance(item_data.definition, DoorItemDefinition):
continue

if all(not self._logic.solvability_guaranteed(e_hex) for e_hex in item_data.definition.panel_id_hexes):
item_data.classification = ItemClassification.useful

# Build the mandatory item list.
Expand Down
2 changes: 1 addition & 1 deletion worlds/witness/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ def __init__(self, world: "WitnessWorld", player_logic: WitnessPlayerLogic):
)

event_locations = {
p for p in player_logic.EVENT_PANELS
p for p in player_logic.USED_EVENT_NAMES_BY_HEX
}

self.EVENT_LOCATION_TABLE = {
Expand Down
Loading

0 comments on commit e44cf9d

Please sign in to comment.