Replaced "area" shuttles with "landmark" shuttles.

Largely ported from the work done at Baystation in https://github.com/Baystation12/Baystation12/pull/17460 and later commits.

 - Shuttles no longer require a separate area for each location they jump to.
   Instead destinations are indicated by landmark objects, which are not necessarily exclusive to that shuttle.
   This means that more than one shuttle could use the same docking port (not at the same time of course).
 - Enhanced shuttle control computers to use nanoui if they didn't.
 - Organizes shuttle datum code a bit better so there is less re-inventing the wheel in subtypes.
 - Allows the possibility of shuttles (or destinations) that start on late-loaded maps.
 - Deprecate the "extra" shuttle areas that are no longer needed and update shuttle areas in unit tests

This all required a bit of infrastructure improvements.

 - ChangeArea proc, for changing the area of a turf.
 - Fixed lighting overlays actually being able to be destroyed.
 - Added a few utility macros and procs.
 - Added "turf translation" procs which are like move_contents_to but more flexible.
This commit is contained in:
Leshana
2020-02-28 16:23:51 -05:00
parent caeb0de720
commit c837078105
69 changed files with 2474 additions and 1451 deletions

View File

@@ -2,21 +2,15 @@
//this is the master controller, that things will try to dock with.
/obj/machinery/embedded_controller/radio/docking_port_multi
name = "docking port controller"
program = /datum/computer/file/embedded_program/docking/multi
var/child_tags_txt
var/child_names_txt
var/list/child_names = list()
var/datum/computer/file/embedded_program/docking/multi/docking_program
/obj/machinery/embedded_controller/radio/docking_port_multi/Initialize()
. = ..()
docking_program = new/datum/computer/file/embedded_program/docking/multi(src)
program = docking_program
var/list/names = splittext(child_names_txt, ";")
var/list/tags = splittext(child_tags_txt, ";")
if (names.len == tags.len)
for (var/i = 1; i <= tags.len; i++)
child_names[tags[i]] = names[i]
@@ -24,6 +18,7 @@
/obj/machinery/embedded_controller/radio/docking_port_multi/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
var/data[0]
var/datum/computer/file/embedded_program/docking/multi/docking_program = program // Cast to proper type
var/list/airlocks[child_names.len]
var/i = 1
@@ -44,24 +39,21 @@
ui.set_auto_update(1)
/obj/machinery/embedded_controller/radio/docking_port_multi/Topic(href, href_list)
return
return 1 // Apparently we swallow all input (this is corrected legacy code)
//a docking port based on an airlock
// This is the actual controller that will be commanded by the master defined above
/obj/machinery/embedded_controller/radio/airlock/docking_port_multi
name = "docking port controller"
program = /datum/computer/file/embedded_program/airlock/multi_docking
var/master_tag //for mapping
var/datum/computer/file/embedded_program/airlock/multi_docking/airlock_program
tag_secure = 1
/obj/machinery/embedded_controller/radio/airlock/docking_port_multi/Initialize()
. = ..()
airlock_program = new/datum/computer/file/embedded_program/airlock/multi_docking(src)
program = airlock_program
/obj/machinery/embedded_controller/radio/airlock/docking_port_multi/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
var/data[0]
var/datum/computer/file/embedded_program/airlock/multi_docking/airlock_program // Cast to proper type
data = list(
"chamber_pressure" = round(airlock_program.memory["chamber_sensor_pressure"]),
@@ -82,12 +74,9 @@
ui.set_auto_update(1)
/obj/machinery/embedded_controller/radio/airlock/docking_port_multi/Topic(href, href_list)
if(..())
if((. = ..()))
return
usr.set_machine(src)
src.add_fingerprint(usr)
var/clean = 0
switch(href_list["command"]) //anti-HTML-hacking checks
if("cycle_ext")