Refactors shuttles to be loaded in, rather than be on the station maps (#33766)

* Refactors shuttles to be loaded in, rather than be on the station maps

- Shuttles are now loaded in by the shuttle subsystem.

You configure what shuttles are loaded in via
`/obj/configuration/shuttle_load` objects.

* Box arrivals shuttle is now imported from template

* Moves things out of the #ifdef

* Box emergency shuttle is now imported

* Box emergency shuttle is now templated

* Box ferry and whiteship now load from template

* More shuttles on Box done

* Apart from the pods, Box is now completely templated

* Delta now has all non-awkward shuttles loaded in

And Centcom..

* Removes no ops turfs, more error messages

* Fixes slightly chopped off external wall

* Massaging more shuttles into working correctly

* Debug messages are king

* Delta cargo shuttle now docks again

* First pass of Metastation shuttles

* Omegastation first pass

* Metastation now has its own shuttle

* Did most shuttles on Pubby

* Turns out Pubby arrival shuttle is slightly smaller than Box arrival

* Whoops, missed a stationary port

* TGMified the pubby arrival shuttle

* First pass, box is working

* All stations now have roundstart_template and no configuration objects

* Removes roundstart_move

* Why do we even have these unused keys

* Remove unused coded vars

* removes some excessive safety checks

* Missed some Centcom cargo dock stuff

* Got it working again

* That thing that Cyberboss wanted

* Noop turfs the shuttle templates

* And template noop for the area

* Attempts to assuage travis

* Warning!

* Please love me, Travis

* RIP Remie
This commit is contained in:
coiax
2018-01-25 15:18:15 -05:00
committed by Emmett Gaines
parent 9a99ff4e72
commit 8e20aa3f7b
43 changed files with 10218 additions and 5211 deletions
+9 -14
View File
@@ -11,8 +11,6 @@
callTime = INFINITY
ignitionTime = 50
roundstart_move = TRUE //force a call to dockRoundstart
var/sound_played
var/damaged //too damaged to undock?
var/list/areas //areas in our shuttle
@@ -22,16 +20,20 @@
var/perma_docked = FALSE //highlander with RESPAWN??? OH GOD!!!
/obj/docking_port/mobile/arrivals/Initialize(mapload)
if(SSshuttle.arrivals)
WARNING("More than one arrivals docking_port placed on map!")
return INITIALIZE_HINT_QDEL
SSshuttle.arrivals = src
if(!timid)
register()
. = ..()
preferred_direction = dir
return INITIALIZE_HINT_LATELOAD //for latejoin list
/obj/docking_port/mobile/arrivals/register()
..()
if(SSshuttle.arrivals)
WARNING("More than one arrivals docking_port placed on map! Ignoring duplicates.")
SSshuttle.arrivals = src
/obj/docking_port/mobile/arrivals/LateInitialize()
areas = list()
@@ -54,13 +56,6 @@
SSjob.latejoin_trackers = new_latejoin
/obj/docking_port/mobile/arrivals/dockRoundstart()
SSshuttle.generate_transit_dock(src)
Launch()
timer = world.time
check()
return TRUE
/obj/docking_port/mobile/arrivals/check()
. = ..()
-2
View File
@@ -184,7 +184,6 @@
height = 11
dir = EAST
port_direction = WEST
roundstart_move = "emergency_away"
var/sound_played = 0 //If the launch sound has been sent to all players on the shuttle itself
/obj/docking_port/mobile/emergency/canDock(obj/docking_port/stationary/S)
@@ -537,7 +536,6 @@
width = 8
height = 8
dir = EAST
roundstart_move = "backup_away"
/obj/docking_port/mobile/emergency/backup/Initialize()
// We want to be a valid emergency shuttle
+16 -10
View File
@@ -23,6 +23,14 @@
/obj/machinery/shuttle_manipulator/Initialize()
. = ..()
update_icon()
SSshuttle.manipulator = src
/obj/machinery/shuttle_manipulator/Destroy(force)
if(!force)
. = QDEL_HINT_LETMELIVE
else
SSshuttle.manipulator = null
. = ..()
/obj/machinery/shuttle_manipulator/update_icon()
cut_overlays()
@@ -182,8 +190,7 @@
update_icon()
/obj/machinery/shuttle_manipulator/proc/action_load(
datum/map_template/shuttle/loading_template)
/obj/machinery/shuttle_manipulator/proc/action_load(datum/map_template/shuttle/loading_template, obj/docking_port/stationary/destination_port)
// Check for an existing preview
if(preview_shuttle && (loading_template != preview_template))
preview_shuttle.jumpToNullSpace()
@@ -199,16 +206,15 @@
var/mode = SHUTTLE_IDLE
var/obj/docking_port/stationary/D
if(existing_shuttle)
if(istype(destination_port))
D = destination_port
else if(existing_shuttle)
timer = existing_shuttle.timer
mode = existing_shuttle.mode
D = existing_shuttle.get_docked()
else
D = preview_shuttle.findRoundstartDock()
if(!D)
var/m = "No dock found for preview shuttle, aborting."
WARNING(m)
var/m = "No dock found for preview shuttle ([preview_template.name]), aborting."
throw EXCEPTION(m)
var/result = preview_shuttle.canDock(D)
@@ -216,11 +222,11 @@
// but we can ignore the someone else docked error because we'll
// be moving into their place shortly
if((result != SHUTTLE_CAN_DOCK) && (result != SHUTTLE_SOMEONE_ELSE_DOCKED))
var/m = "Unsuccessful dock of [preview_shuttle] ([result])."
WARNING(m)
WARNING("Template shuttle [preview_shuttle] cannot dock at [D] ([result]).")
return
existing_shuttle.jumpToNullSpace()
if(existing_shuttle)
existing_shuttle.jumpToNullSpace()
preview_shuttle.initiate_docking(D)
. = preview_shuttle
+26 -9
View File
@@ -167,6 +167,9 @@
var/last_dock_time
var/datum/map_template/shuttle/roundstart_template
var/json_key
/obj/docking_port/stationary/Initialize(mapload)
. = ..()
SSshuttle.stationary += src
@@ -184,6 +187,22 @@
highlight("#f00")
#endif
/obj/docking_port/stationary/proc/load_roundstart()
if(json_key)
var/sid = SSmapping.config.shuttles[json_key]
roundstart_template = SSmapping.shuttle_templates[sid]
if(!roundstart_template)
CRASH("json_key:[json_key] value \[[sid]\] resulted in a null shuttle template for [src]")
else if(roundstart_template) // passed a PATH
var/sid = "[initial(roundstart_template.port_id)]_[initial(roundstart_template.suffix)]"
roundstart_template = SSmapping.shuttle_templates[sid]
if(!roundstart_template)
CRASH("Invalid path ([roundstart_template]) passed to docking port.")
if(roundstart_template)
SSshuttle.manipulator.action_load(roundstart_template, src)
//returns first-found touching shuttleport
/obj/docking_port/stationary/get_docked()
. = locate(/obj/docking_port/mobile) in loc
@@ -234,7 +253,6 @@
var/mode = SHUTTLE_IDLE //current shuttle mode
var/callTime = 100 //time spent in transit (deciseconds). Should not be lower then 10 seconds without editing the animation of the hyperspace ripples.
var/ignitionTime = 55 // time spent "starting the engines". Also rate limits how often we try to reserve transit space if its ever full of transiting shuttles.
var/roundstart_move //id of port to send shuttle to at roundstart
// The direction the shuttle prefers to travel in
var/preferred_direction = NORTH
@@ -251,8 +269,9 @@
var/list/movement_force = list("KNOCKDOWN" = 3, "THROW" = 2)
// A timid shuttle will not register itself with the shuttle subsystem
// All shuttle templates are timid
var/timid = FALSE
// All shuttle templates MUST be timid, imports will fail if they're not
// Shuttle defined already on the map MUST NOT be timid, or they won't work
var/timid = TRUE
var/list/ripples = list()
var/engine_coeff = 1 //current engine coeff
@@ -473,12 +492,6 @@
for(var/obj/machinery/door/poddoor/shuttledock/pod in GLOB.airlocks)
pod.check()
/obj/docking_port/mobile/proc/findRoundstartDock()
return SSshuttle.getDock(roundstart_move)
/obj/docking_port/mobile/proc/dockRoundstart()
. = dock_id(roundstart_move)
/obj/docking_port/mobile/proc/dock_id(id)
var/port = SSshuttle.getDock(id)
if(port)
@@ -489,6 +502,10 @@
/obj/effect/landmark/shuttle_import
name = "Shuttle Import"
// Never move the shuttle import landmark, otherwise things get WEIRD
/obj/effect/landmark/shuttle_import/onShuttleMove()
return FALSE
//used by shuttle subsystem to check timers
/obj/docking_port/mobile/proc/check()
check_effects()
-1
View File
@@ -34,7 +34,6 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list(
width = 12
dwidth = 5
height = 7
roundstart_move = "supply_away"
// When TRUE, these vars allow exporting emagged/contraband items, and add some special interactions to existing exports.
var/contraband = FALSE