From d59f5a8e5649ad09a41b65edcc68f701320ca52e Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Thu, 27 Dec 2018 16:30:47 -0600 Subject: Misc overworld documentation --- src/scrcmd.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/scrcmd.c') diff --git a/src/scrcmd.c b/src/scrcmd.c index ab3af019d..39df1117d 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -735,7 +735,7 @@ bool8 ScrCmd_setmaplayoutindex(struct ScriptContext *ctx) { u16 value = VarGet(ScriptReadHalfword(ctx)); - sub_8085524(value); + SetCurrentMapLayout(value); return FALSE; } @@ -747,7 +747,7 @@ bool8 ScrCmd_warp(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_80AF734(); ResetInitialPlayerAvatarState(); return TRUE; @@ -761,7 +761,7 @@ bool8 ScrCmd_warpsilent(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); sp13E_warp_to_last_warp(); ResetInitialPlayerAvatarState(); return TRUE; @@ -775,7 +775,7 @@ bool8 ScrCmd_warpdoor(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_80AF7D0(); ResetInitialPlayerAvatarState(); return TRUE; @@ -790,9 +790,9 @@ 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); + SetWarpDestination(mapGroup, mapNum, -1, x - 7, y - 7); sp13F_fall_to_last_warp(); 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; } @@ -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; -- cgit v1.2.3 From 46d41d2fb9c5d8ff842139410ebf0ff1642f9b82 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Fri, 28 Dec 2018 12:29:21 -0600 Subject: Use EVENT_OBJ_ID_PLAYER in C code --- src/scrcmd.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/scrcmd.c') diff --git a/src/scrcmd.c b/src/scrcmd.c index 39df1117d..77852ad31 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -49,6 +49,7 @@ #include "trainer_see.h" #include "tv.h" #include "window.h" +#include "constants/event_objects.h" typedef u16 (*SpecialFunc)(void); typedef void (*NativeFunc)(void); @@ -1239,11 +1240,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 +1252,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; -- cgit v1.2.3 From 6e7bdb3ca4d3753c1d382d9470c505d3922b9299 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Fri, 28 Dec 2018 15:11:15 -0600 Subject: Document misc field_specials things --- src/scrcmd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/scrcmd.c') diff --git a/src/scrcmd.c b/src/scrcmd.c index 77852ad31..dd14c1eef 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -749,7 +749,7 @@ bool8 ScrCmd_warp(struct ScriptContext *ctx) u16 y = VarGet(ScriptReadHalfword(ctx)); SetWarpDestination(mapGroup, mapNum, warpId, x, y); - sub_80AF734(); + DoWarp(); ResetInitialPlayerAvatarState(); return TRUE; } @@ -763,7 +763,7 @@ bool8 ScrCmd_warpsilent(struct ScriptContext *ctx) u16 y = VarGet(ScriptReadHalfword(ctx)); SetWarpDestination(mapGroup, mapNum, warpId, x, y); - sp13E_warp_to_last_warp(); + DoDiveWarp(); ResetInitialPlayerAvatarState(); return TRUE; } @@ -777,7 +777,7 @@ bool8 ScrCmd_warpdoor(struct ScriptContext *ctx) u16 y = VarGet(ScriptReadHalfword(ctx)); SetWarpDestination(mapGroup, mapNum, warpId, x, y); - sub_80AF7D0(); + DoDoorWarp(); ResetInitialPlayerAvatarState(); return TRUE; } @@ -794,7 +794,7 @@ bool8 ScrCmd_warphole(struct ScriptContext *ctx) SetWarpDestinationToFixedHoleWarp(x - 7, y - 7); else SetWarpDestination(mapGroup, mapNum, -1, x - 7, y - 7); - sp13F_fall_to_last_warp(); + DoFallWarp(); ResetInitialPlayerAvatarState(); return TRUE; } -- cgit v1.2.3