From ea87cbbe4a23ceff72f31e461c7ead32f560031e Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 25 Oct 2025 11:20:55 -0400 Subject: Made White Ending customizable --- apworld/player_logic.py | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'apworld/player_logic.py') diff --git a/apworld/player_logic.py b/apworld/player_logic.py index 67365b7..e21e2c3 100644 --- a/apworld/player_logic.py +++ b/apworld/player_logic.py @@ -249,6 +249,13 @@ class Lingo2PlayerLogic: self.shuffled_maps = set(game_map.id for game_map in world.static_logic.objects.maps if should_shuffle_map(game_map)) + maximum_masteries = 13 + len(world.options.enable_gift_maps.value) + if world.options.enable_icarus: + maximum_masteries += 1 + + if world.options.masteries_requirement > maximum_masteries: + world.options.masteries_requirement.value = maximum_masteries + if self.world.options.shuffle_doors: for progressive in world.static_logic.objects.progressives: for i in range(0, len(progressive.doors)): @@ -362,18 +369,23 @@ class Lingo2PlayerLogic: self.locations_by_room.setdefault(mastery.room_id, []).append(PlayerLocation(mastery.ap_id, AccessRequirements())) + if world.options.masteries_requirement > 0: + event_name = f"{world.static_logic.get_room_object_map_name(mastery)} - Mastery (Collected)" + self.event_loc_item_by_room.setdefault(mastery.room_id, {})[event_name] = "Mastery" + for ending in world.static_logic.objects.endings: if world.static_logic.get_room_object_map_id(ending) not in self.shuffled_maps: continue - # Don't create a location for your selected ending, and never create a location for White Ending. + # Don't create a location for your selected ending. Also don't create a location for White Ending if it's + # necessarily in the postgame, i.e. it requires all 12 other endings. if world.options.victory_condition.current_key.removesuffix("_ending").upper() != ending.name\ - and ending.name != "WHITE": + and (ending.name != "WHITE" or world.options.endings_requirement < 12): 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 + item_name = "Ending" if world.options.victory_condition.current_key.removesuffix("_ending").upper() == ending.name: item_name = "Victory" @@ -520,13 +532,12 @@ 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] + if door.white_ending: + if self.world.options.endings_requirement > 0: + reqs.progressives["Ending"] = self.world.options.endings_requirement.value - if self.world.options.victory_condition.current_key.removesuffix("_ending").upper() == ending.name: - reqs.items.add("Victory") - else: - reqs.items.add(f"{ending.name.capitalize()} Ending (Achieved)") + if self.world.options.masteries_requirement > 0: + reqs.progressives["Mastery"] = self.world.options.masteries_requirement.value for sub_door_id in door.doors: sub_reqs = self.get_door_open_reqs(sub_door_id) -- cgit 1.4.1