pokeemerald/data/maps/NewMauville_Inside/scripts.inc

264 lines
11 KiB
PHP
Raw Normal View History

2021-07-20 21:18:31 +02:00
NewMauville_Inside_MapScripts::
2019-11-07 16:32:21 +01:00
map_script MAP_SCRIPT_ON_RESUME, NewMauville_Inside_OnResume
map_script MAP_SCRIPT_ON_TRANSITION, NewMauville_Inside_OnTransition
2019-11-07 16:32:21 +01:00
map_script MAP_SCRIPT_ON_LOAD, NewMauville_Inside_OnLoad
2017-11-10 02:21:31 +01:00
.byte 0
2021-07-20 21:18:31 +02:00
NewMauville_Inside_OnResume:
call_if_eq VAR_TEMP_1, 1, NewMauville_Inside_EventScript_SetBarrierStateBlueButton
call_if_eq VAR_TEMP_2, 1, NewMauville_Inside_EventScript_SetBarrierStateGreenButton
2019-11-07 16:32:21 +01:00
call_if_set FLAG_SYS_CTRL_OBJ_DELETE, NewMauville_Inside_EventScript_TryRemoveVoltorb
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
NewMauville_Inside_EventScript_TryRemoveVoltorb::
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
NewMauville_Inside_OnTransition:
2018-05-19 18:02:43 +02:00
setvar VAR_TEMP_1, 0
setvar VAR_TEMP_2, 0
2019-11-07 16:32:21 +01:00
call_if_unset FLAG_DEFEATED_VOLTORB_1_NEW_MAUVILLE, NewMauville_Inside_EventScript_ShowVoltorb1
call_if_unset FLAG_DEFEATED_VOLTORB_2_NEW_MAUVILLE, NewMauville_Inside_EventScript_ShowVoltorb2
call_if_unset FLAG_DEFEATED_VOLTORB_3_NEW_MAUVILLE, NewMauville_Inside_EventScript_ShowVoltorb3
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
NewMauville_Inside_EventScript_ShowVoltorb1::
2018-10-18 21:28:59 +02:00
clearflag FLAG_HIDE_NEW_MAUVILLE_VOLTORB_1
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
NewMauville_Inside_EventScript_ShowVoltorb2::
2018-10-18 21:28:59 +02:00
clearflag FLAG_HIDE_NEW_MAUVILLE_VOLTORB_2
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
NewMauville_Inside_EventScript_ShowVoltorb3::
2018-10-18 21:28:59 +02:00
clearflag FLAG_HIDE_NEW_MAUVILLE_VOLTORB_3
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
NewMauville_Inside_OnLoad:
call_if_eq VAR_NEW_MAUVILLE_STATE, 2, NewMauville_Inside_EventScript_SetGeneratorOffMetatiles
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
NewMauville_Inside_EventScript_BlueButton::
2017-11-10 02:21:31 +01:00
lockall
2018-05-19 18:02:43 +02:00
setvar VAR_TEMP_1, 1
setvar VAR_TEMP_2, 0
2017-11-10 02:21:31 +01:00
playse SE_PIN
2019-11-07 16:32:21 +01:00
call NewMauville_Inside_EventScript_SetBarrierStateBlueButton
2017-11-10 02:21:31 +01:00
special DrawWholeMapView
releaseall
end
2021-07-20 21:18:31 +02:00
NewMauville_Inside_EventScript_GreenButton::
2017-11-10 02:21:31 +01:00
lockall
2018-05-19 18:02:43 +02:00
setvar VAR_TEMP_1, 0
setvar VAR_TEMP_2, 1
2017-11-10 02:21:31 +01:00
playse SE_PIN
2019-11-07 16:32:21 +01:00
call NewMauville_Inside_EventScript_SetBarrierStateGreenButton
2017-11-10 02:21:31 +01:00
special DrawWholeMapView
releaseall
end
2021-07-20 21:18:31 +02:00
NewMauville_Inside_EventScript_SetBarrierStateBlueButton::
2021-11-16 23:12:16 +01:00
setmetatile 23, 34, METATILE_BikeShop_Barrier_Hidden_Top, TRUE
setmetatile 23, 35, METATILE_BikeShop_Barrier_Hidden_Bottom, TRUE
setmetatile 23, 36, METATILE_BikeShop_Floor_Shadow_Top, FALSE
setmetatile 23, 37, METATILE_BikeShop_Wall_Edge_Top, FALSE
setmetatile 10, 16, METATILE_BikeShop_Barrier_Hidden_Top, TRUE
setmetatile 10, 17, METATILE_BikeShop_Barrier_Hidden_Bottom, TRUE
setmetatile 10, 18, METATILE_BikeShop_Floor_Shadow_Top, FALSE
setmetatile 10, 19, METATILE_BikeShop_Wall_Edge_Top, FALSE
setmetatile 10, 0, METATILE_BikeShop_Barrier_Hidden_Top, TRUE
setmetatile 10, 1, METATILE_BikeShop_Barrier_Hidden_Bottom, TRUE
setmetatile 10, 2, METATILE_BikeShop_Floor_Shadow_Top, FALSE
setmetatile 10, 3, METATILE_BikeShop_Wall_Edge_Top, FALSE
setmetatile 37, 33, METATILE_BikeShop_Barrier_Green_Top, TRUE
setmetatile 37, 34, METATILE_BikeShop_Barrier_Green_TopMid, TRUE
setmetatile 37, 35, METATILE_BikeShop_Barrier_Green_BottomMid, TRUE
setmetatile 37, 36, METATILE_BikeShop_Barrier_Green_Bottom, TRUE
setmetatile 28, 22, METATILE_BikeShop_Barrier_Green_Top, TRUE
setmetatile 28, 23, METATILE_BikeShop_Barrier_Green_TopMid, TRUE
setmetatile 28, 24, METATILE_BikeShop_Barrier_Green_BottomMid, TRUE
setmetatile 28, 25, METATILE_BikeShop_Barrier_Green_Bottom, TRUE
setmetatile 10, 24, METATILE_BikeShop_Barrier_Green_Top, TRUE
setmetatile 10, 25, METATILE_BikeShop_Barrier_Green_TopMid, TRUE
setmetatile 10, 26, METATILE_BikeShop_Barrier_Green_BottomMid, TRUE
setmetatile 10, 27, METATILE_BikeShop_Barrier_Green_Bottom, TRUE
setmetatile 21, 2, METATILE_BikeShop_Barrier_Green_Top, TRUE
setmetatile 21, 3, METATILE_BikeShop_Barrier_Green_TopMid, TRUE
setmetatile 21, 4, METATILE_BikeShop_Barrier_Green_BottomMid, TRUE
setmetatile 21, 5, METATILE_BikeShop_Barrier_Green_Bottom, TRUE
setmetatile 6, 11, METATILE_BikeShop_Button_Pressed, FALSE
setmetatile 13, 10, METATILE_BikeShop_Button_Pressed, FALSE
setmetatile 16, 22, METATILE_BikeShop_Button_Pressed, FALSE
setmetatile 4, 26, METATILE_BikeShop_Button_Pressed, FALSE
setmetatile 30, 38, METATILE_BikeShop_Button_Pressed, FALSE
setmetatile 2, 11, METATILE_BikeShop_Button_Green, FALSE
setmetatile 17, 10, METATILE_BikeShop_Button_Green, FALSE
setmetatile 25, 18, METATILE_BikeShop_Button_Green, FALSE
setmetatile 18, 36, METATILE_BikeShop_Button_Green, FALSE
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
NewMauville_Inside_EventScript_SetBarrierStateGreenButton::
2021-11-16 23:12:16 +01:00
setmetatile 23, 34, METATILE_BikeShop_Barrier_Blue_Top, TRUE
setmetatile 23, 35, METATILE_BikeShop_Barrier_Blue_TopMid, TRUE
setmetatile 23, 36, METATILE_BikeShop_Barrier_Blue_BottomMid, TRUE
setmetatile 23, 37, METATILE_BikeShop_Barrier_Blue_Bottom, TRUE
setmetatile 10, 16, METATILE_BikeShop_Barrier_Blue_Top, TRUE
setmetatile 10, 17, METATILE_BikeShop_Barrier_Blue_TopMid, TRUE
setmetatile 10, 18, METATILE_BikeShop_Barrier_Blue_BottomMid, TRUE
setmetatile 10, 19, METATILE_BikeShop_Barrier_Blue_Bottom, TRUE
setmetatile 10, 0, METATILE_BikeShop_Barrier_Blue_Top, TRUE
setmetatile 10, 1, METATILE_BikeShop_Barrier_Blue_TopMid, TRUE
setmetatile 10, 2, METATILE_BikeShop_Barrier_Blue_BottomMid, TRUE
setmetatile 10, 3, METATILE_BikeShop_Barrier_Blue_Bottom, TRUE
setmetatile 37, 33, METATILE_BikeShop_Barrier_Hidden_Top, TRUE
setmetatile 37, 34, METATILE_BikeShop_Barrier_Hidden_Bottom, TRUE
setmetatile 37, 35, METATILE_BikeShop_Floor_Shadow_Top, FALSE
setmetatile 37, 36, METATILE_BikeShop_Wall_Edge_Top, FALSE
setmetatile 28, 22, METATILE_BikeShop_Barrier_Hidden_Top, TRUE
setmetatile 28, 23, METATILE_BikeShop_Barrier_Hidden_Bottom, TRUE
setmetatile 28, 24, METATILE_BikeShop_Floor_Shadow_Top, FALSE
setmetatile 28, 25, METATILE_BikeShop_Wall_Edge_Top, FALSE
setmetatile 10, 24, METATILE_BikeShop_Barrier_Hidden_Top, TRUE
setmetatile 10, 25, METATILE_BikeShop_Barrier_Hidden_Bottom, TRUE
setmetatile 10, 26, METATILE_BikeShop_Floor_Shadow_Top, FALSE
setmetatile 10, 27, METATILE_BikeShop_Wall_Edge_Top, FALSE
setmetatile 21, 2, METATILE_BikeShop_Barrier_Hidden_Top, TRUE
setmetatile 21, 3, METATILE_BikeShop_Barrier_Hidden_Bottom, TRUE
setmetatile 21, 4, METATILE_BikeShop_Floor_Shadow_Top, FALSE
setmetatile 21, 5, METATILE_BikeShop_Wall_Edge_Top, FALSE
setmetatile 2, 11, METATILE_BikeShop_Button_Pressed, FALSE
setmetatile 17, 10, METATILE_BikeShop_Button_Pressed, FALSE
setmetatile 25, 18, METATILE_BikeShop_Button_Pressed, FALSE
setmetatile 18, 36, METATILE_BikeShop_Button_Pressed, FALSE
setmetatile 6, 11, METATILE_BikeShop_Button_Blue, FALSE
setmetatile 13, 10, METATILE_BikeShop_Button_Blue, FALSE
setmetatile 16, 22, METATILE_BikeShop_Button_Blue, FALSE
setmetatile 4, 26, METATILE_BikeShop_Button_Blue, FALSE
setmetatile 30, 38, METATILE_BikeShop_Button_Blue, FALSE
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
NewMauville_Inside_EventScript_RedButton::
2017-11-10 02:21:31 +01:00
lockall
2019-11-07 16:32:21 +01:00
msgbox NewMauville_Inside_Text_SteppedOnSwitchGeneratorStopped, MSGBOX_DEFAULT
call NewMauville_Inside_EventScript_SetGeneratorOffMetatiles
2019-02-22 10:18:43 +01:00
setvar VAR_NEW_MAUVILLE_STATE, 2
2017-11-10 02:21:31 +01:00
releaseall
end
2021-07-20 21:18:31 +02:00
NewMauville_Inside_EventScript_SetGeneratorOffMetatiles::
2021-11-16 23:12:16 +01:00
setmetatile 33, 6, METATILE_BikeShop_Button_Pressed, FALSE
setmetatile 32, 2, METATILE_BikeShop_Generator_Off_Tile0, TRUE
setmetatile 33, 2, METATILE_BikeShop_Generator_Off_Tile1, TRUE
setmetatile 34, 2, METATILE_BikeShop_Generator_Off_Tile2, TRUE
setmetatile 35, 2, METATILE_BikeShop_Generator_Off_Tile3, TRUE
setmetatile 32, 3, METATILE_BikeShop_Generator_Off_Tile4, TRUE
setmetatile 33, 3, METATILE_BikeShop_Generator_Off_Tile5, TRUE
setmetatile 34, 3, METATILE_BikeShop_Generator_Off_Tile6, TRUE
setmetatile 35, 3, METATILE_BikeShop_Generator_Off_Tile7, TRUE
2017-11-10 02:21:31 +01:00
special DrawWholeMapView
return
2021-07-20 21:18:31 +02:00
NewMauville_Inside_EventScript_Generator::
2017-11-10 02:21:31 +01:00
lockall
goto_if_eq VAR_NEW_MAUVILLE_STATE, 2, NewMauville_Inside_EventScript_GeneratorOff
2019-11-07 16:32:21 +01:00
msgbox NewMauville_Inside_Text_GeneratorRadiatingHeat, MSGBOX_DEFAULT
2017-11-10 02:21:31 +01:00
releaseall
end
2021-07-20 21:18:31 +02:00
NewMauville_Inside_EventScript_GeneratorOff::
2019-11-07 16:32:21 +01:00
msgbox NewMauville_Inside_Text_GeneratorQuietedDown, MSGBOX_DEFAULT
2017-11-10 02:21:31 +01:00
releaseall
end
2021-07-20 21:18:31 +02:00
NewMauville_Inside_EventScript_Voltorb1::
2017-11-10 02:21:31 +01:00
lock
faceplayer
setwildbattle SPECIES_VOLTORB, 25
2017-11-10 02:21:31 +01:00
waitse
2021-11-07 18:58:11 +01:00
playmoncry SPECIES_VOLTORB, CRY_MODE_ENCOUNTER
2017-11-10 02:21:31 +01:00
delay 40
waitmoncry
setflag FLAG_SYS_CTRL_OBJ_DELETE
dowildbattle
clearflag FLAG_SYS_CTRL_OBJ_DELETE
specialvar VAR_RESULT, GetBattleOutcome
goto_if_eq VAR_RESULT, B_OUTCOME_WON, NewMauville_Inside_EventScript_DefeatedVoltorb1
goto_if_eq VAR_RESULT, B_OUTCOME_RAN, NewMauville_Inside_EventScript_DefeatedVoltorb1
goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, NewMauville_Inside_EventScript_DefeatedVoltorb1
2019-01-02 22:12:43 +01:00
setflag FLAG_DEFEATED_VOLTORB_1_NEW_MAUVILLE
2017-11-10 02:21:31 +01:00
release
end
2021-07-20 21:18:31 +02:00
NewMauville_Inside_EventScript_DefeatedVoltorb1::
2019-01-02 22:12:43 +01:00
setflag FLAG_DEFEATED_VOLTORB_1_NEW_MAUVILLE
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
NewMauville_Inside_EventScript_Voltorb2::
2017-11-10 02:21:31 +01:00
lock
faceplayer
setwildbattle SPECIES_VOLTORB, 25
2017-11-10 02:21:31 +01:00
waitse
2021-11-07 18:58:11 +01:00
playmoncry SPECIES_VOLTORB, CRY_MODE_ENCOUNTER
2017-11-10 02:21:31 +01:00
delay 40
waitmoncry
setflag FLAG_SYS_CTRL_OBJ_DELETE
dowildbattle
clearflag FLAG_SYS_CTRL_OBJ_DELETE
specialvar VAR_RESULT, GetBattleOutcome
goto_if_eq VAR_RESULT, B_OUTCOME_WON, NewMauville_Inside_EventScript_DefeatedVoltorb2
goto_if_eq VAR_RESULT, B_OUTCOME_RAN, NewMauville_Inside_EventScript_DefeatedVoltorb2
goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, NewMauville_Inside_EventScript_DefeatedVoltorb2
2019-01-02 22:12:43 +01:00
setflag FLAG_DEFEATED_VOLTORB_2_NEW_MAUVILLE
2017-11-10 02:21:31 +01:00
release
end
2021-07-20 21:18:31 +02:00
NewMauville_Inside_EventScript_DefeatedVoltorb2::
2019-01-02 22:12:43 +01:00
setflag FLAG_DEFEATED_VOLTORB_2_NEW_MAUVILLE
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
NewMauville_Inside_EventScript_Voltorb3::
2017-11-10 02:21:31 +01:00
lock
faceplayer
setwildbattle SPECIES_VOLTORB, 25
2017-11-10 02:21:31 +01:00
waitse
2021-11-07 18:58:11 +01:00
playmoncry SPECIES_VOLTORB, CRY_MODE_ENCOUNTER
2017-11-10 02:21:31 +01:00
delay 40
waitmoncry
setflag FLAG_SYS_CTRL_OBJ_DELETE
dowildbattle
clearflag FLAG_SYS_CTRL_OBJ_DELETE
specialvar VAR_RESULT, GetBattleOutcome
goto_if_eq VAR_RESULT, B_OUTCOME_WON, NewMauville_Inside_EventScript_DefeatedVoltorb3
goto_if_eq VAR_RESULT, B_OUTCOME_RAN, NewMauville_Inside_EventScript_DefeatedVoltorb3
goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, NewMauville_Inside_EventScript_DefeatedVoltorb3
2019-01-02 22:12:43 +01:00
setflag FLAG_DEFEATED_VOLTORB_3_NEW_MAUVILLE
2017-11-10 02:21:31 +01:00
release
end
2021-07-20 21:18:31 +02:00
NewMauville_Inside_EventScript_DefeatedVoltorb3::
2019-01-02 22:12:43 +01:00
setflag FLAG_DEFEATED_VOLTORB_3_NEW_MAUVILLE
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
NewMauville_Inside_Text_GeneratorRadiatingHeat:
2017-11-10 02:21:31 +01:00
.string "The generator is radiating heat that\n"
.string "can be felt even at a distance.\p"
.string "It looks like it should be turned off\n"
.string "as soon as possible.$"
2021-07-20 21:18:31 +02:00
NewMauville_Inside_Text_GeneratorQuietedDown:
2017-11-10 02:21:31 +01:00
.string "The generator quieted down.$"
2021-07-20 21:18:31 +02:00
NewMauville_Inside_Text_SteppedOnSwitchGeneratorStopped:
2017-11-10 02:21:31 +01:00
.string "{PLAYER} stepped on the switch.\p"
.string "Click…\p"
.string "… … … … … … … …\n"
.string "… … … … … … … …\p"
.string "The generator appears to have\n"
.string "stopped…$"