pokefirered/data/maps/Route16/scripts.inc
2022-06-24 21:10:48 -04:00

82 lines
2.0 KiB
C++

Route16_MapScripts::
map_script MAP_SCRIPT_ON_RESUME, Route16_OnResume
map_script MAP_SCRIPT_ON_TRANSITION, Route16_OnTransition
map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, Route16_OnWarp
.byte 0
Route16_OnResume::
call_if_set FLAG_SYS_SPECIAL_WILD_BATTLE, Route16_EventScript_RemoveSnorlax
end
Route16_EventScript_RemoveSnorlax::
removeobject VAR_LAST_TALKED
return
Route16_OnTransition::
compare VAR_MAP_SCENE_ROUTE16, 1
call_if_eq Route16_OnTransitionCyclingRoad
end
Route16_OnTransitionCyclingRoad::
setflag FLAG_SYS_ON_CYCLING_ROAD
return
Route16_OnWarp::
map_script_2 VAR_MAP_SCENE_ROUTE16, 1, Route16_OnWarpCyclingRoad
.2byte 0
Route16_OnWarpCyclingRoad::
special ForcePlayerOntoBike
end
Route16_EventScript_Snorlax::
lock
faceplayer
goto_if_unset FLAG_GOT_POKE_FLUTE, Route16_EventScript_SnorlaxNoPokeFlute
goto_if_questlog EventScript_ReleaseEnd
special QuestLog_CutRecording
msgbox Text_WantToUsePokeFlute, MSGBOX_YESNO
compare VAR_RESULT, NO
goto_if_eq Route16_EventScript_DontUsePokeFlute
call EventScript_AwakenSnorlax
setwildbattle SPECIES_SNORLAX, 30, ITEM_NONE
waitse
playmoncry SPECIES_SNORLAX, 2
delay 40
waitmoncry
setflag FLAG_HIDE_ROUTE_16_SNORLAX
setflag FLAG_SYS_SPECIAL_WILD_BATTLE
dowildbattle
clearflag FLAG_SYS_SPECIAL_WILD_BATTLE
specialvar VAR_RESULT, GetBattleOutcome
compare VAR_RESULT, B_OUTCOME_WON
goto_if_eq Route16_EventScript_FoughtSnorlax
compare VAR_RESULT, B_OUTCOME_RAN
goto_if_eq Route16_EventScript_FoughtSnorlax
compare VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED
goto_if_eq Route16_EventScript_FoughtSnorlax
release
end
Route16_EventScript_DontUsePokeFlute::
release
end
Route16_EventScript_FoughtSnorlax::
msgbox Text_SnorlaxReturnedToMountains
release
end
Route16_EventScript_SnorlaxNoPokeFlute::
msgbox Route16_Text_MonSprawledOutInSlumber
release
end
Route16_EventScript_CyclingRoadSign::
msgbox Route16_Text_CyclingRoadSign, MSGBOX_SIGN
end
Route16_EventScript_RouteSign::
msgbox Route16_Text_RouteSign, MSGBOX_SIGN
end