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