From ff7509003113bdd5f773bb23faf6e7db6ac81c57 Mon Sep 17 00:00:00 2001 From: TheGamerdk <5618080+TheGamerdk@users.noreply.github.com> Date: Tue, 1 Aug 2023 23:58:23 +0200 Subject: [PATCH] Removed old stuff --- code/modules/cm_marines/overwatch.dm | 626 +-------------------------- 1 file changed, 20 insertions(+), 606 deletions(-) diff --git a/code/modules/cm_marines/overwatch.dm b/code/modules/cm_marines/overwatch.dm index 3afb632f5223..2a7f10b2d2aa 100644 --- a/code/modules/cm_marines/overwatch.dm +++ b/code/modules/cm_marines/overwatch.dm @@ -32,9 +32,6 @@ var/list/saved_coordinates = list() - //DELETE THIS - var/tgui = TRUE - var/list/camera_holders = list() var/list/multicam_marines = list() @@ -144,9 +141,7 @@ to_chat(user, SPAN_WARNING("You don't have the training to use [src].")) return - if(tgui) - tgui_interact(user) - return + tgui_interact(user) user.set_interaction(src) var/dat = "" @@ -396,6 +391,8 @@ data["ob_cooldown"] = COOLDOWN_TIMELEFT(almayer_orbital_cannon, ob_firing_cooldown) data["ob_loaded"] = almayer_orbital_cannon.chambered_tray + data["operator"] = operator.name + return data /obj/structure/machinery/computer/overwatch/ui_state(mob/user) @@ -501,7 +498,7 @@ if("replace_lead") if(!params["ref"]) return - change_lead_tgui(params["ref"]) + change_lead(params["ref"]) if("insubordination") mark_insubordination() @@ -600,6 +597,21 @@ return multicam_marines -= marine update_multicams() + if("change_operator") + if(operator != user) + if(operator && ishighersilicon(operator)) + visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("AI override in progress. Access denied.")]") + return + if(!current_squad || current_squad.assume_overwatch(user)) + operator = user + if(ishighersilicon(user)) + to_chat(user, "[icon2html(src, usr)] [SPAN_BOLDNOTICE("Overwatch system AI override protocol successful.")]") + current_squad?.send_squad_message("Attention. [operator.name] has engaged overwatch system control override.", displayed_icon = src) + else + var/mob/living/carbon/human/H = operator + var/obj/item/card/id/ID = H.get_idcard() + visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("Basic overwatch systems initialized. Welcome, [ID ? "[ID.rank] ":""][operator.name]. Please select a squad.")]") + current_squad?.send_squad_message("Attention. Your Overwatch officer is now [ID ? "[ID.rank] ":""][operator.name].", displayed_icon = src) /obj/structure/machinery/computer/overwatch/proc/update_multicams() var/index = 1 @@ -609,7 +621,7 @@ index++ -/obj/structure/machinery/computer/overwatch/proc/change_lead_tgui(sl_ref) +/obj/structure/machinery/computer/overwatch/proc/change_lead(sl_ref) if(!usr) return var/mob/user = usr @@ -675,546 +687,12 @@ selected_sl.update_inv_wear_suit() -/obj/structure/machinery/computer/overwatch/proc/get_base_menu_text() - var/dat = "" - - if(!current_squad) //No squad has been set yet. Pick one. - dat += "Current Squad: ----------
" - return dat; - - dat += "Current Squad: [current_squad.name] Squad " - dat += "Message Squad

" - dat += "Toggle Tactical Map" - dat += "

" - if(current_squad.squad_leader) - dat += "Squad Leader: [current_squad.squad_leader.name] " - dat += "MSG " - dat += "CHANGE SQUAD LEADER

" - else - dat += "Squad Leader: NONE ASSIGN SQUAD LEADER

" - - dat += "Primary Objective: " - if(current_squad.primary_objective) - dat += "Check Set
" - else - dat += "NONE! Set
" - dat += "Secondary Objective: " - if(current_squad.secondary_objective) - dat += "Check Set
" - else - dat += "NONE! Set
" - dat += "
" - dat += "Report a marine for insubordination
" - dat += "Transfer a marine to another squad

" - - dat += "Supply Drop Control
" - dat += "Orbital Bombardment Control
" - dat += "Squad Monitor
" - dat += "
" - dat += "Refresh" - - return dat - -/obj/structure/machinery/computer/overwatch/proc/get_info_screen_text() - var/dat = "" - - dat += {" - - "} - - if(!current_squad) - dat += "No Squad selected!
" - else - var/leader_text = "" - var/leader_count = 0 - var/tl_text = "" - var/tl_count = 0 - var/spec_text = "" - var/spec_count = 0 - var/medic_text = "" - var/medic_count = 0 - var/engi_text = "" - var/engi_count = 0 - var/smart_text = "" - var/smart_count = 0 - var/marine_text = "" - var/marine_count = 0 - var/misc_text = "" - var/living_count = 0 - - var/conscious_text = "" - var/unconscious_text = "" - var/dead_text = "" - - var/SL_z //z level of the Squad Leader - if(current_squad.squad_leader) - var/turf/SL_turf = get_turf(current_squad.squad_leader) - SL_z = SL_turf.z - - - for(var/X in current_squad.marines_list) - if(!X) - continue //just to be safe - var/mob_name = "unknown" - var/mob_state = "" - var/role = "unknown" - var/act_sl = "" - var/fteam = "" - var/dist = "???" - var/area_name = "???" - var/mob/living/carbon/human/H - - var/is_filtered = FALSE - if(X && ("\ref[X]" in marine_filter)) - is_filtered = TRUE - - if(ishuman(X)) - H = X - mob_name = H.real_name - var/area/A = get_area(H) - var/turf/M_turf = get_turf(H) - if(!M_turf) - continue - if(A) - area_name = sanitize_area(A.name) - - switch(z_hidden) - if(HIDE_ALMAYER) - if(is_mainship_level(M_turf.z)) - continue - if(HIDE_GROUND) - if(is_ground_level(M_turf.z)) - continue - - if(H.job) - role = H.job - else if(istype(H.wear_id, /obj/item/card/id)) //decapitated marine is mindless, - var/obj/item/card/id/ID = H.wear_id //we use their ID to get their role. - if(ID.rank) role = ID.rank - - if(current_squad.squad_leader) - if(H == current_squad.squad_leader) - dist = "N/A" - if(current_squad.name == SQUAD_SOF) - if(H.job == JOB_MARINE_RAIDER_CMD) - act_sl = " (direct command)" - else if(H.job != JOB_MARINE_RAIDER_SL) - act_sl = " (acting TL)" - else if(H.job != JOB_SQUAD_LEADER) - act_sl = " (acting SL)" - else if(M_turf && (M_turf.z == SL_z)) - dist = "[get_dist(H, current_squad.squad_leader)] ([dir2text_short(get_dir(current_squad.squad_leader, H))])" - - if(is_filtered && marine_filter_enabled) - continue - - switch(H.stat) - if(CONSCIOUS) - mob_state = "Conscious" - living_count++ - conscious_text += "[mob_name][role][act_sl][mob_state][area_name][dist][is_filtered ? "Show" : "Hide"]" - - if(UNCONSCIOUS) - mob_state = "Unconscious" - living_count++ - unconscious_text += "[mob_name][role][act_sl][mob_state][area_name][dist][is_filtered ? "Show" : "Hide"]" - - if(DEAD) - if(dead_hidden) - continue - mob_state = SET_CLASS("DEAD", INTERFACE_RED) - dead_text += "[mob_name][role][act_sl][mob_state][area_name][dist][is_filtered ? "Show" : "Hide"]" - - if(!istype(H.head, /obj/item/clothing/head/helmet/marine)) - mob_state += SET_CLASS(" (NO HELMET)", INTERFACE_ORANGE) - - if(!H.key || !H.client) - if(H.stat != DEAD) - mob_state += " (SSD)" - - - if(H.assigned_fireteam) - fteam = " [H.assigned_fireteam]" - - else //listed marine was deleted or gibbed, all we have is their name - if(dead_hidden) - continue - if(z_hidden) //gibbed marines are neither on the colony nor on the almayer - continue - for(var/datum/data/record/t in GLOB.data_core.general) - if(t.fields["name"] == X) - role = t.fields["real_rank"] - break - mob_state = SET_CLASS("DEAD", INTERFACE_RED) - mob_name = X - - dead_text += "[mob_name][role][act_sl][mob_state][area_name][dist][is_filtered ? "Show" : "Hide"]" - - - var/marine_infos = "[mob_name][role][act_sl][fteam][mob_state][area_name][dist][is_filtered ? "Show" : "Hide"]" - switch(role) - if(JOB_SQUAD_LEADER) - leader_text += marine_infos - leader_count++ - if(JOB_SQUAD_TEAM_LEADER) - tl_text += marine_infos - tl_count++ - if(JOB_SQUAD_SPECIALIST) - spec_text += marine_infos - spec_count++ - if(JOB_SQUAD_MEDIC) - medic_text += marine_infos - medic_count++ - if(JOB_SQUAD_ENGI) - engi_text += marine_infos - engi_count++ - if(JOB_SQUAD_SMARTGUN) - smart_text += marine_infos - smart_count++ - if(JOB_SQUAD_MARINE) - marine_text += marine_infos - marine_count++ - else - misc_text += marine_infos - - dat += "[leader_count ? "Squad Leader Deployed" : SET_CLASS("No Squad Leader Deployed!", INTERFACE_RED)]
" - dat += "Fireteam Leaders: [tl_count ? "[tl_count]" : SET_CLASS("No Fireteam Leaders Deployed!", INTERFACE_RED)]
" - dat += "[spec_count ? "Squad Specialist Deployed" : SET_CLASS("No Specialist Deployed!", INTERFACE_RED)]
" - dat += "[smart_count ? "Squad Smartgunner Deployed" : SET_CLASS("No Smartgunner Deployed!", INTERFACE_RED)]
" - dat += "Squad Hospital Corpsmen: [medic_count] Deployed | Squad Combat Technicians: [engi_count] Deployed
" - dat += "Squad Riflemen: [marine_count] Deployed
" - dat += "Total: [current_squad.marines_list.len] Deployed
" - dat += "Marines alive: [living_count]


" - dat += "
Search:
" - dat += "" - dat += "" - if(!living_marines_sorting) - dat += leader_text + tl_text + spec_text + medic_text + engi_text + smart_text + marine_text + misc_text - else - dat += conscious_text + unconscious_text + dead_text - dat += "
NameRoleStateLocationSL DistanceFilter
" - dat += "

" - dat += "Refresh
" - dat += "Change Sorting Method
" - dat += "[dead_hidden ? "Show Dead Marines" : "Hide Dead Marines" ]
" - dat += "[marine_filter_enabled ? "Disable Marine Filter" : "Enable Marine Filter"]
" - dat += "Change Locations Ignored
" - dat += "
Back" - return dat - -/obj/structure/machinery/computer/overwatch/proc/get_supply_drop_menu_text() - var/dat = "Supply Drop Control

" - if(!current_squad) - dat += "No squad selected!" - else - dat += "Current Supply Drop Status: " - var/cooldown_left = COOLDOWN_TIMELEFT(current_squad, next_supplydrop) - if(cooldown_left > 0) - dat += "Launch tubes resetting ([round(cooldown_left/10)] seconds)
" - else - dat += SET_CLASS("Ready!", INTERFACE_GREEN) - dat += "
" - dat += "Launch Pad Status: " - var/obj/structure/closet/crate/C = locate() in current_squad.drop_pad.loc - if(C) - dat += SET_CLASS("Supply crate loaded", INTERFACE_GREEN) - dat += "
" - else - dat += "Empty
" - dat += "Longitude: [x_supply] Change
" - dat += "Latitude: [y_supply] Change

" - dat += "LAUNCH!" - dat += "

" - dat += "Refresh
" - dat += "Back" - return dat - -/obj/structure/machinery/computer/overwatch/proc/get_orbital_bombardment_control_text() - var/dat = "Orbital Bombardment Control

" - if(!current_squad) - dat += "No squad selected!" - else - dat += "Current Cannon Status: " - var/cooldown_left = COOLDOWN_TIMELEFT(almayer_orbital_cannon, ob_firing_cooldown) - if(almayer_orbital_cannon.is_disabled) - dat += "Cannon is disabled!
" - else if(cooldown_left > 0) - dat += "Cannon on cooldown ([round(cooldown_left/10)] seconds)
" - else if(!almayer_orbital_cannon.chambered_tray) - dat += SET_CLASS("No ammo chambered in the cannon.", INTERFACE_RED) - dat += "
" - else - dat += SET_CLASS("Ready!", INTERFACE_GREEN) - dat += "
" - dat += "Longitude: [x_bomb] Change
" - dat += "Latitude: [y_bomb] Change

" - dat += "FIRE!" - dat += "

" - dat += "Refresh
" - dat += "Back" - return dat - -/obj/structure/machinery/computer/overwatch/Topic(href, href_list) - if(..()) - return - if(!href_list["operation"]) - return - - if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (ishighersilicon(usr))) - usr.set_interaction(src) - - switch(href_list["operation"]) - // main interface - if("mapview") - tacmap.tgui_interact(usr) - if("back") - state = 0 - if("monitor") - state = 1 - if("supplies") - state = 2 - if("bombs") - state = 3 - if("change_operator") - if(operator != usr) - if(operator && ishighersilicon(operator)) - visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("AI override in progress. Access denied.")]") - return - if(!current_squad || current_squad.assume_overwatch(usr)) - operator = usr - if(ishighersilicon(usr)) - to_chat(usr, "[icon2html(src, usr)] [SPAN_BOLDNOTICE("Overwatch system AI override protocol successful.")]") - current_squad?.send_squad_message("Attention. [operator.name] has engaged overwatch system control override.", displayed_icon = src) - else - var/mob/living/carbon/human/H = operator - var/obj/item/card/id/ID = H.get_idcard() - visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("Basic overwatch systems initialized. Welcome, [ID ? "[ID.rank] ":""][operator.name]. Please select a squad.")]") - current_squad?.send_squad_message("Attention. Your Overwatch officer is now [ID ? "[ID.rank] ":""][operator.name].", displayed_icon = src) - if("logout") - if(current_squad?.release_overwatch()) - if(ishighersilicon(usr)) - current_squad.send_squad_message("Attention. [operator.name] has released overwatch system control. Overwatch functions deactivated.", displayed_icon = src) - to_chat(usr, "[icon2html(src, usr)] [SPAN_BOLDNOTICE("Overwatch system control override disengaged.")]") - else - var/mob/living/carbon/human/H = operator - var/obj/item/card/id/ID = H.get_idcard() - current_squad.send_squad_message("Attention. [ID ? "[ID.rank] ":""][operator ? "[operator.name]":"sysadmin"] is no longer your Overwatch officer. Overwatch functions deactivated.", displayed_icon = src) - visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("Overwatch systems deactivated. Goodbye, [ID ? "[ID.rank] ":""][operator ? "[operator.name]":"sysadmin"].")]") - operator = null - current_squad = null - if(cam && !ishighersilicon(usr)) - usr.reset_view(null) - usr.UnregisterSignal(cam, COMSIG_PARENT_QDELETING) - cam = null - state = 0 - if("pick_squad") - if(operator == usr) - if(current_squad) - to_chat(usr, SPAN_WARNING("[icon2html(src, usr)] You are already selecting a squad.")) - else - var/list/squad_list = list() - for(var/datum/squad/S in RoleAuthority.squads) - if(S.active && !S.overwatch_officer && S.faction == faction && S.name != "Root") - squad_list += S.name - - var/name_sel = tgui_input_list(usr, "Which squad would you like to claim for Overwatch?", "Claim Squad", squad_list) - if(!name_sel) - return - if(operator != usr) - return - if(current_squad) - to_chat(usr, SPAN_WARNING("[icon2html(src, usr)] You are already selecting a squad.")) - return - var/datum/squad/selected = get_squad_by_name(name_sel) - if(selected) - //Link everything together, squad, console, and officer - if(selected.assume_overwatch(usr)) - current_squad = selected - current_squad.send_squad_message("Attention - Your squad has been selected for Overwatch. Check your Status pane for objectives.", displayed_icon = src) - current_squad.send_squad_message("Your Overwatch officer is: [operator.name].", displayed_icon = src) - visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("Tactical data for squad '[current_squad]' loaded. All tactical functions initialized.")]") - attack_hand(usr) - else - to_chat(usr, "[icon2html(src, usr)] [SPAN_WARNING("Invalid input. Aborting.")]") - if("message") - if(current_squad && operator == usr) - var/input = sanitize_control_chars(stripped_input(usr, "Please write a message to announce to the squad:", "Squad Message")) - if(input) - current_squad.send_message(input, 1) //message, adds username - current_squad.send_maptext(input, "Squad Message:") - visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("Message '[input]' sent to all Marines of squad '[current_squad]'.")]") - log_overwatch("[key_name(usr)] sent '[input]' to squad [current_squad].") - if("sl_message") - if(current_squad && operator == usr) - var/input = sanitize_control_chars(stripped_input(usr, "Please write a message to announce to the squad leader:", "SL Message")) - if(input) - current_squad.send_message(input, 1, 1) //message, adds username, only to leader - current_squad.send_maptext(input, "Squad Leader Message:", 1) - visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("Message '[input]' sent to Squad Leader [current_squad.squad_leader] of squad '[current_squad]'.")]") - log_overwatch("[key_name(usr)] sent '[input]' to Squad Leader [current_squad.squad_leader] of squad [current_squad].") - if("check_primary") - if(current_squad) //This is already checked, but ehh. - if(current_squad.primary_objective) - visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("Reminding primary objectives of squad '[current_squad]'.")]") - to_chat(usr, "[icon2html(src, usr)] Primary Objective: [current_squad.primary_objective]") - if("check_secondary") - if(current_squad) //This is already checked, but ehh. - if(current_squad.secondary_objective) - visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("Reminding secondary objectives of squad '[current_squad]'.")]") - to_chat(usr, "[icon2html(src, usr)] Secondary Objective: [current_squad.secondary_objective]") - if("set_primary") - var/input = sanitize_control_chars(stripped_input(usr, "What will be the squad's primary objective?", "Primary Objective")) - if(current_squad && input) - current_squad.primary_objective = "[input] ([worldtime2text()])" - current_squad.send_message("Your primary objective has been changed to '[input]'. See Status pane for details.") - current_squad.send_maptext(input, "Primary Objective Updated:") - visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("Primary objective of squad '[current_squad]' set to '[input]'.")]") - log_overwatch("[key_name(usr)] set [current_squad]'s primary objective to '[input]'.") - if("set_secondary") - var/input = sanitize_control_chars(stripped_input(usr, "What will be the squad's secondary objective?", "Secondary Objective")) - if(input) - current_squad.secondary_objective = input + " ([worldtime2text()])" - current_squad.send_message("Your secondary objective has been changed to '[input]'. See Status pane for details.") - current_squad.send_maptext(input, "Secondary Objective Updated:") - visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("Secondary objective of squad '[current_squad]' set to '[input]'.")]") - log_overwatch("[key_name(usr)] set [current_squad]'s secondary objective to '[input]'.") - if("supply_x") - var/input = tgui_input_real_number(usr,"What longitude should be targetted? (Increments towards the east)", "X Coordinate", 0) - to_chat(usr, "[icon2html(src, usr)] [SPAN_NOTICE("Longitude is now [input].")]") - x_supply = input - if("supply_y") - var/input = tgui_input_real_number(usr,"What latitude should be targetted? (Increments towards the north)", "Y Coordinate", 0) - to_chat(usr, "[icon2html(src, usr)] [SPAN_NOTICE("Latitude is now [input].")]") - y_supply = input - if("bomb_x") - var/input = tgui_input_real_number(usr,"What longitude should be targetted? (Increments towards the east)", "X Coordinate", 0) - to_chat(usr, "[icon2html(src, usr)] [SPAN_NOTICE("Longitude is now [input].")]") - x_bomb = input - if("bomb_y") - var/input = tgui_input_real_number(usr,"What latitude should be targetted? (Increments towards the north)", "Y Coordinate", 0) - to_chat(usr, "[icon2html(src, usr)] [SPAN_NOTICE("Latitude is now [input].")]") - y_bomb = input - if("refresh") - attack_hand(usr) - if("change_sort") - living_marines_sorting = !living_marines_sorting - if(living_marines_sorting) - to_chat(usr, "[icon2html(src, usr)] [SPAN_NOTICE("Marines are now sorted by health status.")]") - else - to_chat(usr, "[icon2html(src, usr)] [SPAN_NOTICE("Marines are now sorted by rank.")]") - if("hide_dead") - dead_hidden = !dead_hidden - if(dead_hidden) - to_chat(usr, "[icon2html(src, usr)] [SPAN_NOTICE("Dead marines are now not shown.")]") - else - to_chat(usr, "[icon2html(src, usr)] [SPAN_NOTICE("Dead marines are now shown again.")]") - if("choose_z") - switch(z_hidden) - if(HIDE_NONE) - z_hidden = HIDE_ALMAYER - to_chat(usr, "[icon2html(src, usr)] [SPAN_NOTICE("Marines on the Almayer are now hidden.")]") - if(HIDE_ALMAYER) - z_hidden = HIDE_GROUND - to_chat(usr, "[icon2html(src, usr)] [SPAN_NOTICE("Marines on the ground are now hidden.")]") - else - z_hidden = HIDE_NONE - to_chat(usr, "[icon2html(src, usr)] [SPAN_NOTICE("No location is ignored anymore.")]") - - if("toggle_marine_filter") - if(marine_filter_enabled) - marine_filter_enabled = FALSE - to_chat(usr, "[icon2html(src, usr)] [SPAN_NOTICE("All marines will now be shown regardless of filter.")]") - else - marine_filter_enabled = TRUE - to_chat(usr, "[icon2html(src, usr)] [SPAN_NOTICE("Individual Marine Filter is now enabled.")]") - if("filter_marine") - if (current_squad) - var/squaddie = href_list["squaddie"] - if(!(squaddie in marine_filter)) - marine_filter += squaddie - to_chat(usr, "[icon2html(src, usr)] [SPAN_NOTICE("Marine now hidden.")]") - else - marine_filter -= squaddie - to_chat(usr, "[icon2html(src, usr)] [SPAN_NOTICE("Marine will now be shown.")]") - if("change_lead") - change_lead() - if("insubordination") - mark_insubordination() - if("squad_transfer") - transfer_squad() - if("dropsupply") - if(current_squad) - if(!COOLDOWN_FINISHED(current_squad, next_supplydrop)) - to_chat(usr, "[icon2html(src, usr)] [SPAN_WARNING("Supply drop not yet ready to launch again!")]") - else - handle_supplydrop() - if("dropbomb") - if(almayer_orbital_cannon.is_disabled) - to_chat(usr, "[icon2html(src, usr)] [SPAN_WARNING("Orbital bombardment cannon disabled!")]") - else if(!COOLDOWN_FINISHED(almayer_orbital_cannon, ob_firing_cooldown)) - to_chat(usr, "[icon2html(src, usr)] [SPAN_WARNING("Orbital bombardment cannon not yet ready to fire again! Please wait [COOLDOWN_TIMELEFT(almayer_orbital_cannon, ob_firing_cooldown)/10] seconds.")]") - else - handle_bombard(usr) - if("back") - state = 0 - if("use_cam") - if(isRemoteControlling(usr)) - to_chat(usr, "[icon2html(src, usr)] [SPAN_WARNING("Unable to override console camera viewer. Track with camera instead. ")]") - return - if(current_squad) - var/mob/cam_target = locate(href_list["cam_target"]) - var/obj/structure/machinery/camera/new_cam = get_camera_from_target(cam_target) - if(!new_cam || !new_cam.can_use()) - to_chat(usr, "[icon2html(src, usr)] [SPAN_WARNING("Searching for helmet cam. No helmet cam found for this marine! Tell your squad to put their helmets on!")]") - else if(cam && cam == new_cam)//click the camera you're watching a second time to stop watching. - visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("Stopping helmet cam view of [cam_target].")]") - usr.UnregisterSignal(cam, COMSIG_PARENT_QDELETING) - cam = null - usr.reset_view(null) - else if(usr.client.view != world_view_size) - to_chat(usr, SPAN_WARNING("You're too busy peering through binoculars.")) - else - if(cam) - usr.UnregisterSignal(cam, COMSIG_PARENT_QDELETING) - cam = new_cam - usr.reset_view(cam) - usr.RegisterSignal(cam, COMSIG_PARENT_QDELETING, TYPE_PROC_REF(/mob, reset_observer_view_on_deletion)) - attack_hand(usr) //The above doesn't ever seem to work. - /obj/structure/machinery/computer/overwatch/check_eye(mob/user) if(user.is_mob_incapacitated(TRUE) || get_dist(user, src) > 1 || user.blinded) //user can't see - not sure why canmove is here. user.unset_interaction() else if(!cam || !cam.can_use()) //camera doesn't work, is no longer selected or is gone user.unset_interaction() -/obj/structure/machinery/computer/overwatch/on_unset_interaction(mob/user) - ..() - if(!isRemoteControlling(user)) - if(cam) - user.UnregisterSignal(cam, COMSIG_PARENT_QDELETING) - cam = null - user.reset_view(null) /obj/structure/machinery/computer/overwatch/ui_close(mob/user) ..() @@ -1251,70 +729,6 @@ to_chat(M, SPAN_HIGHDANGER("Orbital bombardment launch command detected!")) to_chat(M, SPAN_DANGER("Launch command informs [ob_type] warhead. Estimated impact area: [ob_area.name]")) -/obj/structure/machinery/computer/overwatch/proc/change_lead() - if(!usr || usr != operator) - return - if(!current_squad) - to_chat(usr, "[icon2html(src, usr)] [SPAN_WARNING("No squad selected!")]") - return - var/sl_candidates = list() - for(var/mob/living/carbon/human/H in current_squad.marines_list) - if(istype(H) && H.stat != DEAD && H.mind && !jobban_isbanned(H, JOB_SQUAD_LEADER)) - sl_candidates += H - var/new_lead = tgui_input_list(usr, "Choose a new Squad Leader", "Replace SL", sl_candidates) - if(!new_lead || new_lead == "Cancel") - return - var/mob/living/carbon/human/H = new_lead - if(!istype(H) || !H.mind || H.stat == DEAD) //marines_list replaces mob refs of gibbed marines with just a name string - to_chat(usr, "[icon2html(src, usr)] [SPAN_WARNING("[H] is KIA!")]") - return - if(H == current_squad.squad_leader) - to_chat(usr, "[icon2html(src, usr)] [SPAN_WARNING("[H] is already the Squad Leader!")]") - return - if(jobban_isbanned(H, JOB_SQUAD_LEADER)) - to_chat(usr, "[icon2html(src, usr)] [SPAN_WARNING("[H] is unfit to lead!")]") - return - if(current_squad.squad_leader) - current_squad.send_message("Attention: [current_squad.squad_leader] is [current_squad.squad_leader.stat == DEAD ? "stepping down" : "demoted"]. A new Squad Leader has been set: [H.real_name].") - visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("Squad Leader [current_squad.squad_leader] of squad '[current_squad]' has been [current_squad.squad_leader.stat == DEAD ? "replaced" : "demoted and replaced"] by [H.real_name]! Logging to enlistment files.")]") - var/old_lead = current_squad.squad_leader - current_squad.demote_squad_leader(current_squad.squad_leader.stat != DEAD) - SStracking.start_tracking(current_squad.tracking_id, old_lead) - else - current_squad.send_message("Attention: A new Squad Leader has been set: [H.real_name].") - visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("[H.real_name] is the new Squad Leader of squad '[current_squad]'! Logging to enlistment file.")]") - - to_chat(H, "[icon2html(src, H)] Overwatch: You've been promoted to \'[H.job == JOB_SQUAD_LEADER ? "SQUAD LEADER" : "ACTING SQUAD LEADER"]\' for [current_squad.name]. Your headset has access to the command channel (:v).") - to_chat(usr, "[icon2html(src, usr)] [H.real_name] is [current_squad]'s new leader!") - - if(H.assigned_fireteam) - if(H == current_squad.fireteam_leaders[H.assigned_fireteam]) - current_squad.unassign_ft_leader(H.assigned_fireteam, TRUE, FALSE) - current_squad.unassign_fireteam(H, FALSE) - - current_squad.squad_leader = H - current_squad.update_squad_leader() - current_squad.update_free_mar() - - SStracking.set_leader(current_squad.tracking_id, H) - SStracking.start_tracking("marine_sl", H) - - if(H.job == JOB_SQUAD_LEADER)//a real SL - H.comm_title = "SL" - else //an acting SL - H.comm_title = "aSL" - ADD_TRAIT(H, TRAIT_LEADERSHIP, TRAIT_SOURCE_SQUAD_LEADER) - - var/obj/item/device/radio/headset/almayer/marine/R = H.get_type_in_ears(/obj/item/device/radio/headset/almayer/marine) - if(R) - R.keys += new /obj/item/device/encryptionkey/squadlead/acting(R) - R.recalculateChannels() - if(istype(H.wear_id, /obj/item/card/id)) - var/obj/item/card/id/ID = H.wear_id - ID.access += ACCESS_MARINE_LEADER - H.hud_set_squad() - H.update_inv_head() //updating marine helmet leader overlays - H.update_inv_wear_suit() /obj/structure/machinery/computer/overwatch/proc/mark_insubordination() if(!usr)