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
This commit is contained in:
SonicRPika 2023-01-20 17:49:12 +00:00 committed by GitHub
parent 02d3eef565
commit 34dba007dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -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,

View File

@ -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
}
}