about summary refs log tree commit diff stats
path: root/apworld/player_logic.py
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-10-25 11:20:55 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-10-25 11:20:55 -0400
commitea87cbbe4a23ceff72f31e461c7ead32f560031e (patch)
tree2983fb51bc4f9a3f7ccaf0cb71a2dfad54eceeeb /apworld/player_logic.py
parent8b07ae101fb9e0f2fc0e2d46a4cd77ff78d62d13 (diff)
downloadlingo2-archipelago-ea87cbbe4a23ceff72f31e461c7ead32f560031e.tar.gz
lingo2-archipelago-ea87cbbe4a23ceff72f31e461c7ead32f560031e.tar.bz2
lingo2-archipelago-ea87cbbe4a23ceff72f31e461c7ead32f560031e.zip
Made White Ending customizable
Diffstat (limited to 'apworld/player_logic.py')
-rw-r--r--apworld/player_logic.py29
1 files changed, 20 insertions, 9 deletions
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:
249 self.shuffled_maps = set(game_map.id for game_map in world.static_logic.objects.maps 249 self.shuffled_maps = set(game_map.id for game_map in world.static_logic.objects.maps
250 if should_shuffle_map(game_map)) 250 if should_shuffle_map(game_map))
251 251
252 maximum_masteries = 13 + len(world.options.enable_gift_maps.value)
253 if world.options.enable_icarus:
254 maximum_masteries += 1
255
256 if world.options.masteries_requirement > maximum_masteries:
257 world.options.masteries_requirement.value = maximum_masteries
258
252 if self.world.options.shuffle_doors: 259 if self.world.options.shuffle_doors:
253 for progressive in world.static_logic.objects.progressives: 260 for progressive in world.static_logic.objects.progressives:
254 for i in range(0, len(progressive.doors)): 261 for i in range(0, len(progressive.doors)):
@@ -362,18 +369,23 @@ class Lingo2PlayerLogic:
362 self.locations_by_room.setdefault(mastery.room_id, []).append(PlayerLocation(mastery.ap_id, 369 self.locations_by_room.setdefault(mastery.room_id, []).append(PlayerLocation(mastery.ap_id,
363 AccessRequirements())) 370 AccessRequirements()))
364 371
372 if world.options.masteries_requirement > 0:
373 event_name = f"{world.static_logic.get_room_object_map_name(mastery)} - Mastery (Collected)"
374 self.event_loc_item_by_room.setdefault(mastery.room_id, {})[event_name] = "Mastery"
375
365 for ending in world.static_logic.objects.endings: 376 for ending in world.static_logic.objects.endings:
366 if world.static_logic.get_room_object_map_id(ending) not in self.shuffled_maps: 377 if world.static_logic.get_room_object_map_id(ending) not in self.shuffled_maps:
367 continue 378 continue
368 379
369 # Don't create a location for your selected ending, and never create a location for White Ending. 380 # Don't create a location for your selected ending. Also don't create a location for White Ending if it's
381 # necessarily in the postgame, i.e. it requires all 12 other endings.
370 if world.options.victory_condition.current_key.removesuffix("_ending").upper() != ending.name\ 382 if world.options.victory_condition.current_key.removesuffix("_ending").upper() != ending.name\
371 and ending.name != "WHITE": 383 and (ending.name != "WHITE" or world.options.endings_requirement < 12):
372 self.locations_by_room.setdefault(ending.room_id, []).append(PlayerLocation(ending.ap_id, 384 self.locations_by_room.setdefault(ending.room_id, []).append(PlayerLocation(ending.ap_id,
373 AccessRequirements())) 385 AccessRequirements()))
374 386
375 event_name = f"{ending.name.capitalize()} Ending (Achieved)" 387 event_name = f"{ending.name.capitalize()} Ending (Achieved)"
376 item_name = event_name 388 item_name = "Ending"
377 389
378 if world.options.victory_condition.current_key.removesuffix("_ending").upper() == ending.name: 390 if world.options.victory_condition.current_key.removesuffix("_ending").upper() == ending.name:
379 item_name = "Victory" 391 item_name = "Victory"
@@ -520,13 +532,12 @@ class Lingo2PlayerLogic:
520 for room in door.rooms: 532 for room in door.rooms:
521 reqs.rooms.add(self.world.static_logic.get_room_region_name(room)) 533 reqs.rooms.add(self.world.static_logic.get_room_region_name(room))
522 534
523 for ending_id in door.endings: 535 if door.white_ending:
524 ending = self.world.static_logic.objects.endings[ending_id] 536 if self.world.options.endings_requirement > 0:
537 reqs.progressives["Ending"] = self.world.options.endings_requirement.value
525 538
526 if self.world.options.victory_condition.current_key.removesuffix("_ending").upper() == ending.name: 539 if self.world.options.masteries_requirement > 0:
527 reqs.items.add("Victory") 540 reqs.progressives["Mastery"] = self.world.options.masteries_requirement.value
528 else:
529 reqs.items.add(f"{ending.name.capitalize()} Ending (Achieved)")
530 541
531 for sub_door_id in door.doors: 542 for sub_door_id in door.doors:
532 sub_reqs = self.get_door_open_reqs(sub_door_id) 543 sub_reqs = self.get_door_open_reqs(sub_door_id)