Adds escape pod docking controller type

Escape pods now no longer launch automatically during regular crew
transfers. However they can be set to launch during a regular crew
transfer by emagging the escape pod controller.

Also fixes emergency shuttle arrival announcement having the wrong ETD.
This commit is contained in:
mwerezak
2014-06-25 12:32:12 -04:00
parent c44ac554dd
commit d5c5d4b21f
7 changed files with 227 additions and 84 deletions

View File

@@ -18,53 +18,6 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
var/deny_shuttle = 0 //allows admins to prevent the shuttle from being called
var/departed = 0 //if the shuttle has left the station at least once
/datum/emergency_shuttle_controller/proc/setup_pods()
escape_pods = list()
var/datum/shuttle/ferry/escape_pod/pod
pod = new()
pod.location = 0
pod.warmup_time = 0
pod.area_station = locate(/area/shuttle/escape_pod1/station)
pod.area_offsite = locate(/area/shuttle/escape_pod1/centcom)
pod.area_transition = locate(/area/shuttle/escape_pod1/transit)
pod.transit_direction = NORTH
pod.move_time = SHUTTLE_TRANSIT_DURATION_RETURN
escape_pods += pod
pod = new()
pod.location = 0
pod.warmup_time = 0
pod.area_station = locate(/area/shuttle/escape_pod2/station)
pod.area_offsite = locate(/area/shuttle/escape_pod2/centcom)
pod.area_transition = locate(/area/shuttle/escape_pod2/transit)
pod.transit_direction = NORTH
pod.move_time = SHUTTLE_TRANSIT_DURATION_RETURN
escape_pods += pod
pod = new()
pod.location = 0
pod.warmup_time = 0
pod.area_station = locate(/area/shuttle/escape_pod3/station)
pod.area_offsite = locate(/area/shuttle/escape_pod3/centcom)
pod.area_transition = locate(/area/shuttle/escape_pod3/transit)
pod.transit_direction = EAST
pod.move_time = SHUTTLE_TRANSIT_DURATION_RETURN
escape_pods += pod
//There is no pod 4, apparently.
pod = new()
pod.location = 0
pod.warmup_time = 0
pod.area_station = locate(/area/shuttle/escape_pod5/station)
pod.area_offsite = locate(/area/shuttle/escape_pod5/centcom)
pod.area_transition = locate(/area/shuttle/escape_pod5/transit)
pod.transit_direction = EAST //should this be WEST? I have no idea.
pod.move_time = SHUTTLE_TRANSIT_DURATION_RETURN
escape_pods += pod
/datum/emergency_shuttle_controller/proc/process()
if (wait_for_launch)
@@ -76,14 +29,29 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
if (!shuttle.location) //leaving from the station
//launch the pods!
for (var/datum/shuttle/ferry/escape_pod/pod in escape_pods)
pod.launch(src)
if (!pod.arming_controller || pod.arming_controller.armed)
pod.launch(src)
if (autopilot)
shuttle.launch(src)
//called when the shuttle has arrived.
/datum/emergency_shuttle_controller/proc/shuttle_arrived()
if (!shuttle.location && autopilot) //at station
set_launch_countdown(SHUTTLE_LEAVETIME) //get ready to return
if (!shuttle.location) //at station
if (autopilot)
set_launch_countdown(SHUTTLE_LEAVETIME) //get ready to return
if (evac)
captain_announce("The Emergency Shuttle has docked with the station. You have approximately [round(estimate_launch_time()/60,1)] minutes to board the Emergency Shuttle.")
world << sound('sound/AI/shuttledock.ogg')
else
captain_announce("The scheduled Crew Transfer Shuttle has docked with the station. It will depart in approximately [round(emergency_shuttle.estimate_launch_time()/60,1)] minutes.")
//arm the escape pods
if (evac)
for (var/datum/shuttle/ferry/escape_pod/pod in escape_pods)
if (pod.arming_controller)
pod.arming_controller.arm()
//begins the launch countdown and sets the amount of time left until launch
/datum/emergency_shuttle_controller/proc/set_launch_countdown(var/seconds)

View File

@@ -30,16 +30,68 @@ var/global/datum/shuttle_controller/shuttle_controller
shuttle.dock_target_station = "escape_dock"
shuttle.dock_target_offsite = "centcom_dock"
shuttle.transit_direction = NORTH
shuttle.move_time = 300
shuttle.move_time = SHUTTLE_TRANSIT_DURATION_RETURN
//shuttle.docking_controller_tag = "supply_shuttle"
//shuttle.dock_target_station = "cargo_bay"
shuttles["Escape"] = shuttle
process_shuttles += shuttle
//give the emergency shuttle controller it's shuttle
emergency_shuttle.shuttle = shuttle
emergency_shuttle.setup_pods()
process_shuttles += emergency_shuttle.escape_pods
shuttle = new/datum/shuttle/ferry/escape_pod()
shuttle.location = 0
shuttle.warmup_time = 0
shuttle.area_station = locate(/area/shuttle/escape_pod1/station)
shuttle.area_offsite = locate(/area/shuttle/escape_pod1/centcom)
shuttle.area_transition = locate(/area/shuttle/escape_pod1/transit)
shuttle.docking_controller_tag = "escape_pod_1"
shuttle.dock_target_station = "escape_pod_bay_1"
shuttle.transit_direction = NORTH
shuttle.move_time = SHUTTLE_TRANSIT_DURATION_RETURN + rand(-30, 60) //randomize this so it seems like the pods are being picked up one by one
process_shuttles += shuttle
shuttles["Escape Pod 1"] = shuttle
shuttle = new/datum/shuttle/ferry/escape_pod()
shuttle.location = 0
shuttle.warmup_time = 0
shuttle.area_station = locate(/area/shuttle/escape_pod2/station)
shuttle.area_offsite = locate(/area/shuttle/escape_pod2/centcom)
shuttle.area_transition = locate(/area/shuttle/escape_pod2/transit)
shuttle.transit_direction = NORTH
shuttle.move_time = SHUTTLE_TRANSIT_DURATION_RETURN + rand(-30, 60) //randomize this so it seems like the pods are being picked up one by one
process_shuttles += shuttle
shuttles["Escape Pod 2"] = shuttle
shuttle = new/datum/shuttle/ferry/escape_pod()
shuttle.location = 0
shuttle.warmup_time = 0
shuttle.area_station = locate(/area/shuttle/escape_pod3/station)
shuttle.area_offsite = locate(/area/shuttle/escape_pod3/centcom)
shuttle.area_transition = locate(/area/shuttle/escape_pod3/transit)
shuttle.transit_direction = EAST
shuttle.move_time = SHUTTLE_TRANSIT_DURATION_RETURN + rand(-30, 60) //randomize this so it seems like the pods are being picked up one by one
process_shuttles += shuttle
shuttles["Escape Pod 3"] = shuttle
//There is no pod 4, apparently.
shuttle = new/datum/shuttle/ferry/escape_pod()
shuttle.location = 0
shuttle.warmup_time = 0
shuttle.area_station = locate(/area/shuttle/escape_pod5/station)
shuttle.area_offsite = locate(/area/shuttle/escape_pod5/centcom)
shuttle.area_transition = locate(/area/shuttle/escape_pod5/transit)
shuttle.transit_direction = EAST //should this be WEST? I have no idea.
shuttle.move_time = SHUTTLE_TRANSIT_DURATION_RETURN + rand(-30, 60) //randomize this so it seems like the pods are being picked up one by one
process_shuttles += shuttle
shuttles["Escape Pod 5"] = shuttle
//give the emergency shuttle controller it's shuttles
emergency_shuttle.shuttle = shuttles["Escape"]
emergency_shuttle.escape_pods = list(
shuttles["Escape Pod 1"],
shuttles["Escape Pod 2"],
shuttles["Escape Pod 3"],
shuttles["Escape Pod 5"],
)
// Supply shuttle
shuttle = new/datum/shuttle/ferry/supply()
@@ -191,6 +243,13 @@ var/global/datum/shuttle_controller/shuttle_controller
multidock = shuttle
dock_controller_map_station[multidock.docking_controller_tag_station] = multidock
dock_controller_map_offsite[multidock.docking_controller_tag_offsite] = multidock
//escape pod arming controllers
var/datum/shuttle/ferry/escape_pod/pod
var/list/pod_controller_map = list()
for (var/datum/shuttle/ferry/escape_pod/P in emergency_shuttle.escape_pods)
if (P.dock_target_station)
pod_controller_map[P.dock_target_station] = P
//search for the controllers, if we have one.
if (dock_controller_map.len)
@@ -210,6 +269,12 @@ var/global/datum/shuttle_controller/shuttle_controller
if (istype(multidock))
multidock.docking_controller_offsite = C.program
dock_controller_map_offsite -= C.id_tag
//escape pods
if (C.id_tag in pod_controller_map)
pod = pod_controller_map[C.id_tag]
if (istype(C.program, /datum/computer/file/embedded_program/docking/simple/escape_pod/))
pod.arming_controller = C.program
//sanity check
if (dock_controller_map.len || dock_controller_map_station.len || dock_controller_map_offsite.len)