Pokemon R/B: Version 5 Update (#3566)

* Quiz updates

* Enable Partial Trainersanity

* Losable Key Items Still Count

* New options api

* Type Chart Seed

* Continue switching to new options API

* Level Scaling and Quiz fixes

* Level Scaling and Quiz fixes

* Clarify that palettes are only for Super Gameboy

* Type chart seed groups use one random players' options

* remove goal option again

* Text updates

* Trainersanity Trainers ignore Blind Trainers setting

* Re-order simple connecting interiors so that directions are preserved when possible

* Dexsanity exact number

* Year update

* Dexsanity Doc update

* revert accidental file deletion

* Fixes

* Add world parameter to logic calls

* restore correct seeded random object

* missing world.options changes

* Trainersanity table bug fix

* delete entrances as well as exits when restarting door shuffle

* Do not collect route 25 item for level scaling if trainer is trainersanity

* world.options in level_scaling.py

* Update worlds/pokemon_rb/level_scaling.py

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

* Update worlds/pokemon_rb/encounters.py

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

* Update worlds/pokemon_rb/encounters.py

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

* world -> multiworld

* Fix Cerulean Cave Hidden Item Center Rocks region

* Fix Cerulean Cave Hidden Item Center Rocks region for real

* Remove "self-locking" rules

* Update worlds/pokemon_rb/regions.py

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

* Fossil events

* Update worlds/pokemon_rb/level_scaling.py

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

---------

Co-authored-by: alchav <alchav@jalchavware.com>
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
This commit is contained in:
Alchav
2024-09-18 14:37:17 -04:00
committed by GitHub
parent 51a6dc150c
commit db5d9fbf70
15 changed files with 1435 additions and 1335 deletions

View File

@@ -1,49 +1,47 @@
from . import poke_data
def can_surf(state, player):
return (((state.has("HM03 Surf", player) and can_learn_hm(state, "Surf", player))
or state.has("Flippers", player)) and (state.has("Soul Badge", player) or
state.has(state.multiworld.worlds[player].extra_badges.get("Surf"), player)
or state.multiworld.badges_needed_for_hm_moves[player].value == 0))
def can_surf(state, world, player):
return (((state.has("HM03 Surf", player) and can_learn_hm(state, world, "Surf", player))) and (state.has("Soul Badge", player) or
state.has(world.extra_badges.get("Surf"), player)
or world.options.badges_needed_for_hm_moves.value == 0))
def can_cut(state, player):
return ((state.has("HM01 Cut", player) and can_learn_hm(state, "Cut", player) or state.has("Master Sword", player))
and (state.has("Cascade Badge", player) or
state.has(state.multiworld.worlds[player].extra_badges.get("Cut"), player) or
state.multiworld.badges_needed_for_hm_moves[player].value == 0))
def can_cut(state, world, player):
return ((state.has("HM01 Cut", player) and can_learn_hm(state, world, "Cut", player))
and (state.has("Cascade Badge", player) or state.has(world.extra_badges.get("Cut"), player) or
world.options.badges_needed_for_hm_moves.value == 0))
def can_fly(state, player):
return (((state.has("HM02 Fly", player) and can_learn_hm(state, "Fly", player)) or state.has("Flute", player)) and
(state.has("Thunder Badge", player) or state.has(state.multiworld.worlds[player].extra_badges.get("Fly"), player)
or state.multiworld.badges_needed_for_hm_moves[player].value == 0))
def can_fly(state, world, player):
return (((state.has("HM02 Fly", player) and can_learn_hm(state, world, "Fly", player)) or state.has("Flute", player)) and
(state.has("Thunder Badge", player) or state.has(world.extra_badges.get("Fly"), player)
or world.options.badges_needed_for_hm_moves.value == 0))
def can_strength(state, player):
return ((state.has("HM04 Strength", player) and can_learn_hm(state, "Strength", player)) or
def can_strength(state, world, player):
return ((state.has("HM04 Strength", player) and can_learn_hm(state, world, "Strength", player)) or
state.has("Titan's Mitt", player)) and (state.has("Rainbow Badge", player) or
state.has(state.multiworld.worlds[player].extra_badges.get("Strength"), player)
or state.multiworld.badges_needed_for_hm_moves[player].value == 0)
state.has(world.extra_badges.get("Strength"), player)
or world.options.badges_needed_for_hm_moves.value == 0)
def can_flash(state, player):
return (((state.has("HM05 Flash", player) and can_learn_hm(state, "Flash", player)) or state.has("Lamp", player))
and (state.has("Boulder Badge", player) or state.has(state.multiworld.worlds[player].extra_badges.get("Flash"),
player) or state.multiworld.badges_needed_for_hm_moves[player].value == 0))
def can_flash(state, world, player):
return (((state.has("HM05 Flash", player) and can_learn_hm(state, world, "Flash", player)) or state.has("Lamp", player))
and (state.has("Boulder Badge", player) or state.has(world.extra_badges.get("Flash"),
player) or world.options.badges_needed_for_hm_moves.value == 0))
def can_learn_hm(state, move, player):
for pokemon, data in state.multiworld.worlds[player].local_poke_data.items():
def can_learn_hm(state, world, move, player):
for pokemon, data in world.local_poke_data.items():
if state.has(pokemon, player) and data["tms"][6] & 1 << (["Cut", "Fly", "Surf", "Strength",
"Flash"].index(move) + 2):
return True
return False
def can_get_hidden_items(state, player):
return state.has("Item Finder", player) or not state.multiworld.require_item_finder[player].value
def can_get_hidden_items(state, world, player):
return state.has("Item Finder", player) or not world.options.require_item_finder.value
def has_key_items(state, count, player):
@@ -53,13 +51,14 @@ def has_key_items(state, count, player):
"Hideout Key", "Card Key 2F", "Card Key 3F", "Card Key 4F", "Card Key 5F",
"Card Key 6F", "Card Key 7F", "Card Key 8F", "Card Key 9F", "Card Key 10F",
"Card Key 11F", "Exp. All", "Fire Stone", "Thunder Stone", "Water Stone",
"Leaf Stone", "Moon Stone"] if state.has(item, player)])
"Leaf Stone", "Moon Stone", "Oak's Parcel", "Helix Fossil", "Dome Fossil",
"Old Amber", "Tea", "Gold Teeth", "Bike Voucher"] if state.has(item, player)])
+ min(state.count("Progressive Card Key", player), 10))
return key_items >= count
def can_pass_guards(state, player):
if state.multiworld.tea[player]:
def can_pass_guards(state, world, player):
if world.options.tea:
return state.has("Tea", player)
else:
return state.has("Vending Machine Drinks", player)
@@ -70,8 +69,8 @@ def has_badges(state, count, player):
"Soul Badge", "Volcano Badge", "Earth Badge"] if state.has(item, player)]) >= count
def oaks_aide(state, count, player):
return ((not state.multiworld.require_pokedex[player] or state.has("Pokedex", player))
def oaks_aide(state, world, count, player):
return ((not world.options.require_pokedex or state.has("Pokedex", player))
and has_pokemon(state, count, player))
@@ -85,9 +84,7 @@ def has_pokemon(state, count, player):
def fossil_checks(state, count, player):
return (state.can_reach('Mt Moon B2F', 'Region', player) and
state.can_reach('Cinnabar Lab Fossil Room', 'Region', player) and
state.can_reach('Cinnabar Island', 'Region', player) and len(
return (state.has_all(["Mt Moon Fossils", "Cinnabar Lab", "Cinnabar Island"], player) and len(
[item for item in ["Dome Fossil", "Helix Fossil", "Old Amber"] if state.has(item, player)]) >= count)
@@ -96,19 +93,19 @@ def card_key(state, floor, player):
state.has("Progressive Card Key", player, floor - 1)
def rock_tunnel(state, player):
return can_flash(state, player) or not state.multiworld.dark_rock_tunnel_logic[player]
def rock_tunnel(state, world, player):
return can_flash(state, world, player) or not world.options.dark_rock_tunnel_logic
def route_3(state, player):
if state.multiworld.route_3_condition[player] == "defeat_brock":
def route(state, world, player):
if world.options.route_3_condition == "defeat_brock":
return state.has("Defeat Brock", player)
elif state.multiworld.route_3_condition[player] == "defeat_any_gym":
elif world.options.route_3_condition == "defeat_any_gym":
return state.has_any(["Defeat Brock", "Defeat Misty", "Defeat Lt. Surge", "Defeat Erika", "Defeat Koga",
"Defeat Blaine", "Defeat Sabrina", "Defeat Viridian Gym Giovanni"], player)
elif state.multiworld.route_3_condition[player] == "boulder_badge":
elif world.options.route_3_condition == "boulder_badge":
return state.has("Boulder Badge", player)
elif state.multiworld.route_3_condition[player] == "any_badge":
elif world.options.route_3_condition == "any_badge":
return state.has_any(["Boulder Badge", "Cascade Badge", "Thunder Badge", "Rainbow Badge", "Marsh Badge",
"Soul Badge", "Volcano Badge", "Earth Badge"], player)
# open