mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-10 10:01:40 +00:00
Emergency Shuttle Signal Tracing
Intended to cut down on shuttle ping-ponging caused by stealth comms consoles. -After the second recall, centcom will attempt to trace the origin of emergency shuttle calls and recalls -The results can be viewed on any authenticated communications console. -Tracing has a 40% failure chance to further reduce the risk of metagaming the game mode
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 += "<BR>Latest emergency signal trace attempt successful.<BR>Last signal origin: <b>[format_text(emergency_shuttle.last_call_loc.name)]</b>.<BR>"
|
||||
else
|
||||
dat += "<BR>Latest emergency signal trace attempt failed.<BR>"
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=logout'>Log Out</A> \]<BR>"
|
||||
dat += "<BR><B>General Functions</B>"
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=messagelist'>Message List</A> \]"
|
||||
@@ -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 += "<BR>Latest emergency signal trace attempt successful.<BR>Last signal origin: <b>[format_text(emergency_shuttle.last_call_loc.name)]</b>.<BR>"
|
||||
else
|
||||
dat += "<BR>Latest emergency signal trace attempt failed.<BR>"
|
||||
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-messagelist'>Message List</A> \]"
|
||||
if(emergency_shuttle.location==0 && !emergency_shuttle.online)
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=ai-callshuttle'>Call Emergency Shuttle</A> \]"
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user