close to first pass

This commit is contained in:
qadan 2020-01-02 23:59:28 -04:00
parent 901b25952d
commit 0547606207
4 changed files with 33 additions and 25 deletions

View File

@ -28,12 +28,14 @@ def parse_arguments(argv, no_defaults=False):
parser = argparse.ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter) parser = argparse.ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter)
parser.add_argument('--create_spoiler', help='Output a Spoiler File', action='store_true') parser.add_argument('--create_spoiler', help='Output a Spoiler File', action='store_true')
parser.add_argument('--logic', default=defval('noglitches'), const='noglitches', nargs='?', choices=['noglitches', 'minorglitches', 'nologic'], parser.add_argument('--logic', default=defval('noglitches'), const='noglitches', nargs='?', choices=['noglitches', 'minorglitches', 'owglitches', 'nologic'],
help='''\ help='''\
Select Enforcement of Item Requirements. (default: %(default)s) Select Enforcement of Item Requirements. (default: %(default)s)
No Glitches: No Glitches:
Minor Glitches: May require Fake Flippers, Bunny Revival Minor Glitches: May require Fake Flippers, Bunny Revival
and Dark Room Navigation. and Dark Room Navigation.
Overworld Glitches: May require overworld glitches. Starts with
boots.
No Logic: Distribute items without regard for No Logic: Distribute items without regard for
item requirements. item requirements.
''') ''')

2
Gui.py
View File

@ -193,7 +193,7 @@ def guiMain(args=None):
logicFrame = Frame(drowDownFrame) logicFrame = Frame(drowDownFrame)
logicVar = StringVar() logicVar = StringVar()
logicVar.set('noglitches') logicVar.set('noglitches')
logicOptionMenu = OptionMenu(logicFrame, logicVar, 'noglitches', 'minorglitches', 'nologic') logicOptionMenu = OptionMenu(logicFrame, logicVar, 'noglitches', 'minorglitches', 'owglitches', 'nologic')
logicOptionMenu.pack(side=RIGHT) logicOptionMenu.pack(side=RIGHT)
logicLabel = Label(logicFrame, text='Game logic') logicLabel = Label(logicFrame, text='Game logic')
logicLabel.pack(side=LEFT) logicLabel.pack(side=LEFT)

View File

@ -125,6 +125,8 @@ difficulties = {
} }
def generate_itempool(world, player): def generate_itempool(world, player):
if world.logic == 'owglitches':
world.push_precollected(ItemFactory('Pegasus Boots'), player)
if (world.difficulty[player] not in ['normal', 'hard', 'expert'] or world.goal[player] not in ['ganon', 'pedestal', 'dungeons', 'triforcehunt', 'crystals'] if (world.difficulty[player] not in ['normal', 'hard', 'expert'] or world.goal[player] not in ['ganon', 'pedestal', 'dungeons', 'triforcehunt', 'crystals']
or world.mode[player] not in ['open', 'standard', 'inverted'] or world.timer not in ['none', 'display', 'timed', 'timed-ohko', 'ohko', 'timed-countdown'] or world.progressive not in ['on', 'off', 'random']): or world.mode[player] not in ['open', 'standard', 'inverted'] or world.timer not in ['none', 'display', 'timed', 'timed-ohko', 'ohko', 'timed-countdown'] or world.progressive not in ['on', 'off', 'random']):
raise NotImplementedError('Not supported yet') raise NotImplementedError('Not supported yet')

View File

@ -644,7 +644,10 @@ def no_glitches_rules(world, player):
set_rule(world.get_entrance('Paradox Cave Push Block Reverse', player), lambda state: False) # no glitches does not require block override set_rule(world.get_entrance('Paradox Cave Push Block Reverse', player), lambda state: False) # no glitches does not require block override
set_rule(world.get_entrance('Paradox Cave Bomb Jump', player), lambda state: False) set_rule(world.get_entrance('Paradox Cave Bomb Jump', player), lambda state: False)
set_rule(world.get_entrance('Skull Woods First Section Bomb Jump', player), lambda state: False) set_rule(world.get_entrance('Skull Woods First Section Bomb Jump', player), lambda state: False)
add_conditional_lamps(world, player)
def add_conditional_lamps(world, player):
# Light cones in standard depend on which world we actually are in, not which one the location would normally be # Light cones in standard depend on which world we actually are in, not which one the location would normally be
# We add Lamp requirements only to those locations which lie in the dark world (or everything if open # We add Lamp requirements only to those locations which lie in the dark world (or everything if open
DW_Entrances = ['Bumper Cave (Bottom)', 'Superbunny Cave (Top)', 'Superbunny Cave (Bottom)', 'Hookshot Cave', 'Bumper Cave (Top)', 'Hookshot Cave Back Entrance', 'Dark Death Mountain Ledge (East)', DW_Entrances = ['Bumper Cave (Bottom)', 'Superbunny Cave (Top)', 'Superbunny Cave (Bottom)', 'Hookshot Cave', 'Bumper Cave (Top)', 'Hookshot Cave Back Entrance', 'Dark Death Mountain Ledge (East)',
@ -695,57 +698,58 @@ def no_glitches_rules(world, player):
def overworld_glitches_rules(world, player): def overworld_glitches_rules(world, player):
# spots that are immediately accessible # spots that are immediately accessible
set_rule(world.get_location('Zoras River', player), lambda state: True) set_rule(world.get_entrance('Hobo Bridge', player), lambda state: True)
set_rule(world.get_location('Hobo Bridge', player), lambda state: True) set_rule(world.get_region('Lake Hylia Central Island', player), lambda state: True)
set_rule(world.get_location('Lake Hylia Central Island', player), lambda state: True) set_rule(world.get_entrance('Zoras River', player), lambda state: True)
# lw boots-accessible locations # lw boots-accessible locations
lw_boots_accessible_locations = [ lw_boots_accessible_regions = [
'Bat Cave Drop Ledge', 'Bat Cave Drop Ledge',
'Zora\'s Ledge', 'Lake Hylia Island',
]
lw_boots_accessible_entrances = [
'Death Mountain Return Ledge',
'Cave 45 Ledge',
'Graveyard Ledge',
'Lake Hylia Island'
'Desert Ledge', 'Desert Ledge',
'Desert Ledge (Northeast)', 'Desert Ledge (Northeast)',
'Desert Palace Lone Stairs',
'Desert Palace Entrance (North) Spot', 'Desert Palace Entrance (North) Spot',
'Death Mountain', 'Death Mountain',
'Death Mountain Return Ledge',
'East Death Mountain (Bottom)', 'East Death Mountain (Bottom)',
'East Death Mountain (Top)', 'East Death Mountain (Top)',
'Death Mountain (Top)', 'Death Mountain (Top)',
'Spectacle Rock', 'Spectacle Rock',
'Death Mountain Floating Island (Light World)', 'Death Mountain Floating Island (Light World)',
'Turtle Rock Teleporter',
] ]
# dw boots-accessible regions # dw boots-accessible regions
dw_boots_accessible_regions = [ dw_boots_accessible_regions = [
'East Dark World',
'Northeast Dark World', 'Northeast Dark World',
'Dark Lake Hylia',
'Dark Lake Hylia Ledge',
'West Dark World', 'West Dark World',
'Hammer Peg Area', 'Hammer Peg Area',
'Bumper Cave Ledge', 'Bumper Cave Ledge',
'Dark Desert', 'Dark Desert',
'Dark Death Mountain (Top)', 'Dark Death Mountain (Top)',
'Dark Death Mountain Ledge',
'Dark Death Mountain (East Bottom)', 'Dark Death Mountain (East Bottom)',
'Dark Death Mountain Ledge',
'Death Mountain Floating Island (Dark World)', 'Death Mountain Floating Island (Dark World)',
'Turtle Rock (Top)', 'Turtle Rock (Top)',
'Ganons Tower',
] ]
if world.mode[player] != 'inverted':
lw_boots_accessible_regions.append('Cave 45 Ledge')
lw_boots_accessible_regions.append('Graveyard Ledge')
# couple other random spots
set_rule(world.get_location('Bombos Tablet', player), lambda state: state.has('Book of Mudora', player) and state.has_beam_sword(player) and (state.has_Mirror(player) or state.has_Boots(player)))
set_rule(world.get_entrance('Dark Desert Teleporter', player), lambda state: (state.has('Ocarina', player) or state.has_Boots(player)) and state.can_lift_heavy_rocks(player))
set_rule(world.get_entrance('South Hyrule Teleporter', player), lambda state: (state.has('Hammer', player) or state.has_Boots(player)) and state.can_lift_rocks(player))
set_rule(world.get_location('Zora\'s Ledge', player), lambda state: state.has_Boots(player))
needs_boots = lambda state: state.has_Boots(player) needs_boots = lambda state: state.has_Boots(player)
needs_boots_and_pearl = lambda state: state.has_Boots(player) and state.has_Pearl(player) needs_boots_and_pearl = lambda state: state.has_Boots(player) and state.has_Pearl(player)
for spot in lw_boots_accessible_regions: for spot in lw_boots_accessible_regions:
add_rule(world.get_region(spot, player), needs_boots_and_pearl if world.mode[player] == 'inverted' else needs_boots, 'or') region = world.get_region(spot, player)
for location in region.locations:
add_rule(world.get_location(location, player), needs_boots_and_pearl if world.mode[player] == 'inverted' else needs_boots, 'or')
for spot in dw_boots_accessible_regions: for spot in dw_boots_accessible_regions:
add_rule(world.get_region(spot, player), needs_boots if world.mode[player] == 'inverted' else needs_boots_and_pearl, 'or') region = world.get_region(spot, player)
# couple other random spots for location in region.locations:
if world.mode[player] != 'inverted': add_rule(world.get_location(location, player), needs_boots if world.mode[player] == 'inverted' else needs_boots_and_pearl, 'or')
set_rule(world.get_location('Bombos Tablet', player), lambda state: state.has('Book of Mudora', player) and state.has_beam_sword(player) and (state.has_Mirror(player) or state.has_Boots(player))) add_conditional_lamps(world, player)
set_rule(world.get_entrance('Waterfall of Wishing', player), lambda state: state.has('Flippers', player) or state.has_Pearl(player))
else:
def open_rules(world, player): def open_rules(world, player):