From 04197b49126604a310fae1d314709334f6d2460d Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 31 Aug 2024 01:54:25 -0400 Subject: [PATCH] Fix swapped cycling road entrances --- data/event_scripts.s | 2 +- data/maps/Route110/map.json | 8 ++++---- .../map.json | 8 ++++---- .../scripts.inc | 16 ++++++++++++++++ .../map.json | 8 ++++---- .../scripts.inc | 16 ---------------- data/maps/map_groups.json | 4 ++-- src/field_specials.c | 2 +- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/data/event_scripts.s b/data/event_scripts.s index e8fb9dcbd1..55720a6add 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -563,8 +563,8 @@ gStdScripts_End:: .include "data/maps/Route110_TrickHousePuzzle6/scripts.inc" .include "data/maps/Route110_TrickHousePuzzle7/scripts.inc" .include "data/maps/Route110_TrickHousePuzzle8/scripts.inc" - .include "data/maps/Route110_SeasideCyclingRoadNorthEntrance/scripts.inc" .include "data/maps/Route110_SeasideCyclingRoadSouthEntrance/scripts.inc" + .include "data/maps/Route110_SeasideCyclingRoadNorthEntrance/scripts.inc" .include "data/maps/Route113_GlassWorkshop/scripts.inc" .include "data/maps/Route123_BerryMastersHouse/scripts.inc" .include "data/maps/Route119_WeatherInstitute_1F/scripts.inc" diff --git a/data/maps/Route110/map.json b/data/maps/Route110/map.json index 2b52164113..6e4982fa22 100644 --- a/data/maps/Route110/map.json +++ b/data/maps/Route110/map.json @@ -518,28 +518,28 @@ "x": 15, "y": 16, "elevation": 0, - "dest_map": "MAP_ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE", + "dest_map": "MAP_ROUTE110_SEASIDE_CYCLING_ROAD_NORTH_ENTRANCE", "dest_warp_id": "0" }, { "x": 18, "y": 16, "elevation": 0, - "dest_map": "MAP_ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE", + "dest_map": "MAP_ROUTE110_SEASIDE_CYCLING_ROAD_NORTH_ENTRANCE", "dest_warp_id": "2" }, { "x": 16, "y": 88, "elevation": 0, - "dest_map": "MAP_ROUTE110_SEASIDE_CYCLING_ROAD_NORTH_ENTRANCE", + "dest_map": "MAP_ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE", "dest_warp_id": "0" }, { "x": 19, "y": 88, "elevation": 0, - "dest_map": "MAP_ROUTE110_SEASIDE_CYCLING_ROAD_NORTH_ENTRANCE", + "dest_map": "MAP_ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE", "dest_warp_id": "2" } ], diff --git a/data/maps/Route110_SeasideCyclingRoadNorthEntrance/map.json b/data/maps/Route110_SeasideCyclingRoadNorthEntrance/map.json index 6f3c6c75c5..88cbf1cc88 100644 --- a/data/maps/Route110_SeasideCyclingRoadNorthEntrance/map.json +++ b/data/maps/Route110_SeasideCyclingRoadNorthEntrance/map.json @@ -34,28 +34,28 @@ "y": 5, "elevation": 0, "dest_map": "MAP_ROUTE110", - "dest_warp_id": "4" + "dest_warp_id": "2" }, { "x": 2, "y": 5, "elevation": 0, "dest_map": "MAP_ROUTE110", - "dest_warp_id": "4" + "dest_warp_id": "2" }, { "x": 12, "y": 5, "elevation": 0, "dest_map": "MAP_ROUTE110", - "dest_warp_id": "5" + "dest_warp_id": "3" }, { "x": 13, "y": 5, "elevation": 0, "dest_map": "MAP_ROUTE110", - "dest_warp_id": "5" + "dest_warp_id": "3" } ], "coord_events": [ diff --git a/data/maps/Route110_SeasideCyclingRoadNorthEntrance/scripts.inc b/data/maps/Route110_SeasideCyclingRoadNorthEntrance/scripts.inc index 5eb1f3dea2..fb1cdc5c71 100644 --- a/data/maps/Route110_SeasideCyclingRoadNorthEntrance/scripts.inc +++ b/data/maps/Route110_SeasideCyclingRoadNorthEntrance/scripts.inc @@ -1,6 +1,16 @@ Route110_SeasideCyclingRoadNorthEntrance_MapScripts:: + map_script MAP_SCRIPT_ON_TRANSITION, Route110_SeasideCyclingRoadNorthEntrance_OnTransition .byte 0 +Route110_SeasideCyclingRoadNorthEntrance_OnTransition: + call_if_eq VAR_CYCLING_CHALLENGE_STATE, 3, Route110_SeasideCyclingRoadNorthEntrance_EventScript_RestartChallenge + call_if_eq VAR_CYCLING_CHALLENGE_STATE, 2, Route110_SeasideCyclingRoadNorthEntrance_EventScript_RestartChallenge + end + +Route110_SeasideCyclingRoadNorthEntrance_EventScript_RestartChallenge:: + setvar VAR_CYCLING_CHALLENGE_STATE, 1 + return + Route110_SeasideCyclingRoadNorthEntrance_EventScript_Clerk:: lock faceplayer @@ -11,12 +21,17 @@ Route110_SeasideCyclingRoadNorthEntrance_EventScript_Clerk:: Route110_SeasideCyclingRoadNorthEntrance_EventScript_BikeCheck:: lockall specialvar VAR_RESULT, GetPlayerAvatarBike + call_if_eq VAR_RESULT, 2, Route110_SeasideCyclingRoadNorthEntrance_EventScript_OnMachBike goto_if_eq VAR_RESULT, 0, Route110_SeasideCyclingRoadNorthEntrance_EventScript_NoBike setflag FLAG_SYS_CYCLING_ROAD setvar VAR_TEMP_1, 1 releaseall end +Route110_SeasideCyclingRoadNorthEntrance_EventScript_OnMachBike:: + setvar VAR_CYCLING_CHALLENGE_STATE, 1 + return + Route110_SeasideCyclingRoadNorthEntrance_EventScript_NoBike:: msgbox Route110_SeasideCyclingRoadNorthEntrance_Text_TooDangerousToWalk, MSGBOX_DEFAULT closemessage @@ -31,6 +46,7 @@ Route110_SeasideCyclingRoadNorthEntrance_Movement_PushPlayerBackFromCounter: Route110_SeasideCyclingRoadNorthEntrance_EventScript_ClearCyclingRoad:: lockall + setvar VAR_CYCLING_CHALLENGE_STATE, 0 clearflag FLAG_SYS_CYCLING_ROAD setvar VAR_TEMP_1, 0 releaseall diff --git a/data/maps/Route110_SeasideCyclingRoadSouthEntrance/map.json b/data/maps/Route110_SeasideCyclingRoadSouthEntrance/map.json index 59e3e5be65..943984075d 100644 --- a/data/maps/Route110_SeasideCyclingRoadSouthEntrance/map.json +++ b/data/maps/Route110_SeasideCyclingRoadSouthEntrance/map.json @@ -34,28 +34,28 @@ "y": 5, "elevation": 0, "dest_map": "MAP_ROUTE110", - "dest_warp_id": "2" + "dest_warp_id": "4" }, { "x": 2, "y": 5, "elevation": 0, "dest_map": "MAP_ROUTE110", - "dest_warp_id": "2" + "dest_warp_id": "4" }, { "x": 12, "y": 5, "elevation": 0, "dest_map": "MAP_ROUTE110", - "dest_warp_id": "3" + "dest_warp_id": "5" }, { "x": 13, "y": 5, "elevation": 0, "dest_map": "MAP_ROUTE110", - "dest_warp_id": "3" + "dest_warp_id": "5" } ], "coord_events": [ diff --git a/data/maps/Route110_SeasideCyclingRoadSouthEntrance/scripts.inc b/data/maps/Route110_SeasideCyclingRoadSouthEntrance/scripts.inc index df53f55ccf..5c4dcfa219 100644 --- a/data/maps/Route110_SeasideCyclingRoadSouthEntrance/scripts.inc +++ b/data/maps/Route110_SeasideCyclingRoadSouthEntrance/scripts.inc @@ -1,16 +1,6 @@ Route110_SeasideCyclingRoadSouthEntrance_MapScripts:: - map_script MAP_SCRIPT_ON_TRANSITION, Route110_SeasideCyclingRoadSouthEntrance_OnTransition .byte 0 -Route110_SeasideCyclingRoadSouthEntrance_OnTransition: - call_if_eq VAR_CYCLING_CHALLENGE_STATE, 3, Route110_SeasideCyclingRoadSouthEntrance_EventScript_RestartChallenge - call_if_eq VAR_CYCLING_CHALLENGE_STATE, 2, Route110_SeasideCyclingRoadSouthEntrance_EventScript_RestartChallenge - end - -Route110_SeasideCyclingRoadSouthEntrance_EventScript_RestartChallenge:: - setvar VAR_CYCLING_CHALLENGE_STATE, 1 - return - Route110_SeasideCyclingRoadSouthEntrance_EventScript_Clerk:: lock faceplayer @@ -21,17 +11,12 @@ Route110_SeasideCyclingRoadSouthEntrance_EventScript_Clerk:: Route110_SeasideCyclingRoadSouthEntrance_EventScript_BikeCheck:: lockall specialvar VAR_RESULT, GetPlayerAvatarBike - call_if_eq VAR_RESULT, 2, Route110_SeasideCyclingRoadSouthEntrance_EventScript_OnMachBike goto_if_eq VAR_RESULT, 0, Route110_SeasideCyclingRoadSouthEntrance_EventScript_NoBike setflag FLAG_SYS_CYCLING_ROAD setvar VAR_TEMP_1, 1 releaseall end -Route110_SeasideCyclingRoadSouthEntrance_EventScript_OnMachBike:: - setvar VAR_CYCLING_CHALLENGE_STATE, 1 - return - Route110_SeasideCyclingRoadSouthEntrance_EventScript_NoBike:: msgbox Route110_SeasideCyclingRoadSouthEntrance_Text_TooDangerousToWalk, MSGBOX_DEFAULT closemessage @@ -46,7 +31,6 @@ Route110_SeasideCyclingRoadSouthEntrance_Movement_PushPlayerBackFromCounter: Route110_SeasideCyclingRoadSouthEntrance_EventScript_ClearCyclingRoad:: lockall - setvar VAR_CYCLING_CHALLENGE_STATE, 0 clearflag FLAG_SYS_CYCLING_ROAD setvar VAR_TEMP_1, 0 releaseall diff --git a/data/maps/map_groups.json b/data/maps/map_groups.json index ebef431b30..8a90679c8d 100644 --- a/data/maps/map_groups.json +++ b/data/maps/map_groups.json @@ -604,8 +604,8 @@ "Route110_TrickHousePuzzle6", "Route110_TrickHousePuzzle7", "Route110_TrickHousePuzzle8", - "Route110_SeasideCyclingRoadNorthEntrance", - "Route110_SeasideCyclingRoadSouthEntrance" + "Route110_SeasideCyclingRoadSouthEntrance", + "Route110_SeasideCyclingRoadNorthEntrance" ], "gMapGroup_IndoorRoute113": [ "Route113_GlassWorkshop" diff --git a/src/field_specials.c b/src/field_specials.c index f1e5d7bb2d..f8d493493c 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -263,7 +263,7 @@ u16 GetRecordedCyclingRoadResults(void) void UpdateCyclingRoadState(void) { - if (gLastUsedWarp.mapNum == MAP_NUM(ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE) && gLastUsedWarp.mapGroup == MAP_GROUP(ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE)) + if (gLastUsedWarp.mapNum == MAP_NUM(ROUTE110_SEASIDE_CYCLING_ROAD_NORTH_ENTRANCE) && gLastUsedWarp.mapGroup == MAP_GROUP(ROUTE110_SEASIDE_CYCLING_ROAD_NORTH_ENTRANCE)) return; if (VarGet(VAR_CYCLING_CHALLENGE_STATE) == 2 || VarGet(VAR_CYCLING_CHALLENGE_STATE) == 3)