diff --git a/Main.py b/Main.py index f19c75d9..fd086076 100644 --- a/Main.py +++ b/Main.py @@ -336,10 +336,29 @@ def main(args, seed=None, fish=None): for player in range(1, world.players+1): if world.shopsanity[player]: customize_shops(world, player) + if not args.skip_money_balance and args.algorithm in ['balanced', 'equitable']: balance_money_progression(world) ensure_good_items(world, True) + for player in range(1, world.players+1): + if args.orange_potion and world.difficulty[player] == "normal": + cap_shop = world.get_region('Capacity Upgrade', player).shop + potion = { + 'item': "Orange Potion", + 'price': 1000, + 'max': 0, + 'replacement': None, + 'replacement_price': 0, + 'create_location': False, + 'player': 0, + } + if cap_shop.inventory[0] is None: + cap_shop.inventory[0] = potion + else: + cap_shop.inventory.insert(1, potion) + + if args.print_custom_yaml: world.settings.record_info(world) world.settings.record_overworld(world) @@ -482,7 +501,7 @@ def export_yaml(args, fish): for player in range(1, world.players + 1): world.difficulty_requirements[player] = difficulties[world.difficulty[player]] - + set_starting_inventory(world, args) world.settings = CustomSettings() diff --git a/Rom.py b/Rom.py index 8a437707..eb1170e5 100644 --- a/Rom.py +++ b/Rom.py @@ -85,7 +85,7 @@ from Utils import int16_as_bytes, int32_as_bytes, local_path, snes_to_pc from Versions import DRVersion, GKVersion, ORVersion JAP10HASH = '03a63945398191337e896e5771f77173' -RANDOMIZERBASEHASH = 'c7ef3ff118c84ddd427ca4fa2461a47b' +RANDOMIZERBASEHASH = '94ff6d50db131aabe6b086e783709004' class JsonRom(object): @@ -2021,7 +2021,15 @@ def write_custom_shops(rom, world, player): if world.shopsanity[player] or shop.type == ShopType.TakeAny: rom.write_byte(0x186E40 + shop.sram_address + index, 1) if world.shopsanity[player] and shop.region.name in shop_to_location_table: - loc_item = world.get_location(shop_to_location_table[shop.region.name][index], player).item + if shop.region.name == "Capacity Upgrade" and shop.item_count == 3: + if index == 1: + loc_item = ItemFactory(item['item'], player) + else: + if index == 2: + index = 1 + loc_item = world.get_location(shop_to_location_table[shop.region.name][index], player).item + else: + loc_item = world.get_location(shop_to_location_table[shop.region.name][index], player).item elif world.shopsanity[player] and shop.region.name in retro_shops: loc_item = world.get_location(retro_shops[shop.region.name][index], player).item else: @@ -2037,7 +2045,7 @@ def write_custom_shops(rom, world, player): replace_price = int16_as_bytes(item['replacement_price']) item_max = item['max'] item_player = 0 if item['player'] == player else item['player'] - item_data = [shop_id, item_id] + price + [item_max, replace] + replace_price + [item_player] + item_data = [shop_id, item_id] + price + [item_max, replace] + replace_price + [item_player] items_data.extend(item_data) rom.write_bytes(0x184800, shop_data) diff --git a/resources/app/cli/args.json b/resources/app/cli/args.json index 0918413b..4df2a18f 100644 --- a/resources/app/cli/args.json +++ b/resources/app/cli/args.json @@ -759,6 +759,10 @@ "type": "str", "help": "suppress" }, + "orange_potion": { + "action": "store_true", + "help": "suppress" + }, "settingsonload": { "choices": [ "default",