 6dccf36f88
			
		
	
	6dccf36f88
	
	
	
		
			
			Almost all of the events have been eradicated, which significantly improves both generation speed and playthrough calculation. Previously, checking for access to a location involved checking for access to each panel in the location, as well as recursively checking for access to any panels required by those panels. This potentially performed the same check multiple times. The access requirements for locations are now calculated and flattened in generate_early, so that the access function can directly check for the required rooms, doors, and colors. These flattened access requirements are also used for Entrance checking, and register_indirect_condition is used to make sure that can_reach(Region) is safe to use. The Mastery and Level 2 rules now just run a bunch of access rules and count the number of them that succeed, instead of relying on event items. Finally: the Level 2 panel hunt is now enabled even when Level 2 is not the victory condition, as I feel that generation is fast enough now for that to be acceptable.
		
			
				
	
	
		
			20 lines
		
	
	
		
			738 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			738 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from . import LingoTestBase
 | |
| 
 | |
| 
 | |
| class TestPanelHunt(LingoTestBase):
 | |
|     options = {
 | |
|         "shuffle_doors": "complex",
 | |
|         "location_checks": "insanity",
 | |
|         "victory_condition": "level_2",
 | |
|         "level_2_requirement": "15"
 | |
|     }
 | |
| 
 | |
|     def test_another_try(self) -> None:
 | |
|         self.collect_by_name("The Traveled - Entrance") # idk why this is needed
 | |
|         self.assertFalse(self.can_reach_location("Second Room - ANOTHER TRY"))
 | |
|         self.assertFalse(self.can_reach_location("Second Room - Unlock Level 2"))
 | |
| 
 | |
|         self.collect_by_name("Second Room - Exit Door")
 | |
|         self.assertTrue(self.can_reach_location("Second Room - ANOTHER TRY"))
 | |
|         self.assertTrue(self.can_reach_location("Second Room - Unlock Level 2"))
 |