mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Arrivals shuttle now moves automatically to and from the station. People still spawn onboard if they join the round with arrivals selected in preferences. The shuttle is completely automated and will go to the station if someone boards it, and leave if nobody is onboard. Changes some tape code so it can be mapped in. Sadly the mapmerger is broken so the map file diff is massive.
36 lines
1.3 KiB
Plaintext
36 lines
1.3 KiB
Plaintext
|
|
var/global/datum/shuttle_controller/shuttle_controller
|
|
|
|
|
|
/datum/shuttle_controller
|
|
var/list/shuttles //maps shuttle tags to shuttle datums, so that they can be looked up.
|
|
var/list/process_shuttles //simple list of shuttles, for processing
|
|
|
|
/datum/shuttle_controller/proc/process()
|
|
//process ferry shuttles
|
|
for (var/datum/shuttle/ferry/shuttle in process_shuttles)
|
|
if (shuttle.process_state || shuttle.always_process)
|
|
shuttle.process()
|
|
|
|
|
|
//This is called by gameticker after all the machines and radio frequencies have been properly initialized
|
|
/datum/shuttle_controller/proc/setup_shuttle_docks()
|
|
// for(var/shuttle_tag in shuttles)
|
|
// var/datum/shuttle/shuttle = shuttles[shuttle_tag]
|
|
for(var/shuttle_type in subtypesof(/datum/shuttle))
|
|
var/datum/shuttle/shuttle = shuttle_type
|
|
if(initial(shuttle.category) == shuttle_type)
|
|
continue
|
|
shuttle = new shuttle()
|
|
shuttle.init_docking_controllers()
|
|
shuttle.dock() //makes all shuttles docked to something at round start go into the docked state
|
|
|
|
for(var/obj/machinery/embedded_controller/C in machines)
|
|
if(istype(C.program, /datum/computer/file/embedded_program/docking))
|
|
C.program.tag = null //clear the tags, 'cause we don't need 'em anymore
|
|
|
|
/datum/shuttle_controller/New()
|
|
shuttles = list()
|
|
process_shuttles = list()
|
|
|