From a4b9a8f43ce0c9b9d5c38d0e6ed19a3aaabee06f Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sun, 31 Aug 2025 12:42:56 -0400 Subject: [Apworld] Better handling of White Ending It now has the correct logic, and also no location will be created for it. --- apworld/player_logic.py | 16 ++++++++++++++-- 1 file 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 @@ from .generated import data_pb2 as data_pb2 from typing import TYPE_CHECKING, NamedTuple +from .options import VictoryCondition + if TYPE_CHECKING: from . import Lingo2World @@ -131,8 +133,14 @@ class Lingo2PlayerLogic: AccessRequirements())) for ending in world.static_logic.objects.endings: - self.locations_by_room.setdefault(ending.room_id, []).append(PlayerLocation(ending.ap_id, - AccessRequirements())) + # Don't ever create a location for White Ending. Don't even make an event for it if it's not the victory + # condition, since it is necessarily going to be in the postgame. + if ending.name == "WHITE": + if self.world.options.victory_condition != VictoryCondition.option_white_ending: + continue + else: + self.locations_by_room.setdefault(ending.room_id, []).append(PlayerLocation(ending.ap_id, + AccessRequirements())) event_name = f"{ending.name.capitalize()} Ending (Achieved)" item_name = event_name @@ -238,6 +246,10 @@ class Lingo2PlayerLogic: for room in door.rooms: reqs.rooms.add(self.world.static_logic.get_room_region_name(room)) + for ending_id in door.endings: + ending = self.world.static_logic.objects.endings[ending_id] + reqs.items.add(f"{ending.name.capitalize()} Ending (Achieved)") + for sub_door_id in door.doors: sub_reqs = self.get_door_open_reqs(sub_door_id) reqs.merge(sub_reqs) -- cgit 1.4.1