Advertisement
dragonbane

Rando Settings

Nov 8th, 2018
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 72.76 KB | None | 0 0
  1. import sys
  2. import os
  3. import textwrap
  4. import re
  5. import random
  6. import hashlib
  7. import string
  8.  
  9. # 32 characters
  10. letters = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789"
  11. index_to_letter = { i: letters[i] for i in range(32) }
  12. letter_to_index = { v: k for k, v in index_to_letter.items() }
  13.  
  14. def bit_string_to_text(bits):
  15.     # pad the bits array to be multiple of 5
  16.     if len(bits) % 5 > 0:
  17.         bits += [0] * (5 - len(bits) % 5)
  18.     # convert to characters
  19.     result = ""
  20.     for i in range(0, len(bits), 5):
  21.         chunk = bits[i:i + 5]
  22.         value = 0
  23.         for b in range(5):
  24.             value |= chunk[b] << b
  25.         result += index_to_letter[value]
  26.     return result
  27.  
  28. def text_to_bit_string(text):
  29.     bits = []
  30.     for c in text:
  31.         index = letter_to_index[c]
  32.         for b in range(5):
  33.             bits += [ (index >> b) & 1 ]
  34.     return bits
  35.  
  36. # holds the info for a single setting
  37. class Setting_Info():
  38.  
  39.     def __init__(self, name, type, bitwidth=0, shared=False, args_params={}, gui_params=None):
  40.         self.name = name # name of the setting, used as a key to retrieve the setting's value everywhere
  41.         self.type = type # type of the setting's value, used to properly convert types in GUI code
  42.         self.bitwidth = bitwidth # number of bits needed to store the setting, used in converting settings to a string
  43.         self.shared = shared # whether or not the setting is one that should be shared, used in converting settings to a string
  44.         self.args_params = args_params # parameters that should be pased to the command line argument parser's add_argument() function
  45.         self.gui_params = gui_params # parameters that the gui uses to build the widget components
  46.  
  47.         # create the choices parameters from the gui options if applicable
  48.         if gui_params and 'options' in gui_params and 'choices' not in args_params \
  49.                 and not ('type' in args_params and callable(args_params['type'])):
  50.             if isinstance(gui_params['options'], list):
  51.                 self.args_params['choices'] = list(gui_params['options'])
  52.             elif isinstance(gui_params['options'], dict):
  53.                 self.args_params['choices'] = list(gui_params['options'].values())
  54.                 if 'default' in gui_params:
  55.                     gui_params['default'] = (gui_params['options'])[gui_params['default']]
  56.  
  57.  
  58. # holds the particular choices for a run's settings
  59. class Settings():
  60.  
  61.     def get_settings_display(self):
  62.         padding = 0
  63.         for setting in filter(lambda s: s.shared, setting_infos):
  64.             padding = max( len(setting.name), padding )
  65.         padding += 2
  66.         output = ''
  67.         for setting in filter(lambda s: s.shared, setting_infos):
  68.             name = setting.name + ': ' + ' ' * (padding - len(setting.name))
  69.             val = str(self.__dict__[setting.name])
  70.             output += name + val + '\n'
  71.         return output
  72.  
  73.     def get_settings_string(self):
  74.         bits = []
  75.         for setting in filter(lambda s: s.shared and s.bitwidth > 0, setting_infos):
  76.             value = self.__dict__[setting.name]
  77.             i_bits = []
  78.             if setting.type == bool:
  79.                 i_bits = [ 1 if value else 0 ]
  80.             if setting.type == str:
  81.                 index = setting.args_params['choices'].index(value)
  82.                 # https://stackoverflow.com/questions/10321978/integer-to-bitfield-as-a-list
  83.                 i_bits = [1 if digit=='1' else 0 for digit in bin(index)[2:]]
  84.                 i_bits.reverse()
  85.             if setting.type == int:
  86.                 value = value - ('min' in setting.gui_params and setting.gui_params['min'] or 0)
  87.                 value = int(value / ('step' in setting.gui_params and setting.gui_params['step'] or 1))
  88.                 value = min(value, ('max' in setting.gui_params and setting.gui_params['max'] or value))
  89.                 # https://stackoverflow.com/questions/10321978/integer-to-bitfield-as-a-list
  90.                 i_bits = [1 if digit=='1' else 0 for digit in bin(value)[2:]]
  91.                 i_bits.reverse()
  92.             # pad it
  93.             i_bits += [0] * ( setting.bitwidth - len(i_bits) )
  94.             bits += i_bits
  95.         return bit_string_to_text(bits)
  96.  
  97.     def update_with_settings_string(self, text):
  98.         bits = text_to_bit_string(text)
  99.  
  100.         for setting in filter(lambda s: s.shared and s.bitwidth > 0, setting_infos):
  101.             cur_bits = bits[:setting.bitwidth]
  102.             bits = bits[setting.bitwidth:]
  103.             value = None
  104.             if setting.type == bool:
  105.                 value = True if cur_bits[0] == 1 else False
  106.             if setting.type == str:
  107.                 index = 0
  108.                 for b in range(setting.bitwidth):
  109.                     index |= cur_bits[b] << b
  110.                 value = setting.args_params['choices'][index]
  111.             if setting.type == int:
  112.                 value = 0
  113.                 for b in range(setting.bitwidth):
  114.                     value |= cur_bits[b] << b
  115.                 value = value * ('step' in setting.gui_params and setting.gui_params['step'] or 1)
  116.                 value = value + ('min' in setting.gui_params and setting.gui_params['min'] or 0)
  117.             self.__dict__[setting.name] = value
  118.  
  119.         self.settings_string = self.get_settings_string()
  120.  
  121.     def update(self):
  122.         self.settings_string = self.get_settings_string()
  123.  
  124.     # add the settings as fields, and calculate information based on them
  125.     def __init__(self, settings_dict):
  126.         self.__dict__.update(settings_dict)
  127.         for info in setting_infos:
  128.             if info.name not in self.__dict__:
  129.                 if info.type == bool:
  130.                     if info.gui_params is not None and 'default' in info.gui_params:
  131.                         self.__dict__[info.name] = True if info.gui_params['default'] == 'checked' else False
  132.                     else:
  133.                         self.__dict__[info.name] = False
  134.                 if info.type == str:
  135.                     if 'default' in info.args_params:
  136.                         if info.gui_params is not None and 'default' in info.gui_params:
  137.                             self.__dict__[info.name] = info.gui_params['default']
  138.                         else:
  139.                             self.__dict__[info.name] = info.args_params['default']
  140.                     else:
  141.                         self.__dict__[info.name] = ""
  142.                 if info.type == int:
  143.                     if info.gui_params is not None and 'default' in info.gui_params:
  144.                         self.__dict__[info.name] = info.gui_params['default']
  145.                     else:
  146.                         self.__dict__[info.name] = 1
  147.         self.settings_string = self.get_settings_string()
  148.  
  149. # a list of the possible settings
  150. setting_infos = [
  151.     Setting_Info('check_version', bool, 0, False,
  152.     {
  153.         'help': '''\
  154.                Checks if you are on the latest version
  155.                ''',
  156.         'action': 'store_true'
  157.     }),
  158.     Setting_Info('checked_version', str, 0, False, {
  159.             'default': '',
  160.             'help': 'Supress version warnings if checked_version is less than'}),
  161.     Setting_Info('rom', str, 0, False, {
  162.             'default': 'ZOOTDEC.z64',
  163.             'help': 'Path to an OoT 1.0 rom to use as a base.'}),
  164.     Setting_Info('output_dir', str, 0, False, {
  165.             'default': '',
  166.             'help': 'Path to output directory for rom generation.'}),
  167.     Setting_Info('seed', str, 0, False, {
  168.             'help': 'Define seed number to generate.'}),
  169.     Setting_Info('count', int, 0, False, {
  170.             'help': '''\
  171.                    Use to batch generate multiple seeds with same settings.
  172.                    If --seed is provided, it will be used for the first seed, then
  173.                    used to derive the next seed (i.e. generating 10 seeds with
  174.                    --seed given will produce the same 10 (different) roms each
  175.                    time).
  176.                    ''',
  177.             'type': int}),
  178.     Setting_Info('world_count', int, 0, False, {
  179.             'default': 1,
  180.             'help': '''\
  181.                    Use to create a multi-world generation for co-op seeds.
  182.                    World count is the number of players. Warning: Increasing
  183.                    the world count will drastically increase generation time.
  184.                    ''',
  185.             'type': int}),
  186.     Setting_Info('player_num', int, 0, False, {
  187.             'default': 1,
  188.             'help': '''\
  189.                    Use to select world to generate when there are multiple worlds.
  190.                    ''',
  191.             'type': int}),
  192.     Setting_Info('create_spoiler', bool, 1, True,
  193.         {
  194.             'help': 'Output a Spoiler File',
  195.             'action': 'store_true'
  196.         },
  197.         {
  198.             'text': 'Create Spoiler Log',
  199.             'group': 'rom_tab',
  200.             'widget': 'Checkbutton',
  201.             'default': 'checked',
  202.             'dependency': lambda guivar: guivar['compress_rom'].get() != 'No ROM Output',
  203.             'tooltip':'''\
  204.                      Enabling this will change the seed.
  205.                      '''
  206.         }),
  207.     Setting_Info('compress_rom', str, 2, False,
  208.         {
  209.             'default': 'True',
  210.             'const': 'True',
  211.             'nargs': '?',
  212.             'help': '''\
  213.                    Create a compressed version of the output ROM file.
  214.                    True: Compresses. Improves stability. Will take longer to generate
  215.                    False: Uncompressed. Unstable. Faster generation
  216.                    None: No ROM Output. Creates spoiler log only
  217.                    ''',
  218.         },
  219.         {
  220.             'text': 'Compress ROM',
  221.             'group': 'rom_tab',
  222.             'widget': 'Radiobutton',
  223.             'default': 'Compressed [Stable]',
  224.             'horizontal': True,
  225.             'options': {
  226.                 'Compressed [Stable]': 'True',
  227.                 'Uncompressed [Crashes]': 'False',
  228.                 'No ROM Output': 'None',
  229.             },
  230.             'tooltip':'''\
  231.                      The first time compressed generation will take a while,
  232.                      but subsequent generations will be quick. It is highly
  233.                      recommended to compress or the game will crash
  234.                      frequently except on real N64 hardware.
  235.                      '''
  236.         }),
  237.     Setting_Info('open_forest', bool, 1, True,
  238.         {
  239.             'help': '''\
  240.                    Mido no longer blocks the path to the Deku Tree, and
  241.                    the Kokiri boy no longer blocks the path out of the forest.
  242.                    ''',
  243.             'action': 'store_true'
  244.         },
  245.         {
  246.             'text': 'Open Forest',
  247.             'group': 'open',
  248.             'widget': 'Checkbutton',
  249.             'default': 'checked',
  250.             'tooltip':'''\
  251.                      Mido no longer blocks the path to the Deku Tree,
  252.                      and the Kokiri boy no longer blocks the path out
  253.                      of the forest.
  254.  
  255.                      When this option is off, the Kokiri Sword and
  256.                      Slingshot are always available somewhere
  257.                      in the forest.
  258.                      '''
  259.         }),
  260.     Setting_Info('open_kakariko', bool, 1, True,
  261.         {
  262.             'help': '''\
  263.                    The gate in Kakariko Village to Death Mountain Trail
  264.                    is always open instead of needing Zelda's Letter.
  265.                    ''',
  266.             'action': 'store_true'
  267.         },
  268.         {
  269.             'text': 'Open Kakariko Gate',
  270.             'group': 'open',
  271.             'widget': 'Checkbutton',
  272.             'default': 'unchecked',
  273.             'tooltip':'''\
  274.                      The gate in Kakariko Village to Death Mountain Trail
  275.                      is always open instead of needing Zelda's Letter.
  276.  
  277.                      Either way, the gate is always open as an adult.
  278.                      '''
  279.         }),
  280.     Setting_Info('open_door_of_time', bool, 1, True,
  281.         {
  282.             'help': '''
  283.                    The Door of Time is open from the beginning of the game.
  284.                    ''',
  285.             'action': 'store_true'
  286.         },
  287.         {
  288.             'text': 'Open Door of Time',
  289.             'group': 'open',
  290.             'widget': 'Checkbutton',
  291.             'default': 'unchecked',
  292.             'tooltip':'''\
  293.                      The Door of Time starts opened instead of needing to
  294.                      play the Song of Time. If this is not set, only
  295.                      an Ocarina and Song of Time must be found to open
  296.                      the Door of Time.
  297.                      '''
  298.         }),
  299.     Setting_Info('gerudo_fortress', str, 2, True,
  300.         {
  301.             'default': 'normal',
  302.             'const': 'normal',
  303.             'nargs': '?',
  304.             'help': '''Select how much of Gerudo Fortress is required. (default: %(default)s)
  305.                       Normal: Free all four carpenters to get the Gerudo Card.
  306.                       Fast:   Free only the carpenter closest to Link's prison to get the Gerudo Card.
  307.                       Open:   Start with the Gerudo Card and all its benefits.
  308.                    '''
  309.         },
  310.         {
  311.             'text': 'Gerudo Fortress',
  312.             'group': 'open',
  313.             'widget': 'Combobox',
  314.             'default': 'Default Behavior',
  315.             'options': {
  316.                 'Default Behavior': 'normal',
  317.                 'Rescue One Carpenter': 'fast',
  318.                 'Start with Gerudo Card': 'open',
  319.             },
  320.             'tooltip':'''\
  321.                      'Rescue One Carpenter': Only the bottom left
  322.                      carpenter must be rescued.
  323.  
  324.                      'Start with Gerudo Card': The carpenters are rescued from
  325.                      the start of the game, and the player starts with the Gerudo
  326.                      Card in the inventory allowing access to Gerudo Training Grounds.
  327.                      '''
  328.         }),
  329.     Setting_Info('bridge', str, 2, True,
  330.         {
  331.             'default': 'medallions',
  332.             'const': 'medallions',
  333.             'nargs': '?',
  334.             'help': '''\
  335.                    Select requirement to spawn the Rainbow Bridge to reach Ganon's Castle. (default: %(default)s)
  336.                    Medallions:    Collect all six medallions to create the bridge.
  337.                    Vanilla:       Collect only the Shadow and Spirit Medallions and possess the Light Arrows.
  338.                    All Dungeons:  Collect all spiritual stones and all medallions to create the bridge.
  339.                    Open:          The bridge will spawn without an item requirement.
  340.                    '''
  341.         },
  342.         {
  343.             'text': 'Rainbow Bridge Requirement',
  344.             'group': 'open',
  345.             'widget': 'Combobox',
  346.             'default': 'All Medallions',
  347.             'options': {
  348.                 'All Dungeons': 'dungeons',
  349.                 'All Medallions': 'medallions',
  350.                 'Vanilla Requirements': 'vanilla',
  351.                 'Always Open': 'open',
  352.             },
  353.             'tooltip':'''\
  354.                      'All Dungeons': All Medallions and Stones
  355.  
  356.                      'All Medallions': All 6 Medallions only
  357.  
  358.                      'Vanilla Requirements': Spirit and Shadow
  359.                      Medallions and the Light Arrows
  360.  
  361.                      'Always Open': Rainbow Bridge is always present
  362.                      '''
  363.         }),
  364.     Setting_Info('all_reachable', bool, 1, True,
  365.         {
  366.             'help': '''\
  367.                    When disabled, only check if the game is beatable with
  368.                    placement. Do not ensure all locations are reachable.
  369.                    ''',
  370.             'action': 'store_true'
  371.         },
  372.         {
  373.             'text': 'All Locations Reachable',
  374.             'group': 'world',
  375.             'widget': 'Checkbutton',
  376.             'default': 'checked',
  377.             'tooltip':'''\
  378.                      When this option is enabled, the randomizer will
  379.                      guarantee that every item is obtainable and every
  380.                      location is reachable.
  381.                      
  382.                      When disabled, only required items and locations
  383.                      to beat the game will be guaranteed reachable.
  384.                      
  385.                      Even when enabled, some locations may still be able
  386.                      to hold the keys needed to reach them.
  387.                      '''
  388.         }),    
  389.     Setting_Info('bombchus_in_logic', bool, 1, True,
  390.         {
  391.             'help': '''\
  392.                    Bombchus will be considered in logic. This has a few effects:
  393.                    -Back Alley shop will open once you've found Bombchus.
  394.                    -It will sell an affordable pack (5 for 60) and never sell out.
  395.                    -Bombchus refills cannot be bought until Bombchus have been obtained.
  396.                    ''',
  397.             'action': 'store_true'
  398.         },
  399.         {
  400.             'text': 'Bombchus Are Considered in Logic',
  401.             'group': 'world',
  402.             'widget': 'Checkbutton',
  403.             'default': 'checked',
  404.             'tooltip':'''\
  405.                      Bombchus are properly considered in logic.
  406.  
  407.                      The first Bombchu pack will always be 20.
  408.                      Subsequent packs will be 5 or 10 based on
  409.                      how many you have.
  410.  
  411.                      Bombchus can be purchased for 60/99/180
  412.                      rupees once they are been found.
  413.  
  414.                      Bombchu Bowling opens with Bombchus.
  415.                      Bombchus are available at Kokiri Shop
  416.                      and the Bazaar. Bombchu refills cannot
  417.                      be bought until Bombchus have been
  418.                      obtained.
  419.                      ''',
  420.         }),
  421.     Setting_Info('one_item_per_dungeon', bool, 1, True,
  422.         {
  423.             'help': '''\
  424.                    Each dungeon will have exactly one major item.
  425.                    Does not include dungeon items or GS Tokens.
  426.                    ''',
  427.             'action': 'store_true'
  428.         },
  429.         {
  430.             'text': 'Dungeons Have One Major Item',
  431.             'group': 'world',
  432.             'widget': 'Checkbutton',
  433.             'default': 'unchecked',
  434.             'tooltip':'''\
  435.                      Dungeons have exactly one major
  436.                      item. This naturally makes each
  437.                      dungeon similar in value instaed
  438.                      of valued based on chest count.
  439.  
  440.                      Spirit Temple Colossus hands count
  441.                      as part of the dungeon. Spirit
  442.                      Temple has TWO items to match
  443.                      vanilla distribution.
  444.  
  445.                      Dungeon items and GS Tokens do
  446.                      not count as major items.
  447.                      ''',
  448.         }),
  449.     Setting_Info('trials_random', bool, 1, True,
  450.         {
  451.             'help': '''\
  452.                    Sets the number of trials must be cleared to enter
  453.                    Ganon's Tower to a random value.
  454.                    ''',
  455.             'action': 'store_true'
  456.         },
  457.         {
  458.             'text': 'Random Number of Ganon\'s Trials',
  459.             'group': 'open',
  460.             'widget': 'Checkbutton',
  461.             'default': 'unchecked',
  462.             'tooltip':'''\
  463.                      Sets a random number of trials to
  464.                      enter Ganon's Tower.
  465.                      '''
  466.         }),
  467.     Setting_Info('trials', int, 3, True,
  468.         {
  469.             'default': 6,
  470.             'const': 6,
  471.             'nargs': '?',
  472.             'choices': [0, 1, 2, 3, 4, 5, 6],
  473.             'help': '''\
  474.                    Select how many trials must be cleared to enter Ganon's Tower.
  475.                    The trials you must complete will be selected randomly.
  476.                    ''',
  477.             'type': int                    
  478.         },
  479.         {
  480.             'group': 'open',
  481.             'widget': 'Scale',
  482.             'default': 6,
  483.             'min': 0,
  484.             'max': 6,
  485.             'random': True,
  486.             'tooltip':'''\
  487.                      Trials are randomly selected. If hints are
  488.                      enabled, then there will be hints for which
  489.                      trials need to be completed.
  490.                      ''',
  491.             'dependency': lambda guivar: not guivar['trials_random'].get(),
  492.         }),
  493.     Setting_Info('no_escape_sequence', bool, 1, True,
  494.         {
  495.             'help': '''\
  496.                    The tower collapse escape sequence between Ganondorf and Ganon will be skipped.
  497.                    ''',
  498.             'action': 'store_true'
  499.         },
  500.         {
  501.             'text': 'Skip Tower Collapse Escape Sequence',
  502.             'group': 'convenience',
  503.             'widget': 'Checkbutton',
  504.             'default': 'unchecked',
  505.             'tooltip':'''\
  506.                      The tower collapse escape sequence between
  507.                      Ganondorf and Ganon will be skipped.
  508.                      '''
  509.         }),
  510.     Setting_Info('no_guard_stealth', bool, 1, True,
  511.         {
  512.             'help': '''\
  513.                    The crawlspace into Hyrule Castle will take you straight to Zelda.
  514.                    ''',
  515.             'action': 'store_true'
  516.         },
  517.         {
  518.             'text': 'Skip Interior Castle Guard Stealth Sequence',
  519.             'group': 'convenience',
  520.             'widget': 'Checkbutton',
  521.             'default': 'unchecked',
  522.             'tooltip':'''\
  523.                      The crawlspace into Hyrule Castle goes
  524.                      straight to Zelda, skipping the guards.
  525.                      '''
  526.         }),
  527.     Setting_Info('no_epona_race', bool, 1, True,
  528.         {
  529.             'help': '''\
  530.                    Having Epona's Song will allow you to summon Epona without racing Ingo.
  531.                    ''',
  532.             'action': 'store_true'
  533.         },
  534.         {
  535.             'text': 'Skip Epona Race',
  536.             'group': 'convenience',
  537.             'widget': 'Checkbutton',
  538.             'default': 'unchecked',
  539.             'tooltip':'''\
  540.                      Epona can be summoned with Epona's Song
  541.                      without needing to race Ingo.
  542.                      '''
  543.         }),
  544.     Setting_Info('fast_chests', bool, 1, True,
  545.         {
  546.             'help': '''\
  547.                    Makes all chests open without the large chest opening cutscene.
  548.                    ''',
  549.             'action': 'store_true'
  550.         },
  551.         {
  552.             'text': 'Fast Chest Cutscenes',
  553.             'group': 'convenience',
  554.             'widget': 'Checkbutton',
  555.             'default': 'checked',
  556.             'tooltip':'''\
  557.                      All chest animations are fast. If disabled,
  558.                      the animation time is slow for major items.
  559.                      '''
  560.         }),
  561.     Setting_Info('big_poe_count_random', bool, 1, True,
  562.         {
  563.             'help': '''\
  564.                    Sets a random number of Big Poes to receive an item from the buyer.
  565.                    ''',
  566.             'action': 'store_true'
  567.         },
  568.         {
  569.             'text': 'Random Big Poe Target Count',
  570.             'group': 'convenience',
  571.             'widget': 'Checkbutton',
  572.             'default': 'unchecked',
  573.             'tooltip':'''\
  574.                      The Poe buyer will give a reward for turning
  575.                      in a random number of Big Poes.
  576.                      '''
  577.         }),
  578.     Setting_Info('big_poe_count', int, 4, True,
  579.         {
  580.             'default': 10,
  581.             'const': 10,
  582.             'nargs': '?',
  583.             'choices': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
  584.             'help': '''\
  585.                    Select the number of Big Poes to receive an item from the buyer.
  586.                    ''',
  587.             'type': int,
  588.         },
  589.         {
  590.             'group': 'convenience',
  591.             'widget': 'Scale',
  592.             'default': 10,
  593.             'min': 1,
  594.             'max': 10,
  595.             'tooltip':'''\
  596.                      The Poe buyer will give a reward for turning
  597.                      in the chosen number of Big Poes.
  598.                      ''',
  599.             'dependency': lambda guivar: not guivar['big_poe_count_random'].get(),
  600.         }),
  601.     Setting_Info('free_scarecrow', bool, 1, True,
  602.         {
  603.             'help': '''\
  604.                    Start with Scarecrow's Song. You do not need
  605.                    to play it as child or adult at the scarecrow
  606.                    patch to be able to summon Pierre.
  607.                    ''',
  608.             'action': 'store_true'
  609.         },
  610.         {
  611.             'text': 'Start with Scarecrow\'s Song',
  612.             'group': 'convenience',
  613.             'widget': 'Checkbutton',
  614.             'default': 'unchecked',
  615.             'tooltip':'''\
  616.                      Skips needing to go to Lake Hylia as both
  617.                      child and adult to learn Scarecrow's Song.
  618.                      '''
  619.         }),
  620.     Setting_Info('scarecrow_song', str, 0, False,
  621.         {
  622.             'default': 'DAAAAAAA',
  623.             'const': 'DAAAAAAA',
  624.             'nargs': '?',
  625.             'help': '''\
  626.                    The song started with if 'free_scarecrow' is True
  627.                    Valid notes: A, U, L, R, D
  628.                    ''',
  629.         },
  630.         {
  631.             'group': 'convenience',
  632.             'widget': 'Entry',
  633.             'default': 'DAAAAAAA',
  634.             'dependency': lambda guivar: guivar['free_scarecrow'].get(),
  635.             'tooltip':'''\
  636.                      The song must be 8 notes long and have
  637.                      at least two different notes.
  638.                      Valid notes are:
  639.                      'A': A Button
  640.                      'D': C-Down
  641.                      'U': C-Up
  642.                      'L': C-Left
  643.                      'R': C-Right
  644.                      '''
  645.         }),
  646.     Setting_Info('shuffle_kokiri_sword', bool, 1, True,
  647.         {
  648.             'help': '''\
  649.                    Shuffles the Kokiri Sword into the pool.
  650.                    ''',
  651.             'action': 'store_true'
  652.         },
  653.         {
  654.             'text': 'Shuffle Kokiri Sword',
  655.             'group': 'logic',
  656.             'widget': 'Checkbutton',
  657.             'default': 'checked',
  658.             'tooltip':'''\
  659.                      Disabling this will make the Kokiri Sword
  660.                      always available at the start.
  661.                      '''
  662.         }),
  663.     Setting_Info('shuffle_weird_egg', bool, 1, True,
  664.         {
  665.             'help': '''\
  666.                    Shuffles the Weird Egg item from Malon into the pool.
  667.                    This means that you need to find the egg before going Zelda.
  668.                    ''',
  669.             'action': 'store_true'
  670.         },
  671.         {
  672.             'text': 'Shuffle Weird Egg',
  673.             'group': 'logic',
  674.             'widget': 'Checkbutton',
  675.             'default': 'checked',
  676.             'tooltip':'''\
  677.                      You need to find the egg before going Zelda.
  678.                      This means the Weird Egg locks the rewards from
  679.                      Impa, Saria, Malon, and Talon as well as the
  680.                      Happy Mask sidequest.
  681.                      '''
  682.         }),
  683.     Setting_Info('shuffle_ocarinas', bool, 1, True,
  684.         {
  685.             'help': '''\
  686.                    Shuffles the Fairy Ocarina and the Ocarina of Time into the pool.
  687.                    This means that you need to find an ocarina before playing songs.
  688.                    ''',
  689.             'action': 'store_true'
  690.         },
  691.         {
  692.             'text': 'Shuffle Ocarinas',
  693.             'group': 'logic',
  694.             'widget': 'Checkbutton',
  695.             'default': 'checked',
  696.             'tooltip':'''\
  697.                      The Fairy Ocarina and Ocarina of Time are
  698.                      randomized. One will be required before
  699.                      songs can be played.
  700.                      '''
  701.         }),
  702.     Setting_Info('shuffle_song_items', bool, 1, True,
  703.         {
  704.             'help': '''\
  705.                    Shuffles the songs with with rest of the item pool so that
  706.                    songs can appear at other locations and items can appear at
  707.                    the song locations.
  708.                    ''',
  709.             'action': 'store_true'
  710.         },
  711.         {
  712.             'text': 'Shuffle Songs with Items',
  713.             'group': 'logic',
  714.             'widget': 'Checkbutton',
  715.             'default': 'checked',
  716.             'tooltip':'''\
  717.                      Songs can appear anywhere as normal items.
  718.  
  719.                      If this option is not set, songs will still
  720.                      be shuffled but will be limited to the
  721.                      locations that has songs in the original game.
  722.                      '''
  723.         }),
  724.     Setting_Info('shuffle_gerudo_card', bool, 1, True,
  725.         {
  726.             'help': '''\
  727.                    Shuffles the Gerudo Card into the item pool.
  728.                    The Gerudo Card does not stop guards from throwing you in jail.
  729.                    It only grants access to Gerudo Training Grounds after all carpenters
  730.                    have been rescued. This option does nothing if "gerudo_fortress" is "open".
  731.                    ''',
  732.             'action': 'store_true'
  733.         },
  734.         {
  735.             'text': 'Shuffle Gerudo Card',
  736.             'group': 'logic',
  737.             'widget': 'Checkbutton',
  738.             'default': 'unchecked',
  739.             'dependency': lambda guivar: guivar['gerudo_fortress'].get() != 'Start with Gerudo Card',
  740.             'tooltip':'''\
  741.                      Gerudo Card is required to enter
  742.                      Gerudo Training Grounds.
  743.                      '''
  744.         }),
  745.     Setting_Info('shuffle_scrubs', str, 3, True,
  746.         {
  747.             'default': 'off',
  748.             'const': 'off',
  749.             'nargs': '?',
  750.             'help': '''\
  751.                    Deku Scrub Salesmen are randomized:
  752.                    off:        Only the 3 Scrubs that give one-time items
  753.                                in the vanilla game will have random items.
  754.                    low:        All Scrubs will have random items and their
  755.                                prices will be reduced to 10 rupees each.
  756.                    regular:    All Scrubs will have random items and each
  757.                                of them will demand their vanilla prices.
  758.                    random:     All Scrubs will have random items and their
  759.                                price will also be random between 10-99 rupees.
  760.                    '''
  761.         },
  762.         {
  763.             'text': 'Scrub Shuffle',
  764.             'group': 'logic',
  765.             'widget': 'Combobox',
  766.             'default': 'Off',
  767.             'options': {
  768.                 'Off': 'off',
  769.                 'On (Affordable)': 'low',
  770.                 'On (Expensive)': 'regular',
  771.                 'On (Random Prices)': 'random',
  772.             },
  773.             'tooltip':'''\
  774.                      'Off': Only the 3 Scrubs that give one-time
  775.                      items in the vanilla game (PoH, Deku Nut
  776.                      capacity, and Deku Stick capacity) will
  777.                      have random items.
  778.  
  779.                      'Affordable': All Scrub prices will be
  780.                      reduced to 10 rupees each.
  781.  
  782.                      'Expensive': All Scrub prices will be
  783.                      their vanilla prices. This will require
  784.                      spending over 1000 rupees on Scrubs.
  785.  
  786.                      'Random Prices': All Scrub prices will be
  787.                      between 0-99 rupees. This will on average
  788.                      be very, very expensive overall.
  789.  
  790.                      The texts of the Scrubs are not updated.
  791.                      '''
  792.         }),  
  793.     Setting_Info('shopsanity', str, 3, True,
  794.         {
  795.             'default': 'off',
  796.             'const': 'off',
  797.             'nargs': '?',
  798.             'help': '''\
  799.                    Shop contents are randomized. Non-shop items
  800.                    are one time purchases. This setting also
  801.                    changes the item pool to introduce a new Wallet
  802.                    upgrade and more money.
  803.                    off:        Normal Shops*
  804.                    0-4:        Shop contents are shuffled and N non-shop
  805.                                items are added to every shop. So more
  806.                                possible item locations.
  807.                    random:     Shop contents are shuffles and each shop
  808.                                will have a random number of non-shop items
  809.                    '''
  810.         },
  811.         {
  812.             'text': 'Shopsanity',
  813.             'group': 'logic',
  814.             'widget': 'Combobox',
  815.             'default': 'Off',
  816.             'options': {
  817.                 'Off': 'off',
  818.                 'Shuffled Shops (0 Items)': '0',
  819.                 'Shuffled Shops (1 Items)': '1',
  820.                 'Shuffled Shops (2 Items)': '2',
  821.                 'Shuffled Shops (3 Items)': '3',
  822.                 'Shuffled Shops (4 Items)': '4',
  823.                 'Shuffled Shops (Random)': 'random',
  824.             },
  825.             'tooltip':'''\
  826.                      Shop contents are randomized.
  827.                      (X Items): Shops have X random non-shop (Special
  828.                      Deal!) items. They will always be on the left
  829.                      side, and some of the lower value shop items
  830.                      will be replaced to make room for these.
  831.                      
  832.                      (Random): Each shop will have a random number
  833.                      of non-shop items up to a maximum of 4.
  834.                      
  835.                      The non-shop items have no requirements except
  836.                      money, while the normal shop items (such as
  837.                      200/300 rupee tunics) have normal vanilla
  838.                      requirements. This means that, for example,
  839.                      as a child you cannot buy 200/300 rupee
  840.                      tunics, but you can buy non-shop tunics.
  841.                      
  842.                      Non-shop Bombchus will unlock the chu slot
  843.                      in your inventory, which, if Bombchus are in
  844.                      logic, is needed to buy Bombchu refills.
  845.                      Otherwise, the Bomb Bag is required.
  846.                      '''
  847.         }),      
  848.     Setting_Info('shuffle_mapcompass', str, 2, True,
  849.         {
  850.         'default': 'dungeon',
  851.         'const': 'dungeon',
  852.         'nargs': '?',
  853.         'help': '''\
  854.                    Sets the Map and Compass placement rules
  855.                    remove:      Maps and Compasses are removed from the world.
  856.                    startwith:   Start with all Maps and Compasses.
  857.                    dungeon:     Maps and Compasses are put in their dungeon.
  858.                    keysanity:   Maps and Compasses can appear anywhere.
  859.                    '''
  860.         },
  861.         {
  862.             'text': 'Shuffle Dungeon Items',
  863.             'group': 'logic',
  864.             'widget': 'Combobox',
  865.             'default': 'Maps/Compasses: Dungeon Only',
  866.             'options': {
  867.                 'Maps/Compasses: Remove': 'remove',
  868.                 'Maps/Compasses: Start With': 'startwith',
  869.                 'Maps/Compasses: Dungeon Only': 'dungeon',
  870.                 'Maps/Compasses: Anywhere': 'keysanity'
  871.             },
  872.             'tooltip':'''\
  873.                      'Remove': Maps and Compasses are removed.
  874.                      This will add a small amount of money and
  875.                      refill items to the pool.
  876.                      
  877.                      'Start With': Maps and Compasses are given to
  878.                      you from the start. This will add a small
  879.                      amount of money and refill items to the pool.
  880.  
  881.                      'Dungeon': Maps and Compasses can only appear
  882.                      in their respective dungeon.
  883.  
  884.                      'Anywhere': Maps and Compasses can appear
  885.                      anywhere in the world.
  886.  
  887.                      Setting 'Remove', 'Start With, or 'Anywhere' will
  888.                      add 2 more possible locations to each Dungeons.
  889.                      This makes dungeons more profitable, especially
  890.                      Ice Cavern, Water Temple, and Jabu Jabu's Belly.
  891.                      '''
  892.         }),
  893.     Setting_Info('shuffle_smallkeys', str, 2, True,
  894.         {
  895.         'default': 'dungeon',
  896.         'const': 'dungeon',
  897.         'nargs': '?',
  898.         'help': '''\
  899.                    Sets the Small Keys placement rules
  900.                    remove:      Small Keys are removed from the world.
  901.                    dungeon:     Small Keys are put in their dungeon.
  902.                    keysanity:   Small Keys can appear anywhere.
  903.                    '''
  904.         },
  905.         {
  906.             'group': 'logic',
  907.             'widget': 'Combobox',
  908.             'default': 'Small Keys: Dungeon Only',
  909.             'options': {
  910.                 'Small Keys: Remove (Keysy)': 'remove',
  911.                 'Small Keys: Dungeon Only': 'dungeon',
  912.                 'Small Keys: Anywhere (Keysanity)': 'keysanity'
  913.             },
  914.             'tooltip':'''\
  915.                      'Remove': Small Keys are removed. All locked
  916.                      doors in dungeons will be unlocked. An easier
  917.                      mode.
  918.  
  919.                      'Dungeon': Small Keys can only appear in their
  920.                      respective dungeon. If Fire Temple is not a
  921.                      Master Quest dungeon, the door to the Boss Key
  922.                      chest will be unlocked
  923.  
  924.                      'Anywhere': Small Keys can appear
  925.                      anywhere in the world. A difficult mode since
  926.                      it is more likely to need to enter a dungeon
  927.                      multiple times.
  928.  
  929.                      Try different combination out, such as:
  930.                      'Small Keys: Dungeon' + 'Boss Keys: Anywhere'
  931.                      for a milder Keysanity experience.
  932.                      '''
  933.         }),
  934.     Setting_Info('shuffle_bosskeys', str, 2, True,
  935.         {
  936.         'default': 'dungeon',
  937.         'const': 'dungeon',
  938.         'nargs': '?',
  939.         'help': '''\
  940.                    Sets the Boss Keys placement rules
  941.                    remove:      Boss Keys are removed from the world.
  942.                    dungeon:     Boss Keys are put in their dungeon.
  943.                    keysanity:   Boss Keys can appear anywhere.
  944.                    '''
  945.         },
  946.         {
  947.             'group': 'logic',
  948.             'widget': 'Combobox',
  949.             'default': 'Boss Keys: Dungeon Only',
  950.             'options': {
  951.                 'Boss Keys: Remove (Keysy)': 'remove',
  952.                 'Boss Keys: Dungeon Only': 'dungeon',
  953.                 'Boss Keys: Anywhere (Keysanity)': 'keysanity'
  954.             },
  955.             'tooltip':'''\
  956.                      'Remove': Boss Keys are removed. All locked
  957.                      doors in dungeons will be unlocked. An easier
  958.                      mode.
  959.  
  960.                      'Dungeon': Boss Keys can only appear in their
  961.                      respective dungeon.
  962.  
  963.                      'Anywhere': Boss Keys can appear
  964.                      anywhere in the world. A difficult mode since
  965.                      it is more likely to need to enter a dungeon
  966.                      multiple times.
  967.  
  968.                      Try different combination out, such as:
  969.                      'Small Keys: Dungeon' + 'Boss Keys: Anywhere'
  970.                      for a milder Keysanity experience.
  971.                      '''
  972.         }),
  973.     Setting_Info('enhance_map_compass', bool, 1, True,
  974.         {
  975.             'help': '''\
  976.                    Gives the Map and Compass extra functionality.
  977.                    Map will tell if a dungeon is vanilla or Master Quest.
  978.                    Compass will tell what medallion or stone is within.
  979.                    The Temple of Time Altar will no longer provide any
  980.                    information. If the maps and compasses are removed then
  981.                    the information will be unavailable.
  982.                    ''',
  983.             'action': 'store_true'
  984.         },
  985.         {
  986.             'text': 'Maps and Compasses Give Information',
  987.             'group': 'logic',
  988.             'widget': 'Checkbutton',
  989.             'default': 'checked',
  990.             'tooltip':'''\
  991.                    Gives the Map and Compass extra functionality.
  992.                    Map will tell if a dungeon is vanilla or Master Quest.
  993.                    Compass will tell what medallion or stone is within.
  994.                    The Temple of Time Altar will no longer provide any
  995.                    information.
  996.  
  997.                    'Maps/Compasses: Remove': The dungeon information is
  998.                    not available anywhere in the game.
  999.                    
  1000.                    'Maps/Compasses: Start With': The dungeon information
  1001.                    is available immediately from the dungeon menu.
  1002.                    ''',
  1003.         }),    
  1004.     Setting_Info('unlocked_ganondorf', bool, 1, True,
  1005.         {
  1006.             'help': '''\
  1007.                    The Boss Key door in Ganon's Tower will start unlocked.
  1008.                    ''',
  1009.             'action': 'store_true'
  1010.         },
  1011.         {
  1012.             'text': 'Remove Ganon\'s Boss Door Lock',
  1013.             'group': 'logic',
  1014.             'widget': 'Checkbutton',
  1015.             'default': 'unchecked',
  1016.             'tooltip':'''\
  1017.                      The Boss Key door in Ganon's Tower
  1018.                      will start unlocked. This is intended
  1019.                      to be used with reduced trial
  1020.                      requirements to make it more likely
  1021.                      that skipped trials can be avoided.
  1022.                      ''',
  1023.             'dependency': lambda guivar: guivar['shuffle_bosskeys'].get() != 'Boss Keys: Remove (Keysy)',
  1024.         }),    
  1025.     Setting_Info('tokensanity', str, 2, True,
  1026.         {
  1027.             'default': 'off',
  1028.             'const': 'off',
  1029.             'nargs': '?',
  1030.             'help': '''\
  1031.                    Gold Skulltula Tokens will be shuffled into the pool,
  1032.                    and Gold Skulltula locations can have any item.
  1033.                    off:        Don't use this feature
  1034.                    dungeons:   Only dungeon Skulltulas will be shuffled
  1035.                    all:        All Gold Skulltulas will be shuffled
  1036.                    '''
  1037.         },
  1038.         {
  1039.             'text': 'Tokensanity',
  1040.             'group': 'logic',
  1041.             'widget': 'Combobox',
  1042.             'default': 'Off',
  1043.             'options': {
  1044.                 'Off': 'off',
  1045.                 'Dungeons Only': 'dungeons',
  1046.                 'All Tokens': 'all',
  1047.             },
  1048.             'tooltip':'''\
  1049.                      Token reward from Gold Skulltulas are
  1050.                      shuffled into the pool.
  1051.  
  1052.                      'Dungeons Only': This only shuffles
  1053.                      the GS locations that are within
  1054.                      dungeons, increasing the value of
  1055.                      most dungeons and making internal
  1056.                      dungeon exploration more diverse.
  1057.  
  1058.                      'All Tokens': Effectively adds 100
  1059.                      new locations for items to appear.
  1060.                      '''
  1061.         }),
  1062.     Setting_Info('quest', str, 2, True,
  1063.         {
  1064.             'default': 'vanilla',
  1065.             'const': 'vanilla',
  1066.             'nargs': '?',
  1067.             'help': '''\
  1068.                    Select requirement to spawn the Rainbow Bridge to reach Ganon's Castle. (default: %(default)s)
  1069.                    Vanilla:       Dungeons will be the original Ocarina of Time dungeons.
  1070.                    Master:        Dungeons will be in the form of the Master Quest.
  1071.                    Mixed:         Each dungeon will randomly be either standard or Master Quest.
  1072.                    '''
  1073.         },
  1074.         {
  1075.             'text': 'Dungeon Quest',
  1076.             'group': 'world',
  1077.             'widget': 'Combobox',
  1078.             'default': 'Vanilla',
  1079.             'options': {
  1080.                 'Vanilla': 'vanilla',
  1081.                 'Master Quest': 'master',
  1082.                 'Mixed': 'mixed',
  1083.             },
  1084.             'tooltip':'''\
  1085.                      'Vanilla': Dungeons will be in their
  1086.                      default OoT form.
  1087.  
  1088.                      'Master Quest': Dungeons will be in the
  1089.                      form found in OoT: Master Quest.
  1090.  
  1091.                      'Mixed': Each dungeon will have a
  1092.                      random chance to be in either form.
  1093.                      ''',
  1094.         }),
  1095.     Setting_Info('logic_skulltulas', int, 3, True,
  1096.         {
  1097.             'default': 50,
  1098.             'const': 50,
  1099.             'nargs': '?',
  1100.             'choices': [0, 10, 20, 30, 40, 50],
  1101.             'help': '''\
  1102.                    Choose the maximum number of Gold Skulltula Tokens you will be expected to collect.
  1103.                    ''',
  1104.             'type': int
  1105.         },
  1106.         {
  1107.             'text': 'Maximum Expected Skulltula Tokens',
  1108.             'group': 'rewards',
  1109.             'widget': 'Scale',
  1110.             'default': 50,
  1111.             'min': 0,
  1112.             'max': 50,
  1113.             'step': 10,
  1114.             'tooltip':'''\
  1115.                      Choose the maximum number of Gold Skulltula
  1116.                      Tokens you will be expected to collect.
  1117.                      '''
  1118.         }),
  1119.     Setting_Info('logic_no_night_tokens_without_suns_song', bool, 1, True,
  1120.         {
  1121.             'help': '''\
  1122.                    You will not be expected to collect nighttime-only skulltulas
  1123.                    unless you have Sun's Song
  1124.                    ''',
  1125.             'action': 'store_true'
  1126.         },
  1127.         {
  1128.             'text': 'No Nighttime Skulltulas without Sun\'s Song',
  1129.             'group': 'rewards',
  1130.             'widget': 'Checkbutton',
  1131.             'default': 'unchecked',
  1132.             'tooltip':'''\
  1133.                      GS Tokens that can only be obtained
  1134.                      during the night expect you to have Sun's
  1135.                      Song to collect them. This prevents needing
  1136.                      to wait until night for some locations.
  1137.                      '''
  1138.         }),
  1139.     Setting_Info('logic_no_big_poes', bool, 1, True,
  1140.         {
  1141.             'help': '''\
  1142.                    You will not be expected to collect 10 big poes.
  1143.                    ''',
  1144.             'action': 'store_true'
  1145.         },
  1146.         {
  1147.             'text': 'No Big Poes',
  1148.             'group': 'rewards',
  1149.             'widget': 'Checkbutton',
  1150.             'default': 'unchecked',
  1151.             'tooltip':'''\
  1152.                      The Big Poe vendor will not have a
  1153.                      required item.
  1154.                      '''
  1155.         }),
  1156.     Setting_Info('logic_no_child_fishing', bool, 1, True,
  1157.         {
  1158.             'help': '''\
  1159.                    You will not be expected to obtain the child fishing reward.
  1160.                    ''',
  1161.             'action': 'store_true'
  1162.         },
  1163.         {
  1164.             'text': 'No Child Fishing',
  1165.             'group': 'rewards',
  1166.             'widget': 'Checkbutton',
  1167.             'default': 'unchecked',
  1168.             'tooltip':'''\
  1169.                      Fishing does not work correctly on
  1170.                      Bizhawk.
  1171.                      '''
  1172.         }),
  1173.     Setting_Info('logic_no_adult_fishing', bool, 1, True,
  1174.         {
  1175.             'help': '''\
  1176.                    You will not be expected to obtain the adult fishing reward.
  1177.                    ''',
  1178.             'action': 'store_true'
  1179.         },
  1180.         {
  1181.             'text': 'No Adult Fishing',
  1182.             'group': 'rewards',
  1183.             'widget': 'Checkbutton',
  1184.             'default': 'unchecked',
  1185.             'tooltip':'''\
  1186.                      Fishing does not work correctly on
  1187.                      Bizhawk.
  1188.                      '''
  1189.         }),
  1190.     Setting_Info('logic_no_trade_skull_mask', bool, 1, True,
  1191.         {
  1192.             'help': '''\
  1193.                    You will not be expected to show the Skull Mask at the forest stage.
  1194.                    ''',
  1195.             'action': 'store_true'
  1196.         },
  1197.         {
  1198.             'text': 'No Skull Mask Reward',
  1199.             'group': 'rewards',
  1200.             'widget': 'Checkbutton',
  1201.             'default': 'unchecked',
  1202.             'tooltip':'''\
  1203.                      Showing off the Skull Mask will
  1204.                      not yield a required item.
  1205.                      '''
  1206.         }),
  1207.     Setting_Info('logic_no_trade_mask_of_truth', bool, 1, True,
  1208.         {
  1209.             'help': '''\
  1210.                    You will not be expected to show the Mask of Truth at the forest stage.
  1211.                    ''',
  1212.             'action': 'store_true'
  1213.         },
  1214.         {
  1215.             'text': 'No Mask of Truth Reward',
  1216.             'group': 'rewards',
  1217.             'widget': 'Checkbutton',
  1218.             'default': 'unchecked',
  1219.             'tooltip':'''\
  1220.                      Showing off the Mask of Truth
  1221.                      will not yield a required item.
  1222.                      '''
  1223.         }),
  1224.     Setting_Info('logic_no_1500_archery', bool, 1, True,
  1225.         {
  1226.             'help': '''\
  1227.                    You will not be expected to win the 1500 point horseback archery reward.
  1228.                    ''',
  1229.             'action': 'store_true'
  1230.         },
  1231.         {
  1232.             'text': 'No 1500 Horseback Archery',
  1233.             'group': 'rewards',
  1234.             'widget': 'Checkbutton',
  1235.             'default': 'unchecked',
  1236.             'tooltip':'''\
  1237.                      Scoring 1500 points at horseback
  1238.                      archery will not yield a required item.
  1239.                      '''
  1240.         }),
  1241.     Setting_Info('logic_no_memory_game', bool, 1, True,
  1242.         {
  1243.             'help': '''\
  1244.                    You will not be expected to play the ocarina memory game in Lost Woods.
  1245.                    ''',
  1246.             'action': 'store_true'
  1247.         },
  1248.         {
  1249.             'text': 'No Lost Woods Memory Game',
  1250.             'group': 'rewards',
  1251.             'widget': 'Checkbutton',
  1252.             'default': 'unchecked',
  1253.             'tooltip':'''\
  1254.                      Playing the ocarina memory game
  1255.                      will not yield a required item.
  1256.                      '''
  1257.         }),
  1258.     Setting_Info('logic_no_second_dampe_race', bool, 1, True,
  1259.         {
  1260.             'help': '''\
  1261.                    You will not be expected to race Dampe a second time.
  1262.                    ''',
  1263.             'action': 'store_true'
  1264.         },
  1265.         {
  1266.             'text': 'No Racing Dampe a Second Time',
  1267.             'group': 'rewards',
  1268.             'widget': 'Checkbutton',
  1269.             'default': 'unchecked',
  1270.             'tooltip':'''\
  1271.                      The second Dampe race will
  1272.                      not yield a required item.
  1273.                      '''
  1274.         }),
  1275.     Setting_Info('logic_no_trade_biggoron', bool, 1, True,
  1276.         {
  1277.             'help': '''\
  1278.                    You will not be expected to show the Claim Check to Biggoron.
  1279.                    ''',
  1280.             'action': 'store_true'
  1281.         },
  1282.         {
  1283.             'text': 'No Biggoron Reward',
  1284.             'group': 'rewards',
  1285.             'widget': 'Checkbutton',
  1286.             'default': 'unchecked',
  1287.             'tooltip':'''\
  1288.                      Showing the Claim Check to Biggoron
  1289.                      will not yield a required item.
  1290.                      '''
  1291.         }),
  1292.     Setting_Info('logic_earliest_adult_trade', str, 4, True,
  1293.         {
  1294.             'default': 'pocket_egg',
  1295.             'const': 'always',
  1296.             'nargs': '?',
  1297.             'help': '''\
  1298.                    Select the earliest item that can appear in the adult trade sequence:
  1299.                    'pocket_egg'
  1300.                    'pocket_cucco'
  1301.                    'cojiro'
  1302.                    'odd_mushroom'
  1303.                    'poachers_saw'
  1304.                    'broken_sword'
  1305.                    'prescription'
  1306.                    'eyeball_frog'
  1307.                    'eyedrops'
  1308.                    'claim_check'
  1309.                    '''
  1310.         },
  1311.         {
  1312.             'text': 'Adult Trade Sequence',
  1313.             'group': 'rewards',
  1314.             'widget': 'Combobox',
  1315.             'dependency': lambda guivar: not guivar['logic_no_trade_biggoron'].get(),
  1316.             'default': 'Earliest: Pocket Egg',
  1317.             'options': {
  1318.                 'Earliest: Pocket Egg': 'pocket_egg',
  1319.                 'Earliest: Pocket Cucco': 'pocket_cucco',
  1320.                 'Earliest: Cojiro': 'cojiro',
  1321.                 'Earliest: Odd Mushroom': 'odd_mushroom',
  1322.                 'Earliest: Poacher\'s Saw': 'poachers_saw',
  1323.                 'Earliest: Broken Sword': 'broken_sword',
  1324.                 'Earliest: Prescription': 'prescription',
  1325.                 'Earliest: Eyeball Frog': 'eyeball_frog',
  1326.                 'Earliest: Eyedrops': 'eyedrops',
  1327.                 'Earliest: Claim Check': 'claim_check'},
  1328.             'tooltip':'''\
  1329.                      Select the earliest item that can appear in the adult trade sequence.
  1330.                      '''
  1331.         }),
  1332.     Setting_Info('logic_latest_adult_trade', str, 4, True,
  1333.         {
  1334.             'default': 'claim_check',
  1335.             'const': 'always',
  1336.             'nargs': '?',
  1337.             'help': '''\
  1338.                    Select the latest item that can appear in the adult trade sequence:
  1339.                    'pocket_egg'
  1340.                    'pocket_cucco'
  1341.                    'cojiro'
  1342.                    'odd_mushroom'
  1343.                    'poachers_saw'
  1344.                    'broken_sword'
  1345.                    'prescription'
  1346.                    'eyeball_frog'
  1347.                    'eyedrops'
  1348.                    'claim_check'
  1349.                    '''
  1350.         },
  1351.         {
  1352.             'group': 'rewards',
  1353.             'widget': 'Combobox',
  1354.             'dependency': lambda guivar: not guivar['logic_no_trade_biggoron'].get(),
  1355.             'default': 'Latest: Claim Check',
  1356.             'options': {
  1357.                 'Latest: Pocket Egg': 'pocket_egg',
  1358.                 'Latest: Pocket Cucco': 'pocket_cucco',
  1359.                 'Latest: Cojiro': 'cojiro',
  1360.                 'Latest: Odd Mushroom': 'odd_mushroom',
  1361.                 'Latest: Poacher\'s Saw': 'poachers_saw',
  1362.                 'Latest: Broken Sword': 'broken_sword',
  1363.                 'Latest: Prescription': 'prescription',
  1364.                 'Latest: Eyeball Frog': 'eyeball_frog',
  1365.                 'Latest: Eyedrops': 'eyedrops',
  1366.                 'Latest: Claim Check': 'claim_check'},
  1367.             'tooltip':'''\
  1368.                      Select the latest item that can appear in the adult trade sequence.
  1369.                      '''
  1370.         }),
  1371.     Setting_Info('logic_tricks', bool, 1, True,
  1372.         {
  1373.             'help': '''\
  1374.                    Enable various advanced tricks that do not require glitches.
  1375.                    ''',
  1376.             'action': 'store_true'
  1377.         },
  1378.         {
  1379.             'text': 'Various Advanced Tricks',
  1380.             'group': 'tricks',
  1381.             'widget': 'Checkbutton',
  1382.             'default': 'unchecked',
  1383.             'tooltip':'''\
  1384.                      Enables a large number of minor
  1385.                      tricks that do not require glitches.
  1386.                      '''
  1387.         }),
  1388.     Setting_Info('logic_man_on_roof', bool, 1, True,
  1389.         {
  1390.             'help': '''\
  1391.                    The man on the roof will not require the Hookshot in logic.
  1392.                    ''',
  1393.             'action': 'store_true'
  1394.         },
  1395.         {
  1396.             'text': 'Man on Roof without Hookshot',
  1397.             'group': 'tricks',
  1398.             'widget': 'Checkbutton',
  1399.             'default': 'unchecked',
  1400.             'tooltip':'''\
  1401.                      Can be reached by side-hopping off
  1402.                      the watchtower.
  1403.                      '''
  1404.         }),
  1405.     Setting_Info('logic_child_deadhand', bool, 1, True,
  1406.         {
  1407.             'help': '''\
  1408.                    Deadhand in the Bottom of the Well will not require the Kokiri sword in logic.
  1409.                    ''',
  1410.             'action': 'store_true'
  1411.         },
  1412.         {
  1413.             'text': 'Child Deadhand without Kokiri Sword',
  1414.             'group': 'tricks',
  1415.             'widget': 'Checkbutton',
  1416.             'default': 'unchecked',
  1417.             'tooltip':'''\
  1418.                      Requires 9 sticks or 5 jump slashes.
  1419.                      '''
  1420.         }),
  1421.     Setting_Info('logic_dc_jump', bool, 1, True,
  1422.         {
  1423.             'help': '''\
  1424.                    Jumping towards the Bomb Bag chest in Dodongo's Cavern as an adult
  1425.                    will not require Hover Boots in logic.
  1426.                    ''',
  1427.             'action': 'store_true'
  1428.         },
  1429.         {
  1430.             'text': 'Dodongo\'s Cavern Spike Trap Room Jump without Hover Boots',
  1431.             'group': 'tricks',
  1432.             'widget': 'Checkbutton',
  1433.             'default': 'unchecked',
  1434.             'tooltip':'''\
  1435.                      Jump is adult only.
  1436.                      '''
  1437.         }),
  1438.     Setting_Info('logic_windmill_poh', bool, 1, True,
  1439.         {
  1440.             'help': '''\
  1441.                    Getting the Piece of Heart in the windmill as an adult will require nothing in logic.
  1442.                    ''',
  1443.             'action': 'store_true'
  1444.         },
  1445.         {
  1446.             'text': 'Windmill PoH as Adult with Nothing',
  1447.             'group': 'tricks',
  1448.             'widget': 'Checkbutton',
  1449.             'default': 'unchecked',
  1450.             'tooltip':'''\
  1451.                      Can jump up to the spinning platform from
  1452.                      below as adult.
  1453.                      '''
  1454.         }),
  1455.     Setting_Info('logic_crater_bean_poh_with_hovers', bool, 1, True,
  1456.         {
  1457.             'help': '''\
  1458.                    The Piece of Heart in Death Mountain Crater that normally requires the bean to
  1459.                    reach will optionally require the Hover Boots in logic.
  1460.                    ''',
  1461.             'action': 'store_true'
  1462.         },
  1463.         {
  1464.             'text': "Crater's Bean PoH with Hover Boots",
  1465.             'group': 'tricks',
  1466.             'widget': 'Checkbutton',
  1467.             'default': 'unchecked',
  1468.             'tooltip':'''\
  1469.                      Hover from the base of the bridge
  1470.                      near Goron City and walk up the
  1471.                      very steep slope.
  1472.                      '''
  1473.         }),
  1474.     Setting_Info('logic_zora_with_cucco', bool, 1, True,
  1475.         {
  1476.             'help': '''\
  1477.                    Zora's Domain can be entered with a Cucco as child in logic.
  1478.                    ''',
  1479.             'action': 'store_true'
  1480.         },
  1481.         {
  1482.             'text': "Zora's Domain Entry with Cucco",
  1483.             'group': 'tricks',
  1484.             'widget': 'Checkbutton',
  1485.             'default': 'unchecked',
  1486.             'tooltip':'''\
  1487.                      Can fly behind the waterfall with
  1488.                      a cucco as child.
  1489.                      '''
  1490.         }),
  1491.     Setting_Info('logic_zora_with_hovers', bool, 1, True,
  1492.         {
  1493.             'help': '''\
  1494.                    Zora's Domain can be entered with Hover Boots as Adult in logic.
  1495.                    ''',
  1496.             'action': 'store_true'
  1497.         },
  1498.         {
  1499.             'text': "Zora's Domain Entry with Hover Boots",
  1500.             'group': 'tricks',
  1501.             'widget': 'Checkbutton',
  1502.             'default': 'unchecked',
  1503.             'tooltip':'''\
  1504.                      Can hover behind the waterfall as adult.
  1505.                      This is very difficult.
  1506.                      '''
  1507.         }),
  1508.     Setting_Info('logic_fewer_tunic_requirements', bool, 1, True,
  1509.         {
  1510.             'help': '''\
  1511.                    Allows the following possible without Goron or Zora Tunic:
  1512.                    Enter Water Temple
  1513.                    Enter Fire Temple
  1514.                    Zoras Fountain Bottom Freestanding PoH
  1515.                    Gerudo Training Grounds Underwater Silver Rupee Chest
  1516.                    ''',
  1517.             'action': 'store_true'
  1518.         },
  1519.         {
  1520.             'text': "Fewer Tunic Requirements",
  1521.             'group': 'tricks',
  1522.             'widget': 'Checkbutton',
  1523.             'default': 'unchecked',
  1524.             'tooltip':'''\
  1525.                      Allows the following possible without Tunics:
  1526.                      - Enter Water Temple. The key below the center
  1527.                      pillar still requires Zora Tunic.
  1528.                      - Enter Fire Temple. Only the first floor is
  1529.                      accessible, and not Volvagia.
  1530.                      - Zora's Fountain Bottom Freestanding PoH.
  1531.                      Might not have enough health to resurface.
  1532.                      - Gerudo Training Grounds Underwater
  1533.                      Silver Rupee Chest. May need to make multiple
  1534.                      trips.
  1535.                      '''
  1536.         }),
  1537.     Setting_Info('logic_morpha_with_scale', bool, 1, True,
  1538.         {
  1539.             'help': '''\
  1540.                    Allows entering Water Temple and beating
  1541.                    Morpha with Gold Scale instead of Iron Boots.
  1542.                    Only applicable for keysanity and keysy.
  1543.                    ''',
  1544.             'action': 'store_true'
  1545.         },
  1546.         {
  1547.             'text': "Morpha with Gold Scale",
  1548.             'group': 'tricks',
  1549.             'widget': 'Checkbutton',
  1550.             'default': 'checked',
  1551.             'tooltip':'''\
  1552.                      Allows entering Water Temple and beating
  1553.                      Morpha with Gold Scale instead of Iron Boots.
  1554.                      Only applicable for keysanity and keysy due
  1555.                      to the logic always seeing every chest in
  1556.                      Water Temple that could contain the Boss Key
  1557.                      as requiring Iron Boots.
  1558.                      ''',
  1559.             'dependency': lambda guivar: guivar['shuffle_bosskeys'].get() != 'Boss Keys: Dungeon Only'
  1560.         }),
  1561.     Setting_Info('logic_lens', str, 2, True,
  1562.         {
  1563.             'default': 'all',
  1564.             'const': 'always',
  1565.             'nargs': '?',
  1566.             'help': '''\
  1567.                    Choose what expects the Lens of Truth:
  1568.                    all:              All lens spots expect the lens (except those that did not in the original game)
  1569.                    chest-wasteland:  Only wasteland and chest minigame expect the lens
  1570.                    chest:            Only the chest minigame expects the lens
  1571.                    '''
  1572.         },
  1573.         {
  1574.             'text': 'Lens of Truth',
  1575.             'group': 'tricks',
  1576.             'widget': 'Combobox',
  1577.             'default': 'Required Everywhere',
  1578.             'options': {
  1579.                 'Required Everywhere': 'all',
  1580.                 'Wasteland and Chest Minigame': 'chest-wasteland',
  1581.                 'Only Chest Minigame': 'chest',
  1582.             },
  1583.             'tooltip':'''\
  1584.                      'Required everywhere': every invisible or
  1585.                      fake object will expect you to have the
  1586.                      Lens of Truth and Magic. The exception is
  1587.                      passing through the first wall in Bottom of
  1588.                      the Well, since that is required in vanilla.
  1589.  
  1590.                      'Wasteland': The lens is needed to follow
  1591.                      the ghost guide across the Haunted Wasteland.
  1592.                      '''
  1593.         }),
  1594.     Setting_Info('ocarina_songs', bool, 1, True,
  1595.         {
  1596.             'help': '''\
  1597.                    Randomizes the notes needed to play each ocarina song.
  1598.                    ''',
  1599.             'action': 'store_true'
  1600.         },
  1601.         {
  1602.             'text': 'Randomize Ocarina Song Notes',
  1603.             'group': 'other',
  1604.             'widget': 'Checkbutton',
  1605.             'default': 'unchecked',
  1606.             'tooltip':'''\
  1607.                      Will need to memorize a new set of songs.
  1608.                      Can be silly, but difficult. Songs are
  1609.                      generally sensible, and warp songs are
  1610.                      typically more difficult.
  1611.                      '''
  1612.         }),
  1613.     Setting_Info('correct_chest_sizes', bool, 1, True,
  1614.         {
  1615.             'help': '''\
  1616.                    Updates the chest sizes to match their contents.
  1617.                    Small Chest = Non-required Item
  1618.                    Big Chest = Progression Item
  1619.                    ''',
  1620.             'action': 'store_true'
  1621.         },
  1622.         {
  1623.             'text': 'Chest Size Matches Contents',
  1624.             'group': 'other',
  1625.             'widget': 'Checkbutton',
  1626.             'default': 'unchecked',
  1627.             'tooltip':'''\
  1628.                      Chests will be large if they contain a major
  1629.                      item and small if they don't. This allows skipping
  1630.                      chests if they are small. However, skipping
  1631.                      small chests will mean having low health,
  1632.                      ammo, and rupees, so doing so is a risk.
  1633.                      '''
  1634.         }),
  1635.     Setting_Info('clearer_hints', bool, 1, True,
  1636.         {
  1637.             'help': '''\
  1638.                    The hints provided by Gossip Stones are
  1639.                    very direct.
  1640.                    ''',
  1641.             'action': 'store_true'
  1642.         },
  1643.         {
  1644.             'text': 'Clearer Hints',
  1645.             'group': 'other',
  1646.             'widget': 'Checkbutton',
  1647.             'default': 'unchecked',
  1648.             'tooltip':'''\
  1649.                      The hints provided by Gossip Stones will
  1650.                      be very direct if this option is enabled.
  1651.                      '''
  1652.         }),
  1653.     Setting_Info('hints', str, 2, True,
  1654.         {
  1655.             'default': 'none',
  1656.             'const': 'agony',
  1657.             'nargs': '?',
  1658.             'help': '''\
  1659.                    Choose how Gossip Stones behave
  1660.                    none:   Default behavior
  1661.                    mask:   Have useful hints that are read with the Mask of Truth.
  1662.                    agony:  Have useful hints that are read with Stone of Agony.
  1663.                    always: Have useful hints which can always be read.
  1664.                    '''
  1665.         },
  1666.         {
  1667.             'text': 'Gossip Stones',
  1668.             'group': 'other',
  1669.             'widget': 'Combobox',
  1670.             'default': 'Hints; Need Stone of Agony',
  1671.             'options': {
  1672.                 'No Hints': 'none',
  1673.                 'Hints; Need Mask of Truth': 'mask',
  1674.                 'Hints; Need Stone of Agony': 'agony',
  1675.                 'Hints; Need Nothing': 'always',
  1676.             },
  1677.             'tooltip':'''\
  1678.                      Gossip Stones can be made to give hints
  1679.                      about where items can be found.
  1680.  
  1681.                      Different settings can be chosen to
  1682.                      decide which item is needed to
  1683.                      speak to Gossip Stones. Choosing to
  1684.                      stick with the Mask of Truth will
  1685.                      make the hints very difficult to
  1686.                      obtain.
  1687.  
  1688.                      Hints for 'on the way of the hero' are
  1689.                      locations that contain items that are
  1690.                      required to beat the game.
  1691.                      '''
  1692.         }),
  1693.     Setting_Info('text_shuffle', str, 2, True,
  1694.         {
  1695.             'default': 'none',
  1696.             'const': 'none',
  1697.             'nargs': '?',
  1698.             'help': '''\
  1699.                    Choose how to shuffle the game's messages.
  1700.                    none:          Default behavior
  1701.                    except_hints:  All non-useful text is shuffled.
  1702.                    complete:      All text is shuffled.
  1703.                    '''
  1704.         },
  1705.         {
  1706.             'text': 'Text Shuffle',
  1707.             'group': 'other',
  1708.             'widget': 'Combobox',
  1709.             'default': 'No Text Shuffled',
  1710.             'options': {
  1711.                 'No Text Shuffled': 'none',
  1712.                 'Shuffled except Hints and Keys': 'except_hints',
  1713.                 'All Text Shuffled': 'complete',
  1714.             },
  1715.             'tooltip':'''\
  1716.                      Will make things confusing for comedic value.
  1717.  
  1718.                      'Shuffled except Hints and Keys': Key texts
  1719.                      are not shuffled because in keysanity it is
  1720.                      inconvenient to figure out which keys are which
  1721.                      without the correct text. Similarly, non-shop
  1722.                      items sold in shops will also retain standard
  1723.                      text for the purpose of accurate price checks.
  1724.                      '''
  1725.         }),
  1726.     Setting_Info('difficulty', str, 2, True,
  1727.         {
  1728.             'default': 'normal',
  1729.             'const': 'normal',
  1730.             'nargs': '?',
  1731.             'help': '''\
  1732.                    Change the item pool for an added challenge.
  1733.                    normal:         Default items
  1734.                    hard:           Double defense, double magic, and all 8 heart containers are removed. Ammo
  1735.                                    for each type can only be expanded once and you can only find three Bombchu packs.
  1736.                    very_hard:      Double defense, double magic, Nayru's Love, and all health upgrades are removed.
  1737.                                    No ammo expansions are available and you can only find one Bombchu pack.
  1738.                    ohko:           Same as very hard, and Link will die in one hit.
  1739.                    '''
  1740.         },
  1741.         {
  1742.             'text': 'Difficulty',
  1743.             'group': 'other',
  1744.             'widget': 'Combobox',
  1745.             'default': 'Normal',
  1746.             'options': {
  1747.                 'Normal': 'normal',
  1748.                 'Hard': 'hard',
  1749.                 'Very Hard': 'very_hard',
  1750.                 'OHKO': 'ohko'
  1751.             },
  1752.             'tooltip':'''\
  1753.                      Makes health less available, reduces
  1754.                      ammo expansions, and reduces Bombchus
  1755.                      in the item pool by three.
  1756.  
  1757.                      'Hard': Heart Containers, Double Magic,
  1758.                      and Double Defense are removed. Only
  1759.                      one extra Quiver, Bullet Bag, Bomb Bag,
  1760.                      Deku Stick and Deku Nut Capacity Upgrades
  1761.                      will be available. Only three Bombchu
  1762.                      packs are available.
  1763.  
  1764.                      'Very Hard': Heart Containers, Pieces of
  1765.                      Heart, Double Magic, Double Defense,
  1766.                      and Nayru's Love are removed. No extra
  1767.                      Quivers, Bullet Bags, Bomb Bags, or
  1768.                      Deku Stick and Deku Nut Capacity Upgrades
  1769.                      will be available. Only one Bombchu
  1770.                      pack is available.
  1771.  
  1772.                      'OHKO': Link dies in one hit.
  1773.                      '''
  1774.         }),
  1775.     Setting_Info('default_targeting', str, 1, False,
  1776.         {
  1777.             'default': 'hold',
  1778.             'const': 'always',
  1779.             'nargs': '?',
  1780.             'help': '''\
  1781.                    Choose what the default Z-targeting is.
  1782.                    '''
  1783.         },
  1784.         {
  1785.             'text': 'Default Targeting Option',
  1786.             'group': 'rom_tab',
  1787.             'widget': 'Combobox',
  1788.             'default': 'Hold',
  1789.             'options': {
  1790.                 'Hold': 'hold',
  1791.                 'Switch': 'switch',
  1792.             }
  1793.         }),
  1794.     Setting_Info('background_music', str, 2, False,
  1795.         {
  1796.             'default': 'normal',
  1797.             'const': 'normal',
  1798.             'nargs': '?',
  1799.             'help': '''\
  1800.                    Sets the background music behavior
  1801.                    normal:      Areas play their normal background music
  1802.                    off:         No background music
  1803.                    random:      Areas play random background music
  1804.                    '''
  1805.         },
  1806.         {
  1807.             'text': 'Background Music',
  1808.             'group': 'cosmetics',
  1809.             'widget': 'Combobox',
  1810.             'default': 'Normal',
  1811.             'options': {
  1812.                 'Normal': 'normal',
  1813.                 'No Music': 'off',
  1814.                 'Random': 'random',
  1815.             },
  1816.             'tooltip': '''\
  1817.                       'No Music': No background music.
  1818.                       is played.
  1819.  
  1820.                       'Random': Area background music is
  1821.                       randomized.
  1822.                       '''
  1823.         })
  1824. ]
  1825.  
  1826. # gets the randomizer settings from command line arguments
  1827. def get_settings_from_command_line_args(argvs):
  1828.  
  1829.     result = {}
  1830.     for info in setting_infos:
  1831.         if info.name in argvs.keys():
  1832.             result[info.name] = argvs[info.name]
  1833.     settings = Settings(result)
  1834.  
  1835.     if 'settings_string' in argvs.keys():
  1836.         settings.update_with_settings_string(argvs['settings_string'])
  1837.         return settings.get_settings_display()
  1838.  
  1839.     return settings.get_settings_string()
  1840.    
  1841. print(get_settings_from_command_line_args({'player_num': 1, 'default_targeting': 'switch', 'settings_string': 'D42JKRANFJBAAKAJAB'}))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement