Skip to content
Merged
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
3 changes: 3 additions & 0 deletions worlds/portal2/ItemNames.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
ball_button = "Ball Buttons"
frankenturret = "Frankenturrets"
paint = "Three Gels"
blue_gel = "Blue Gel"
orange_gel = "Orange Gel"
white_gel = "White Gel"
laser = "Lasers"
faith_plate = "Aerial Faith Plates"
funnel = "Excursion Funnels"
Expand Down
11 changes: 9 additions & 2 deletions worlds/portal2/Items.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ class ItemTag(Flag):
WEAPON = auto()
CUBE = auto()
GEL = auto()

BLUE_GEL = auto()
ORANGE_GEL = auto()
WHITE_GEL = auto()

CORE = auto()

# Affect applied
Expand Down Expand Up @@ -41,7 +46,7 @@ class Portal2Item(Item):
weighted_cube: Portal2ItemData("prop_weighted_cube", "models/props/metal_box.mdl", ItemTag.DELETE | ItemTag.CUBE, ItemClassification.progression),
reflection_cube: Portal2ItemData("prop_weighted_cube", "models/props/reflection_cube.mdl", ItemTag.DELETE | ItemTag.CUBE, ItemClassification.progression),
spherical_cube: Portal2ItemData("prop_weighted_cube", "models/props_gameplay/mp_ball.mdl", ItemTag.DELETE | ItemTag.CUBE, ItemClassification.filler),
antique_cube: Portal2ItemData("prop_weighted_cube", "models/props_underground_underground_weighted_cube.mdl", ItemTag.DELETE | ItemTag.CUBE, ItemClassification.progression),
antique_cube: Portal2ItemData("prop_weighted_cube", "models/props_underground_weighted_cube.mdl", ItemTag.DELETE | ItemTag.CUBE, ItemClassification.progression),

# Buttons
button: Portal2ItemData("prop_button", None, ItemTag.ENTITY | ItemTag.DELETE, ItemClassification.progression),
Expand All @@ -51,7 +56,9 @@ class Portal2Item(Item):

# Puzzle Elements
frankenturret: Portal2ItemData("prop_monster_box", None, ItemTag.ENTITY | ItemTag.DELETE, ItemClassification.progression),
paint: Portal2ItemData("info_paint_sprayer", None, ItemTag.ENTITY | ItemTag.GEL | ItemTag.DELETE, ItemClassification.progression),
blue_gel: Portal2ItemData("various", "blue", ItemTag.ENTITY | ItemTag.GEL | ItemTag.BLUE_GEL, ItemClassification.progression),
orange_gel: Portal2ItemData("various", "orange", ItemTag.ENTITY | ItemTag.GEL | ItemTag.ORANGE_GEL, ItemClassification.progression),
white_gel: Portal2ItemData("various", "white", ItemTag.ENTITY | ItemTag.GEL | ItemTag.WHITE_GEL, ItemClassification.progression),
laser: Portal2ItemData("env_portal_laser", None, ItemTag.ENTITY | ItemTag.DELETE, ItemClassification.progression),
faith_plate: Portal2ItemData("trigger_catapult", None, ItemTag.ENTITY | ItemTag.DELETE, ItemClassification.progression),
funnel: Portal2ItemData("prop_tractor_beam", None, ItemTag.ENTITY | ItemTag.DELETE, ItemClassification.progression),
Expand Down
75 changes: 47 additions & 28 deletions worlds/portal2/Locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class LocationType(Flag):
ITEM = auto()
ACHIEVEMENT = auto()
WHEATLY_MONITOR = auto()
RATMAN_DEN = auto()
OTHER = auto()

class Portal2LocationData:
Expand Down Expand Up @@ -75,15 +76,15 @@ class Portal2Location(Location):
# Chapter 6
"Underground Completion": Portal2LocationData("sp_a3_01", LocationType.MAP_COMPLETION, [portal_gun_2], 6),
"Cave Johnson Completion": Portal2LocationData("sp_a3_03", LocationType.MAP_COMPLETION, [portal_gun_2], 6),
"Repulsion Intro Completion": Portal2LocationData("sp_a3_jump_intro", LocationType.MAP_COMPLETION, [portal_gun_2, paint, old_button, old_floor_button, antique_cube], 6),
"Bomb Flings Completion": Portal2LocationData("sp_a3_bomb_flings", LocationType.MAP_COMPLETION, [portal_gun_2, old_button, paint], 6),
"Crazy Box Completion": Portal2LocationData("sp_a3_crazy_box", LocationType.MAP_COMPLETION, [portal_gun_2, old_button, paint, antique_cube, old_floor_button], 6),
"Repulsion Intro Completion": Portal2LocationData("sp_a3_jump_intro", LocationType.MAP_COMPLETION, [portal_gun_2, blue_gel, old_button, old_floor_button, antique_cube], 6),
"Bomb Flings Completion": Portal2LocationData("sp_a3_bomb_flings", LocationType.MAP_COMPLETION, [portal_gun_2, old_button, blue_gel], 6),
"Crazy Box Completion": Portal2LocationData("sp_a3_crazy_box", LocationType.MAP_COMPLETION, [portal_gun_2, old_button, blue_gel, antique_cube, old_floor_button], 6),
"PotatOS Completion": Portal2LocationData("sp_a3_transition01", LocationType.MAP_COMPLETION, [portal_gun_2, potatos], 6),
# Chapter 7
"Propulsion Intro Completion": Portal2LocationData("sp_a3_speed_ramp", LocationType.MAP_COMPLETION, [portal_gun_2, paint, antique_cube, old_floor_button, old_button], 7),
"Propulsion Flings Completion": Portal2LocationData("sp_a3_speed_flings", LocationType.MAP_COMPLETION, [portal_gun_2, paint, antique_cube, old_floor_button], 7),
"Conversion Intro Completion": Portal2LocationData("sp_a3_portal_intro", LocationType.MAP_COMPLETION, [portal_gun_2, paint], 7),
"Three Gels Completion": Portal2LocationData("sp_a3_end", LocationType.MAP_COMPLETION, [portal_gun_2, paint], 7),
"Propulsion Intro Completion": Portal2LocationData("sp_a3_speed_ramp", LocationType.MAP_COMPLETION, [portal_gun_2, blue_gel, orange_gel, antique_cube, old_floor_button, old_button], 7),
"Propulsion Flings Completion": Portal2LocationData("sp_a3_speed_flings", LocationType.MAP_COMPLETION, [portal_gun_2, blue_gel, orange_gel, antique_cube, old_floor_button], 7),
"Conversion Intro Completion": Portal2LocationData("sp_a3_portal_intro", LocationType.MAP_COMPLETION, [portal_gun_2, blue_gel, orange_gel, white_gel], 7),
"Three Gels Completion": Portal2LocationData("sp_a3_end", LocationType.MAP_COMPLETION, [portal_gun_2, blue_gel, orange_gel, white_gel], 7),
# Chapter 8
"Test Completion": Portal2LocationData("sp_a4_intro", LocationType.MAP_COMPLETION, [portal_gun_2, frankenturret, floor_button, button], 8),
"Funnel Intro Completion": Portal2LocationData("sp_a4_tb_intro", LocationType.MAP_COMPLETION, [portal_gun_2, funnel, frankenturret, floor_button], 8),
Expand All @@ -94,13 +95,13 @@ class Portal2Location(Location):
"Stop The Box Completion": Portal2LocationData("sp_a4_stop_the_box", LocationType.MAP_COMPLETION, [portal_gun_2, frankenturret, floor_button, button, faith_plate, bridge], 8),
"Laser Catapult Completion": Portal2LocationData("sp_a4_laser_catapult", LocationType.MAP_COMPLETION, [portal_gun_2, frankenturret, floor_button, faith_plate, reflection_cube, laser, laser_catcher, funnel], 8),
"Laser Platform Completion": Portal2LocationData("sp_a4_laser_platform", LocationType.MAP_COMPLETION, [portal_gun_2, button, reflection_cube, laser, laser_catcher, funnel], 8),
"Propulsion Catch Completion": Portal2LocationData("sp_a4_speed_tb_catch", LocationType.MAP_COMPLETION, [portal_gun_2, floor_button, funnel, button, frankenturret, paint], 8),
"Repulsion Polarity Completion": Portal2LocationData("sp_a4_jump_polarity", LocationType.MAP_COMPLETION, [portal_gun_2, paint, funnel, floor_button, button], 8),
"Propulsion Catch Completion": Portal2LocationData("sp_a4_speed_tb_catch", LocationType.MAP_COMPLETION, [portal_gun_2, floor_button, funnel, button, frankenturret, orange_gel], 8),
"Repulsion Polarity Completion": Portal2LocationData("sp_a4_jump_polarity", LocationType.MAP_COMPLETION, [portal_gun_2, blue_gel, white_gel, funnel, floor_button, button], 8),
# Chapter 9
"Finale 1 Completion": Portal2LocationData("sp_a4_finale1", LocationType.MAP_COMPLETION, [portal_gun_2, faith_plate, funnel, paint], 9),
"Finale 2 Completion": Portal2LocationData("sp_a4_finale2", LocationType.MAP_COMPLETION, [portal_gun_2, funnel, paint, floor_button, turrets], 9),
"Finale 3 Completion": Portal2LocationData("sp_a4_finale3", LocationType.MAP_COMPLETION, [portal_gun_2, paint, funnel], 9),
"Finale 4 Completion": Portal2LocationData("sp_a4_finale4", LocationType.MAP_COMPLETION, [portal_gun_2, potatos, paint, adventure_core, space_core, fact_core], 9),
"Finale 1 Completion": Portal2LocationData("sp_a4_finale1", LocationType.MAP_COMPLETION, [portal_gun_2, faith_plate, funnel, white_gel], 9),
"Finale 2 Completion": Portal2LocationData("sp_a4_finale2", LocationType.MAP_COMPLETION, [portal_gun_2, funnel, blue_gel, floor_button, turrets], 9),
"Finale 3 Completion": Portal2LocationData("sp_a4_finale3", LocationType.MAP_COMPLETION, [portal_gun_2, orange_gel, white_gel, funnel], 9),
"Finale 4 Completion": Portal2LocationData("sp_a4_finale4", LocationType.MAP_COMPLETION, [portal_gun_2, potatos, blue_gel, orange_gel, white_gel, adventure_core, space_core, fact_core], 9),
}

# Optional Checks
Expand Down Expand Up @@ -154,10 +155,12 @@ class Portal2Location(Location):
"Wheatley Monitor 8": Portal2LocationData("sp_a4_laser_catapult", LocationType.WHEATLY_MONITOR, [portal_gun_2, frankenturret, faith_plate, funnel, reflection_cube, laser, laser_catcher]),
"Wheatley Monitor 9": Portal2LocationData("sp_a4_laser_platform", LocationType.WHEATLY_MONITOR, [portal_gun_2, laser, laser_catcher, reflection_cube, button]),
"Wheatley Monitor 10": Portal2LocationData("sp_a4_speed_tb_catch", LocationType.WHEATLY_MONITOR, [portal_gun_2]),
"Wheatley Monitor 11": Portal2LocationData("sp_a4_jump_polarity", LocationType.WHEATLY_MONITOR, [portal_gun_2, paint, funnel, turrets, floor_button, button]),
"Wheatley Monitor 12": Portal2LocationData("sp_a4_finale3", LocationType.WHEATLY_MONITOR, [portal_gun_2, paint]),
"Wheatley Monitor 11": Portal2LocationData("sp_a4_jump_polarity", LocationType.WHEATLY_MONITOR, [portal_gun_2, blue_gel, white_gel, funnel, turrets, floor_button, button]),
"Wheatley Monitor 12": Portal2LocationData("sp_a4_finale3", LocationType.WHEATLY_MONITOR, [portal_gun_2, orange_gel, white_gel]),
}

# Note: these are the names used in game to identify the monitors
# most are just the map name but some have a number after due to multiple monitors in the same map
wheatley_maps_to_monitor_names: dict[str, str] = {value.map_name: key for key, value in wheatley_monitor_table.items()}

item_location_table: dict[str, Portal2LocationData] = {
Expand All @@ -169,17 +172,31 @@ class Portal2Location(Location):
item_maps_to_item_location : dict[str, str] = {value.map_name:key for key, value in item_location_table.items()}

ratman_den_locations_table: dict[str, Portal2LocationData] = {
"Ratman Den 1": Portal2LocationData("sp_a1_intro4", LocationType.OTHER, [weighted_cube, floor_button]),
"Ratman Den 2": Portal2LocationData("sp_a2_dual_lasers", LocationType.OTHER),
"Ratman Den 3": Portal2LocationData("sp_a2_trust_fling", LocationType.OTHER, [portal_gun_2, faith_plate]),
"Ratman Den 4": Portal2LocationData("sp_a2_bridge_intro", LocationType.OTHER),
"Ratman Den 5": Portal2LocationData("sp_a2_bridge_the_gap", LocationType.OTHER, [portal_gun_2]),
"Ratman Den 6": Portal2LocationData("sp_a2_laser_vs_turret", LocationType.OTHER, [portal_gun_2, laser, floor_button, reflection_cube]),
"Ratman Den 7": Portal2LocationData("sp_a2_pull_the_rug", LocationType.OTHER, [portal_gun_2, bridge])
"Ratman Den 1": Portal2LocationData("sp_a1_intro4", LocationType.RATMAN_DEN, [weighted_cube, floor_button]),
"Ratman Den 2": Portal2LocationData("sp_a2_dual_lasers", LocationType.RATMAN_DEN),
"Ratman Den 3": Portal2LocationData("sp_a2_trust_fling", LocationType.RATMAN_DEN, [portal_gun_2, faith_plate]),
"Ratman Den 4": Portal2LocationData("sp_a2_bridge_intro", LocationType.RATMAN_DEN),
"Ratman Den 5": Portal2LocationData("sp_a2_bridge_the_gap", LocationType.RATMAN_DEN, [portal_gun_2, bridge]),
"Ratman Den 6": Portal2LocationData("sp_a2_laser_vs_turret", LocationType.RATMAN_DEN, [portal_gun_2, laser, floor_button, reflection_cube]),
"Ratman Den 7": Portal2LocationData("sp_a2_pull_the_rug", LocationType.RATMAN_DEN, [portal_gun_2, bridge])
}

ratman_map_to_ratman_den: dict[str, str] = {value.map_name: key for key, value in ratman_den_locations_table.items()}

vitrified_door_locations_table: dict[str, Portal2LocationData] = {
"Vitrified Door 1": Portal2LocationData("sp_a3_03", LocationType.OTHER, [portal_gun_2], 6),
"Vitrified Door 2": Portal2LocationData("sp_a3_03", LocationType.OTHER, [portal_gun_2], 6),
"Vitrified Door 3": Portal2LocationData("sp_a3_03", LocationType.OTHER, [portal_gun_2], 6),
"Vitrified Door 4": Portal2LocationData("sp_a3_transition01", LocationType.OTHER, [portal_gun_2], 6),
"Vitrified Door 5": Portal2LocationData("sp_a3_transition01", LocationType.OTHER, [portal_gun_2], 6),
"Vitrified Door 6": Portal2LocationData("sp_a3_transition01", LocationType.OTHER, [portal_gun_2], 6),
}

vitrified_map_to_vitrified_door: dict[str, list[str]] = {
"sp_a3_03": ["Vitrified Door 1", "Vitrified Door 2", "Vitrified Door 3"],
"sp_a3_transition01": ["Vitrified Door 4", "Vitrified Door 5", "Vitrified Door 6"]
}

all_locations_table: dict[str, Portal2LocationData] = map_complete_table.copy()
all_locations_table.update(cutscene_completion_table)

Expand All @@ -191,6 +208,7 @@ class Portal2Location(Location):
all_locations_table.update(wheatley_monitor_table)
all_locations_table.update(item_location_table)
all_locations_table.update(ratman_den_locations_table)
all_locations_table.update(vitrified_door_locations_table)
# all_locations_table.update(achievements_table)

location_groups: dict[str, set[str]] = {
Expand Down Expand Up @@ -236,8 +254,8 @@ class Portal2Location(Location):
"Neurotoxin Sabotage Completion": [portal_gun_2],
"Core Completion": [turrets],
# Chapter 6
"Repulsion Intro Completion": [paint, old_floor_button, portal_gun_2],
"Bomb Flings Completion": [portal_gun_2, paint, old_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],
# Chapter 7
"Propulsion Intro Completion": [portal_gun_2],
Expand All @@ -253,7 +271,7 @@ class Portal2Location(Location):
"Laser Catapult Completion": [portal_gun_2],
"Laser Platform Completion": [portal_gun_2, funnel],
"Propulsion Catch Completion": [button, frankenturret],
"Repulsion Polarity Completion": [turrets, button, paint],
"Repulsion Polarity Completion": [turrets, button, blue_gel, white_gel],
# Chapter 9
"Finale 1 Completion": [portal_gun_2, frankenturret, faith_plate],
"Finale 2 Completion": [portal_gun_2],
Expand All @@ -263,7 +281,7 @@ class Portal2Location(Location):
sub_locations_in_maps: dict[str, list[str]] = {
"Portal Gun Completion": [portal_gun_1],
"Incinerator Completion": [portal_gun_2],
"PotatOS Completion": [potatos],
"PotatOS Completion": [potatos, "Vitrified Door 4", "Vitrified Door 5", "Vitrified Door 6"],
"Funnel Intro Completion": ["Wheatley Monitor 1"],
"Ceiling Button Completion": ["Wheatley Monitor 2"],
"Wall Button Completion": ["Wheatley Monitor 3"],
Expand All @@ -275,11 +293,12 @@ class Portal2Location(Location):
"Propulsion Catch Completion": ["Wheatley Monitor 10"],
"Repulsion Polarity Completion": ["Wheatley Monitor 11"],
"Finale 3 Completion": ["Wheatley Monitor 12"],
"Laser Stairs Completion": ["Ratman Den 1"],
"Smooth Jazz Completion": ["Ratman Den 1"],
"Dual Lasers Completion": ["Ratman Den 2"],
"Trust Fling Completion": ["Ratman Den 3"],
"Bridge Intro Completion": ["Ratman Den 4"],
"Bridge the Gap Completion": ["Ratman Den 5"],
"Laser Vs. Turret Completion": ["Ratman Den 6"],
"Pull The Rug Completion": ["Ratman Den 7"]
"Pull The Rug Completion": ["Ratman Den 7"],
"Cave Johnson Completion": ["Vitrified Door 1", "Vitrified Door 2", "Vitrified Door 3"],
}
8 changes: 8 additions & 0 deletions worlds/portal2/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ class RatmanDens(Toggle):
Determines whether locating Ratman Dens will send location checks
"""
display_name = "Ratman Dens"

class VitrifiedDoors(Toggle):
"""
Determines whether locating Vitrified Doors will send location checks
"""
display_name = "Vitrified Doors"

portal2_option_groups = [
OptionGroup("Location Options", [
Expand All @@ -137,6 +143,7 @@ class RatmanDens(Toggle):
CutsceneLevels,
WheatleyMonitors,
RatmanDens,
VitrifiedDoors
]),
OptionGroup("Trap Options", [
TrapFillPercentage,
Expand Down Expand Up @@ -169,6 +176,7 @@ class Portal2Options(PerGameCommonOptions):
# storyachievementsanity: StoryAchievementSanity
wheatley_monitors: WheatleyMonitors
ratman_dens: RatmanDens
vitrified_doors: VitrifiedDoors

trap_fill_percentage: TrapFillPercentage
motion_blur_trap_weight: MotionBlurTrapWeight
Expand Down
3 changes: 3 additions & 0 deletions worlds/portal2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ def create_connected_maps(self, chapter_number: int, map_location_names: list[st
elif self.options.ratman_dens and sub_location in ratman_den_locations_table:
ratman_requirements = ratman_den_locations_table[sub_location].required_items
self.create_in_level_check(sub_location, ratman_requirements, region_start)
elif self.options.vitrified_doors and sub_location in vitrified_door_locations_table:
vitrified_requirements = vitrified_door_locations_table[sub_location].required_items
self.create_in_level_check(sub_location, vitrified_requirements, region_start)

# Connect to chapter region if there was no previous level or if open world
if self.options.game_mode == GameModeOption.OPEN_WORLD or last_region == None:
Expand Down
2 changes: 1 addition & 1 deletion worlds/portal2/archipelago.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"game": "Portal 2",
"authors": [ "GlassToadstool" ],
"minimum_ap_version": "0.6.3",
"world_version": "0.6.0"
"world_version": "0.7.0"
}
Loading
Loading