mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Whitespace fixes
This commit is contained in:
@@ -13,6 +13,7 @@ class ArgumentDefaultsHelpFormatter(argparse.RawTextHelpFormatter):
|
|||||||
def _get_help_string(self, action):
|
def _get_help_string(self, action):
|
||||||
return textwrap.dedent(action.help)
|
return textwrap.dedent(action.help)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
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')
|
||||||
|
1
Fill.py
1
Fill.py
@@ -1,6 +1,7 @@
|
|||||||
import random
|
import random
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
def distribute_items_cutoff(world, cutoffrate=0.33):
|
def distribute_items_cutoff(world, cutoffrate=0.33):
|
||||||
# get list of locations to fill in
|
# get list of locations to fill in
|
||||||
fill_locations = world.get_unfilled_locations()
|
fill_locations = world.get_unfilled_locations()
|
||||||
|
1
Gui.py
1
Gui.py
@@ -45,6 +45,7 @@ def guiMain(args=None):
|
|||||||
baseRomLabel = Label(romDialogFrame, text='Base Rom')
|
baseRomLabel = Label(romDialogFrame, text='Base Rom')
|
||||||
romVar = StringVar()
|
romVar = StringVar()
|
||||||
romEntry = Entry(romDialogFrame, textvariable=romVar)
|
romEntry = Entry(romDialogFrame, textvariable=romVar)
|
||||||
|
|
||||||
def RomSelect():
|
def RomSelect():
|
||||||
rom = filedialog.askopenfilename()
|
rom = filedialog.askopenfilename()
|
||||||
romVar.set(rom)
|
romVar.set(rom)
|
||||||
|
3
Main.py
3
Main.py
@@ -41,7 +41,7 @@ def main(args, seed=None):
|
|||||||
|
|
||||||
create_regions(world)
|
create_regions(world)
|
||||||
|
|
||||||
create_dungeons(world);
|
create_dungeons(world)
|
||||||
|
|
||||||
logger.info('Shuffling the World about.')
|
logger.info('Shuffling the World about.')
|
||||||
|
|
||||||
@@ -315,4 +315,3 @@ def create_playthrough(world):
|
|||||||
|
|
||||||
# we can finally output our playthrough
|
# we can finally output our playthrough
|
||||||
old_world.spoiler.playthrough = OrderedDict([(str(i + 1), {str(location): str(location.item) for location in sphere}) for i, sphere in enumerate(collection_spheres)])
|
old_world.spoiler.playthrough = OrderedDict([(str(i + 1), {str(location): str(location.item) for location in sphere}) for i, sphere in enumerate(collection_spheres)])
|
||||||
|
|
||||||
|
6
Rom.py
6
Rom.py
@@ -87,8 +87,10 @@ def patch_rom(world, rom, hashtable, beep='normal', sprite=None):
|
|||||||
if location.parent_region.dungeon:
|
if location.parent_region.dungeon:
|
||||||
dungeon = location.parent_region.dungeon
|
dungeon = location.parent_region.dungeon
|
||||||
if location.item.key and dungeon.is_dungeon_item(location.item):
|
if location.item.key and dungeon.is_dungeon_item(location.item):
|
||||||
if location.item.type == "BigKey": itemid = 0x32
|
if location.item.type == "BigKey":
|
||||||
if location.item.type == "SmallKey": itemid = 0x24
|
itemid = 0x32
|
||||||
|
if location.item.type == "SmallKey":
|
||||||
|
itemid = 0x24
|
||||||
rom.write_byte(locationaddress, itemid)
|
rom.write_byte(locationaddress, itemid)
|
||||||
else:
|
else:
|
||||||
# crystals
|
# crystals
|
||||||
|
4
Rules.py
4
Rules.py
@@ -20,8 +20,6 @@ def set_rules(world):
|
|||||||
else:
|
else:
|
||||||
raise NotImplementedError('Not implemented yet')
|
raise NotImplementedError('Not implemented yet')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if world.goal == 'dungeons':
|
if world.goal == 'dungeons':
|
||||||
# require all dungeons to beat ganon
|
# require all dungeons to beat ganon
|
||||||
add_rule(world.get_location('Ganon'), lambda state: state.can_reach('Master Sword Pedestal', 'Location') and state.has('Beat Agahnim 1') and state.has('Beat Agahnim 2'))
|
add_rule(world.get_location('Ganon'), lambda state: state.can_reach('Master Sword Pedestal', 'Location') and state.has('Beat Agahnim 1') and state.has('Beat Agahnim 2'))
|
||||||
@@ -56,6 +54,7 @@ def forbid_item(location, item):
|
|||||||
old_rule = location.item_rule
|
old_rule = location.item_rule
|
||||||
location.item_rule = lambda i: i.name != item and old_rule(i)
|
location.item_rule = lambda i: i.name != item and old_rule(i)
|
||||||
|
|
||||||
|
|
||||||
def item_in_locations(state, item, locations):
|
def item_in_locations(state, item, locations):
|
||||||
for location in locations:
|
for location in locations:
|
||||||
loc = state.world.get_location(location)
|
loc = state.world.get_location(location)
|
||||||
@@ -209,7 +208,6 @@ def global_rules(world):
|
|||||||
for location in ['Desert Palace - Lanmolas', 'Desert Palace - Big Key Chest', 'Desert Palace - Compass Chest']:
|
for location in ['Desert Palace - Lanmolas', 'Desert Palace - Big Key Chest', 'Desert Palace - Compass Chest']:
|
||||||
forbid_item(world.get_location(location), 'Small Key (Desert Palace)')
|
forbid_item(world.get_location(location), 'Small Key (Desert Palace)')
|
||||||
|
|
||||||
|
|
||||||
set_rule(world.get_entrance('Tower of Hera Small Key Door'), lambda state: state.has('Small Key (Tower of Hera)'))
|
set_rule(world.get_entrance('Tower of Hera Small Key Door'), lambda state: state.has('Small Key (Tower of Hera)'))
|
||||||
set_rule(world.get_entrance('Tower of Hera Big Key Door'), lambda state: state.has('Big Key (Tower of Hera)'))
|
set_rule(world.get_entrance('Tower of Hera Big Key Door'), lambda state: state.has('Big Key (Tower of Hera)'))
|
||||||
set_rule(world.get_location('Tower of Hera - Big Chest'), lambda state: state.has('Big Key (Tower of Hera)'))
|
set_rule(world.get_location('Tower of Hera - Big Chest'), lambda state: state.has('Big Key (Tower of Hera)'))
|
||||||
|
Reference in New Issue
Block a user