escape shuttle to subsystem (#19325)

* escape shuttle to subsystem

* .

* thank you github

* axe this, unused

* prevent comm computer server crash

---------

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
Kashargul
2026-03-26 20:49:17 -04:00
committed by GitHub
co-authored by Cameron Lennox
parent 58ddf3df83
commit f498ce0659
31 changed files with 393 additions and 419 deletions
+6 -6
View File
@@ -395,19 +395,19 @@
dat += "Current Game Mode: " + span_bold("[SSticker.mode.name]") + "<BR>"
dat += "Round Duration: " + span_bold("[roundduration2text()]") + "<BR>"
dat += span_bold("Emergency shuttle") + "<BR>"
if (!GLOB.emergency_shuttle.online())
if (!SSemergency_shuttle.online())
dat += "<a href='byond://?src=\ref[src];[HrefToken()];call_shuttle=1'>Call Shuttle</a><br>"
else
if (GLOB.emergency_shuttle.wait_for_launch)
var/timeleft = GLOB.emergency_shuttle.estimate_launch_time()
if (SSemergency_shuttle.wait_for_launch)
var/timeleft = SSemergency_shuttle.estimate_launch_time()
dat += "ETL: <a href='byond://?src=\ref[src];[HrefToken()];edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>"
else if (GLOB.emergency_shuttle.shuttle.has_arrive_time())
var/timeleft = GLOB.emergency_shuttle.estimate_arrival_time()
else if (SSemergency_shuttle.shuttle.has_arrive_time())
var/timeleft = SSemergency_shuttle.estimate_arrival_time()
dat += "ETA: <a href='byond://?src=\ref[src];[HrefToken()];edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>"
dat += "<a href='byond://?src=\ref[src];[HrefToken()];call_shuttle=2'>Send Back</a><br>"
if (GLOB.emergency_shuttle.shuttle.moving_status == SHUTTLE_WARMUP)
if (SSemergency_shuttle.shuttle.moving_status == SHUTTLE_WARMUP)
dat += "Launching now..."
dat += "<a href='byond://?src=\ref[src];[HrefToken()];delay_round_end=1'>[SSticker.delay_end ? "End Round Normally" : "Delay Round End"]</a><br>"
+16 -16
View File
@@ -83,23 +83,23 @@
switch(href_list["call_shuttle"])
if("1")
if ((!( SSticker ) || !GLOB.emergency_shuttle.location()))
if ((!( SSticker ) || !SSemergency_shuttle.location()))
return
if (GLOB.emergency_shuttle.can_call())
GLOB.emergency_shuttle.call_evac()
if (SSemergency_shuttle.can_call())
SSemergency_shuttle.call_evac()
log_admin("[key_name(usr)] called the Emergency Shuttle")
message_admins(span_blue("[key_name_admin(usr)] called the Emergency Shuttle to the station."), 1)
if("2")
if (!( SSticker ) || !GLOB.emergency_shuttle.location())
if (!( SSticker ) || !SSemergency_shuttle.location())
return
if (GLOB.emergency_shuttle.can_call())
GLOB.emergency_shuttle.call_evac()
if (SSemergency_shuttle.can_call())
SSemergency_shuttle.call_evac()
log_admin("[key_name(usr)] called the Emergency Shuttle")
message_admins(span_blue("[key_name_admin(usr)] called the Emergency Shuttle to the station."), 1)
else if (GLOB.emergency_shuttle.can_recall())
GLOB.emergency_shuttle.recall()
else if (SSemergency_shuttle.can_recall())
SSemergency_shuttle.recall()
log_admin("[key_name(usr)] sent the Emergency Shuttle back")
message_admins(span_blue("[key_name_admin(usr)] sent the Emergency Shuttle back."), 1)
@@ -108,20 +108,20 @@
else if(href_list["edit_shuttle_time"])
if(!check_rights(R_SERVER)) return
if (GLOB.emergency_shuttle.wait_for_launch)
var/new_time_left = tgui_input_number(usr, "Enter new shuttle launch countdown (seconds):","Edit Shuttle Launch Time", GLOB.emergency_shuttle.estimate_launch_time() )
if (SSemergency_shuttle.wait_for_launch)
var/new_time_left = tgui_input_number(usr, "Enter new shuttle launch countdown (seconds):","Edit Shuttle Launch Time", SSemergency_shuttle.estimate_launch_time() )
GLOB.emergency_shuttle.launch_time = world.time + new_time_left*10
SSemergency_shuttle.launch_time = world.time + (new_time_left * 10)
log_admin("[key_name(usr)] edited the Emergency Shuttle's launch time to [new_time_left]")
message_admins(span_blue("[key_name_admin(usr)] edited the Emergency Shuttle's launch time to [new_time_left*10]"), 1)
else if (GLOB.emergency_shuttle.shuttle.has_arrive_time())
message_admins(span_blue("[key_name_admin(usr)] edited the Emergency Shuttle's launch time to [new_time_left * 10]"), 1)
else if (SSemergency_shuttle.shuttle.has_arrive_time())
var/new_time_left = tgui_input_number(usr, "Enter new shuttle arrival time (seconds):","Edit Shuttle Arrival Time", GLOB.emergency_shuttle.estimate_arrival_time() )
GLOB.emergency_shuttle.shuttle.arrive_time = world.time + new_time_left*10
var/new_time_left = tgui_input_number(usr, "Enter new shuttle arrival time (seconds):","Edit Shuttle Arrival Time", SSemergency_shuttle.estimate_arrival_time() )
SSemergency_shuttle.shuttle.arrive_time = world.time + (new_time_left * 10)
log_admin("[key_name(usr)] edited the Emergency Shuttle's arrival time to [new_time_left]")
message_admins(span_blue("[key_name_admin(usr)] edited the Emergency Shuttle's arrival time to [new_time_left*10]"), 1)
message_admins(span_blue("[key_name_admin(usr)] edited the Emergency Shuttle's arrival time to [new_time_left * 10]"), 1)
else
tgui_alert_async(usr, "The shuttle is neither counting down to launch nor is it in transit. Please try again when it is.")
+9 -9
View File
@@ -677,7 +677,7 @@ ADMIN_VERB(toggle_view_range, R_HOLDER, "Change View Range", "Switches between 1
feedback_add_details("admin_verb","CVRA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
ADMIN_VERB(admin_call_shuttle, R_ADMIN|R_SERVER, "Call Shuttle", "Calls the emergency shuttel.", ADMIN_CATEGORY_EVENTS)
if ((!( SSticker ) || !GLOB.emergency_shuttle.location()))
if ((!( SSticker ) || !SSemergency_shuttle.location()))
return
var/confirm = tgui_alert(user, "You sure?", "Confirm", list("Yes", "No"))
@@ -687,15 +687,15 @@ ADMIN_VERB(admin_call_shuttle, R_ADMIN|R_SERVER, "Call Shuttle", "Calls the emer
if(SSticker.mode.auto_recall_shuttle)
choice = tgui_input_list(user, "The shuttle will just return if you call it. Call anyway?", "Shuttle Call", list("Confirm", "Cancel"))
if(choice == "Confirm")
GLOB.emergency_shuttle.auto_recall = 1 //enable auto-recall
SSemergency_shuttle.auto_recall = TRUE //enable auto-recall
else
return
choice = tgui_input_list(user, "Is this an emergency evacuation or a crew transfer?", "Shuttle Call", list("Emergency", "Crew Transfer"))
if (choice == "Emergency")
GLOB.emergency_shuttle.call_evac()
SSemergency_shuttle.call_evac()
else
GLOB.emergency_shuttle.call_transfer()
SSemergency_shuttle.call_transfer()
feedback_add_details("admin_verb","CSHUT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -705,10 +705,10 @@ ADMIN_VERB(admin_call_shuttle, R_ADMIN|R_SERVER, "Call Shuttle", "Calls the emer
ADMIN_VERB(admin_cancel_shuttle, R_ADMIN|R_FUN, "Cancel Shuttle", "Cancels the emergency shuttel.", ADMIN_CATEGORY_EVENTS)
if(tgui_alert(user, "You sure?", "Confirm", list("Yes", "No")) != "Yes") return
if(!SSticker || !GLOB.emergency_shuttle.can_recall())
if(!SSticker || !SSemergency_shuttle.can_recall())
return
GLOB.emergency_shuttle.recall()
SSemergency_shuttle.recall()
feedback_add_details("admin_verb","CCSHUT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
log_admin("[key_name(user)] admin-recalled the emergency shuttle.")
message_admins(span_blue("[key_name_admin(user)] admin-recalled the emergency shuttle."))
@@ -717,10 +717,10 @@ ADMIN_VERB(admin_deny_shuttle, R_ADMIN, "Toggle Deny Shuttle", "Prevents the shu
if (!SSticker)
return
GLOB.emergency_shuttle.deny_shuttle = !GLOB.emergency_shuttle.deny_shuttle
SSemergency_shuttle.deny_shuttle = !SSemergency_shuttle.deny_shuttle
log_admin("[key_name(user)] has [GLOB.emergency_shuttle.deny_shuttle ? "denied" : "allowed"] the shuttle to be called.")
message_admins("[key_name_admin(user)] has [GLOB.emergency_shuttle.deny_shuttle ? "denied" : "allowed"] the shuttle to be called.")
log_admin("[key_name(user)] has [SSemergency_shuttle.deny_shuttle ? "denied" : "allowed"] the shuttle to be called.")
message_admins("[key_name_admin(user)] has [SSemergency_shuttle.deny_shuttle ? "denied" : "allowed"] the shuttle to be called.")
ADMIN_VERB(everyone_random, R_FUN, "Make Everyone Random", "Make everyone have a random appearance. You can only use this before rounds!", ADMIN_CATEGORY_FUN_DO_NOT)
if (SSticker && SSticker.mode)
+2 -2
View File
@@ -245,8 +245,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/observer/dead/get_status_tab_items()
. = ..()
if(GLOB.emergency_shuttle)
var/eta_status = GLOB.emergency_shuttle.get_status_panel_eta()
if(SSemergency_shuttle)
var/eta_status = SSemergency_shuttle.get_status_panel_eta()
if(eta_status)
. += ""
. += "[eta_status]"
@@ -100,8 +100,8 @@
. += ""
. += "Intent: [a_intent]"
. += "Move Mode: [m_intent]"
if(GLOB.emergency_shuttle)
var/eta_status = GLOB.emergency_shuttle.get_status_panel_eta()
if(SSemergency_shuttle)
var/eta_status = SSemergency_shuttle.get_status_panel_eta()
if(eta_status)
. += "[eta_status]"
+1 -1
View File
@@ -407,7 +407,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
call_shuttle_proc(src)
// hack to display shuttle timer
if(GLOB.emergency_shuttle.online())
if(SSemergency_shuttle.online())
post_status(src, "shuttle", user = src)
/mob/living/silicon/ai/proc/ai_recall_shuttle()
+2 -2
View File
@@ -157,8 +157,8 @@
// this function displays the shuttles ETA in the status panel if the shuttle has been called
/mob/living/silicon/proc/show_emergency_shuttle_eta()
if(GLOB.emergency_shuttle)
var/eta_status = GLOB.emergency_shuttle.get_status_panel_eta()
if(SSemergency_shuttle)
var/eta_status = SSemergency_shuttle.get_status_panel_eta()
if(eta_status)
. = "[eta_status]"
+4 -4
View File
@@ -4,9 +4,9 @@
/datum/shuttle/autodock/ferry/escape_pod/New()
move_time = move_time + rand(-30, 60)
if(name in GLOB.emergency_shuttle.escape_pods)
if(name in SSemergency_shuttle.escape_pods)
CRASH("An escape pod with the name '[name]' has already been defined.")
GLOB.emergency_shuttle.escape_pods[name] = src
SSemergency_shuttle.escape_pods[name] = src
..()
@@ -56,7 +56,7 @@
"docking_status" = docking_program.get_docking_status(),
"override_enabled" = docking_program.override_enabled,
"exterior_status" = docking_program.memory["door_status"], // TGUI DATA fails silently when there's no linked pod, leading to UI crashes
"can_force" = pod?.can_force() || (GLOB.emergency_shuttle.departed && pod?.can_launch()), //allow players to manually launch ahead of time if the shuttle leaves
"can_force" = pod?.can_force() || (SSemergency_shuttle.departed && pod?.can_launch()), //allow players to manually launch ahead of time if the shuttle leaves
"armed" = pod?.arming_controller.armed,
"internalTemplateName" = "EscapePodConsole",
)
@@ -72,7 +72,7 @@
if("force_launch")
if(pod.can_force())
pod.force_launch(src)
else if(GLOB.emergency_shuttle.departed && pod.can_launch()) //allow players to manually launch ahead of time if the shuttle leaves
else if(SSemergency_shuttle.departed && pod.can_launch()) //allow players to manually launch ahead of time if the shuttle leaves
pod.launch(src)
. = TRUE
+13 -13
View File
@@ -7,9 +7,9 @@
/datum/shuttle/autodock/ferry/emergency/New()
..()
radio_connection = SSradio.add_object(src, frequency, null)
if(GLOB.emergency_shuttle.shuttle)
if(SSemergency_shuttle.shuttle)
CRASH("An emergency shuttle has already been defined.")
GLOB.emergency_shuttle.shuttle = src
SSemergency_shuttle.shuttle = src
/datum/shuttle/autodock/ferry/emergency/arrived()
. = ..()
@@ -17,7 +17,7 @@
var/obj/machinery/computer/shuttle_control/emergency/C = in_use
C.reset_authorization()
GLOB.emergency_shuttle.shuttle_arrived()
SSemergency_shuttle.shuttle_arrived()
/datum/shuttle/autodock/ferry/emergency/long_jump(var/destination, var/interim, var/travel_time)
if (!location)
@@ -27,17 +27,17 @@
//update move_time and launch_time so we get correct ETAs
move_time = travel_time
GLOB.emergency_shuttle.launch_time = world.time
SSemergency_shuttle.launch_time = world.time
..(destination, interim, travel_time, direction)
/datum/shuttle/autodock/ferry/emergency/perform_shuttle_move()
if (current_location == landmark_station) //leaving the station
spawn(0)
GLOB.emergency_shuttle.departed = 1
var/estimated_time = round(GLOB.emergency_shuttle.estimate_arrival_time()/60,1)
SSemergency_shuttle.departed = TRUE
var/estimated_time = round(SSemergency_shuttle.estimate_arrival_time()/60,1)
if (GLOB.emergency_shuttle.evac)
if (SSemergency_shuttle.evac)
GLOB.priority_announcement.Announce(replacetext(replacetext(using_map.emergency_shuttle_leaving_dock, "%dock_name%", "[using_map.dock_name]"), "%ETA%", "[estimated_time] minute\s"))
else
GLOB.priority_announcement.Announce(replacetext(replacetext(using_map.shuttle_leaving_dock, "%dock_name%", "[using_map.dock_name]"), "%ETA%", "[estimated_time] minute\s"), "Transfer System", 'sound/AI/tramdepart.ogg')
@@ -71,8 +71,8 @@
if (!can_launch(user)) return
if (istype(user, /obj/machinery/computer/shuttle_control/emergency)) //if we were given a command by an emergency shuttle console
if (GLOB.emergency_shuttle.autopilot)
GLOB.emergency_shuttle.autopilot = 0
if (SSemergency_shuttle.autopilot)
SSemergency_shuttle.autopilot = FALSE
to_chat(world, span_boldnotice("Alert: The shuttle autopilot has been overridden. Launch sequence initiated!"))
if(usr)
@@ -85,8 +85,8 @@
if (!can_force(user)) return
if (istype(user, /obj/machinery/computer/shuttle_control/emergency)) //if we were given a command by an emergency shuttle console
if (GLOB.emergency_shuttle.autopilot)
GLOB.emergency_shuttle.autopilot = 0
if (SSemergency_shuttle.autopilot)
SSemergency_shuttle.autopilot = FALSE
to_chat(world, span_boldnotice("Alert: The shuttle autopilot has been overridden. Bluespace drive engaged!"))
if(usr)
@@ -99,8 +99,8 @@
if (!can_cancel(user)) return
if (istype(user, /obj/machinery/computer/shuttle_control/emergency)) //if we were given a command by an emergency shuttle console
if (GLOB.emergency_shuttle.autopilot)
GLOB.emergency_shuttle.autopilot = 0
if (SSemergency_shuttle.autopilot)
SSemergency_shuttle.autopilot = FALSE
to_chat(world, span_boldnotice("Alert: The shuttle autopilot has been overridden. Launch sequence aborted!"))
if(usr)
+27 -20
View File
@@ -25,6 +25,8 @@
var/message_cooldown
var/centcomm_message_cooldown
///Cooldown on how quickly you can change the station's level.
COOLDOWN_DECLARE(level_change_cooldown)
var/tmp_alertlevel = 0
var/stat_msg1
@@ -63,6 +65,10 @@
return COMM_AUTHENTICATION_NONE
/datum/tgui_module/communications/proc/change_security_level(mob/user, new_level)
if(!COOLDOWN_FINISHED(src, level_change_cooldown))
to_chat(user, span_warning("Please wait [round((COOLDOWN_TIMELEFT(src, level_change_cooldown) * 0.1), 1)] second(s) before changing the station's alert level again."))
tmp_alertlevel = 0
return
tmp_alertlevel = new_level
var/old_level = GLOB.security_level
if(!tmp_alertlevel) tmp_alertlevel = SEC_LEVEL_GREEN
@@ -84,6 +90,7 @@
feedback_inc("alert_comms_orange",1)
if(SEC_LEVEL_BLUE)
feedback_inc("alert_comms_blue",1)
COOLDOWN_START(src, level_change_cooldown, 2 MINUTES) // 2 minute cd on station alert changing.
tmp_alertlevel = 0
/datum/tgui_module/communications/tgui_data(mob/user)
@@ -145,12 +152,12 @@
data["msg_cooldown"] = message_cooldown ? (round((message_cooldown - world.time) / 10)) : 0
data["cc_cooldown"] = centcomm_message_cooldown ? (round((centcomm_message_cooldown - world.time) / 10)) : 0
data["esc_callable"] = GLOB.emergency_shuttle.location() && !GLOB.emergency_shuttle.online() ? TRUE : FALSE
data["esc_recallable"] = GLOB.emergency_shuttle.location() && GLOB.emergency_shuttle.online() ? TRUE : FALSE
data["esc_callable"] = SSemergency_shuttle.location() && !SSemergency_shuttle.online() ? TRUE : FALSE
data["esc_recallable"] = SSemergency_shuttle.location() && SSemergency_shuttle.online() ? TRUE : FALSE
data["esc_status"] = FALSE
if(GLOB.emergency_shuttle.has_eta())
var/timeleft = GLOB.emergency_shuttle.estimate_arrival_time()
data["esc_status"] = GLOB.emergency_shuttle.online() ? "ETA:" : "RECALLING:"
if(SSemergency_shuttle.has_eta())
var/timeleft = SSemergency_shuttle.estimate_arrival_time()
data["esc_status"] = SSemergency_shuttle.online() ? "ETA:" : "RECALLING:"
data["esc_status"] += " [timeleft / 60 % 60]:[add_zero(num2text(timeleft % 60), 2)]"
return data
@@ -272,7 +279,7 @@
return
call_shuttle_proc(ui.user)
if(GLOB.emergency_shuttle.online())
if(SSemergency_shuttle.online())
post_status(src, "shuttle", user = ui.user)
setMenuState(ui.user, COMM_SCREEN_MAIN)
@@ -381,7 +388,7 @@
PS.allowedtocall = !(PS.allowedtocall)
/proc/call_shuttle_proc(var/mob/user)
if ((!( SSticker ) || !GLOB.emergency_shuttle.location()))
if ((!( SSticker ) || !SSemergency_shuttle.location()))
return
if(!GLOB.universe.OnShuttleCall(user))
@@ -392,7 +399,7 @@
to_chat(user, "[using_map.boss_short] will not allow the shuttle to be called. Consider all contracts terminated.")
return
if(GLOB.emergency_shuttle.deny_shuttle)
if(SSemergency_shuttle.deny_shuttle)
to_chat(user, "The emergency shuttle may not be sent at this time. Please try again later.")
return
@@ -400,11 +407,11 @@
to_chat(user, "The emergency shuttle is refueling. Please wait another [round((6000-world.time)/600)] minute\s before trying again.")
return
if(GLOB.emergency_shuttle.going_to_centcom())
if(SSemergency_shuttle.going_to_centcom())
to_chat(user, "The emergency shuttle may not be called while returning to [using_map.boss_short].")
return
if(GLOB.emergency_shuttle.online())
if(SSemergency_shuttle.online())
to_chat(user, "The emergency shuttle is already on its way.")
return
@@ -412,7 +419,7 @@
to_chat(user, "Under directive 7-10, [station_name()] is quarantined until further notice.")
return
GLOB.emergency_shuttle.call_evac()
SSemergency_shuttle.call_evac()
log_game("[key_name(user)] has called the shuttle.")
message_admins("[key_name_admin(user)] has called the shuttle.", 1)
admin_chat_message(message = "Emergency evac beginning! Called by [key_name(user)]!", color = "#CC2222") //VOREStation Add
@@ -420,20 +427,20 @@
return
/proc/init_shift_change(var/mob/user, var/force = 0)
if ((!( SSticker ) || !GLOB.emergency_shuttle.location()))
if ((!( SSticker ) || !SSemergency_shuttle.location()))
return
if(GLOB.emergency_shuttle.going_to_centcom())
if(SSemergency_shuttle.going_to_centcom())
to_chat(user, "The shuttle may not be called while returning to [using_map.boss_short].")
return
if(GLOB.emergency_shuttle.online())
if(SSemergency_shuttle.online())
to_chat(user, "The shuttle is already on its way.")
return
// if force is 0, some things may stop the shuttle call
if(!force)
if(GLOB.emergency_shuttle.deny_shuttle)
if(SSemergency_shuttle.deny_shuttle)
to_chat(user, "[using_map.boss_short] does not currently have a shuttle available in your sector. Please try again later.")
return
@@ -447,13 +454,13 @@
if(SSticker.mode.auto_recall_shuttle)
//New version pretends to call the shuttle but cause the shuttle to return after a random duration.
GLOB.emergency_shuttle.auto_recall = 1
SSemergency_shuttle.auto_recall = TRUE
if(SSticker.mode.name == "blob" || SSticker.mode.name == "epidemic")
to_chat(user, "Under directive 7-10, [station_name()] is quarantined until further notice.")
return
GLOB.emergency_shuttle.call_transfer()
SSemergency_shuttle.call_transfer()
//delay events in case of an autotransfer
if (isnull(user))
@@ -467,13 +474,13 @@
return
/proc/cancel_call_proc(var/mob/user)
if (!( SSticker ) || !GLOB.emergency_shuttle.can_recall())
if (!( SSticker ) || !SSemergency_shuttle.can_recall())
return
if((SSticker.mode.name == "blob")||(SSticker.mode.name == "Meteor"))
return
if(!GLOB.emergency_shuttle.going_to_centcom()) //check that shuttle isn't already heading to CentCom
GLOB.emergency_shuttle.recall()
if(!SSemergency_shuttle.going_to_centcom()) //check that shuttle isn't already heading to CentCom
SSemergency_shuttle.recall()
log_game("[key_name(user)] has recalled the shuttle.")
message_admins("[key_name_admin(user)] has recalled the shuttle.", 1)
return
+3 -3
View File
@@ -62,10 +62,10 @@
data["name"] = name
data["duration"] = roundduration2text()
if(GLOB.emergency_shuttle?.going_to_centcom())
if(SSemergency_shuttle?.going_to_centcom())
data["evac"] = "Gone"
else if(GLOB.emergency_shuttle?.online())
if(GLOB.emergency_shuttle.evac)
else if(SSemergency_shuttle?.online())
if(SSemergency_shuttle.evac)
data["evac"] = "Emergency"
else
data["evac"] = "Crew Transfer"