summaryrefslogtreecommitdiff
path: root/src/scrcmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/scrcmd.c')
-rw-r--r--src/scrcmd.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/scrcmd.c b/src/scrcmd.c
index ab3af019d..837259a7f 100644
--- a/src/scrcmd.c
+++ b/src/scrcmd.c
@@ -49,12 +49,12 @@
#include "trainer_see.h"
#include "tv.h"
#include "window.h"
+#include "constants/event_objects.h"
typedef u16 (*SpecialFunc)(void);
typedef void (*NativeFunc)(void);
-extern const u8 *gUnknown_020375C0;
-
+EWRAM_DATA const u8 *gUnknown_020375C0 = NULL;
static EWRAM_DATA u32 gUnknown_020375C4 = 0;
static EWRAM_DATA u16 sPauseCounter = 0;
static EWRAM_DATA u16 sMovingNpcId = 0;
@@ -735,7 +735,7 @@ bool8 ScrCmd_setmaplayoutindex(struct ScriptContext *ctx)
{
u16 value = VarGet(ScriptReadHalfword(ctx));
- sub_8085524(value);
+ SetCurrentMapLayout(value);
return FALSE;
}
@@ -747,8 +747,8 @@ bool8 ScrCmd_warp(struct ScriptContext *ctx)
u16 x = VarGet(ScriptReadHalfword(ctx));
u16 y = VarGet(ScriptReadHalfword(ctx));
- Overworld_SetWarpDestination(mapGroup, mapNum, warpId, x, y);
- sub_80AF734();
+ SetWarpDestination(mapGroup, mapNum, warpId, x, y);
+ DoWarp();
ResetInitialPlayerAvatarState();
return TRUE;
}
@@ -761,8 +761,8 @@ bool8 ScrCmd_warpsilent(struct ScriptContext *ctx)
u16 x = VarGet(ScriptReadHalfword(ctx));
u16 y = VarGet(ScriptReadHalfword(ctx));
- Overworld_SetWarpDestination(mapGroup, mapNum, warpId, x, y);
- sp13E_warp_to_last_warp();
+ SetWarpDestination(mapGroup, mapNum, warpId, x, y);
+ DoDiveWarp();
ResetInitialPlayerAvatarState();
return TRUE;
}
@@ -775,8 +775,8 @@ bool8 ScrCmd_warpdoor(struct ScriptContext *ctx)
u16 x = VarGet(ScriptReadHalfword(ctx));
u16 y = VarGet(ScriptReadHalfword(ctx));
- Overworld_SetWarpDestination(mapGroup, mapNum, warpId, x, y);
- sub_80AF7D0();
+ SetWarpDestination(mapGroup, mapNum, warpId, x, y);
+ DoDoorWarp();
ResetInitialPlayerAvatarState();
return TRUE;
}
@@ -790,10 +790,10 @@ bool8 ScrCmd_warphole(struct ScriptContext *ctx)
PlayerGetDestCoords(&x, &y);
if (mapGroup == 0xFF && mapNum == 0xFF)
- SetFixedHoleWarpAsDestination(x - 7, y - 7);
+ SetWarpDestinationToFixedHoleWarp(x - 7, y - 7);
else
- Overworld_SetWarpDestination(mapGroup, mapNum, -1, x - 7, y - 7);
- sp13F_fall_to_last_warp();
+ SetWarpDestination(mapGroup, mapNum, -1, x - 7, y - 7);
+ DoFallWarp();
ResetInitialPlayerAvatarState();
return TRUE;
}
@@ -806,7 +806,7 @@ bool8 ScrCmd_warpteleport(struct ScriptContext *ctx)
u16 x = VarGet(ScriptReadHalfword(ctx));
u16 y = VarGet(ScriptReadHalfword(ctx));
- Overworld_SetWarpDestination(mapGroup, mapNum, warpId, x, y);
+ SetWarpDestination(mapGroup, mapNum, warpId, x, y);
sub_80AF848();
ResetInitialPlayerAvatarState();
return TRUE;
@@ -820,7 +820,7 @@ bool8 ScrCmd_warpD7(struct ScriptContext *ctx)
u16 x = VarGet(ScriptReadHalfword(ctx));
u16 y = VarGet(ScriptReadHalfword(ctx));
- Overworld_SetWarpDestination(mapGroup, mapNum, warpId, x, y);
+ SetWarpDestination(mapGroup, mapNum, warpId, x, y);
sub_80AF87C();
ResetInitialPlayerAvatarState();
return TRUE;
@@ -834,7 +834,7 @@ bool8 ScrCmd_setwarp(struct ScriptContext *ctx)
u16 x = VarGet(ScriptReadHalfword(ctx));
u16 y = VarGet(ScriptReadHalfword(ctx));
- Overworld_SetWarpDestination(mapGroup, mapNum, warpId, x, y);
+ SetWarpDestination(mapGroup, mapNum, warpId, x, y);
return FALSE;
}
@@ -846,7 +846,7 @@ bool8 ScrCmd_setdynamicwarp(struct ScriptContext *ctx)
u16 x = VarGet(ScriptReadHalfword(ctx));
u16 y = VarGet(ScriptReadHalfword(ctx));
- saved_warp2_set_2(0, mapGroup, mapNum, warpId, x, y);
+ SetDynamicWarpWithCoords(0, mapGroup, mapNum, warpId, x, y);
return FALSE;
}
@@ -882,7 +882,7 @@ bool8 ScrCmd_setescapewarp(struct ScriptContext *ctx)
u16 x = VarGet(ScriptReadHalfword(ctx));
u16 y = VarGet(ScriptReadHalfword(ctx));
- sub_8084DD4(mapGroup, mapNum, warpId, x, y);
+ SetEscapeWarp(mapGroup, mapNum, warpId, x, y);
return FALSE;
}
@@ -1239,11 +1239,11 @@ bool8 ScrCmd_lock(struct ScriptContext *ctx)
bool8 ScrCmd_releaseall(struct ScriptContext *ctx)
{
- u8 objectId;
+ u8 playerObjectId;
HideFieldMessageBox();
- objectId = GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0);
- EventObjectClearHeldMovementIfFinished(&gEventObjects[objectId]);
+ playerObjectId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0);
+ EventObjectClearHeldMovementIfFinished(&gEventObjects[playerObjectId]);
sub_80D338C();
UnfreezeEventObjects();
return FALSE;
@@ -1251,13 +1251,13 @@ bool8 ScrCmd_releaseall(struct ScriptContext *ctx)
bool8 ScrCmd_release(struct ScriptContext *ctx)
{
- u8 objectId;
+ u8 playerObjectId;
HideFieldMessageBox();
if (gEventObjects[gSelectedEventObject].active)
EventObjectClearHeldMovementIfFinished(&gEventObjects[gSelectedEventObject]);
- objectId = GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0);
- EventObjectClearHeldMovementIfFinished(&gEventObjects[objectId]);
+ playerObjectId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0);
+ EventObjectClearHeldMovementIfFinished(&gEventObjects[playerObjectId]);
sub_80D338C();
UnfreezeEventObjects();
return FALSE;
@@ -1998,7 +1998,7 @@ bool8 ScrCmd_setrespawn(struct ScriptContext *ctx)
{
u16 healLocationId = VarGet(ScriptReadHalfword(ctx));
- Overworld_SetHealLocationWarp(healLocationId);
+ SetLastHealLocationWarp(healLocationId);
return FALSE;
}
@@ -2235,7 +2235,7 @@ bool8 ScrCmd_warpD1(struct ScriptContext *ctx)
u16 x = VarGet(ScriptReadHalfword(ctx));
u16 y = VarGet(ScriptReadHalfword(ctx));
- Overworld_SetWarpDestination(mapGroup, mapNum, warpId, x, y);
+ SetWarpDestination(mapGroup, mapNum, warpId, x, y);
sub_808D074(GetPlayerFacingDirection());
sub_80B0244();
ResetInitialPlayerAvatarState();
@@ -2289,7 +2289,7 @@ bool8 ScrCmd_warpE0(struct ScriptContext *ctx)
u16 x = VarGet(ScriptReadHalfword(ctx));
u16 y = VarGet(ScriptReadHalfword(ctx));
- Overworld_SetWarpDestination(mapGroup, mapNum, warpId, x, y);
+ SetWarpDestination(mapGroup, mapNum, warpId, x, y);
sub_80AF79C();
ResetInitialPlayerAvatarState();
return TRUE;