Skip to content

Commit

Permalink
trident shuttle now generic
Browse files Browse the repository at this point in the history
  • Loading branch information
mullenpaul committed Oct 11, 2023
1 parent 6f16651 commit f7dd489
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 13 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 14 additions & 0 deletions code/datums/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
var/port_x_offset
var/port_y_offset

var/tags

/datum/map_template/shuttle/proc/prerequisites_met()
return TRUE

Expand Down Expand Up @@ -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"
17 changes: 14 additions & 3 deletions code/modules/shuttle/computers/trijent_elevator_control.dm
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
/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
var/datum/elevator/destination/site

/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

Expand Down Expand Up @@ -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)
Expand Down
24 changes: 24 additions & 0 deletions code/modules/shuttle/shuttles.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
17 changes: 13 additions & 4 deletions code/modules/shuttle/shuttles/trijent_elevator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand All @@ -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
33 changes: 27 additions & 6 deletions maps/map_files/DesertDam/Desert_Dam.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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" = (
Expand Down Expand Up @@ -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" = (
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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" = (
Expand Down Expand Up @@ -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" = (
Expand Down

0 comments on commit f7dd489

Please sign in to comment.