Skip to content

Commit

Permalink
patch RNG link in thief generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonymous committed Apr 26, 2023
1 parent 17ad4c1 commit 03b36c0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions randomizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5600,7 +5600,8 @@ def generate_thieves(iris_item):
buyable_items = {i for s in ShopObject.every for i in s.wares_flat}
rare_items = [i for i in ItemObject.every
if i.price > 0 and i.rank > 0 and i not in buyable_items]
rare_items = sorted(rare_items, key=lambda i: i.rank)
rare_items = sorted(rare_items,
key=lambda i: (i.rank, i.signature, i.index))
max_index = len(rare_items)-1
index = random.randint(random.randint(1, max_index), max_index)
iris_exchange_item = rare_items[index]
Expand All @@ -5609,7 +5610,8 @@ def generate_thieves(iris_item):
iris_exchange_quantity += 1
iris_exchange_quantity = min(iris_exchange_quantity, 99)

buyable_items = sorted(buyable_items, key=lambda i: i.price)
buyable_items = sorted(buyable_items,
key=lambda i: (i.price, i.signature, i.index))
max_index = len(buyable_items)-1
index = random.randint(random.randint(1, max_index), max_index)
second_exchange_item = buyable_items[index]
Expand Down

0 comments on commit 03b36c0

Please sign in to comment.