Skip to content

Commit

Permalink
Merge pull request #580 from hanzi/sgr-fossil-checks-kanto
Browse files Browse the repository at this point in the history
SGR: Check event var before allowing Kanto Fossil resets
  • Loading branch information
hanzi authored Dec 16, 2024
2 parents e020ae0 + e590beb commit d1dc8f0
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions modules/modes/static_gift_resets.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,23 @@ def run(self) -> Generator:
raise BotModeError(
"The first Pokémon in your party in the saved game must have max friendship (255) to receive the egg."
)
if encounter[2] == "Hoenn Fossils":
if (
save_data.get_event_var("FOSSIL_RESURRECTION_STATE") == 0
or get_event_var("FOSSIL_RESURRECTION_STATE") == 0
):
if get_event_var("FOSSIL_RESURRECTION_STATE") == 0:
if encounter[2] in ("Hoenn Fossils", "Kanto Fossils"):
var_name = (
"FOSSIL_RESURRECTION_STATE"
if context.rom.is_rse
else "MAP_SCENE_CINNABAR_ISLAND_POKEMON_LAB_EXPERIMENT_ROOM_REVIVE_STATE"
)
if save_data.get_event_var(var_name) == 0 or get_event_var(var_name) == 0:
if get_event_var(var_name) == 0:
raise BotModeError(
"You need to first give a Fossil to the Scientist, then re-enter the room, and then save the game before using this mode."
)
else:
raise BotModeError(
"You need to save the game after giving a Fossil to the Scientist before using this mode."
)
if save_data.get_event_var("FOSSIL_RESURRECTION_STATE") == 1:
if get_event_var("FOSSIL_RESURRECTION_STATE") == 1:
if save_data.get_event_var(var_name) == 1:
if get_event_var(var_name) == 1:
raise BotModeError(
"The Scientist is not ready yet. Try leaving the room and coming back, then save the game before using this mode."
)
Expand Down

0 comments on commit d1dc8f0

Please sign in to comment.