summary refs log tree commit diff stats
path: root/rules.py
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-12-10 13:15:42 -0500
committerGitHub <noreply@github.com>2023-12-10 19:15:42 +0100
commit99128f67a3b4478a5561b1ba33a2f3588a61a1df (patch)
tree6afdfc1d51bb8b6d22e6b20725aacaef9437ebb4 /rules.py
parentee4ebe472759e91d511f3f151311f3a54e68051b (diff)
downloadlingo-apworld-99128f67a3b4478a5561b1ba33a2f3588a61a1df.tar.gz
lingo-apworld-99128f67a3b4478a5561b1ba33a2f3588a61a1df.tar.bz2
lingo-apworld-99128f67a3b4478a5561b1ba33a2f3588a61a1df.zip
Lingo: Fix entrance checking being broken on default settings (#2506)
The most serious issue this PR addresses is that entrances that use doors without items (a small subset of doors when door shuffle is on, but *every* door when door shuffle is off, which is the default) underestimate the requirements needed to use that entrance. The logic would calculate the panels needed to open the door, but would neglect to keep track of the rooms those panels were in, meaning that doors would be considered openable if you had the colors needed to solve a panel that's in a room you have no access to.

Another issue is that, previously, logic would always consider the "ANOTHER TRY" panel accessible for the purposes of the LEVEL 2 panel hunt. This could result in seeds where the player is expected to have exactly the correct number of solves to reach LEVEL 2, but in reality is short by one because ANOTHER TRY itself is not revealed until the panel hunt is complete. This change marks ANOTHER TRY as non-counting, because even though it is technically a counting panel in-game, it can never contribute to the LEVEL 2 panel hunt. This issue could also apply to THE MASTER, since it is the only other counting panel with special access rules, although it is much less likely. This change adds special handling for counting THE MASTER. These issues were possible to manifest whenever the LEVEL 2 panel hunt was enabled, which it is by default.

Smaller logic issues also fixed in this PR:

* The Orange Tower Basement MASTERY panel was marked as requiring the mastery doors to be opened, when it was actually possible to get it without them by using a painting to get into the room.
* The Pilgrim Room painting item was incorrectly being marked as a filler item, despite it being progression.
* There has been another update to the game that adds connections between areas that were previously not connected. These changes were additive, which is why they are not critical.
* The panel stacks in the rhyme room now require both colours on each panel.
Diffstat (limited to 'rules.py')
-rw-r--r--rules.py23
1 files changed, 6 insertions, 17 deletions
diff --git a/rules.py b/rules.py index ee9dcc4..481fab1 100644 --- a/rules.py +++ b/rules.py
@@ -17,23 +17,6 @@ def lingo_can_use_entrance(state: CollectionState, room: str, door: RoomAndDoor,
17 return _lingo_can_open_door(state, effective_room, door.door, world, player_logic) 17 return _lingo_can_open_door(state, effective_room, door.door, world, player_logic)
18 18
19 19
20def lingo_can_use_pilgrimage(state: CollectionState, world: "LingoWorld", player_logic: LingoPlayerLogic):
21 fake_pilgrimage = [
22 ["Second Room", "Exit Door"], ["Crossroads", "Tower Entrance"],
23 ["Orange Tower Fourth Floor", "Hot Crusts Door"], ["Outside The Initiated", "Shortcut to Hub Room"],
24 ["Orange Tower First Floor", "Shortcut to Hub Room"], ["Directional Gallery", "Shortcut to The Undeterred"],
25 ["Orange Tower First Floor", "Salt Pepper Door"], ["Hub Room", "Crossroads Entrance"],
26 ["Champion's Rest", "Shortcut to The Steady"], ["The Bearer", "Shortcut to The Bold"],
27 ["Art Gallery", "Exit"], ["The Tenacious", "Shortcut to Hub Room"],
28 ["Outside The Agreeable", "Tenacious Entrance"]
29 ]
30 for entrance in fake_pilgrimage:
31 if not _lingo_can_open_door(state, entrance[0], entrance[1], world, player_logic):
32 return False
33
34 return True
35
36
37def lingo_can_use_location(state: CollectionState, location: PlayerLocation, world: "LingoWorld", 20def lingo_can_use_location(state: CollectionState, location: PlayerLocation, world: "LingoWorld",
38 player_logic: LingoPlayerLogic): 21 player_logic: LingoPlayerLogic):
39 return _lingo_can_satisfy_requirements(state, location.access, world, player_logic) 22 return _lingo_can_satisfy_requirements(state, location.access, world, player_logic)
@@ -56,6 +39,12 @@ def lingo_can_use_level_2_location(state: CollectionState, world: "LingoWorld",
56 counted_panels += panel_count 39 counted_panels += panel_count
57 if counted_panels >= world.options.level_2_requirement.value - 1: 40 if counted_panels >= world.options.level_2_requirement.value - 1:
58 return True 41 return True
42 # THE MASTER has to be handled separately, because it has special access rules.
43 if state.can_reach("Orange Tower Seventh Floor", "Region", world.player)\
44 and lingo_can_use_mastery_location(state, world, player_logic):
45 counted_panels += 1
46 if counted_panels >= world.options.level_2_requirement.value - 1:
47 return True
59 return False 48 return False
60 49
61 50