diff options
Diffstat (limited to 'apworld')
-rw-r--r-- | apworld/options.py | 9 | ||||
-rw-r--r-- | apworld/player_logic.py | 35 | ||||
-rw-r--r-- | apworld/static_logic.py | 3 |
3 files changed, 41 insertions, 6 deletions
diff --git a/apworld/options.py b/apworld/options.py index f7dc5bd..dbf09e7 100644 --- a/apworld/options.py +++ b/apworld/options.py | |||
@@ -8,6 +8,14 @@ class ShuffleDoors(Toggle): | |||
8 | display_name = "Shuffle Doors" | 8 | display_name = "Shuffle Doors" |
9 | 9 | ||
10 | 10 | ||
11 | class ShuffleControlCenterColors(Toggle): | ||
12 | """ | ||
13 | Some doors open after solving the COLOR panel in the Control Center. If this option is enabled, these doors will | ||
14 | instead open upon receiving an item. | ||
15 | """ | ||
16 | display_name = "Shuffle Control Center Colors" | ||
17 | |||
18 | |||
11 | class ShuffleLetters(Choice): | 19 | class ShuffleLetters(Choice): |
12 | """ | 20 | """ |
13 | Controls how letter unlocks are handled. Note that H1, I1, N1, and T1 will always be present at their vanilla | 21 | Controls how letter unlocks are handled. Note that H1, I1, N1, and T1 will always be present at their vanilla |
@@ -71,6 +79,7 @@ class VictoryCondition(Choice): | |||
71 | @dataclass | 79 | @dataclass |
72 | class Lingo2Options(PerGameCommonOptions): | 80 | class Lingo2Options(PerGameCommonOptions): |
73 | shuffle_doors: ShuffleDoors | 81 | shuffle_doors: ShuffleDoors |
82 | shuffle_control_center_colors: ShuffleControlCenterColors | ||
74 | shuffle_letters: ShuffleLetters | 83 | shuffle_letters: ShuffleLetters |
75 | keyholder_sanity: KeyholderSanity | 84 | keyholder_sanity: KeyholderSanity |
76 | daedalus_roof_access: DaedalusRoofAccess | 85 | daedalus_roof_access: DaedalusRoofAccess |
diff --git a/apworld/player_logic.py b/apworld/player_logic.py index 5cb9011..ce9a4e5 100644 --- a/apworld/player_logic.py +++ b/apworld/player_logic.py | |||
@@ -123,16 +123,39 @@ class Lingo2PlayerLogic: | |||
123 | self.item_by_door[progressive.doors[i]] = (progressive.name, i + 1) | 123 | self.item_by_door[progressive.doors[i]] = (progressive.name, i + 1) |
124 | self.real_items.append(progressive.name) | 124 | self.real_items.append(progressive.name) |
125 | 125 | ||
126 | for door_group in world.static_logic.objects.door_groups: | ||
127 | if door_group.type == data_pb2.DoorGroupType.CONNECTOR and not self.world.options.shuffle_doors: | ||
128 | continue | ||
129 | |||
130 | if (door_group.type == data_pb2.DoorGroupType.COLOR_CONNECTOR and | ||
131 | not self.world.options.shuffle_control_center_colors): | ||
132 | continue | ||
133 | |||
134 | for door in door_group.doors: | ||
135 | self.item_by_door[door] = (door_group.name, 1) | ||
136 | |||
137 | self.real_items.append(door_group.name) | ||
138 | |||
126 | # We iterate through the doors in two parts because it is essential that we determine which doors are shuffled | 139 | # We iterate through the doors in two parts because it is essential that we determine which doors are shuffled |
127 | # before we calculate any access requirements. | 140 | # before we calculate any access requirements. |
128 | for door in world.static_logic.objects.doors: | 141 | for door in world.static_logic.objects.doors: |
129 | if door.type in [data_pb2.DoorType.STANDARD, data_pb2.DoorType.ITEM_ONLY] and self.world.options.shuffle_doors: | 142 | if door.type in [data_pb2.DoorType.EVENT, data_pb2.DoorType.LOCATION_ONLY, data_pb2.DoorType.GRAVESTONE]: |
130 | if door.id in self.item_by_door: | 143 | continue |
131 | continue | 144 | |
145 | if door.id in self.item_by_door: | ||
146 | continue | ||
147 | |||
148 | if (door.type in [data_pb2.DoorType.STANDARD, data_pb2.DoorType.ITEM_ONLY] and | ||
149 | not self.world.options.shuffle_doors): | ||
150 | continue | ||
151 | |||
152 | if (door.type == data_pb2.DoorType.CONTROL_CENTER_COLOR and | ||
153 | not self.world.options.shuffle_control_center_colors): | ||
154 | continue | ||
132 | 155 | ||
133 | door_item_name = self.world.static_logic.get_door_item_name(door) | 156 | door_item_name = self.world.static_logic.get_door_item_name(door) |
134 | self.item_by_door[door.id] = (door_item_name, 1) | 157 | self.item_by_door[door.id] = (door_item_name, 1) |
135 | self.real_items.append(door_item_name) | 158 | self.real_items.append(door_item_name) |
136 | 159 | ||
137 | for door in world.static_logic.objects.doors: | 160 | for door in world.static_logic.objects.doors: |
138 | if door.type in [data_pb2.DoorType.STANDARD, data_pb2.DoorType.LOCATION_ONLY, data_pb2.DoorType.GRAVESTONE]: | 161 | if door.type in [data_pb2.DoorType.STANDARD, data_pb2.DoorType.LOCATION_ONLY, data_pb2.DoorType.GRAVESTONE]: |
diff --git a/apworld/static_logic.py b/apworld/static_logic.py index b699d59..3f6cdea 100644 --- a/apworld/static_logic.py +++ b/apworld/static_logic.py | |||
@@ -44,6 +44,9 @@ class Lingo2StaticLogic: | |||
44 | for progressive in self.objects.progressives: | 44 | for progressive in self.objects.progressives: |
45 | self.item_id_to_name[progressive.ap_id] = progressive.name | 45 | self.item_id_to_name[progressive.ap_id] = progressive.name |
46 | 46 | ||
47 | for door_group in self.objects.door_groups: | ||
48 | self.item_id_to_name[door_group.ap_id] = door_group.name | ||
49 | |||
47 | for keyholder in self.objects.keyholders: | 50 | for keyholder in self.objects.keyholders: |
48 | if keyholder.HasField("key"): | 51 | if keyholder.HasField("key"): |
49 | location_name = f"{self.get_room_object_location_prefix(keyholder)} - {keyholder.key.upper()} Keyholder" | 52 | location_name = f"{self.get_room_object_location_prefix(keyholder)} - {keyholder.key.upper()} Keyholder" |