pokeemerald/data/maps/ShoalCave_LowTideEntranceRoom/scripts.inc

102 lines
3.7 KiB
PHP
Raw Normal View History

2021-07-20 21:18:31 +02:00
ShoalCave_LowTideEntranceRoom_MapScripts::
map_script MAP_SCRIPT_ON_TRANSITION, ShoalCave_LowTideEntranceRoom_OnTransition
2017-11-10 02:21:31 +01:00
.byte 0
2021-07-20 21:18:31 +02:00
ShoalCave_LowTideEntranceRoom_OnTransition:
special UpdateShoalTideFlag
2019-11-07 18:17:28 +01:00
goto_if_set FLAG_SYS_SHOAL_TIDE, ShoalCave_LowTideEntranceRoom_EventScript_SetHighTide
goto ShoalCave_LowTideEntranceRoom_EventScript_SetLowTide
2017-11-10 02:21:31 +01:00
2021-07-20 21:18:31 +02:00
ShoalCave_LowTideEntranceRoom_EventScript_SetHighTide::
2019-01-31 22:51:20 +01:00
setmaplayoutindex LAYOUT_SHOAL_CAVE_HIGH_TIDE_ENTRANCE_ROOM
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
ShoalCave_LowTideEntranceRoom_EventScript_SetLowTide::
2019-01-31 22:51:20 +01:00
setmaplayoutindex LAYOUT_SHOAL_CAVE_LOW_TIDE_ENTRANCE_ROOM
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
ShoalCave_LowTideEntranceRoom_EventScript_ShellBellExpert::
2017-11-10 02:21:31 +01:00
lock
faceplayer
dotimebasedevents
2019-11-07 18:17:28 +01:00
call_if_set FLAG_SYS_SHOAL_ITEM, ShoalCave_LowTideEntranceRoom_EventScript_ResetShoalItems
2017-11-10 02:21:31 +01:00
checkitem ITEM_SHOAL_SALT, 4
2019-11-07 18:17:28 +01:00
compare VAR_RESULT, FALSE
goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_NotEnoughShoalSaltOrShells
2017-11-10 02:21:31 +01:00
checkitem ITEM_SHOAL_SHELL, 4
2019-11-07 18:17:28 +01:00
compare VAR_RESULT, FALSE
goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_NotEnoughShoalSaltOrShells
msgbox ShoalCave_LowTideEntranceRoom_Text_WouldYouLikeShellBell, MSGBOX_YESNO
2019-11-02 17:34:53 +01:00
compare VAR_RESULT, NO
2019-11-07 18:17:28 +01:00
goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_DeclineShellBell
2017-11-10 02:21:31 +01:00
checkitemspace ITEM_SHELL_BELL, 1
2019-11-07 18:17:28 +01:00
compare VAR_RESULT, FALSE
call_if_eq ShoalCave_LowTideEntranceRoom_EventScript_CheckSpaceWillBeFreed
compare VAR_RESULT, 2
2019-11-07 18:17:28 +01:00
goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_NoRoomForShellBell
msgbox ShoalCave_LowTideEntranceRoom_Text_MakeShellBellRightAway, MSGBOX_DEFAULT
removeitem ITEM_SHOAL_SALT, 4
removeitem ITEM_SHOAL_SHELL, 4
giveitem ITEM_SHELL_BELL
2019-11-07 18:17:28 +01:00
compare VAR_RESULT, FALSE
goto_if_eq Common_EventScript_ShowBagIsFull
2019-11-07 18:17:28 +01:00
msgbox ShoalCave_LowTideEntranceRoom_Text_ExplainShellBell, MSGBOX_DEFAULT
2018-10-17 18:25:12 +02:00
setflag FLAG_TEMP_2
2017-11-10 02:21:31 +01:00
release
end
2019-11-07 18:17:28 +01:00
@ If the bag is full, check if a slot will be freed when 4 Shoal Salt or Shells are given
2021-07-20 21:18:31 +02:00
ShoalCave_LowTideEntranceRoom_EventScript_CheckSpaceWillBeFreed::
2017-11-10 02:21:31 +01:00
checkitem ITEM_SHOAL_SALT, 5
2019-11-07 18:17:28 +01:00
compare VAR_RESULT, TRUE
goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_CheckSpaceWillBeFreedShells
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
ShoalCave_LowTideEntranceRoom_EventScript_CheckSpaceWillBeFreedShells::
2017-11-10 02:21:31 +01:00
checkitem ITEM_SHOAL_SHELL, 5
2019-11-07 18:17:28 +01:00
compare VAR_RESULT, TRUE
goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_NoSpaceWillBeFreed
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
ShoalCave_LowTideEntranceRoom_EventScript_NoSpaceWillBeFreed::
2017-11-10 02:21:31 +01:00
setvar VAR_RESULT, 2
return
2021-07-20 21:18:31 +02:00
ShoalCave_LowTideEntranceRoom_EventScript_NoRoomForShellBell::
2019-11-07 18:17:28 +01:00
msgbox ShoalCave_LowTideEntranceRoom_Text_NoSpaceInYourBag, MSGBOX_DEFAULT
2017-11-10 02:21:31 +01:00
release
end
2021-07-20 21:18:31 +02:00
ShoalCave_LowTideEntranceRoom_EventScript_NotEnoughShoalSaltOrShells::
2017-11-10 02:21:31 +01:00
checkitem ITEM_SHOAL_SALT, 1
2019-11-07 18:17:28 +01:00
compare VAR_RESULT, TRUE
goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_HasSomeShoalSaltOrShell
2017-11-10 02:21:31 +01:00
checkitem ITEM_SHOAL_SHELL, 1
2019-11-07 18:17:28 +01:00
compare VAR_RESULT, TRUE
goto_if_eq ShoalCave_LowTideEntranceRoom_EventScript_HasSomeShoalSaltOrShell
msgbox ShoalCave_LowTideEntranceRoom_Text_AreYouPlanningOnGoingInThere, MSGBOX_DEFAULT
2017-11-10 02:21:31 +01:00
release
end
2021-07-20 21:18:31 +02:00
ShoalCave_LowTideEntranceRoom_EventScript_HasSomeShoalSaltOrShell::
2019-11-07 18:17:28 +01:00
msgbox ShoalCave_LowTideEntranceRoom_Text_BringMe4ShoalSaltAndShells, MSGBOX_DEFAULT
2017-11-10 02:21:31 +01:00
release
end
2021-07-20 21:18:31 +02:00
ShoalCave_LowTideEntranceRoom_EventScript_DeclineShellBell::
2019-11-07 18:17:28 +01:00
msgbox ShoalCave_LowTideEntranceRoom_Text_WantedToMakeShellBell, MSGBOX_DEFAULT
2017-11-10 02:21:31 +01:00
release
end
2021-07-20 21:18:31 +02:00
ShoalCave_LowTideEntranceRoom_EventScript_ResetShoalItems::
2019-01-03 02:54:55 +01:00
clearflag FLAG_RECEIVED_SHOAL_SALT_1
clearflag FLAG_RECEIVED_SHOAL_SALT_2
clearflag FLAG_RECEIVED_SHOAL_SALT_3
clearflag FLAG_RECEIVED_SHOAL_SALT_4
clearflag FLAG_RECEIVED_SHOAL_SHELL_1
clearflag FLAG_RECEIVED_SHOAL_SHELL_2
clearflag FLAG_RECEIVED_SHOAL_SHELL_3
clearflag FLAG_RECEIVED_SHOAL_SHELL_4
2017-11-10 02:21:31 +01:00
clearflag FLAG_SYS_SHOAL_ITEM
return