Generate heal location constants automatically, move data back to a single file.

This commit is contained in:
GriffinR
2025-02-03 20:18:34 -05:00
parent 678fdf9979
commit cdadd7d2ed
28 changed files with 199 additions and 249 deletions
@@ -0,0 +1,14 @@
#ifndef GUARD_CONSTANTS_HEAL_LOCATIONS_H
#define GUARD_CONSTANTS_HEAL_LOCATIONS_H
{{ doNotModifyHeader }}
enum {
HEAL_LOCATION_NONE,
## for heal_location in heal_locations
{{ heal_location.id }},
## endfor
NUM_HEAL_LOCATIONS
};
#endif // GUARD_CONSTANTS_HEAL_LOCATIONS_H
+136
View File
@@ -0,0 +1,136 @@
{
"heal_locations": [
{
"id": "HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F",
"map": "MAP_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F",
"x": 4,
"y": 2
},
{
"id": "HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE_2F",
"map": "MAP_LITTLEROOT_TOWN_MAYS_HOUSE_2F",
"x": 4,
"y": 2
},
{
"id": "HEAL_LOCATION_PETALBURG_CITY",
"map": "MAP_PETALBURG_CITY",
"x": 20,
"y": 17
},
{
"id": "HEAL_LOCATION_SLATEPORT_CITY",
"map": "MAP_SLATEPORT_CITY",
"x": 19,
"y": 20
},
{
"id": "HEAL_LOCATION_MAUVILLE_CITY",
"map": "MAP_MAUVILLE_CITY",
"x": 22,
"y": 6
},
{
"id": "HEAL_LOCATION_RUSTBORO_CITY",
"map": "MAP_RUSTBORO_CITY",
"x": 16,
"y": 39
},
{
"id": "HEAL_LOCATION_FORTREE_CITY",
"map": "MAP_FORTREE_CITY",
"x": 5,
"y": 7
},
{
"id": "HEAL_LOCATION_LILYCOVE_CITY",
"map": "MAP_LILYCOVE_CITY",
"x": 24,
"y": 15
},
{
"id": "HEAL_LOCATION_MOSSDEEP_CITY",
"map": "MAP_MOSSDEEP_CITY",
"x": 28,
"y": 17
},
{
"id": "HEAL_LOCATION_SOOTOPOLIS_CITY",
"map": "MAP_SOOTOPOLIS_CITY",
"x": 43,
"y": 32
},
{
"id": "HEAL_LOCATION_EVER_GRANDE_CITY",
"map": "MAP_EVER_GRANDE_CITY",
"x": 27,
"y": 49
},
{
"id": "HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE",
"map": "MAP_LITTLEROOT_TOWN",
"x": 5,
"y": 9
},
{
"id": "HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE",
"map": "MAP_LITTLEROOT_TOWN",
"x": 14,
"y": 9
},
{
"id": "HEAL_LOCATION_OLDALE_TOWN",
"map": "MAP_OLDALE_TOWN",
"x": 6,
"y": 17
},
{
"id": "HEAL_LOCATION_DEWFORD_TOWN",
"map": "MAP_DEWFORD_TOWN",
"x": 2,
"y": 11
},
{
"id": "HEAL_LOCATION_LAVARIDGE_TOWN",
"map": "MAP_LAVARIDGE_TOWN",
"x": 9,
"y": 7
},
{
"id": "HEAL_LOCATION_FALLARBOR_TOWN",
"map": "MAP_FALLARBOR_TOWN",
"x": 14,
"y": 8
},
{
"id": "HEAL_LOCATION_VERDANTURF_TOWN",
"map": "MAP_VERDANTURF_TOWN",
"x": 16,
"y": 4
},
{
"id": "HEAL_LOCATION_PACIFIDLOG_TOWN",
"map": "MAP_PACIFIDLOG_TOWN",
"x": 8,
"y": 16
},
{
"id": "HEAL_LOCATION_EVER_GRANDE_CITY_POKEMON_LEAGUE",
"map": "MAP_EVER_GRANDE_CITY",
"x": 18,
"y": 6
},
{
"id": "HEAL_LOCATION_SOUTHERN_ISLAND_EXTERIOR",
"map": "MAP_SOUTHERN_ISLAND_EXTERIOR",
"x": 15,
"y": 20
},
{
"id": "HEAL_LOCATION_BATTLE_FRONTIER_OUTSIDE_EAST",
"map": "MAP_BATTLE_FRONTIER_OUTSIDE_EAST",
"x": 3,
"y": 52
}
]
}
+28
View File
@@ -0,0 +1,28 @@
{{ doNotModifyHeader }}
static const struct HealLocation sHealLocations[NUM_HEAL_LOCATIONS - 1] = {
## for heal_location in heal_locations
[{{ heal_location.id }} - 1] = {
.mapGroup = MAP_GROUP({{ heal_location.map }}),
.mapNum = MAP_NUM({{ heal_location.map }}),
.x = {{ heal_location.x }},
.y = {{ heal_location.y }},
},
## endfor
};
static const u16 sWhiteoutRespawnHealCenterMapIdxs[][2] = {
## for heal_location in heal_locations
{% if existsIn(heal_location, "respawn_map") %}
[{{ heal_location.id }} - 1] = { MAP_GROUP({{ heal_location.respawn_map }}), MAP_NUM({{ heal_location.respawn_map }})},
{% endif %}
## endfor
};
static const u8 sWhiteoutRespawnHealerNpcIds[] = {
## for heal_location in heal_locations
{% if existsIn(heal_location, "respawn_npc") %}
[{{ heal_location.id }} - 1] = {{ heal_location.respawn_npc }},
{% endif %}
## endfor
};