From 27bc14c6e7826e351a73b6035310bff8877933e0 Mon Sep 17 00:00:00 2001 From: Morrow Date: Tue, 14 Nov 2023 01:35:13 -0500 Subject: [PATCH] auto headset tracking --- code/game/jobs/job/marine/squads.dm | 18 ++++++++++++++++++ .../objects/items/devices/radio/headset.dm | 13 ++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/code/game/jobs/job/marine/squads.dm b/code/game/jobs/job/marine/squads.dm index b50d5a2ae0..ad06315ba4 100644 --- a/code/game/jobs/job/marine/squads.dm +++ b/code/game/jobs/job/marine/squads.dm @@ -752,6 +752,12 @@ if(fireteam == "SQ2") H.wear_id.access += ACCESS_SQUAD_TWO + for(var/obj/item/device/radio/headset/cycled_headset in H) + if(!("Squad Sergeant" in cycled_headset.tracking_options)) + continue + + cycled_headset.locate_setting = cycled_headset.tracking_options["Squad Sergeant"] + /datum/squad/proc/unassign_fireteam(mob/living/carbon/human/H, upd_ui = TRUE) fireteams[H.assigned_fireteam].Remove(H) var/ft = H.assigned_fireteam @@ -769,6 +775,12 @@ if(H.wear_id) H.wear_id.access.Remove(ACCESS_SQUAD_ONE, ACCESS_SQUAD_TWO) + for(var/obj/item/device/radio/headset/cycled_headset in H) + if(!("Platoon Sergeant" in cycled_headset.tracking_options)) + continue + + cycled_headset.locate_setting = cycled_headset.tracking_options["Platoon Sergeant"] + /datum/squad/proc/assign_ft_leader(fireteam, mob/living/carbon/human/H, upd_ui = TRUE) if(fireteam_leaders[fireteam]) unassign_ft_leader(fireteam, FALSE, FALSE) @@ -780,6 +792,12 @@ if(H.stat == CONSCIOUS) to_chat(H, FONT_SIZE_HUGE(SPAN_BLUE("You were assigned as [fireteam] Team Leader."))) + for(var/obj/item/device/radio/headset/cycled_headset in H) + if(!("Platoon Sergeant" in cycled_headset.tracking_options)) + continue + + cycled_headset.locate_setting = cycled_headset.tracking_options["Platoon Sergeant"] + /datum/squad/proc/unassign_ft_leader(fireteam, clear_group_id, upd_ui = TRUE) if(!fireteam_leaders[fireteam]) return diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index c3320e031e..f15c5b40e4 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -33,7 +33,7 @@ var/has_hud = FALSE var/headset_hud_on = FALSE - var/locate_setting = TRACKER_FTL + var/locate_setting = TRACKER_SL var/misc_tracking = FALSE var/hud_type = MOB_HUD_FACTION_USCM var/default_freq @@ -406,6 +406,17 @@ frequency = PUB_FREQ has_hud = TRUE +/obj/item/device/radio/headset/almayer/equipped(mob/living/carbon/human/user, slot) + . = ..() + + if((user == user.assigned_squad?.fireteam_leaders["SQ1"] || user == user.assigned_squad?.fireteam_leaders["SQ2"]) && ("Platoon Sergeant" in tracking_options)) + locate_setting = tracking_options["Platoon Sergeant"] + return + + if(((user in user.assigned_squad?.fireteams["SQ1"]) || (user in user.assigned_squad?.fireteams["SQ2"])) && ("Squad Sergeant" in tracking_options)) + locate_setting = tracking_options["Squad Sergeant"] + return + /obj/item/device/radio/headset/almayer/verb/enter_tree() set name = "Enter Techtree" set desc = "Enter the Marine techtree"