From 6bf5172becfe3bee364abb3145bb7574c56e5a00 Mon Sep 17 00:00:00 2001 From: Luc <89928798+lewcc@users.noreply.github.com> Date: Sun, 26 Mar 2023 07:17:37 -0400 Subject: [PATCH] Fix SM (and some other) follow links (#20554) * hoopefully fix SM message tracking being really weird * update some more follow targets * Apply suggestions from code review hehe Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com> * Cleans up some loose ends, implements for arrivals announcer too * Changes target to the new deactivated core --------- Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com> --- code/game/machinery/cloning.dm | 1 + code/game/machinery/cryopod.dm | 1 + code/game/objects/items/collar.dm | 1 + code/game/objects/items/devices/radio/radio_objects.dm | 7 +++++-- code/modules/mining/laborcamp/laborshuttle.dm | 1 + code/modules/mob/living/silicon/ai/latejoin.dm | 5 +++-- code/modules/mob/new_player/new_player.dm | 4 ++-- code/modules/power/supermatter/supermatter.dm | 1 + code/modules/projectiles/guns/energy/special_eguns.dm | 1 + code/modules/security_levels/keycard_authentication.dm | 2 +- 10 files changed, 17 insertions(+), 7 deletions(-) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index eb9e3dc1cdd..359b4e27f6f 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -70,6 +70,7 @@ GLOBAL_LIST_INIT(cloner_biomass_items, list(\ Radio = new /obj/item/radio(src) Radio.listening = FALSE Radio.config(list("Medical" = 0)) + Radio.follow_target = src component_parts = list() component_parts += new /obj/item/circuitboard/clonepod(null) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 363dcaad497..32329fa42a0 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -238,6 +238,7 @@ /obj/machinery/cryopod/Initialize(mapload) . = ..() announce = new /obj/item/radio/intercom(src) + announce.follow_target = src icon_state = base_icon_state find_control_computer() diff --git a/code/game/objects/items/collar.dm b/code/game/objects/items/collar.dm index 6f437071a21..6d58c8c2c53 100644 --- a/code/game/objects/items/collar.dm +++ b/code/game/objects/items/collar.dm @@ -67,6 +67,7 @@ var/area/pet_death_area = get_area(M) var/obj/item/radio/headset/pet_death_announcer = new /obj/item/radio/headset(src) + pet_death_announcer.follow_target = src if(istype(pet_death_area, /area/syndicate_mothership) || istype(pet_death_area, /area/shuttle/syndicate_elite)) //give the syndicats a bit of stealth pet_death_announcer.autosay("[M] has been vandalized in Space!", "[M]'s Death Alarm") diff --git a/code/game/objects/items/devices/radio/radio_objects.dm b/code/game/objects/items/devices/radio/radio_objects.dm index 7d5a1250b56..42e0e044e24 100644 --- a/code/game/objects/items/devices/radio/radio_objects.dm +++ b/code/game/objects/items/devices/radio/radio_objects.dm @@ -253,7 +253,7 @@ GLOBAL_LIST_INIT(default_medbay_channels, list( /obj/item/radio/proc/ToggleReception() listening = !listening && !(wires.is_cut(WIRE_RADIO_RECEIVER) || wires.is_cut(WIRE_RADIO_SIGNAL)) -/obj/item/radio/proc/autosay(message, from, channel, role = "Unknown") //BS12 EDIT +/obj/item/radio/proc/autosay(message, from, channel, role = "Unknown", follow_target_override) //BS12 EDIT var/datum/radio_frequency/connection = null if(channel && channels && channels.len > 0) if(channel == "department") @@ -295,7 +295,10 @@ GLOBAL_LIST_INIT(default_medbay_channels, list( else tcm.source_level = level_name_to_num(MAIN_STATION) // Assume station level if we dont have an actual Z level available to us. tcm.freq = connection.frequency - tcm.follow_target = follow_target + if(follow_target_override) + tcm.follow_target = follow_target_override + else + tcm.follow_target = follow_target // Now put that through the stuff for(var/obj/machinery/tcomms/core/C in GLOB.tcomms_machines) diff --git a/code/modules/mining/laborcamp/laborshuttle.dm b/code/modules/mining/laborcamp/laborshuttle.dm index 2e0204d82d1..f7f9565d8cb 100644 --- a/code/modules/mining/laborcamp/laborshuttle.dm +++ b/code/modules/mining/laborcamp/laborshuttle.dm @@ -40,6 +40,7 @@ /obj/machinery/mineral/labor_prisoner_shuttle_console/Initialize() . = ..() announcer = new /obj/item/radio/intercom(null) + announcer.follow_target = src announcer.config(list("Security" = 0)) /obj/machinery/mineral/labor_prisoner_shuttle_console/Destroy() diff --git a/code/modules/mob/living/silicon/ai/latejoin.dm b/code/modules/mob/living/silicon/ai/latejoin.dm index 429f442fc71..a0a4d3f5fa9 100644 --- a/code/modules/mob/living/silicon/ai/latejoin.dm +++ b/code/modules/mob/living/silicon/ai/latejoin.dm @@ -12,8 +12,9 @@ GLOBAL_LIST_EMPTY(empty_playable_ai_cores) cryo_AI() /mob/living/silicon/ai/proc/cryo_AI() - GLOB.empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(loc) - GLOB.global_announcer.autosay("[src] has been moved to intelligence storage.", "Artificial Intelligence Oversight") + var/dead_aicore = new /obj/structure/AIcore/deactivated(loc) + GLOB.empty_playable_ai_cores += dead_aicore + GLOB.global_announcer.autosay("[src] has been moved to intelligence storage.", "Artificial Intelligence Oversight", follow_target_override = dead_aicore) //Handle job slot/tater cleanup. var/job = mind.assigned_role diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 4c3cc4c2247..5f91cb08250 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -416,7 +416,7 @@ if((character.mind.assigned_role != "Cyborg") && (character.mind.assigned_role != character.mind.special_role)) if(character.mind.role_alt_title) rank = character.mind.role_alt_title - GLOB.global_announcer.autosay("[character.real_name],[rank ? " [rank]," : " visitor," ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer") + GLOB.global_announcer.autosay("[character.real_name],[rank ? " [rank]," : " visitor," ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer", follow_target_override = character) /mob/new_player/proc/AnnounceCyborg(mob/living/character, rank, join_message) if(SSticker.current_state == GAME_STATE_PLAYING) @@ -433,7 +433,7 @@ if(character.mind) if(character.mind.assigned_role != character.mind.special_role) // can't use their name here, since cyborg namepicking is done post-spawn, so we'll just say "A new Cyborg has arrived"/"A new Android has arrived"/etc. - GLOB.global_announcer.autosay("A new[rank ? " [rank]" : " visitor" ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer") + GLOB.global_announcer.autosay("A new[rank ? " [rank]" : " visitor" ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer", follow_target_override = character) /mob/new_player/proc/LateChoices() var/mills = ROUND_TIME // 1/10 of a second, not real milliseconds but whatever diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index ebc92cd8d87..35b58a6e265 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -201,6 +201,7 @@ GLOB.poi_list |= src radio = new(src) radio.listening = FALSE + radio.follow_target = src radio.config(list("Engineering" = 0)) investigate_log("has been created.", "supermatter") diff --git a/code/modules/projectiles/guns/energy/special_eguns.dm b/code/modules/projectiles/guns/energy/special_eguns.dm index 930e537f610..6505ed38ae1 100644 --- a/code/modules/projectiles/guns/energy/special_eguns.dm +++ b/code/modules/projectiles/guns/energy/special_eguns.dm @@ -747,6 +747,7 @@ . = ..() Announcer = new /obj/item/radio/headset(src) Announcer.config(list("Security" = 1)) + Announcer.follow_target = src options["The Original"] = "handgun" options["Golden Mamba"] = "handgun_golden-mamba" options["NT's Finest"] = "handgun_nt-finest" diff --git a/code/modules/security_levels/keycard_authentication.dm b/code/modules/security_levels/keycard_authentication.dm index 45da8899c1b..0db0068b235 100644 --- a/code/modules/security_levels/keycard_authentication.dm +++ b/code/modules/security_levels/keycard_authentication.dm @@ -188,7 +188,7 @@ atom_say("All Emergency Response Teams are dispatched and can not be called at this time.") return atom_say("ERT request transmitted!") - GLOB.command_announcer.autosay("ERT request transmitted. Reason: [ert_reason]", name) + GLOB.command_announcer.autosay("ERT request transmitted. Reason: [ert_reason]", name, follow_target_override = src) print_centcom_report(ert_reason, station_time_timestamp() + " ERT Request") var/fullmin_count = 0