From 6b92ee150d6900bb865ad8e3fefd8b0cb31c9f38 Mon Sep 17 00:00:00 2001 From: thatguy11325 <148832074+thatguy11325@users.noreply.github.com> Date: Tue, 27 Aug 2024 22:16:08 -0400 Subject: [PATCH] Safari zone map id rewards --- pokemonred_puffer/data/map.py | 86 ++++++++++++++++++-------------- pokemonred_puffer/environment.py | 5 +- 2 files changed, 51 insertions(+), 40 deletions(-) diff --git a/pokemonred_puffer/data/map.py b/pokemonred_puffer/data/map.py index 8996b63..63e42a2 100644 --- a/pokemonred_puffer/data/map.py +++ b/pokemonred_puffer/data/map.py @@ -273,42 +273,52 @@ 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.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"], } diff --git a/pokemonred_puffer/environment.py b/pokemonred_puffer/environment.py index 06386fc..b8489e7 100644 --- a/pokemonred_puffer/environment.py +++ b/pokemonred_puffer/environment.py @@ -1497,6 +1497,7 @@ def update_seen_coords(self): self.explore_map[local_to_global(y_pos, x_pos, map_n)] + inc, self.exploration_max, ) * self.map_id_scaling(map_n) + print(self.map_id_scaling(map_n)) # self.seen_global_coords[local_to_global(y_pos, x_pos, map_n)] = 1 self.seen_map_ids[map_n] = 1 @@ -1724,14 +1725,14 @@ def map_id_scaling(self, map_n: int) -> float: if map_id not in MAP_ID_COMPLETION_EVENTS: return 1.0 - event_or_missable = MAP_ID_COMPLETION_EVENTS[map_id] - if ( + if 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] ): return self.map_id_scalefactor return 1.0