| 
									
										
										
										
											2023-03-21 15:21:27 -05:00
										 |  |  | from BaseClasses import ItemClassification | 
					
						
							|  |  |  | from . import MessengerTestBase | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class HardLogicTest(MessengerTestBase): | 
					
						
							|  |  |  |     options = { | 
					
						
							| 
									
										
										
										
											2023-04-03 19:27:36 -05:00
										 |  |  |         "logic_level": "hard", | 
					
						
							| 
									
										
										
										
											2023-03-21 15:21:27 -05:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def testVertical(self) -> None: | 
					
						
							|  |  |  |         """Test the locations that still require wingsuit or rope dart.""" | 
					
						
							|  |  |  |         locations = [ | 
					
						
							|  |  |  |             # tower of time | 
					
						
							|  |  |  |             "Tower of Time Seal - Time Waster Seal", "Tower of Time Seal - Lantern Climb", | 
					
						
							|  |  |  |             "Tower of Time Seal - Arcane Orbs", | 
					
						
							|  |  |  |             # ninja village | 
					
						
							| 
									
										
										
										
											2023-04-03 19:27:36 -05:00
										 |  |  |             "Candle", "Astral Seed", "Ninja Village Seal - Tree House", "Astral Tea Leaves", | 
					
						
							| 
									
										
										
										
											2023-03-21 15:21:27 -05:00
										 |  |  |             # autumn hills | 
					
						
							| 
									
										
										
										
											2023-04-06 03:48:30 -05:00
										 |  |  |             "Climbing Claws", "Key of Hope", "Leaf Golem", | 
					
						
							| 
									
										
										
										
											2023-03-21 15:21:27 -05:00
										 |  |  |             "Autumn Hills Seal - Trip Saws", "Autumn Hills Seal - Double Swing Saws", | 
					
						
							|  |  |  |             "Autumn Hills Seal - Spike Ball Swing", "Autumn Hills Seal - Spike Ball Darts", | 
					
						
							|  |  |  |             # forlorn temple | 
					
						
							|  |  |  |             "Demon King Crown", | 
					
						
							|  |  |  |             "Forlorn Temple Seal - Rocket Maze", "Forlorn Temple Seal - Rocket Sunset", | 
					
						
							|  |  |  |             # catacombs | 
					
						
							| 
									
										
										
										
											2023-04-06 03:48:30 -05:00
										 |  |  |             "Necro", "Ruxxtin's Amulet", "Ruxxtin", | 
					
						
							| 
									
										
										
										
											2023-03-21 15:21:27 -05:00
										 |  |  |             "Catacombs Seal - Triple Spike Crushers", "Catacombs Seal - Crusher Gauntlet", "Catacombs Seal - Dirty Pond", | 
					
						
							|  |  |  |             # bamboo creek | 
					
						
							|  |  |  |             "Claustro", | 
					
						
							|  |  |  |             "Bamboo Creek Seal - Spike Crushers and Doors", "Bamboo Creek Seal - Spike Ball Pits", | 
					
						
							|  |  |  |             "Bamboo Creek Seal - Spike Crushers and Doors v2", | 
					
						
							|  |  |  |             # howling grotto | 
					
						
							| 
									
										
										
										
											2023-04-06 03:48:30 -05:00
										 |  |  |             "Emerald Golem", "Howling Grotto Seal - Crushing Pits", "Howling Grotto Seal - Crushing Pits", | 
					
						
							| 
									
										
										
										
											2023-03-21 15:21:27 -05:00
										 |  |  |             # glacial peak | 
					
						
							|  |  |  |             "Glacial Peak Seal - Ice Climbers", | 
					
						
							|  |  |  |             # cloud ruins | 
					
						
							|  |  |  |             "Acro", "Cloud Ruins Seal - Ghost Pit", | 
					
						
							|  |  |  |             "Cloud Ruins Seal - Toothbrush Alley", "Cloud Ruins Seal - Saw Pit", "Cloud Ruins Seal - Money Farm Room", | 
					
						
							|  |  |  |             # underworld | 
					
						
							|  |  |  |             "Underworld Seal - Rising Fanta", "Underworld Seal - Sharp and Windy Climb", | 
					
						
							|  |  |  |             # riviere turquoise | 
					
						
							|  |  |  |             "Fairy Bottle", "Riviere Turquoise Seal - Flower Power", | 
					
						
							|  |  |  |             # elemental skylands | 
					
						
							| 
									
										
										
										
											2023-04-06 03:48:30 -05:00
										 |  |  |             "Elemental Skylands Seal - Air", | 
					
						
							| 
									
										
										
										
											2023-03-21 15:21:27 -05:00
										 |  |  |             # phantom | 
					
						
							|  |  |  |             "Rescue Phantom", | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  |         items = [["Wingsuit", "Rope Dart"]] | 
					
						
							|  |  |  |         self.assertAccessDependency(locations, items) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def testWindmill(self) -> None: | 
					
						
							|  |  |  |         """Windmill Shuriken isn't progression on normal difficulty, so test it's marked correctly and required.""" | 
					
						
							|  |  |  |         self.assertEqual(ItemClassification.progression, self.get_item_by_name("Windmill Shuriken").classification) | 
					
						
							|  |  |  |         windmill_locs = [ | 
					
						
							|  |  |  |             "Key of Strength", | 
					
						
							|  |  |  |             "Key of Symbiosis", | 
					
						
							| 
									
										
										
										
											2023-04-03 19:27:36 -05:00
										 |  |  |             "Underworld Seal - Fireball Wave", | 
					
						
							| 
									
										
										
										
											2023-03-21 15:21:27 -05:00
										 |  |  |         ] | 
					
						
							|  |  |  |         for loc in windmill_locs: | 
					
						
							|  |  |  |             with self.subTest("can't reach location with nothing", location=loc): | 
					
						
							|  |  |  |                 self.assertFalse(self.can_reach_location(loc)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         items = self.get_items_by_name(["Windmill Shuriken", "Ninja Tabi", "Fairy Bottle"]) | 
					
						
							|  |  |  |         self.collect(items) | 
					
						
							|  |  |  |         for loc in windmill_locs: | 
					
						
							|  |  |  |             with self.subTest("can reach with Windmill", location=loc): | 
					
						
							|  |  |  |                 self.assertTrue(self.can_reach_location(loc)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         special_loc = "Autumn Hills Seal - Spike Ball Darts" | 
					
						
							|  |  |  |         item = self.get_item_by_name("Wingsuit") | 
					
						
							|  |  |  |         self.collect(item) | 
					
						
							|  |  |  |         self.assertTrue(self.can_reach_location(special_loc)) | 
					
						
							|  |  |  |         self.remove(item) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         item = self.get_item_by_name("Rope Dart") | 
					
						
							|  |  |  |         self.collect(item) | 
					
						
							|  |  |  |         self.assertTrue(self.can_reach_location(special_loc)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ChallengingLogicTest(MessengerTestBase): | 
					
						
							|  |  |  |     options = { | 
					
						
							| 
									
										
										
										
											2023-03-24 18:55:24 -05:00
										 |  |  |         "shuffle_seals": "false", | 
					
						
							| 
									
										
										
										
											2023-04-03 19:27:36 -05:00
										 |  |  |         "logic_level": "challenging", | 
					
						
							| 
									
										
										
										
											2023-03-21 15:21:27 -05:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class NoLogicTest(MessengerTestBase): | 
					
						
							|  |  |  |     options = { | 
					
						
							| 
									
										
										
										
											2023-04-03 19:27:36 -05:00
										 |  |  |         "logic_level": "oob", | 
					
						
							| 
									
										
										
										
											2023-03-21 15:21:27 -05:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def testAccess(self) -> None: | 
					
						
							|  |  |  |         """Test the locations with rules still require things.""" | 
					
						
							|  |  |  |         all_locations = [ | 
					
						
							|  |  |  |             "Claustro", "Key of Strength", "Key of Symbiosis", "Key of Love", "Pyro", "Key of Chaos", "Key of Courage", | 
					
						
							|  |  |  |             "Autumn Hills Seal - Spike Ball Darts", "Ninja Village Seal - Tree House", "Underworld Seal - Fireball Wave", | 
					
						
							|  |  |  |             "Tower of Time Seal - Time Waster Seal", "Rescue Phantom", "Elemental Skylands Seal - Air", | 
					
						
							|  |  |  |             "Elemental Skylands Seal - Water", "Elemental Skylands Seal - Fire", | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  |         for loc in all_locations: | 
					
						
							|  |  |  |             with self.subTest("Default unreachables", location=loc): | 
					
						
							|  |  |  |                 self.assertFalse(self.can_reach_location(loc)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def testNoLogic(self) -> None: | 
					
						
							|  |  |  |         """Test some funny locations to make sure they aren't reachable, but we can still win""" | 
					
						
							|  |  |  |         self.assertEqual(self.can_reach_location("Pyro"), False) | 
					
						
							|  |  |  |         self.assertEqual(self.can_reach_location("Rescue Phantom"), False) | 
					
						
							|  |  |  |         self.assertBeatable(True) |