commit
						f3e5e5faa5
					
				| 
						 | 
				
			
			@ -61,6 +61,7 @@ class World(object):
 | 
			
		|||
        self.difficulty_requirements = None
 | 
			
		||||
        self.fix_fake_world = True
 | 
			
		||||
        self.spoiler = Spoiler(self)
 | 
			
		||||
        self.lamps_needed_for_dark_rooms = 1
 | 
			
		||||
 | 
			
		||||
    def intialize_regions(self):
 | 
			
		||||
        for region in self.regions:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,6 +8,9 @@ def link_entrances(world):
 | 
			
		|||
    for exitname, regionname in mandatory_connections:
 | 
			
		||||
        connect_simple(world, exitname, regionname)
 | 
			
		||||
 | 
			
		||||
    connect_two_way(world, 'Links House', 'Links House Exit') # unshuffled. For now
 | 
			
		||||
    connect_exit(world, 'Chris Houlihan Room Exit', 'Links House') # should always match link's house, except for plandos
 | 
			
		||||
 | 
			
		||||
    # if we do not shuffle, set default connections
 | 
			
		||||
    if world.shuffle == 'vanilla':
 | 
			
		||||
        for exitname, regionname in default_connections:
 | 
			
		||||
| 
						 | 
				
			
			@ -1649,10 +1652,7 @@ Single_Cave_Targets = ['Blinds Hideout',
 | 
			
		|||
                       'Dam']
 | 
			
		||||
 | 
			
		||||
# these are connections that cannot be shuffled and always exist. They link together separate parts of the world we need to divide into regions
 | 
			
		||||
mandatory_connections = [('Links House', 'Links House'),  # unshuffled. For now
 | 
			
		||||
                         ('Links House Exit', 'Light World'),
 | 
			
		||||
 | 
			
		||||
                         ('Lake Hylia Central Island Pier', 'Lake Hylia Central Island'),
 | 
			
		||||
mandatory_connections = [('Lake Hylia Central Island Pier', 'Lake Hylia Central Island'),
 | 
			
		||||
                         ('Lake Hylia Central Island Teleporter', 'Dark Lake Hylia Central Island'),
 | 
			
		||||
                         ('Zoras River', 'Zoras River'),
 | 
			
		||||
                         ('Kings Grave Outer Rocks', 'Kings Grave Area'),
 | 
			
		||||
| 
						 | 
				
			
			@ -2045,7 +2045,8 @@ default_dungeon_connections = [('Desert Palace Entrance (South)', 'Desert Palace
 | 
			
		|||
# exitdata = (room_id, ow_area, vram_loc, scroll_y, scroll_x, link_y, link_x, camera_y, camera_x, unknown_1, unknown_2, door_1, door_2)
 | 
			
		||||
 | 
			
		||||
# ToDo somehow merge this with creation of the locations
 | 
			
		||||
door_addresses = {'Desert Palace Entrance (South)': (0x08, (0x0084, 0x30, 0x0314, 0x0c56, 0x00a6, 0x0ca8, 0x0128, 0x0cc3, 0x0133, 0x0a, 0xfa, 0x0000, 0x0000)),
 | 
			
		||||
door_addresses = {'Links House': (0x00, (0x0104, 0x2c, 0x0506, 0x0a9a, 0x0832, 0x0ae8, 0x08b8, 0x0b07, 0x08bf, 0x06, 0xfe, 0x0816, 0x0000)),
 | 
			
		||||
                  'Desert Palace Entrance (South)': (0x08, (0x0084, 0x30, 0x0314, 0x0c56, 0x00a6, 0x0ca8, 0x0128, 0x0cc3, 0x0133, 0x0a, 0xfa, 0x0000, 0x0000)),
 | 
			
		||||
                  'Desert Palace Entrance (West)': (0x0A, (0x0083, 0x30, 0x0280, 0x0c46, 0x0003, 0x0c98, 0x0088, 0x0cb3, 0x0090, 0x0a, 0xfd, 0x0000, 0x0000)),
 | 
			
		||||
                  'Desert Palace Entrance (North)': (0x0B, (0x0063, 0x30, 0x0016, 0x0c00, 0x00a2, 0x0c28, 0x0128, 0x0c6d, 0x012f, 0x00, 0x0e, 0x0000, 0x0000)),
 | 
			
		||||
                  'Desert Palace Entrance (East)': (0x09, (0x0085, 0x30, 0x02a8, 0x0c4a, 0x0142, 0x0c98, 0x01c8, 0x0cb7, 0x01cf, 0x06, 0xfe, 0x0000, 0x0000)),
 | 
			
		||||
| 
						 | 
				
			
			@ -2189,7 +2190,9 @@ door_addresses = {'Desert Palace Entrance (South)': (0x08, (0x0084, 0x30, 0x0314
 | 
			
		|||
# Key=Name
 | 
			
		||||
# value = entrance #
 | 
			
		||||
#        | (entrance #, exit #)
 | 
			
		||||
exit_ids = {'Desert Palace Exit (South)': (0x09, 0x0A),
 | 
			
		||||
exit_ids = {'Links House Exit': (0x01, 0x00),
 | 
			
		||||
            'Chris Houlihan Room Exit': (None, 0x3D),
 | 
			
		||||
            'Desert Palace Exit (South)': (0x09, 0x0A),
 | 
			
		||||
            'Desert Palace Exit (West)': (0x0B, 0x0C),
 | 
			
		||||
            'Desert Palace Exit (East)': (0x0A, 0x0B),
 | 
			
		||||
            'Desert Palace Exit (North)': (0x0C, 0x0D),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										19
									
								
								ItemList.py
								
								
								
								
							
							
						
						
									
										19
									
								
								ItemList.py
								
								
								
								
							| 
						 | 
				
			
			@ -40,7 +40,7 @@ hardbaseitems = (['Silver Arrows', 'Single Arrow', 'Single Bomb'] + ['Rupees (30
 | 
			
		|||
                 ['Boss Heart Container'] * 5 + ['Piece of Heart'] * 24)
 | 
			
		||||
hardfirst20extra = ['Single Bomb'] * 7 + ['Rupees (5)'] * 8 + ['Rupee (1)'] * 2 + ['Rupees (20)']  * 2 + ['Arrows (10)']
 | 
			
		||||
hardsecond10extra = ['Rupees (5)'] * 7 + ['Rupee (1)'] * 3
 | 
			
		||||
hardthird10extra = ['Arrows (10)'] * 4 + ['Rupees (20)']  * 3 + ['Single Bomb'] * 3 
 | 
			
		||||
hardthird10extra = ['Arrows (10)'] * 4 + ['Rupees (20)']  * 3 + ['Single Bomb'] * 3
 | 
			
		||||
hardfourth10extra = ['Rupees (5)'] * 3 + ['Single Arrow'] * 5 + ['Single Bomb'] * 2
 | 
			
		||||
hardfinal20extra = ['Single Bomb'] * 4 + ['Rupees (5)'] * 2 + ['Single Arrow'] * 14
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -217,14 +217,15 @@ def generate_itempool(world):
 | 
			
		|||
 | 
			
		||||
    # set up item pool
 | 
			
		||||
    if world.custom:
 | 
			
		||||
        (pool, placed_items, clock_mode, treasure_hunt_count, treasure_hunt_icon) = make_custom_item_pool(world.progressive, world.shuffle, world.difficulty, world.timer, world.goal, world.mode, world.customitemarray)
 | 
			
		||||
        (pool, placed_items, clock_mode, treasure_hunt_count, treasure_hunt_icon, lamps_needed_for_dark_rooms) = make_custom_item_pool(world.progressive, world.shuffle, world.difficulty, world.timer, world.goal, world.mode, world.customitemarray)
 | 
			
		||||
        world.rupoor_cost = min(world.customitemarray[67], 9999)
 | 
			
		||||
    else:
 | 
			
		||||
        (pool, placed_items, clock_mode, treasure_hunt_count, treasure_hunt_icon) = get_pool_core(world.progressive, world.shuffle, world.difficulty, world.timer, world.goal, world.mode)
 | 
			
		||||
        (pool, placed_items, clock_mode, treasure_hunt_count, treasure_hunt_icon, lamps_needed_for_dark_rooms) = get_pool_core(world.progressive, world.shuffle, world.difficulty, world.timer, world.goal, world.mode)
 | 
			
		||||
    world.itempool = ItemFactory(pool)
 | 
			
		||||
    for (location, item) in placed_items:
 | 
			
		||||
        world.push_item(location, ItemFactory(item), False)
 | 
			
		||||
        world.get_location(location).event = True
 | 
			
		||||
    world.lamps_needed_for_dark_rooms = lamps_needed_for_dark_rooms
 | 
			
		||||
    if clock_mode is not None:
 | 
			
		||||
        world.clock_mode = clock_mode
 | 
			
		||||
    if treasure_hunt_count is not None:
 | 
			
		||||
| 
						 | 
				
			
			@ -299,6 +300,10 @@ def get_pool_core(progressive, shuffle, difficulty, timer, goal, mode):
 | 
			
		|||
    else:
 | 
			
		||||
        pool.extend(basicgloves)
 | 
			
		||||
 | 
			
		||||
    lamps_needed_for_dark_rooms = 1
 | 
			
		||||
    if difficulty == 'easy':
 | 
			
		||||
        lamps_needed_for_dark_rooms = 3
 | 
			
		||||
 | 
			
		||||
    # insanity shuffle doesn't have fake LW/DW logic so for now guaranteed Mirror and Moon Pearl at the start
 | 
			
		||||
    if  shuffle == 'insanity_legacy':
 | 
			
		||||
        placed_items.append(('Link\'s House', 'Magic Mirror'))
 | 
			
		||||
| 
						 | 
				
			
			@ -377,7 +382,7 @@ def get_pool_core(progressive, shuffle, difficulty, timer, goal, mode):
 | 
			
		|||
 | 
			
		||||
    if goal == 'pedestal':
 | 
			
		||||
        placed_items.append(('Master Sword Pedestal', 'Triforce'))
 | 
			
		||||
    return (pool, placed_items, clock_mode, treasure_hunt_count, treasure_hunt_icon)
 | 
			
		||||
    return (pool, placed_items, clock_mode, treasure_hunt_count, treasure_hunt_icon, lamps_needed_for_dark_rooms)
 | 
			
		||||
 | 
			
		||||
def make_custom_item_pool(progressive, shuffle, difficulty, timer, goal, mode, customitemarray):
 | 
			
		||||
    pool = []
 | 
			
		||||
| 
						 | 
				
			
			@ -461,6 +466,10 @@ def make_custom_item_pool(progressive, shuffle, difficulty, timer, goal, mode, c
 | 
			
		|||
 | 
			
		||||
    diff = difficulties[difficulty]
 | 
			
		||||
 | 
			
		||||
    lamps_needed_for_dark_rooms = 1
 | 
			
		||||
    if difficulty == 'easy':
 | 
			
		||||
        lamps_needed_for_dark_rooms = customitemarray[12]
 | 
			
		||||
 | 
			
		||||
    # expert+ difficulties produce the same contents for
 | 
			
		||||
    # all bottles, since only one bottle is available
 | 
			
		||||
    if diff.same_bottle:
 | 
			
		||||
| 
						 | 
				
			
			@ -515,7 +524,7 @@ def make_custom_item_pool(progressive, shuffle, difficulty, timer, goal, mode, c
 | 
			
		|||
    if itemtotal < total_items_to_place:
 | 
			
		||||
        pool.extend(['Nothing'] * (total_items_to_place - itemtotal))
 | 
			
		||||
 | 
			
		||||
    return (pool, placed_items, clock_mode, treasure_hunt_count, treasure_hunt_icon)
 | 
			
		||||
    return (pool, placed_items, clock_mode, treasure_hunt_count, treasure_hunt_icon, lamps_needed_for_dark_rooms)
 | 
			
		||||
 | 
			
		||||
# A quick test to ensure all combinations generate the correct amount of items.
 | 
			
		||||
def test():
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										3
									
								
								Main.py
								
								
								
								
							
							
						
						
									
										3
									
								
								Main.py
								
								
								
								
							| 
						 | 
				
			
			@ -146,7 +146,8 @@ def copy_world(world):
 | 
			
		|||
    ret.can_access_trock_eyebridge = world.can_access_trock_eyebridge
 | 
			
		||||
    ret.can_take_damage = world.can_take_damage
 | 
			
		||||
    ret.difficulty_requirements = world.difficulty_requirements
 | 
			
		||||
    ret.fix_fake_world = ret.fix_fake_world
 | 
			
		||||
    ret.fix_fake_world = world.fix_fake_world
 | 
			
		||||
    ret.lamps_needed_for_dark_rooms = world.lamps_needed_for_dark_rooms
 | 
			
		||||
    create_regions(ret)
 | 
			
		||||
    create_dungeons(ret)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,6 +30,7 @@ def create_regions(world):
 | 
			
		|||
        create_cave_region('North Fairy Cave', None, ['North Fairy Cave Exit']),
 | 
			
		||||
        create_cave_region('Dam', ['Floodgate Chest']),
 | 
			
		||||
        create_cave_region('Links House', ['Link\'s House'], ['Links House Exit']),
 | 
			
		||||
        create_cave_region('Chris Houlihan Room', None, ['Chris Houlihan Room Exit']),
 | 
			
		||||
        create_cave_region('Tavern', ['Kakariko Tavern']),
 | 
			
		||||
        create_cave_region('Elder House', None, ['Elder House Exit (East)', 'Elder House Exit (West)']),
 | 
			
		||||
        create_cave_region('Snitch Lady (East)'),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								Rom.py
								
								
								
								
							
							
						
						
									
										2
									
								
								Rom.py
								
								
								
								
							| 
						 | 
				
			
			@ -15,7 +15,7 @@ from Items import ItemFactory
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
JAP10HASH = '03a63945398191337e896e5771f77173'
 | 
			
		||||
RANDOMIZERBASEHASH = 'c2ee7540753ec0225372669f830b6edd'
 | 
			
		||||
RANDOMIZERBASEHASH = '6f7173a95befbb888569068d22bd790d'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class JsonRom(object):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										8
									
								
								Rules.py
								
								
								
								
							
							
						
						
									
										8
									
								
								Rules.py
								
								
								
								
							| 
						 | 
				
			
			@ -53,7 +53,7 @@ def add_rule(spot, rule, combine='and'):
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
def add_lamp_requirement(spot):
 | 
			
		||||
    add_rule(spot, lambda state: state.has('Lamp'))
 | 
			
		||||
    add_rule(spot, lambda state: state.has('Lamp', state.world.lamps_needed_for_dark_rooms))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def forbid_item(location, item):
 | 
			
		||||
| 
						 | 
				
			
			@ -437,9 +437,9 @@ def no_glitches_rules(world):
 | 
			
		|||
    add_conditional_lamp('Eastern Palace - Prize', 'Eastern Palace', 'Location')
 | 
			
		||||
 | 
			
		||||
    if not world.sewer_light_cone:
 | 
			
		||||
        add_rule(world.get_location('Sewers - Dark Cross'), lambda state: state.has('Lamp'))
 | 
			
		||||
        add_rule(world.get_entrance('Sewers Back Door'), lambda state: state.has('Lamp'))
 | 
			
		||||
        add_rule(world.get_entrance('Throne Room'), lambda state: state.has('Lamp'))
 | 
			
		||||
        add_lamp_requirement(world.get_location('Sewers - Dark Cross'))
 | 
			
		||||
        add_lamp_requirement(world.get_entrance('Sewers Back Door'))
 | 
			
		||||
        add_lamp_requirement(world.get_entrance('Throne Room'))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def open_rules(world):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Loading…
	
		Reference in New Issue