From 748a1dbdd4cc37edbd123c66296a789b428d8a5f Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 6 Oct 2019 14:16:37 -0400 Subject: [PATCH] Document cave hole --- data/maps/GraniteCave_B1F/scripts.inc | 8 ++++---- data/maps/MirageTower_2F/scripts.inc | 8 ++++---- data/maps/MirageTower_3F/scripts.inc | 8 ++++---- data/maps/MtPyre_2F/scripts.inc | 8 ++++---- data/maps/SkyPillar_2F/scripts.inc | 8 ++++---- data/maps/SkyPillar_4F/scripts.inc | 8 ++++---- data/scripts/cave_hole.inc | 22 +++++++--------------- include/event_scripts.h | 2 +- src/field_control_avatar.c | 2 +- 9 files changed, 33 insertions(+), 41 deletions(-) diff --git a/data/maps/GraniteCave_B1F/scripts.inc b/data/maps/GraniteCave_B1F/scripts.inc index 099e5a501..61e143e23 100644 --- a/data/maps/GraniteCave_B1F/scripts.inc +++ b/data/maps/GraniteCave_B1F/scripts.inc @@ -1,10 +1,10 @@ GraniteCave_B1F_MapScripts:: @ 822DC5E - map_script MAP_SCRIPT_ON_FRAME_TABLE, GraniteCave_B1F_MapScript2_2A8327 - map_script MAP_SCRIPT_ON_TRANSITION, GraniteCave_B1F_MapScript1_2A8331 - map_script MAP_SCRIPT_ON_RESUME, GraniteCave_B1F_MapScript1_22DC6E + map_script MAP_SCRIPT_ON_FRAME_TABLE, CaveHole_MapScript2_CheckFallDownHole + map_script MAP_SCRIPT_ON_TRANSITION, CaveHole_MapScript1_FixCrackedGround + map_script MAP_SCRIPT_ON_RESUME, GraniteCave_B1F_MapScript1_SetHoleWarp .byte 0 -GraniteCave_B1F_MapScript1_22DC6E: @ 822DC6E +GraniteCave_B1F_MapScript1_SetHoleWarp: @ 822DC6E setstepcallback 7 setholewarp MAP_GRANITE_CAVE_B2F, 255, 0, 0 end diff --git a/data/maps/MirageTower_2F/scripts.inc b/data/maps/MirageTower_2F/scripts.inc index d22a7c6ff..6fa89f400 100644 --- a/data/maps/MirageTower_2F/scripts.inc +++ b/data/maps/MirageTower_2F/scripts.inc @@ -1,10 +1,10 @@ MirageTower_2F_MapScripts:: @ 823AD11 - map_script MAP_SCRIPT_ON_FRAME_TABLE, MirageTower_2F_MapScript2_2A8327 - map_script MAP_SCRIPT_ON_TRANSITION, MirageTower_2F_MapScript1_2A8331 - map_script MAP_SCRIPT_ON_RESUME, MirageTower_2F_MapScript1_23AD21 + map_script MAP_SCRIPT_ON_FRAME_TABLE, CaveHole_MapScript2_CheckFallDownHole + map_script MAP_SCRIPT_ON_TRANSITION, CaveHole_MapScript1_FixCrackedGround + map_script MAP_SCRIPT_ON_RESUME, MirageTower_2F_MapScript1_SetHoleWarp .byte 0 -MirageTower_2F_MapScript1_23AD21: @ 823AD21 +MirageTower_2F_MapScript1_SetHoleWarp: @ 823AD21 setstepcallback 7 setholewarp MAP_MIRAGE_TOWER_1F, 255, 0, 0 end diff --git a/data/maps/MirageTower_3F/scripts.inc b/data/maps/MirageTower_3F/scripts.inc index f29f542fc..05cac7c03 100644 --- a/data/maps/MirageTower_3F/scripts.inc +++ b/data/maps/MirageTower_3F/scripts.inc @@ -1,10 +1,10 @@ MirageTower_3F_MapScripts:: @ 823AD2C - map_script MAP_SCRIPT_ON_FRAME_TABLE, MirageTower_3F_MapScript2_2A8327 - map_script MAP_SCRIPT_ON_TRANSITION, MirageTower_3F_MapScript1_2A8331 - map_script MAP_SCRIPT_ON_RESUME, MirageTower_3F_MapScript1_23AD3C + map_script MAP_SCRIPT_ON_FRAME_TABLE, CaveHole_MapScript2_CheckFallDownHole + map_script MAP_SCRIPT_ON_TRANSITION, CaveHole_MapScript1_FixCrackedGround + map_script MAP_SCRIPT_ON_RESUME, MirageTower_3F_MapScript1_SetHoleWarp .byte 0 -MirageTower_3F_MapScript1_23AD3C: @ 823AD3C +MirageTower_3F_MapScript1_SetHoleWarp: @ 823AD3C setstepcallback 7 setholewarp MAP_MIRAGE_TOWER_2F, 255, 0, 0 end diff --git a/data/maps/MtPyre_2F/scripts.inc b/data/maps/MtPyre_2F/scripts.inc index 150c08df4..2c8a93155 100644 --- a/data/maps/MtPyre_2F/scripts.inc +++ b/data/maps/MtPyre_2F/scripts.inc @@ -1,10 +1,10 @@ MtPyre_2F_MapScripts:: @ 82310FB - map_script MAP_SCRIPT_ON_FRAME_TABLE, MtPyre_2F_MapScript2_2A8327 - map_script MAP_SCRIPT_ON_TRANSITION, MtPyre_2F_MapScript1_2A8331 - map_script MAP_SCRIPT_ON_RESUME, MtPyre_2F_MapScript1_23110B + map_script MAP_SCRIPT_ON_FRAME_TABLE, CaveHole_MapScript2_CheckFallDownHole + map_script MAP_SCRIPT_ON_TRANSITION, CaveHole_MapScript1_FixCrackedGround + map_script MAP_SCRIPT_ON_RESUME, MtPyre_2F_MapScript1_SetHoleWarp .byte 0 -MtPyre_2F_MapScript1_23110B: @ 823110B +MtPyre_2F_MapScript1_SetHoleWarp: @ 823110B setstepcallback 7 setholewarp MAP_MT_PYRE_1F, 255, 0, 0 end diff --git a/data/maps/SkyPillar_2F/scripts.inc b/data/maps/SkyPillar_2F/scripts.inc index dcbff3642..710dd9372 100644 --- a/data/maps/SkyPillar_2F/scripts.inc +++ b/data/maps/SkyPillar_2F/scripts.inc @@ -1,20 +1,20 @@ SkyPillar_2F_MapScripts:: @ 823962B - map_script MAP_SCRIPT_ON_FRAME_TABLE, SkyPillar_2F_MapScript2_2A8327 + map_script MAP_SCRIPT_ON_FRAME_TABLE, CaveHole_MapScript2_CheckFallDownHole map_script MAP_SCRIPT_ON_TRANSITION, SkyPillar_2F_OnTransition - map_script MAP_SCRIPT_ON_RESUME, SkyPillar_2F_MapScript1_239650 + map_script MAP_SCRIPT_ON_RESUME, SkyPillar_2F_MapScript1_SetHoleWarp .byte 0 SkyPillar_2F_OnTransition: @ 823963B compare VAR_SKY_PILLAR_STATE, 2 call_if_lt SkyPillar_2F_EventScript_CleanFloor - copyvar VAR_ICE_STEP_COUNT, 0x1 + copyvar VAR_ICE_STEP_COUNT, 1 end SkyPillar_2F_EventScript_CleanFloor:: @ 823964C setmaplayoutindex LAYOUT_SKY_PILLAR_2F_CLEAN return -SkyPillar_2F_MapScript1_239650: @ 8239650 +SkyPillar_2F_MapScript1_SetHoleWarp: @ 8239650 setstepcallback 7 setholewarp MAP_SKY_PILLAR_1F, 255, 0, 0 end diff --git a/data/maps/SkyPillar_4F/scripts.inc b/data/maps/SkyPillar_4F/scripts.inc index 413f56521..5b13ab4f1 100644 --- a/data/maps/SkyPillar_4F/scripts.inc +++ b/data/maps/SkyPillar_4F/scripts.inc @@ -1,20 +1,20 @@ SkyPillar_4F_MapScripts:: @ 8239671 - map_script MAP_SCRIPT_ON_FRAME_TABLE, SkyPillar_4F_MapScript2_2A8327 + map_script MAP_SCRIPT_ON_FRAME_TABLE, CaveHole_MapScript2_CheckFallDownHole map_script MAP_SCRIPT_ON_TRANSITION, SkyPillar_4F_OnTransition - map_script MAP_SCRIPT_ON_RESUME, SkyPillar_4F_MapScript1_239696 + map_script MAP_SCRIPT_ON_RESUME, SkyPillar_4F_MapScript1_SetHoleWarp .byte 0 SkyPillar_4F_OnTransition: @ 8239681 compare VAR_SKY_PILLAR_STATE, 2 call_if_lt SkyPillar_4F_EventScript_CleanFloor - copyvar VAR_ICE_STEP_COUNT, 0x1 + copyvar VAR_ICE_STEP_COUNT, 1 end SkyPillar_4F_EventScript_CleanFloor:: @ 8239692 setmaplayoutindex LAYOUT_SKY_PILLAR_4F_CLEAN return -SkyPillar_4F_MapScript1_239696: @ 8239696 +SkyPillar_4F_MapScript1_SetHoleWarp: @ 8239696 setstepcallback 7 setholewarp MAP_SKY_PILLAR_3F, 255, 0, 0 end diff --git a/data/scripts/cave_hole.inc b/data/scripts/cave_hole.inc index 86689fdb0..0852149a6 100644 --- a/data/scripts/cave_hole.inc +++ b/data/scripts/cave_hole.inc @@ -1,23 +1,15 @@ -GraniteCave_B1F_MapScript2_2A8327: @ 82A8327 -MirageTower_2F_MapScript2_2A8327: @ 82A8327 -MirageTower_3F_MapScript2_2A8327: @ 82A8327 -MtPyre_2F_MapScript2_2A8327: @ 82A8327 -SkyPillar_2F_MapScript2_2A8327: @ 82A8327 -SkyPillar_4F_MapScript2_2A8327: @ 82A8327 +CaveHole_MapScript2_CheckFallDownHole: @ 82A8327 map_script_2 VAR_ICE_STEP_COUNT, 0, EventScript_FallDownHole .2byte 0 -GraniteCave_B1F_MapScript1_2A8331: @ 82A8331 -MirageTower_2F_MapScript1_2A8331: @ 82A8331 -MirageTower_3F_MapScript1_2A8331: @ 82A8331 -MtPyre_2F_MapScript1_2A8331: @ 82A8331 - copyvar VAR_ICE_STEP_COUNT, 0x1 +CaveHole_MapScript1_FixCrackedGround: @ 82A8331 + copyvar VAR_ICE_STEP_COUNT, 1 end EventScript_FallDownHole:: @ 82A8337 lockall delay 20 - applymovement EVENT_OBJ_ID_PLAYER, GraniteCave_B1F_Movement_2A8369 + applymovement EVENT_OBJ_ID_PLAYER, Movement_SetInvisible waitmovement 0 playse SE_RU_HYUU delay 60 @@ -25,10 +17,10 @@ EventScript_FallDownHole:: @ 82A8337 waitstate end -gUnknown_082A8350:: @ 82A8350 +EventScript_FallDownHoleMtPyre:: @ 82A8350 lockall delay 20 - applymovement EVENT_OBJ_ID_PLAYER, GraniteCave_B1F_Movement_2A8369 + applymovement EVENT_OBJ_ID_PLAYER, Movement_SetInvisible waitmovement 0 playse SE_RU_HYUU delay 60 @@ -36,6 +28,6 @@ gUnknown_082A8350:: @ 82A8350 waitstate end -GraniteCave_B1F_Movement_2A8369: @ 82A8369 +Movement_SetInvisible: @ 82A8369 set_invisible step_end diff --git a/include/event_scripts.h b/include/event_scripts.h index 02265413e..7671f13d8 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -558,7 +558,7 @@ extern const u8 LittlerootTown_ProfessorBirchsLab_EventScript_1FA4D6[]; extern const u8 RustboroCity_Gym_EventScript_21307B[]; extern const u8 MossdeepCity_SpaceCenter_2F_EventScript_224175[]; extern const u8 SSTidalCorridor_EventScript_23C050[]; -extern const u8 gUnknown_082A8350[]; +extern const u8 EventScript_FallDownHoleMtPyre[]; // Secret Base extern const u8 SecretBase_EventScript_PC[]; diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index f3f9be530..f00f23602 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -733,7 +733,7 @@ static bool8 TryStartWarpEventScript(struct MapPosition *position, u16 metatileB } if (MetatileBehavior_IsMtPyreHole(metatileBehavior) == TRUE) { - ScriptContext1_SetupScript(gUnknown_082A8350); + ScriptContext1_SetupScript(EventScript_FallDownHoleMtPyre); return TRUE; } if (MetatileBehavior_IsMossdeepGymWarp(metatileBehavior) == TRUE)