Skip to content

Commit

Permalink
Safari zone map id rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
thatguy11325 committed Aug 28, 2024
1 parent a47c4ef commit 6b92ee1
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 40 deletions.
86 changes: 48 additions & 38 deletions pokemonred_puffer/data/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
}
5 changes: 3 additions & 2 deletions pokemonred_puffer/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

0 comments on commit 6b92ee1

Please sign in to comment.