Shopsanity multiworld and rupee progression balancing
This commit is contained in:
156
Fill.py
156
Fill.py
@@ -2,7 +2,8 @@ import random
|
||||
import logging
|
||||
|
||||
from BaseClasses import CollectionState
|
||||
from Regions import shop_to_location_table, retro_shops
|
||||
from Items import ItemFactory
|
||||
from Regions import shop_to_location_table
|
||||
|
||||
|
||||
class FillError(RuntimeError):
|
||||
@@ -382,8 +383,6 @@ def sell_potions(world, player):
|
||||
# potions are excluded from the cap fairy due to visual problem
|
||||
if shop.region.name in shop_to_location_table and shop.region.name != 'Capacity Upgrade':
|
||||
loc_choices += [world.get_location(loc, player) for loc in shop_to_location_table[shop.region.name]]
|
||||
if world.retro[player] and shop.region.name in retro_shops:
|
||||
loc_choices += [world.get_location(loc, player) for loc in retro_shops[shop.region.name]]
|
||||
locations = [loc for loc in loc_choices if not loc.item]
|
||||
for potion in ['Green Potion', 'Blue Potion', 'Red Potion']:
|
||||
location = random.choice(locations)
|
||||
@@ -502,3 +501,154 @@ def balance_multiworld_progression(world):
|
||||
break
|
||||
elif not sphere_locations:
|
||||
raise RuntimeError('Not all required items reachable. Something went terribly wrong here.')
|
||||
|
||||
|
||||
def balance_money_progression(world):
|
||||
logger = logging.getLogger('')
|
||||
state = CollectionState(world)
|
||||
unchecked_locations = world.get_locations().copy()
|
||||
wallet = {player: 0 for player in range(1, world.players+1)}
|
||||
kiki_check = {player: False for player in range(1, world.players+1)}
|
||||
kiki_paid = {player: False for player in range(1, world.players+1)}
|
||||
rooms_visited = {player: set() for player in range(1, world.players+1)}
|
||||
balance_locations = {player: set() for player in range(1, world.players+1)}
|
||||
|
||||
pay_for_locations = {'Bottle Merchant': 100, 'Chest Game': 30, 'Digging Game': 80,
|
||||
'King Zora': 500, 'Blacksmith': 10}
|
||||
rupee_chart = {'Rupee (1)': 1, 'Rupees (5)': 5, 'Rupees (20)': 20, 'Rupees (50)': 50,
|
||||
'Rupees (100)': 100, 'Rupees (300)': 300}
|
||||
rupee_rooms = {'Eastern Rupees': 90, 'Mire Key Rupees': 45, 'Mire Shooter Rupees': 90,
|
||||
'TR Rupees': 270, 'PoD Dark Basement': 270}
|
||||
acceptable_balancers = ['Bombs (3)', 'Arrows (10)', 'Bombs (10)']
|
||||
|
||||
def get_sphere_locations(sphere_state, locations):
|
||||
sphere_state.sweep_for_events(key_only=True, locations=locations)
|
||||
return [loc for loc in locations if sphere_state.can_reach(loc) and sphere_state.not_flooding_a_key(sphere_state.world, loc)]
|
||||
|
||||
def interesting_item(location, item, world, player):
|
||||
if item.advancement:
|
||||
return True
|
||||
if item.type is not None or item.name.startswith('Rupee'):
|
||||
return True
|
||||
if item.name in ['Progressive Armor', 'Blue Mail', 'Red Mail']:
|
||||
return True
|
||||
if world.retro[player] and (item.name in ['Single Arrow', 'Small Key (Universal)']):
|
||||
return True
|
||||
if location.name in pay_for_locations:
|
||||
return True
|
||||
return False
|
||||
|
||||
def kiki_required(state, location):
|
||||
path = state.path[location.parent_region]
|
||||
if path:
|
||||
while path[1]:
|
||||
if path[0] == 'Palace of Darkness':
|
||||
return True
|
||||
path = path[1]
|
||||
return False
|
||||
|
||||
done = False
|
||||
while not done:
|
||||
sphere_costs = {player: 0 for player in range(1, world.players+1)}
|
||||
locked_by_money = {player: set() for player in range(1, world.players+1)}
|
||||
sphere_locations = get_sphere_locations(state, unchecked_locations)
|
||||
checked_locations = []
|
||||
for player in range(1, world.players+1):
|
||||
if not kiki_check[player]:
|
||||
kiki_payable = state.prog_items[('Moon Pearl', player)] > 0 or world.mode[player] == 'inverted'
|
||||
if kiki_payable and world.get_region('East Dark World', player) in state.reachable_regions[player]:
|
||||
if not kiki_paid[player]:
|
||||
kiki_check[player] = True
|
||||
sphere_costs[player] += 110
|
||||
locked_by_money[player].add('Kiki')
|
||||
for location in sphere_locations:
|
||||
location_free, loc_player = True, location.player
|
||||
if location.parent_region.name in shop_to_location_table and location.name != 'Potion Shop':
|
||||
slot = shop_to_location_table[location.parent_region.name].index(location.name)
|
||||
shop = location.parent_region.shop
|
||||
shop_item = shop.inventory[slot]
|
||||
sphere_costs[loc_player] += shop_item['price']
|
||||
location_free = False
|
||||
locked_by_money[loc_player].add(location)
|
||||
elif location.name in pay_for_locations:
|
||||
sphere_costs[loc_player] += pay_for_locations[location.name]
|
||||
location_free = False
|
||||
locked_by_money[loc_player].add(location)
|
||||
if kiki_check[loc_player] and not kiki_paid[loc_player] and kiki_required(state, location):
|
||||
locked_by_money[loc_player].add(location)
|
||||
location_free = False
|
||||
if location_free:
|
||||
state.collect(location.item, True, location)
|
||||
unchecked_locations.remove(location)
|
||||
if location.item.name.startswith('Rupee'):
|
||||
wallet[location.item.player] += rupee_chart[location.item.name]
|
||||
if location.item.name != 'Rupees (300)':
|
||||
balance_locations[location.item.player].add(location)
|
||||
if interesting_item(location, location.item, world, location.item.player):
|
||||
checked_locations.append(location)
|
||||
elif location.item.name in acceptable_balancers:
|
||||
balance_locations[location.item.player].add(location)
|
||||
for room, income in rupee_rooms.items():
|
||||
for player in range(1, world.players+1):
|
||||
if room not in rooms_visited[player] and world.get_region(room, player) in state.reachable_regions[player]:
|
||||
wallet[player] += income
|
||||
rooms_visited[player].add(room)
|
||||
if checked_locations:
|
||||
if world.has_beaten_game(state):
|
||||
done = True
|
||||
continue
|
||||
# else go to next sphere
|
||||
else:
|
||||
# check for solvent players
|
||||
solvent = set()
|
||||
insolvent = set()
|
||||
for player in range(1, world.players+1):
|
||||
if wallet[player] >= sphere_costs[player] > 0:
|
||||
solvent.add(player)
|
||||
if sphere_costs[player] > 0 and sphere_costs[player] > wallet[player]:
|
||||
insolvent.add(player)
|
||||
if len(solvent) == 0:
|
||||
target_player = min(insolvent, key=lambda p: sphere_costs[p]-wallet[p])
|
||||
difference = sphere_costs[target_player]-wallet[target_player]
|
||||
logger.debug(f'Money balancing needed: Player {target_player} short {difference}')
|
||||
while difference > 0:
|
||||
swap_targets = [x for x in unchecked_locations if x not in sphere_locations and x.item.name.startswith('Rupees') and x.item.player == target_player]
|
||||
if len(swap_targets) == 0:
|
||||
best_swap, best_value = None, 300
|
||||
else:
|
||||
best_swap = max(swap_targets, key=lambda t: rupee_chart[t.item.name])
|
||||
best_value = rupee_chart[best_swap.item.name]
|
||||
increase_targets = [x for x in balance_locations[target_player] if x.item.name in rupee_chart and rupee_chart[x.item.name] < best_value]
|
||||
if len(increase_targets) == 0:
|
||||
increase_targets = [x for x in balance_locations[target_player] if (rupee_chart[x.item.name] if x.item.name in rupee_chart else 0) < best_value]
|
||||
if len(increase_targets) == 0:
|
||||
raise Exception('No early sphere swaps for rupees - money grind would be required - bailing for now')
|
||||
best_target = min(increase_targets, key=lambda t: rupee_chart[t.item.name] if t.item.name in rupee_chart else 0)
|
||||
old_value = rupee_chart[best_target.item.name] if best_target.item.name in rupee_chart else 0
|
||||
if best_swap is None:
|
||||
logger.debug(f'Upgrading {best_target.item.name} @ {best_target.name} for 300 Rupees')
|
||||
best_target.item = ItemFactory('Rupees (300)', best_target.item.player)
|
||||
best_target.item.location = best_target
|
||||
else:
|
||||
old_item = best_target.item
|
||||
logger.debug(f'Swapping {best_target.item.name} @ {best_target.name} for {best_swap.item.name} @ {best_swap.name}')
|
||||
best_target.item = best_swap.item
|
||||
best_target.item.location = best_target
|
||||
best_swap.item = old_item
|
||||
best_swap.item.location = best_swap
|
||||
increase = best_value - old_value
|
||||
difference -= increase
|
||||
wallet[target_player] += increase
|
||||
solvent.add(player)
|
||||
# apply solvency
|
||||
for player in solvent:
|
||||
wallet[player] -= sphere_costs[player]
|
||||
sphere_costs[player] = 0
|
||||
for location in locked_by_money[player]:
|
||||
if location == 'Kiki':
|
||||
kiki_paid[player] = True
|
||||
else:
|
||||
state.collect(location.item, True, location)
|
||||
unchecked_locations.remove(location)
|
||||
if location.item.name.startswith('Rupee'):
|
||||
wallet[location.item.player] += rupee_chart[location.item.name]
|
||||
|
||||
17
ItemList.py
17
ItemList.py
@@ -7,7 +7,7 @@ from BaseClasses import Region, RegionType, Shop, ShopType, Location
|
||||
from Bosses import place_bosses
|
||||
from Dungeons import get_dungeon_item_pool
|
||||
from EntranceShuffle import connect_entrance
|
||||
from Regions import shop_to_location_table, retro_shops
|
||||
from Regions import shop_to_location_table, retro_shops, shop_table_by_location
|
||||
from Fill import FillError, fill_restrictive
|
||||
from Items import ItemFactory
|
||||
|
||||
@@ -437,7 +437,10 @@ def create_dynamic_shop_locations(world, player):
|
||||
if item is None:
|
||||
continue
|
||||
if item['create_location']:
|
||||
loc = Location(player, "{} Item {}".format(shop.region.name, i+1), parent=shop.region)
|
||||
slot_name = "{} Item {}".format(shop.region.name, i+1)
|
||||
address = shop_table_by_location[slot_name] if world.shopsanity[player] else None
|
||||
loc = Location(player, slot_name, address=address,
|
||||
parent=shop.region, hint_text='in an old-fashioned cave')
|
||||
shop.region.locations.append(loc)
|
||||
world.dynamic_locations.append(loc)
|
||||
|
||||
@@ -483,16 +486,18 @@ def set_up_shops(world, player):
|
||||
removals = [next(item for item in world.itempool if item.name == 'Arrows (10)' and item.player == player)]
|
||||
red_pots = [item for item in world.itempool if item.name == 'Red Potion' and item.player == player][:5]
|
||||
shields_n_hearts = [item for item in world.itempool if item.name in ['Blue Shield', 'Small Heart'] and item.player == player]
|
||||
removals.extend([item for item in world.itempool if item.name == 'Arrow Upgrade (+5)' and item.player == player])
|
||||
removals.extend(red_pots)
|
||||
removals.extend(random.sample(shields_n_hearts, 5))
|
||||
for remove in removals:
|
||||
world.itempool.remove(remove)
|
||||
for i in range(6):
|
||||
for i in range(6): # replace the Arrows (10) and randomly selected hearts/blue shield
|
||||
arrow_item = ItemFactory('Single Arrow', player)
|
||||
arrow_item.advancement = True
|
||||
world.itempool.append(arrow_item)
|
||||
for i in range(5):
|
||||
for i in range(5): # replace the red potions
|
||||
world.itempool.append(ItemFactory('Small Key (Universal)', player))
|
||||
world.itempool.append(ItemFactory('Rupees (50)', player)) # replaces the arrow upgrade
|
||||
# TODO: move hard+ mode changes for shields here, utilizing the new shops
|
||||
else:
|
||||
rss = world.get_region('Red Shield Shop', player).shop
|
||||
@@ -509,7 +514,7 @@ def set_up_shops(world, player):
|
||||
|
||||
|
||||
def customize_shops(world, player):
|
||||
found_bomb_upgrade, found_arrow_upgrade = False, False
|
||||
found_bomb_upgrade, found_arrow_upgrade = False, world.retro[player]
|
||||
possible_replacements = []
|
||||
shops_to_customize = shop_to_location_table.copy()
|
||||
if world.retro[player]:
|
||||
@@ -584,7 +589,7 @@ def randomize_price(price):
|
||||
if price <= 10:
|
||||
return price
|
||||
else:
|
||||
half_price = int(math.ceil(half_price / 10.0)) * 10
|
||||
half_price = int(math.ceil(half_price / 5.0)) * 5
|
||||
max_price = price - half_price
|
||||
max_price //= 5
|
||||
return random.randint(0, max_price) * 5 + half_price
|
||||
|
||||
30
Items.py
30
Items.py
@@ -24,25 +24,25 @@ def ItemFactory(items, player):
|
||||
|
||||
# Format: Name: (Advancement, Priority, Type, ItemCode, Pedestal Hint Text, Pedestal Credit Text, Sick Kid Credit Text, Zora Credit Text, Witch Credit Text, Flute Boy Credit Text, Hint Text)
|
||||
item_table = {'Bow': (True, False, None, 0x0B, 200, 'You have\nchosen the\narcher class.', 'the stick and twine', 'arrow-slinging kid', 'arrow sling for sale', 'witch and robin hood', 'archer boy shoots again', 'the Bow'),
|
||||
'Progressive Bow': (True, False, None, 0x64, 100, 'You have\nchosen the\narcher class.', 'the stick and twine', 'arrow-slinging kid', 'arrow sling for sale', 'witch and robin hood', 'archer boy shoots again', 'a Bow'),
|
||||
'Progressive Bow (Alt)': (True, False, None, 0x65, 100, 'You have\nchosen the\narcher class.', 'the stick and twine', 'arrow-slinging kid', 'arrow sling for sale', 'witch and robin hood', 'archer boy shoots again', 'a Bow'),
|
||||
'Book of Mudora': (True, False, None, 0x1D, 100, 'This is a\nparadox?!', 'and the story book', 'the scholarly kid', 'moon runes for sale', 'drugs for literacy', 'book-worm boy can read again', 'the Book'),
|
||||
'Hammer': (True, False, None, 0x09, 200, 'stop\nhammer time!', 'and m c hammer', 'hammer-smashing kid', 'm c hammer for sale', 'stop... hammer time', 'stop, hammer time', 'the hammer'),
|
||||
'Hookshot': (True, False, None, 0x0A, 200, 'BOING!!!\nBOING!!!\nBOING!!!', 'and the tickle beam', 'tickle-monster kid', 'tickle beam for sale', 'witch and tickle boy', 'beam boy tickles again', 'the Hookshot'),
|
||||
'Magic Mirror': (True, False, None, 0x1A, 200, 'Isn\'t your\nreflection so\npretty?', 'the face reflector', 'the narcissistic kid', 'your face for sale', 'trades looking-glass', 'narcissistic boy is happy again', 'the Mirror'),
|
||||
'Ocarina': (True, False, None, 0x14, 200, 'Save the duck\nand fly to\nfreedom!', 'and the duck call', 'the duck-call kid', 'duck call for sale', 'duck-calls for trade', 'ocarina boy plays again', 'the Flute'),
|
||||
'Pegasus Boots': (True, False, None, 0x4B, 200, 'Gotta go fast!', 'and the sprint shoes', 'the running-man kid', 'sprint shoe for sale', 'shrooms for speed', 'gotta-go-fast boy runs again', 'the Boots'),
|
||||
'Progressive Bow': (True, False, None, 0x64, 150, 'You have\nchosen the\narcher class.', 'the stick and twine', 'arrow-slinging kid', 'arrow sling for sale', 'witch and robin hood', 'archer boy shoots again', 'a Bow'),
|
||||
'Progressive Bow (Alt)': (True, False, None, 0x65, 150, 'You have\nchosen the\narcher class.', 'the stick and twine', 'arrow-slinging kid', 'arrow sling for sale', 'witch and robin hood', 'archer boy shoots again', 'a Bow'),
|
||||
'Book of Mudora': (True, False, None, 0x1D, 150, 'This is a\nparadox?!', 'and the story book', 'the scholarly kid', 'moon runes for sale', 'drugs for literacy', 'book-worm boy can read again', 'the Book'),
|
||||
'Hammer': (True, False, None, 0x09, 250, 'stop\nhammer time!', 'and m c hammer', 'hammer-smashing kid', 'm c hammer for sale', 'stop... hammer time', 'stop, hammer time', 'the hammer'),
|
||||
'Hookshot': (True, False, None, 0x0A, 250, 'BOING!!!\nBOING!!!\nBOING!!!', 'and the tickle beam', 'tickle-monster kid', 'tickle beam for sale', 'witch and tickle boy', 'beam boy tickles again', 'the Hookshot'),
|
||||
'Magic Mirror': (True, False, None, 0x1A, 250, 'Isn\'t your\nreflection so\npretty?', 'the face reflector', 'the narcissistic kid', 'your face for sale', 'trades looking-glass', 'narcissistic boy is happy again', 'the Mirror'),
|
||||
'Ocarina': (True, False, None, 0x14, 250, 'Save the duck\nand fly to\nfreedom!', 'and the duck call', 'the duck-call kid', 'duck call for sale', 'duck-calls for trade', 'ocarina boy plays again', 'the Flute'),
|
||||
'Pegasus Boots': (True, False, None, 0x4B, 250, 'Gotta go fast!', 'and the sprint shoes', 'the running-man kid', 'sprint shoe for sale', 'shrooms for speed', 'gotta-go-fast boy runs again', 'the Boots'),
|
||||
'Power Glove': (True, False, None, 0x1B, 100, 'Now you can\nlift weak\nstuff!', 'and the grey mittens', 'body-building kid', 'lift glove for sale', 'fungus for gloves', 'body-building boy lifts again', 'the glove'),
|
||||
'Cape': (True, False, None, 0x19, 50, 'Wear this to\nbecome\ninvisible!', 'the camouflage cape', 'red riding-hood kid', 'red hood for sale', 'hood from a hood', 'dapper boy hides again', 'the cape'),
|
||||
'Mushroom': (True, False, None, 0x29, 50, 'I\'m a fun guy!\n\nI\'m a funghi!', 'and the legal drugs', 'the drug-dealing kid', 'legal drugs for sale', 'shroom swap', 'shroom boy sells drugs again', 'the mushroom'),
|
||||
'Shovel': (True, False, None, 0x13, 50, 'Can\n You\n Dig it?', 'and the spade', 'archaeologist kid', 'dirt spade for sale', 'can you dig it', 'shovel boy digs again', 'the shovel'),
|
||||
'Lamp': (True, False, None, 0x12, 100, 'Baby, baby,\nbaby.\nLight my way!', 'and the flashlight', 'light-shining kid', 'flashlight for sale', 'fungus for illumination', 'illuminated boy can see again', 'the lamp'),
|
||||
'Lamp': (True, False, None, 0x12, 150, 'Baby, baby,\nbaby.\nLight my way!', 'and the flashlight', 'light-shining kid', 'flashlight for sale', 'fungus for illumination', 'illuminated boy can see again', 'the lamp'),
|
||||
'Magic Powder': (True, False, None, 0x0D, 50, 'you can turn\nanti-faeries\ninto faeries', 'and the magic sack', 'the sack-holding kid', 'magic sack for sale', 'the witch and assistant', 'magic boy plays marbles again', 'the powder'),
|
||||
'Moon Pearl': (True, False, None, 0x1F, 200, ' Bunny Link\n be\n gone!', 'and the jaw breaker', 'fortune-telling kid', 'lunar orb for sale', 'shrooms for moon rock', 'moon boy plays ball again', 'the moon pearl'),
|
||||
'Cane of Somaria': (True, False, None, 0x15, 200, 'I make blocks\nto hold down\nswitches!', 'and the red blocks', 'the block-making kid', 'block stick for sale', 'block stick for trade', 'cane boy makes blocks again', 'the red cane'),
|
||||
'Fire Rod': (True, False, None, 0x07, 200, 'I\'m the hot\nrod. I make\nthings burn!', 'and the flamethrower', 'fire-starting kid', 'rage rod for sale', 'fungus for rage-rod', 'firestarter boy burns again', 'the fire rod'),
|
||||
'Flippers': (True, False, None, 0x1E, 200, 'fancy a swim?', 'and the toewebs', 'the swimming kid', 'finger webs for sale', 'shrooms let you swim', 'swimming boy swims again', 'the flippers'),
|
||||
'Ice Rod': (True, False, None, 0x08, 200, 'I\'m the cold\nrod. I make\nthings freeze!', 'and the freeze ray', 'the ice-bending kid', 'freeze ray for sale', 'fungus for ice-rod', 'ice-cube boy freezes again', 'the ice rod'),
|
||||
'Cane of Somaria': (True, False, None, 0x15, 250, 'I make blocks\nto hold down\nswitches!', 'and the red blocks', 'the block-making kid', 'block stick for sale', 'block stick for trade', 'cane boy makes blocks again', 'the red cane'),
|
||||
'Fire Rod': (True, False, None, 0x07, 250, 'I\'m the hot\nrod. I make\nthings burn!', 'and the flamethrower', 'fire-starting kid', 'rage rod for sale', 'fungus for rage-rod', 'firestarter boy burns again', 'the fire rod'),
|
||||
'Flippers': (True, False, None, 0x1E, 250, 'fancy a swim?', 'and the toewebs', 'the swimming kid', 'finger webs for sale', 'shrooms let you swim', 'swimming boy swims again', 'the flippers'),
|
||||
'Ice Rod': (True, False, None, 0x08, 250, 'I\'m the cold\nrod. I make\nthings freeze!', 'and the freeze ray', 'the ice-bending kid', 'freeze ray for sale', 'fungus for ice-rod', 'ice-cube boy freezes again', 'the ice rod'),
|
||||
'Titans Mitts': (True, False, None, 0x1C, 200, 'Now you can\nlift heavy\nstuff!', 'and the golden glove', 'body-building kid', 'carry glove for sale', 'fungus for bling-gloves', 'body-building boy has gold again', 'the mitts'),
|
||||
'Bombos': (True, False, None, 0x0F, 100, 'Burn, baby,\nburn! Fear my\nring of fire!', 'and the swirly coin', 'coin-collecting kid', 'swirly coin for sale', 'shrooms for swirly-coin', 'medallion boy melts room again', 'Bombos'),
|
||||
'Ether': (True, False, None, 0x10, 100, 'This magic\ncoin freezes\neverything!', 'and the bolt coin', 'coin-collecting kid', 'bolt coin for sale', 'shrooms for bolt-coin', 'medallion boy sees floor again', 'Ether'),
|
||||
@@ -58,8 +58,8 @@ item_table = {'Bow': (True, False, None, 0x0B, 200, 'You have\nchosen the\narche
|
||||
'Tempered Sword': (True, False, 'Sword', 0x02, 150, 'I stole the\nblacksmith\'s\njob!', 'the tempered sword', 'sword-wielding kid', 'flame sword for sale', 'fungus for red slasher', 'sword boy fights again', 'the Tempered Sword'),
|
||||
'Fighter Sword': (True, False, 'Sword', 0x49, 50, 'A pathetic\nsword rests\nhere!', 'the tiny sword', 'sword-wielding kid', 'tiny sword for sale', 'fungus for tiny slasher', 'sword boy fights again', 'the small sword'),
|
||||
'Golden Sword': (True, False, 'Sword', 0x03, 200, 'The butter\nsword rests\nhere!', 'and the butter sword', 'sword-wielding kid', 'butter for sale', 'cap churned to butter', 'sword boy fights again', 'the Golden Sword'),
|
||||
'Progressive Sword': (True, False, 'Sword', 0x5E, 100, 'a better copy\nof your sword\nfor your time', 'the unknown sword', 'sword-wielding kid', 'sword for sale', 'fungus for some slasher', 'sword boy fights again', 'a sword'),
|
||||
'Progressive Glove': (True, False, None, 0x61, 100, 'a way to lift\nheavier things', 'and the lift upgrade', 'body-building kid', 'some glove for sale', 'fungus for gloves', 'body-building boy lifts again', 'a glove'),
|
||||
'Progressive Sword': (True, False, 'Sword', 0x5E, 150, 'a better copy\nof your sword\nfor your time', 'the unknown sword', 'sword-wielding kid', 'sword for sale', 'fungus for some slasher', 'sword boy fights again', 'a sword'),
|
||||
'Progressive Glove': (True, False, None, 0x61, 150, 'a way to lift\nheavier things', 'and the lift upgrade', 'body-building kid', 'some glove for sale', 'fungus for gloves', 'body-building boy lifts again', 'a glove'),
|
||||
'Silver Arrows': (True, False, None, 0x58, 100, 'Do you fancy\nsilver tipped\narrows?', 'and the ganonsbane', 'ganon-killing kid', 'ganon doom for sale', 'fungus for pork', 'archer boy shines again', 'the silver arrows'),
|
||||
'Green Pendant': (True, False, 'Crystal', [0x04, 0x38, 0x62, 0x00, 0x69, 0x01], 999, None, None, None, None, None, None, None),
|
||||
'Blue Pendant': (True, False, 'Crystal', [0x02, 0x34, 0x60, 0x00, 0x69, 0x02], 999, None, None, None, None, None, None, None),
|
||||
|
||||
3
Main.py
3
Main.py
@@ -22,7 +22,7 @@ from RoomData import create_rooms
|
||||
from Rules import set_rules
|
||||
from Dungeons import create_dungeons, fill_dungeons, fill_dungeons_restrictive
|
||||
from Fill import distribute_items_cutoff, distribute_items_staleness, distribute_items_restrictive, flood_items
|
||||
from Fill import sell_potions, sell_keys, balance_multiworld_progression
|
||||
from Fill import sell_potions, sell_keys, balance_multiworld_progression, balance_money_progression
|
||||
from ItemList import generate_itempool, difficulties, fill_prizes, customize_shops
|
||||
from Utils import output_path, parse_player_names
|
||||
|
||||
@@ -216,6 +216,7 @@ def main(args, seed=None, fish=None):
|
||||
for player in range(1, world.players+1):
|
||||
if world.shopsanity[player]:
|
||||
customize_shops(world, player)
|
||||
balance_money_progression(world)
|
||||
|
||||
outfilebase = 'DR_%s' % (args.outputname if args.outputname else world.seed)
|
||||
|
||||
|
||||
@@ -902,6 +902,13 @@ def adjust_locations(world, player):
|
||||
dungeon.small_keys.append(key_item)
|
||||
elif key_item.bigkey:
|
||||
dungeon.big_key = key_item
|
||||
if world.shopsanity[player]:
|
||||
index = 0
|
||||
for shop, location_list in shop_to_location_table.items():
|
||||
for location in location_list:
|
||||
world.get_location(location, player).address = 0x400000 + index
|
||||
# player address? it is in the shop table
|
||||
index += 1
|
||||
|
||||
|
||||
# (type, room_id, shopkeeper, custom, locked, [items])
|
||||
|
||||
4
Rom.py
4
Rom.py
@@ -27,7 +27,7 @@ from EntranceShuffle import door_addresses, exit_ids
|
||||
|
||||
|
||||
JAP10HASH = '03a63945398191337e896e5771f77173'
|
||||
RANDOMIZERBASEHASH = 'bffd4e834049ca5f5295601436fc6009'
|
||||
RANDOMIZERBASEHASH = '05128f2ed347479abb5f3149463bb06d'
|
||||
|
||||
|
||||
class JsonRom(object):
|
||||
@@ -535,7 +535,7 @@ def patch_rom(world, rom, player, team, enemized):
|
||||
|
||||
itemid = location.item.code if location.item is not None else 0x5A
|
||||
|
||||
if location.address is None:
|
||||
if location.address is None or (type(location.address) is int and location.address >= 0x400000):
|
||||
continue
|
||||
|
||||
if not location.crystal:
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user