From 05dac999a8f4c9abc3969c763ec8a4e3b252cab4 Mon Sep 17 00:00:00 2001 From: alwaysintreble Date: Wed, 8 Sep 2021 12:29:29 -0500 Subject: [PATCH] Fixed chaos item weight preset so it gets generated per world. --- worlds/ror2/Items.py | 14 -------------- worlds/ror2/__init__.py | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/worlds/ror2/Items.py b/worlds/ror2/Items.py index 104540d8..3345fd6d 100644 --- a/worlds/ror2/Items.py +++ b/worlds/ror2/Items.py @@ -117,19 +117,6 @@ even_weights = { "Equipment": 1 } -chaos_weights = { - "Item Scrap, Green": randint(0, 100), - "Item Scrap, Red": randint(0, 100), - "Item Scrap, Yellow": randint(0, 80), - "Item Scrap, White": randint(0, 100), - "Common Item": randint(0, 100), - "Uncommon Item": randint(0, 70), - "Legendary Item": randint(0, 25), - "Boss Item": randint(0, 10), - "Lunar Item": randint(0, 40), - "Equipment": randint(0, 40) -} - scraps_only_weights = { "Item Scrap, Green": 80, "Item Scrap, Red": 40, @@ -149,7 +136,6 @@ item_pool_weights: typing.Dict[int, typing.Dict[str, int]] = { 2: uncommon_weights, 3: legendary_weights, 4: lunartic_weights, - 5: chaos_weights, 6: no_scraps_weights, 7: even_weights, 8: scraps_only_weights diff --git a/worlds/ror2/__init__.py b/worlds/ror2/__init__.py index 394cdbe0..da2fe244 100644 --- a/worlds/ror2/__init__.py +++ b/worlds/ror2/__init__.py @@ -6,6 +6,7 @@ from .Rules import set_rules from BaseClasses import Region, Entrance, Item, MultiWorld from .Options import ror2_options from ..AutoWorld import World +from random import randint client_version = 1 @@ -48,7 +49,22 @@ class RiskOfRainWorld(World): # if presets are enabled generate junk_pool from the selected preset if self.world.item_pool_presets[self.player].value: pool_option = self.world.item_weights[self.player].value - junk_pool = item_pool_weights[pool_option] + # generate chaos weights + if pool_option == 5: + junk_pool = { + "item Scrap, Green": randint(0, 100), + "Item Scrap, Red": randint(0, 100), + "Item Scrap, Yellow": randint(0, 100), + "Item Scrap, White": randint(0, 100), + "Common Item": randint(0, 100), + "Uncommon Item": randint(0, 70), + "Legendary Item": randint(0, 25), + "Boss Item": randint(0, 10), + "Lunar Item": randint(0, 40), + "Equipment": randint(0, 40) + } + else: + junk_pool = item_pool_weights[pool_option] # Generate item pool itempool = []