pokeemerald/data/maps/FarawayIsland_Interior/scripts.inc

190 lines
5.9 KiB
PHP
Raw Permalink Normal View History

2021-07-05 19:54:43 +02:00
@ Note: LOCALID_FARAWAY_ISLAND_MEW is a local id for this map used elsewhere. It's defined in event_objects.h
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_MapScripts::
2019-10-31 22:00:37 +01:00
map_script MAP_SCRIPT_ON_RESUME, FarawayIsland_Interior_OnResume
map_script MAP_SCRIPT_ON_TRANSITION, FarawayIsland_Interior_OnTransition
2019-10-31 22:00:37 +01:00
map_script MAP_SCRIPT_ON_FRAME_TABLE, FarawayIsland_Interior_OnFrame
map_script MAP_SCRIPT_ON_RETURN_TO_FIELD, FarawayIsland_Interior_OnReturnToField
2017-11-10 02:21:31 +01:00
.byte 0
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_OnReturnToField:
2020-07-19 20:12:38 +02:00
call_if_set FLAG_SYS_CTRL_OBJ_DELETE, FarawayIsland_Interior_EventScript_TrySetMewAboveGrass
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_EventScript_TrySetMewAboveGrass::
specialvar VAR_RESULT, GetBattleOutcome
goto_if_eq VAR_RESULT, B_OUTCOME_WON, FarawayIsland_Interior_EventScript_SetMewAboveGrass
goto_if_eq VAR_RESULT, B_OUTCOME_RAN, FarawayIsland_Interior_EventScript_SetMewAboveGrass
goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, FarawayIsland_Interior_EventScript_SetMewAboveGrass
goto_if_eq VAR_RESULT, B_OUTCOME_MON_TELEPORTED, FarawayIsland_Interior_EventScript_SetMewAboveGrass
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_EventScript_SetMewAboveGrass::
2017-11-10 02:21:31 +01:00
setvar VAR_0x8004, 1
2020-07-19 20:12:38 +02:00
special SetMewAboveGrass
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_OnResume:
2019-10-31 22:00:37 +01:00
call_if_set FLAG_SYS_CTRL_OBJ_DELETE, FarawayIsland_Interior_EventScript_TryRemoveMew
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_EventScript_TryRemoveMew::
specialvar VAR_RESULT, GetBattleOutcome
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
FarawayIsland_Interior_OnTransition:
2019-03-22 19:36:06 +01:00
setvar VAR_FARAWAY_ISLAND_STEP_COUNTER, 0
2018-05-19 18:02:43 +02:00
setvar VAR_TEMP_1, 1
2019-10-31 22:00:37 +01:00
call_if_unset FLAG_CAUGHT_MEW, FarawayIsland_Interior_EventScript_TryShowMew
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_EventScript_TryShowMew::
2019-02-23 02:21:26 +01:00
goto_if_set FLAG_DEFEATED_MEW, Common_EventScript_NopReturn
clearflag FLAG_HIDE_MEW
2018-05-19 18:02:43 +02:00
setvar VAR_TEMP_1, 0
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_OnFrame:
2019-10-31 22:00:37 +01:00
map_script_2 VAR_TEMP_1, 0, FarawayIsland_Interior_EventScript_FindMew
2017-11-10 02:21:31 +01:00
.2byte 0
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_EventScript_FindMew::
2017-11-10 02:21:31 +01:00
lockall
playse SE_PIN
2021-07-05 19:54:43 +02:00
applymovement LOCALID_FARAWAY_ISLAND_MEW, Common_Movement_ExclamationMark
2017-11-10 02:21:31 +01:00
waitmovement 0
2021-07-05 19:54:43 +02:00
applymovement LOCALID_FARAWAY_ISLAND_MEW, Common_Movement_Delay48
2017-11-10 02:21:31 +01:00
waitmovement 0
2021-07-05 19:54:43 +02:00
applymovement LOCALID_FARAWAY_ISLAND_MEW, FarawayIsland_Interior_Movement_MewMoveAndHide
2017-11-10 02:21:31 +01:00
waitmovement 0
2021-07-05 19:54:43 +02:00
copyobjectxytoperm LOCALID_FARAWAY_ISLAND_MEW
2018-05-19 18:02:43 +02:00
setvar VAR_TEMP_1, 1
2017-11-10 02:21:31 +01:00
releaseall
end
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_Movement_MewMoveAndHide:
walk_up
walk_up
walk_up
walk_in_place_faster_down
set_invisible
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_Movement_MewAppear:
set_visible
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_Movement_MewFloatUpNorth:
lock_facing_direction
walk_fast_up
walk_fast_up
unlock_facing_direction
walk_in_place_down
walk_in_place_down
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_Movement_MewFloatUpSouth:
lock_facing_direction
walk_fast_up
walk_fast_up
unlock_facing_direction
walk_in_place_up
walk_in_place_up
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_Movement_MewFloatUpWest:
lock_facing_direction
walk_fast_up
walk_fast_up
unlock_facing_direction
walk_in_place_right
walk_in_place_right
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_Movement_MewFloatUpEast:
lock_facing_direction
walk_fast_up
walk_fast_up
unlock_facing_direction
walk_in_place_left
walk_in_place_left
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_EventScript_Mew::
2017-11-10 02:21:31 +01:00
lock
faceplayer
2021-07-05 19:54:43 +02:00
applymovement LOCALID_FARAWAY_ISLAND_MEW, FarawayIsland_Interior_Movement_MewAppear
2017-11-10 02:21:31 +01:00
waitmovement 0
setvar VAR_0x8004, 0
2020-07-19 20:12:38 +02:00
special SetMewAboveGrass
message FarawayIsland_Interior_Text_Mew
2017-11-10 02:21:31 +01:00
waitse
2021-11-07 18:58:11 +01:00
playmoncry SPECIES_MEW, CRY_MODE_ENCOUNTER
call_if_eq VAR_FACING, DIR_NORTH, FarawayIsland_Interior_EventScript_FoundMewNorth
call_if_eq VAR_FACING, DIR_SOUTH, FarawayIsland_Interior_EventScript_FoundMewSouth
call_if_eq VAR_FACING, DIR_WEST, FarawayIsland_Interior_EventScript_FoundMewWest
call_if_eq VAR_FACING, DIR_EAST, FarawayIsland_Interior_EventScript_FoundMewEast
2020-07-19 20:12:38 +02:00
special DestroyMewEmergingGrassSprite
2017-11-10 02:21:31 +01:00
delay 40
waitmoncry
seteventmon SPECIES_MEW, 30
2017-11-10 02:21:31 +01:00
setflag FLAG_SYS_CTRL_OBJ_DELETE
2017-11-28 23:02:09 +01:00
special BattleSetup_StartLegendaryBattle
2017-11-10 02:21:31 +01:00
waitstate
clearflag FLAG_SYS_CTRL_OBJ_DELETE
specialvar VAR_RESULT, GetBattleOutcome
goto_if_eq VAR_RESULT, B_OUTCOME_WON, FarawayIsland_Interior_EventScript_MewDefeated
goto_if_eq VAR_RESULT, B_OUTCOME_RAN, FarawayIsland_Interior_EventScript_PlayerOrMewRan
goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, FarawayIsland_Interior_EventScript_PlayerOrMewRan
goto_if_eq VAR_RESULT, B_OUTCOME_MON_TELEPORTED, FarawayIsland_Interior_EventScript_PlayerOrMewRan
2019-01-02 22:12:43 +01:00
setflag FLAG_CAUGHT_MEW
2017-11-10 02:21:31 +01:00
release
end
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_EventScript_MewDefeated::
2019-01-02 22:12:43 +01:00
setflag FLAG_DEFEATED_MEW
2019-08-15 05:38:42 +02:00
setvar VAR_0x8004, SPECIES_MEW
goto Common_EventScript_LegendaryFlewAway
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_EventScript_PlayerOrMewRan::
2019-08-15 05:38:42 +02:00
setvar VAR_0x8004, SPECIES_MEW
goto Common_EventScript_LegendaryFlewAway
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_EventScript_FoundMewNorth::
2021-07-05 19:54:43 +02:00
applymovement LOCALID_FARAWAY_ISLAND_MEW, FarawayIsland_Interior_Movement_MewFloatUpNorth
2017-11-10 02:21:31 +01:00
waitmovement 0
return
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_EventScript_FoundMewSouth::
2021-07-05 19:54:43 +02:00
applymovement LOCALID_FARAWAY_ISLAND_MEW, FarawayIsland_Interior_Movement_MewFloatUpSouth
2017-11-10 02:21:31 +01:00
waitmovement 0
return
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_EventScript_FoundMewWest::
2021-07-05 19:54:43 +02:00
applymovement LOCALID_FARAWAY_ISLAND_MEW, FarawayIsland_Interior_Movement_MewFloatUpWest
2017-11-10 02:21:31 +01:00
waitmovement 0
return
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_EventScript_FoundMewEast::
2021-07-05 19:54:43 +02:00
applymovement LOCALID_FARAWAY_ISLAND_MEW, FarawayIsland_Interior_Movement_MewFloatUpEast
2017-11-10 02:21:31 +01:00
waitmovement 0
return
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_EventScript_HideMewWhenGrassCut::
2017-11-10 09:24:21 +01:00
lockall
2019-12-15 17:42:50 +01:00
fadescreenswapbuffers FADE_TO_BLACK
setflag FLAG_HIDE_MEW
2021-07-05 19:54:43 +02:00
removeobject LOCALID_FARAWAY_ISLAND_MEW
2019-12-15 17:42:50 +01:00
fadescreenswapbuffers FADE_FROM_BLACK
2019-10-31 22:00:37 +01:00
msgbox FarawayIsland_Interior_Text_TheFeelingOfBeingWatchedFaded, MSGBOX_DEFAULT
2017-11-10 09:24:21 +01:00
closemessage
releaseall
end
2021-07-20 21:18:31 +02:00
FarawayIsland_Interior_Text_TheFeelingOfBeingWatchedFaded:
2017-11-10 09:24:21 +01:00
.string "The feeling of being watched faded…$"