Skip to content

Commit

Permalink
Move heal locations data to their associated map.json (#869)
Browse files Browse the repository at this point in the history
  • Loading branch information
GriffinRichards authored Oct 11, 2024
1 parent 68acbcf commit 0696597
Show file tree
Hide file tree
Showing 30 changed files with 322 additions and 112 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ $(C_OBJECTS): $(BUILD_DIR)/%.o: %.c $$(C_DEP)
# Only .s files in data need preproc
$(BUILD_DIR)/data/%.o: data/%.s $$(ASM_DEP)
@echo "$(AS) <flags> -o $@ $<"
@$(PREPROC) $< charmap.txt | $(CPP) -I include | $(AS) $(ASFLAGS) -o $@
@$(PREPROC) $< charmap.txt | $(CPP) -I include | $(PREPROC) -ie $< charmap.txt | $(AS) $(ASFLAGS) -o $@

$(BUILD_DIR)/%.o: %.s $$(ASM_DEP)
@echo "$(AS) <flags> -o $@ $<"
Expand Down
7 changes: 7 additions & 0 deletions data/maps/BattleTower_Outside/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,12 @@
"player_facing_dir": "BG_EVENT_PLAYER_FACING_ANY",
"script": "BattleTower_Outside_EventScript_16025A"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_BATTLE_TOWER_OUTSIDE",
"x": 14,
"y": 9
}
]
}
7 changes: 7 additions & 0 deletions data/maps/DewfordTown/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,12 @@
"player_facing_dir": "BG_EVENT_PLAYER_FACING_ANY",
"script": "DewfordTown_EventScript_14E0BD"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_DEWFORD_TOWN",
"x": 2,
"y": 11
}
]
}
12 changes: 12 additions & 0 deletions data/maps/EverGrandeCity/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,17 @@
"player_facing_dir": "BG_EVENT_PLAYER_FACING_NORTH",
"script": "Common_EventScript_PokemonCenterSign"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_EVER_GRANDE_CITY",
"x": 27,
"y": 49
},
{
"id": "HEAL_LOCATION_EVER_GRANDE_CITY_POKEMON_LEAGUE",
"x": 18,
"y": 6
}
]
}
7 changes: 7 additions & 0 deletions data/maps/FallarborTown/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,12 @@
"item": "ITEM_NUGGET",
"flag": "FLAG_HIDDEN_ITEM_1C"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_FALLARBOR_TOWN",
"x": 14,
"y": 8
}
]
}
7 changes: 7 additions & 0 deletions data/maps/FortreeCity/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,5 +229,12 @@
"player_facing_dir": "BG_EVENT_PLAYER_FACING_NORTH",
"script": "Common_EventScript_PokemartSign"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_FORTREE_CITY",
"x": 5,
"y": 7
}
]
}
7 changes: 7 additions & 0 deletions data/maps/LavaridgeTown/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,5 +255,12 @@
"item": "ITEM_ICE_HEAL",
"flag": "FLAG_HIDDEN_ITEM_0"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_LAVARIDGE_TOWN",
"x": 9,
"y": 7
}
]
}
7 changes: 7 additions & 0 deletions data/maps/LilycoveCity/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -457,5 +457,12 @@
"item": "ITEM_POKE_BALL",
"flag": "FLAG_HIDDEN_ITEM_4B"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_LILYCOVE_CITY",
"x": 24,
"y": 15
}
]
}
12 changes: 12 additions & 0 deletions data/maps/LittlerootTown/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,5 +235,17 @@
"player_facing_dir": "BG_EVENT_PLAYER_FACING_ANY",
"script": "LittlerootTown_EventScript_14D834"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE",
"x": 5,
"y": 9
},
{
"id": "HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE",
"x": 14,
"y": 9
}
]
}
7 changes: 7 additions & 0 deletions data/maps/LittlerootTown_BrendansHouse_2F/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,5 +237,12 @@
"player_facing_dir": "BG_EVENT_PLAYER_FACING_ANY",
"script": "LittlerootTown_BrendansHouse_2F_EventScript_152870"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F",
"x": 4,
"y": 2
}
]
}
7 changes: 7 additions & 0 deletions data/maps/LittlerootTown_MaysHouse_2F/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,5 +250,12 @@
"player_facing_dir": "BG_EVENT_PLAYER_FACING_ANY",
"script": "LittlerootTown_MaysHouse_2F_EventScript_152C39"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE_2F",
"x": 4,
"y": 2
}
]
}
7 changes: 7 additions & 0 deletions data/maps/MauvilleCity/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,5 +267,12 @@
"player_facing_dir": "BG_EVENT_PLAYER_FACING_ANY",
"script": "MauvilleCity_EventScript_14C099"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_MAUVILLE_CITY",
"x": 22,
"y": 6
}
]
}
7 changes: 7 additions & 0 deletions data/maps/MossdeepCity/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,5 +320,12 @@
"player_facing_dir": "BG_EVENT_PLAYER_FACING_ANY",
"script": "MossdeepCity_EventScript_14CFE4"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_MOSSDEEP_CITY",
"x": 28,
"y": 17
}
]
}
7 changes: 7 additions & 0 deletions data/maps/OldaleTown/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,12 @@
"player_facing_dir": "BG_EVENT_PLAYER_FACING_NORTH",
"script": "Common_EventScript_PokemartSign"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_OLDALE_TOWN",
"x": 6,
"y": 17
}
]
}
7 changes: 7 additions & 0 deletions data/maps/PacifidlogTown/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,12 @@
"player_facing_dir": "BG_EVENT_PLAYER_FACING_NORTH",
"script": "Common_EventScript_PokemonCenterSign"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_PACIFIDLOG_TOWN",
"x": 8,
"y": 16
}
]
}
7 changes: 7 additions & 0 deletions data/maps/PetalburgCity/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -287,5 +287,12 @@
"item": "ITEM_RARE_CANDY",
"flag": "FLAG_HIDDEN_ITEM_5F"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_PETALBURG_CITY",
"x": 20,
"y": 17
}
]
}
7 changes: 7 additions & 0 deletions data/maps/RustboroCity/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -496,5 +496,12 @@
"player_facing_dir": "BG_EVENT_PLAYER_FACING_ANY",
"script": "RustboroCity_EventScript_14C440"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_RUSTBORO_CITY",
"x": 16,
"y": 39
}
]
}
7 changes: 7 additions & 0 deletions data/maps/SlateportCity/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -608,5 +608,12 @@
"player_facing_dir": "BG_EVENT_PLAYER_FACING_ANY",
"script": "SlateportCity_EventScript_14BC3C"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_SLATEPORT_CITY",
"x": 19,
"y": 20
}
]
}
7 changes: 7 additions & 0 deletions data/maps/SootopolisCity/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,5 +301,12 @@
"player_facing_dir": "BG_EVENT_PLAYER_FACING_ANY",
"script": "SootopolisCity_EventScript_14D2F6"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_SOOTOPOLIS_CITY",
"x": 43,
"y": 32
}
]
}
7 changes: 7 additions & 0 deletions data/maps/SouthernIsland_Exterior/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,12 @@
"player_facing_dir": "BG_EVENT_PLAYER_FACING_ANY",
"script": "SouthernIsland_Exterior_EventScript_160B4A"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_SOUTHERN_ISLAND_EXTERIOR",
"x": 15,
"y": 20
}
]
}
7 changes: 7 additions & 0 deletions data/maps/VerdanturfTown/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,5 +192,12 @@
"player_facing_dir": "BG_EVENT_PLAYER_FACING_ANY",
"script": "VerdanturfTown_EventScript_14E8E5"
}
],
"heal_locations": [
{
"id": "HEAL_LOCATION_VERDANTURF_TOWN",
"x": 16,
"y": 4
}
]
}
47 changes: 25 additions & 22 deletions include/constants/heal_locations.h
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
#ifndef GUARD_CONSTANTS_HEAL_LOCATIONS_H
#define GUARD_CONSTANTS_HEAL_LOCATIONS_H

#define HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F 1
#define HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE_2F 2
#define HEAL_LOCATION_PETALBURG_CITY 3
#define HEAL_LOCATION_SLATEPORT_CITY 4
#define HEAL_LOCATION_MAUVILLE_CITY 5
#define HEAL_LOCATION_RUSTBORO_CITY 6
#define HEAL_LOCATION_FORTREE_CITY 7
#define HEAL_LOCATION_LILYCOVE_CITY 8
#define HEAL_LOCATION_MOSSDEEP_CITY 9
#define HEAL_LOCATION_SOOTOPOLIS_CITY 10
#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_POKEMON_LEAGUE 20
#define HEAL_LOCATION_BATTLE_TOWER_OUTSIDE 21
#define HEAL_LOCATION_SOUTHERN_ISLAND_EXTERIOR 22
enum {
HEAL_LOCATION_NONE,
HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F,
HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE_2F,
HEAL_LOCATION_PETALBURG_CITY,
HEAL_LOCATION_SLATEPORT_CITY,
HEAL_LOCATION_MAUVILLE_CITY,
HEAL_LOCATION_RUSTBORO_CITY,
HEAL_LOCATION_FORTREE_CITY,
HEAL_LOCATION_LILYCOVE_CITY,
HEAL_LOCATION_MOSSDEEP_CITY,
HEAL_LOCATION_SOOTOPOLIS_CITY,
HEAL_LOCATION_EVER_GRANDE_CITY,
HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE,
HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE,
HEAL_LOCATION_OLDALE_TOWN,
HEAL_LOCATION_DEWFORD_TOWN,
HEAL_LOCATION_LAVARIDGE_TOWN,
HEAL_LOCATION_FALLARBOR_TOWN,
HEAL_LOCATION_VERDANTURF_TOWN,
HEAL_LOCATION_PACIFIDLOG_TOWN,
HEAL_LOCATION_EVER_GRANDE_CITY_POKEMON_LEAGUE,
HEAL_LOCATION_BATTLE_TOWER_OUTSIDE,
HEAL_LOCATION_SOUTHERN_ISLAND_EXTERIOR,
};

#endif // GUARD_CONSTANTS_HEAL_LOCATIONS_H
4 changes: 2 additions & 2 deletions include/heal_location.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

struct HealLocation
{
s8 group;
s8 map;
s8 mapGroup;
s8 mapNum;
u16 x;
u16 y;
};
Expand Down
5 changes: 5 additions & 0 deletions map_data_rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ INCLUDECONSTS_OUTDIR := include/constants

AUTO_GEN_TARGETS += $(INCLUDECONSTS_OUTDIR)/map_groups.h
AUTO_GEN_TARGETS += $(INCLUDECONSTS_OUTDIR)/layouts.h
AUTO_GEN_TARGETS += $(DATA_SRC_SUBDIR)/heal_locations.h

MAP_DIRS := $(dir $(wildcard $(MAPS_DIR)/*/map.json))
MAP_CONNECTIONS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/connections.inc,$(MAP_DIRS))
MAP_EVENTS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/events.inc,$(MAP_DIRS))
MAP_HEADERS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/header.inc,$(MAP_DIRS))
MAP_JSONS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/map.json,$(MAP_DIRS))

$(BUILD_DIR)/data/maps.o: data/maps.s $(LAYOUTS_DIR)/layouts.inc $(LAYOUTS_DIR)/layouts_table.inc $(MAPS_DIR)/headers.inc $(MAPS_DIR)/groups.inc $(MAPS_DIR)/connections.inc $(MAP_CONNECTIONS) $(MAP_HEADERS)
$(PREPROC) $< charmap.txt | $(CPP) -I include -nostdinc -undef -Wno-unicode - | $(PREPROC) -ie $< charmap.txt | $(AS) $(ASFLAGS) -o $@
Expand All @@ -30,3 +32,6 @@ $(MAPS_OUTDIR)/connections.inc $(MAPS_OUTDIR)/groups.inc $(MAPS_OUTDIR)/events.i

$(LAYOUTS_OUTDIR)/layouts.inc $(LAYOUTS_OUTDIR)/layouts_table.inc $(INCLUDECONSTS_OUTDIR)/layouts.h: $(LAYOUTS_DIR)/layouts.json
$(MAPJSON) layouts ruby $< $(LAYOUTS_OUTDIR) $(INCLUDECONSTS_OUTDIR)

$(DATA_SRC_SUBDIR)/heal_locations.h: $(MAP_JSONS)
@$(MAPJSON) heal_locations ruby $^ $(DATA_SRC_SUBDIR)/heal_locations.h
1 change: 1 addition & 0 deletions src/data/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
heal_locations.h
wild_encounters.h
25 changes: 0 additions & 25 deletions src/data/heal_locations.h

This file was deleted.

Loading

0 comments on commit 0696597

Please sign in to comment.