diff --git a/code/controllers/shuttle_controller.dm b/code/controllers/shuttle_controller.dm
index c33ccc2a00e..2f8c2204921 100644
--- a/code/controllers/shuttle_controller.dm
+++ b/code/controllers/shuttle_controller.dm
@@ -22,6 +22,8 @@ datum/shuttle_controller
var/location = UNDOCKED //
var/online = 0
var/direction = 1 //-1 = going back to central command, 1 = going to SS13. Only important for recalling
+ var/recall_count = 0
+ var/area/last_call_loc = null // Stores where the last shuttle call/recall was made from
var/endtime // timeofday that shuttle arrives
var/timelimit //important when the shuttle gets called for more than shuttlearrivetime
@@ -35,12 +37,16 @@ datum/shuttle_controller
// call the shuttle
// if not called before, set the endtime to T+600 seconds
// otherwise if outgoing, switch to incoming
- proc/incall(coeff = 1)
+ proc/incall(coeff = 1, var/signal_origin)
if(endtime)
if(direction == -1)
setdirection(1)
else
+ if(signal_origin && prob(60)) //40% chance the signal tracing will fail
+ last_call_loc = signal_origin
+ else
+ last_call_loc = null
settimeleft(SHUTTLEARRIVETIME*coeff)
online = 1
if(always_fake_recall)
@@ -50,7 +56,7 @@ datum/shuttle_controller
else
fake_recall = rand(SHUTTLEARRIVETIME / 2, SHUTTLEARRIVETIME - 100)
- proc/recall()
+ proc/recall(var/signal_origin)
if(direction == 1)
var/timeleft = timeleft()
if(timeleft >= SHUTTLEARRIVETIME)
@@ -58,7 +64,18 @@ datum/shuttle_controller
direction = 1
endtime = null
return
- captain_announce("The emergency shuttle has been recalled.")
+
+ recall_count ++
+
+ if(recall_count > 2 && signal_origin && prob(60)) //40% chance the signal tracing will fail
+ last_call_loc = signal_origin
+ else
+ last_call_loc = null
+
+ if(recall_count == 2)
+ captain_announce("The emergency shuttle has been recalled.\n\nExcessive number of emergency shuttle calls detected. We will attempt to trace any further signals to their source. Results may be viewed on any communications console.")
+ else
+ captain_announce("The emergency shuttle has been recalled.")
world << sound('sound/AI/shuttlerecalled.ogg')
setdirection(-1)
online = 1
diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm
index abcd6c8edd6..783792e774a 100644
--- a/code/game/machinery/computer/communications.dm
+++ b/code/game/machinery/computer/communications.dm
@@ -350,6 +350,11 @@
switch(src.state)
if(STATE_DEFAULT)
if (src.authenticated)
+ if(emergency_shuttle.recall_count > 1)
+ if(emergency_shuttle.last_call_loc)
+ dat += "
Latest emergency signal trace attempt successful.
Last signal origin: [format_text(emergency_shuttle.last_call_loc.name)].
"
+ else
+ dat += "
Latest emergency signal trace attempt failed.
"
dat += "
\[ Log Out \]
"
dat += "
General Functions"
dat += "
\[ Message List \]"
@@ -439,6 +444,12 @@
var/dat = ""
switch(src.aistate)
if(STATE_DEFAULT)
+ if(emergency_shuttle.recall_count > 1)
+ if(emergency_shuttle.last_call_loc)
+ dat += "
Latest emergency signal trace attempt successful.
Last signal origin: [format_text(emergency_shuttle.last_call_loc.name)].
"
+ else
+ dat += "
Latest emergency signal trace attempt failed.
"
+
dat += "
\[ Message List \]"
if(emergency_shuttle.location==0 && !emergency_shuttle.online)
dat += "
\[ Call Emergency Shuttle \]"
@@ -519,11 +530,12 @@
user << "The emergency shuttle is already on its way."
return
+ var/area/signal_origin = get_area(user)
if (seclevel2num(get_security_level()) == SEC_LEVEL_RED) // There is a serious threat we gotta move no time to give them five minutes.
- emergency_shuttle.incall(0.6)
+ emergency_shuttle.incall(0.6, signal_origin)
captain_announce("The emergency shuttle has been called. Red Alert state confirmed: Dispatching priority shuttle. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.")
else
- emergency_shuttle.incall()
+ emergency_shuttle.incall(1, signal_origin)
captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.")
log_game("[key_name(user)] has called the shuttle.")
@@ -547,7 +559,8 @@
if(emergency_shuttle.direction != -1 && emergency_shuttle.online) //check that shuttle isn't already heading to centcom
- emergency_shuttle.recall()
+ var/area/signal_origin = get_area(user)
+ emergency_shuttle.recall(signal_origin)
log_game("[key_name(user)] has recalled the shuttle.")
message_admins("[key_name_admin(user)] has recalled the shuttle.", 1)
return