Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PKMN RB] Make Encounters in one location unique #3994

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions worlds/pokemon_rb/encounters.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ def process_pokemon_locations(self):
encounter_slots = encounter_slots_master.copy()

zone_mapping = {}
zone_placed_mons = {}

if self.options.randomize_wild_pokemon:
mons_list = [pokemon for pokemon in poke_data.pokemon_data.keys() if pokemon not in poke_data.legendary_pokemon
or self.options.randomize_legendary_pokemon.value == 3]
Expand All @@ -180,11 +182,13 @@ def process_pokemon_locations(self):
zone = " - ".join(location.name.split(" - ")[:-1])
if zone not in zone_mapping:
zone_mapping[zone] = {}
if zone not in zone_placed_mons:
zone_placed_mons[zone] = []
original_mon = slot.original_item
if self.options.area_1_to_1_mapping and original_mon in zone_mapping[zone]:
mon = zone_mapping[zone][original_mon]
else:
mon = randomize_pokemon(self, original_mon, mons_list,
mon = randomize_pokemon(self, original_mon, [m for m in mons_list if m not in zone_placed_mons[zone]],
self.options.randomize_wild_pokemon.value, self.random)
#
while ("Pokemon Tower 6F" in slot.name and
Expand All @@ -201,6 +205,7 @@ def process_pokemon_locations(self):
location.item.location = location
locations.append(location)
zone_mapping[zone][original_mon] = mon
zone_placed_mons[zone].append(mon)

mons_to_add = []
remaining_pokemon = [pokemon for pokemon in poke_data.pokemon_data.keys() if placed_mons[pokemon] == 0 and
Expand Down Expand Up @@ -270,4 +275,4 @@ def process_pokemon_locations(self):
location.item = self.create_item(slot.original_item)
location.locked = True
location.item.location = location
placed_mons[location.item.name] += 1
placed_mons[location.item.name] += 1
Loading