Remove cap upgrades for hard/expert

Replace cap upgrades with red rupees in shopsanity
This commit is contained in:
aerinon
2021-06-02 13:28:33 -06:00
parent 63d49c5775
commit c81865b33f
2 changed files with 33 additions and 25 deletions

View File

@@ -303,7 +303,11 @@ def generate_itempool(world, player):
if shop.region.name in shop_to_location_table: if shop.region.name in shop_to_location_table:
for index, slot in enumerate(shop.inventory): for index, slot in enumerate(shop.inventory):
if slot: if slot:
pool.append(slot['item']) item = slot['item']
if shop.region.name == 'Capacity Upgrade' and world.difficulty[player] != 'normal':
pool.append('Rupees (20)')
else:
pool.append(item)
items = ItemFactory(pool, player) items = ItemFactory(pool, player)
if world.shopsanity[player]: if world.shopsanity[player]:
@@ -556,6 +560,7 @@ def customize_shops(world, player):
shopkeeper = random.choice([0xC1, 0xA0, 0xE2, 0xE3]) shopkeeper = random.choice([0xC1, 0xA0, 0xE2, 0xE3])
shop.shopkeeper_config = shopkeeper shop.shopkeeper_config = shopkeeper
# handle capacity upgrades - randomly choose a bomb bunch or arrow bunch to become capacity upgrades # handle capacity upgrades - randomly choose a bomb bunch or arrow bunch to become capacity upgrades
if world.difficulty[player] == 'normal':
if not found_bomb_upgrade and len(possible_replacements) > 0: if not found_bomb_upgrade and len(possible_replacements) > 0:
choices = [] choices = []
for shop, idx, loc, item in possible_replacements: for shop, idx, loc, item in possible_replacements:

3
Rom.py
View File

@@ -1600,6 +1600,9 @@ def write_custom_shops(rom, world, player):
loc_item = world.get_location(retro_shops[shop.region.name][index], player).item loc_item = world.get_location(retro_shops[shop.region.name][index], player).item
else: else:
loc_item = ItemFactory(item['item'], player) loc_item = ItemFactory(item['item'], player)
if (not world.shopsanity[player] and shop.region.name == 'Capacity Upgrade'
and world.difficulty[player] != 'normal'):
continue # skip cap upgrades except in normal/shopsanity
item_id = loc_item.code item_id = loc_item.code
price = int16_as_bytes(item['price']) price = int16_as_bytes(item['price'])
replace = ItemFactory(item['replacement'], player).code if item['replacement'] else 0xFF replace = ItemFactory(item['replacement'], player).code if item['replacement'] else 0xFF