mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-14 09:27:45 +01:00
Airlock markers - docking and shuttle airlocks (#17717)
* rearrange files * Squashed commit of the following: commitec32b5b6e9Author: DreamySkrell <> Date: Sat Oct 28 22:32:05 2023 +0200 ccc commitbe750e672dAuthor: DreamySkrell <> Date: Sat Oct 28 22:01:02 2023 +0200 cc commit1ecd9afb6cAuthor: DreamySkrell <> Date: Sat Oct 28 21:57:38 2023 +0200 c commit159d1000d9Author: DreamySkrell <> Date: Sat Oct 28 21:40:40 2023 +0200 nav_ert_dock kill commitb767a2574aAuthor: DreamySkrell <> Date: Sat Oct 28 21:24:34 2023 +0200 a commitaa01eec1fcAuthor: DreamySkrell <> Date: Sat Oct 28 21:09:48 2023 +0200 NAV_HORIZON_DOCK_ALL commit4564bfd29fAuthor: DreamySkrell <> Date: Sat Oct 28 20:55:45 2023 +0200 burglar and raider to use NAV_HORIZON_EXTERIOR_ALL_DECKS and SNEAKY commitec7564fcb1Author: DreamySkrell <> Date: Sat Oct 28 20:43:17 2023 +0200 merc shuttle to use NAV_HORIZON_EXTERIOR_ALL_DECKS commitd306934a73Author: DreamySkrell <> Date: Fri Oct 27 00:00:41 2023 +0200 fix merc and skipjack area/template_noop commit0600a348cdAuthor: DreamySkrell <> Date: Thu Oct 26 22:28:45 2023 +0200 merc ship generic dock landmark huh commitc9850622f9Author: DreamySkrell <> Date: Thu Oct 26 20:37:55 2023 +0200 sane landmark tags commit56d9052270Author: DreamySkrell <> Date: Thu Oct 26 20:11:55 2023 +0200 /horizon/dock/deck_3/port_3 commit846d737c94Author: DreamySkrell <> Date: Thu Oct 26 20:03:17 2023 +0200 landmark/horizon/deck -> landmark/horizon/exterior/deck commitef5c3d1b09Author: DreamySkrell <> Date: Thu Oct 26 20:02:17 2023 +0200 landmark/horizon/dock -> landmark/horizon/dock/deck_3/... commit1716ef26a8Author: DreamySkrell <> Date: Thu Oct 26 19:54:21 2023 +0200 docks ruler helpers commit18c66a3124Author: DreamySkrell <> Date: Thu Oct 26 19:47:27 2023 +0200 a commit0f2fc4524cAuthor: DreamySkrell <> Date: Thu Oct 26 19:43:19 2023 +0200 horizon/nav -> horizon/hangar commite13a5233d1Author: DreamySkrell <> Date: Thu Oct 26 19:41:08 2023 +0200 sccv_horizon_shuttle_landmarks.dm * Squashed commit of the following: commit4d7052be3bAuthor: DreamySkrell <> Date: Sun Oct 29 14:18:40 2023 +0100 tests rerun please commitae04980347Author: DreamySkrell <> Date: Sun Oct 29 13:25:26 2023 +0100 oops commit176ea80155Author: DreamySkrell <> Date: Sun Oct 29 12:54:25 2023 +0100 tests rerun please commit5cf7db9162Author: DreamySkrell <> Date: Sun Oct 29 12:45:07 2023 +0100 c commitf93887a1efAuthor: DreamySkrell <> Date: Sun Oct 29 12:43:47 2023 +0100 jjjjjjjjjjjj commit697542a270Author: DreamySkrell <> Date: Sun Oct 29 12:25:32 2023 +0100 a commita83373a62aAuthor: DreamySkrell <> Date: Sun Oct 29 12:17:47 2023 +0100 ay commitbaf447a694Author: DreamySkrell <> Date: Sun Oct 29 11:05:38 2023 +0100 a * sprites * code and mapping wip... * huhhhh * agony * docs idk * intrepid idk * almost working... * i fucking love docks * 568 * m * kkkkkkkkkkkkkkk * helper in own file * a * tags * huh * a * 1 pixel * intrepid mf * spark mf * access * guidelines * g * gd * hnyfgjdtjtsdyjdtyj * m * c * a * fix canary and ert shuttle docking controller tags * huhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh * remove old changelogs * sprite * bad docs removal --------- Co-authored-by: DreamySkrell <>
This commit is contained in:
@@ -1,121 +0,0 @@
|
||||
/obj/effect/map_effect/marker
|
||||
name = "map marker parent abstract object"
|
||||
icon = 'icons/effects/map_effects.dmi'
|
||||
icon_state = "map_marker"
|
||||
|
||||
/obj/effect/map_effect/marker_helper
|
||||
name = "map marker helper parent abstract object"
|
||||
icon = 'icons/effects/map_effects.dmi'
|
||||
icon_state = "map_marker"
|
||||
|
||||
/// Airlock marker that, when placed above airlock components (doors, pumps, sensors, etc),
|
||||
/// actually sets the airlock up to make it functional.
|
||||
/obj/effect/map_effect/marker/airlock
|
||||
name = "airlock marker (inside the airlock)"
|
||||
desc = "MASTER_TAG VAR MUST BE UNIQUE FOR THE AIRLOCK! Place this on top of airlock components (doors, pumps, sensors, etc)."
|
||||
icon = 'icons/effects/map_effects.dmi'
|
||||
icon_state = "airlock_marker"
|
||||
layer = LIGHTING_LAYER
|
||||
|
||||
/// Radio frequency of this airlock.
|
||||
var/frequency = 2137
|
||||
|
||||
/// Unique tag for this airlock. Not visible in game and to the player. Do not leave this as null.
|
||||
/// THIS MUST BE UNIQUE FOR THE AIRLOCK. Every marker in one airlock should have the same `master_tag`.
|
||||
/// But different airlocks, even on different maps, cannot share the same `master_tag`.
|
||||
var/master_tag = null
|
||||
|
||||
/// Doors/buttons/etc will be set to this access requirement. If null, they will not have any access requirements.
|
||||
var/required_access = list(access_external_airlocks)
|
||||
|
||||
/// Specialization helper for the airlock marker, to be put above "exterior" parts of the airlock,
|
||||
/// and on top of the actual airlock marker. By itself does nothing.
|
||||
/obj/effect/map_effect/marker_helper/airlock/exterior
|
||||
name = "airlock marker (exterior/outside/vacuum)"
|
||||
icon = 'icons/effects/map_effects.dmi'
|
||||
icon_state = "airlock_marker_exterior"
|
||||
layer = LIGHTING_LAYER
|
||||
|
||||
/// Specialization helper for the airlock marker, to be put above "interior" parts of the airlock,
|
||||
/// and on top of the actual airlock marker. By itself does nothing.
|
||||
/obj/effect/map_effect/marker_helper/airlock/interior
|
||||
name = "airlock marker (interior/inside/pressurized)"
|
||||
icon = 'icons/effects/map_effects.dmi'
|
||||
icon_state = "airlock_marker_interior"
|
||||
layer = LIGHTING_LAYER
|
||||
|
||||
/obj/effect/map_effect/marker/airlock/Initialize(mapload, ...)
|
||||
..()
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
#define MASTER_TAG "[master_tag]_controller"
|
||||
#define AIRPUMP_TAG "[master_tag]_pump"
|
||||
#define SENSOR_TAG "[master_tag]_sensor"
|
||||
#define EXTERIOR_DOOR_TAG "[master_tag]_outer"
|
||||
#define INTERIOR_DOOR_TAG "[master_tag]_inner"
|
||||
|
||||
/obj/effect/map_effect/marker/airlock/LateInitialize()
|
||||
if(!master_tag || !frequency)
|
||||
return
|
||||
|
||||
var/is_interior = locate(/obj/effect/map_effect/marker_helper/airlock/interior) in loc
|
||||
var/is_exterior = locate(/obj/effect/map_effect/marker_helper/airlock/exterior) in loc
|
||||
|
||||
// iterate over airlock components under this marker
|
||||
// and actually set them up
|
||||
for(var/thing in loc)
|
||||
var/obj/machinery/embedded_controller/radio/airlock/airlock_controller/airlock_controller = thing
|
||||
if(istype(airlock_controller))
|
||||
airlock_controller.set_frequency(frequency)
|
||||
airlock_controller.id_tag = MASTER_TAG
|
||||
airlock_controller.tag_airpump = AIRPUMP_TAG
|
||||
airlock_controller.tag_chamber_sensor = SENSOR_TAG
|
||||
airlock_controller.tag_exterior_door = EXTERIOR_DOOR_TAG
|
||||
airlock_controller.tag_interior_door = INTERIOR_DOOR_TAG
|
||||
airlock_controller.req_access = required_access
|
||||
airlock_controller.program = new /datum/computer/file/embedded_program/airlock(airlock_controller)
|
||||
continue
|
||||
|
||||
var/obj/machinery/door/airlock/door = thing
|
||||
if(istype(door))
|
||||
door.set_frequency(frequency)
|
||||
door.req_access = required_access
|
||||
door.lock()
|
||||
if(is_interior)
|
||||
door.id_tag = INTERIOR_DOOR_TAG
|
||||
else if(is_exterior)
|
||||
door.id_tag = EXTERIOR_DOOR_TAG
|
||||
continue
|
||||
|
||||
var/obj/machinery/airlock_sensor/sensor = thing
|
||||
if(istype(sensor))
|
||||
sensor.set_frequency(frequency)
|
||||
sensor.id_tag = SENSOR_TAG
|
||||
sensor.master_tag = MASTER_TAG
|
||||
continue
|
||||
|
||||
var/obj/machinery/atmospherics/unary/vent_pump/pump = thing
|
||||
if(istype(pump))
|
||||
pump.frequency = frequency
|
||||
unregister_radio(pump, frequency)
|
||||
pump.setup_radio()
|
||||
pump.id_tag = AIRPUMP_TAG
|
||||
continue
|
||||
|
||||
var/obj/machinery/access_button/button = thing
|
||||
if(istype(button))
|
||||
button.set_frequency(frequency)
|
||||
button.master_tag = MASTER_TAG
|
||||
button.req_access = required_access
|
||||
if(is_interior)
|
||||
button.command = "cycle_interior"
|
||||
else if(is_exterior)
|
||||
button.command = "cycle_exterior"
|
||||
continue
|
||||
|
||||
#undef MASTER_TAG
|
||||
#undef AIRPUMP_TAG
|
||||
#undef SENSOR_TAG
|
||||
#undef EXTERIOR_DOOR_TAG
|
||||
#undef INTERIOR_DOOR_TAG
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
#define AIRLOCK_MARKER_TAG_MASTER "[master_tag]"
|
||||
#define AIRLOCK_MARKER_TAG_SENSOR_CHAMBER "[master_tag]_sensor_chamber"
|
||||
#define AIRLOCK_MARKER_TAG_SENSOR_INTERIOR "[master_tag]_sensor_interior"
|
||||
#define AIRLOCK_MARKER_TAG_SENSOR_EXTERIOR "[master_tag]_sensor_exterior"
|
||||
#define AIRLOCK_MARKER_TAG_DOOR_EXTERIOR "[master_tag]_door_exterior"
|
||||
#define AIRLOCK_MARKER_TAG_DOOR_INTERIOR "[master_tag]_door_interior"
|
||||
#define AIRLOCK_MARKER_TAG_AIRPUMP_CHAMBER "[master_tag]_airpump_chamber"
|
||||
#define AIRLOCK_MARKER_TAG_AIRPUMP_OUT_EXTERNAL "[master_tag]_pump_out_external"
|
||||
#define AIRLOCK_MARKER_TAG_AIRPUMP_OUT_INTERNAL "[master_tag]_pump_out_internal"
|
||||
@@ -0,0 +1,118 @@
|
||||
/obj/effect/map_effect/marker
|
||||
name = "map marker parent abstract object"
|
||||
icon = 'icons/effects/map_effects.dmi'
|
||||
icon_state = "marker_base"
|
||||
|
||||
/// Airlock marker that, when placed above airlock components, actually sets them up to make it functional.
|
||||
/// This is a simple exterior access airlock, not used for docking.
|
||||
/// See `maps/helpers/guidelines_airlocks.dmm` for examples of good and bad airlocks.
|
||||
/obj/effect/map_effect/marker/airlock
|
||||
name = "airlock marker"
|
||||
desc = "See comments/documentation in code."
|
||||
icon = 'icons/effects/map_effects.dmi'
|
||||
icon_state = "marker_airlock"
|
||||
layer = LIGHTING_LAYER
|
||||
|
||||
/// Radio frequency of this airlock.
|
||||
/// For simple external/service access airlocks it does not affect anything.
|
||||
var/frequency = 2137
|
||||
|
||||
/// Unique tag for this airlock. Not visible in game and to the player. Do not leave this as null.
|
||||
/// THIS MUST BE UNIQUE FOR THE AIRLOCK. Every marker in one airlock should have the same `master_tag`.
|
||||
/// Different airlocks, even on different maps, cannot share the same `master_tag`.
|
||||
var/master_tag = null
|
||||
|
||||
/// If true, the airlock will be set up to fill with air from the outside when cycling to exterior,
|
||||
/// and will empty air to outside before filling with interior air. This makes it so exterior and interior atmospheres do not mix.
|
||||
/// Should be used for airlocks that may be used on planets with atmosphere and air (as opposed to ships or space stations that stay in vacuum).
|
||||
var/cycle_to_external_air = FALSE
|
||||
|
||||
/// Doors/buttons/etc will be set to this access requirement. If null, they will not have any access requirements.
|
||||
req_access = null
|
||||
|
||||
/// Doors/buttons/etc will be set to this access requirement. If null, they will not have any access requirements.
|
||||
req_one_access = list(access_external_airlocks)
|
||||
|
||||
/obj/effect/map_effect/marker/airlock/Initialize(mapload, ...)
|
||||
..()
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/obj/effect/map_effect/marker/airlock/LateInitialize()
|
||||
if(!master_tag || !frequency)
|
||||
return
|
||||
|
||||
var/is_interior = locate(/obj/effect/map_effect/marker_helper/airlock/interior) in loc
|
||||
var/is_exterior = locate(/obj/effect/map_effect/marker_helper/airlock/exterior) in loc
|
||||
var/is_out = locate(/obj/effect/map_effect/marker_helper/airlock/out) in loc
|
||||
|
||||
// iterate over airlock components under this marker
|
||||
// and actually set them up
|
||||
for(var/thing in loc)
|
||||
// set up the controller
|
||||
var/obj/machinery/embedded_controller/radio/airlock/airlock_controller/controller = thing
|
||||
if(istype(controller))
|
||||
// common controller vars
|
||||
controller.set_frequency(frequency)
|
||||
controller.id_tag = AIRLOCK_MARKER_TAG_MASTER
|
||||
controller.tag_airpump = AIRLOCK_MARKER_TAG_AIRPUMP_CHAMBER
|
||||
controller.tag_chamber_sensor = AIRLOCK_MARKER_TAG_SENSOR_CHAMBER
|
||||
controller.tag_exterior_sensor = AIRLOCK_MARKER_TAG_SENSOR_EXTERIOR
|
||||
controller.tag_exterior_door = AIRLOCK_MARKER_TAG_DOOR_EXTERIOR
|
||||
controller.tag_interior_door = AIRLOCK_MARKER_TAG_DOOR_INTERIOR
|
||||
controller.cycle_to_external_air = cycle_to_external_air
|
||||
controller.req_access = req_access
|
||||
controller.req_one_access = req_one_access
|
||||
// controller subtype specific vars
|
||||
controller.program = new /datum/computer/file/embedded_program/airlock(controller)
|
||||
continue
|
||||
|
||||
// and all the other airlock components
|
||||
|
||||
var/obj/machinery/door/airlock/door = thing
|
||||
if(istype(door))
|
||||
door.set_frequency(frequency)
|
||||
door.req_access = req_access
|
||||
door.req_one_access = req_one_access
|
||||
door.lock()
|
||||
if(is_interior)
|
||||
door.id_tag = AIRLOCK_MARKER_TAG_DOOR_INTERIOR
|
||||
else if(is_exterior)
|
||||
door.id_tag = AIRLOCK_MARKER_TAG_DOOR_EXTERIOR
|
||||
continue
|
||||
|
||||
var/obj/machinery/airlock_sensor/sensor = thing
|
||||
if(istype(sensor))
|
||||
sensor.set_frequency(frequency)
|
||||
sensor.master_tag = AIRLOCK_MARKER_TAG_MASTER
|
||||
if(is_interior)
|
||||
sensor.id_tag = AIRLOCK_MARKER_TAG_SENSOR_INTERIOR
|
||||
else if(is_exterior)
|
||||
sensor.id_tag = AIRLOCK_MARKER_TAG_SENSOR_EXTERIOR
|
||||
else
|
||||
sensor.id_tag = AIRLOCK_MARKER_TAG_SENSOR_CHAMBER
|
||||
continue
|
||||
|
||||
var/obj/machinery/atmospherics/unary/vent_pump/pump = thing
|
||||
if(istype(pump))
|
||||
pump.frequency = frequency
|
||||
unregister_radio(pump, frequency)
|
||||
pump.setup_radio()
|
||||
if(is_exterior)
|
||||
pump.id_tag = AIRLOCK_MARKER_TAG_AIRPUMP_OUT_EXTERNAL
|
||||
else if(is_out)
|
||||
pump.id_tag = AIRLOCK_MARKER_TAG_AIRPUMP_OUT_INTERNAL
|
||||
else
|
||||
pump.id_tag = AIRLOCK_MARKER_TAG_AIRPUMP_CHAMBER
|
||||
continue
|
||||
|
||||
var/obj/machinery/access_button/button = thing
|
||||
if(istype(button))
|
||||
button.set_frequency(frequency)
|
||||
button.master_tag = AIRLOCK_MARKER_TAG_MASTER
|
||||
button.req_access = req_access
|
||||
button.req_one_access = req_one_access
|
||||
if(is_interior)
|
||||
button.command = "cycle_interior"
|
||||
else if(is_exterior)
|
||||
button.command = "cycle_exterior"
|
||||
continue
|
||||
@@ -0,0 +1,117 @@
|
||||
|
||||
/// Docking airlock marker that, when placed above airlock components, actually sets them up to make it functional.
|
||||
/// This is a docking airlock, meaning it is connected to a shuttle landmark object.
|
||||
/// When some shuttle arrives at that landmark, the actual docking may commence, with the doors of the airlock automatically opening, etc.
|
||||
/// This is the station/ship side of that docking (the other being the shuttle).
|
||||
/obj/effect/map_effect/marker/airlock/docking
|
||||
name = "docking airlock marker"
|
||||
icon = 'icons/effects/map_effects.dmi'
|
||||
icon_state = "marker_airlock_docking"
|
||||
layer = LIGHTING_LAYER
|
||||
|
||||
/// Radio frequency of this airlock.
|
||||
/// For docking airlocks, the frequency of docking port airlock and the shuttle airlock needs to match,
|
||||
/// otherwise they can't "talk", and the docking will never actually happen.
|
||||
/// Keep 1380 as default frequency, to maximize compatibility between various shuttles and docks.
|
||||
frequency = 1380
|
||||
|
||||
/// Unique tag for this airlock. Not visible in game and to the player. Do not leave this as null.
|
||||
/// THIS MUST BE UNIQUE FOR THE AIRLOCK. Every marker in one airlock should have the same `master_tag`.
|
||||
/// Different airlocks, even on different maps, cannot share the same `master_tag`.
|
||||
/// This must be the same as the `docking_controller` tag in the shuttle landmark object.
|
||||
master_tag = null
|
||||
|
||||
/// Tag of the shuttle landmark, that this docking port is supposed to be connected to.
|
||||
/// Same as `landmark_tag` var of the shuttle landmark object, and same as the key for `registered_shuttle_landmarks` in shuttle subsystem.
|
||||
var/landmark_tag = null
|
||||
|
||||
/obj/effect/map_effect/marker/airlock/docking/LateInitialize()
|
||||
if(!master_tag || !frequency || !landmark_tag)
|
||||
return
|
||||
|
||||
var/is_interior = locate(/obj/effect/map_effect/marker_helper/airlock/interior) in loc
|
||||
var/is_exterior = locate(/obj/effect/map_effect/marker_helper/airlock/exterior) in loc
|
||||
var/is_out = locate(/obj/effect/map_effect/marker_helper/airlock/out) in loc
|
||||
|
||||
// iterate over airlock components under this marker
|
||||
// and actually set them up
|
||||
for(var/thing in loc)
|
||||
// set up the controller
|
||||
var/obj/machinery/embedded_controller/radio/airlock/docking_port/controller = thing
|
||||
if(istype(controller))
|
||||
// common controller vars
|
||||
controller.set_frequency(frequency)
|
||||
controller.id_tag = AIRLOCK_MARKER_TAG_MASTER
|
||||
controller.tag_airpump = AIRLOCK_MARKER_TAG_AIRPUMP_CHAMBER
|
||||
controller.tag_chamber_sensor = AIRLOCK_MARKER_TAG_SENSOR_CHAMBER
|
||||
controller.tag_exterior_sensor = AIRLOCK_MARKER_TAG_SENSOR_EXTERIOR
|
||||
controller.tag_exterior_door = AIRLOCK_MARKER_TAG_DOOR_EXTERIOR
|
||||
controller.tag_interior_door = AIRLOCK_MARKER_TAG_DOOR_INTERIOR
|
||||
controller.cycle_to_external_air = cycle_to_external_air
|
||||
controller.req_access = req_access
|
||||
controller.req_one_access = req_one_access
|
||||
// controller subtype specific vars
|
||||
controller.airlock_program = new /datum/computer/file/embedded_program/airlock/docking(controller)
|
||||
controller.docking_program = new /datum/computer/file/embedded_program/docking/airlock(controller, controller.airlock_program)
|
||||
controller.program = controller.docking_program
|
||||
if(SSshuttle.registered_shuttle_landmarks[landmark_tag])
|
||||
var/obj/effect/shuttle_landmark/landmark = SSshuttle.registered_shuttle_landmarks[landmark_tag]
|
||||
landmark.docking_controller = SSshuttle.docking_registry[AIRLOCK_MARKER_TAG_MASTER]
|
||||
continue
|
||||
|
||||
var/obj/effect/shuttle_landmark/landmark = thing
|
||||
if(istype(landmark))
|
||||
if(SSshuttle.docking_registry[AIRLOCK_MARKER_TAG_MASTER])
|
||||
landmark.docking_controller = SSshuttle.docking_registry[AIRLOCK_MARKER_TAG_MASTER]
|
||||
continue
|
||||
|
||||
// and all the other airlock components
|
||||
|
||||
var/obj/machinery/door/airlock/door = thing
|
||||
if(istype(door))
|
||||
door.set_frequency(frequency)
|
||||
door.req_access = req_access
|
||||
door.req_one_access = req_one_access
|
||||
door.lock()
|
||||
if(is_interior)
|
||||
door.id_tag = AIRLOCK_MARKER_TAG_DOOR_INTERIOR
|
||||
else if(is_exterior)
|
||||
door.id_tag = AIRLOCK_MARKER_TAG_DOOR_EXTERIOR
|
||||
continue
|
||||
|
||||
var/obj/machinery/airlock_sensor/sensor = thing
|
||||
if(istype(sensor))
|
||||
sensor.set_frequency(frequency)
|
||||
sensor.master_tag = AIRLOCK_MARKER_TAG_MASTER
|
||||
if(is_interior)
|
||||
sensor.id_tag = AIRLOCK_MARKER_TAG_SENSOR_INTERIOR
|
||||
else if(is_exterior)
|
||||
sensor.id_tag = AIRLOCK_MARKER_TAG_SENSOR_EXTERIOR
|
||||
else
|
||||
sensor.id_tag = AIRLOCK_MARKER_TAG_SENSOR_CHAMBER
|
||||
continue
|
||||
|
||||
var/obj/machinery/atmospherics/unary/vent_pump/pump = thing
|
||||
if(istype(pump))
|
||||
pump.frequency = frequency
|
||||
unregister_radio(pump, frequency)
|
||||
pump.setup_radio()
|
||||
if(is_exterior)
|
||||
pump.id_tag = AIRLOCK_MARKER_TAG_AIRPUMP_OUT_EXTERNAL
|
||||
else if(is_out)
|
||||
pump.id_tag = AIRLOCK_MARKER_TAG_AIRPUMP_OUT_INTERNAL
|
||||
else
|
||||
pump.id_tag = AIRLOCK_MARKER_TAG_AIRPUMP_CHAMBER
|
||||
continue
|
||||
|
||||
var/obj/machinery/access_button/button = thing
|
||||
if(istype(button))
|
||||
button.set_frequency(frequency)
|
||||
button.master_tag = AIRLOCK_MARKER_TAG_MASTER
|
||||
button.req_access = req_access
|
||||
button.req_one_access = req_one_access
|
||||
if(is_interior)
|
||||
button.command = "cycle_interior"
|
||||
else if(is_exterior)
|
||||
button.command = "cycle_exterior"
|
||||
continue
|
||||
@@ -0,0 +1,28 @@
|
||||
/obj/effect/map_effect/marker_helper
|
||||
name = "map marker helper parent abstract object"
|
||||
icon = 'icons/effects/map_effects.dmi'
|
||||
icon_state = "marker_base"
|
||||
|
||||
/// Specialization helper for the airlock marker. By itself does nothing.
|
||||
/// To be put above "exterior" components of the airlock, and on top of the actual airlock marker.
|
||||
/obj/effect/map_effect/marker_helper/airlock/exterior
|
||||
name = "airlock marker helper (exterior/outside/vacuum)"
|
||||
icon = 'icons/effects/map_effects.dmi'
|
||||
icon_state = "marker_helper_airlock_exterior"
|
||||
layer = LIGHTING_LAYER
|
||||
|
||||
/// Specialization helper for the airlock marker, to be put above "interior" parts of the airlock,
|
||||
/// and on top of the actual airlock marker. By itself does nothing.
|
||||
/obj/effect/map_effect/marker_helper/airlock/interior
|
||||
name = "airlock marker helper (interior/inside/pressurized)"
|
||||
icon = 'icons/effects/map_effects.dmi'
|
||||
icon_state = "marker_helper_airlock_interior"
|
||||
layer = LIGHTING_LAYER
|
||||
|
||||
/// Specialization helper for the airlock marker, to be put above the out pump of the airlock,
|
||||
/// and on top of the actual airlock marker. By itself does nothing.
|
||||
/obj/effect/map_effect/marker_helper/airlock/out
|
||||
name = "airlock marker helper (chamber, out pump)"
|
||||
icon = 'icons/effects/map_effects.dmi'
|
||||
icon_state = "marker_helper_airlock_out"
|
||||
layer = LIGHTING_LAYER
|
||||
@@ -0,0 +1,111 @@
|
||||
|
||||
/// Docking airlock marker that, when placed above airlock components, actually sets them up to make it functional.
|
||||
/// This is a docking airlock specialized for shuttles, and is connected to a shuttle datum.
|
||||
/// When that shuttle arrives at some landmark, the actual docking may commence, with the doors of the airlock automatically opening, etc.
|
||||
/// This is the shuttle side of that docking (the other being the station/ship).
|
||||
/obj/effect/map_effect/marker/airlock/shuttle
|
||||
name = "shuttle docking airlock marker"
|
||||
icon = 'icons/effects/map_effects.dmi'
|
||||
icon_state = "marker_airlock_shuttle"
|
||||
layer = LIGHTING_LAYER
|
||||
|
||||
/// Radio frequency of this airlock.
|
||||
/// For docking airlocks, the frequency of docking port airlock and the shuttle airlock needs to match,
|
||||
/// otherwise they can't "talk", and the docking will never actually happen (meaning the automatic opening/closing of doors).
|
||||
/// Keep 1380 as default frequency, to maximize compatibility between various shuttles and docks.
|
||||
frequency = 1380
|
||||
|
||||
/// Unique tag for this airlock. Not visible in game and to the player. Do not leave this as null.
|
||||
/// THIS MUST BE UNIQUE FOR THE AIRLOCK. Every marker in one airlock should have the same `master_tag`.
|
||||
/// Different airlocks, even on different maps, cannot share the same `master_tag`.
|
||||
/// This must be the same as the `dock_target` tag in the shuttle datum.
|
||||
master_tag = null
|
||||
|
||||
/// Tag of the shuttle, that this docking port is supposed to be connected to.
|
||||
/// Same as `name` var of the shuttle datum, and same as the key for `shuttles` in shuttle subsystem.
|
||||
var/shuttle_tag = null
|
||||
|
||||
/obj/effect/map_effect/marker/airlock/shuttle/LateInitialize()
|
||||
if(!master_tag || !frequency || !shuttle_tag)
|
||||
return
|
||||
|
||||
var/is_interior = locate(/obj/effect/map_effect/marker_helper/airlock/interior) in loc
|
||||
var/is_exterior = locate(/obj/effect/map_effect/marker_helper/airlock/exterior) in loc
|
||||
var/is_out = locate(/obj/effect/map_effect/marker_helper/airlock/out) in loc
|
||||
|
||||
// iterate over airlock components under this marker
|
||||
// and actually set them up
|
||||
for(var/thing in loc)
|
||||
// set up the controller
|
||||
var/obj/machinery/embedded_controller/radio/airlock/docking_port/controller = thing
|
||||
if(istype(controller))
|
||||
// common controller vars
|
||||
controller.set_frequency(frequency)
|
||||
controller.id_tag = AIRLOCK_MARKER_TAG_MASTER
|
||||
controller.tag_airpump = AIRLOCK_MARKER_TAG_AIRPUMP_CHAMBER
|
||||
controller.tag_chamber_sensor = AIRLOCK_MARKER_TAG_SENSOR_CHAMBER
|
||||
controller.tag_exterior_sensor = AIRLOCK_MARKER_TAG_SENSOR_EXTERIOR
|
||||
controller.tag_exterior_door = AIRLOCK_MARKER_TAG_DOOR_EXTERIOR
|
||||
controller.tag_interior_door = AIRLOCK_MARKER_TAG_DOOR_INTERIOR
|
||||
controller.cycle_to_external_air = cycle_to_external_air
|
||||
controller.req_access = req_access
|
||||
controller.req_one_access = req_one_access
|
||||
// controller subtype specific vars
|
||||
controller.airlock_program = new /datum/computer/file/embedded_program/airlock/docking(controller)
|
||||
controller.docking_program = new /datum/computer/file/embedded_program/docking/airlock(controller, controller.airlock_program)
|
||||
controller.program = controller.docking_program
|
||||
if(SSshuttle.shuttles[shuttle_tag])
|
||||
var/datum/shuttle/autodock/shuttle = SSshuttle.shuttles[shuttle_tag]
|
||||
shuttle.dock_target = AIRLOCK_MARKER_TAG_MASTER
|
||||
continue
|
||||
|
||||
// and all the other airlock components
|
||||
|
||||
var/obj/machinery/door/airlock/door = thing
|
||||
if(istype(door))
|
||||
door.set_frequency(frequency)
|
||||
door.req_access = req_access
|
||||
door.req_one_access = req_one_access
|
||||
door.lock()
|
||||
if(is_interior)
|
||||
door.id_tag = AIRLOCK_MARKER_TAG_DOOR_INTERIOR
|
||||
else if(is_exterior)
|
||||
door.id_tag = AIRLOCK_MARKER_TAG_DOOR_EXTERIOR
|
||||
continue
|
||||
|
||||
var/obj/machinery/airlock_sensor/sensor = thing
|
||||
if(istype(sensor))
|
||||
sensor.set_frequency(frequency)
|
||||
sensor.master_tag = AIRLOCK_MARKER_TAG_MASTER
|
||||
if(is_interior)
|
||||
sensor.id_tag = AIRLOCK_MARKER_TAG_SENSOR_INTERIOR
|
||||
else if(is_exterior)
|
||||
sensor.id_tag = AIRLOCK_MARKER_TAG_SENSOR_EXTERIOR
|
||||
else
|
||||
sensor.id_tag = AIRLOCK_MARKER_TAG_SENSOR_CHAMBER
|
||||
continue
|
||||
|
||||
var/obj/machinery/atmospherics/unary/vent_pump/pump = thing
|
||||
if(istype(pump))
|
||||
pump.frequency = frequency
|
||||
unregister_radio(pump, frequency)
|
||||
pump.setup_radio()
|
||||
if(is_exterior)
|
||||
pump.id_tag = AIRLOCK_MARKER_TAG_AIRPUMP_OUT_EXTERNAL
|
||||
else if(is_out)
|
||||
pump.id_tag = AIRLOCK_MARKER_TAG_AIRPUMP_OUT_INTERNAL
|
||||
else
|
||||
pump.id_tag = AIRLOCK_MARKER_TAG_AIRPUMP_CHAMBER
|
||||
continue
|
||||
|
||||
var/obj/machinery/access_button/button = thing
|
||||
if(istype(button))
|
||||
button.set_frequency(frequency)
|
||||
button.master_tag = AIRLOCK_MARKER_TAG_MASTER
|
||||
button.req_access = req_access
|
||||
button.req_one_access = req_one_access
|
||||
if(is_interior)
|
||||
button.command = "cycle_interior"
|
||||
else if(is_exterior)
|
||||
button.command = "cycle_exterior"
|
||||
continue
|
||||
@@ -4,7 +4,8 @@
|
||||
var/in_use = null //tells the controller whether this shuttle needs processing, also attempts to prevent double-use
|
||||
var/last_dock_attempt_time = 0
|
||||
var/current_dock_target
|
||||
//ID of the controller on the shuttle
|
||||
|
||||
/// `id_tag`/`master_tag` of the docking controller of this shuttle.
|
||||
var/dock_target = null
|
||||
|
||||
var/obj/effect/shuttle_landmark/next_location
|
||||
|
||||
Reference in New Issue
Block a user