diff --git a/code/datums/components/weatherannouncer.dm b/code/datums/components/weatherannouncer.dm index 70105875d8d..35c51f0c343 100644 --- a/code/datums/components/weatherannouncer.dm +++ b/code/datums/components/weatherannouncer.dm @@ -81,7 +81,7 @@ return // No change var/atom/movable/speaker = parent var/msg = get_warning_message() - var/obj/machinery/announcement_system/aas = get_announcement_system(/datum/aas_config_entry/weather, speaker) + var/obj/machinery/announcement_system/aas = get_announcement_system(/datum/aas_config_entry/weather, speaker, list(RADIO_CHANNEL_SUPPLY)) // Active AAS will override default announcement lines if (aas) msg = aas.compile_config_message(/datum/aas_config_entry/weather, list(), !is_weather_dangerous ? 4 : warning_level + 1) @@ -188,6 +188,14 @@ "Safe" = "No risk expected from incoming weather front.", ) +/datum/aas_config_entry/weather/act_up() + . = ..() + if (.) + return + + // 10% chance to turn off weather broadcast entirely + if (prob(10)) + enabled = FALSE #undef WEATHER_ALERT_CLEAR #undef WEATHER_ALERT_INCOMING diff --git a/code/game/machinery/announcement_system.dm b/code/game/machinery/announcement_system.dm index 74597101194..e39e2e4fed6 100644 --- a/code/game/machinery/announcement_system.dm +++ b/code/game/machinery/announcement_system.dm @@ -29,10 +29,10 @@ GLOBAL_LIST_EMPTY(announcement_systems) var/errorlight = "Error_Red" /obj/machinery/announcement_system/Initialize(mapload) - . = ..() - GLOB.announcement_systems += src - radio = new radio_type(src) config_entries = init_subtypes(/datum/aas_config_entry, list()) + . = ..() + radio = new radio_type(src) + GLOB.announcement_systems += src update_appearance() /obj/machinery/announcement_system/randomize_language_if_on_station() @@ -168,13 +168,14 @@ GLOBAL_LIST_EMPTY(announcement_systems) /obj/machinery/announcement_system/proc/has_supported_channels(list/channels) if (!LAZYLEN(channels) || (RADIO_CHANNEL_COMMON in channels)) // Okay, I am not proud of this, but I don't want CentCom or Syndie AASs to broadcast on Common. - return src.type == /obj/machinery/announcement_system + // Because our overrides can just change radio withour creating new subtype we prefer to check both. + return src.type == /obj/machinery/announcement_system && src.radio_type == /obj/machinery/announcement_system::radio_type for(var/channel in channels) if(radio.channels[channel]) return TRUE return FALSE -/// Can AAS receive request for broadcast from you? +/// Can AAS receive request for broadcast from you? Null source means yes. /obj/machinery/announcement_system/proc/can_be_reached_from(atom/source) if(!source || !istype(source)) return TRUE @@ -182,6 +183,7 @@ GLOBAL_LIST_EMPTY(announcement_systems) if (!source_turf) return TRUE // Keep updated with broadcasting.dm (/datum/signal/subspace/vocal/New) + // FFF (For Future Feature): think about adding radio relay support. Maybe implementing /datum/signal/subspace/aas_event or something similar. return z in SSmapping.get_connected_levels(source_turf) /// Compiles the announcement message with the provided variables. Announcement line is optional. @@ -205,13 +207,13 @@ GLOBAL_LIST_EMPTY(announcement_systems) for(var/channel in channels) radio.talk_into(src, message, channel, command_span ? list(speech_span, SPAN_COMMAND) : null) -/// Announces configs entry message with the provided variables. Channels and announcement_line are optional. +/// Announces configs entry message with the provided variables. Channels, announcement_line and command_span are optional. /obj/machinery/announcement_system/proc/announce(aas_config_entry_type, list/variables_map, list/channels, announcement_line, command_span) var/msg = compile_config_message(aas_config_entry_type, variables_map, announcement_line, TRUE) if (msg) broadcast(msg, channels, command_span) -/// Returns a random announcement system that is operational, has the specified config entry, signal can reach source and radio supports any channel in list. Config entry, source and channels are optional. +/// Returns a random announcement system that is operational, has the specified config entry, signal can reach source and radio supports any channel in list. All args are optional. /proc/get_announcement_system(aas_config_entry_type, source, list/channels) if (!GLOB.announcement_systems.len) return null @@ -225,7 +227,7 @@ GLOBAL_LIST_EMPTY(announcement_systems) intact_aass += announce return intact_aass.len ? pick(intact_aass) : null -/// Announces the provided message with the provided variables and config entry type. Channels, announcement_line, command_span and source are optional. +/// Announces the provided message with the provided variables and config entry type. Only aas_config_entry_type and variables_map are mandatory. Other args are optional. /proc/aas_config_announce(aas_config_entry_type, list/variables_map, source, list/channels, announcement_line, command_span) var/obj/machinery/announcement_system/announcer = get_announcement_system(aas_config_entry_type, source, channels) if (!announcer) @@ -245,7 +247,7 @@ GLOBAL_LIST_EMPTY(announcement_systems) // Can be changed or disabled by players var/modifiable = TRUE -/// Compiles the announcement message with the provided variables. Announcement line is optional. +/// Compiles the announcement message with the provided variables. Announcement line is optional, may be both index or line key. /datum/aas_config_entry/proc/compile_announce(list/variables_map, announcement_line) var/announcement_message = LAZYACCESS(announcement_lines_map, announcement_line) // If index was provided LAZYACCESS will return us a key, not value @@ -273,7 +275,7 @@ GLOBAL_LIST_EMPTY(announcement_systems) */ /datum/aas_config_entry/arrival - name = "Arrival Announcement" + name = "Global: Arrival Announcement" announcement_lines_map = list( "Message" = "%PERSON has signed up as %RANK") vars_and_tooltips_map = list( @@ -291,7 +293,7 @@ GLOBAL_LIST_EMPTY(announcement_systems) "ERR)#: DA#AB@#E NOT F(*ND!") /datum/aas_config_entry/newhead - name = "Departmental Head Announcement" + name = "Departmental: Head Announcement" announcement_lines_map = list( "Message" = "%PERSON, %RANK, is the department head.") vars_and_tooltips_map = list( @@ -309,7 +311,7 @@ GLOBAL_LIST_EMPTY(announcement_systems) "AAS.exe is not responding. NanoOS is searching for a solution to the problem.") /datum/aas_config_entry/researched_node - name = "Research Node Announcement" + name = "Science Alert: Research Node Announcement" announcement_lines_map = list( "Message" = "The %NODE techweb node has been researched") vars_and_tooltips_map = list( @@ -328,7 +330,7 @@ GLOBAL_LIST_EMPTY(announcement_systems) "ERR)#R - B*@ TEXT F*O(ND!") /datum/aas_config_entry/arrivals_broken - name = "Arrivals Shuttle Malfunction Announcement" + name = "Engineering Alert: Arrivals Shuttle Malfunction Announcement" announcement_lines_map = list( "Message" = "The arrivals shuttle has been damaged. Docking for repairs...") general_tooltip = "Broadcasted, when arrivals shuttle docks for repairs. No replacable variables provided." diff --git a/code/game/machinery/civilian_bounties.dm b/code/game/machinery/civilian_bounties.dm index 0b24fb8ebe1..b917bed6c7d 100644 --- a/code/game/machinery/civilian_bounties.dm +++ b/code/game/machinery/civilian_bounties.dm @@ -347,7 +347,7 @@ var/nag_message = "[src] is unsent in [get_area(src)]." //nag on Supply channel and reduce the speed bonus multiplier to nothing - var/obj/machinery/announcement_system/aas = get_announcement_system(/datum/aas_config_entry/bounty_cube_unsent, src) + var/obj/machinery/announcement_system/aas = get_announcement_system(/datum/aas_config_entry/bounty_cube_unsent, src, list(RADIO_CHANNEL_SUPPLY)) if (aas) nag_message = aas.compile_config_message(/datum/aas_config_entry/bounty_cube_unsent, list("LOCATION" = get_area_name(src), "COST" = bounty_value), "Regular Message") if (speed_bonus) diff --git a/code/game/machinery/computer/arcade/orion.dm b/code/game/machinery/computer/arcade/orion.dm index 6c2945cb126..ce26a9b50fb 100644 --- a/code/game/machinery/computer/arcade/orion.dm +++ b/code/game/machinery/computer/arcade/orion.dm @@ -546,7 +546,7 @@ /datum/aas_config_entry/orion_violent_behavior_alert // Well we don't want to show that only Orion Trails reports violent behavior, eh-h? - name = "Violent Behavior Alert" + name = "Global: Violent Behavior Alert" announcement_lines_map = list( RADIO_CHANNEL_SECURITY = "SECURITY ALERT: Crewmember %PERSON recorded displaying antisocial tendencies in %LOCATION by %SOURCE. Please watch for violent behavior.", RADIO_CHANNEL_MEDICAL = "PSYCH ALERT: Crewmember %PERSON recorded displaying antisocial tendencies in %LOCATION by %SOURCE. Please schedule psych evaluation.", diff --git a/code/game/machinery/computer/orders/order_computer/order_computer.dm b/code/game/machinery/computer/orders/order_computer/order_computer.dm index a83b930eada..02b26438d50 100644 --- a/code/game/machinery/computer/orders/order_computer/order_computer.dm +++ b/code/game/machinery/computer/orders/order_computer/order_computer.dm @@ -235,7 +235,7 @@ GLOBAL_LIST_EMPTY(order_console_products) return /datum/aas_config_entry/order_console - name = "Local Ordering Console Announcements" + name = "Cargo Alert: Local Ordering Console Announcements" announcement_lines_map = list() general_tooltip = "Used to make announces, when consoles listed here placing new order" diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index 44d6ebbffde..ff4d0e05af6 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -190,7 +190,7 @@ GLOBAL_LIST_EMPTY(req_console_ckey_departments) // Check if user can call this emergency (prevent self-calls) RETA var/user_dept = reta_get_user_department(usr) - if(user_dept == target_dept) + if(user_dept == target_dept && !isAdminGhostAI(usr)) to_chat(usr, span_alert("You cannot call your own department for emergency assistance.")) return @@ -201,6 +201,28 @@ GLOBAL_LIST_EMPTY(req_console_ckey_departments) emergency = emergency_type + // Enhanced announcement with caller info + var/caller_info = "" + // Aghosts have no IDs, but they hold authorithy so instead calling them Unknowns just drop caller info completely + if(usr && isliving(usr)) + caller_info = "(Identification not provided)" + var/mob/living/caller_mob = usr + var/obj/item/card/id/ID = caller_mob.get_idcard() + if(ID) + caller_info = "(Called by [ID.registered_name], [ID.assignment])" + // Centcom still refuses to provide IDs to their silicons + else if (issilicon(caller_mob)) + caller_info = "(Called by [caller_mob.name], [caller_mob.job])" + // Cyborgs do not have their job var set, and this is wrong + if(iscyborg(caller_mob) && caller_mob?.mind?.assigned_role) + caller_info = "(Called by [caller_mob.name], [caller_mob.mind.assigned_role.title])" + + // If someone swiped their ID before + else if (message_verified_by) + caller_info = "(Last authentication: [message_verified_by])" + message_stamped_by = "" + message_verified_by = "" + // Grant RETA if conditions are met if(origin_dept && target_dept && CONFIG_GET(flag/reta_enabled)) // Set cooldown @@ -214,66 +236,56 @@ GLOBAL_LIST_EMPTY(req_console_ckey_departments) // Track this call for multiple department analysis reta_track_call(origin_dept, target_dept) - // Enhanced announcement with caller info - var/caller_info = "" - if(usr) - var/caller_name = usr.real_name || "Unknown" - var/caller_title = "Unknown Position" - if(usr?.mind?.assigned_role) - caller_title = usr.mind.assigned_role.title - caller_info = " (Called by [caller_name], [caller_title])" - - var/enhanced_location = "[department][caller_info]" - switch(emergency_type) if(REQ_EMERGENCY_SECURITY) - aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_SECURITY), REQ_EMERGENCY_SECURITY) + aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = department, "CALLER" = caller_info, "RETARESPONDERS" = granted_count), src, list(RADIO_CHANNEL_SECURITY), "Security") if(REQ_EMERGENCY_ENGINEERING) - aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_ENGINEERING), REQ_EMERGENCY_ENGINEERING) + aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = department, "CALLER" = caller_info, "RETARESPONDERS" = granted_count), src, list(RADIO_CHANNEL_ENGINEERING), "Engineering") if(REQ_EMERGENCY_MEDICAL) - aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_MEDICAL), REQ_EMERGENCY_MEDICAL) + aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = department, "CALLER" = caller_info, "RETARESPONDERS" = granted_count), src, list(RADIO_CHANNEL_MEDICAL), "Medical") // Send confirmation to the calling department about the RETA activation - var/calling_message = "RETA activated[caller_info]. [target_dept] personnel now have temporary access to your areas." - - // Get an announcement system to send simple radio messages - var/obj/machinery/announcement_system/announcer = get_announcement_system(null, null, list(RADIO_CHANNEL_COMMON)) - if(announcer) - switch(origin_dept) - if("Security") - announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_SECURITY) - if("Engineering") - announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_ENGINEERING) - if("Medical") - announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_MEDICAL) - if("Science") - announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_SCIENCE) - if("Service") - announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_SERVICE) - if("Command") - announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_COMMAND) - if("Cargo") - announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_SUPPLY) - if("Mining") - announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_SUPPLY) + var/list/target_channels = list() + switch(origin_dept) + if("Security") + target_channels += RADIO_CHANNEL_SECURITY + if("Engineering") + target_channels += RADIO_CHANNEL_ENGINEERING + if("Medical") + target_channels += RADIO_CHANNEL_MEDICAL + if("Science") + target_channels += RADIO_CHANNEL_SCIENCE + if("Service") + target_channels += RADIO_CHANNEL_SERVICE + if("Command") + target_channels += RADIO_CHANNEL_COMMAND + if("Cargo") + target_channels += RADIO_CHANNEL_SUPPLY + if("Mining") + target_channels += RADIO_CHANNEL_SUPPLY + // Do not announce if RETA failed to activate + if (granted_count) + aas_config_announce(/datum/aas_config_entry/rc_reta_announcement, list("GRANTEE" = target_dept, "CALLER" = caller_info), src, target_channels) // Log RETA activity log_game("RETA: [origin_dept] called [target_dept] emergency, granted access to [granted_count] responder IDs for [duration_ds/10] seconds") // Push UI updates to consoles in the same origin department reta_push_ui_updates(origin_dept, target_dept) + // Making sure our emergency is synced with RETA timers + addtimer(CALLBACK(src, PROC_REF(clear_emergency)), duration_ds) else // Normal emergency call without RETA switch(emergency_type) if(REQ_EMERGENCY_SECURITY) - aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = department), null, list(RADIO_CHANNEL_SECURITY), REQ_EMERGENCY_SECURITY) + aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = department, "CALLER" = caller_info), null, list(RADIO_CHANNEL_SECURITY), "Security") if(REQ_EMERGENCY_ENGINEERING) - aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = department), null, list(RADIO_CHANNEL_ENGINEERING), REQ_EMERGENCY_ENGINEERING) + aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = department, "CALLER" = caller_info), null, list(RADIO_CHANNEL_ENGINEERING), "Engineering") if(REQ_EMERGENCY_MEDICAL) - aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = department), null, list(RADIO_CHANNEL_MEDICAL), REQ_EMERGENCY_MEDICAL) + aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = department, "CALLER" = caller_info), null, list(RADIO_CHANNEL_MEDICAL), "Medical") + addtimer(CALLBACK(src, PROC_REF(clear_emergency)), 5 MINUTES) update_appearance() - addtimer(CALLBACK(src, PROC_REF(clear_emergency)), 5 MINUTES) return TRUE if("send_announcement") if(!COOLDOWN_FINISHED(src, announcement_cooldown)) @@ -536,18 +548,93 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/requests_console/auto_name, 30) pixel_shift = 30 /datum/aas_config_entry/rc_emergency - name = "RC Alert: Emergency" + name = "RC Alert: Emergency Request" announcement_lines_map = list( - "Security" = "SECURITY EMERGENCY in %LOCATION - RETA door access granted to responders!", - "Engineering" = "ENGINEERING EMERGENCY in %LOCATION - RETA door access granted to responders!", - "Medical" = "MEDICAL EMERGENCY in %LOCATION - RETA door access granted to responders!", - ) - vars_and_tooltips_map = list( - "LOCATION" = "will be replaced with the department name and caller information (Name, Job Title)", + REQ_EMERGENCY_SECURITY = "SECURITY EMERGENCY in %LOCATION %CALLER!!!", + REQ_EMERGENCY_ENGINEERING = "ENGINEERING EMERGENCY in %LOCATION %CALLER!!!", + REQ_EMERGENCY_MEDICAL = "MEDICAL EMERGENCY in %LOCATION %CALLER!!!", ) + vars_and_tooltips_map = list( + "LOCATION" = "will be replaced with the department name", + "CALLER" = "with caller name and job if applicable", + ) + +/datum/aas_config_entry/rc_emergency/New() + . = ..() + // If RETA enabled change config lines to include RETA info + if(CONFIG_GET(flag/reta_enabled)) + // Non sec/engi/med personnel may be called by CC or AI (I hope) for anomaly removal and etc. Mostly admin triggered calls + announcement_lines_map = list( + "RETA Granted" = "- RETA door access granted to responders", + "RETA Failed" = "- no RETA access provided", + "Security" = "SECURITY EMERGENCY in %LOCATION %CALLER %RETA!!!", + "Engineering" = "ENGINEERING EMERGENCY in %LOCATION %CALLER %RETA!!!", + "Medical" = "MEDICAL EMERGENCY in %LOCATION %CALLER, %RETA!!!", + "Science" = "Science personnel was requested in %LOCATION %CALLER %RETA.", + "Service" = "Service personnel was requested in %LOCATION %CALLER %RETA.", + "Command" = "Command personnel was requested in %LOCATION %CALLER %RETA.", + "Cargo" = "Cargo personnel was requested in %LOCATION %CALLER %RETA.", + "Mining" = "Miners were requested in %LOCATION %CALLER %RETA.", + ) + vars_and_tooltips_map = list( + "LOCATION" = "will be replaced with the department name", + "CALLER" = "with caller name and job if applicable", + "RETA" = "with RETA Granted or RETA Failed lines depending on RETA system report", + ) + +/datum/aas_config_entry/rc_emergency/compile_announce(list/variables_map, announcement_line) + if (!variables_map["CALLER"]) + variables_map["CALLER"] = "(Caller placeholder)" + + variables_map["RETA"] = variables_map["RETARESPONDERS"] ? announcement_lines_map["RETA Granted"] : announcement_lines_map["RETA Failed"] + . = ..() + // In case - someone expands RETA departments, but forgets to add announcement lines for them + if (!announcement_lines_map[announcement_line]) + . = "ERROR: UNKNOWN DEPARTMENT \[[announcement_line]\] CALLED IN [variables_map["LOCATION"] || "\[NO DATA\]"] [variables_map["CALLER"]]. PLEASE REPORT THIS TO NT TECH SUPPORT." + + var/list/exploded_string = splittext_char(., "(Caller placeholder)") + var/list/trimed_message = list() + for (var/line in exploded_string) + line = trim(line) + if (line) + trimed_message += line + // Rebuild the string without empty lines + . = trimed_message.Join(" ") + +/datum/aas_config_entry/rc_reta_announcement + name = "RC Alert: RETA Granted" + announcement_lines_map = list( + "Message" = "RETA activated %CALLER. %GRANTEE personnel now have temporary access to your areas." + ) + + vars_and_tooltips_map = list( + "CALLER" = "will be replaced with caller info if applicable", + "GRANTEE" = "with who may now access targeted areas", + ) + +/datum/aas_config_entry/rc_reta_announcement/New() + . = ..() + // If RETA disabled - we should be down + if(!CONFIG_GET(flag/reta_enabled)) + announcement_lines_map["Message"] = "RETA system is disabled." + enabled = FALSE + modifiable = FALSE + +/datum/aas_config_entry/rc_reta_announcement/compile_announce(list/variables_map, announcement_line) + if (!variables_map["CALLER"]) + variables_map["CALLER"] = "(Caller placeholder)" + var/list/exploded_string = splittext_char(..(), "(Caller placeholder)") + var/list/trimed_message = list() + for (var/line in exploded_string) + line = trim(line) + if (line) + trimed_message += line + // Rebuild the string without empty lines + . = trimed_message.Join(" ") + /datum/aas_config_entry/rc_new_message - name = "RC Alert: New Message " + name = "RC Alert: New Message" // Yes, players can't use html tags, however they can use speech mods like | or +, but sh-sh-sh, don't tell them! announcement_lines_map = list( "Unauthenticated" = "Message from %SENDER to %RECEIVER: %MESSAGE", diff --git a/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm b/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm index 758fcbb7d6a..b54a3540307 100644 --- a/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm +++ b/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm @@ -102,7 +102,7 @@ GLOBAL_LIST_EMPTY(jam_on_wardec) var/datum/techweb/station_techweb = locate(/datum/techweb/science) in SSresearch.techwebs if(station_techweb) - var/obj/machinery/announcement_system/announcement_system = get_announcement_system() + var/obj/machinery/announcement_system/announcement_system = get_announcement_system(null, null, list(RADIO_CHANNEL_SCIENCE)) if (!isnull(announcement_system)) announcement_system.broadcast("Additional research data received from Nanotrasen R&D Division following the emergency protocol.", list(RADIO_CHANNEL_SCIENCE), TRUE) station_techweb.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = TECHWEB_TIER_5_POINTS * 3)) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm index 7dd07ab5990..ab608377cd8 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm @@ -680,10 +680,14 @@ /datum/aas_config_entry/medical_cryo_announcements/compile_announce(list/variables_map, announcement_line) variables_map["AUTOEJECTING"] = variables_map["EJECTING"] ? announcement_lines_map["Autoejecting"] : "" - . = ..() - // Why double replacetext_char? Well, to handle cases where variable in the middle of sentence like "also %AUTOEJECTING this", so there will be no double spaces - // Yeah I am bad, at this, sorry (it should be a perfect place for regex usage, but I am weak) - . = trim(replacetext_char(replacetext_char(., "\[NO DATA\] ", ""), "\[NO DATA\]", "")) + var/list/exploded_string = splittext_char(..(), "\[NO DATA\]") + var/list/trimed_message = list() + for (var/line in exploded_string) + line = trim(line) + if (line) + trimed_message += line + // Rebuild the string without empty lines + . = trimed_message.Join(" ") #undef MAX_TEMPERATURE #undef CRYO_MULTIPLY_FACTOR diff --git a/code/modules/bitrunning/server/threats.dm b/code/modules/bitrunning/server/threats.dm index d8d79aee766..c8d21785960 100644 --- a/code/modules/bitrunning/server/threats.dm +++ b/code/modules/bitrunning/server/threats.dm @@ -131,7 +131,7 @@ /obj/machinery/quantum_server/proc/station_spawn(mob/living/antag, obj/machinery/byteforge/chosen_forge) antag.balloon_alert(antag, "scanning...") chosen_forge.setup_particles(angry = TRUE) - var/obj/machinery/announcement_system/aas = get_announcement_system(source = src) + var/obj/machinery/announcement_system/aas = get_announcement_system(null, src, list(RADIO_CHANNEL_SUPPLY)) if (aas) aas.broadcast("QUANTUM SERVER ALERT: Security breach detected. Unauthorized entry sequence in progress...", list(RADIO_CHANNEL_SUPPLY)) SEND_SIGNAL(src, COMSIG_BITRUNNER_STATION_SPAWN) diff --git a/code/modules/jobs/job_types/security_officer.dm b/code/modules/jobs/job_types/security_officer.dm index 87bfd0b18c9..298c10b05b7 100644 --- a/code/modules/jobs/job_types/security_officer.dm +++ b/code/modules/jobs/job_types/security_officer.dm @@ -157,7 +157,7 @@ GLOBAL_LIST_EMPTY(security_officer_distribution) department, distribution, ) - var/obj/machinery/announcement_system/announcement_system = get_announcement_system(/datum/aas_config_entry/announce_officer) + var/obj/machinery/announcement_system/announcement_system = get_announcement_system(/datum/aas_config_entry/announce_officer, null, list(RADIO_CHANNEL_SECURITY)) if (isnull(announcement_system)) return diff --git a/code/modules/modular_computers/file_system/programs/dept_order.dm b/code/modules/modular_computers/file_system/programs/dept_order.dm index e640d5ecb37..3677890dd0f 100644 --- a/code/modules/modular_computers/file_system/programs/dept_order.dm +++ b/code/modules/modular_computers/file_system/programs/dept_order.dm @@ -266,7 +266,7 @@ GLOBAL_VAR(department_cd_override) return FALSE /datum/aas_config_entry/department_orders - name = "Departmental Order Announcement" + name = "Departmental: Order Announcement" announcement_lines_map = list( "Order Placed" = "A department order has been placed by %PERSON for %ORDER.", "Cooldown Reset" = "Department order cooldown has expired! A new order may now be placed!", diff --git a/code/modules/reta/reta_debug.dm b/code/modules/reta/reta_debug.dm index 788c303c0cf..32c0660455e 100644 --- a/code/modules/reta/reta_debug.dm +++ b/code/modules/reta/reta_debug.dm @@ -72,51 +72,49 @@ ADMIN_VERB(reta_manual_trigger, R_ADMIN, "RETA Door Access", "Manually trigger R message_admins("RETA access granted successfully: [english_list(granted_depts)] personnel now have [calling_dept] access. Total eligible cards: [total_eligible_cards]") // Send department announcement like the normal system - var/caller_info = " (Called by CENTCOM)" - var/enhanced_location = "[calling_dept][caller_info]" + var/caller_info = "(Called by CENTCOM)" // Send announcements to all successfully granted departments for(var/dept in granted_depts) switch(dept) if("Security") - aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_SECURITY), "Security") + aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = calling_dept, "CALLER" = caller_info), null, list(RADIO_CHANNEL_SECURITY), "Security") if("Engineering") - aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_ENGINEERING), "Engineering") + aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = calling_dept, "CALLER" = caller_info), null, list(RADIO_CHANNEL_ENGINEERING), "Engineering") if("Medical") - aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_MEDICAL), "Medical") + aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = calling_dept, "CALLER" = caller_info), null, list(RADIO_CHANNEL_MEDICAL), "Medical") if("Science") - aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_SCIENCE), "Science") + aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = calling_dept, "CALLER" = caller_info), null, list(RADIO_CHANNEL_SCIENCE), "Science") if("Service") - aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_SERVICE), "Service") + aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = calling_dept, "CALLER" = caller_info), null, list(RADIO_CHANNEL_SERVICE), "Service") if("Command") - aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_COMMAND), "Command") + aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = calling_dept, "CALLER" = caller_info), null, list(RADIO_CHANNEL_COMMAND), "Command") if("Cargo") - aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_SUPPLY), "Cargo") + aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = calling_dept, "CALLER" = caller_info), null, list(RADIO_CHANNEL_SUPPLY), "Cargo") if("Mining") - aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_SUPPLY), "Mining") + aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = calling_dept, "CALLER" = caller_info), null, list(RADIO_CHANNEL_SUPPLY), "Mining") // Send confirmation to the calling department about who has been given access - var/calling_message = "RETA activated[caller_info]. The following now have temporary door access: [english_list(granted_depts)]." + var/grantee = english_list(granted_depts) + var/list/target_channels = list() + switch(calling_dept) + if("Security") + target_channels += RADIO_CHANNEL_SECURITY + if("Engineering") + target_channels += RADIO_CHANNEL_ENGINEERING + if("Medical") + target_channels += RADIO_CHANNEL_MEDICAL + if("Science") + target_channels += RADIO_CHANNEL_SCIENCE + if("Service") + target_channels += RADIO_CHANNEL_SERVICE + if("Command") + target_channels += RADIO_CHANNEL_COMMAND + if("Cargo") + target_channels += RADIO_CHANNEL_SUPPLY + if("Mining") + target_channels += RADIO_CHANNEL_SUPPLY - // Get an announcement system to send simple radio messages - var/obj/machinery/announcement_system/announcer = get_announcement_system(null, null, list(RADIO_CHANNEL_COMMON)) - if(announcer) - switch(calling_dept) - if("Security") - announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_SECURITY) - if("Engineering") - announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_ENGINEERING) - if("Medical") - announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_MEDICAL) - if("Science") - announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_SCIENCE) - if("Service") - announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_SERVICE) - if("Command") - announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_COMMAND) - if("Cargo") - announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_SUPPLY) - if("Mining") - announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_SUPPLY) + aas_config_announce(/datum/aas_config_entry/rc_reta_announcement, list("GRANTEE" = grantee, "CALLER" = caller_info), null, target_channels) else message_admins("RETA access grant failed for all departments.")