diff --git a/code/datums/shuttle_controller.dm b/code/datums/shuttle_controller.dm
index 251583f11b..d67c7c5505 100644
--- a/code/datums/shuttle_controller.dm
+++ b/code/datums/shuttle_controller.dm
@@ -11,6 +11,8 @@ var/global/datum/shuttle_controller/emergency_shuttle/emergency_shuttle
datum/shuttle_controller
var
+ alert = 0 //0 = emergency, 1 = crew cycle
+
location = 0 //0 = somewhere far away (in spess), 1 = at SS13, 2 = returned from SS13
online = 0
direction = 1 //-1 = going back to central command, 1 = going to SS13, 2 = in transit to centcom (not recalled)
@@ -36,28 +38,35 @@ datum/shuttle_controller
settimeleft(SHUTTLEARRIVETIME*coeff)
online = 1
//turning on the red lights in hallways and siren
- for(var/area/A in world)
- if(istype(A, /area/hallway))
- A.readyalert()
- //sound_siren = 1
+ if(coeff == 1)
+ for(var/area/A in world)
+ if(istype(A, /area/hallway))
+ A.readyalert()
+ //sound_siren = 1
+ proc/shuttlealert(var/X)
+ alert = X
proc/recall()
if(direction == 1)
var/timeleft = timeleft()
- if(timeleft >= 600)
+ if(alert == 0)
+ if(timeleft >= 600)
+ return
+ captain_announce("The emergency shuttle has been recalled.")
+ world << sound('shuttlerecalled.ogg')
+ setdirection(-1)
+ online = 1
+ for(var/area/A in world)
+ if(istype(A, /area/hallway))
+ A.readyreset()
+ return
+ else //makes it possible to send shuttle back.
+ captain_announce("The shuttle has been recalled.")
+ setdirection(-1)
+ online = 1
return
- captain_announce("The emergency shuttle has been recalled.")
- world << sound('shuttlerecalled.ogg')
- setdirection(-1)
- online = 1
- //turning off the red lights in hallways and siren
- for(var/area/A in world)
- if(istype(A, /area/hallway))
- A.readyreset()
- // sound_siren = 0
-
// returns the time (in seconds) before shuttle arrival
// note if direction = -1, gives a count-up to SHUTTLEARRIVETIME
@@ -192,9 +201,11 @@ datum/shuttle_controller
start_location.move_contents_to(end_location)
settimeleft(SHUTTLELEAVETIME)
- captain_announce("The Emergency Shuttle has docked with the station. You have [timeleft()/60] minutes to board the Emergency Shuttle.")
- world << sound('shuttledock.ogg')
-
+ if(alert == 0)
+ captain_announce("The Emergency Shuttle has docked with the station. You have [timeleft()/60] minutes to board the Emergency Shuttle.")
+ world << sound('shuttledock.ogg')
+ else
+ captain_announce("The shuttle has docked with the station. You have [timeleft()/60] minutes to board the shuttle.")
return 1
if(1)
@@ -262,8 +273,10 @@ datum/shuttle_controller
spawn(0)
D.close()
-
- captain_announce("The Emergency Shuttle has left the station. Estimate [timeleft()/60] minutes until the shuttle docks at Central Command.")
+ if(alert == 0)
+ captain_announce("The Emergency Shuttle has left the station. Estimate [timeleft()/60] minutes until the shuttle docks at Central Command.")
+ else
+ captain_announce("The shuttle has left the station. Estimate [timeleft()/60] minutes until the shuttle docks at Central Command.")
// Some aesthetic turbulance shaking
for(var/mob/M in end_location)
diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm
index ab3de514e3..fb4b4e1b2f 100644
--- a/code/game/machinery/computer/communications.dm
+++ b/code/game/machinery/computer/communications.dm
@@ -26,6 +26,7 @@
STATE_STATUSDISPLAY = 7
STATE_ALERT_LEVEL = 8
STATE_CONFIRM_LEVEL = 9
+ STATE_CREWTRANSFER = 10
var/status_display_freq = "1435"
var/stat_msg1
@@ -117,6 +118,16 @@
if(emergency_shuttle.online)
post_status("shuttle")
src.state = STATE_DEFAULT
+ if("crewtransfer")
+ src.state= STATE_DEFAULT
+ if(src.authenticated)
+ src.state = STATE_CREWTRANSFER
+ if("crewtransfer2")
+ if(src.authenticated)
+ init_shift_change(usr) //key difference here
+ if(emergency_shuttle.online)
+ post_status("shuttle")
+ src.state = STATE_DEFAULT
if("cancelshuttle")
src.state = STATE_DEFAULT
if(src.authenticated)
@@ -306,6 +317,7 @@
dat += "
\[ Cancel Shuttle Call \]"
else
dat += "
\[ Call Emergency Shuttle \]"
+ dat += "
\[ Initiate Crew Transfer \]"
dat += "
\[ Set Status Display \]"
else
@@ -313,6 +325,8 @@
dat += "
\[ Message List \]"
if(STATE_CALLSHUTTLE)
dat += "Are you sure you want to call the shuttle? \[ OK | Cancel \]"
+ if(STATE_CREWTRANSFER) // this is the shiftchage screen.
+ dat += "Are you sure you want to initiate a crew transfer? This will call the shuttle. \[ OK | Cancel \]"
if(STATE_CANCELSHUTTLE)
dat += "Are you sure you want to cancel the shuttle? \[ OK | Cancel \]"
if(STATE_MESSAGELIST)
@@ -468,6 +482,7 @@
return
emergency_shuttle.incall()
+ emergency_shuttle.shuttlealert(1)
log_game("[key_name(user)] has called the shuttle.")
message_admins("[key_name_admin(user)] has called the shuttle.", 1)
captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.")
@@ -475,6 +490,46 @@
return
+/proc/init_shift_change(var/mob/user)
+ if ((!( ticker ) || emergency_shuttle.location))
+ return
+
+ if(emergency_shuttle.deny_shuttle)
+ user << "Centcom does not currently have a shuttle available in your sector. Please try again later."
+ return
+
+ if(sent_strike_team == 1)
+ user << "Centcom will not allow the shuttle to be called. Consider all contracts terminated."
+ return
+
+ if(world.time < 54000) // 30 minute grace period to let the game get going
+ user << "The shuttle is refueling. Please wait another [round((54000-world.time)/600)] minutes before trying again."//may need to change "/600"
+ return
+
+ if(emergency_shuttle.direction == -1)
+ user << "The shuttle may not be called while returning to CentCom."
+ return
+
+ if(emergency_shuttle.online)
+ user << "The shuttle is already on its way."
+ return
+
+ if(ticker.mode.name == "revolution" || ticker.mode.name == "AI malfunction" || ticker.mode.name == "sandbox")
+ //New version pretends to call the shuttle but cause the shuttle to return after a random duration.
+ emergency_shuttle.fake_recall = rand(300,500)
+
+ if(ticker.mode.name == "blob" || ticker.mode.name == "epidemic")
+ user << "Under directive 7-10, [station_name()] is quarantined until further notice."
+ return
+
+ emergency_shuttle.incall()
+ emergency_shuttle.shuttlealert(1)
+ log_game("[key_name(user)] has called the shuttle.")
+ message_admins("[key_name_admin(user)] has called the shuttle.", 1)
+ captain_announce("A crew transfer has been initiated. The shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.")
+
+ return
+
/proc/cancel_call_proc(var/mob/user)
if ((!( ticker ) || emergency_shuttle.location || emergency_shuttle.direction == 0 || emergency_shuttle.timeleft() < 300))