Orange potion flag
This commit is contained in:
21
Main.py
21
Main.py
@@ -336,10 +336,29 @@ def main(args, seed=None, fish=None):
|
|||||||
for player in range(1, world.players+1):
|
for player in range(1, world.players+1):
|
||||||
if world.shopsanity[player]:
|
if world.shopsanity[player]:
|
||||||
customize_shops(world, player)
|
customize_shops(world, player)
|
||||||
|
|
||||||
if not args.skip_money_balance and args.algorithm in ['balanced', 'equitable']:
|
if not args.skip_money_balance and args.algorithm in ['balanced', 'equitable']:
|
||||||
balance_money_progression(world)
|
balance_money_progression(world)
|
||||||
ensure_good_items(world, True)
|
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:
|
if args.print_custom_yaml:
|
||||||
world.settings.record_info(world)
|
world.settings.record_info(world)
|
||||||
world.settings.record_overworld(world)
|
world.settings.record_overworld(world)
|
||||||
@@ -482,7 +501,7 @@ def export_yaml(args, fish):
|
|||||||
|
|
||||||
for player in range(1, world.players + 1):
|
for player in range(1, world.players + 1):
|
||||||
world.difficulty_requirements[player] = difficulties[world.difficulty[player]]
|
world.difficulty_requirements[player] = difficulties[world.difficulty[player]]
|
||||||
|
|
||||||
set_starting_inventory(world, args)
|
set_starting_inventory(world, args)
|
||||||
|
|
||||||
world.settings = CustomSettings()
|
world.settings = CustomSettings()
|
||||||
|
|||||||
14
Rom.py
14
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
|
from Versions import DRVersion, GKVersion, ORVersion
|
||||||
|
|
||||||
JAP10HASH = '03a63945398191337e896e5771f77173'
|
JAP10HASH = '03a63945398191337e896e5771f77173'
|
||||||
RANDOMIZERBASEHASH = 'c7ef3ff118c84ddd427ca4fa2461a47b'
|
RANDOMIZERBASEHASH = '94ff6d50db131aabe6b086e783709004'
|
||||||
|
|
||||||
|
|
||||||
class JsonRom(object):
|
class JsonRom(object):
|
||||||
@@ -2021,7 +2021,15 @@ def write_custom_shops(rom, world, player):
|
|||||||
if world.shopsanity[player] or shop.type == ShopType.TakeAny:
|
if world.shopsanity[player] or shop.type == ShopType.TakeAny:
|
||||||
rom.write_byte(0x186E40 + shop.sram_address + index, 1)
|
rom.write_byte(0x186E40 + shop.sram_address + index, 1)
|
||||||
if world.shopsanity[player] and shop.region.name in shop_to_location_table:
|
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:
|
elif world.shopsanity[player] and shop.region.name in retro_shops:
|
||||||
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:
|
||||||
@@ -2037,7 +2045,7 @@ def write_custom_shops(rom, world, player):
|
|||||||
replace_price = int16_as_bytes(item['replacement_price'])
|
replace_price = int16_as_bytes(item['replacement_price'])
|
||||||
item_max = item['max']
|
item_max = item['max']
|
||||||
item_player = 0 if item['player'] == player else item['player']
|
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)
|
items_data.extend(item_data)
|
||||||
|
|
||||||
rom.write_bytes(0x184800, shop_data)
|
rom.write_bytes(0x184800, shop_data)
|
||||||
|
|||||||
@@ -759,6 +759,10 @@
|
|||||||
"type": "str",
|
"type": "str",
|
||||||
"help": "suppress"
|
"help": "suppress"
|
||||||
},
|
},
|
||||||
|
"orange_potion": {
|
||||||
|
"action": "store_true",
|
||||||
|
"help": "suppress"
|
||||||
|
},
|
||||||
"settingsonload": {
|
"settingsonload": {
|
||||||
"choices": [
|
"choices": [
|
||||||
"default",
|
"default",
|
||||||
|
|||||||
Reference in New Issue
Block a user