diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm index d9bb78db778..fc32f40e931 100644 --- a/code/game/machinery/bots/medbot.dm +++ b/code/game/machinery/bots/medbot.dm @@ -594,7 +594,14 @@ /obj/machinery/bot/medbot/proc/declare_critical(var/crit_patient) var/area/location = get_area(src) for(var/mob/living/carbon/human/human in world) - if((human.z == src.z) && istype(human.glasses, /obj/item/clothing/glasses/hud/health) | istype(human.glasses, /obj/item/clothing/glasses/hud/health_advanced) && !human.blinded) + if((human.z == src.z) && istype(human.glasses, /obj/item/clothing/glasses/hud/health) || istype(human.glasses, /obj/item/clothing/glasses/hud/health_advanced) && !human.blinded) if((skin == "bezerk") && (!("syndicate" in human.faction))) continue - human << "\icon[human.glasses] Medical emergency! [crit_patient ? "[crit_patient]" : "A patient"] is in critical condition at [location]!" \ No newline at end of file + human << "\icon[human.glasses] Medical emergency! [crit_patient ? "[crit_patient]" : "A patient"] is in critical condition at [location]!" + for(var/mob/living/silicon/robot in world) + if((robot.z == src.z) && !robot.blinded) + if((skin == "bezerk") && (!("syndicate" in robot.faction))) + continue + for(var/obj/I in robot.contents) + if(istype(I, /obj/item/borg/sight/hud/med)) + robot << "\icon[I] Medical emergency! [crit_patient ? "[crit_patient]" : "A patient"] is in critical condition at [location]!" \ No newline at end of file diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index 8cffa388451..cbd78f31440 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -481,4 +481,9 @@ Auto Patrol: []"}, var/area/location = get_area(src) for(var/mob/living/carbon/human/human in world) if((human.z == src.z) && istype(human.glasses, /obj/item/clothing/glasses/hud/security) || istype(human.glasses, /obj/item/clothing/glasses/sunglasses/sechud) && !human.blinded) - human << "\icon[human.glasses] [src.name] is [arrest_type ? "detaining" : "arresting"] level [threatlevel] threat [target] in [location]" \ No newline at end of file + human << "\icon[human.glasses] [src.name] is [arrest_type ? "detaining" : "arresting"] level [threatlevel] threat [target] in [location]" + for(var/mob/living/silicon/robot/robot in world) + if((robot.z == src.z) && !robot.blinded) + for(var/obj/I in robot.contents) + if(istype(I, /obj/item/borg/sight/hud/sec)) + robot << "\icon[I] [src.name] is [arrest_type ? "detaining" : "arresting"] level [threatlevel] threat [target] in [location]" \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 4b3b0be4105..d4bd758201d 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -478,9 +478,26 @@ var/mob/living/silicon/robot/R = M switch(hudtype) if("security") - return istype(R.module_state_1, /obj/item/borg/sight/hud/sec) || istype(R.module_state_2, /obj/item/borg/sight/hud/sec) || istype(R.module_state_3, /obj/item/borg/sight/hud/sec) + for(var/obj/I in R.contents) + if(istype(I, /obj/item/borg/sight/hud/sec)) + return 1 if("medical") - return istype(R.module_state_1, /obj/item/borg/sight/hud/med) || istype(R.module_state_2, /obj/item/borg/sight/hud/med) || istype(R.module_state_3, /obj/item/borg/sight/hud/med) + for(var/obj/I in R.contents) + if(istype(I, /obj/item/borg/sight/hud/med)) + return 1 + else + return 0 + else if(istype(M, /mob/living/silicon/ai)) + var/mob/living/silicon/ai/A = M + switch(hudtype) + if("security") + for(var/obj/I in A.contents) + if(istype(I, /obj/item/borg/sight/hud/sec)) + return 1 + if("medical") + for(var/obj/I in A.contents) + if(istype(I, /obj/item/borg/sight/hud/med)) + return 1 else return 0 else diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index bd9f66d7b35..08cca9e9c04 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -58,6 +58,9 @@ var/list/ai_list = list() var/obj/machinery/bot/Bot var/turf/waypoint //Holds the turf of the currently selected waypoint. var/waypoint_mode = 0 //Waypoint mode is for selecting a turf via clicking. + + var/obj/item/borg/sight/hud/sec/sechud = null + var/obj/item/borg/sight/hud/med/healthhud = null /mob/living/silicon/ai/New(loc, var/datum/ai_laws/L, var/obj/item/device/mmi/B, var/safety = 0) var/list/possibleNames = ai_names @@ -99,11 +102,13 @@ var/list/ai_list = list() aiRadio.myAi = src aiCamera = new/obj/item/device/camera/siliconcam/ai_camera(src) + + if (istype(loc, /turf)) verbs.Add(/mob/living/silicon/ai/proc/ai_network_change, \ /mob/living/silicon/ai/proc/ai_statuschange, /mob/living/silicon/ai/proc/ai_hologram_change, \ - /mob/living/silicon/ai/proc/toggle_camera_light, /mob/living/silicon/ai/proc/botcall, /mob/living/silicon/ai/proc/control_integrated_radio) + /mob/living/silicon/ai/proc/toggle_camera_light, /mob/living/silicon/ai/proc/botcall, /mob/living/silicon/ai/proc/control_integrated_radio, /mob/living/silicon/ai/proc/control_hud) if(!safety)//Only used by AIize() to successfully spawn an AI. if (!B)//If there is no player/brain inside. @@ -118,7 +123,7 @@ var/list/ai_list = list() verbs.Remove(,/mob/living/silicon/ai/proc/ai_call_shuttle,/mob/living/silicon/ai/proc/ai_camera_track, \ /mob/living/silicon/ai/proc/ai_camera_list, /mob/living/silicon/ai/proc/ai_network_change, \ /mob/living/silicon/ai/proc/ai_statuschange, /mob/living/silicon/ai/proc/ai_hologram_change, \ - /mob/living/silicon/ai/proc/toggle_camera_light,/mob/living/silicon/ai/verb/pick_icon) + /mob/living/silicon/ai/proc/toggle_camera_light,/mob/living/silicon/ai/verb/pick_icon,/mob/living/silicon/ai/proc/control_hud) laws = new /datum/ai_laws/alienmov else B.brainmob.mind.transfer_to(src) @@ -808,6 +813,10 @@ var/list/ai_list = list() //Toggles the luminosity and applies it by re-entereing the camera. /mob/living/silicon/ai/proc/toggle_camera_light() + set name = "Toggle Camera Lights" + set desc = "Toggles the lights on the cameras throughout the station." + set category = "AI Commands" + if(stat != CONSCIOUS) return @@ -820,8 +829,25 @@ var/list/ai_list = list() else lightNearbyCamera() +/mob/living/silicon/ai/proc/control_hud() + set name = "Toggle Sensors" + set desc = "Toggles your sensors to display security records, medical records or nothing." + set category = "AI Commands" + + if(stat != 0) + return - + var/hud = input("Please select a sensor module!", "Toggle Sensors", "None", null) in list("None","Security","Medical") + for(var/obj/item/borg/sight/hud/H in contents) + del(H) + switch(hud) + if("Security") + sechud = new/obj/item/borg/sight/hud/sec(src) + if("Medical") + healthhud = new/obj/item/borg/sight/hud/med(src) + else + return + // Handled camera lighting, when toggled. // It will get the nearest camera from the eyeobj, lighting it. diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index d0c6c767fcf..bd54abad2c4 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -1,4 +1,7 @@ /mob/living/silicon/ai/Life() + if(client) + handle_regular_hud_updates() + if (src.stat == 2) return else //I'm not removing that shitton of tabs, unneeded as they are. -- Urist @@ -9,7 +12,7 @@ src.cameraFollow = null src.reset_view(null) src.unset_machine() - + src.updatehealth() if (src.malfhack) @@ -182,3 +185,11 @@ health = 100 - getOxyLoss() - getToxLoss() - getBruteLoss() else health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() + +/mob/living/silicon/ai/proc/handle_regular_hud_updates() + for(var/image/hud in client.images) //COPIED FROM the human handle_regular_hud_updates() proc + if(copytext(hud.icon_state,1,4) == "hud") //ugly, but icon comparison is worse, I believe + client.images.Remove(hud) + + var/obj/item/borg/sight/hud/hud = (locate(/obj/item/borg/sight/hud) in src) + if(hud && hud.hud) hud.hud.process_hud(src) \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 41eef6dddf1..c98e6405c03 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -73,6 +73,9 @@ var/base_icon = "" var/crisis = 0 var/hiddenborg = 0 + + var/obj/item/borg/sight/hud/sec/sechud = null + var/obj/item/borg/sight/hud/med/healthhud = null /mob/living/silicon/robot/New(loc,var/syndie = 0,var/unfinished = 0, var/alien = 0) spark_system = new /datum/effect/effect/system/spark_spread() @@ -456,6 +459,25 @@ else C.toggled = 1 src << "\red You enable [C.name]." + +/mob/living/silicon/robot/verb/control_hud() + set name = "Toggle Sensors" + set desc = "Toggles your sensors to display security records, medical records or nothing." + set category = "Robot Commands" + + if(stat != 0) + return + + var/hud = input("Please select a sensor module!", "Toggle Sensors", "None", null) in list("None","Security","Medical") + for(var/obj/item/borg/sight/hud/H in contents) + del(H) + switch(hud) + if("Security") + sechud = new/obj/item/borg/sight/hud/sec(src) + if("Medical") + healthhud = new/obj/item/borg/sight/hud/med(src) + else + return /mob/living/silicon/robot/blob_act() if (stat != 2) diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index e3040de8024..38fd15f0cd3 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -120,7 +120,6 @@ New() src.modules += new /obj/item/device/flashlight(src) src.modules += new /obj/item/device/flash(src) - src.modules += new /obj/item/borg/sight/hud/med(src) src.modules += new /obj/item/device/healthanalyzer(src) src.modules += new /obj/item/device/reagent_scanner/adv(src) src.modules += new /obj/item/roller_holder(src) @@ -230,7 +229,6 @@ New() src.modules += new /obj/item/device/flashlight/seclite(src) src.modules += new /obj/item/device/flash(src) - src.modules += new /obj/item/borg/sight/hud/sec(src) src.modules += new /obj/item/weapon/handcuffs/cyborg(src) src.modules += new /obj/item/weapon/melee/baton/robot(src) src.modules += new /obj/item/weapon/gun/energy/taser/cyborg(src)