Skip to content

Commit

Permalink
OoS: Added a "shopPriceFactor" option
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinopony committed Mar 7, 2024
1 parent 4f25217 commit 81bd77e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
14 changes: 14 additions & 0 deletions worlds/tloz_oos/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,19 @@ class OracleOfSeasonsRingQuality(Choice):
default = 1


class OracleOfSeasonsPricesFactor(Range):
"""
A factor (expressed as percentage) that will be applied to all prices inside all shops in the game.
- Setting it at 10% will make all items almost free
- Setting it at 300% will make all items horrendously expensive, use at your own risk!
"""
display_name = "Prices Factor (%)"

range_start = 10
range_end = 300
default = 100


class OracleOfSeasonsAdvanceShop(Toggle):
"""
In the vanilla game, there is a house northwest of Horon Village hosting the secret "Advance Shop" that can only
Expand Down Expand Up @@ -271,6 +284,7 @@ class OracleOfSeasonsOptions(PerGameCommonOptions):
golden_beasts_requirement: OraclesOfSeasonsGoldenBeastsRequirement
lost_woods_item_sequence: OracleOfSeasonsLostWoodsItemSequence
ring_quality: OracleOfSeasonsRingQuality
shop_prices_factor: OracleOfSeasonsPricesFactor
advance_shop: OracleOfSeasonsAdvanceShop
fools_ore: OracleOfSeasonsFoolsOre
warp_to_start: OracleOfSeasonsWarpToStart
Expand Down
14 changes: 3 additions & 11 deletions worlds/tloz_oos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,9 @@ def shuffle_portals():
self.randomize_shop_prices()

def randomize_shop_prices(self):
prices_bag = []
prices_bag.extend([400] * 1)
prices_bag.extend([300] * 4)
prices_bag.extend([200] * 20)
prices_bag.extend([100] * 40)
prices_bag.extend([80] * 15)
prices_bag.extend([60] * 10)
prices_bag.extend([30] * 5)
self.random.shuffle(prices_bag)

global_prices_factor = self.options.shop_prices_factor.value / 100.0
for key, divider in self.shop_prices.items():
floating_price = int(prices_bag.pop() / divider)
floating_price = self.random.normalvariate(130, 50) * global_prices_factor / divider
for value in VALID_RUPEE_VALUES:
if value >= floating_price:
self.shop_prices[key] = value
Expand Down Expand Up @@ -408,6 +399,7 @@ def generate_output(self, output_directory: str):
"golden_beasts_requirement": self.options.golden_beasts_requirement.value,
"treehouse_old_man_requirement": self.options.treehouse_old_man_requirement.value,
"quick_flute": self.options.quick_flute.current_key,
"open_advance_shop": self.options.advance_shop.current_key,
"slot_name": self.multiworld.get_player_name(self.player)
},
"default seasons": {},
Expand Down

0 comments on commit 81bd77e

Please sign in to comment.