Files
CHOMPStation2/code/controllers/shuttle_controller.dm
Neerti d0d6689263 Web Shuttle Update
Adds autopilot functionality for shuttle one and shuttle two. It can be enabled and disabled by the flight computer.
Autopilot is active by default on both shuttles. The shuttle waits for two minutes when it reaches the outpost or station, except for the first flight, where it waits for about ten minutes, which should be plenty of time for people to get on and for the pilot to turn it off if one exists.
Adds renaming feature to all shuttles.
Ports /tg/'s 'shuttle warning' effect, which adds a bunch of blue circles where a ship is about to land, which should prevent surprise shuttle crushes if paying attention.
Flight times for all routes are cut in half to act as the bonus for flying manually. Automatic flight takes twice as long, and so it will take the current amount of time.
Makes Ninja shuttle faster because Nippen steal.
Does some cleanup with temporary effects.
2018-01-14 14:03:58 -05:00

40 lines
1.4 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/shuttle in process_shuttles)
if(istype(shuttle, /datum/shuttle/ferry))
var/datum/shuttle/ferry/F = shuttle
if(F.process_state || F.always_process)
F.process()
else
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()