Implement Return Old Man already in starting inventory

This commit is contained in:
codemann8
2023-12-07 13:04:24 -06:00
parent bcd311980b
commit a6f244cd01
3 changed files with 12 additions and 1 deletions

View File

@@ -114,6 +114,9 @@ class InitialSram:
equip[0x37B] = 1 equip[0x37B] = 1
equip[0x36E] = 0x80 equip[0x36E] = 0x80
if startingstate.has('Return Old Man', player):
self._initial_sram_bytes[0x410] = self._initial_sram_bytes[0x410] | 0x01
for item in world.precollected_items: for item in world.precollected_items:
if item.player != player: if item.player != player:
continue continue
@@ -123,7 +126,8 @@ class InitialSram:
'Golden Sword', 'Tempered Sword', 'Master Sword', 'Fighter Sword', 'Progressive Sword', 'Golden Sword', 'Tempered Sword', 'Master Sword', 'Fighter Sword', 'Progressive Sword',
'Mirror Shield', 'Red Shield', 'Blue Shield', 'Progressive Shield', 'Mirror Shield', 'Red Shield', 'Blue Shield', 'Progressive Shield',
'Red Mail', 'Blue Mail', 'Progressive Armor', 'Red Mail', 'Blue Mail', 'Progressive Armor',
'Magic Upgrade (1/4)', 'Magic Upgrade (1/2)']: 'Magic Upgrade (1/4)', 'Magic Upgrade (1/2)',
'Return Old Man']:
continue continue
set_table = {'Book of Mudora': (0x34E, 1), 'Hammer': (0x34B, 1), 'Bug Catching Net': (0x34D, 1), 'Hookshot': (0x342, 1), 'Magic Mirror': (0x353, 2), set_table = {'Book of Mudora': (0x34E, 1), 'Hammer': (0x34B, 1), 'Bug Catching Net': (0x34D, 1), 'Hookshot': (0x342, 1), 'Magic Mirror': (0x353, 2),

View File

@@ -227,6 +227,12 @@ def generate_itempool(world, player):
loc.locked = True loc.locked = True
loc.forced_item = loc.item loc.forced_item = loc.item
if 'Return Old Man' in list(map(str, [i for i in world.precollected_items if i.player == player])):
old_man = world.get_location('Old Man', player)
world.push_item(old_man, ItemFactory('Nothing', player), False)
old_man.forced_item = old_man.item
old_man.skip = True
world.get_location('Ganon', player).event = True world.get_location('Ganon', player).event = True
world.get_location('Ganon', player).locked = True world.get_location('Ganon', player).locked = True
world.push_item(world.get_location('Agahnim 1', player), ItemFactory('Beat Agahnim 1', player), False) world.push_item(world.get_location('Agahnim 1', player), ItemFactory('Beat Agahnim 1', player), False)

View File

@@ -1541,6 +1541,7 @@ def standard_rules(world, player):
world.get_entrance('Uncle S&Q', player).hide_path = True world.get_entrance('Uncle S&Q', player).hide_path = True
set_rule(world.get_entrance('Links House S&Q', player), lambda state: state.has('Zelda Delivered', player)) set_rule(world.get_entrance('Links House S&Q', player), lambda state: state.has('Zelda Delivered', player))
set_rule(world.get_entrance('Sanctuary S&Q', player), lambda state: state.has('Zelda Delivered', player)) set_rule(world.get_entrance('Sanctuary S&Q', player), lambda state: state.has('Zelda Delivered', player))
add_rule(world.get_entrance('Old Man S&Q', player), lambda state: state.has('Zelda Delivered', player))
# these are because of rails # these are because of rails
if world.shuffle[player] != 'vanilla': if world.shuffle[player] != 'vanilla':
# where ever these happen to be # where ever these happen to be