From 6f312dab270ffd22a6908546caeae29cb381182c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 20 Mar 2020 03:04:38 -0400 Subject: [PATCH] Index heal location data, use better names --- .../scripts.inc | 2 +- .../scripts.inc | 2 +- include/constants/heal_locations.h | 8 ++-- src/data/heal_locations.h | 44 +++++++++---------- src/heal_location.c | 1 + src/region_map.c | 6 +-- 6 files changed, 32 insertions(+), 31 deletions(-) diff --git a/data/maps/EverGrandeCity_PokemonCenter_1F/scripts.inc b/data/maps/EverGrandeCity_PokemonCenter_1F/scripts.inc index 95be20f75170..333bffc3709d 100644 --- a/data/maps/EverGrandeCity_PokemonCenter_1F/scripts.inc +++ b/data/maps/EverGrandeCity_PokemonCenter_1F/scripts.inc @@ -4,7 +4,7 @@ EverGrandeCity_PokemonCenter_1F_MapScripts:: @ 8229A34 .byte 0 EverGrandeCity_PokemonCenter_1F_OnTransition: @ 8229A3F - setrespawn HEAL_LOCATION_EVER_GRANDE_CITY_1 + setrespawn HEAL_LOCATION_EVER_GRANDE_CITY call_if_unset FLAG_MET_SCOTT_IN_EVERGRANDE, EverGrandeCity_PokemonCenter_1F_EventScript_TryShowScott end diff --git a/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc b/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc index 72c069243c21..c69c28d8b4ce 100644 --- a/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc +++ b/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc @@ -4,7 +4,7 @@ EverGrandeCity_PokemonLeague_1F_MapScripts:: @ 82295D2 .byte 0 EverGrandeCity_PokemonLeague_1F_OnTransition: @ 82295DD - setrespawn HEAL_LOCATION_EVER_GRANDE_CITY_2 + setrespawn HEAL_LOCATION_EVER_GRANDE_CITY_POKEMON_LEAGUE setflag FLAG_LANDMARK_POKEMON_LEAGUE call_if_unset FLAG_ENTERED_ELITE_FOUR, EverGrandeCity_PokemonLeague_1F_EventScript_GuardsBlockDoor end diff --git a/include/constants/heal_locations.h b/include/constants/heal_locations.h index 64c8956a9b64..272a69dfa957 100644 --- a/include/constants/heal_locations.h +++ b/include/constants/heal_locations.h @@ -11,16 +11,16 @@ #define HEAL_LOCATION_LILYCOVE_CITY 8 #define HEAL_LOCATION_MOSSDEEP_CITY 9 #define HEAL_LOCATION_SOOTOPOLIS_CITY 10 -#define HEAL_LOCATION_EVER_GRANDE_CITY_1 11 -#define HEAL_LOCATION_LITTLEROOT_TOWN_1 12 -#define HEAL_LOCATION_LITTLEROOT_TOWN_2 13 +#define HEAL_LOCATION_EVER_GRANDE_CITY 11 +#define HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE 12 +#define HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE 13 #define HEAL_LOCATION_OLDALE_TOWN 14 #define HEAL_LOCATION_DEWFORD_TOWN 15 #define HEAL_LOCATION_LAVARIDGE_TOWN 16 #define HEAL_LOCATION_FALLARBOR_TOWN 17 #define HEAL_LOCATION_VERDANTURF_TOWN 18 #define HEAL_LOCATION_PACIFIDLOG_TOWN 19 -#define HEAL_LOCATION_EVER_GRANDE_CITY_2 20 +#define HEAL_LOCATION_EVER_GRANDE_CITY_POKEMON_LEAGUE 20 #define HEAL_LOCATION_SOUTHERN_ISLAND_EXTERIOR 21 #define HEAL_LOCATION_BATTLE_FRONTIER_OUTSIDE_EAST 22 diff --git a/src/data/heal_locations.h b/src/data/heal_locations.h index 613bcebe8339..04530a1dbf2c 100644 --- a/src/data/heal_locations.h +++ b/src/data/heal_locations.h @@ -1,25 +1,25 @@ static const struct HealLocation sHealLocations[] = { - {MAP_GROUP(LITTLEROOT_TOWN_BRENDANS_HOUSE_2F), MAP_NUM(LITTLEROOT_TOWN_BRENDANS_HOUSE_2F), 4, 2}, - {MAP_GROUP(LITTLEROOT_TOWN_MAYS_HOUSE_2F), MAP_NUM(LITTLEROOT_TOWN_MAYS_HOUSE_2F), 4, 2}, - {MAP_GROUP(PETALBURG_CITY), MAP_NUM(PETALBURG_CITY), 20, 17}, - {MAP_GROUP(SLATEPORT_CITY), MAP_NUM(SLATEPORT_CITY), 19, 20}, - {MAP_GROUP(MAUVILLE_CITY), MAP_NUM(MAUVILLE_CITY), 22, 6}, - {MAP_GROUP(RUSTBORO_CITY), MAP_NUM(RUSTBORO_CITY), 16, 39}, - {MAP_GROUP(FORTREE_CITY), MAP_NUM(FORTREE_CITY), 5, 7}, - {MAP_GROUP(LILYCOVE_CITY), MAP_NUM(LILYCOVE_CITY), 24, 15}, - {MAP_GROUP(MOSSDEEP_CITY), MAP_NUM(MOSSDEEP_CITY), 28, 17}, - {MAP_GROUP(SOOTOPOLIS_CITY), MAP_NUM(SOOTOPOLIS_CITY), 43, 32}, - {MAP_GROUP(EVER_GRANDE_CITY), MAP_NUM(EVER_GRANDE_CITY), 27, 49}, - {MAP_GROUP(LITTLEROOT_TOWN), MAP_NUM(LITTLEROOT_TOWN), 5, 9}, - {MAP_GROUP(LITTLEROOT_TOWN), MAP_NUM(LITTLEROOT_TOWN), 14, 9}, - {MAP_GROUP(OLDALE_TOWN), MAP_NUM(OLDALE_TOWN), 6, 17}, - {MAP_GROUP(DEWFORD_TOWN), MAP_NUM(DEWFORD_TOWN), 2, 11}, - {MAP_GROUP(LAVARIDGE_TOWN), MAP_NUM(LAVARIDGE_TOWN), 9, 7}, - {MAP_GROUP(FALLARBOR_TOWN), MAP_NUM(FALLARBOR_TOWN), 14, 8}, - {MAP_GROUP(VERDANTURF_TOWN), MAP_NUM(VERDANTURF_TOWN), 16, 4}, - {MAP_GROUP(PACIFIDLOG_TOWN), MAP_NUM(PACIFIDLOG_TOWN), 8, 16}, - {MAP_GROUP(EVER_GRANDE_CITY), MAP_NUM(EVER_GRANDE_CITY), 18, 6}, - {MAP_GROUP(SOUTHERN_ISLAND_EXTERIOR), MAP_NUM(SOUTHERN_ISLAND_EXTERIOR), 15, 20}, - {MAP_GROUP(BATTLE_FRONTIER_OUTSIDE_EAST), MAP_NUM(BATTLE_FRONTIER_OUTSIDE_EAST), 3, 52}, + [HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F - 1] = {MAP_GROUP(LITTLEROOT_TOWN_BRENDANS_HOUSE_2F), MAP_NUM(LITTLEROOT_TOWN_BRENDANS_HOUSE_2F), 4, 2}, + [HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE_2F - 1] = {MAP_GROUP(LITTLEROOT_TOWN_MAYS_HOUSE_2F), MAP_NUM(LITTLEROOT_TOWN_MAYS_HOUSE_2F), 4, 2}, + [HEAL_LOCATION_PETALBURG_CITY - 1] = {MAP_GROUP(PETALBURG_CITY), MAP_NUM(PETALBURG_CITY), 20, 17}, + [HEAL_LOCATION_SLATEPORT_CITY - 1] = {MAP_GROUP(SLATEPORT_CITY), MAP_NUM(SLATEPORT_CITY), 19, 20}, + [HEAL_LOCATION_MAUVILLE_CITY - 1] = {MAP_GROUP(MAUVILLE_CITY), MAP_NUM(MAUVILLE_CITY), 22, 6}, + [HEAL_LOCATION_RUSTBORO_CITY - 1] = {MAP_GROUP(RUSTBORO_CITY), MAP_NUM(RUSTBORO_CITY), 16, 39}, + [HEAL_LOCATION_FORTREE_CITY - 1] = {MAP_GROUP(FORTREE_CITY), MAP_NUM(FORTREE_CITY), 5, 7}, + [HEAL_LOCATION_LILYCOVE_CITY - 1] = {MAP_GROUP(LILYCOVE_CITY), MAP_NUM(LILYCOVE_CITY), 24, 15}, + [HEAL_LOCATION_MOSSDEEP_CITY - 1] = {MAP_GROUP(MOSSDEEP_CITY), MAP_NUM(MOSSDEEP_CITY), 28, 17}, + [HEAL_LOCATION_SOOTOPOLIS_CITY - 1] = {MAP_GROUP(SOOTOPOLIS_CITY), MAP_NUM(SOOTOPOLIS_CITY), 43, 32}, + [HEAL_LOCATION_EVER_GRANDE_CITY - 1] = {MAP_GROUP(EVER_GRANDE_CITY), MAP_NUM(EVER_GRANDE_CITY), 27, 49}, + [HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE - 1] = {MAP_GROUP(LITTLEROOT_TOWN), MAP_NUM(LITTLEROOT_TOWN), 5, 9}, + [HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE - 1] = {MAP_GROUP(LITTLEROOT_TOWN), MAP_NUM(LITTLEROOT_TOWN), 14, 9}, + [HEAL_LOCATION_OLDALE_TOWN - 1] = {MAP_GROUP(OLDALE_TOWN), MAP_NUM(OLDALE_TOWN), 6, 17}, + [HEAL_LOCATION_DEWFORD_TOWN - 1] = {MAP_GROUP(DEWFORD_TOWN), MAP_NUM(DEWFORD_TOWN), 2, 11}, + [HEAL_LOCATION_LAVARIDGE_TOWN - 1] = {MAP_GROUP(LAVARIDGE_TOWN), MAP_NUM(LAVARIDGE_TOWN), 9, 7}, + [HEAL_LOCATION_FALLARBOR_TOWN - 1] = {MAP_GROUP(FALLARBOR_TOWN), MAP_NUM(FALLARBOR_TOWN), 14, 8}, + [HEAL_LOCATION_VERDANTURF_TOWN - 1] = {MAP_GROUP(VERDANTURF_TOWN), MAP_NUM(VERDANTURF_TOWN), 16, 4}, + [HEAL_LOCATION_PACIFIDLOG_TOWN - 1] = {MAP_GROUP(PACIFIDLOG_TOWN), MAP_NUM(PACIFIDLOG_TOWN), 8, 16}, + [HEAL_LOCATION_EVER_GRANDE_CITY_POKEMON_LEAGUE - 1] = {MAP_GROUP(EVER_GRANDE_CITY), MAP_NUM(EVER_GRANDE_CITY), 18, 6}, + [HEAL_LOCATION_SOUTHERN_ISLAND_EXTERIOR - 1] = {MAP_GROUP(SOUTHERN_ISLAND_EXTERIOR), MAP_NUM(SOUTHERN_ISLAND_EXTERIOR), 15, 20}, + [HEAL_LOCATION_BATTLE_FRONTIER_OUTSIDE_EAST - 1] = {MAP_GROUP(BATTLE_FRONTIER_OUTSIDE_EAST), MAP_NUM(BATTLE_FRONTIER_OUTSIDE_EAST), 3, 52}, }; diff --git a/src/heal_location.c b/src/heal_location.c index b378e8e8cbfa..5eda24d67ad5 100644 --- a/src/heal_location.c +++ b/src/heal_location.c @@ -1,6 +1,7 @@ #include "global.h" #include "heal_location.h" #include "constants/maps.h" +#include "constants/heal_locations.h" #include "data/heal_locations.h" diff --git a/src/region_map.c b/src/region_map.c index 500e9e38352f..394f4cc9119f 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -301,7 +301,7 @@ static const u8 sMapHealLocations[][3] = {MAP_GROUP(LILYCOVE_CITY), MAP_NUM(LILYCOVE_CITY), HEAL_LOCATION_LILYCOVE_CITY}, {MAP_GROUP(MOSSDEEP_CITY), MAP_NUM(MOSSDEEP_CITY), HEAL_LOCATION_MOSSDEEP_CITY}, {MAP_GROUP(SOOTOPOLIS_CITY), MAP_NUM(SOOTOPOLIS_CITY), HEAL_LOCATION_SOOTOPOLIS_CITY}, - {MAP_GROUP(EVER_GRANDE_CITY), MAP_NUM(EVER_GRANDE_CITY), HEAL_LOCATION_EVER_GRANDE_CITY_1}, + {MAP_GROUP(EVER_GRANDE_CITY), MAP_NUM(EVER_GRANDE_CITY), HEAL_LOCATION_EVER_GRANDE_CITY}, {MAP_GROUP(ROUTE101), MAP_NUM(ROUTE101), 0}, {MAP_GROUP(ROUTE102), MAP_NUM(ROUTE102), 0}, {MAP_GROUP(ROUTE103), MAP_NUM(ROUTE103), 0}, @@ -1998,10 +1998,10 @@ static void CB_ExitFlyMap(void) SetWarpDestinationToHealLocation(HEAL_LOCATION_BATTLE_FRONTIER_OUTSIDE_EAST); break; case MAPSEC_LITTLEROOT_TOWN: - SetWarpDestinationToHealLocation(gSaveBlock2Ptr->playerGender == MALE ? HEAL_LOCATION_LITTLEROOT_TOWN_1 : HEAL_LOCATION_LITTLEROOT_TOWN_2); + SetWarpDestinationToHealLocation(gSaveBlock2Ptr->playerGender == MALE ? HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE : HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE); break; case MAPSEC_EVER_GRANDE_CITY: - SetWarpDestinationToHealLocation(FlagGet(FLAG_LANDMARK_POKEMON_LEAGUE) && sFlyMap->regionMap.posWithinMapSec == 0 ? HEAL_LOCATION_EVER_GRANDE_CITY_2 : HEAL_LOCATION_EVER_GRANDE_CITY_1); + SetWarpDestinationToHealLocation(FlagGet(FLAG_LANDMARK_POKEMON_LEAGUE) && sFlyMap->regionMap.posWithinMapSec == 0 ? HEAL_LOCATION_EVER_GRANDE_CITY_POKEMON_LEAGUE : HEAL_LOCATION_EVER_GRANDE_CITY); break; default: if (sMapHealLocations[sFlyMap->regionMap.mapSecId][2] != 0)