mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Merge remote-tracking branch 'garakmon/heal-loc-2'
This commit is contained in:
commit
18d5186630
@ -5,6 +5,7 @@
|
||||
#include "constants/songs.h"
|
||||
#include "constants/species.h"
|
||||
#include "constants/vars.h"
|
||||
#include "constants/heal_locations.h"
|
||||
#include "constants/trainers.h"
|
||||
.include "asm/macros.inc"
|
||||
.include "asm/macros/event.inc"
|
||||
@ -3346,7 +3347,7 @@ EventScript_2736D9:: @ 82736D9
|
||||
end
|
||||
|
||||
EventScript_2736F4:: @ 82736F4
|
||||
setrespawn 16
|
||||
setrespawn HEAL_LOCATION_LAVARIDGE_TOWN
|
||||
return
|
||||
|
||||
EventScript_2736F8:: @ 82736F8
|
||||
|
@ -4,7 +4,7 @@ BattleFrontier_PokemonCenter_1F_MapScripts:: @ 82678F9
|
||||
.byte 0
|
||||
|
||||
BattleFrontier_PokemonCenter_1F_MapScript1_267904: @ 8267904
|
||||
setrespawn 22
|
||||
setrespawn HEAL_LOCATION_BATTLE_FRONTIER_OUTSIDE_EAST
|
||||
end
|
||||
|
||||
BattleFrontier_PokemonCenter_1F_EventScript_267908:: @ 8267908
|
||||
|
@ -4,7 +4,7 @@ DewfordTown_PokemonCenter_1F_MapScripts:: @ 81FC523
|
||||
.byte 0
|
||||
|
||||
DewfordTown_PokemonCenter_1F_MapScript1_1FC52E: @ 81FC52E
|
||||
setrespawn 15
|
||||
setrespawn HEAL_LOCATION_DEWFORD_TOWN
|
||||
call DewfordTown_PokemonCenter_1F_EventScript_2718DE
|
||||
end
|
||||
|
||||
|
@ -51,7 +51,7 @@ EverGrandeCity_HallOfFame_EventScript_229850:: @ 8229850
|
||||
end
|
||||
|
||||
EverGrandeCity_HallOfFame_EventScript_2298E9:: @ 82298E9
|
||||
setrespawn 1
|
||||
setrespawn HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F
|
||||
fadescreenspeed 1, 24
|
||||
special GameClear
|
||||
waitstate
|
||||
@ -59,7 +59,7 @@ EverGrandeCity_HallOfFame_EventScript_2298E9:: @ 82298E9
|
||||
end
|
||||
|
||||
EverGrandeCity_HallOfFame_EventScript_2298F5:: @ 82298F5
|
||||
setrespawn 2
|
||||
setrespawn HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE_2F
|
||||
fadescreenspeed 1, 24
|
||||
special GameClear
|
||||
waitstate
|
||||
|
@ -4,7 +4,7 @@ EverGrandeCity_PokemonCenter_1F_MapScripts:: @ 8229A34
|
||||
.byte 0
|
||||
|
||||
EverGrandeCity_PokemonCenter_1F_MapScript1_229A3F: @ 8229A3F
|
||||
setrespawn 11
|
||||
setrespawn HEAL_LOCATION_EVER_GRANDE_CITY_1
|
||||
checkflag FLAG_0x1CF
|
||||
call_if 0, EverGrandeCity_PokemonCenter_1F_EventScript_229A4C
|
||||
end
|
||||
|
@ -4,7 +4,7 @@ EverGrandeCity_PokemonLeague_1F_MapScripts:: @ 82295D2
|
||||
.byte 0
|
||||
|
||||
EverGrandeCity_PokemonLeague_1F_MapScript1_2295DD: @ 82295DD
|
||||
setrespawn 20
|
||||
setrespawn HEAL_LOCATION_EVER_GRANDE_CITY_2
|
||||
setflag FLAG_LANDMARK_POKEMON_LEAGUE
|
||||
checkflag FLAG_0x107
|
||||
call_if 0, EverGrandeCity_PokemonLeague_1F_EventScript_2295ED
|
||||
|
@ -4,7 +4,7 @@ FallarborTown_PokemonCenter_1F_MapScripts:: @ 8200BCD
|
||||
.byte 0
|
||||
|
||||
FallarborTown_PokemonCenter_1F_MapScript1_200BD8: @ 8200BD8
|
||||
setrespawn 17
|
||||
setrespawn HEAL_LOCATION_FALLARBOR_TOWN
|
||||
call FallarborTown_PokemonCenter_1F_EventScript_2718DE
|
||||
end
|
||||
|
||||
|
@ -4,7 +4,7 @@ FortreeCity_PokemonCenter_1F_MapScripts:: @ 82173D8
|
||||
.byte 0
|
||||
|
||||
FortreeCity_PokemonCenter_1F_MapScript1_2173E3: @ 82173E3
|
||||
setrespawn 7
|
||||
setrespawn HEAL_LOCATION_FORTREE_CITY
|
||||
end
|
||||
|
||||
FortreeCity_PokemonCenter_1F_EventScript_2173E7:: @ 82173E7
|
||||
|
@ -24,7 +24,7 @@ InsideOfTruck_EventScript_23BF04:: @ 823BF04
|
||||
end
|
||||
|
||||
InsideOfTruck_EventScript_23BF20:: @ 823BF20
|
||||
setrespawn 1
|
||||
setrespawn HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F
|
||||
setvar VAR_0x4092, 1
|
||||
setflag FLAG_0x2F7
|
||||
setflag FLAG_0x2FA
|
||||
@ -37,7 +37,7 @@ InsideOfTruck_EventScript_23BF20:: @ 823BF20
|
||||
end
|
||||
|
||||
InsideOfTruck_EventScript_23BF46:: @ 823BF46
|
||||
setrespawn 2
|
||||
setrespawn HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE_2F
|
||||
setvar VAR_0x4092, 2
|
||||
setflag FLAG_0x2F6
|
||||
setflag FLAG_0x2F9
|
||||
|
@ -4,7 +4,7 @@ LavaridgeTown_PokemonCenter_1F_MapScripts:: @ 81FFAFA
|
||||
.byte 0
|
||||
|
||||
LavaridgeTown_PokemonCenter_1F_MapScript1_1FFB05: @ 81FFB05
|
||||
setrespawn 16
|
||||
setrespawn HEAL_LOCATION_LAVARIDGE_TOWN
|
||||
call LavaridgeTown_PokemonCenter_1F_EventScript_2718DE
|
||||
end
|
||||
|
||||
|
@ -4,7 +4,7 @@ LilycoveCity_PokemonCenter_1F_MapScripts:: @ 821C5B2
|
||||
.byte 0
|
||||
|
||||
LilycoveCity_PokemonCenter_1F_MapScript1_21C5BD: @ 821C5BD
|
||||
setrespawn 8
|
||||
setrespawn HEAL_LOCATION_LILYCOVE_CITY
|
||||
goto LilycoveCity_PokemonCenter_1F_EventScript_21C5C6
|
||||
end
|
||||
|
||||
|
@ -4,7 +4,7 @@ MauvilleCity_PokemonCenter_1F_MapScripts:: @ 8210E5B
|
||||
.byte 0
|
||||
|
||||
MauvilleCity_PokemonCenter_1F_MapScript1_210E66: @ 8210E66
|
||||
setrespawn 5
|
||||
setrespawn HEAL_LOCATION_MAUVILLE_CITY
|
||||
call MauvilleCity_PokemonCenter_1F_EventScript_2718DE
|
||||
goto MauvilleCity_PokemonCenter_1F_EventScript_210E74
|
||||
end
|
||||
|
@ -4,7 +4,7 @@ MossdeepCity_PokemonCenter_1F_MapScripts:: @ 822223F
|
||||
.byte 0
|
||||
|
||||
MossdeepCity_PokemonCenter_1F_MapScript1_22224A: @ 822224A
|
||||
setrespawn 9
|
||||
setrespawn HEAL_LOCATION_MOSSDEEP_CITY
|
||||
end
|
||||
|
||||
MossdeepCity_PokemonCenter_1F_EventScript_22224E:: @ 822224E
|
||||
|
@ -4,7 +4,7 @@ OldaleTown_PokemonCenter_1F_MapScripts:: @ 81FC006
|
||||
.byte 0
|
||||
|
||||
OldaleTown_PokemonCenter_1F_MapScript1_1FC011: @ 81FC011
|
||||
setrespawn 14
|
||||
setrespawn HEAL_LOCATION_OLDALE_TOWN
|
||||
call OldaleTown_PokemonCenter_1F_EventScript_2718DE
|
||||
end
|
||||
|
||||
|
@ -4,7 +4,7 @@ PacifidlogTown_PokemonCenter_1F_MapScripts:: @ 82034A7
|
||||
.byte 0
|
||||
|
||||
PacifidlogTown_PokemonCenter_1F_MapScript1_2034B2: @ 82034B2
|
||||
setrespawn 19
|
||||
setrespawn HEAL_LOCATION_PACIFIDLOG_TOWN
|
||||
end
|
||||
|
||||
PacifidlogTown_PokemonCenter_1F_EventScript_2034B6:: @ 82034B6
|
||||
|
@ -4,7 +4,7 @@ PetalburgCity_PokemonCenter_1F_MapScripts:: @ 82079E8
|
||||
.byte 0
|
||||
|
||||
PetalburgCity_PokemonCenter_1F_MapScript1_2079F3: @ 82079F3
|
||||
setrespawn 3
|
||||
setrespawn HEAL_LOCATION_PETALBURG_CITY
|
||||
call PetalburgCity_PokemonCenter_1F_EventScript_2718DE
|
||||
end
|
||||
|
||||
|
@ -4,7 +4,7 @@ RustboroCity_PokemonCenter_1F_MapScripts:: @ 8214D62
|
||||
.byte 0
|
||||
|
||||
RustboroCity_PokemonCenter_1F_MapScript1_214D6D: @ 8214D6D
|
||||
setrespawn 6
|
||||
setrespawn HEAL_LOCATION_RUSTBORO_CITY
|
||||
call RustboroCity_PokemonCenter_1F_EventScript_2718DE
|
||||
end
|
||||
|
||||
|
@ -123,7 +123,7 @@ SSTidalCorridor_EventScript_23C119:: @ 823C119
|
||||
end
|
||||
|
||||
SSTidalCorridor_EventScript_23C13B:: @ 823C13B
|
||||
setrespawn 8
|
||||
setrespawn HEAL_LOCATION_LILYCOVE_CITY
|
||||
msgbox SSTidalCorridor_Text_23C64F, 4
|
||||
checkflag FLAG_0x104
|
||||
call_if 1, SSTidalCorridor_EventScript_23C179
|
||||
@ -133,7 +133,7 @@ SSTidalCorridor_EventScript_23C13B:: @ 823C13B
|
||||
end
|
||||
|
||||
SSTidalCorridor_EventScript_23C15A:: @ 823C15A
|
||||
setrespawn 4
|
||||
setrespawn HEAL_LOCATION_SLATEPORT_CITY
|
||||
msgbox SSTidalCorridor_Text_23C64F, 4
|
||||
checkflag FLAG_0x104
|
||||
call_if 1, SSTidalCorridor_EventScript_23C179
|
||||
|
@ -4,7 +4,7 @@ SlateportCity_PokemonCenter_1F_MapScripts:: @ 820DABF
|
||||
.byte 0
|
||||
|
||||
SlateportCity_PokemonCenter_1F_MapScript1_20DACA: @ 820DACA
|
||||
setrespawn 4
|
||||
setrespawn HEAL_LOCATION_SLATEPORT_CITY
|
||||
call SlateportCity_PokemonCenter_1F_EventScript_2718DE
|
||||
end
|
||||
|
||||
|
@ -4,7 +4,7 @@ SootopolisCity_PokemonCenter_1F_MapScripts:: @ 82264F1
|
||||
.byte 0
|
||||
|
||||
SootopolisCity_PokemonCenter_1F_MapScript1_2264FC: @ 82264FC
|
||||
setrespawn 10
|
||||
setrespawn HEAL_LOCATION_SOOTOPOLIS_CITY
|
||||
end
|
||||
|
||||
SootopolisCity_PokemonCenter_1F_EventScript_226500:: @ 8226500
|
||||
|
@ -4,7 +4,7 @@ VerdanturfTown_PokemonCenter_1F_MapScripts:: @ 8202726
|
||||
.byte 0
|
||||
|
||||
VerdanturfTown_PokemonCenter_1F_MapScript1_202731: @ 8202731
|
||||
setrespawn 18
|
||||
setrespawn HEAL_LOCATION_VERDANTURF_TOWN
|
||||
call VerdanturfTown_PokemonCenter_1F_EventScript_2718DE
|
||||
end
|
||||
|
||||
|
27
include/constants/heal_locations.h
Normal file
27
include/constants/heal_locations.h
Normal file
@ -0,0 +1,27 @@
|
||||
#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_1 11
|
||||
#define HEAL_LOCATION_LITTLEROOT_TOWN_1 12
|
||||
#define HEAL_LOCATION_LITTLEROOT_TOWN_2 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_SOUTHERN_ISLAND_EXTERIOR 21
|
||||
#define HEAL_LOCATION_BATTLE_FRONTIER_OUTSIDE_EAST 22
|
||||
|
||||
#endif // GUARD_CONSTANTS_HEAL_LOCATIONS_H
|
@ -1,13 +1,6 @@
|
||||
#ifndef GUARD_HEAL_LOCATION_H
|
||||
#define GUARD_HEAL_LOCATION_H
|
||||
|
||||
// Exported type declarations
|
||||
|
||||
struct UnkStruct_0859F534 {
|
||||
const union AffineAnimCmd *const *const affineAnims;
|
||||
void (* callback)(struct Sprite *sprite);
|
||||
};
|
||||
|
||||
struct HealLocation
|
||||
{
|
||||
s8 group;
|
||||
@ -16,10 +9,8 @@ struct HealLocation
|
||||
u16 y;
|
||||
};
|
||||
|
||||
// Exported RAM declarations
|
||||
u32 GetHealLocationIndexByMap(u16 mapGroup, u16 mapNum);
|
||||
const struct HealLocation *GetHealLocationByMap(u16 mapGroup, u16 mapNum);
|
||||
const struct HealLocation *GetHealLocation(u32 index);
|
||||
|
||||
// Exported ROM declarations
|
||||
|
||||
const struct HealLocation *GetHealLocationPointer(u32 loc);
|
||||
|
||||
#endif //GUARD_HEAL_LOCATION_H
|
||||
#endif // GUARD_HEAL_LOCATION_H
|
||||
|
25
src/data/heal_locations.h
Normal file
25
src/data/heal_locations.h
Normal file
@ -0,0 +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},
|
||||
};
|
@ -1,83 +1,37 @@
|
||||
|
||||
// Includes
|
||||
#include "global.h"
|
||||
#include "constants/maps.h"
|
||||
#include "heal_location.h"
|
||||
#include "constants/maps.h"
|
||||
|
||||
#define HEAL_LOCATION(map, x, y) {MAP_GROUP(map), MAP_NUM(map), x, y}
|
||||
#include "data/heal_locations.h"
|
||||
|
||||
// Static type declarations
|
||||
|
||||
// Static RAM declarations
|
||||
|
||||
// Static ROM declarations
|
||||
|
||||
// .rodata
|
||||
|
||||
static const struct HealLocation sHealLocations[] = {
|
||||
HEAL_LOCATION(LITTLEROOT_TOWN_BRENDANS_HOUSE_2F, 4, 2),
|
||||
HEAL_LOCATION(LITTLEROOT_TOWN_MAYS_HOUSE_2F, 4, 2),
|
||||
HEAL_LOCATION(PETALBURG_CITY, 20, 17),
|
||||
HEAL_LOCATION(SLATEPORT_CITY, 19, 20),
|
||||
HEAL_LOCATION(MAUVILLE_CITY, 22, 6),
|
||||
HEAL_LOCATION(RUSTBORO_CITY, 16, 39),
|
||||
HEAL_LOCATION(FORTREE_CITY, 5, 7),
|
||||
HEAL_LOCATION(LILYCOVE_CITY, 24, 15),
|
||||
HEAL_LOCATION(MOSSDEEP_CITY, 28, 17),
|
||||
HEAL_LOCATION(SOOTOPOLIS_CITY, 43, 32),
|
||||
HEAL_LOCATION(EVER_GRANDE_CITY, 27, 49),
|
||||
HEAL_LOCATION(LITTLEROOT_TOWN, 5, 9),
|
||||
HEAL_LOCATION(LITTLEROOT_TOWN, 14, 9),
|
||||
HEAL_LOCATION(OLDALE_TOWN, 6, 17),
|
||||
HEAL_LOCATION(DEWFORD_TOWN, 2, 11),
|
||||
HEAL_LOCATION(LAVARIDGE_TOWN, 9, 7),
|
||||
HEAL_LOCATION(FALLARBOR_TOWN, 14, 8),
|
||||
HEAL_LOCATION(VERDANTURF_TOWN, 16, 4),
|
||||
HEAL_LOCATION(PACIFIDLOG_TOWN, 8, 16),
|
||||
HEAL_LOCATION(EVER_GRANDE_CITY, 18, 6),
|
||||
HEAL_LOCATION(SOUTHERN_ISLAND_EXTERIOR, 15, 20),
|
||||
HEAL_LOCATION(BATTLE_FRONTIER_OUTSIDE_EAST, 3, 52)
|
||||
};
|
||||
|
||||
#define NUM_HEAL_LOCATIONS (ARRAY_COUNT(sHealLocations))
|
||||
|
||||
// .text
|
||||
|
||||
static u32 GetHealLocationIndexFromMapGroupAndNum(u16 mapGroup, u16 mapNum)
|
||||
u32 GetHealLocationIndexByMap(u16 mapGroup, u16 mapNum)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < NUM_HEAL_LOCATIONS; i++)
|
||||
for (i = 0; i < ARRAY_COUNT(sHealLocations); i++)
|
||||
{
|
||||
if (sHealLocations[i].group == mapGroup && sHealLocations[i].map == mapNum)
|
||||
{
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const struct HealLocation *GetHealLocationPointerFromMapGroupAndNum(u16 mapGroup, u16 mapNum)
|
||||
const struct HealLocation *GetHealLocationByMap(u16 mapGroup, u16 mapNum)
|
||||
{
|
||||
u32 loc;
|
||||
u32 index = GetHealLocationIndexByMap(mapGroup, mapNum);
|
||||
|
||||
loc = GetHealLocationIndexFromMapGroupAndNum(mapGroup, mapNum);
|
||||
if (loc == 0)
|
||||
{
|
||||
if (index == 0)
|
||||
return NULL;
|
||||
}
|
||||
return &sHealLocations[loc - 1];
|
||||
else
|
||||
return &sHealLocations[index - 1];
|
||||
}
|
||||
|
||||
const struct HealLocation *GetHealLocationPointer(u32 loc)
|
||||
const struct HealLocation *GetHealLocation(u32 index)
|
||||
{
|
||||
if (loc == 0)
|
||||
{
|
||||
if (index == 0)
|
||||
return NULL;
|
||||
}
|
||||
if (loc > NUM_HEAL_LOCATIONS)
|
||||
{
|
||||
else if (index > ARRAY_COUNT(sHealLocations))
|
||||
return NULL;
|
||||
}
|
||||
return &sHealLocations[loc - 1];
|
||||
else
|
||||
return &sHealLocations[index - 1];
|
||||
}
|
||||
|
@ -689,7 +689,7 @@ void copy_saved_warp2_bank_and_enter_x_to_warp1(u8 unused)
|
||||
|
||||
void sub_8084CCC(u8 a1)
|
||||
{
|
||||
const struct HealLocation *warp = GetHealLocationPointer(a1);
|
||||
const struct HealLocation *warp = GetHealLocation(a1);
|
||||
|
||||
if (warp)
|
||||
Overworld_SetWarpDestination(warp->group, warp->map, -1, warp->x, warp->y);
|
||||
@ -702,7 +702,7 @@ void Overworld_SetWarpDestToLastHealLoc(void)
|
||||
|
||||
void Overworld_SetHealLocationWarp(u8 healLocationId)
|
||||
{
|
||||
const struct HealLocation *healLocation = GetHealLocationPointer(healLocationId);
|
||||
const struct HealLocation *healLocation = GetHealLocation(healLocationId);
|
||||
|
||||
if (healLocation != NULL)
|
||||
SetWarpData(&gSaveBlock1Ptr->lastHealLocation, healLocation->group, healLocation->map, -1, healLocation->x, healLocation->y);
|
||||
@ -761,7 +761,7 @@ void sub_8084F2C(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y)
|
||||
|
||||
void sub_8084F6C(u8 a1)
|
||||
{
|
||||
const struct HealLocation *warp = GetHealLocationPointer(a1);
|
||||
const struct HealLocation *warp = GetHealLocation(a1);
|
||||
if (warp)
|
||||
SetWarpData(&gSaveBlock1Ptr->warp1, warp->group, warp->map, -1, warp->x, warp->y);
|
||||
}
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include "field_effect.h"
|
||||
#include "region_map.h"
|
||||
#include "constants/region_map_sections.h"
|
||||
#include "heal_location.h"
|
||||
#include "constants/heal_locations.h"
|
||||
|
||||
#define MAP_WIDTH 28
|
||||
#define MAP_HEIGHT 15
|
||||
@ -242,23 +244,23 @@ static const u16 Unknown_085A1D48[] = INCBIN_U16("graphics/pokenav/fly_target_ic
|
||||
|
||||
static const u8 sUnknown_085A1D68[] = INCBIN_U8("graphics/pokenav/fly_target_icons.4bpp.lz");
|
||||
|
||||
static const u8 sUnknown_085A1E3C[][3] = {
|
||||
{MAP_GROUP(LITTLEROOT_TOWN), MAP_NUM(LITTLEROOT_TOWN), 1},
|
||||
{MAP_GROUP(OLDALE_TOWN), MAP_NUM(OLDALE_TOWN), 14},
|
||||
{MAP_GROUP(DEWFORD_TOWN), MAP_NUM(DEWFORD_TOWN), 15},
|
||||
{MAP_GROUP(LAVARIDGE_TOWN), MAP_NUM(LAVARIDGE_TOWN), 16},
|
||||
{MAP_GROUP(FALLARBOR_TOWN), MAP_NUM(FALLARBOR_TOWN), 17},
|
||||
{MAP_GROUP(VERDANTURF_TOWN), MAP_NUM(VERDANTURF_TOWN), 18},
|
||||
{MAP_GROUP(PACIFIDLOG_TOWN), MAP_NUM(PACIFIDLOG_TOWN), 19},
|
||||
{MAP_GROUP(PETALBURG_CITY), MAP_NUM(PETALBURG_CITY), 3},
|
||||
{MAP_GROUP(SLATEPORT_CITY), MAP_NUM(SLATEPORT_CITY), 4},
|
||||
{MAP_GROUP(MAUVILLE_CITY), MAP_NUM(MAUVILLE_CITY), 5},
|
||||
{MAP_GROUP(RUSTBORO_CITY), MAP_NUM(RUSTBORO_CITY), 6},
|
||||
{MAP_GROUP(FORTREE_CITY), MAP_NUM(FORTREE_CITY), 7},
|
||||
{MAP_GROUP(LILYCOVE_CITY), MAP_NUM(LILYCOVE_CITY), 8},
|
||||
{MAP_GROUP(MOSSDEEP_CITY), MAP_NUM(MOSSDEEP_CITY), 9},
|
||||
{MAP_GROUP(SOOTOPOLIS_CITY), MAP_NUM(SOOTOPOLIS_CITY), 10},
|
||||
{MAP_GROUP(EVER_GRANDE_CITY), MAP_NUM(EVER_GRANDE_CITY), 11},
|
||||
static const u8 sMapHealLocations[][3] = {
|
||||
{MAP_GROUP(LITTLEROOT_TOWN), MAP_NUM(LITTLEROOT_TOWN), HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F},
|
||||
{MAP_GROUP(OLDALE_TOWN), MAP_NUM(OLDALE_TOWN), HEAL_LOCATION_OLDALE_TOWN},
|
||||
{MAP_GROUP(DEWFORD_TOWN), MAP_NUM(DEWFORD_TOWN), HEAL_LOCATION_DEWFORD_TOWN},
|
||||
{MAP_GROUP(LAVARIDGE_TOWN), MAP_NUM(LAVARIDGE_TOWN), HEAL_LOCATION_LAVARIDGE_TOWN},
|
||||
{MAP_GROUP(FALLARBOR_TOWN), MAP_NUM(FALLARBOR_TOWN), HEAL_LOCATION_FALLARBOR_TOWN},
|
||||
{MAP_GROUP(VERDANTURF_TOWN), MAP_NUM(VERDANTURF_TOWN), HEAL_LOCATION_VERDANTURF_TOWN},
|
||||
{MAP_GROUP(PACIFIDLOG_TOWN), MAP_NUM(PACIFIDLOG_TOWN), HEAL_LOCATION_PACIFIDLOG_TOWN},
|
||||
{MAP_GROUP(PETALBURG_CITY), MAP_NUM(PETALBURG_CITY), HEAL_LOCATION_PETALBURG_CITY},
|
||||
{MAP_GROUP(SLATEPORT_CITY), MAP_NUM(SLATEPORT_CITY), HEAL_LOCATION_SLATEPORT_CITY},
|
||||
{MAP_GROUP(MAUVILLE_CITY), MAP_NUM(MAUVILLE_CITY), HEAL_LOCATION_MAUVILLE_CITY},
|
||||
{MAP_GROUP(RUSTBORO_CITY), MAP_NUM(RUSTBORO_CITY), HEAL_LOCATION_RUSTBORO_CITY},
|
||||
{MAP_GROUP(FORTREE_CITY), MAP_NUM(FORTREE_CITY), HEAL_LOCATION_FORTREE_CITY},
|
||||
{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(ROUTE101), MAP_NUM(ROUTE101), 0},
|
||||
{MAP_GROUP(ROUTE102), MAP_NUM(ROUTE102), 0},
|
||||
{MAP_GROUP(ROUTE103), MAP_NUM(ROUTE103), 0},
|
||||
@ -1908,25 +1910,25 @@ static void sub_8124E0C(void)
|
||||
switch (sFlyMap->regionMap.mapSecId)
|
||||
{
|
||||
case MAPSEC_SOUTHERN_ISLAND:
|
||||
sub_8084CCC(0x15);
|
||||
sub_8084CCC(HEAL_LOCATION_SOUTHERN_ISLAND_EXTERIOR);
|
||||
break;
|
||||
case MAPSEC_BATTLE_FRONTIER:
|
||||
sub_8084CCC(0x16);
|
||||
sub_8084CCC(HEAL_LOCATION_BATTLE_FRONTIER_OUTSIDE_EAST);
|
||||
break;
|
||||
case MAPSEC_LITTLEROOT_TOWN:
|
||||
sub_8084CCC(gSaveBlock2Ptr->playerGender == MALE ? 0x0C : 0x0D);
|
||||
sub_8084CCC(gSaveBlock2Ptr->playerGender == MALE ? HEAL_LOCATION_LITTLEROOT_TOWN_1 : HEAL_LOCATION_LITTLEROOT_TOWN_2);
|
||||
break;
|
||||
case MAPSEC_EVER_GRANDE_CITY:
|
||||
sub_8084CCC(FlagGet(FLAG_LANDMARK_POKEMON_LEAGUE) && sFlyMap->regionMap.posWithinMapSec == 0 ? 0x14 : 0x0B);
|
||||
sub_8084CCC(FlagGet(FLAG_LANDMARK_POKEMON_LEAGUE) && sFlyMap->regionMap.posWithinMapSec == 0 ? HEAL_LOCATION_EVER_GRANDE_CITY_2 : HEAL_LOCATION_EVER_GRANDE_CITY_1);
|
||||
break;
|
||||
default:
|
||||
if (sUnknown_085A1E3C[sFlyMap->regionMap.mapSecId][2] != 0)
|
||||
if (sMapHealLocations[sFlyMap->regionMap.mapSecId][2] != 0)
|
||||
{
|
||||
sub_8084CCC(sUnknown_085A1E3C[sFlyMap->regionMap.mapSecId][2]);
|
||||
sub_8084CCC(sMapHealLocations[sFlyMap->regionMap.mapSecId][2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
warp1_set_2(sUnknown_085A1E3C[sFlyMap->regionMap.mapSecId][0], sUnknown_085A1E3C[sFlyMap->regionMap.mapSecId][1], -1);
|
||||
warp1_set_2(sMapHealLocations[sFlyMap->regionMap.mapSecId][0], sMapHealLocations[sFlyMap->regionMap.mapSecId][1], -1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user