LTTP Shop updates (#177)

* Shop price modifier and non-lttp item price changes

* Item price modifier setting
This commit is contained in:
Alchav 2022-01-02 21:07:43 -05:00 committed by GitHub
parent 27c528a6b3
commit 41fdafa3fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -91,6 +91,11 @@ class ShopItemSlots(Range):
range_start = 0
range_end = 30
class ShopPriceModifier(Range):
"""Percentage modifier for shuffled item prices in shops"""
range_start = 0
default = 100
range_end = 10000
class WorldState(Choice):
option_standard = 1
@ -306,6 +311,7 @@ alttp_options: typing.Dict[str, type(Option)] = {
"killable_thieves": KillableThieves,
"bush_shuffle": BushShuffle,
"shop_item_slots": ShopItemSlots,
"shop_price_modifier": ShopPriceModifier,
"tile_shuffle": TileShuffle,
"ow_palettes": OWPalette,
"uw_palettes": UWPalette,

View File

@ -247,7 +247,12 @@ def ShopSlotFill(world):
item_name = location.item.name
if location.item.game != "A Link to the Past":
price = world.random.randrange(1, 28)
if location.item.advancement:
price = world.random.randrange(8, 56)
elif location.item.never_exclude:
price = world.random.randrange(4, 28)
else:
price = world.random.randrange(2, 14)
elif any(x in item_name for x in
['Compass', 'Map', 'Single Bomb', 'Single Arrow', 'Piece of Heart']):
price = world.random.randrange(1, 7)
@ -258,7 +263,8 @@ def ShopSlotFill(world):
else:
price = world.random.randrange(8, 56)
shop.push_inventory(location.shop_slot, item_name, price * 5, 1,
shop.push_inventory(location.shop_slot, item_name,
min(int(price * 5 * world.shop_price_modifier[location.player] / 100), 9999), 1,
location.item.player if location.item.player != location.player else 0)
if 'P' in world.shop_shuffle[location.player]:
price_to_funny_price(shop.inventory[location.shop_slot], world, location.player)