From 5234c0544a82eb530170c482c1994f644d1e1910 Mon Sep 17 00:00:00 2001 From: Matt Atlas Date: Thu, 30 Dec 2021 22:10:05 +0100 Subject: [PATCH] Fixes evac shuttles being called as transfer shuttles, fixes shuttle arrive time announcement. (#12876) --- code/controllers/subsystems/evac.dm | 3 +- .../evacuation/evacuation_shuttle.dm | 9 +++- code/controllers/verbs.dm | 1 + code/game/machinery/case_button.dm | 2 +- .../file_system/programs/command/comm.dm | 6 +-- code/modules/shuttles/shuttle_emergency.dm | 2 - html/changelogs/mattatlas-shuttlestuff.yml | 43 +++++++++++++++++++ maps/aurora/code/aurora.dm | 4 +- maps/exodus/code/exodus.dm | 12 +++--- maps/runtime/code/runtime.dm | 2 +- 10 files changed, 66 insertions(+), 18 deletions(-) create mode 100644 html/changelogs/mattatlas-shuttlestuff.yml diff --git a/code/controllers/subsystems/evac.dm b/code/controllers/subsystems/evac.dm index ad8d73d0202..a23938e0ec0 100644 --- a/code/controllers/subsystems/evac.dm +++ b/code/controllers/subsystems/evac.dm @@ -14,4 +14,5 @@ var/datum/controller/subsystem/evac/SSevac evacuation_controller.set_up() /datum/controller/subsystem/evac/fire() - evacuation_controller.process() \ No newline at end of file + evacuation_controller.process() + \ No newline at end of file diff --git a/code/controllers/subsystems/evacuation/evacuation_shuttle.dm b/code/controllers/subsystems/evacuation/evacuation_shuttle.dm index 97283525350..f443375cb5b 100644 --- a/code/controllers/subsystems/evacuation/evacuation_shuttle.dm +++ b/code/controllers/subsystems/evacuation/evacuation_shuttle.dm @@ -37,9 +37,14 @@ pod.launch(src) if(autopilot && shuttle.moving_status == SHUTTLE_IDLE) - evac_arrival_time = world.time + (shuttle.move_time*10) + (shuttle.warmup_time*10) shuttle.launch(src) - // Announcements, state changes and such are handled by the shuttle itself to prevent desync. + + state = EVAC_IN_TRANSIT + + if (emergency_evacuation) + priority_announcement.Announce(replacetext(replacetext(current_map.emergency_shuttle_leaving_dock, "%dock%", "[current_map.dock_name]"), "%ETA%", "[round(get_eta()/60,1)] minute\s")) + else + priority_announcement.Announce(replacetext(replacetext(current_map.shuttle_leaving_dock, "%dock%", "[current_map.dock_name]"), "%ETA%", "[round(get_eta()/60,1)] minute\s")) /datum/evacuation_controller/shuttle/finish_preparing_evac() departed = 1 diff --git a/code/controllers/verbs.dm b/code/controllers/verbs.dm index 2928d9e6a0a..e7e8aa9b1ed 100644 --- a/code/controllers/verbs.dm +++ b/code/controllers/verbs.dm @@ -20,6 +20,7 @@ if (!Master.initializing && SS.flags & SS_NO_DISPLAY) continue available_controllers[SS.name] = SS + available_controllers["Evacuation Main Controller"] = evacuation_controller var/css = input("What controller would you like to debug?", "Controllers") as null|anything in available_controllers debug_variables(available_controllers[css]) diff --git a/code/game/machinery/case_button.dm b/code/game/machinery/case_button.dm index 2349a035a02..56de69d534d 100644 --- a/code/game/machinery/case_button.dm +++ b/code/game/machinery/case_button.dm @@ -107,7 +107,7 @@ /obj/machinery/case_button/shuttle/activate(mob/user) ..() - return call_shuttle_proc(user) + return call_shuttle_proc(user, TRUE) /obj/machinery/case_button/shuttle/deactivate(mob/user) ..() diff --git a/code/modules/modular_computers/file_system/programs/command/comm.dm b/code/modules/modular_computers/file_system/programs/command/comm.dm index 8b9548ecb02..f649bb98e63 100644 --- a/code/modules/modular_computers/file_system/programs/command/comm.dm +++ b/code/modules/modular_computers/file_system/programs/command/comm.dm @@ -391,7 +391,7 @@ Command action procs return FALSE //Returns 1 if called 0 if not -/proc/call_shuttle_proc(var/mob/user) +/proc/call_shuttle_proc(var/mob/user, var/emergency = FALSE) if((!(ROUND_IS_STARTED) || !evacuation_controller)) return FALSE @@ -414,8 +414,8 @@ Command action procs to_chat(user, "An evacuation is already underway.") return - if(evacuation_controller.call_evacuation(user)) - log_and_message_admins("[user? key_name(user) : "Autotransfer"] has called the shuttle.") + if(evacuation_controller.call_evacuation(user, emergency)) + log_and_message_admins("[user? key_name(user) : "Autotransfer"] has called a shuttle.") return TRUE diff --git a/code/modules/shuttles/shuttle_emergency.dm b/code/modules/shuttles/shuttle_emergency.dm index 0f5882dea9d..e2878b1425c 100644 --- a/code/modules/shuttles/shuttle_emergency.dm +++ b/code/modules/shuttles/shuttle_emergency.dm @@ -27,8 +27,6 @@ /datum/shuttle/autodock/ferry/emergency/long_jump(var/obj/effect/shuttle_landmark/destination, var/obj/effect/shuttle_landmark/interim, var/travel_time) ..(destination, interim, emergency_controller.get_long_jump_time(), direction) - if(destination == waypoint_offsite) - priority_announcement.Announce(replacetext(replacetext((emergency_controller.emergency_evacuation ? current_map.emergency_shuttle_leaving_dock : current_map.shuttle_leaving_dock), "%dock%", "[current_map.dock_name]"), "%ETA%", "[round(emergency_controller.get_eta()/60,1)] minute\s")) /datum/shuttle/autodock/ferry/emergency/shuttle_moved() if(next_location != waypoint_station) diff --git a/html/changelogs/mattatlas-shuttlestuff.yml b/html/changelogs/mattatlas-shuttlestuff.yml new file mode 100644 index 00000000000..731e6e6c014 --- /dev/null +++ b/html/changelogs/mattatlas-shuttlestuff.yml @@ -0,0 +1,43 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: MattAtlas + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "The evacuation shuttle button now actually calls an evac shuttle." + - bugfix: "Shuttles leaving the station now report the correct time to leave." + - backend: "Added the evacuation controller to the debug controller verb." diff --git a/maps/aurora/code/aurora.dm b/maps/aurora/code/aurora.dm index 33210f3a5e4..862a093ed48 100644 --- a/maps/aurora/code/aurora.dm +++ b/maps/aurora/code/aurora.dm @@ -63,8 +63,8 @@ shuttle_leaving_dock = "The crew transfer shuttle has left the station. Estimate %ETA% until the shuttle docks at %dock%." shuttle_called_message = "A crew transfer to %dock% has been scheduled. The shuttle has been called. It will arrive in approximately %ETA%." shuttle_recall_message = "The scheduled crew transfer has been cancelled." - emergency_shuttle_docked_message = "The emergency shuttle has docked with the station. You have approximately %ETD% minutes to board the emergency shuttle." - emergency_shuttle_leaving_dock = "The emergency shuttle has left the station. Estimate %ETA% minutes until the shuttle docks at %dock%." + emergency_shuttle_docked_message = "The emergency shuttle has docked with the station. You have approximately %ETA% to board the emergency shuttle." + emergency_shuttle_leaving_dock = "The emergency shuttle has left the station. Estimate %ETA% until the shuttle docks at %dock%." emergency_shuttle_recall_message = "The emergency shuttle has been recalled." emergency_shuttle_called_message = "An emergency evacuation shuttle has been called. It will arrive in approximately %ETA%." diff --git a/maps/exodus/code/exodus.dm b/maps/exodus/code/exodus.dm index cb35dc1e8a8..57268921a20 100644 --- a/maps/exodus/code/exodus.dm +++ b/maps/exodus/code/exodus.dm @@ -33,14 +33,14 @@ NETWORK_SECURITY ) - shuttle_docked_message = "The scheduled Crew Transfer Shuttle to %dock% has docked with the station. It will depart in approximately %ETA% minutes." - shuttle_leaving_dock = "The Crew Transfer Shuttle has left the station. Estimate %ETA% minutes until the shuttle docks at %dock%." - shuttle_called_message = "A crew transfer to %dock% has been scheduled. The shuttle has been called. It will arrive in approximately %ETA% minutes." + shuttle_docked_message = "The scheduled Crew Transfer Shuttle to %dock% has docked with the station. It will depart in approximately %ETA%." + shuttle_leaving_dock = "The Crew Transfer Shuttle has left the station. Estimate %ETA% until the shuttle docks at %dock%." + shuttle_called_message = "A crew transfer to %dock% has been scheduled. The shuttle has been called. It will arrive in approximately %ETA%." shuttle_recall_message = "The scheduled crew transfer has been cancelled." - emergency_shuttle_docked_message = "The Emergency Shuttle has docked with the station. You have approximately %ETD% minutes to board the Emergency Shuttle." - emergency_shuttle_leaving_dock = "The Emergency Shuttle has left the station. Estimate %ETA% minutes until the shuttle docks at %dock%." + emergency_shuttle_docked_message = "The Emergency Shuttle has docked with the station. You have approximately %ETA% to board the Emergency Shuttle." + emergency_shuttle_leaving_dock = "The Emergency Shuttle has left the station. Estimate %ETA% until the shuttle docks at %dock%." emergency_shuttle_recall_message = "The emergency shuttle has been recalled." - emergency_shuttle_called_message = "An emergency evacuation shuttle has been called. It will arrive in approximately %ETA% minutes." + emergency_shuttle_called_message = "An emergency evacuation shuttle has been called. It will arrive in approximately %ETA%." evac_controller_type = /datum/evacuation_controller/shuttle diff --git a/maps/runtime/code/runtime.dm b/maps/runtime/code/runtime.dm index 88e7ffede15..9fadbb42db2 100644 --- a/maps/runtime/code/runtime.dm +++ b/maps/runtime/code/runtime.dm @@ -27,7 +27,7 @@ use_overmap = TRUE - shuttle_docked_message = "Attention all hands: Jump preparation complete. The bluespace drive is now spooling up, secure all stations for departure. Time to jump: approximately %ETD%." + shuttle_docked_message = "Attention all hands: Jump preparation complete. The bluespace drive is now spooling up, secure all stations for departure. Time to jump: approximately %ETA%." shuttle_leaving_dock = "Attention all hands: Jump initiated, exiting bluespace in %ETA%." shuttle_called_message = "Attention all hands: Jump sequence initiated. Transit procedures are now in effect. Jump in %ETA%." shuttle_recall_message = "Attention all hands: Jump sequence aborted, return to normal operating conditions."