Custom Item Pool Update

This updates the custom item pool feature to support progressive bows and the 10 bomb item. Yes, the latter had existed for a long time and was just never put in properly. The default item pool with the custom item pool feature now matches v31's item distribution instead of whatever the last version with bomb/arrow capacity upgrades' default was. I'm unsure if anyone will actually use this feature even still, but it's now up to date!
This commit is contained in:
AmazingAmpharos 2019-10-23 21:31:02 -05:00 committed by GitHub
parent 948901c51a
commit acc04e92ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 57 additions and 39 deletions

64
Gui.py
View File

@ -398,8 +398,8 @@ def guiMain(args=None):
int(sword3Var.get()), int(sword4Var.get()), int(progswordVar.get()), int(shield1Var.get()), int(shield2Var.get()), int(shield3Var.get()), int(progshieldVar.get()), int(bluemailVar.get()),
int(redmailVar.get()), int(progmailVar.get()), int(halfmagicVar.get()), int(quartermagicVar.get()), int(bcap5Var.get()), int(bcap10Var.get()), int(acap5Var.get()), int(acap10Var.get()),
int(arrow1Var.get()), int(arrow10Var.get()), int(bomb1Var.get()), int(bomb3Var.get()), int(rupee1Var.get()), int(rupee5Var.get()), int(rupee20Var.get()), int(rupee50Var.get()), int(rupee100Var.get()),
int(rupee300Var.get()), int(rupoorVar.get()), int(blueclockVar.get()), int(greenclockVar.get()), int(redclockVar.get()), int(triforcepieceVar.get()), int(triforcecountVar.get()),
int(triforceVar.get()), int(rupoorcostVar.get()), int(universalkeyVar.get())]
int(rupee300Var.get()), int(rupoorVar.get()), int(blueclockVar.get()), int(greenclockVar.get()), int(redclockVar.get()), int(progbowVar.get()), int(bomb10Var.get()), int(triforcepieceVar.get()),
int(triforcecountVar.get()), int(triforceVar.get()), int(rupoorcostVar.get()), int(universalkeyVar.get())]
guiargs.rom = romVar.get()
guiargs.jsonout = None
guiargs.sprite = sprite
@ -553,19 +553,19 @@ def guiMain(args=None):
bowFrame = Frame(itemList1)
bowLabel = Label(bowFrame, text='Bow')
bowVar = StringVar(value='1')
bowVar = StringVar(value='0')
bowEntry = Entry(bowFrame, textvariable=bowVar, width=3, validate='all', vcmd=vcmd)
bowFrame.pack()
bowLabel.pack(anchor=W, side=LEFT, padx=(0,53))
bowEntry.pack(anchor=E)
silverarrowFrame = Frame(itemList1)
silverarrowLabel = Label(silverarrowFrame, text='Silver Arrow')
silverarrowVar = StringVar(value='1')
silverarrowEntry = Entry(silverarrowFrame, textvariable=silverarrowVar, width=3, validate='all', vcmd=vcmd)
silverarrowFrame.pack()
silverarrowLabel.pack(anchor=W, side=LEFT, padx=(0,13))
silverarrowEntry.pack(anchor=E)
progbowFrame = Frame(itemList1)
progbowLabel = Label(progbowFrame, text='Prog.Bow')
progbowVar = StringVar(value='2')
progbowEntry = Entry(progbowFrame, textvariable=progbowVar, width=3, validate='all', vcmd=vcmd)
progbowFrame.pack()
progbowLabel.pack(anchor=W, side=LEFT, padx=(0,25))
progbowEntry.pack(anchor=E)
boomerangFrame = Frame(itemList1)
boomerangLabel = Label(boomerangFrame, text='Boomerang')
@ -921,7 +921,7 @@ def guiMain(args=None):
bcap5Frame = Frame(itemList3)
bcap5Label = Label(bcap5Frame, text='Bomb C.+5')
bcap5Var = StringVar(value='6')
bcap5Var = StringVar(value='0')
bcap5Entry = Entry(bcap5Frame, textvariable=bcap5Var, width=3, validate='all', vcmd=vcmd)
bcap5Frame.pack()
bcap5Label.pack(anchor=W, side=LEFT, padx=(0,16))
@ -929,7 +929,7 @@ def guiMain(args=None):
bcap10Frame = Frame(itemList3)
bcap10Label = Label(bcap10Frame, text='Bomb C.+10')
bcap10Var = StringVar(value='1')
bcap10Var = StringVar(value='0')
bcap10Entry = Entry(bcap10Frame, textvariable=bcap10Var, width=3, validate='all', vcmd=vcmd)
bcap10Frame.pack()
bcap10Label.pack(anchor=W, side=LEFT, padx=(0,10))
@ -937,7 +937,7 @@ def guiMain(args=None):
acap5Frame = Frame(itemList4)
acap5Label = Label(acap5Frame, text='Arrow C.+5')
acap5Var = StringVar(value='6')
acap5Var = StringVar(value='0')
acap5Entry = Entry(acap5Frame, textvariable=acap5Var, width=3, validate='all', vcmd=vcmd)
acap5Frame.pack()
acap5Label.pack(anchor=W, side=LEFT, padx=(0,7))
@ -945,7 +945,7 @@ def guiMain(args=None):
acap10Frame = Frame(itemList4)
acap10Label = Label(acap10Frame, text='Arrow C.+10')
acap10Var = StringVar(value='1')
acap10Var = StringVar(value='0')
acap10Entry = Entry(acap10Frame, textvariable=acap10Var, width=3, validate='all', vcmd=vcmd)
acap10Frame.pack()
acap10Label.pack(anchor=W, side=LEFT, padx=(0,1))
@ -961,7 +961,7 @@ def guiMain(args=None):
arrow10Frame = Frame(itemList4)
arrow10Label = Label(arrow10Frame, text='Arrows (10)')
arrow10Var = StringVar(value='5')
arrow10Var = StringVar(value='12')
arrow10Entry = Entry(arrow10Frame, textvariable=arrow10Var, width=3, validate='all', vcmd=vcmd)
arrow10Frame.pack()
arrow10Label.pack(anchor=W, side=LEFT, padx=(0,7))
@ -977,12 +977,20 @@ def guiMain(args=None):
bomb3Frame = Frame(itemList4)
bomb3Label = Label(bomb3Frame, text='Bombs (3)')
bomb3Var = StringVar(value='10')
bomb3Var = StringVar(value='16')
bomb3Entry = Entry(bomb3Frame, textvariable=bomb3Var, width=3, validate='all', vcmd=vcmd)
bomb3Frame.pack()
bomb3Label.pack(anchor=W, side=LEFT, padx=(0,13))
bomb3Entry.pack(anchor=E)
bomb10Frame = Frame(itemList4)
bomb10Label = Label(bomb10Frame, text='Bombs (10)')
bomb10Var = StringVar(value='1')
bomb10Entry = Entry(bomb10Frame, textvariable=bomb10Var, width=3, validate='all', vcmd=vcmd)
bomb10Frame.pack()
bomb10Label.pack(anchor=W, side=LEFT, padx=(0,7))
bomb10Entry.pack(anchor=E)
rupee1Frame = Frame(itemList4)
rupee1Label = Label(rupee1Frame, text='Rupee (1)')
rupee1Var = StringVar(value='2')
@ -1031,14 +1039,6 @@ def guiMain(args=None):
rupee300Label.pack(anchor=W, side=LEFT, padx=(0,0))
rupee300Entry.pack(anchor=E)
rupoorFrame = Frame(itemList4)
rupoorLabel = Label(rupoorFrame, text='Rupoor')
rupoorVar = StringVar(value='0')
rupoorEntry = Entry(rupoorFrame, textvariable=rupoorVar, width=3, validate='all', vcmd=vcmd)
rupoorFrame.pack()
rupoorLabel.pack(anchor=W, side=LEFT, padx=(0,28))
rupoorEntry.pack(anchor=E)
blueclockFrame = Frame(itemList4)
blueclockLabel = Label(blueclockFrame, text='Blue Clock')
blueclockVar = StringVar(value='0')
@ -1063,6 +1063,14 @@ def guiMain(args=None):
redclockLabel.pack(anchor=W, side=LEFT, padx=(0,14))
redclockEntry.pack(anchor=E)
silverarrowFrame = Frame(itemList5)
silverarrowLabel = Label(silverarrowFrame, text='Silver Arrow')
silverarrowVar = StringVar(value='0')
silverarrowEntry = Entry(silverarrowFrame, textvariable=silverarrowVar, width=3, validate='all', vcmd=vcmd)
silverarrowFrame.pack()
silverarrowLabel.pack(anchor=W, side=LEFT, padx=(0,64))
silverarrowEntry.pack(anchor=E)
universalkeyFrame = Frame(itemList5)
universalkeyLabel = Label(universalkeyFrame, text='Universal Key')
universalkeyVar = StringVar(value='0')
@ -1095,6 +1103,14 @@ def guiMain(args=None):
triforceLabel.pack(anchor=W, side=LEFT, padx=(0,23))
triforceEntry.pack(anchor=E)
rupoorFrame = Frame(itemList5)
rupoorLabel = Label(rupoorFrame, text='Rupoor')
rupoorVar = StringVar(value='0')
rupoorEntry = Entry(rupoorFrame, textvariable=rupoorVar, width=3, validate='all', vcmd=vcmd)
rupoorFrame.pack()
rupoorLabel.pack(anchor=W, side=LEFT, padx=(0,87))
rupoorEntry.pack(anchor=E)
rupoorcostFrame = Frame(itemList5)
rupoorcostLabel = Label(rupoorcostFrame, text='Rupoor Cost')
rupoorcostVar = StringVar(value='10')

View File

@ -178,7 +178,7 @@ def generate_itempool(world, player):
# set up item pool
if world.custom:
(pool, placed_items, precollected_items, clock_mode, treasure_hunt_count, treasure_hunt_icon, lamps_needed_for_dark_rooms) = make_custom_item_pool(world.progressive, world.shuffle, world.difficulty, world.timer, world.goal, world.mode, world.swords, world.retro, world.customitemarray)
world.rupoor_cost = min(world.customitemarray[67], 9999)
world.rupoor_cost = min(world.customitemarray[69], 9999)
else:
(pool, placed_items, precollected_items, clock_mode, treasure_hunt_count, treasure_hunt_icon, lamps_needed_for_dark_rooms) = get_pool_core(world.progressive, world.shuffle, world.difficulty, world.timer, world.goal, world.mode, world.swords, world.retro)
world.itempool += ItemFactory(pool, player)
@ -489,16 +489,16 @@ def make_custom_item_pool(progressive, shuffle, difficulty, timer, goal, mode, s
treasure_hunt_icon = None
# Correct for insanely oversized item counts and take initial steps to handle undersized pools.
for x in range(0, 64):
for x in range(0, 66):
if customitemarray[x] > total_items_to_place:
customitemarray[x] = total_items_to_place
if customitemarray[66] > total_items_to_place:
customitemarray[66] = total_items_to_place
if customitemarray[68] > total_items_to_place:
customitemarray[68] = total_items_to_place
itemtotal = 0
for x in range(0, 65):
for x in range(0, 66):
itemtotal = itemtotal + customitemarray[x]
itemtotal = itemtotal + customitemarray[66]
itemtotal = itemtotal + customitemarray[68]
itemtotal = itemtotal + customitemarray[70]
pool.extend(['Bow'] * customitemarray[0])
pool.extend(['Silver Arrows']* customitemarray[1])
@ -559,8 +559,10 @@ def make_custom_item_pool(progressive, shuffle, difficulty, timer, goal, mode, s
pool.extend(['Blue Clock'] * customitemarray[61])
pool.extend(['Green Clock'] * customitemarray[62])
pool.extend(['Red Clock'] * customitemarray[63])
pool.extend(['Triforce Piece'] * customitemarray[64])
pool.extend(['Triforce'] * customitemarray[66])
pool.extend(['Progressive Bow'] * customitemarray[64])
pool.extend(['Bombs (10)'] * customitemarray[65])
pool.extend(['Triforce Piece'] * customitemarray[66])
pool.extend(['Triforce'] * customitemarray[68])
diff = difficulties[difficulty]
@ -575,12 +577,12 @@ def make_custom_item_pool(progressive, shuffle, difficulty, timer, goal, mode, s
thisbottle = random.choice(diff.bottles)
pool.append(thisbottle)
if customitemarray[64] > 0 or customitemarray[65] > 0:
treasure_hunt_count = max(min(customitemarray[65], 99), 1) #To display, count must be between 1 and 99.
if customitemarray[66] > 0 or customitemarray[67] > 0:
treasure_hunt_count = max(min(customitemarray[67], 99), 1) #To display, count must be between 1 and 99.
treasure_hunt_icon = 'Triforce Piece'
# Ensure game is always possible to complete here, force sufficient pieces if the player is unwilling.
if (customitemarray[64] < treasure_hunt_count) and (goal == 'triforcehunt') and (customitemarray[66] == 0):
extrapieces = treasure_hunt_count - customitemarray[64]
if (customitemarray[66] < treasure_hunt_count) and (goal == 'triforcehunt') and (customitemarray[68] == 0):
extrapieces = treasure_hunt_count - customitemarray[66]
pool.extend(['Triforce Piece'] * extrapieces)
itemtotal = itemtotal + extrapieces
@ -599,11 +601,11 @@ def make_custom_item_pool(progressive, shuffle, difficulty, timer, goal, mode, s
if retro:
key_location = random.choice(['Secret Passage', 'Hyrule Castle - Boomerang Chest', 'Hyrule Castle - Map Chest', 'Hyrule Castle - Zelda\'s Chest', 'Sewers - Dark Cross'])
placed_items.append((key_location, 'Small Key (Universal)'))
pool.extend(['Small Key (Universal)'] * max((customitemarray[68] - 1), 0))
pool.extend(['Small Key (Universal)'] * max((customitemarray[70] - 1), 0))
else:
pool.extend(['Small Key (Universal)'] * customitemarray[68])
pool.extend(['Small Key (Universal)'] * customitemarray[70])
else:
pool.extend(['Small Key (Universal)'] * customitemarray[68])
pool.extend(['Small Key (Universal)'] * customitemarray[70])
pool.extend(['Fighter Sword'] * customitemarray[32])
pool.extend(['Progressive Sword'] * customitemarray[36])