Skip to content

Commit

Permalink
Add after events to map id rewards
Browse files Browse the repository at this point in the history
thatguy11325 committed Sep 21, 2024
1 parent 9c1cfbf commit 6b2c8b5
Showing 2 changed files with 76 additions and 66 deletions.
126 changes: 63 additions & 63 deletions pokemonred_puffer/data/map.py
Original file line number Diff line number Diff line change
@@ -273,70 +273,70 @@ class MapIds(Enum):
}

MAP_ID_COMPLETION_EVENTS = {
MapIds.PEWTER_GYM: ["EVENT_BEAT_BROCK"],
MapIds.CERULEAN_GYM: ["EVENT_BEAT_MISTY"],
MapIds.VERMILION_GYM: ["EVENT_BEAT_LT_SURGE"],
MapIds.CELADON_GYM: ["EVENT_BEAT_ERIKA"],
MapIds.SAFFRON_GYM: ["EVENT_BEAT_SABRINA"],
MapIds.FUCHSIA_GYM: ["EVENT_BEAT_KOGA"],
MapIds.CINNABAR_GYM: ["EVENT_BEAT_BLAINE"],
MapIds.VIRIDIAN_GYM: ["EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI"],
MapIds.GAME_CORNER: ["EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI"],
MapIds.ROCKET_HIDEOUT_B1F: ["EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI"],
MapIds.ROCKET_HIDEOUT_B2F: ["EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI"],
MapIds.ROCKET_HIDEOUT_B3F: ["EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI"],
MapIds.ROCKET_HIDEOUT_B4F: ["EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI"],
MapIds.ROCKET_HIDEOUT_ELEVATOR: ["EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI"],
MapIds.SILPH_CO_1F: ["EVENT_BEAT_SILPH_CO_GIOVANNI"],
MapIds.SILPH_CO_2F: ["EVENT_BEAT_SILPH_CO_GIOVANNI"],
MapIds.SILPH_CO_3F: ["EVENT_BEAT_SILPH_CO_GIOVANNI"],
MapIds.SILPH_CO_4F: ["EVENT_BEAT_SILPH_CO_GIOVANNI"],
MapIds.SILPH_CO_5F: ["EVENT_BEAT_SILPH_CO_GIOVANNI"],
MapIds.SILPH_CO_6F: ["EVENT_BEAT_SILPH_CO_GIOVANNI"],
MapIds.SILPH_CO_7F: ["EVENT_BEAT_SILPH_CO_GIOVANNI"],
MapIds.SILPH_CO_8F: ["EVENT_BEAT_SILPH_CO_GIOVANNI"],
MapIds.SILPH_CO_9F: ["EVENT_BEAT_SILPH_CO_GIOVANNI"],
MapIds.SILPH_CO_10F: ["EVENT_BEAT_SILPH_CO_GIOVANNI"],
MapIds.SILPH_CO_11F: ["EVENT_BEAT_SILPH_CO_GIOVANNI"],
MapIds.SILPH_CO_ELEVATOR: ["EVENT_BEAT_SILPH_CO_GIOVANNI"],
MapIds.POKEMON_MANSION_1F: ["HS_POKEMON_MANSION_B1F_ITEM_5"],
MapIds.POKEMON_MANSION_2F: ["HS_POKEMON_MANSION_B1F_ITEM_5"],
MapIds.POKEMON_MANSION_3F: ["HS_POKEMON_MANSION_B1F_ITEM_5"],
MapIds.POKEMON_MANSION_B1F: ["HS_POKEMON_MANSION_B1F_ITEM_5"],
MapIds.POKEMON_TOWER_1F: ["EVENT_GOT_POKE_FLUTE"],
MapIds.POKEMON_TOWER_2F: ["EVENT_GOT_POKE_FLUTE"],
MapIds.POKEMON_TOWER_3F: ["EVENT_GOT_POKE_FLUTE"],
MapIds.POKEMON_TOWER_4F: ["EVENT_GOT_POKE_FLUTE"],
MapIds.POKEMON_TOWER_5F: ["EVENT_GOT_POKE_FLUTE"],
MapIds.POKEMON_TOWER_6F: ["EVENT_GOT_POKE_FLUTE"],
MapIds.POKEMON_TOWER_7F: ["EVENT_GOT_POKE_FLUTE"],
MapIds.MR_FUJIS_HOUSE: ["EVENT_GOT_POKE_FLUTE"],
MapIds.SAFARI_ZONE_CENTER: ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"],
MapIds.SAFARI_ZONE_CENTER_REST_HOUSE: ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"],
MapIds.SAFARI_ZONE_EAST: ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"],
MapIds.SAFARI_ZONE_EAST_REST_HOUSE: ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"],
MapIds.SAFARI_ZONE_GATE: ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"],
MapIds.SAFARI_ZONE_NORTH: ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"],
MapIds.SAFARI_ZONE_NORTH_REST_HOUSE: ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"],
MapIds.SAFARI_ZONE_SECRET_HOUSE: ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"],
MapIds.SAFARI_ZONE_WEST: ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"],
MapIds.SAFARI_ZONE_WEST_REST_HOUSE: ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"],
# MapIds.ROUTE_23: ["EVENT_BEAT_CHAMPION_RIVAL"],
MapIds.VICTORY_ROAD_1F: ["EVENT_BEAT_CHAMPION_RIVAL"],
MapIds.VICTORY_ROAD_2F: ["EVENT_BEAT_CHAMPION_RIVAL"],
MapIds.VICTORY_ROAD_3F: ["EVENT_BEAT_CHAMPION_RIVAL"],
MapIds.INDIGO_PLATEAU: ["EVENT_BEAT_CHAMPION_RIVAL"],
MapIds.INDIGO_PLATEAU_LOBBY: ["EVENT_BEAT_CHAMPION_RIVAL"],
MapIds.LORELEIS_ROOM: ["EVENT_BEAT_CHAMPION_RIVAL"],
MapIds.BRUNOS_ROOM: ["EVENT_BEAT_CHAMPION_RIVAL"],
MapIds.AGATHAS_ROOM: ["EVENT_BEAT_CHAMPION_RIVAL"],
MapIds.LANCES_ROOM: ["EVENT_BEAT_CHAMPION_RIVAL"],
MapIds.CHAMPIONS_ROOM: ["EVENT_BEAT_CHAMPION_RIVAL"],
MapIds.PEWTER_GYM: [[], ["EVENT_BEAT_BROCK"]],
MapIds.CERULEAN_GYM: [[], ["EVENT_BEAT_MISTY"]],
MapIds.VERMILION_GYM: [[], ["EVENT_BEAT_LT_SURGE"]],
MapIds.CELADON_GYM: [[], ["EVENT_BEAT_ERIKA"]],
MapIds.SAFFRON_GYM: [[], ["EVENT_BEAT_SABRINA"]],
MapIds.FUCHSIA_GYM: [[], ["EVENT_BEAT_KOGA"]],
MapIds.CINNABAR_GYM: [[], ["EVENT_BEAT_BLAINE"]],
MapIds.VIRIDIAN_GYM: [[], ["EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI"]],
MapIds.GAME_CORNER: [[], ["EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI"]],
MapIds.ROCKET_HIDEOUT_B1F: [[], ["EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI"]],
MapIds.ROCKET_HIDEOUT_B2F: [[], ["EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI"]],
MapIds.ROCKET_HIDEOUT_B3F: [[], ["EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI"]],
MapIds.ROCKET_HIDEOUT_B4F: [[], ["EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI"]],
MapIds.ROCKET_HIDEOUT_ELEVATOR: [[], ["EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI"]],
MapIds.SILPH_CO_1F: [[], ["EVENT_BEAT_SILPH_CO_GIOVANNI"]],
MapIds.SILPH_CO_2F: [[], ["EVENT_BEAT_SILPH_CO_GIOVANNI"]],
MapIds.SILPH_CO_3F: [[], ["EVENT_BEAT_SILPH_CO_GIOVANNI"]],
MapIds.SILPH_CO_4F: [[], ["EVENT_BEAT_SILPH_CO_GIOVANNI"]],
MapIds.SILPH_CO_5F: [[], ["EVENT_BEAT_SILPH_CO_GIOVANNI"]],
MapIds.SILPH_CO_6F: [[], ["EVENT_BEAT_SILPH_CO_GIOVANNI"]],
MapIds.SILPH_CO_7F: [[], ["EVENT_BEAT_SILPH_CO_GIOVANNI"]],
MapIds.SILPH_CO_8F: [[], ["EVENT_BEAT_SILPH_CO_GIOVANNI"]],
MapIds.SILPH_CO_9F: [[], ["EVENT_BEAT_SILPH_CO_GIOVANNI"]],
MapIds.SILPH_CO_10F: [[], ["EVENT_BEAT_SILPH_CO_GIOVANNI"]],
MapIds.SILPH_CO_11F: [[], ["EVENT_BEAT_SILPH_CO_GIOVANNI"]],
MapIds.SILPH_CO_ELEVATOR: [[], ["EVENT_BEAT_SILPH_CO_GIOVANNI"]],
MapIds.POKEMON_MANSION_1F: [[], ["HS_POKEMON_MANSION_B1F_ITEM_5"]],
MapIds.POKEMON_MANSION_2F: [[], ["HS_POKEMON_MANSION_B1F_ITEM_5"]],
MapIds.POKEMON_MANSION_3F: [[], ["HS_POKEMON_MANSION_B1F_ITEM_5"]],
MapIds.POKEMON_MANSION_B1F: [[], ["HS_POKEMON_MANSION_B1F_ITEM_5"]],
MapIds.POKEMON_TOWER_1F: [[], ["EVENT_GOT_POKE_FLUTE"]],
MapIds.POKEMON_TOWER_2F: [[], ["EVENT_GOT_POKE_FLUTE"]],
MapIds.POKEMON_TOWER_3F: [[], ["EVENT_GOT_POKE_FLUTE"]],
MapIds.POKEMON_TOWER_4F: [[], ["EVENT_GOT_POKE_FLUTE"]],
MapIds.POKEMON_TOWER_5F: [[], ["EVENT_GOT_POKE_FLUTE"]],
MapIds.POKEMON_TOWER_6F: [[], ["EVENT_GOT_POKE_FLUTE"]],
MapIds.POKEMON_TOWER_7F: [[], ["EVENT_GOT_POKE_FLUTE"]],
MapIds.MR_FUJIS_HOUSE: [[], ["EVENT_GOT_POKE_FLUTE"]],
MapIds.SAFARI_ZONE_CENTER: [[], ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"]],
MapIds.SAFARI_ZONE_CENTER_REST_HOUSE: [[], ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"]],
MapIds.SAFARI_ZONE_EAST: [[], ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"]],
MapIds.SAFARI_ZONE_EAST_REST_HOUSE: [[], ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"]],
MapIds.SAFARI_ZONE_GATE: [[], ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"]],
MapIds.SAFARI_ZONE_NORTH: [[], ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"]],
MapIds.SAFARI_ZONE_NORTH_REST_HOUSE: [[], ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"]],
MapIds.SAFARI_ZONE_SECRET_HOUSE: [[], ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"]],
MapIds.SAFARI_ZONE_WEST: [[], ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"]],
MapIds.SAFARI_ZONE_WEST_REST_HOUSE: [[], ["EVENT_GOT_HM03", "HS_SAFARI_ZONE_WEST_ITEM_4"]],
MapIds.ROUTE_23: [["EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI"], ["EVENT_BEAT_CHAMPION_RIVAL"]],
MapIds.VICTORY_ROAD_1F: [[], ["EVENT_BEAT_CHAMPION_RIVAL"]],
MapIds.VICTORY_ROAD_2F: [[], ["EVENT_BEAT_CHAMPION_RIVAL"]],
MapIds.VICTORY_ROAD_3F: [[], ["EVENT_BEAT_CHAMPION_RIVAL"]],
MapIds.INDIGO_PLATEAU: [[], ["EVENT_BEAT_CHAMPION_RIVAL"]],
MapIds.INDIGO_PLATEAU_LOBBY: [[], ["EVENT_BEAT_CHAMPION_RIVAL"]],
MapIds.LORELEIS_ROOM: [[], ["EVENT_BEAT_CHAMPION_RIVAL"]],
MapIds.BRUNOS_ROOM: [[], ["EVENT_BEAT_CHAMPION_RIVAL"]],
MapIds.AGATHAS_ROOM: [[], ["EVENT_BEAT_CHAMPION_RIVAL"]],
MapIds.LANCES_ROOM: [[], ["EVENT_BEAT_CHAMPION_RIVAL"]],
MapIds.CHAMPIONS_ROOM: [[], ["EVENT_BEAT_CHAMPION_RIVAL"]],
}

DISABLE_WILD_ENCOUNTERS_EXCEPTIONS = {
MapIds.ROUTE_23,
MapIds.VICTORY_ROAD_1F,
MapIds.VICTORY_ROAD_2F,
MapIds.VICTORY_ROAD_3F,
# MapIds.ROUTE_23,
# MapIds.VICTORY_ROAD_1F,
# MapIds.VICTORY_ROAD_2F,
# MapIds.VICTORY_ROAD_3F,
}
16 changes: 13 additions & 3 deletions pokemonred_puffer/environment.py
Original file line number Diff line number Diff line change
@@ -1727,15 +1727,25 @@ def scale_map_id(self, map_n: int) -> float:
map_id = MapIds(map_n)
if map_id not in MAP_ID_COMPLETION_EVENTS:
return False
after_events, until_events = MAP_ID_COMPLETION_EVENTS[map_id]

if all(
event_or_missable.startswith("EVENT_")
and not self.events.get_event(event_or_missable)
(event_or_missable.startswith("EVENT_") and self.events.get_event(event_or_missable))
or (
event_or_missable.startswith("HS_")
and self.missables.get_missable(event_or_missable)
)
for event_or_missable in after_events
) and all(
(
event_or_missable.startswith("EVENT_")
and not self.events.get_event(event_or_missable)
)
or (
event_or_missable.startswith("HS_")
and not self.missables.get_missable(event_or_missable)
)
for event_or_missable in MAP_ID_COMPLETION_EVENTS[map_id]
for event_or_missable in until_events
):
return True
return False

0 comments on commit 6b2c8b5

Please sign in to comment.