mirror of
				https://github.com/MarioSpore/Grinch-AP.git
				synced 2025-10-21 20:21:32 -06:00 
			
		
		
		
	LADX: Fix D6 keylogic (#1585)
* fix keylogic for d6 * markup required keys for keylogic * add test * Update __init__.py
This commit is contained in:
		| @@ -31,8 +31,8 @@ class Dungeon6: | ||||
|             lower_right_owl = Location(dungeon=6).add(OwlStatue(0x1D7)).connect(lower_right_side, AND(POWER_BRACELET, STONE_BEAK6)) | ||||
|  | ||||
|         center_1 = Location(dungeon=6).add(DroppedKey(0x1C3)).connect(miniboss, AND(COUNT(POWER_BRACELET, 2), FEATHER)) # tile room key drop | ||||
|         center_2_and_upper_right_side = Location(dungeon=6).add(DungeonChest(0x1B1)).connect(center_1, KEY6) # top right chest horseheads | ||||
|         boss_key = Location(dungeon=6).add(DungeonChest(0x1B6)).connect(center_2_and_upper_right_side, AND(KEY6, HOOKSHOT)) | ||||
|         center_2_and_upper_right_side = Location(dungeon=6).add(DungeonChest(0x1B1)).connect(center_1, AND(KEY6, FOUND(KEY6, 2))) # top right chest horseheads | ||||
|         boss_key = Location(dungeon=6).add(DungeonChest(0x1B6)).connect(center_2_and_upper_right_side, AND(AND(KEY6, FOUND(KEY6, 3), HOOKSHOT))) | ||||
|         if options.owlstatues == "both" or options.owlstatues == "dungeon": | ||||
|             Location(dungeon=6).add(OwlStatue(0x1B6)).connect(boss_key, STONE_BEAK6) | ||||
|  | ||||
|   | ||||
							
								
								
									
										35
									
								
								worlds/ladx/test/TestDungeonLogic.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								worlds/ladx/test/TestDungeonLogic.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,35 @@ | ||||
| from . import LADXTestBase | ||||
|  | ||||
| from ..Items import ItemName | ||||
|  | ||||
| class TestD6(LADXTestBase): | ||||
|     # Force keys into pool for testing | ||||
|     options = { | ||||
|         "shuffle_small_keys": "any_world" | ||||
|     } | ||||
|  | ||||
|     def test_keylogic(self): | ||||
|         keys = self.get_items_by_name(ItemName.KEY6) | ||||
|         self.collect_by_name([ItemName.FACE_KEY, ItemName.HOOKSHOT, ItemName.POWER_BRACELET, ItemName.BOMB, ItemName.FEATHER, ItemName.FLIPPERS]) | ||||
|         # Can reach an un-keylocked item in the dungeon | ||||
|         self.assertTrue(self.can_reach_location("L2 Bracelet Chest (Face Shrine)")) | ||||
|  | ||||
|         # For each location, add a key and check that the right thing unlocks | ||||
|         location_1 = "Tile Room Key (Face Shrine)" | ||||
|         location_2 = "Top Right Horse Heads Chest (Face Shrine)" | ||||
|         location_3 = "Pot Locked Chest (Face Shrine)" | ||||
|         self.assertFalse(self.can_reach_location(location_1)) | ||||
|         self.assertFalse(self.can_reach_location(location_2)) | ||||
|         self.assertFalse(self.can_reach_location(location_3)) | ||||
|         self.collect(keys[0]) | ||||
|         self.assertTrue(self.can_reach_location(location_1)) | ||||
|         self.assertFalse(self.can_reach_location(location_2)) | ||||
|         self.assertFalse(self.can_reach_location(location_3)) | ||||
|         self.collect(keys[1]) | ||||
|         self.assertTrue(self.can_reach_location(location_1)) | ||||
|         self.assertTrue(self.can_reach_location(location_2)) | ||||
|         self.assertFalse(self.can_reach_location(location_3)) | ||||
|         self.collect(keys[2]) | ||||
|         self.assertTrue(self.can_reach_location(location_1)) | ||||
|         self.assertTrue(self.can_reach_location(location_2)) | ||||
|         self.assertTrue(self.can_reach_location(location_3)) | ||||
							
								
								
									
										4
									
								
								worlds/ladx/test/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								worlds/ladx/test/__init__.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| from test.TestBase import WorldTestBase | ||||
| from ..Common import LINKS_AWAKENING | ||||
| class LADXTestBase(WorldTestBase): | ||||
|     game = LINKS_AWAKENING | ||||
		Reference in New Issue
	
	Block a user
	 zig-for
					zig-for