summary refs log tree commit diff stats
path: root/rules.py
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-07-26 04:53:11 -0400
committerGitHub <noreply@github.com>2024-07-26 10:53:11 +0200
commit7641d9590110fa7b4901c7f7ca0384392ef24375 (patch)
tree8efdfa5be3a88879a690a4a7351eb7b635989dc7 /rules.py
parent00c16023c45301224400a06f31f637fdedba00ee (diff)
downloadlingo-apworld-7641d9590110fa7b4901c7f7ca0384392ef24375.tar.gz
lingo-apworld-7641d9590110fa7b4901c7f7ca0384392ef24375.tar.bz2
lingo-apworld-7641d9590110fa7b4901c7f7ca0384392ef24375.zip
Lingo: Add panels mode door shuffle (#3163)
* Created panels mode door shuffle

* Added some panel door item names

* Remove RUNT TURN panel door

Not really useful.

* Fix logic with First SIX related stuff

* Add group_doors to slot data

* Fix LEVEL 2 behavior with panels mode

* Fixed unit tests

* Fixed duplicate IDs from merge

* Just regenerated new IDs

* Fixed duplication of color and door group items

* Removed unnecessary unit test option

* Fix The Seeker being achievable without entrance door

* Fix The Observant being achievable without locked panels

* Added some more panel doors

* Added Progressive Suits Area

* Lingo: Fix Basement access with THE MASTER

* Added indirect conditions for MASTER-blocked entrances

* Fixed Incomparable achievement access

* Fix STAIRS panel logic

* Fix merge error with good items

* Is this clearer?

* DREAD and TURN LEARN

* Allow a weird edge case for reduced locations

Panels mode door shuffle + grouped doors + color shuffle + pilgrimage enabled is exactly the right number of items for reduced locations. Removing color shuffle also allows for disabling pilgrimage, adding sunwarp locking, or both, with a couple of locations left over.

* Prevent small sphere one on panels mode

* Added shuffle_doors aliases for old options

* Fixed a unit test

* Updated datafile

* Tweaked requirements for reduced locations

* Added player name to OptionError messages

* Update generated.dat
Diffstat (limited to 'rules.py')
-rw-r--r--rules.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/rules.py b/rules.py index ed84c56..e0bb08f 100644 --- a/rules.py +++ b/rules.py
@@ -3,7 +3,7 @@ from typing import TYPE_CHECKING
3from BaseClasses import CollectionState 3from BaseClasses import CollectionState
4from .datatypes import RoomAndDoor 4from .datatypes import RoomAndDoor
5from .player_logic import AccessRequirements, PlayerLocation 5from .player_logic import AccessRequirements, PlayerLocation
6from .static_logic import PROGRESSION_BY_ROOM, PROGRESSIVE_ITEMS 6from .static_logic import PROGRESSIVE_DOORS_BY_ROOM, PROGRESSIVE_ITEMS
7 7
8if TYPE_CHECKING: 8if TYPE_CHECKING:
9 from . import LingoWorld 9 from . import LingoWorld
@@ -59,6 +59,12 @@ def _lingo_can_satisfy_requirements(state: CollectionState, access: AccessRequir
59 if not state.has(color.capitalize(), world.player): 59 if not state.has(color.capitalize(), world.player):
60 return False 60 return False
61 61
62 if not all(state.has(item, world.player) for item in access.items):
63 return False
64
65 if not all(state.has(item, world.player, index) for item, index in access.progression.items()):
66 return False
67
62 if access.the_master and not lingo_can_use_mastery_location(state, world): 68 if access.the_master and not lingo_can_use_mastery_location(state, world):
63 return False 69 return False
64 70
@@ -77,7 +83,7 @@ def _lingo_can_open_door(state: CollectionState, room: str, door: str, world: "L
77 83
78 item_name = world.player_logic.item_by_door[room][door] 84 item_name = world.player_logic.item_by_door[room][door]
79 if item_name in PROGRESSIVE_ITEMS: 85 if item_name in PROGRESSIVE_ITEMS:
80 progression = PROGRESSION_BY_ROOM[room][door] 86 progression = PROGRESSIVE_DOORS_BY_ROOM[room][door]
81 return state.has(item_name, world.player, progression.index) 87 return state.has(item_name, world.player, progression.index)
82 88
83 return state.has(item_name, world.player) 89 return state.has(item_name, world.player)