diff options
| author | GriffinR <griffin.g.richards@gmail.com> | 2020-01-23 14:46:03 -0500 |
|---|---|---|
| committer | GriffinR <griffin.g.richards@gmail.com> | 2020-01-24 02:57:45 -0500 |
| commit | ef1f9ead0ba44c67185dccc616846646d7ce9257 (patch) | |
| tree | ea1dea4c196acfc062cbe144911fa979e96218b2 /data/maps/TrainerTower_Elevator | |
| parent | e97d3532d4d72a1fe9aec755cd2a3c6527484e27 (diff) | |
Document Trainer Tower scripts
Diffstat (limited to 'data/maps/TrainerTower_Elevator')
| -rw-r--r-- | data/maps/TrainerTower_Elevator/map.json | 35 | ||||
| -rw-r--r-- | data/maps/TrainerTower_Elevator/scripts.inc | 80 |
2 files changed, 115 insertions, 0 deletions
diff --git a/data/maps/TrainerTower_Elevator/map.json b/data/maps/TrainerTower_Elevator/map.json new file mode 100644 index 000000000..7d004c2df --- /dev/null +++ b/data/maps/TrainerTower_Elevator/map.json @@ -0,0 +1,35 @@ +{ + "id": "MAP_TRAINER_TOWER_ELEVATOR", + "name": "TrainerTower_Elevator", + "layout": "LAYOUT_TRAINER_TOWER_ELEVATOR", + "music": "MUS_T_TOWER", + "region_map_section": "MAPSEC_TRAINER_TOWER_2", + "requires_flash": false, + "weather": "WEATHER_NONE", + "map_type": "MAP_TYPE_8", + "unknown_18": 0, + "unknown_19": 2, + "elevator_flag": 0, + "battle_scene": "BATTLE_SCENE_0", + "connections": null, + "object_events": [], + "warp_events": [ + { + "x": 2, + "y": 5, + "elevation": 3, + "dest_map": "MAP_NONE", + "dest_warp_id": 127 + } + ], + "coord_events": [], + "bg_events": [ + { + "type": "bg_event_type_0", + "x": 0, + "y": 2, + "elevation": 0, + "script": "TrainerTower_Elevator_EventScript_FloorSelect" + } + ] +} diff --git a/data/maps/TrainerTower_Elevator/scripts.inc b/data/maps/TrainerTower_Elevator/scripts.inc new file mode 100644 index 000000000..349667102 --- /dev/null +++ b/data/maps/TrainerTower_Elevator/scripts.inc @@ -0,0 +1,80 @@ +TrainerTower_Elevator_MapScripts:: @ 8164AF8 + map_script MAP_SCRIPT_ON_RESUME, TrainerTower_OnResume + map_script MAP_SCRIPT_ON_FRAME_TABLE, TrainerTower_OnFrame + .byte 0 + +TrainerTower_Elevator_EventScript_FloorSelect:: @ 8164B03 + lockall + setvar VAR_0x8004, 6 + call_if_unset FLAG_TEMP_2, EventScript_GetElevatorFloor + copyvar VAR_0x8005, VAR_ELEVATOR_FLOOR + special Special_DrawElevatorCurrentFloorWindow + message Text_WantWhichFloor + waitmessage + setvar VAR_0x8004, 6 + specialvar VAR_RESULT, Special_InitElevatorFloorSelectMenuPos + switch VAR_RESULT + case 0, TrainerTower_Elevator_EventScript_FloorSelectFromRoof + case 1, TrainerTower_Elevator_EventScript_FloorSelectFromLobby + end + +TrainerTower_Elevator_EventScript_FloorSelectFromRoof:: @ 8164B46 + multichoicedefault 0, 0, MULTICHOICE_ROOFTOP_B1F, 0, FALSE + goto TrainerTower_Elevator_EventScript_ChooseFloor + end + +TrainerTower_Elevator_EventScript_FloorSelectFromLobby:: @ 8164B52 + multichoicedefault 0, 0, MULTICHOICE_ROOFTOP_B1F, 1, FALSE + goto TrainerTower_Elevator_EventScript_ChooseFloor + end + +TrainerTower_Elevator_EventScript_ChooseFloor:: @ 8164B5E + switch VAR_RESULT + case 0, TrainerTower_Elevator_EventScript_SelectRoof + case 1, TrainerTower_Elevator_EventScript_SelectLobby + case 2, TrainerTower_Elevator_EventScript_CloseFloorSelect + case SCR_MENU_CANCEL, TrainerTower_Elevator_EventScript_CloseFloorSelect + end + +TrainerTower_Elevator_EventScript_SelectLobby:: @ 8164B90 + setvar VAR_0x8006, 3 + setdynamicwarp MAP_TRAINER_TOWER_LOBBY, 255, 17, 8 + compare VAR_ELEVATOR_FLOOR, 3 + goto_if_eq TrainerTower_Elevator_EventScript_CloseFloorSelect + call TrainerTower_Elevator_EventScript_MoveElevator + setvar VAR_ELEVATOR_FLOOR, 3 + special Special_CloseElevatorCurrentFloorWindow + delay 25 + applymovement OBJ_EVENT_ID_PLAYER, TrainerTower_Elevator_Movement_ExitElevator + waitmovement 0 + warp MAP_TRAINER_TOWER_LOBBY, 255, 17, 8 + waitstate + releaseall + end + +TrainerTower_Elevator_EventScript_SelectRoof:: @ 8164BCD + goto TrainerTower_Elevator_EventScript_CloseFloorSelect + end + +TrainerTower_Elevator_EventScript_CloseFloorSelect:: @ 8164BD3 + special Special_CloseElevatorCurrentFloorWindow + releaseall + end + +TrainerTower_Elevator_EventScript_MoveElevator:: @ 8164BD8 + special Special_CloseElevatorCurrentFloorWindow + closemessage + waitse + special Special_AnimateElevator + waitstate + setflag FLAG_TEMP_2 + return + +TrainerTower_Elevator_Movement_ExitElevator:: @ 8164BE5 + walk_in_place_fastest_down + delay_16 + walk_down + walk_right + walk_right + walk_down + step_end |
