pokeemerald/data/maps/DesertRuins/scripts.inc

95 lines
2.6 KiB
PHP
Raw Normal View History

2021-07-20 21:18:31 +02:00
DesertRuins_MapScripts::
2019-10-31 22:00:37 +01:00
map_script MAP_SCRIPT_ON_RESUME, DesertRuins_OnResume
map_script MAP_SCRIPT_ON_LOAD, DesertRuins_OnLoad
2019-04-05 01:28:37 +02:00
map_script MAP_SCRIPT_ON_TRANSITION, DesertRuins_OnTransition
2017-11-10 02:21:31 +01:00
.byte 0
2021-07-20 21:18:31 +02:00
DesertRuins_OnResume:
2019-10-31 22:00:37 +01:00
call_if_set FLAG_SYS_CTRL_OBJ_DELETE, DesertRuins_EventScript_TryRemoveRegirock
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
DesertRuins_EventScript_TryRemoveRegirock::
specialvar VAR_RESULT, GetBattleOutcome
compare VAR_RESULT, B_OUTCOME_CAUGHT
2019-02-23 02:21:26 +01:00
goto_if_ne Common_EventScript_NopReturn
2017-11-10 02:21:31 +01:00
removeobject VAR_LAST_TALKED
return
2021-07-20 21:18:31 +02:00
DesertRuins_OnLoad:
2019-10-31 22:00:37 +01:00
call_if_unset FLAG_SYS_REGIROCK_PUZZLE_COMPLETED, DesertRuins_EventScript_HideRegiEntrance
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
DesertRuins_EventScript_HideRegiEntrance::
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-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
DesertRuins_OnTransition:
2017-12-27 04:20:29 +01:00
setflag FLAG_LANDMARK_DESERT_RUINS
2019-10-31 22:00:37 +01:00
call_if_unset FLAG_DEFEATED_REGIROCK, DesertRuins_EventScript_ShowRegirock
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
DesertRuins_EventScript_ShowRegirock::
clearflag FLAG_HIDE_REGIROCK
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
DesertRuins_EventScript_CaveEntranceMiddle::
2017-11-10 02:21:31 +01:00
lockall
2019-10-31 22:00:37 +01:00
goto_if_set FLAG_SYS_REGIROCK_PUZZLE_COMPLETED, DesertRuins_EventScript_BigHoleInWall
braillemessage DesertRuins_Braille_UseRockSmash
2017-11-10 02:21:31 +01:00
waitbuttonpress
2019-10-31 22:00:37 +01:00
closebraillemessage
2017-11-10 02:21:31 +01:00
releaseall
end
2021-07-20 21:18:31 +02:00
DesertRuins_EventScript_BigHoleInWall::
2019-08-15 05:38:42 +02:00
msgbox gText_BigHoleInTheWall, MSGBOX_DEFAULT
2017-11-10 02:21:31 +01:00
releaseall
end
2021-07-20 21:18:31 +02:00
DesertRuins_EventScript_CaveEntranceSide::
2017-11-10 02:21:31 +01:00
lockall
2019-10-31 22:00:37 +01:00
braillemessage DesertRuins_Braille_UseRockSmash
2017-11-10 02:21:31 +01:00
waitbuttonpress
2019-10-31 22:00:37 +01:00
closebraillemessage
2017-11-10 02:21:31 +01:00
releaseall
end
2021-07-20 21:18:31 +02:00
DesertRuins_EventScript_Regirock::
2017-11-10 02:21:31 +01:00
lock
faceplayer
waitse
playmoncry SPECIES_REGIROCK, 2
delay 40
waitmoncry
setwildbattle SPECIES_REGIROCK, 40, ITEM_NONE
setflag FLAG_SYS_CTRL_OBJ_DELETE
2017-11-28 23:02:09 +01:00
special StartRegiBattle
2017-11-10 02:21:31 +01:00
waitstate
clearflag FLAG_SYS_CTRL_OBJ_DELETE
specialvar VAR_RESULT, GetBattleOutcome
compare VAR_RESULT, B_OUTCOME_WON
2019-10-31 22:00:37 +01:00
goto_if_eq DesertRuins_EventScript_DefeatedRegirock
compare VAR_RESULT, B_OUTCOME_RAN
2019-10-31 22:00:37 +01:00
goto_if_eq DesertRuins_EventScript_RanFromRegirock
compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED
2019-10-31 22:00:37 +01:00
goto_if_eq DesertRuins_EventScript_RanFromRegirock
2019-01-02 22:12:43 +01:00
setflag FLAG_DEFEATED_REGIROCK
2017-11-10 02:21:31 +01:00
release
end
2021-07-20 21:18:31 +02:00
DesertRuins_EventScript_DefeatedRegirock::
2019-01-02 22:12:43 +01:00
setflag FLAG_DEFEATED_REGIROCK
2019-08-15 05:38:42 +02:00
goto Common_EventScript_RemoveStaticPokemon
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
DesertRuins_EventScript_RanFromRegirock::
2019-08-15 05:38:42 +02:00
setvar VAR_0x8004, SPECIES_REGIROCK
goto Common_EventScript_LegendaryFlewAway
2017-11-10 02:21:31 +01:00
end