Add --shuffleganon option to include Ganon's Tower and Pyramid in shuffle pool.

This commit is contained in:
LLCoolDave 2017-07-17 22:28:29 +02:00
parent 4b44a796df
commit 1e644836bb
6 changed files with 29 additions and 10 deletions

View File

@ -4,7 +4,7 @@ import logging
class World(object): class World(object):
def __init__(self, shuffle, logic, mode, difficulty, goal, algorithm, place_dungeon_items, check_beatable_only): def __init__(self, shuffle, logic, mode, difficulty, goal, algorithm, place_dungeon_items, check_beatable_only, shuffle_ganon):
self.shuffle = shuffle self.shuffle = shuffle
self.logic = logic self.logic = logic
self.mode = mode self.mode = mode
@ -41,7 +41,8 @@ class World(object):
self.fix_skullwoods_exit = self.shuffle not in ['vanilla', 'simple', 'restricted', 'dungeonssimple'] self.fix_skullwoods_exit = self.shuffle not in ['vanilla', 'simple', 'restricted', 'dungeonssimple']
self.fix_palaceofdarkness_exit = self.shuffle not in ['vanilla', 'simple', 'restricted', 'dungeonssimple'] self.fix_palaceofdarkness_exit = self.shuffle not in ['vanilla', 'simple', 'restricted', 'dungeonssimple']
self.fix_trock_exit = self.shuffle not in ['vanilla', 'simple', 'restricted', 'dungeonssimple'] self.fix_trock_exit = self.shuffle not in ['vanilla', 'simple', 'restricted', 'dungeonssimple']
self.fix_gtower_exit = self.goal != 'ganon' self.shuffle_ganon = shuffle_ganon
self.fix_gtower_exit = self.shuffle_ganon
def get_region(self, regionname): def get_region(self, regionname):
if isinstance(regionname, Region): if isinstance(regionname, Region):

View File

@ -26,7 +26,7 @@ if __name__ == '__main__':
parser.add_argument('--mode', default='open', const='open', nargs='?', choices=['standard', 'open', 'swordless'], parser.add_argument('--mode', default='open', const='open', nargs='?', choices=['standard', 'open', 'swordless'],
help='''\ help='''\
Select game mode. (default: %(default)s) Select game mode. (default: %(default)s)
Open: Open: World starts with Zelda rescued.
Standard: Fixes Hyrule Castle Secret Entrance and Front Door Standard: Fixes Hyrule Castle Secret Entrance and Front Door
but may lead to weird rain state issues if you exit but may lead to weird rain state issues if you exit
through the Hyrule Castle side exits before rescuing through the Hyrule Castle side exits before rescuing
@ -42,10 +42,11 @@ if __name__ == '__main__':
parser.add_argument('--goal', default='ganon', const='ganon', nargs='?', choices=['ganon', 'pedestal', 'dungeons', 'starhunt', 'triforcehunt'], parser.add_argument('--goal', default='ganon', const='ganon', nargs='?', choices=['ganon', 'pedestal', 'dungeons', 'starhunt', 'triforcehunt'],
help='''\ help='''\
Select completion goal. (default: %(default)s) Select completion goal. (default: %(default)s)
Ganon: Defeat Ganon. Ganon: Collect all crystals, beat Agahnim 2 then
defeat Ganon.
Pedestal: Places the Triforce at the Master Sword Pedestal. Pedestal: Places the Triforce at the Master Sword Pedestal.
All Dungeons: Not enforced ingame but considered in the All Dungeons: Collect all crystals, pendants, beat both
playthrough. Agahnim fights and then defeat Ganon.
Star Hunt: Places 15 Power Stars in the world, collect 10 of Star Hunt: Places 15 Power Stars in the world, collect 10 of
them to beat the game. them to beat the game.
Triforce Hunt: Places 3 Triforce Pieces in the world, collect Triforce Hunt: Places 3 Triforce Pieces in the world, collect
@ -130,6 +131,10 @@ if __name__ == '__main__':
ensure all locations are reachable. This only has an effect ensure all locations are reachable. This only has an effect
on the restrictive algorithm currently. on the restrictive algorithm currently.
''', action='store_true') ''', action='store_true')
parser.add_argument('--shuffleganon', help='''\
If set, include the Pyramid Hole and Ganon's Tower in the
entrance shuffle pool.
''', action='store_true')
parser.add_argument('--heartbeep', default='normal', const='normal', nargs='?', choices=['normal', 'half', 'quarter', 'off'], parser.add_argument('--heartbeep', default='normal', const='normal', nargs='?', choices=['normal', 'half', 'quarter', 'off'],
help='''\ help='''\
Select the rate at which the heart beep sound is played at Select the rate at which the heart beep sound is played at

5
Gui.py
View File

@ -23,12 +23,15 @@ def guiMain(args=None):
dungeonItemsCheckbutton = Checkbutton(checkBoxFrame, text="Place Dungeon Items (Compasses/Maps)", onvalue=0, offvalue=1, variable=dungeonItemsVar) dungeonItemsCheckbutton = Checkbutton(checkBoxFrame, text="Place Dungeon Items (Compasses/Maps)", onvalue=0, offvalue=1, variable=dungeonItemsVar)
beatableOnlyVar = IntVar() beatableOnlyVar = IntVar()
beatableOnlyCheckbutton = Checkbutton(checkBoxFrame, text="Only ensure seed is beatable, not all items must be reachable", variable=beatableOnlyVar) beatableOnlyCheckbutton = Checkbutton(checkBoxFrame, text="Only ensure seed is beatable, not all items must be reachable", variable=beatableOnlyVar)
shuffleGanonVar = IntVar()
shuffleGanonCheckbutton = Checkbutton(checkBoxFrame, text="Include Ganon's Tower and Pyramid Hole in shuffle pool", variable=shuffleGanonVar)
createSpoilerCheckbutton.pack(expand=True, anchor=W) createSpoilerCheckbutton.pack(expand=True, anchor=W)
suppressRomCheckbutton.pack(expand=True, anchor=W) suppressRomCheckbutton.pack(expand=True, anchor=W)
quickSwapCheckbutton.pack(expand=True, anchor=W) quickSwapCheckbutton.pack(expand=True, anchor=W)
dungeonItemsCheckbutton.pack(expand=True, anchor=W) dungeonItemsCheckbutton.pack(expand=True, anchor=W)
beatableOnlyCheckbutton.pack(expand=True, anchor=W) beatableOnlyCheckbutton.pack(expand=True, anchor=W)
shuffleGanonCheckbutton.pack(expand=True, anchor=W)
fileDialogFrame = Frame(rightHalfFrame) fileDialogFrame = Frame(rightHalfFrame)
@ -157,6 +160,7 @@ def guiMain(args=None):
guiargs.nodungeonitems = bool(dungeonItemsVar.get()) guiargs.nodungeonitems = bool(dungeonItemsVar.get())
guiargs.beatableonly = bool(beatableOnlyVar.get()) guiargs.beatableonly = bool(beatableOnlyVar.get())
guiargs.quickswap = bool(quickSwapVar.get()) guiargs.quickswap = bool(quickSwapVar.get())
guiargs.shuffleganon = bool(shuffleGanonVar.get())
guiargs.rom = romVar.get() guiargs.rom = romVar.get()
guiargs.jsonout = None guiargs.jsonout = None
guiargs.sprite = spriteVar.get() if spriteVar.get() else None guiargs.sprite = spriteVar.get() if spriteVar.get() else None
@ -206,6 +210,7 @@ def guiMain(args=None):
heartbeepVar.set(args.heartbeep) heartbeepVar.set(args.heartbeep)
logicVar.set(args.logic) logicVar.set(args.logic)
romVar.set(args.rom) romVar.set(args.rom)
shuffleGanonVar.set(args.shuffleganon)
if args.sprite is not None: if args.sprite is not None:
spriteVar.set(args.sprite) spriteVar.set(args.sprite)

View File

@ -26,7 +26,7 @@ def main(args, seed=None):
start = time.clock() start = time.clock()
# initialize the world # initialize the world
world = World(args.shuffle, args.logic, args.mode, args.difficulty, args.goal, args.algorithm, not args.nodungeonitems, args.beatableonly) world = World(args.shuffle, args.logic, args.mode, args.difficulty, args.goal, args.algorithm, not args.nodungeonitems, args.beatableonly, args.shuffleganon)
logger = logging.getLogger('') logger = logging.getLogger('')
if seed is None: if seed is None:
@ -502,7 +502,7 @@ def generate_itempool(world):
def copy_world(world): def copy_world(world):
# ToDo: Not good yet # ToDo: Not good yet
ret = World(world.shuffle, world.logic, world.mode, world.difficulty, world.goal, world.algorithm, world.place_dungeon_items, world.check_beatable_only) ret = World(world.shuffle, world.logic, world.mode, world.difficulty, world.goal, world.algorithm, world.place_dungeon_items, world.check_beatable_only, world.shuffle_ganon)
ret.required_medallions = list(world.required_medallions) ret.required_medallions = list(world.required_medallions)
ret.swamp_patch_required = world.swamp_patch_required ret.swamp_patch_required = world.swamp_patch_required
ret.treasure_hunt_count = world.treasure_hunt_count ret.treasure_hunt_count = world.treasure_hunt_count

View File

@ -28,7 +28,7 @@ def main(args, seed=None):
start = time.clock() start = time.clock()
# initialize the world # initialize the world
world = World('vanilla', 'noglitches', 'standard', 'normal', 'ganon', 'freshness', False, False) world = World('vanilla', 'noglitches', 'standard', 'normal', 'ganon', 'freshness', False, False, False)
logger = logging.getLogger('') logger = logging.getLogger('')
hasher = hashlib.md5() hasher = hashlib.md5()

View File

@ -206,6 +206,14 @@ Use to select a different sprite sheet to use for Link. Path to a binary file of
If set, will only ensure the goal can be achieved, but not necessarily that all locations are reachable. Currently only affects restrictive algorithm. If set, will only ensure the goal can be achieved, but not necessarily that all locations are reachable. Currently only affects restrictive algorithm.
```
--shuffleganon
```
If set, Ganon's Tower is included in the dungeon shuffle pool and the Pyramid Hole/Exit pair is included in the Holes shuffle pool. Ganon can not be defeated until the primary goal is fulfilled.
Note: This option is under development and may sometimes lead to dungeon and crystal distributions that cannot be solved. If this is the case, the generation will fail. Simply retry with a different seed number if you run into this issue.
``` ```
--suppress_rom --suppress_rom
``` ```