Skip to content

Commit 34dba00

Browse files
authored
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
1 parent 02d3eef commit 34dba00

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

worlds/pokemon_rb/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,9 @@ def create_items(self) -> None:
190190
item = self.create_filler()
191191
else:
192192
item = self.create_item(location.original_item)
193+
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
193194
if (item.classification == ItemClassification.filler and self.multiworld.random.randint(1, 100)
194-
<= self.multiworld.trap_percentage[self.player].value):
195+
<= self.multiworld.trap_percentage[self.player].value and combined_traps != 0):
195196
item = self.create_item(self.select_trap())
196197
if location.event:
197198
self.multiworld.get_location(location.name, self.player).place_locked_item(item)
@@ -349,6 +350,7 @@ def fill_slot_data(self) -> dict:
349350
"elite_four_condition": self.multiworld.elite_four_condition[self.player].value,
350351
"victory_road_condition": self.multiworld.victory_road_condition[self.player].value,
351352
"viridian_gym_condition": self.multiworld.viridian_gym_condition[self.player].value,
353+
"cerulean_cave_condition": self.multiworld.cerulean_cave_condition[self.player].value,
352354
"free_fly_map": self.fly_map_code,
353355
"extra_badges": self.extra_badges,
354356
"type_chart": self.type_chart,

worlds/pokemon_rb/options.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ class TrapWeight(Choice):
518518
option_low = 1
519519
option_medium = 3
520520
option_high = 5
521+
option_disabled = 0
521522
default = 3
522523

523524

@@ -539,7 +540,6 @@ class ParalyzeTrapWeight(TrapWeight):
539540
class IceTrapWeight(TrapWeight):
540541
"""Weights for Ice Traps. These apply the Ice status to all your party members. Don't forget to buy Ice Heals!"""
541542
display_name = "Ice Trap Weight"
542-
option_disabled = 0
543543
default = 0
544544

545545

@@ -605,4 +605,4 @@ class IceTrapWeight(TrapWeight):
605605
"paralyze_trap_weight": ParalyzeTrapWeight,
606606
"ice_trap_weight": IceTrapWeight,
607607
"death_link": DeathLink
608-
}
608+
}

0 commit comments

Comments
 (0)