pokeemerald/data/maps/ShoalCave_LowTideEntranceRoom/scripts.inc

92 lines
3.8 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
goto_if_eq VAR_RESULT, FALSE, ShoalCave_LowTideEntranceRoom_EventScript_NotEnoughShoalSaltOrShells
2017-11-10 02:21:31 +01:00
checkitem ITEM_SHOAL_SHELL, 4
goto_if_eq VAR_RESULT, FALSE, ShoalCave_LowTideEntranceRoom_EventScript_NotEnoughShoalSaltOrShells
2019-11-07 18:17:28 +01:00
msgbox ShoalCave_LowTideEntranceRoom_Text_WouldYouLikeShellBell, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, ShoalCave_LowTideEntranceRoom_EventScript_DeclineShellBell
2021-08-05 18:46:11 +02:00
checkitemspace ITEM_SHELL_BELL
call_if_eq VAR_RESULT, FALSE, ShoalCave_LowTideEntranceRoom_EventScript_CheckSpaceWillBeFreed
goto_if_eq VAR_RESULT, 2, ShoalCave_LowTideEntranceRoom_EventScript_NoRoomForShellBell
2019-11-07 18:17:28 +01:00
msgbox ShoalCave_LowTideEntranceRoom_Text_MakeShellBellRightAway, MSGBOX_DEFAULT
removeitem ITEM_SHOAL_SALT, 4
removeitem ITEM_SHOAL_SHELL, 4
giveitem ITEM_SHELL_BELL
2023-08-03 21:45:53 +02:00
goto_if_eq VAR_RESULT, FALSE, Common_EventScript_ShowBagIsFull @ Never FALSE, we already made sure there will be room in the bag.
2019-11-07 18:17:28 +01:00
msgbox ShoalCave_LowTideEntranceRoom_Text_ExplainShellBell, MSGBOX_DEFAULT
2023-08-03 21:45:53 +02:00
setflag FLAG_TEMP_2 @ Not read. Perhaps meant to stop him from re-explaining the Shell Bell if multiple are received in one sitting.
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
goto_if_eq VAR_RESULT, TRUE, 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
goto_if_eq VAR_RESULT, TRUE, 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::
2021-08-05 18:46:11 +02:00
checkitem ITEM_SHOAL_SALT
goto_if_eq VAR_RESULT, TRUE, ShoalCave_LowTideEntranceRoom_EventScript_HasSomeShoalSaltOrShell
2021-08-05 18:46:11 +02:00
checkitem ITEM_SHOAL_SHELL
goto_if_eq VAR_RESULT, TRUE, ShoalCave_LowTideEntranceRoom_EventScript_HasSomeShoalSaltOrShell
2019-11-07 18:17:28 +01:00
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