Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 51 additions & 51 deletions worlds/portal2/Locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,66 +219,66 @@ class Portal2Location(Location):
}

# Alternate logic for speedrunners
speedrun_logic_table: dict[str, list[str]] = {
speedrun_logic_table: dict[str, list[list[str]]] = {
# Chapter 1
"Portal Carousel Completion": [button, floor_button],
"Smooth Jazz Completion": [floor_button],
"Cube Momentum Completion": [floor_button],
"Future Starter Completion": [floor_button],
"Incinerator Completion": [weighted_cube],
"Portal Carousel Completion": [[button, floor_button]],
"Smooth Jazz Completion": [[floor_button]],
"Cube Momentum Completion": [[floor_button]],
"Future Starter Completion": [[floor_button]],
"Incinerator Completion": [[weighted_cube]],
# Chapter 2
"Laser Intro Completion": [portal_gun_2],
"Laser Stairs Completion": [portal_gun_2, floor_button],
"Dual Lasers Completion": [portal_gun_2, laser, laser_catcher],
"Laser Over Goo Completion": [portal_gun_2, floor_button],
"Catapult Intro Completion": [portal_gun_2, floor_button],
"Trust Fling Completion": [portal_gun_2, faith_plate, floor_button],
"Pit Flings Completion": [portal_gun_2],
"Fizzler Intro Completion": [portal_gun_2, laser, laser_catcher],
"Laser Intro Completion": [[portal_gun_2]],
"Laser Stairs Completion": [[portal_gun_2, floor_button]],
"Dual Lasers Completion": [[portal_gun_2, laser, laser_catcher]],
"Laser Over Goo Completion": [[portal_gun_2, floor_button]],
"Catapult Intro Completion": [[portal_gun_2, floor_button, faith_plate]],
"Trust Fling Completion": [[portal_gun_2, faith_plate, floor_button]],
"Pit Flings Completion": [[portal_gun_2]],
"Fizzler Intro Completion": [[portal_gun_2, laser, laser_catcher]],
# Chapter 3
"Ricochet Completion": [portal_gun_2, weighted_cube, floor_button],
"Bridge Intro Completion": [portal_gun_2, floor_button],
"Bridge the Gap Completion": [weighted_cube, button, floor_button],
"Turret Intro Completion": [floor_button],
"Laser Relays Completion": [laser_relays, laser, reflection_cube],
"Turret Blocker Completion": [floor_button],
"Laser Vs. Turret Completion": [portal_gun_2],
"Pull The Rug Completion": [floor_button, weighted_cube, bridge, portal_gun_2],
"Ricochet Completion": [[portal_gun_2, weighted_cube, floor_button, faith_plate]],
"Bridge Intro Completion": [[portal_gun_2, floor_button]],
"Bridge the Gap Completion": [[portal_gun_2, floor_button]],
"Turret Intro Completion": [[floor_button]],
"Laser Relays Completion": [[laser_relays, laser, reflection_cube]],
"Turret Blocker Completion": [[floor_button]],
"Laser Vs. Turret Completion": [[portal_gun_2]],
"Pull The Rug Completion": [[floor_button, weighted_cube, bridge, portal_gun_2]],
# Chapter 4
"Column Blocker Completion": [portal_gun_2],
"Laser Chaining Completion": [reflection_cube, laser, laser_relays],
"Triple Laser Completion": [reflection_cube, portal_gun_2],
"Jailbreak Completion": [portal_gun_2, button, weighted_cube],
"Escape Completion": [],
"Column Blocker Completion": [[portal_gun_2, bridge]],
"Laser Chaining Completion": [[reflection_cube, laser, laser_relays]],
"Triple Laser Completion": [[reflection_cube, portal_gun_2]],
"Jailbreak Completion": [[portal_gun_2, button, weighted_cube]],
"Escape Completion": [[]],
# Chapter 5
"Turret Sabotage Completion": [portal_gun_2],
"Neurotoxin Sabotage Completion": [portal_gun_2],
"Core Completion": [turrets],
"Turret Sabotage Completion": [[portal_gun_2]],
"Neurotoxin Sabotage Completion": [[portal_gun_2]],
"Core Completion": [[turrets]],
# Chapter 6
"Repulsion Intro Completion": [blue_gel, old_floor_button, portal_gun_2],
"Bomb Flings Completion": [portal_gun_2, blue_gel, old_button],
"Crazy Box Completion": [portal_gun_2, old_floor_button],
"Repulsion Intro Completion": [[blue_gel, old_floor_button, portal_gun_2]],
"Bomb Flings Completion": [[portal_gun_2, blue_gel, old_button]],
"Crazy Box Completion": [[portal_gun_2, old_floor_button], [portal_gun_2, blue_gel]],
# Chapter 7
"Propulsion Intro Completion": [portal_gun_2],
"Propulsion Flings Completion": [portal_gun_2, blue_gel],
"Conversion Intro Completion": [portal_gun_2],
"Three Gels Completion": [portal_gun_2, blue_gel],
"Propulsion Intro Completion": [[portal_gun_2]],
"Propulsion Flings Completion": [[portal_gun_2]],
"Conversion Intro Completion": [[portal_gun_2]],
"Three Gels Completion": [[portal_gun_2, blue_gel]],
# Chapter 8
"Funnel Intro Completion": [floor_button, funnel],
"Ceiling Button Completion": [floor_button, frankenturret, button, portal_gun_2],
"Wall Button Completion": [floor_button, funnel, portal_gun_2],
"Polarity Completion": [portal_gun_2, funnel],
"Funnel Catch Completion": [portal_gun_2],
"Stop The Box Completion": [floor_button, portal_gun_2],
"Laser Catapult Completion": [portal_gun_2],
"Laser Platform Completion": [portal_gun_2, funnel],
"Propulsion Catch Completion": [floor_button, funnel],
"Repulsion Polarity Completion": [turrets, button, blue_gel],
"Funnel Intro Completion": [[floor_button, funnel, frankenturret]],
"Ceiling Button Completion": [[floor_button, frankenturret, button, portal_gun_2]],
"Wall Button Completion": [[floor_button, portal_gun_2, frankenturret]],
"Polarity Completion": [[portal_gun_2, funnel]],
"Funnel Catch Completion": [[portal_gun_2, floor_button]],
"Stop The Box Completion": [[floor_button, portal_gun_2]],
"Laser Catapult Completion": [[portal_gun_2]],
"Laser Platform Completion": [[portal_gun_2, funnel, laser, laser_catcher, reflection_cube, button]],
"Propulsion Catch Completion": [[portal_gun_2, floor_button]],
"Repulsion Polarity Completion": [[portal_gun_2, funnel, white_gel]],
# Chapter 9
"Finale 1 Completion": [portal_gun_2, frankenturret, faith_plate],
"Finale 2 Completion": [portal_gun_2],
"Finale 3 Completion": [portal_gun_2, funnel],
"Finale 4 Completion": [portal_gun_2, potatos, white_gel, adventure_core, space_core, fact_core],
"Finale 1 Completion": [[portal_gun_2, frankenturret, faith_plate]],
"Finale 2 Completion": [[portal_gun_2, turrets], [portal_gun_2, funnel]],
"Finale 3 Completion": [[portal_gun_2, funnel]],
"Finale 4 Completion": [[portal_gun_2, potatos, white_gel, adventure_core, space_core, fact_core]],
}

sub_locations_in_maps: dict[str, list[str]] = {
Expand Down
3 changes: 2 additions & 1 deletion worlds/portal2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ def generate_early(self):
if self.options.logic_difficulty == LogicDifficultyOption.SPEEDRUNNER:
for map_location in self.maps_in_use:
if map_location in speedrun_logic_table:
self.location_logic[map_location] = speedrun_logic_table[map_location]
random_logic = self.random.choice(speedrun_logic_table[map_location])

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't use random choice, instead if you want to have alternate logic you can update the logic calculation to use "has_all" and "or" each list over a loop to create the rule. This will also have to be updated in the menu to reflect this which I can do in the next update

self.location_logic[map_location] = random_logic

def create_regions(self) -> None:
menu_region = Region("Menu", self.player, self.multiworld)
Expand Down