diff --git a/worlds/ror2/Options.py b/worlds/ror2/Options.py index bb11d0bd..a77d7c3f 100644 --- a/worlds/ror2/Options.py +++ b/worlds/ror2/Options.py @@ -9,6 +9,13 @@ class TotalLocations(Range): range_end = 50 default = 15 +class TotalItems(Range): + """Number of items which are added to the multiworld on behalf of the Risk of Rain player.""" + displayname = "Total Items" + range_start = 10 + range_end = 50 + default = 30 + class TotalRevivals(Range): """Number of `Dio's Best Friend` item put in the item pool.""" @@ -27,6 +34,10 @@ class ItemPickupStep(Range): range_end = 5 default = 1 +class AllowLunarItems(Toggle): + """Allows Lunar items in the item pool.""" + displayname = "Enable Lunar Item Shuffling" + default = True class StartWithRevive(Toggle): """Start the game with a `Dio's Best Friend` item.""" @@ -38,5 +49,7 @@ ror2_options: typing.Dict[str, type(Option)] = { "total_locations": TotalLocations, "total_revivals": TotalRevivals, "start_with_revive": StartWithRevive, - "item_pickup_step": ItemPickupStep + "item_pickup_step": ItemPickupStep, + "total_items": TotalItems, + "enable_lunar": AllowLunarItems } diff --git a/worlds/ror2/__init__.py b/worlds/ror2/__init__.py index 29db5243..94857cd9 100644 --- a/worlds/ror2/__init__.py +++ b/worlds/ror2/__init__.py @@ -33,9 +33,12 @@ class RiskOfRainWorld(World): # Add revive items for the player itempool += ["Dio's Best Friend"] * self.world.total_revivals[self.player] + if not self.world.enable_lunar[self.player]: + junk_pool.pop("Lunar Item") + # Fill remaining items with randomly generated junk itempool += self.world.random.choices(list(junk_pool.keys()), weights=list(junk_pool.values()), - k=self.world.total_locations[self.player] - + k=self.world.total_items[self.player] - self.world.total_revivals[self.player]) # Convert itempool into real items @@ -53,7 +56,8 @@ class RiskOfRainWorld(World): return { "itemPickupStep": self.world.item_pickup_step[self.player].value, "seed": "".join(self.world.slot_seeds[self.player].choice(string.digits) for i in range(16)), - "totalLocations": self.world.total_locations[self.player].value + "totalLocations": self.world.total_items[self.player].value, + "totalRevivals": self.world.total_revivals[self.player].value } def create_item(self, name: str) -> Item: