Handle optional arguments for warp commands, add WARP_ID_NONE

This commit is contained in:
GriffinR
2021-11-15 12:04:54 -05:00
parent c1130592fa
commit 04cc923d6c
145 changed files with 342 additions and 352 deletions
+1 -1
View File
@@ -798,7 +798,7 @@ static void InitArenaChallenge(void)
if (!isCurrent)
gSaveBlock2Ptr->frontier.arenaWinStreaks[lvlMode] = 0;
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE);
gTrainerBattleOpponent_A = 0;
}
+1 -1
View File
@@ -2099,7 +2099,7 @@ static void InitDomeChallenge(void)
if (!(gSaveBlock2Ptr->frontier.winStreakActiveFlags & sWinStreakFlags[battleMode][lvlMode]))
gSaveBlock2Ptr->frontier.domeWinStreaks[battleMode][lvlMode] = 0;
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE);
gTrainerBattleOpponent_A = 0;
}
+1 -1
View File
@@ -217,7 +217,7 @@ static void InitFactoryChallenge(void)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
gFrontierTempParty[i] = 0xFFFF;
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE);
gTrainerBattleOpponent_A = 0;
}
+1 -1
View File
@@ -93,7 +93,7 @@ static void InitPalaceChallenge(void)
if (!(gSaveBlock2Ptr->frontier.winStreakActiveFlags & sWinStreakFlags[battleMode][lvlMode]))
gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode] = 0;
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE);
gTrainerBattleOpponent_A = 0;
}
-1
View File
@@ -34,7 +34,6 @@
#include "constants/frontier_util.h"
#include "constants/items.h"
#include "constants/layouts.h"
#include "constants/maps.h"
#include "constants/metatile_labels.h"
#include "constants/moves.h"
#include "constants/trainers.h"
-1
View File
@@ -43,7 +43,6 @@
#include "constants/items.h"
#include "constants/songs.h"
#include "constants/map_types.h"
#include "constants/maps.h"
#include "constants/trainers.h"
#include "constants/trainer_hill.h"
#include "constants/weather.h"
+3 -3
View File
@@ -114,7 +114,7 @@ static void InitVerdanturfTentChallenge(void)
gSaveBlock2Ptr->frontier.challengeStatus = 0;
gSaveBlock2Ptr->frontier.curChallengeBattleNum = 0;
gSaveBlock2Ptr->frontier.challengePaused = FALSE;
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE);
}
static void GetVerdanturfTentPrize(void)
@@ -176,7 +176,7 @@ static void InitFallarborTentChallenge(void)
gSaveBlock2Ptr->frontier.challengeStatus = 0;
gSaveBlock2Ptr->frontier.curChallengeBattleNum = 0;
gSaveBlock2Ptr->frontier.challengePaused = FALSE;
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE);
}
static void GetFallarborTentPrize(void)
@@ -231,7 +231,7 @@ static void InitSlateportTentChallenge(void)
gSaveBlock2Ptr->frontier.challengeStatus = 0;
gSaveBlock2Ptr->frontier.curChallengeBattleNum = 0;
gSaveBlock2Ptr->frontier.challengePaused = FALSE;
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE);
}
static void GetSlateportTentPrize(void)
+1 -1
View File
@@ -918,7 +918,7 @@ static void InitTowerChallenge(void)
gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] = 0;
ValidateBattleTowerRecordChecksums();
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE);
gTrainerBattleOpponent_A = 0;
}
-1
View File
@@ -6,7 +6,6 @@
#include "sound.h"
#include "task.h"
#include "constants/field_effects.h"
#include "constants/maps.h"
#include "constants/songs.h"
#include "constants/metatile_labels.h"
#include "fieldmap.h"
+1 -1
View File
@@ -1031,7 +1031,7 @@ void CleanupLinkRoomState(void)
LoadPlayerParty();
SavePlayerBag();
}
SetWarpDestinationToDynamicWarp(0x7F);
SetWarpDestinationToDynamicWarp(WARP_ID_DYNAMIC);
}
void ExitLinkRoom(void)
+1 -1
View File
@@ -2256,7 +2256,7 @@ void Task_LinkContest_FinalizeConnection(u8 taskId)
StringGetEnd10(gContestMons[i].nickname);
DestroyTask(taskId);
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE);
ScriptContext2_Disable();
EnableBothScriptContexts();
}
+1 -1
View File
@@ -1175,7 +1175,7 @@ static void SetInitialPositions(u8 taskId)
static void WarpToInitialPosition(u8 taskId)
{
DrawWholeMapView();
SetWarpDestination(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1, gTasks[taskId].tInitialX, gTasks[taskId].tInitialY);
SetWarpDestination(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE, gTasks[taskId].tInitialX, gTasks[taskId].tInitialY);
WarpIntoMap();
}
-1
View File
@@ -26,7 +26,6 @@
#include "constants/event_objects.h"
#include "constants/field_effects.h"
#include "constants/items.h"
#include "constants/maps.h"
#include "constants/mauville_old_man.h"
#include "constants/trainer_types.h"
#include "constants/union_room.h"
-1
View File
@@ -7,7 +7,6 @@
#include "sprite.h"
#include "constants/event_objects.h"
#include "constants/field_effects.h"
#include "constants/maps.h"
#include "constants/metatile_behaviors.h"
static u8 GetValidMewMoveDirection(u8);
+4 -5
View File
@@ -32,7 +32,6 @@
#include "constants/event_objects.h"
#include "constants/field_poison.h"
#include "constants/map_types.h"
#include "constants/maps.h"
#include "constants/songs.h"
#include "constants/trainer_hill.h"
@@ -691,7 +690,7 @@ static bool8 TryArrowWarp(struct MapPosition *position, u16 metatileBehavior, u8
{
s8 warpEventId = GetWarpEventAtMapPosition(&gMapHeader, position);
if (IsArrowWarpMetatileBehavior(metatileBehavior, direction) == TRUE && warpEventId != -1)
if (IsArrowWarpMetatileBehavior(metatileBehavior, direction) == TRUE && warpEventId != WARP_ID_NONE)
{
StoreInitialPlayerAvatarState();
SetupWarp(&gMapHeader, warpEventId, position);
@@ -705,7 +704,7 @@ static bool8 TryStartWarpEventScript(struct MapPosition *position, u16 metatileB
{
s8 warpEventId = GetWarpEventAtMapPosition(&gMapHeader, position);
if (warpEventId != -1 && IsWarpMetatileBehavior(metatileBehavior) == TRUE)
if (warpEventId != WARP_ID_NONE && IsWarpMetatileBehavior(metatileBehavior) == TRUE)
{
StoreInitialPlayerAvatarState();
SetupWarp(&gMapHeader, warpEventId, position);
@@ -847,7 +846,7 @@ static bool8 TryDoorWarp(struct MapPosition *position, u16 metatileBehavior, u8
if (MetatileBehavior_IsWarpDoor(metatileBehavior) == TRUE)
{
warpEventId = GetWarpEventAtMapPosition(&gMapHeader, position);
if (warpEventId != -1 && IsWarpMetatileBehavior(metatileBehavior) == TRUE)
if (warpEventId != WARP_ID_NONE && IsWarpMetatileBehavior(metatileBehavior) == TRUE)
{
StoreInitialPlayerAvatarState();
SetupWarp(&gMapHeader, warpEventId, position);
@@ -873,7 +872,7 @@ static s8 GetWarpEventAtPosition(struct MapHeader *mapHeader, u16 x, u16 y, u8 e
return i;
}
}
return -1;
return WARP_ID_NONE;
}
static u8 *TryRunCoordEventScript(struct CoordEvent *coordEvent)
-1
View File
@@ -5,7 +5,6 @@
#include "fieldmap.h"
#include "metatile_behavior.h"
#include "task.h"
#include "constants/maps.h"
#include "constants/songs.h"
#include "constants/metatile_labels.h"
-1
View File
@@ -26,7 +26,6 @@
#include "constants/event_object_movement.h"
#include "constants/field_effects.h"
#include "constants/items.h"
#include "constants/maps.h"
#include "constants/moves.h"
#include "constants/songs.h"
#include "constants/trainer_types.h"
+1 -1
View File
@@ -349,7 +349,7 @@ void LookThroughPorthole(void)
FlagSet(FLAG_SYS_CRUISE_MODE);
FlagSet(FLAG_DONT_TRANSITION_MUSIC);
FlagSet(FLAG_HIDE_MAP_NAME_POPUP);
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE);
TrySetPortholeWarpDestination();
DoPortholeWarp();
}
+2 -7
View File
@@ -55,7 +55,6 @@
#include "constants/items.h"
#include "constants/heal_locations.h"
#include "constants/map_types.h"
#include "constants/maps.h"
#include "constants/mystery_gift.h"
#include "constants/script_menu.h"
#include "constants/slot_machine.h"
@@ -960,13 +959,9 @@ u8 GetBattleOutcome(void)
void CableCarWarp(void)
{
if (gSpecialVar_0x8004 != 0)
{
SetWarpDestination(MAP_GROUP(ROUTE112_CABLE_CAR_STATION), MAP_NUM(ROUTE112_CABLE_CAR_STATION), -1, 6, 4);
}
SetWarpDestination(MAP_GROUP(ROUTE112_CABLE_CAR_STATION), MAP_NUM(ROUTE112_CABLE_CAR_STATION), WARP_ID_NONE, 6, 4);
else
{
SetWarpDestination(MAP_GROUP(MT_CHIMNEY_CABLE_CAR_STATION), MAP_NUM(MT_CHIMNEY_CABLE_CAR_STATION), -1, 6, 4);
}
SetWarpDestination(MAP_GROUP(MT_CHIMNEY_CABLE_CAR_STATION), MAP_NUM(MT_CHIMNEY_CABLE_CAR_STATION), WARP_ID_NONE, 6, 4);
}
void SetHiddenItemFlag(void)
-1
View File
@@ -26,7 +26,6 @@
#include "overworld.h"
#include "math_util.h"
#include "constants/battle_frontier.h"
#include "constants/maps.h"
#include "constants/rgb.h"
#include "constants/region_map_sections.h"
#include "constants/songs.h"
-1
View File
@@ -1,6 +1,5 @@
#include "global.h"
#include "heal_location.h"
#include "constants/maps.h"
#include "constants/heal_locations.h"
#include "data/heal_locations.h"
+2 -3
View File
@@ -292,10 +292,9 @@ static void LinkTestScreen(void)
gLinkType = LINKTYPE_TRADE;
OpenLink();
SeedRng(gMain.vblankCounter2);
for (i = 0; i < MAX_LINK_PLAYERS; i++)
{
for (i = 0; i < TRAINER_ID_LENGTH; i++)
gSaveBlock2Ptr->playerTrainerId[i] = Random() % 256;
}
InitLinkTestBG(0, 2, 4, 0, 0);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_BG2_ON | DISPCNT_OBJ_ON);
CreateTask(Task_DestroySelf, 0);
-1
View File
@@ -29,7 +29,6 @@
#include "constants/abilities.h"
#include "constants/battle_frontier.h"
#include "constants/event_objects.h"
#include "constants/maps.h"
#include "constants/region_map_sections.h"
#include "constants/songs.h"
#include "constants/trainers.h"
-1
View File
@@ -16,7 +16,6 @@
#include "decompress.h"
#include "constants/songs.h"
#include "constants/items.h"
#include "constants/maps.h"
#define TAG_SWAP_LINE 109
-1
View File
@@ -15,7 +15,6 @@
#include "task.h"
#include "window.h"
#include "constants/event_objects.h"
#include "constants/maps.h"
#include "constants/rgb.h"
#include "constants/songs.h"
#include "constants/metatile_labels.h"
+1 -2
View File
@@ -29,7 +29,6 @@
#include "pokedex.h"
#include "apprentice.h"
#include "frontier_util.h"
#include "constants/maps.h"
#include "pokedex.h"
#include "save.h"
#include "link_rfu.h"
@@ -126,7 +125,7 @@ static void ClearFrontierRecord(void)
static void WarpToTruck(void)
{
SetWarpDestination(MAP_GROUP(INSIDE_OF_TRUCK), MAP_NUM(INSIDE_OF_TRUCK), -1, -1, -1);
SetWarpDestination(MAP_GROUP(INSIDE_OF_TRUCK), MAP_NUM(INSIDE_OF_TRUCK), WARP_ID_NONE, -1, -1);
WarpIntoMap();
}
+16 -13
View File
@@ -62,7 +62,6 @@
#include "constants/abilities.h"
#include "constants/layouts.h"
#include "constants/map_types.h"
#include "constants/maps.h"
#include "constants/region_map_sections.h"
#include "constants/songs.h"
#include "constants/trainer_hill.h"
@@ -208,7 +207,7 @@ static const struct WarpData sDummyWarpData =
{
.mapGroup = MAP_GROUP(UNDEFINED),
.mapNum = MAP_NUM(UNDEFINED),
.warpId = -1,
.warpId = WARP_ID_NONE,
.x = -1,
.y = -1,
};
@@ -570,7 +569,7 @@ static bool32 IsDummyWarp(struct WarpData *warp)
return FALSE;
else if (warp->mapNum != (s8)MAP_NUM(UNDEFINED))
return FALSE;
else if (warp->warpId != -1)
else if (warp->warpId != WARP_ID_NONE)
return FALSE;
else if (warp->x != -1)
return FALSE;
@@ -608,16 +607,20 @@ static void SetPlayerCoordsFromWarp(void)
{
if (gSaveBlock1Ptr->location.warpId >= 0 && gSaveBlock1Ptr->location.warpId < gMapHeader.events->warpCount)
{
// warpId is a valid warp for this map, use the coords of that warp.
gSaveBlock1Ptr->pos.x = gMapHeader.events->warps[gSaveBlock1Ptr->location.warpId].x;
gSaveBlock1Ptr->pos.y = gMapHeader.events->warps[gSaveBlock1Ptr->location.warpId].y;
}
else if (gSaveBlock1Ptr->location.x >= 0 && gSaveBlock1Ptr->location.y >= 0)
{
// Invalid warpId given. The given coords are valid, use those instead.
// WARP_ID_NONE is used to reach this intentionally.
gSaveBlock1Ptr->pos.x = gSaveBlock1Ptr->location.x;
gSaveBlock1Ptr->pos.y = gSaveBlock1Ptr->location.y;
}
else
{
// Invalid warpId and coords given. Put player in center of map.
gSaveBlock1Ptr->pos.x = gMapHeader.mapLayout->width / 2;
gSaveBlock1Ptr->pos.y = gMapHeader.mapLayout->height / 2;
}
@@ -659,7 +662,7 @@ void SetWarpDestinationToHealLocation(u8 healLocationId)
{
const struct HealLocation *warp = GetHealLocation(healLocationId);
if (warp)
SetWarpDestination(warp->group, warp->map, -1, warp->x, warp->y);
SetWarpDestination(warp->group, warp->map, WARP_ID_NONE, warp->x, warp->y);
}
void SetWarpDestinationToLastHealLocation(void)
@@ -671,7 +674,7 @@ void SetLastHealLocationWarp(u8 healLocationId)
{
const struct HealLocation *healLocation = GetHealLocation(healLocationId);
if (healLocation)
SetWarpData(&gSaveBlock1Ptr->lastHealLocation, healLocation->group, healLocation->map, -1, healLocation->x, healLocation->y);
SetWarpData(&gSaveBlock1Ptr->lastHealLocation, healLocation->group, healLocation->map, WARP_ID_NONE, healLocation->x, healLocation->y);
}
void UpdateEscapeWarp(s16 x, s16 y)
@@ -679,7 +682,7 @@ void UpdateEscapeWarp(s16 x, s16 y)
u8 currMapType = GetCurrentMapType();
u8 destMapType = GetMapTypeByGroupAndId(sWarpDestination.mapGroup, sWarpDestination.mapNum);
if (IsMapTypeOutdoors(currMapType) && IsMapTypeOutdoors(destMapType) != TRUE)
SetEscapeWarp(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1, x - MAP_OFFSET, y - MAP_OFFSET + 1);
SetEscapeWarp(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE, x - MAP_OFFSET, y - MAP_OFFSET + 1);
}
void SetEscapeWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y)
@@ -712,7 +715,7 @@ void SetWarpDestinationToFixedHoleWarp(s16 x, s16 y)
if (IsDummyWarp(&sFixedHoleWarp) == TRUE)
sWarpDestination = gLastUsedWarp;
else
SetWarpDestination(sFixedHoleWarp.mapGroup, sFixedHoleWarp.mapNum, -1, x, y);
SetWarpDestination(sFixedHoleWarp.mapGroup, sFixedHoleWarp.mapNum, WARP_ID_NONE, x, y);
}
static void SetWarpDestinationToContinueGameWarp(void)
@@ -729,7 +732,7 @@ void SetContinueGameWarpToHealLocation(u8 healLocationId)
{
const struct HealLocation *warp = GetHealLocation(healLocationId);
if (warp)
SetWarpData(&gSaveBlock1Ptr->continueGameWarp, warp->group, warp->map, -1, warp->x, warp->y);
SetWarpData(&gSaveBlock1Ptr->continueGameWarp, warp->group, warp->map, WARP_ID_NONE, warp->x, warp->y);
}
void SetContinueGameWarpToDynamicWarp(int unused)
@@ -759,7 +762,7 @@ static bool8 SetDiveWarp(u8 dir, u16 x, u16 y)
if (connection != NULL)
{
SetWarpDestination(connection->mapGroup, connection->mapNum, -1, x, y);
SetWarpDestination(connection->mapGroup, connection->mapNum, WARP_ID_NONE, x, y);
}
else
{
@@ -785,7 +788,7 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum)
{
s32 paletteIndex;
SetWarpDestination(mapGroup, mapNum, -1, -1, -1);
SetWarpDestination(mapGroup, mapNum, WARP_ID_NONE, -1, -1);
// Dont transition map music between BF Outside West/East
if (gMapHeader.regionMapSectionId != MAPSEC_BATTLE_FRONTIER)
@@ -3143,17 +3146,17 @@ static u8 FlipVerticalAndClearForced(u8 newFacing, u8 oldFacing)
return oldFacing;
}
static u8 LinkPlayerDetectCollision(u8 selfObjEventId, u8 a2, s16 x, s16 y)
static bool8 LinkPlayerDetectCollision(u8 selfObjEventId, u8 direction, s16 x, s16 y)
{
u8 i;
for (i = 0; i < 16; i++)
for (i = 0; i < OBJECT_EVENTS_COUNT; i++)
{
if (i != selfObjEventId)
{
if ((gObjectEvents[i].currentCoords.x == x && gObjectEvents[i].currentCoords.y == y)
|| (gObjectEvents[i].previousCoords.x == x && gObjectEvents[i].previousCoords.y == y))
{
return 1;
return TRUE;
}
}
}
-1
View File
@@ -69,7 +69,6 @@
#include "constants/field_effects.h"
#include "constants/item_effects.h"
#include "constants/items.h"
#include "constants/maps.h"
#include "constants/moves.h"
#include "constants/party_menu.h"
#include "constants/rgb.h"
-1
View File
@@ -16,7 +16,6 @@
#include "trig.h"
#include "pokedex_area_region_map.h"
#include "wild_encounter.h"
#include "constants/maps.h"
#include "constants/region_map_sections.h"
#include "constants/rgb.h"
#include "constants/songs.h"
-1
View File
@@ -37,7 +37,6 @@
#include "walda_phrase.h"
#include "window.h"
#include "constants/items.h"
#include "constants/maps.h"
#include "constants/moves.h"
#include "constants/rgb.h"
#include "constants/songs.h"
+1 -2
View File
@@ -7,7 +7,6 @@
#include "palette.h"
#include "party_menu.h"
#include "trig.h"
#include "constants/maps.h"
#include "overworld.h"
#include "event_data.h"
#include "secret_base.h"
@@ -2018,7 +2017,7 @@ static void CB_ExitFlyMap(void)
if (sMapHealLocations[sFlyMap->regionMap.mapSecId][2] != 0)
SetWarpDestinationToHealLocation(sMapHealLocations[sFlyMap->regionMap.mapSecId][2]);
else
SetWarpDestinationToMapWarp(sMapHealLocations[sFlyMap->regionMap.mapSecId][0], sMapHealLocations[sFlyMap->regionMap.mapSecId][1], -1);
SetWarpDestinationToMapWarp(sMapHealLocations[sFlyMap->regionMap.mapSecId][0], sMapHealLocations[sFlyMap->regionMap.mapSecId][1], WARP_ID_NONE);
break;
}
ReturnToFieldFromFlyMapSelect();
-1
View File
@@ -3,7 +3,6 @@
#include "pokemon.h"
#include "random.h"
#include "roamer.h"
#include "constants/maps.h"
// Despite having a variable to track it, the roamer is
// hard-coded to only ever be in map group 0
-1
View File
@@ -5,7 +5,6 @@
#include "fieldmap.h"
#include "sound.h"
#include "sprite.h"
#include "constants/maps.h"
#include "constants/songs.h"
#define ROTATING_GATE_TILE_TAG 0x1300
-1
View File
@@ -1,6 +1,5 @@
#include "global.h"
#include "save_location.h"
#include "constants/maps.h"
#define LIST_END 0xFFFF
+2 -2
View File
@@ -49,7 +49,6 @@
#include "tv.h"
#include "window.h"
#include "constants/event_objects.h"
#include "constants/maps.h"
typedef u16 (*SpecialFunc)(void);
typedef void (*NativeFunc)(void);
@@ -790,7 +789,7 @@ bool8 ScrCmd_warphole(struct ScriptContext *ctx)
if (mapGroup == MAP_GROUP(UNDEFINED) && mapNum == MAP_NUM(UNDEFINED))
SetWarpDestinationToFixedHoleWarp(x - MAP_OFFSET, y - MAP_OFFSET);
else
SetWarpDestination(mapGroup, mapNum, -1, x - MAP_OFFSET, y - MAP_OFFSET);
SetWarpDestination(mapGroup, mapNum, WARP_ID_NONE, x - MAP_OFFSET, y - MAP_OFFSET);
DoFallWarp();
ResetInitialPlayerAvatarState();
return TRUE;
@@ -2238,6 +2237,7 @@ bool8 ScrCmd_gotowondercardscript(struct ScriptContext *ctx)
return FALSE;
}
// This warp is only used by the Union Room.
// For the warp used by the Aqua Hideout, see DoTeleportTileWarp
bool8 ScrCmd_warpspinenter(struct ScriptContext *ctx)
{
-1
View File
@@ -4,7 +4,6 @@
#include "mystery_gift.h"
#include "util.h"
#include "constants/event_objects.h"
#include "constants/maps.h"
#include "constants/map_scripts.h"
#define RAM_SCRIPT_MAGIC 51
+3 -4
View File
@@ -39,7 +39,6 @@
#include "constants/event_objects.h"
#include "constants/field_specials.h"
#include "constants/items.h"
#include "constants/maps.h"
#include "constants/map_types.h"
#include "constants/metatile_behaviors.h"
#include "constants/metatile_labels.h"
@@ -446,7 +445,7 @@ void EnterSecretBase(void)
{
CreateTask(Task_EnterSecretBase, 0);
FadeScreen(FADE_TO_BLACK, 0);
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE);
}
bool8 SecretBaseMapPopupEnabled(void)
@@ -490,7 +489,7 @@ static void Task_EnterNewlyCreatedSecretBase(u8 taskId)
SetWarpDestination(
gSaveBlock1Ptr->location.mapGroup,
gSaveBlock1Ptr->location.mapNum,
-1,
WARP_ID_NONE,
GET_BASE_COMPUTER_X(secretBaseGroup),
GET_BASE_COMPUTER_Y(secretBaseGroup));
WarpIntoMap();
@@ -700,7 +699,7 @@ static void Task_WarpOutOfSecretBase(u8 taskId)
gTasks[taskId].data[0] = 2;
break;
case 2:
SetWarpDestinationToDynamicWarp(0x7e);
SetWarpDestinationToDynamicWarp(WARP_ID_SECRET_BASE);
WarpIntoMap();
gFieldCallback = FieldCB_DefaultWarpExit;
SetMainCallback2(CB2_LoadMap);
-1
View File
@@ -28,7 +28,6 @@
#include "constants/items.h"
#include "constants/layouts.h"
#include "constants/moves.h"
#include "constants/maps.h"
#include "constants/trainers.h"
#include "constants/easy_chat.h"
#include "constants/trainer_hill.h"
-1
View File
@@ -40,7 +40,6 @@
#include "constants/items.h"
#include "constants/layouts.h"
#include "constants/lilycove_lady.h"
#include "constants/maps.h"
#include "constants/metatile_behaviors.h"
#include "constants/metatile_labels.h"
#include "constants/moves.h"
+3 -4
View File
@@ -49,7 +49,6 @@
#include "constants/battle_frontier.h"
#include "constants/cable_club.h"
#include "constants/game_stat.h"
#include "constants/maps.h"
#include "constants/party_menu.h"
#include "constants/rgb.h"
#include "constants/songs.h"
@@ -1593,8 +1592,8 @@ void StartUnionRoomBattle(u16 battleFlags)
static void WarpForWirelessMinigame(u16 linkService, u16 x, u16 y)
{
VarSet(VAR_CABLE_CLUB_STATE, linkService);
SetWarpDestination(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1, x, y);
SetDynamicWarpWithCoords(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1, x, y);
SetWarpDestination(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE, x, y);
SetDynamicWarpWithCoords(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE, x, y);
WarpIntoMap();
}
@@ -1605,7 +1604,7 @@ static void WarpForCableClubActivity(s8 mapGroup, s8 mapNum, s32 x, s32 y, u16 l
gFieldLinkPlayerCount = GetLinkPlayerCount();
gLocalLinkPlayerId = GetMultiplayerId();
SetCableClubWarp();
SetWarpDestination(mapGroup, mapNum, -1, x, y);
SetWarpDestination(mapGroup, mapNum, WARP_ID_NONE, x, y);
WarpIntoMap();
}
-1
View File
@@ -20,7 +20,6 @@
#include "constants/game_stat.h"
#include "constants/items.h"
#include "constants/layouts.h"
#include "constants/maps.h"
#include "constants/weather.h"
extern const u8 EventScript_RepelWoreOff[];