Convert map data to JSON
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "constants/species.h"
|
||||
#include "constants/battle_ai.h"
|
||||
#include "constants/battle_frontier.h"
|
||||
#include "constants/layouts.h"
|
||||
#include "constants/trainers.h"
|
||||
#include "constants/moves.h"
|
||||
|
||||
@@ -662,7 +663,8 @@ static u8 GetStyleForMove(u16 move)
|
||||
|
||||
bool8 sub_81A6BF4(void)
|
||||
{
|
||||
return (gMapHeader.mapLayoutId == 347 || gMapHeader.mapLayoutId == 348);
|
||||
return gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_FACTORY_PRE_BATTLE_ROOM
|
||||
|| gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_FACTORY_BATTLE_ROOM;
|
||||
}
|
||||
|
||||
static void sub_81A6C1C(void)
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/battle_frontier.h"
|
||||
#include "constants/abilities.h"
|
||||
#include "constants/layouts.h"
|
||||
#include "constants/rgb.h"
|
||||
#include "constants/trainers.h"
|
||||
#include "constants/species.h"
|
||||
@@ -1314,8 +1315,10 @@ static void sub_81A8090(void)
|
||||
|
||||
bool8 InBattlePike(void)
|
||||
{
|
||||
return (gMapHeader.mapLayoutId == 351 || gMapHeader.mapLayoutId == 352
|
||||
|| gMapHeader.mapLayoutId == 358 || gMapHeader.mapLayoutId == 359);
|
||||
return gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_THREE_PATH_ROOM
|
||||
|| gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM1
|
||||
|| gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM3
|
||||
|| gMapHeader.mapLayoutId == LAYOUT_UNKNOWN_MAP_084693AC;
|
||||
}
|
||||
|
||||
static void sub_81A80DC(void)
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/event_object_movement_constants.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/layouts.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/moves.h"
|
||||
#include "constants/species.h"
|
||||
@@ -1380,9 +1381,9 @@ u8 GetPyramidRunMultiplier(void)
|
||||
|
||||
u8 InBattlePyramid(void)
|
||||
{
|
||||
if (gMapHeader.mapLayoutId == 361)
|
||||
if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE)
|
||||
return 1;
|
||||
else if (gMapHeader.mapLayoutId == 378)
|
||||
else if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_TOP)
|
||||
return 2;
|
||||
else
|
||||
return FALSE;
|
||||
@@ -1390,7 +1391,8 @@ u8 InBattlePyramid(void)
|
||||
|
||||
bool8 InBattlePyramid_(void)
|
||||
{
|
||||
return (gMapHeader.mapLayoutId == 361 || gMapHeader.mapLayoutId == 378);
|
||||
return gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE
|
||||
|| gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_TOP;
|
||||
}
|
||||
|
||||
void sub_81A9E90(void)
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "frontier_util.h"
|
||||
#include "string_util.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/layouts.h"
|
||||
#include "constants/region_map_sections.h"
|
||||
#include "constants/species.h"
|
||||
|
||||
@@ -270,8 +271,8 @@ static void sub_81B9E88(void)
|
||||
|
||||
bool8 sub_81B9E94(void)
|
||||
{
|
||||
return (gMapHeader.regionMapSectionId == MAPSEC_SLATEPORT_CITY
|
||||
&& ((gMapHeader.mapLayoutId == 385) | (gMapHeader.mapLayoutId == 386)));
|
||||
return gMapHeader.regionMapSectionId == MAPSEC_SLATEPORT_CITY
|
||||
&& (gMapHeader.mapLayoutId == LAYOUT_BATTLE_TENT_CORRIDOR || gMapHeader.mapLayoutId == LAYOUT_BATTLE_TENT_BATTLE_ROOM);
|
||||
}
|
||||
|
||||
static void sub_81B9EC0(void)
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#include "global.h"
|
||||
#include "constants/region_map_sections.h"
|
||||
#include "constants/weather.h"
|
||||
#include "bg.h"
|
||||
#include "event_data.h"
|
||||
#include "gpu_regs.h"
|
||||
@@ -14,6 +12,9 @@
|
||||
#include "string_util.h"
|
||||
#include "task.h"
|
||||
#include "text.h"
|
||||
#include "constants/layouts.h"
|
||||
#include "constants/region_map_sections.h"
|
||||
#include "constants/weather.h"
|
||||
|
||||
// enums
|
||||
enum MapPopUp_Themes
|
||||
@@ -305,7 +306,7 @@ static void ShowMapNamePopUpWindow(void)
|
||||
|
||||
if (InBattlePyramid())
|
||||
{
|
||||
if (gMapHeader.mapLayoutId == 0x17A)
|
||||
if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_TOP)
|
||||
{
|
||||
withoutPrefixPtr = &(mapDisplayHeader[3]);
|
||||
mapDisplayHeaderSource = gBattlePyramid_MapHeaderStrings[7];
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
#include "wild_encounter.h"
|
||||
#include "frontier_util.h"
|
||||
#include "constants/abilities.h"
|
||||
#include "constants/layouts.h"
|
||||
#include "constants/map_types.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/region_map_sections.h"
|
||||
@@ -886,7 +887,7 @@ static void mli0_load_map(u32 a1)
|
||||
LoadCurrentMapData();
|
||||
if (!(sUnknown_020322D8 & 1))
|
||||
{
|
||||
if (gMapHeader.mapLayoutId == 0x169)
|
||||
if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE)
|
||||
sub_81AA1D8();
|
||||
else if (InTrainerHill())
|
||||
sub_81D5DF8();
|
||||
@@ -914,7 +915,7 @@ static void mli0_load_map(u32 a1)
|
||||
mapheader_run_script_with_tag_x3();
|
||||
UpdateLocationHistoryForRoamer();
|
||||
RoamerMoveToOtherLocationSet();
|
||||
if (gMapHeader.mapLayoutId == 0x169)
|
||||
if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE)
|
||||
InitBattlePyramidMap(0);
|
||||
else if (InTrainerHill())
|
||||
InitTrainerHillMap();
|
||||
@@ -1753,7 +1754,7 @@ void CB2_ContinueSavedGame(void)
|
||||
LoadSaveblockMapHeader();
|
||||
ClearDiveAndHoleWarps();
|
||||
trainerHillMapId = GetCurrentTrainerHillMapId();
|
||||
if (gMapHeader.mapLayoutId == 0x169)
|
||||
if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE)
|
||||
sub_81AA2F8();
|
||||
else if (trainerHillMapId != 0 && trainerHillMapId != 6)
|
||||
sub_81D5F48();
|
||||
@@ -1763,7 +1764,7 @@ void CB2_ContinueSavedGame(void)
|
||||
UnfreezeEventObjects();
|
||||
DoTimeBasedEvents();
|
||||
sub_8084788();
|
||||
if (gMapHeader.mapLayoutId == 0x169)
|
||||
if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE)
|
||||
InitBattlePyramidMap(1);
|
||||
else if (trainerHillMapId != 0)
|
||||
InitTrainerHillMap();
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "constants/battle_move_effects.h"
|
||||
#include "constants/hold_effects.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/layouts.h"
|
||||
#include "constants/moves.h"
|
||||
#include "constants/songs.h"
|
||||
#include "constants/species.h"
|
||||
@@ -6848,7 +6849,7 @@ void SetWildMonHeldItem(void)
|
||||
var1 = 20;
|
||||
var2 = 80;
|
||||
}
|
||||
if (gMapHeader.mapLayoutId == 0x1A4)
|
||||
if (gMapHeader.mapLayoutId == LAYOUT_ALTERING_CAVE)
|
||||
{
|
||||
s32 alteringCaveId = GetWildMonTableIdInAlteringCave(species);
|
||||
if (alteringCaveId != 0)
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "constants/event_object_movement_constants.h"
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/layouts.h"
|
||||
#include "constants/moves.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/species.h"
|
||||
@@ -324,7 +325,7 @@ void ResetTrainerHillResults(void)
|
||||
|
||||
static u8 GetFloorId(void)
|
||||
{
|
||||
return gMapHeader.mapLayoutId - 159;
|
||||
return gMapHeader.mapLayoutId - LAYOUT_TRAINER_HILL_1F;
|
||||
}
|
||||
|
||||
u8 GetTrainerHillOpponentClass(u16 trainerId)
|
||||
@@ -385,7 +386,7 @@ static void SetUpDataStruct(void)
|
||||
if (sHillData == NULL)
|
||||
{
|
||||
sHillData = AllocZeroed(sizeof(*sHillData));
|
||||
sHillData->floorId = gMapHeader.mapLayoutId - 159;
|
||||
sHillData->floorId = gMapHeader.mapLayoutId - LAYOUT_TRAINER_HILL_1F;
|
||||
CpuCopy32(sDataPerTag[gSaveBlock1Ptr->trainerHill.tag], &sHillData->tag, sizeof(sHillData->tag));
|
||||
nullsub_2();
|
||||
}
|
||||
@@ -803,10 +804,10 @@ bool32 InTrainerHill(void)
|
||||
{
|
||||
bool32 ret;
|
||||
|
||||
if (gMapHeader.mapLayoutId == 0x19F
|
||||
|| gMapHeader.mapLayoutId == 0x1A0
|
||||
|| gMapHeader.mapLayoutId == 0x1A1
|
||||
|| gMapHeader.mapLayoutId == 0x1A2)
|
||||
if (gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_1F
|
||||
|| gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_2F
|
||||
|| gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_3F
|
||||
|| gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_4F)
|
||||
ret = TRUE;
|
||||
else
|
||||
ret = FALSE;
|
||||
@@ -818,17 +819,17 @@ u8 GetCurrentTrainerHillMapId(void)
|
||||
{
|
||||
u8 ret;
|
||||
|
||||
if (gMapHeader.mapLayoutId == 0x19F)
|
||||
if (gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_1F)
|
||||
ret = 1;
|
||||
else if (gMapHeader.mapLayoutId == 0x1A0)
|
||||
else if (gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_2F)
|
||||
ret = 2;
|
||||
else if (gMapHeader.mapLayoutId == 0x1A1)
|
||||
else if (gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_3F)
|
||||
ret = 3;
|
||||
else if (gMapHeader.mapLayoutId == 0x1A2)
|
||||
else if (gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_4F)
|
||||
ret = 4;
|
||||
else if (gMapHeader.mapLayoutId == 0x1A3)
|
||||
else if (gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_ROOF)
|
||||
ret = 5;
|
||||
else if (gMapHeader.mapLayoutId == 0x19E)
|
||||
else if (gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_ENTRANCE)
|
||||
ret = 6;
|
||||
else
|
||||
ret = 0;
|
||||
@@ -840,7 +841,7 @@ static bool32 sub_81D6100(void)
|
||||
{
|
||||
bool32 ret;
|
||||
|
||||
if (gMapHeader.mapLayoutId == 0x1A3)
|
||||
if (gMapHeader.mapLayoutId == LAYOUT_TRAINER_HILL_ROOF)
|
||||
ret = TRUE;
|
||||
else
|
||||
ret = FALSE;
|
||||
|
||||
9
src/tv.c
9
src/tv.c
@@ -38,6 +38,7 @@
|
||||
#include "secret_base.h"
|
||||
#include "tv.h"
|
||||
#include "data2.h"
|
||||
#include "constants/layouts.h"
|
||||
|
||||
// Static type declarations
|
||||
|
||||
@@ -6264,7 +6265,9 @@ static void DoTVShowTodaysRivalTrainer(void)
|
||||
case MAPSEC_DYNAMIC:
|
||||
switch (show->rivalTrainer.mapLayoutId)
|
||||
{
|
||||
case 0x115 ... 0x117:
|
||||
case LAYOUT_SS_TIDAL_CORRIDOR:
|
||||
case LAYOUT_SS_TIDAL_LOWER_DECK:
|
||||
case LAYOUT_SS_TIDAL_ROOMS:
|
||||
sTVShowState = 10;
|
||||
break;
|
||||
default:
|
||||
@@ -6463,7 +6466,9 @@ static void DoTVShowHoennTreasureInvestigators(void)
|
||||
{
|
||||
switch (show->treasureInvestigators.mapLayoutId)
|
||||
{
|
||||
case 0x115 ... 0x117:
|
||||
case LAYOUT_SS_TIDAL_CORRIDOR:
|
||||
case LAYOUT_SS_TIDAL_LOWER_DECK:
|
||||
case LAYOUT_SS_TIDAL_ROOMS:
|
||||
sTVShowState = 2;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
#include "global.h"
|
||||
#include "wild_encounter.h"
|
||||
#include "pokemon.h"
|
||||
#include "constants/species.h"
|
||||
#include "metatile_behavior.h"
|
||||
#include "fieldmap.h"
|
||||
#include "random.h"
|
||||
#include "constants/maps.h"
|
||||
#include "field_player_avatar.h"
|
||||
#include "constants/abilities.h"
|
||||
#include "event_data.h"
|
||||
#include "safari_zone.h"
|
||||
#include "overworld.h"
|
||||
#include "pokeblock.h"
|
||||
#include "battle_setup.h"
|
||||
#include "roamer.h"
|
||||
#include "constants/game_stat.h"
|
||||
#include "tv.h"
|
||||
#include "link.h"
|
||||
#include "script.h"
|
||||
#include "battle_pike.h"
|
||||
#include "battle_pyramid.h"
|
||||
#include "constants/abilities.h"
|
||||
#include "constants/game_stat.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/layouts.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/species.h"
|
||||
|
||||
extern const u8 EventScript_RepelWoreOff[];
|
||||
|
||||
@@ -413,7 +413,7 @@ static bool8 TryGenerateWildMon(const struct WildPokemonInfo *wildMonInfo, u8 ar
|
||||
level = ChooseWildMonLevel(&wildMonInfo->wildPokemon[wildMonIndex]);
|
||||
if (flags & WILD_CHECK_REPEL && !IsWildLevelAllowedByRepel(level))
|
||||
return FALSE;
|
||||
if (gMapHeader.mapLayoutId != 0x166 && flags & WILD_CHECK_KEEN_EYE && !IsAbilityAllowingEncounter(level))
|
||||
if (gMapHeader.mapLayoutId != LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM3 && flags & WILD_CHECK_KEEN_EYE && !IsAbilityAllowingEncounter(level))
|
||||
return FALSE;
|
||||
|
||||
CreateWildMon(wildMonInfo->wildPokemon[wildMonIndex].species, level);
|
||||
@@ -474,7 +474,7 @@ static bool8 DoWildEncounterRateTest(u32 encounterRate, bool8 ignoreAbility)
|
||||
{
|
||||
u32 ability = GetMonAbility(&gPlayerParty[0]);
|
||||
|
||||
if (ability == ABILITY_STENCH && gMapHeader.mapLayoutId == 0x169)
|
||||
if (ability == ABILITY_STENCH && gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE)
|
||||
encounterRate = encounterRate * 3 / 4;
|
||||
else if (ability == ABILITY_STENCH)
|
||||
encounterRate /= 2;
|
||||
@@ -522,7 +522,7 @@ bool8 StandardWildEncounter(u16 currMetaTileBehavior, u16 previousMetaTileBehavi
|
||||
headerId = GetCurrentMapWildMonHeaderId();
|
||||
if (headerId == 0xFFFF)
|
||||
{
|
||||
if (gMapHeader.mapLayoutId == 0x166)
|
||||
if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM3)
|
||||
{
|
||||
headerId = GetBattlePikeWildMonHeaderId();
|
||||
if (previousMetaTileBehavior != currMetaTileBehavior && !DoGlobalWildEncounterDiceRoll())
|
||||
@@ -537,7 +537,7 @@ bool8 StandardWildEncounter(u16 currMetaTileBehavior, u16 previousMetaTileBehavi
|
||||
BattleSetup_StartBattlePikeWildBattle();
|
||||
return TRUE;
|
||||
}
|
||||
if (gMapHeader.mapLayoutId == 0x169)
|
||||
if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE)
|
||||
{
|
||||
headerId = gSaveBlock2Ptr->frontier.curChallengeBattleNum;
|
||||
if (previousMetaTileBehavior != currMetaTileBehavior && !DoGlobalWildEncounterDiceRoll())
|
||||
@@ -665,7 +665,7 @@ bool8 SweetScentWildEncounter(void)
|
||||
headerId = GetCurrentMapWildMonHeaderId();
|
||||
if (headerId == 0xFFFF)
|
||||
{
|
||||
if (gMapHeader.mapLayoutId == 0x166)
|
||||
if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM3)
|
||||
{
|
||||
headerId = GetBattlePikeWildMonHeaderId();
|
||||
if (TryGenerateWildMon(gBattlePikeWildMonHeaders[headerId].landMonsInfo, WILD_AREA_LAND, 0) != TRUE)
|
||||
@@ -675,7 +675,7 @@ bool8 SweetScentWildEncounter(void)
|
||||
BattleSetup_StartBattlePikeWildBattle();
|
||||
return TRUE;
|
||||
}
|
||||
if (gMapHeader.mapLayoutId == 0x169)
|
||||
if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE)
|
||||
{
|
||||
headerId = gSaveBlock2Ptr->frontier.curChallengeBattleNum;
|
||||
if (TryGenerateWildMon(gBattlePyramidWildMonHeaders[headerId].landMonsInfo, WILD_AREA_LAND, 0) != TRUE)
|
||||
|
||||
Reference in New Issue
Block a user