summary refs log tree commit diff stats
path: root/apworld/player_logic.py
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-08-31 12:42:56 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-08-31 12:42:56 -0400
commita4b9a8f43ce0c9b9d5c38d0e6ed19a3aaabee06f (patch)
treecfae2a360675b6d14e849a4b50bcbe66fff50667 /apworld/player_logic.py
parent8dffc0d1fb5fde81e534d6de8f9cab67483fcce3 (diff)
downloadlingo2-archipelago-a4b9a8f43ce0c9b9d5c38d0e6ed19a3aaabee06f.tar.gz
lingo2-archipelago-a4b9a8f43ce0c9b9d5c38d0e6ed19a3aaabee06f.tar.bz2
lingo2-archipelago-a4b9a8f43ce0c9b9d5c38d0e6ed19a3aaabee06f.zip
[Apworld] Better handling of White Ending
It now has the correct logic, and also no location will be created for
it.
Diffstat (limited to 'apworld/player_logic.py')
-rw-r--r--apworld/player_logic.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/apworld/player_logic.py b/apworld/player_logic.py index 36156e4..c6465f6 100644 --- a/apworld/player_logic.py +++ b/apworld/player_logic.py
@@ -1,6 +1,8 @@
1from .generated import data_pb2 as data_pb2 1from .generated import data_pb2 as data_pb2
2from typing import TYPE_CHECKING, NamedTuple 2from typing import TYPE_CHECKING, NamedTuple
3 3
4from .options import VictoryCondition
5
4if TYPE_CHECKING: 6if TYPE_CHECKING:
5 from . import Lingo2World 7 from . import Lingo2World
6 8
@@ -131,8 +133,14 @@ class Lingo2PlayerLogic:
131 AccessRequirements())) 133 AccessRequirements()))
132 134
133 for ending in world.static_logic.objects.endings: 135 for ending in world.static_logic.objects.endings:
134 self.locations_by_room.setdefault(ending.room_id, []).append(PlayerLocation(ending.ap_id, 136 # Don't ever create a location for White Ending. Don't even make an event for it if it's not the victory
135 AccessRequirements())) 137 # condition, since it is necessarily going to be in the postgame.
138 if ending.name == "WHITE":
139 if self.world.options.victory_condition != VictoryCondition.option_white_ending:
140 continue
141 else:
142 self.locations_by_room.setdefault(ending.room_id, []).append(PlayerLocation(ending.ap_id,
143 AccessRequirements()))
136 144
137 event_name = f"{ending.name.capitalize()} Ending (Achieved)" 145 event_name = f"{ending.name.capitalize()} Ending (Achieved)"
138 item_name = event_name 146 item_name = event_name
@@ -238,6 +246,10 @@ class Lingo2PlayerLogic:
238 for room in door.rooms: 246 for room in door.rooms:
239 reqs.rooms.add(self.world.static_logic.get_room_region_name(room)) 247 reqs.rooms.add(self.world.static_logic.get_room_region_name(room))
240 248
249 for ending_id in door.endings:
250 ending = self.world.static_logic.objects.endings[ending_id]
251 reqs.items.add(f"{ending.name.capitalize()} Ending (Achieved)")
252
241 for sub_door_id in door.doors: 253 for sub_door_id in door.doors:
242 sub_reqs = self.get_door_open_reqs(sub_door_id) 254 sub_reqs = self.get_door_open_reqs(sub_door_id)
243 reqs.merge(sub_reqs) 255 reqs.merge(sub_reqs)