From 34dba007dc0f8f4628411d7a10c02e0892193d6b Mon Sep 17 00:00:00 2001 From: SonicRPika <68293462+SonicRPika@users.noreply.github.com> Date: Fri, 20 Jan 2023 17:49:12 +0000 Subject: [PATCH] Pokemon Red and Blue: Updates to trap weights and tracker support (#1395) * Added cerulean_cave_condition to fill_slot_data Added `cerulean_cave_condition` to the `fill_slot_data` function, for a poptracker feature being worked on as it was missing * Added the potential for any traps to be disabled Adding the ability to disable any kind of trap, for example if you want any status trap except being Poisoned. Will add a contingency to not try and roll a trap if they are all set to disabled. * Added contingency to if all traps are disabled Added a contingency to creating items such that it doesn't try to create a trap if all the traps are disabled * Updated variable name Edited name of variable to follow PEP 8 variable naming conventions --- worlds/pokemon_rb/__init__.py | 4 +++- worlds/pokemon_rb/options.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/worlds/pokemon_rb/__init__.py b/worlds/pokemon_rb/__init__.py index 5a78b63a..ad1a5509 100644 --- a/worlds/pokemon_rb/__init__.py +++ b/worlds/pokemon_rb/__init__.py @@ -190,8 +190,9 @@ class PokemonRedBlueWorld(World): item = self.create_filler() else: item = self.create_item(location.original_item) + combined_traps = self.multiworld.poison_trap_weight[self.player].value + self.multiworld.fire_trap_weight[self.player].value + self.multiworld.paralyze_trap_weight[self.player].value + self.multiworld.ice_trap_weight[self.player].value if (item.classification == ItemClassification.filler and self.multiworld.random.randint(1, 100) - <= self.multiworld.trap_percentage[self.player].value): + <= self.multiworld.trap_percentage[self.player].value and combined_traps != 0): item = self.create_item(self.select_trap()) if location.event: self.multiworld.get_location(location.name, self.player).place_locked_item(item) @@ -349,6 +350,7 @@ class PokemonRedBlueWorld(World): "elite_four_condition": self.multiworld.elite_four_condition[self.player].value, "victory_road_condition": self.multiworld.victory_road_condition[self.player].value, "viridian_gym_condition": self.multiworld.viridian_gym_condition[self.player].value, + "cerulean_cave_condition": self.multiworld.cerulean_cave_condition[self.player].value, "free_fly_map": self.fly_map_code, "extra_badges": self.extra_badges, "type_chart": self.type_chart, diff --git a/worlds/pokemon_rb/options.py b/worlds/pokemon_rb/options.py index e64ce9fe..ae51c47b 100644 --- a/worlds/pokemon_rb/options.py +++ b/worlds/pokemon_rb/options.py @@ -518,6 +518,7 @@ class TrapWeight(Choice): option_low = 1 option_medium = 3 option_high = 5 + option_disabled = 0 default = 3 @@ -539,7 +540,6 @@ class ParalyzeTrapWeight(TrapWeight): class IceTrapWeight(TrapWeight): """Weights for Ice Traps. These apply the Ice status to all your party members. Don't forget to buy Ice Heals!""" display_name = "Ice Trap Weight" - option_disabled = 0 default = 0 @@ -605,4 +605,4 @@ pokemon_rb_options = { "paralyze_trap_weight": ParalyzeTrapWeight, "ice_trap_weight": IceTrapWeight, "death_link": DeathLink -} \ No newline at end of file +}