2021-07-20 21:18:31 +02:00
|
|
|
IslandCave_MapScripts::
|
2019-10-31 22:00:37 +01:00
|
|
|
map_script MAP_SCRIPT_ON_RESUME, IslandCave_OnResume
|
|
|
|
map_script MAP_SCRIPT_ON_LOAD, IslandCave_OnLoad
|
2019-04-05 01:28:37 +02:00
|
|
|
map_script MAP_SCRIPT_ON_TRANSITION, IslandCave_OnTransition
|
2017-11-10 02:21:31 +01:00
|
|
|
.byte 0
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
IslandCave_OnResume:
|
2019-10-31 22:00:37 +01:00
|
|
|
call_if_set FLAG_SYS_CTRL_OBJ_DELETE, IslandCave_EventScript_TryRemoveRegice
|
2017-11-10 02:21:31 +01:00
|
|
|
end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
IslandCave_EventScript_TryRemoveRegice::
|
2018-08-08 10:37:12 +02:00
|
|
|
specialvar VAR_RESULT, GetBattleOutcome
|
2021-11-19 05:06:30 +01:00
|
|
|
goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, Common_EventScript_NopReturn
|
2017-11-10 02:21:31 +01:00
|
|
|
removeobject VAR_LAST_TALKED
|
|
|
|
return
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
IslandCave_OnLoad:
|
2019-10-31 22:00:37 +01:00
|
|
|
call_if_unset FLAG_SYS_BRAILLE_REGICE_COMPLETED, IslandCave_EventScript_HideRegiEntrance
|
2017-11-10 02:21:31 +01:00
|
|
|
end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
IslandCave_EventScript_HideRegiEntrance::
|
2021-11-16 23:12:16 +01:00
|
|
|
setmetatile 7, 19, METATILE_Cave_EntranceCover, TRUE
|
|
|
|
setmetatile 8, 19, METATILE_Cave_EntranceCover, TRUE
|
|
|
|
setmetatile 9, 19, METATILE_Cave_EntranceCover, TRUE
|
|
|
|
setmetatile 7, 20, METATILE_Cave_SealedChamberBraille_Mid, TRUE
|
|
|
|
setmetatile 8, 20, METATILE_Cave_SealedChamberBraille_Mid, TRUE
|
|
|
|
setmetatile 9, 20, METATILE_Cave_SealedChamberBraille_Mid, TRUE
|
2017-11-10 02:21:31 +01:00
|
|
|
return
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
IslandCave_OnTransition:
|
2017-12-27 04:20:29 +01:00
|
|
|
setflag FLAG_LANDMARK_ISLAND_CAVE
|
2019-10-31 22:00:37 +01:00
|
|
|
call IslandCave_EventScript_ClearSteps
|
|
|
|
call_if_unset FLAG_DEFEATED_REGICE, IslandCave_EventScript_ShowRegice
|
2017-11-10 02:21:31 +01:00
|
|
|
end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
IslandCave_EventScript_ShowRegice::
|
2018-10-18 04:07:23 +02:00
|
|
|
clearflag FLAG_HIDE_REGICE
|
2017-11-10 02:21:31 +01:00
|
|
|
return
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
IslandCave_EventScript_OpenRegiEntrance::
|
2021-11-16 23:12:16 +01:00
|
|
|
setmetatile 7, 19, METATILE_Cave_SealedChamberEntrance_TopLeft, TRUE
|
|
|
|
setmetatile 8, 19, METATILE_Cave_SealedChamberEntrance_TopMid, TRUE
|
|
|
|
setmetatile 9, 19, METATILE_Cave_SealedChamberEntrance_TopRight, TRUE
|
|
|
|
setmetatile 7, 20, METATILE_Cave_SealedChamberEntrance_BottomLeft, TRUE
|
|
|
|
setmetatile 8, 20, METATILE_Cave_SealedChamberEntrance_BottomMid, FALSE
|
|
|
|
setmetatile 9, 20, METATILE_Cave_SealedChamberEntrance_BottomRight, TRUE
|
2017-11-10 09:24:21 +01:00
|
|
|
special DrawWholeMapView
|
2020-08-21 00:02:00 +02:00
|
|
|
playse SE_BANG
|
2019-02-18 20:17:02 +01:00
|
|
|
setflag FLAG_SYS_BRAILLE_REGICE_COMPLETED
|
2017-11-10 09:24:21 +01:00
|
|
|
end
|
2017-11-10 08:36:41 +01:00
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
IslandCave_EventScript_CaveEntranceMiddle::
|
2017-11-10 08:36:41 +01:00
|
|
|
lockall
|
2023-08-03 21:45:53 +02:00
|
|
|
call_if_set FLAG_TEMP_REGICE_PUZZLE_FAILED, IslandCave_EventScript_ClearSteps
|
2019-10-31 22:00:37 +01:00
|
|
|
goto_if_set FLAG_SYS_BRAILLE_REGICE_COMPLETED, IslandCave_EventScript_BigHoleInWall
|
|
|
|
braillemessage IslandCave_Braille_RunLapAroundWall
|
2023-08-03 21:45:53 +02:00
|
|
|
setflag FLAG_TEMP_REGICE_PUZZLE_STARTED
|
2017-11-10 08:36:41 +01:00
|
|
|
special ShouldDoBrailleRegicePuzzle
|
2019-10-31 22:00:37 +01:00
|
|
|
goto IslandCave_EventScript_CloseBrailleMsg
|
2017-11-10 08:36:41 +01:00
|
|
|
end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
IslandCave_EventScript_BigHoleInWall::
|
2019-08-15 05:38:42 +02:00
|
|
|
msgbox gText_BigHoleInTheWall, MSGBOX_DEFAULT
|
2017-11-10 08:36:41 +01:00
|
|
|
releaseall
|
|
|
|
end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
IslandCave_EventScript_CaveEntranceSide::
|
2017-11-10 08:36:41 +01:00
|
|
|
lockall
|
2023-08-03 21:45:53 +02:00
|
|
|
call_if_set FLAG_TEMP_REGICE_PUZZLE_FAILED, IslandCave_EventScript_ClearSteps
|
2019-10-31 22:00:37 +01:00
|
|
|
braillemessage IslandCave_Braille_RunLapAroundWall
|
|
|
|
goto_if_set FLAG_SYS_BRAILLE_REGICE_COMPLETED, IslandCave_EventScript_CloseBrailleMsg
|
2023-08-03 21:45:53 +02:00
|
|
|
setflag FLAG_TEMP_REGICE_PUZZLE_STARTED
|
2017-11-10 08:36:41 +01:00
|
|
|
special ShouldDoBrailleRegicePuzzle
|
2019-10-31 22:00:37 +01:00
|
|
|
goto IslandCave_EventScript_CloseBrailleMsg
|
2017-11-10 08:36:41 +01:00
|
|
|
end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
IslandCave_EventScript_CloseBrailleMsg::
|
2017-11-10 08:36:41 +01:00
|
|
|
waitbuttonpress
|
2019-10-31 22:00:37 +01:00
|
|
|
closebraillemessage
|
2017-11-10 08:36:41 +01:00
|
|
|
releaseall
|
|
|
|
end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
IslandCave_EventScript_ClearSteps::
|
2019-02-16 00:24:55 +01:00
|
|
|
setvar VAR_REGICE_STEPS_1, 0
|
|
|
|
setvar VAR_REGICE_STEPS_2, 0
|
|
|
|
setvar VAR_REGICE_STEPS_3, 0
|
2023-08-03 21:45:53 +02:00
|
|
|
clearflag FLAG_TEMP_REGICE_PUZZLE_FAILED
|
2017-11-10 08:36:41 +01:00
|
|
|
return
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
IslandCave_EventScript_Regice::
|
2017-11-10 08:36:41 +01:00
|
|
|
lock
|
|
|
|
faceplayer
|
|
|
|
waitse
|
2021-11-07 18:58:11 +01:00
|
|
|
playmoncry SPECIES_REGICE, CRY_MODE_ENCOUNTER
|
2017-11-10 08:36:41 +01:00
|
|
|
delay 40
|
|
|
|
waitmoncry
|
2022-01-11 08:08:14 +01:00
|
|
|
setwildbattle SPECIES_REGICE, 40
|
2017-11-10 08:36:41 +01:00
|
|
|
setflag FLAG_SYS_CTRL_OBJ_DELETE
|
2017-11-28 23:02:09 +01:00
|
|
|
special StartRegiBattle
|
2017-11-10 08:36:41 +01:00
|
|
|
waitstate
|
|
|
|
clearflag FLAG_SYS_CTRL_OBJ_DELETE
|
2018-08-08 10:37:12 +02:00
|
|
|
specialvar VAR_RESULT, GetBattleOutcome
|
2021-11-19 05:06:30 +01:00
|
|
|
goto_if_eq VAR_RESULT, B_OUTCOME_WON, IslandCave_EventScript_DefeatedRegice
|
|
|
|
goto_if_eq VAR_RESULT, B_OUTCOME_RAN, IslandCave_EventScript_RanFromRegice
|
|
|
|
goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, IslandCave_EventScript_RanFromRegice
|
2019-01-02 22:12:43 +01:00
|
|
|
setflag FLAG_DEFEATED_REGICE
|
2017-11-10 08:36:41 +01:00
|
|
|
release
|
|
|
|
end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
IslandCave_EventScript_DefeatedRegice::
|
2019-01-02 22:12:43 +01:00
|
|
|
setflag FLAG_DEFEATED_REGICE
|
2019-08-15 05:38:42 +02:00
|
|
|
goto Common_EventScript_RemoveStaticPokemon
|
2017-11-10 08:36:41 +01:00
|
|
|
end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
IslandCave_EventScript_RanFromRegice::
|
2019-08-15 05:38:42 +02:00
|
|
|
setvar VAR_0x8004, SPECIES_REGICE
|
|
|
|
goto Common_EventScript_LegendaryFlewAway
|
2017-11-10 08:36:41 +01:00
|
|
|
end
|