Skip to content

Commit

Permalink
TGS Test Merge (#22220)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yogbot-13 committed Jul 28, 2024
2 parents f5d6930 + e6e3dd2 commit 3b4a498
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 21 deletions.
4 changes: 2 additions & 2 deletions code/__DEFINES/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@


// Alert level related
#define ALERT_COEFF_AUTOEVAC_NORMAL 2.5
#define ALERT_COEFF_GREEN 2
#define ALERT_COEFF_AUTOEVAC_NORMAL 1.5
#define ALERT_COEFF_GREEN 1.2
#define ALERT_COEFF_BLUE 1
#define ALERT_COEFF_RED 0.5
#define ALERT_COEFF_AUTOEVAC_CRITICAL 0.4
Expand Down
46 changes: 27 additions & 19 deletions code/controllers/subsystem/shuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -217,28 +217,36 @@ SUBSYSTEM_DEF(shuttle)
if(emergency_no_escape || admin_emergency_no_recall || emergency_no_recall || !emergency || !SSticker.HasRoundStarted())
return

var/threshold = CONFIG_GET(number/emergency_shuttle_autocall_threshold)
if(!threshold)
if(!length(GLOB.joined_player_list)) //if there's nobody actually in the game...
return

var/alive = 0
for(var/I in GLOB.player_list)
var/mob/M = I
if(M.stat != DEAD)
++alive

var/total = GLOB.joined_player_list.len
if(total <= 0)
return //no players no autoevac

if(alive / total <= threshold)
var/msg = "Automatically dispatching shuttle due to crew death."
var/threshold = CONFIG_GET(number/emergency_shuttle_autocall_threshold)
if(threshold)
var/alive = 0
for(var/I in GLOB.player_list)
var/mob/M = I
if(M.stat != DEAD)
++alive

var/total = length(GLOB.joined_player_list)
if(!total) return

if(alive / total <= threshold)
var/msg = "Automatically dispatching shuttle due to crew death."
message_admins(msg)
log_game("[msg] Alive: [alive], Roundstart: [total], Threshold: [threshold]")
emergency_no_recall = TRUE
priority_announce("Catastrophic casualties detected: crisis shuttle protocols activated - jamming recall signals across all frequencies.")
if(emergency.timeLeft(1) > emergency_no_recall * 0.4)
emergency.request(null, set_coefficient = 0.4)
return
if(world.time - SSticker.round_start_time >= 2 HOURS) //auto call the shuttle after 2 hours
var/msg = "Automatically dispatching shuttle due to lack of shift end response."
message_admins(msg)
log_game("[msg] Alive: [alive], Roundstart: [total], Threshold: [threshold]")
emergency_no_recall = TRUE
priority_announce("Catastrophic casualties detected: crisis shuttle protocols activated - jamming recall signals across all frequencies.")
if(emergency.timeLeft(1) > emergency_no_recall * 0.4)
emergency.request(null, set_coefficient = 0.4)
priority_announce("Dispatching shuttle due to lack of shift end response.")
if(emergency.mode == SHUTTLE_IDLE)
emergency.request(null)

/datum/controller/subsystem/shuttle/proc/block_recall(lockout_timer)
if(isnull(lockout_timer))
Expand Down Expand Up @@ -434,7 +442,7 @@ SUBSYSTEM_DEF(shuttle)

if(callShuttle)
if(EMERGENCY_IDLE_OR_RECALLED)
emergency.request(null, set_coefficient = 2.5)
emergency.request(null, set_coefficient = ALERT_COEFF_AUTOEVAC_NORMAL)
log_game("There is no means of calling the shuttle anymore. Shuttle automatically called.")
message_admins("All the communications consoles were destroyed and all AIs are inactive. Shuttle called.")

Expand Down

0 comments on commit 3b4a498

Please sign in to comment.