This commit is contained in:
Aurorablade
2016-07-28 23:47:05 -04:00
parent 13e7b9d248
commit 9735ff78ac
14 changed files with 456 additions and 24 deletions
+19 -4
View File
@@ -9,6 +9,7 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12
//emergency shuttle stuff
var/obj/docking_port/mobile/emergency/emergency
var/obj/docking_port/mobile/emergency/backup/backup_shuttle
var/emergencyCallTime = 6000 //time taken for emergency shuttle to reach the station when called (in deciseconds)
var/emergencyDockTime = 1800 //time taken for emergency shuttle to leave again once it has docked (in deciseconds)
var/emergencyEscapeTime = 1200 //time taken for emergency shuttle to reach a safe distance after leaving station (in deciseconds)
@@ -49,6 +50,8 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12
if(!emergency)
WARNING("No /obj/docking_port/mobile/emergency placed on the map!")
if(!backup_shuttle)
WARNING("No /obj/docking_port/mobile/emergency/backup placed on the map!")
if(!supply)
WARNING("No /obj/docking_port/mobile/supply placed on the map!")
@@ -88,8 +91,11 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12
/datum/controller/process/shuttle/proc/requestEvac(mob/user, call_reason)
if(!emergency)
throw EXCEPTION("requestEvac(): There is no emergency shuttle! The game will be unresolvable. This is likely due to a mapping error")
return
WARNING("requestEvac(): There is no emergency shuttle, but the shuttle was called. Using the backup shuttle instead.")
if(!backup_shuttle)
throw EXCEPTION("requestEvac(): There is no emergency shuttle, or backup shuttle! The game will be unresolvable. This is likely due to a mapping error")
return
emergency = backup_shuttle
if(world.time - round_start_time < config.shuttle_refuel_delay)
to_chat(user, "The emergency shuttle is refueling. Please wait another [abs(round(((world.time - round_start_time) - config.shuttle_refuel_delay)/600))] minutes before trying again.")
@@ -130,6 +136,14 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12
return
// Called when an emergency shuttle mobile docking port is
// destroyed, which will only happen with admin intervention
/datum/controller/process/shuttle/proc/emergencyDeregister()
// When a new emergency shuttle is created, it will override the
// backup shuttle.
emergency = backup_shuttle
/datum/controller/process/shuttle/proc/cancelEvac(mob/user)
if(canRecall())
emergency.cancel(get_area(user))
@@ -194,13 +208,14 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12
/datum/controller/process/shuttle/proc/moveShuttle(shuttleId, dockId, timed)
var/obj/docking_port/mobile/M = getShuttle(shuttleId)
var/obj/docking_port/stationary/D = getDock(dockId)
if(!M)
return 1
if(timed)
if(M.request(getDock(dockId)))
if(M.request(D))
return 2
else
if(M.dock(getDock(dockId)))
if(M.dock(D))
return 2
return 0 //dock successful