From f7dd48904315f6e13ee777f04f930664c7da6edf Mon Sep 17 00:00:00 2001 From: paulrpg Date: Wed, 11 Oct 2023 22:03:09 +0100 Subject: [PATCH] trident shuttle now generic --- code/__DEFINES/shuttles.dm | 2 ++ code/datums/shuttles.dm | 14 ++++++++ .../computers/trijent_elevator_control.dm | 17 ++++++++-- code/modules/shuttle/shuttles.md | 24 ++++++++++++++ .../shuttle/shuttles/trijent_elevator.dm | 17 +++++++--- maps/map_files/DesertDam/Desert_Dam.dmm | 33 +++++++++++++++---- 6 files changed, 94 insertions(+), 13 deletions(-) diff --git a/code/__DEFINES/shuttles.dm b/code/__DEFINES/shuttles.dm index d283656ccae6..2d4026598c28 100644 --- a/code/__DEFINES/shuttles.dm +++ b/code/__DEFINES/shuttles.dm @@ -100,6 +100,8 @@ #define MOBILE_SHUTTLE_ID_ERT_BIG "ert_boarding_shuttle" #define MOBILE_TRIJENT_ELEVATOR "trijentshuttle2" +#define STAT_TRIJENT_EMPTY "trigent_empty" +#define STAT_TRIJENT_OCCUPIED "trigent_occupied" #define STAT_TRIJENT_LZ1 "trigent_lz1" #define STAT_TRIJENT_LZ2 "trigent_lz2" #define STAT_TRIJENT_ENGI "trigent_engineering" diff --git a/code/datums/shuttles.dm b/code/datums/shuttles.dm index eb1fd2341920..f2f675724c8b 100644 --- a/code/datums/shuttles.dm +++ b/code/datums/shuttles.dm @@ -14,6 +14,8 @@ var/port_x_offset var/port_y_offset + var/tags + /datum/map_template/shuttle/proc/prerequisites_met() return TRUE @@ -99,7 +101,19 @@ /datum/map_template/shuttle/proc/post_load(obj/docking_port/mobile/M) if(movement_force) M.movement_force = movement_force.Copy() + if(tags) + M.tag = tags /datum/map_template/shuttle/vehicle shuttle_id = MOBILE_SHUTTLE_VEHICLE_ELEVATOR name = "Vehicle Elevator" + +/datum/map_template/shuttle/trijent_elevator + name = "Trijent Elevator" + shuttle_id = MOBILE_TRIJENT_ELEVATOR + +/datum/map_template/shuttle/trijent_elevator/A + tags="A" + +/datum/map_template/shuttle/trijent_elevator/B + tags="B" diff --git a/code/modules/shuttle/computers/trijent_elevator_control.dm b/code/modules/shuttle/computers/trijent_elevator_control.dm index 290d0c94b33d..9eaa16e56775 100644 --- a/code/modules/shuttle/computers/trijent_elevator_control.dm +++ b/code/modules/shuttle/computers/trijent_elevator_control.dm @@ -1,8 +1,6 @@ /obj/structure/machinery/computer/shuttle/elevator_controller/elevator_call name = "\improper Elevator Call" desc = "Control panel for the elevator" - icon = 'icons/obj/structures/machinery/computer.dmi' - icon_state = "elevator_screen" shuttleId = MOBILE_TRIJENT_ELEVATOR is_call = TRUE var/dockId @@ -10,6 +8,13 @@ /obj/structure/machinery/computer/shuttle/elevator_controller/elevator_call/get_landing_zones() return list(SSshuttle.getDock(dockId)) + +/obj/structure/machinery/computer/shuttle/elevator_controller/elevator_call/trijent/occupied + dockId = STAT_TRIJENT_OCCUPIED + +/obj/structure/machinery/computer/shuttle/elevator_controller/elevator_call/trijent/empty + dockId = STAT_TRIJENT_EMPTY + /obj/structure/machinery/computer/shuttle/elevator_controller/elevator_call/trijent/lz1 dockId = STAT_TRIJENT_LZ1 @@ -38,8 +43,14 @@ /obj/structure/machinery/computer/shuttle/elevator_controller/proc/get_landing_zones() . = list() + var/obj/docking_port/mobile/shuttle = SSshuttle.getShuttle(shuttleId) for(var/obj/docking_port/stationary/trijent_elevator/elev in SSshuttle.stationary) - . += list(elev) + if(shuttle.tag == "") + . += list(elev) + continue + if(shuttle.tag == elev.tag) + . += list(elev) + continue /obj/structure/machinery/computer/shuttle/elevator_controller/tgui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) diff --git a/code/modules/shuttle/shuttles.md b/code/modules/shuttle/shuttles.md index 373e18b44953..1dc987b37b83 100644 --- a/code/modules/shuttle/shuttles.md +++ b/code/modules/shuttle/shuttles.md @@ -16,3 +16,27 @@ Shuttle map templates are used to define what the shuttle should look like. When defining the shuttle dimensions, define the height/width as if it was orienting north. The subsystem will properly line everything up, this allows for stationary docks to be in different orientations to their defined map template. A shuttle has a height, width, dheight and dwidth. The height and width is the size of the shuttle, with respect to its direction. If the template direction is North/South then width is your X coordinate and height is your Y. If the template direction is East/West then width is your Y direction and height is your X. On stationary docking ports, you can specify dwidth and dheight (auto generated for mobile), these are offsets for how your shuttle should land on the site. When a mobile port lands on a stationary port it wants to place the bottom left of the shuttle turfs on the stationary port. The dwidth/dheight allows you to offset this. + + +# Generic Elevator Shuttle + +The elevator used on Trident (DesertDam) can be used in any map and multiple can exist on one map. + +Do not modify the trident shuttle map. You can code in elevators from the following two docking ports (where the elevator can go): + +- /obj/docking_port/stationary/trijent_elevator/occupied +- /obj/docking_port/stationary/trijent_elevator/empty + +An occupied stationary port will start the map with an elevator and an empty one will not. +All docking ports are, by default, linked together. One elevator can go to all docking ports. +To limit access between docking ports you can use tags. + +To setup an elevator: +- place the docking port where you want the elevator to sit +- give the docking port instance a unique ID +- give the docking port instance a unique Name +- give the docking port shuttle_area the area name for where it sits +- if you want to build a docking port 'network' then change the roudnstart_template to a subclass +- if you want to assign a docking port to a 'network' then give it a value in "tag" + +If things are unclear, look at trident. It has two elevator networks. diff --git a/code/modules/shuttle/shuttles/trijent_elevator.dm b/code/modules/shuttle/shuttles/trijent_elevator.dm index 86ad6f7ef217..e8b2b73ec22d 100644 --- a/code/modules/shuttle/shuttles/trijent_elevator.dm +++ b/code/modules/shuttle/shuttles/trijent_elevator.dm @@ -57,6 +57,8 @@ if(istype(arriving_shuttle, /obj/docking_port/mobile/trijent_elevator)) var/obj/docking_port/mobile/trijent_elevator/elevator = arriving_shuttle elevator.door_control.control_doors("open", airlock_exit) + if(elevator.tag != "") + elevator.tag = tag // open dock doors var/datum/door_controller/single/door_control = new() @@ -74,6 +76,17 @@ door_control.control_doors("force-lock-launch") qdel(door_control) +/obj/docking_port/stationary/trijent_elevator/occupied + name="occupied" + id=STAT_TRIJENT_OCCUPIED + airlock_exit="west" + roundstart_template = /datum/map_template/shuttle/trijent_elevator + +/obj/docking_port/stationary/trijent_elevator/empty + name="empty" + id=STAT_TRIJENT_EMPTY + airlock_exit="west" + /obj/docking_port/stationary/trijent_elevator/lz1 name="Lz1 Elevator" id=STAT_TRIJENT_LZ1 @@ -98,7 +111,3 @@ id=STAT_TRIJENT_OMEGA airlock_area=/area/shuttle/trijent_shuttle/omega airlock_exit="east" - -/datum/map_template/shuttle/trijent_elevator - name = "Trijent Elevator" - shuttle_id = MOBILE_TRIJENT_ELEVATOR diff --git a/maps/map_files/DesertDam/Desert_Dam.dmm b/maps/map_files/DesertDam/Desert_Dam.dmm index ed7688070a2f..f0b8dc76bd20 100644 --- a/maps/map_files/DesertDam/Desert_Dam.dmm +++ b/maps/map_files/DesertDam/Desert_Dam.dmm @@ -10112,7 +10112,8 @@ icon_state = "S" }, /obj/structure/machinery/computer/shuttle/elevator_controller/elevator_call/trijent/omega{ - pixel_y = 32 + pixel_y = 32; + shuttleId = "trijentshuttle22" }, /turf/open/floor/prison{ dir = 8; @@ -14387,7 +14388,11 @@ /turf/open/desert/dirt, /area/desert_dam/exterior/valley/valley_telecoms) "aRB" = ( -/obj/docking_port/stationary/trijent_elevator/lz2, +/obj/docking_port/stationary/trijent_elevator/occupied{ + id = "trigent_lz2"; + name = "Lz2 Elevator"; + airlock_area = /area/shuttle/trijent_shuttle/lz2 + }, /turf/open/gm/empty, /area/shuttle/trijent_shuttle/lz2) "aRC" = ( @@ -61538,7 +61543,12 @@ /turf/open/gm/river/desert/shallow, /area/desert_dam/interior/caves/temple) "ipQ" = ( -/obj/docking_port/stationary/trijent_elevator/omega, +/obj/docking_port/stationary/trijent_elevator/empty{ + id = "trigent_omega"; + name = "Omega Elevator"; + airlock_exit = "east"; + airlock_area = /area/shuttle/trijent_shuttle/omega + }, /turf/open/gm/empty, /area/shuttle/trijent_shuttle/omega) "iqs" = ( @@ -62546,7 +62556,8 @@ /area/desert_dam/exterior/valley/valley_labs) "mej" = ( /obj/structure/machinery/computer/shuttle/elevator_controller/elevator_call/trijent/lz2{ - pixel_x = 32 + pixel_x = 32; + shuttleId = "trijentshuttle22" }, /turf/open/floor/prison{ dir = 4; @@ -63387,7 +63398,13 @@ }, /area/desert_dam/interior/caves/central_caves) "pif" = ( -/obj/docking_port/stationary/trijent_elevator/engineering, +/obj/docking_port/stationary/trijent_elevator/empty{ + id = "trigent_engineering"; + name = "Engineering Elevator"; + airlock_exit = "east"; + tag = "A"; + airlock_area = /area/shuttle/trijent_shuttle/engi + }, /turf/open/gm/empty, /area/shuttle/trijent_shuttle/engi) "pij" = ( @@ -64025,7 +64042,11 @@ /turf/open/desert/rock/deep, /area/desert_dam/interior/caves/temple) "rxS" = ( -/obj/docking_port/stationary/trijent_elevator/lz1, +/obj/docking_port/stationary/trijent_elevator/occupied{ + id = "trigent_lz1"; + name = "Lz1 Elevator"; + tag = "A" + }, /turf/open/gm/empty, /area/shuttle/trijent_shuttle/lz1) "ryG" = (