diff options
Diffstat (limited to 'apworld/player_logic.py')
| -rw-r--r-- | apworld/player_logic.py | 45 |
1 files changed, 32 insertions, 13 deletions
| diff --git a/apworld/player_logic.py b/apworld/player_logic.py index 67365b7..d7b18c2 100644 --- a/apworld/player_logic.py +++ b/apworld/player_logic.py | |||
| @@ -241,6 +241,8 @@ class Lingo2PlayerLogic: | |||
| 241 | return "The Charismatic" in world.options.enable_gift_maps.value | 241 | return "The Charismatic" in world.options.enable_gift_maps.value |
| 242 | elif game_map.name == "the_crystalline": | 242 | elif game_map.name == "the_crystalline": |
| 243 | return "The Crystalline" in world.options.enable_gift_maps.value | 243 | return "The Crystalline" in world.options.enable_gift_maps.value |
| 244 | elif game_map.name == "the_fuzzy": | ||
| 245 | return "The Fuzzy" in world.options.enable_gift_maps.value | ||
| 244 | elif game_map.name == "the_stellar": | 246 | elif game_map.name == "the_stellar": |
| 245 | return "The Stellar" in world.options.enable_gift_maps.value | 247 | return "The Stellar" in world.options.enable_gift_maps.value |
| 246 | 248 | ||
| @@ -249,6 +251,16 @@ class Lingo2PlayerLogic: | |||
| 249 | self.shuffled_maps = set(game_map.id for game_map in world.static_logic.objects.maps | 251 | self.shuffled_maps = set(game_map.id for game_map in world.static_logic.objects.maps |
| 250 | if should_shuffle_map(game_map)) | 252 | if should_shuffle_map(game_map)) |
| 251 | 253 | ||
| 254 | maximum_masteries = 13 + len(world.options.enable_gift_maps.value) | ||
| 255 | if world.options.enable_icarus: | ||
| 256 | maximum_masteries += 1 | ||
| 257 | |||
| 258 | if world.options.masteries_requirement > maximum_masteries: | ||
| 259 | world.options.masteries_requirement.value = maximum_masteries | ||
| 260 | |||
| 261 | if "The Fuzzy" in world.options.enable_gift_maps.value: | ||
| 262 | self.real_items.append("Numbers") | ||
| 263 | |||
| 252 | if self.world.options.shuffle_doors: | 264 | if self.world.options.shuffle_doors: |
| 253 | for progressive in world.static_logic.objects.progressives: | 265 | for progressive in world.static_logic.objects.progressives: |
| 254 | for i in range(0, len(progressive.doors)): | 266 | for i in range(0, len(progressive.doors)): |
| @@ -362,24 +374,29 @@ class Lingo2PlayerLogic: | |||
| 362 | self.locations_by_room.setdefault(mastery.room_id, []).append(PlayerLocation(mastery.ap_id, | 374 | self.locations_by_room.setdefault(mastery.room_id, []).append(PlayerLocation(mastery.ap_id, |
| 363 | AccessRequirements())) | 375 | AccessRequirements())) |
| 364 | 376 | ||
| 377 | if world.options.masteries_requirement > 0: | ||
| 378 | event_name = f"{world.static_logic.get_room_object_map_name(mastery)} - Mastery (Collected)" | ||
| 379 | self.event_loc_item_by_room.setdefault(mastery.room_id, {})[event_name] = "Mastery" | ||
| 380 | |||
| 365 | for ending in world.static_logic.objects.endings: | 381 | for ending in world.static_logic.objects.endings: |
| 366 | if world.static_logic.get_room_object_map_id(ending) not in self.shuffled_maps: | 382 | if world.static_logic.get_room_object_map_id(ending) not in self.shuffled_maps: |
| 367 | continue | 383 | continue |
| 368 | 384 | ||
| 369 | # Don't create a location for your selected ending, and never create a location for White Ending. | 385 | # Don't create a location for your selected ending. Also don't create a location for White Ending if it's |
| 386 | # 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\ | 387 | if world.options.victory_condition.current_key.removesuffix("_ending").upper() != ending.name\ |
| 371 | and ending.name != "WHITE": | 388 | and (ending.name != "WHITE" or world.options.endings_requirement < 12): |
| 372 | self.locations_by_room.setdefault(ending.room_id, []).append(PlayerLocation(ending.ap_id, | 389 | self.locations_by_room.setdefault(ending.room_id, []).append(PlayerLocation(ending.ap_id, |
| 373 | AccessRequirements())) | 390 | AccessRequirements())) |
| 374 | 391 | ||
| 375 | event_name = f"{ending.name.capitalize()} Ending (Achieved)" | ||
| 376 | item_name = event_name | ||
| 377 | |||
| 378 | if world.options.victory_condition.current_key.removesuffix("_ending").upper() == ending.name: | 392 | if world.options.victory_condition.current_key.removesuffix("_ending").upper() == ending.name: |
| 379 | item_name = "Victory" | 393 | event_name = f"{ending.name.capitalize()} Ending (Goal)" |
| 394 | self.event_loc_item_by_room.setdefault(ending.room_id, {})[event_name] = "Victory" | ||
| 380 | self.goal_room_id = ending.room_id | 395 | self.goal_room_id = ending.room_id |
| 381 | 396 | ||
| 382 | self.event_loc_item_by_room.setdefault(ending.room_id, {})[event_name] = item_name | 397 | if ending.name != "WHITE": |
| 398 | event_name = f"{ending.name.capitalize()} Ending (Achieved)" | ||
| 399 | self.event_loc_item_by_room.setdefault(ending.room_id, {})[event_name] = "Ending" | ||
| 383 | 400 | ||
| 384 | if self.world.options.keyholder_sanity: | 401 | if self.world.options.keyholder_sanity: |
| 385 | for keyholder in world.static_logic.objects.keyholders: | 402 | for keyholder in world.static_logic.objects.keyholders: |
| @@ -520,13 +537,12 @@ class Lingo2PlayerLogic: | |||
| 520 | for room in door.rooms: | 537 | for room in door.rooms: |
| 521 | reqs.rooms.add(self.world.static_logic.get_room_region_name(room)) | 538 | reqs.rooms.add(self.world.static_logic.get_room_region_name(room)) |
| 522 | 539 | ||
| 523 | for ending_id in door.endings: | 540 | if door.white_ending: |
| 524 | ending = self.world.static_logic.objects.endings[ending_id] | 541 | if self.world.options.endings_requirement > 0: |
| 542 | reqs.progressives["Ending"] = self.world.options.endings_requirement.value | ||
| 525 | 543 | ||
| 526 | if self.world.options.victory_condition.current_key.removesuffix("_ending").upper() == ending.name: | 544 | if self.world.options.masteries_requirement > 0: |
| 527 | reqs.items.add("Victory") | 545 | reqs.progressives["Mastery"] = self.world.options.masteries_requirement.value |
| 528 | else: | ||
| 529 | reqs.items.add(f"{ending.name.capitalize()} Ending (Achieved)") | ||
| 530 | 546 | ||
| 531 | for sub_door_id in door.doors: | 547 | for sub_door_id in door.doors: |
| 532 | sub_reqs = self.get_door_open_reqs(sub_door_id) | 548 | sub_reqs = self.get_door_open_reqs(sub_door_id) |
| @@ -588,3 +604,6 @@ class Lingo2PlayerLogic: | |||
| 588 | 604 | ||
| 589 | if needed > 0: | 605 | if needed > 0: |
| 590 | reqs.letters[l] = max(reqs.letters.get(l, 0), needed) | 606 | reqs.letters[l] = max(reqs.letters.get(l, 0), needed) |
| 607 | |||
| 608 | if any(l.isnumeric() for l in solution): | ||
| 609 | reqs.items.add("Numbers") | ||
