diff --git a/data-de/event_scripts.s b/data-de/event_scripts.s index 62db28a69..5edeff567 100644 --- a/data-de/event_scripts.s +++ b/data-de/event_scripts.s @@ -963,57 +963,7 @@ Common_EventScript_FerryDepartIsland:: @ 81A047C call Common_EventScript_FerryDepart return -CaveOfOrigin_B4F_EventScript_1A04A0:: @ 81A04A0 - lockall - waitse - playmoncry SPECIES_GROUDON_OR_KYOGRE, 2 - waitmoncry - setvar VAR_TEMP_5, 1 - releaseall - end - -CaveOfOrigin_1F_EventScript_1A04AF:: @ 81A04AF -CaveOfOrigin_B1F_EventScript_1A04AF:: @ 81A04AF -CaveOfOrigin_B2F_EventScript_1A04AF:: @ 81A04AF -CaveOfOrigin_B3F_EventScript_1A04AF:: @ 81A04AF - lockall - setvar VAR_TEMP_1, 1 - goto CaveOfOrigin_1F_EventScript_1A04D3 - end - -CaveOfOrigin_B2F_EventScript_1A04BB:: @ 81A04BB -CaveOfOrigin_B3F_EventScript_1A04BB:: @ 81A04BB - lockall - setvar VAR_TEMP_2, 1 - goto CaveOfOrigin_B2F_EventScript_1A04D3 - end - -@ 81A04C7 - lockall - setvar VAR_TEMP_3, 1 - goto CaveOfOrigin_B2F_EventScript_1A04D3 - end - -CaveOfOrigin_1F_EventScript_1A04D3:: @ 81A04D3 -CaveOfOrigin_B2F_EventScript_1A04D3:: @ 81A04D3 - setvar VAR_0x8004, 1 - setvar VAR_0x8005, 1 - special sub_810F758 - waitstate - releaseall - end - -CaveOfOrigin_1F_EventScript_1A04E3:: @ 81A04E3 -CaveOfOrigin_B1F_EventScript_1A04E3:: @ 81A04E3 -CaveOfOrigin_B2F_EventScript_1A04E3:: @ 81A04E3 -CaveOfOrigin_B3F_EventScript_1A04E3:: @ 81A04E3 -CaveOfOrigin_B4F_EventScript_1A04E3:: @ 81A04E3 - setvar VAR_TEMP_1, 1 - setvar VAR_TEMP_2, 1 - setvar VAR_TEMP_3, 1 - setvar VAR_TEMP_4, 1 - setvar VAR_TEMP_5, 1 - return + .include "data/scripts/cave_of_origin.inc" AquaHideout_B1F_EventScript_1A04FD:: @ 81A04FD MagmaHideout_B1F_EventScript_1A04FD:: @ 81A04FD diff --git a/data/event_scripts.s b/data/event_scripts.s index 09ce93a0e..b41d31392 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -962,57 +962,7 @@ Common_EventScript_FerryDepartIsland:: @ 81A047C call Common_EventScript_FerryDepart return -CaveOfOrigin_B4F_EventScript_1A04A0:: @ 81A04A0 - lockall - waitse - playmoncry SPECIES_GROUDON_OR_KYOGRE, 2 - waitmoncry - setvar VAR_TEMP_5, 1 - releaseall - end - -CaveOfOrigin_1F_EventScript_1A04AF:: @ 81A04AF -CaveOfOrigin_B1F_EventScript_1A04AF:: @ 81A04AF -CaveOfOrigin_B2F_EventScript_1A04AF:: @ 81A04AF -CaveOfOrigin_B3F_EventScript_1A04AF:: @ 81A04AF - lockall - setvar VAR_TEMP_1, 1 - goto CaveOfOrigin_1F_EventScript_1A04D3 - end - -CaveOfOrigin_B2F_EventScript_1A04BB:: @ 81A04BB -CaveOfOrigin_B3F_EventScript_1A04BB:: @ 81A04BB - lockall - setvar VAR_TEMP_2, 1 - goto CaveOfOrigin_B2F_EventScript_1A04D3 - end - -@ 81A04C7 - lockall - setvar VAR_TEMP_3, 1 - goto CaveOfOrigin_B2F_EventScript_1A04D3 - end - -CaveOfOrigin_1F_EventScript_1A04D3:: @ 81A04D3 -CaveOfOrigin_B2F_EventScript_1A04D3:: @ 81A04D3 - setvar VAR_0x8004, 1 - setvar VAR_0x8005, 1 - special sub_810F758 - waitstate - releaseall - end - -CaveOfOrigin_1F_EventScript_1A04E3:: @ 81A04E3 -CaveOfOrigin_B1F_EventScript_1A04E3:: @ 81A04E3 -CaveOfOrigin_B2F_EventScript_1A04E3:: @ 81A04E3 -CaveOfOrigin_B3F_EventScript_1A04E3:: @ 81A04E3 -CaveOfOrigin_B4F_EventScript_1A04E3:: @ 81A04E3 - setvar VAR_TEMP_1, 1 - setvar VAR_TEMP_2, 1 - setvar VAR_TEMP_3, 1 - setvar VAR_TEMP_4, 1 - setvar VAR_TEMP_5, 1 - return + .include "data/scripts/cave_of_origin.inc" AquaHideout_B1F_EventScript_1A04FD:: @ 81A04FD MagmaHideout_B1F_EventScript_1A04FD:: @ 81A04FD diff --git a/data/maps/CaveOfOrigin_1F/map.json b/data/maps/CaveOfOrigin_1F/map.json index 0a12aa36e..a111c1a10 100644 --- a/data/maps/CaveOfOrigin_1F/map.json +++ b/data/maps/CaveOfOrigin_1F/map.json @@ -35,7 +35,7 @@ "elevation": 3, "var": "VAR_TEMP_1", "var_value": "0", - "script": "CaveOfOrigin_1F_EventScript_1A04AF" + "script": "CaveOfOrigin_EventScript_Shake1" }, { "type": "trigger", @@ -44,7 +44,7 @@ "elevation": 3, "var": "VAR_TEMP_1", "var_value": "0", - "script": "CaveOfOrigin_1F_EventScript_1A04AF" + "script": "CaveOfOrigin_EventScript_Shake1" }, { "type": "trigger", @@ -53,7 +53,7 @@ "elevation": 3, "var": "VAR_TEMP_1", "var_value": "0", - "script": "CaveOfOrigin_1F_EventScript_1A04AF" + "script": "CaveOfOrigin_EventScript_Shake1" } ], "bg_events": [] diff --git a/data/maps/CaveOfOrigin_1F/scripts.inc b/data/maps/CaveOfOrigin_1F/scripts.inc index a56e5ef70..0ad0d0019 100644 --- a/data/maps/CaveOfOrigin_1F/scripts.inc +++ b/data/maps/CaveOfOrigin_1F/scripts.inc @@ -3,5 +3,5 @@ CaveOfOrigin_1F_MapScripts:: @ 815DD6C .byte 0 CaveOfOrigin_1F_MapScript1_15DD72:: @ 815DD72 - call_if_set FLAG_LEGENDARY_BATTLE_COMPLETED, CaveOfOrigin_1F_EventScript_1A04E3 + call_if_set FLAG_LEGENDARY_BATTLE_COMPLETED, CaveOfOrigin_EventScript_DisableTriggers end diff --git a/data/maps/CaveOfOrigin_B1F/map.json b/data/maps/CaveOfOrigin_B1F/map.json index ed873116c..71220abe6 100644 --- a/data/maps/CaveOfOrigin_B1F/map.json +++ b/data/maps/CaveOfOrigin_B1F/map.json @@ -35,7 +35,7 @@ "elevation": 3, "var": "VAR_TEMP_1", "var_value": "0", - "script": "CaveOfOrigin_B1F_EventScript_1A04AF" + "script": "CaveOfOrigin_EventScript_Shake1" }, { "type": "trigger", @@ -44,7 +44,7 @@ "elevation": 3, "var": "VAR_TEMP_1", "var_value": "0", - "script": "CaveOfOrigin_B1F_EventScript_1A04AF" + "script": "CaveOfOrigin_EventScript_Shake1" }, { "type": "trigger", @@ -53,7 +53,7 @@ "elevation": 3, "var": "VAR_TEMP_1", "var_value": "0", - "script": "CaveOfOrigin_B1F_EventScript_1A04AF" + "script": "CaveOfOrigin_EventScript_Shake1" } ], "bg_events": [] diff --git a/data/maps/CaveOfOrigin_B1F/scripts.inc b/data/maps/CaveOfOrigin_B1F/scripts.inc index 26d63d804..62aaed6d9 100644 --- a/data/maps/CaveOfOrigin_B1F/scripts.inc +++ b/data/maps/CaveOfOrigin_B1F/scripts.inc @@ -3,5 +3,5 @@ CaveOfOrigin_B1F_MapScripts:: @ 815DD7C .byte 0 CaveOfOrigin_B1F_MapScript1_15DD82:: @ 815DD82 - call_if_set FLAG_LEGENDARY_BATTLE_COMPLETED, CaveOfOrigin_B1F_EventScript_1A04E3 + call_if_set FLAG_LEGENDARY_BATTLE_COMPLETED, CaveOfOrigin_EventScript_DisableTriggers end diff --git a/data/maps/CaveOfOrigin_B2F/map.json b/data/maps/CaveOfOrigin_B2F/map.json index 9c35a6ad3..0a2f03ae2 100644 --- a/data/maps/CaveOfOrigin_B2F/map.json +++ b/data/maps/CaveOfOrigin_B2F/map.json @@ -35,7 +35,7 @@ "elevation": 3, "var": "VAR_TEMP_1", "var_value": "0", - "script": "CaveOfOrigin_B2F_EventScript_1A04AF" + "script": "CaveOfOrigin_EventScript_Shake1" }, { "type": "trigger", @@ -44,7 +44,7 @@ "elevation": 3, "var": "VAR_TEMP_1", "var_value": "0", - "script": "CaveOfOrigin_B2F_EventScript_1A04AF" + "script": "CaveOfOrigin_EventScript_Shake1" }, { "type": "trigger", @@ -53,7 +53,7 @@ "elevation": 3, "var": "VAR_TEMP_2", "var_value": "0", - "script": "CaveOfOrigin_B2F_EventScript_1A04BB" + "script": "CaveOfOrigin_EventScript_Shake2" } ], "bg_events": [] diff --git a/data/maps/CaveOfOrigin_B2F/scripts.inc b/data/maps/CaveOfOrigin_B2F/scripts.inc index 6a9db478d..ca0249f68 100644 --- a/data/maps/CaveOfOrigin_B2F/scripts.inc +++ b/data/maps/CaveOfOrigin_B2F/scripts.inc @@ -3,5 +3,5 @@ CaveOfOrigin_B2F_MapScripts:: @ 815DD8C .byte 0 CaveOfOrigin_B2F_MapScript1_15DD92:: @ 815DD92 - call_if_set FLAG_LEGENDARY_BATTLE_COMPLETED, CaveOfOrigin_B2F_EventScript_1A04E3 + call_if_set FLAG_LEGENDARY_BATTLE_COMPLETED, CaveOfOrigin_EventScript_DisableTriggers end diff --git a/data/maps/CaveOfOrigin_B3F/map.json b/data/maps/CaveOfOrigin_B3F/map.json index 8dce96798..4a5c50464 100644 --- a/data/maps/CaveOfOrigin_B3F/map.json +++ b/data/maps/CaveOfOrigin_B3F/map.json @@ -49,7 +49,7 @@ "elevation": 3, "var": "VAR_TEMP_1", "var_value": "0", - "script": "CaveOfOrigin_B3F_EventScript_1A04AF" + "script": "CaveOfOrigin_EventScript_Shake1" }, { "type": "trigger", @@ -58,7 +58,7 @@ "elevation": 3, "var": "VAR_TEMP_2", "var_value": "0", - "script": "CaveOfOrigin_B3F_EventScript_1A04BB" + "script": "CaveOfOrigin_EventScript_Shake2" }, { "type": "trigger", @@ -67,7 +67,7 @@ "elevation": 3, "var": "VAR_TEMP_2", "var_value": "0", - "script": "CaveOfOrigin_B3F_EventScript_1A04BB" + "script": "CaveOfOrigin_EventScript_Shake2" } ], "bg_events": [] diff --git a/data/maps/CaveOfOrigin_B3F/scripts.inc b/data/maps/CaveOfOrigin_B3F/scripts.inc index 27701a21b..2ec00218c 100644 --- a/data/maps/CaveOfOrigin_B3F/scripts.inc +++ b/data/maps/CaveOfOrigin_B3F/scripts.inc @@ -3,5 +3,5 @@ CaveOfOrigin_B3F_MapScripts:: @ 815DD9C .byte 0 CaveOfOrigin_B3F_MapScript1_15DDA2:: @ 815DDA2 - call_if_set FLAG_LEGENDARY_BATTLE_COMPLETED, CaveOfOrigin_B3F_EventScript_1A04E3 + call_if_set FLAG_LEGENDARY_BATTLE_COMPLETED, CaveOfOrigin_EventScript_DisableTriggers end diff --git a/data/maps/CaveOfOrigin_B4F/map.json b/data/maps/CaveOfOrigin_B4F/map.json index 8ab4aa087..39f806f67 100644 --- a/data/maps/CaveOfOrigin_B4F/map.json +++ b/data/maps/CaveOfOrigin_B4F/map.json @@ -51,7 +51,7 @@ "elevation": 3, "var": "VAR_TEMP_5", "var_value": "0", - "script": "CaveOfOrigin_B4F_EventScript_1A04A0" + "script": "CaveOfOrigin_EventScript_LegendaryCry" }, { "type": "trigger", @@ -60,7 +60,7 @@ "elevation": 3, "var": "VAR_TEMP_5", "var_value": "0", - "script": "CaveOfOrigin_B4F_EventScript_1A04A0" + "script": "CaveOfOrigin_EventScript_LegendaryCry" } ], "bg_events": [] diff --git a/data/maps/CaveOfOrigin_B4F/scripts.inc b/data/maps/CaveOfOrigin_B4F/scripts.inc index 366a63450..96cf8610d 100644 --- a/data/maps/CaveOfOrigin_B4F/scripts.inc +++ b/data/maps/CaveOfOrigin_B4F/scripts.inc @@ -18,7 +18,7 @@ CaveOfOrigin_B4F_MapScript1_15DDC5:: @ 815DDC5 setmaplayoutindex 313 .endif call Common_EventScript_SetupLegendaryGfxIds - call_if_set FLAG_LEGENDARY_BATTLE_COMPLETED, CaveOfOrigin_B4F_EventScript_1A04E3 + call_if_set FLAG_LEGENDARY_BATTLE_COMPLETED, CaveOfOrigin_EventScript_DisableTriggers end CaveOfOrigin_B4F_EventScript_15DDD7:: @ 815DDD7 diff --git a/data/maps/SeafloorCavern_Room9/scripts.inc b/data/maps/SeafloorCavern_Room9/scripts.inc index bef07204b..82011cbf7 100644 --- a/data/maps/SeafloorCavern_Room9/scripts.inc +++ b/data/maps/SeafloorCavern_Room9/scripts.inc @@ -106,7 +106,7 @@ SeafloorCavern_Room9_EventScript_15DAFA:: @ 815DAFA waitstate setvar VAR_0x8004, 1 setvar VAR_0x8005, 1 - special sub_810F758 + special ShakeCamera waitstate applymovement 1, SeafloorCavern_Room9_Movement_15DD57 waitmovement 0 @@ -114,7 +114,7 @@ SeafloorCavern_Room9_EventScript_15DAFA:: @ 815DAFA delay 4 setvar VAR_0x8004, 2 setvar VAR_0x8005, 2 - special sub_810F758 + special ShakeCamera waitstate delay 30 setvar VAR_0x8004, 2 diff --git a/data/scripts/cave_of_origin.inc b/data/scripts/cave_of_origin.inc new file mode 100644 index 000000000..0ec097533 --- /dev/null +++ b/data/scripts/cave_of_origin.inc @@ -0,0 +1,43 @@ +CaveOfOrigin_EventScript_LegendaryCry:: @ 81A04A0 + lockall + waitse + playmoncry SPECIES_GROUDON_OR_KYOGRE, 2 + waitmoncry + setvar VAR_TEMP_5, 1 + releaseall + end + +CaveOfOrigin_EventScript_Shake1:: @ 81A04AF + lockall + setvar VAR_TEMP_1, 1 + goto CaveOfOrigin_EventScript_Shake + end + +CaveOfOrigin_EventScript_Shake2:: @ 81A04BB + lockall + setvar VAR_TEMP_2, 1 + goto CaveOfOrigin_EventScript_Shake + end + +@ Unused +CaveOfOrigin_EventScript_Shake3:: @ 81A04C7 + lockall + setvar VAR_TEMP_3, 1 + goto CaveOfOrigin_EventScript_Shake + end + +CaveOfOrigin_EventScript_Shake:: @ 81A04D3 + setvar VAR_0x8004, 1 + setvar VAR_0x8005, 1 + special ShakeCamera + waitstate + releaseall + end + +CaveOfOrigin_EventScript_DisableTriggers:: @ 81A04E3 + setvar VAR_TEMP_1, 1 + setvar VAR_TEMP_2, 1 + setvar VAR_TEMP_3, 1 + setvar VAR_TEMP_4, 1 + setvar VAR_TEMP_5, 1 + return diff --git a/data/specials.inc b/data/specials.inc index a9298ba42..419bf1045 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -318,7 +318,7 @@ gSpecials:: def_special GetShieldToyTVDecorationInfo def_special IsPokerusInParty def_special SetSootopolisGymCrackedIceMetatiles - def_special sub_810F758 + def_special ShakeCamera def_special ScrSpecial_StartGroudonKyogreBattle def_special ScrSpecial_StartRayquazaBattle def_special ScrSpecial_StartRegiBattle diff --git a/src/field_specials.c b/src/field_specials.c index 6900db78a..38a0bd50b 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -1791,7 +1791,7 @@ bool8 IsPokerusInParty(void) static void sub_810F7A8(u8); static void sub_810F814(u8); -void sub_810F758(void) +void ShakeCamera(void) { u8 taskId = CreateTask(sub_810F7A8, 9); gTasks[taskId].data[0] = gSpecialVar_0x8005;