diff --git a/code/__DEFINES/sight.dm b/code/__DEFINES/sight.dm index 677d33ecddc..093f6a7f6f0 100644 --- a/code/__DEFINES/sight.dm +++ b/code/__DEFINES/sight.dm @@ -29,3 +29,7 @@ #define BORGMESON 1 #define BORGTHERM 2 #define BORGXRAY 4 + +#define SECHUD 1 +#define MEDHUD 2 +#define ANTAGHUD 3 diff --git a/code/_globalvars/lists/mobs.dm b/code/_globalvars/lists/mobs.dm index 153a81c4aa0..5de92892b30 100644 --- a/code/_globalvars/lists/mobs.dm +++ b/code/_globalvars/lists/mobs.dm @@ -50,6 +50,7 @@ var/global/list/blocked_mobs = list(/mob/living/simple_animal/hostile, var/global/list/med_hud_users = list() var/global/list/sec_hud_users = list() +var/global/list/antag_hud_users = list() //items that ask to be called every cycle var/global/list/active_diseases = list() //Diseases are mob-based, so they get to go here \ No newline at end of file diff --git a/code/defines/procs/hud.dm b/code/defines/procs/hud.dm index c225a896cf5..14e24033e68 100644 --- a/code/defines/procs/hud.dm +++ b/code/defines/procs/hud.dm @@ -9,7 +9,7 @@ proc/process_med_hud(var/mob/M, var/local_scanner, var/mob/Alt) var/datum/arranged_hud_process/P = arrange_hud_process(M, Alt, med_hud_users) for(var/mob/living/carbon/human/patient in P.Mob.in_view(P.Turf)) - if(P.Mob.see_invisible < patient.invisibility) + if(P.Mob.see_invisible < patient.invisibility || patient.alpha < 127) continue if(!local_scanner) @@ -30,7 +30,7 @@ proc/process_sec_hud(var/mob/M, var/advanced_mode, var/mob/Alt) return var/datum/arranged_hud_process/P = arrange_hud_process(M, Alt, sec_hud_users) for(var/mob/living/carbon/human/perp in P.Mob.in_view(P.Turf)) - if(P.Mob.see_invisible < perp.invisibility) + if(P.Mob.see_invisible < perp.invisibility || perp.alpha < 127) continue P.Client.images += perp.hud_list[ID_HUD] @@ -40,6 +40,17 @@ proc/process_sec_hud(var/mob/M, var/advanced_mode, var/mob/Alt) P.Client.images += perp.hud_list[IMPLOYAL_HUD] P.Client.images += perp.hud_list[IMPCHEM_HUD] + +proc/process_antag_hud(var/mob/M, var/mob/Alt) + if(!can_process_hud(M)) + return + var/datum/arranged_hud_process/P = arrange_hud_process(M, Alt, antag_hud_users) + for(var/mob/living/carbon/human/target in P.Mob.in_view(P.Turf)) + if(P.Mob.see_invisible < target.invisibility || target.alpha < 127) + continue + + P.Client.images += target.hud_list[SPECIALROLE_HUD] + datum/arranged_hud_process var/client/Client var/mob/Mob @@ -70,6 +81,7 @@ mob/proc/regular_hud_updates() //Used in the life.dm of mobs that can use HUDs. client.images -= hud med_hud_users -= src sec_hud_users -= src + antag_hud_users -= src mob/proc/in_view(var/turf/T) return view(T) diff --git a/code/game/mecha/medical/odysseus.dm b/code/game/mecha/medical/odysseus.dm index 180c6a0c537..e6c169e843d 100644 --- a/code/game/mecha/medical/odysseus.dm +++ b/code/game/mecha/medical/odysseus.dm @@ -61,56 +61,4 @@ //TODO - Check documentation for client.eye and client.perspective... /obj/item/clothing/glasses/hud/health/mech name = "Integrated Medical Hud" - - - process_hud(var/mob/M) -/* - world<< "view(M)" - for(var/mob/mob in view(M)) - world << "[mob]" - world<< "view(M.client)" - for(var/mob/mob in view(M.client)) - world << "[mob]" - world<< "view(M.loc)" - for(var/mob/mob in view(M.loc)) - world << "[mob]" -*/ - - if(!M || M.stat || !(M in view(M))) return - if(!M.client) return - var/client/C = M.client - var/image/holder - for(var/mob/living/carbon/human/patient in view(M.loc)) - if(M.see_invisible < patient.invisibility) - continue - var/foundVirus = 0 - - for (var/ID in patient.virus2) - if (ID in virusDB) - foundVirus = 1 - break - - holder = patient.hud_list[HEALTH_HUD] - if(patient.stat == 2) - holder.icon_state = "hudhealth-100" - C.images += holder - else - holder.icon_state = "hud[RoundHealth(patient.health)]" - C.images += holder - - holder = patient.hud_list[STATUS_HUD] - if(patient.stat == 2) - holder.icon_state = "huddead" - else if(patient.status_flags & XENO_HOST) - holder.icon_state = "hudxeno" - else if(foundVirus) - holder.icon_state = "hudill" - else if(patient.has_brain_worms()) - var/mob/living/simple_animal/borer/B = patient.has_brain_worms() - if(B.controlling) - holder.icon_state = "hudbrainworm" - else - holder.icon_state = "hudhealthy" - else - holder.icon_state = "hudhealthy" - C.images += holder + HUDType = MEDHUD diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 8fc29d7f268..21124c4bda3 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -241,6 +241,9 @@ BLIND // can't see anything var/blockTracking // Do we block AI tracking? var/flash_protect = 0 var/tint = 0 + var/HUDType = 0 + var/vision_flags = 0 + var/see_darkness = 1 //Mask /obj/item/clothing/mask diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index c2d333dd849..7e825d76539 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -9,6 +9,7 @@ //var/invisa_view = 0 var/prescription = 0 var/see_darkness = 1 + var/HUDType = 0 /obj/item/clothing/glasses/meson name = "Optical Meson Scanner" @@ -258,17 +259,12 @@ darkness_view = 1 flash_protect = 1 tint = 1 - var/obj/item/clothing/glasses/hud/security/hud = null + HUDType = SECHUD species_fit = list("Vox") sprite_sheets = list( "Vox" = 'icons/mob/species/vox/eyes.dmi' ) - New() - ..() - src.hud = new/obj/item/clothing/glasses/hud/security(src) - return - /obj/item/clothing/glasses/thermal name = "Optical Thermal Scanner" desc = "Thermals in the shape of glasses." diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index 3942b732624..541eb9321f3 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -3,23 +3,22 @@ desc = "A heads-up display that provides important info in (almost) real time." flags = null //doesn't protect eyes because it's a monocle, duh origin_tech = "magnets=3;biotech=2" + HUDType = SECHUD var/list/icon/current = list() //the current hud icons - proc - process_hud(var/mob/M) return - - /obj/item/clothing/glasses/hud/health name = "Health Scanner HUD" desc = "A heads-up display that scans the humans in view and provides accurate data about their health status." icon_state = "healthhud" + HUDType = MEDHUD /obj/item/clothing/glasses/hud/health_advanced name = "Advanced Health Scanner HUD" desc = "A heads-up display that scans the humans in view and provides accurate data about their health status. Includes anti-flash filter." icon_state = "advmedhud" flash_protect = 1 + HUDType = MEDHUD /obj/item/clothing/glasses/hud/health/night name = "Night Vision Health Scanner HUD" @@ -29,12 +28,6 @@ darkness_view = 8 see_darkness = 0 -/obj/item/clothing/glasses/hud/health/process_hud(var/mob/M) - process_med_hud(M,1) - -/obj/item/clothing/glasses/hud/health_advanced/process_hud(var/mob/M) - process_med_hud(M,1) - /obj/item/clothing/glasses/hud/security name = "Security HUD" @@ -57,18 +50,3 @@ icon_state = "securityhudnight" darkness_view = 8 see_darkness = 0 - -/obj/item/clothing/glasses/hud/security/process_hud(var/mob/M) - - if(!M) return - if(!M.client) return - var/client/C = M.client - for(var/mob/living/carbon/human/perp in view(get_turf(M))) - if(M.see_invisible < perp.invisibility) - continue - if(!C) continue - C.images += perp.hud_list[ID_HUD] - C.images += perp.hud_list[WANTED_HUD] - C.images += perp.hud_list[IMPTRACK_HUD] - C.images += perp.hud_list[IMPLOYAL_HUD] - C.images += perp.hud_list[IMPCHEM_HUD] diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index f6e9228c1c4..08c2828a4f3 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -13,6 +13,35 @@ siemens_coefficient = 0.7 loose = 4 // generally well seated +/obj/item/clothing/head/helmet/visor + name = "visor helmet" + desc = "A helmet with a built-in visor. It doesn't seem to do anything, but it sure looks cool!" + icon_state = "helmetgoggles" + +/obj/item/clothing/head/helmet/thermal + name = "thermal visor helmet" + desc = "A helmet with a built-in thermal scanning visor." + icon_state = "helmetthermals" + vision_flags = SEE_MOBS + +/obj/item/clothing/head/helmet/meson + name = "meson visor helmet" + desc = "A helmet with a built-in meson scanning visor." + icon_state = "helmetmesons" + vision_flags = SEE_TURFS + +/obj/item/clothing/head/helmet/material + name = "material visor helmet" + desc = "A helmet with a built-in material scanning visor." + icon_state = "helmetmaterials" + vision_flags = SEE_OBJS + +/obj/item/clothing/head/helmet/night + name = "night-vision helmet" + desc = "A helmet with a built-in pair of night vision goggles." + icon_state = "helmetNVG" + see_darkness = 0 + /obj/item/clothing/head/helmet/alt name = "bulletproof helmet" desc = "A bulletproof helmet that excels in protecting the wearer against traditional projectile weaponry and explosives to a minor extent." diff --git a/code/modules/clothing/spacesuits/miscellaneous.dm b/code/modules/clothing/spacesuits/miscellaneous.dm index bce0a0212d2..ef5c5457ad6 100644 --- a/code/modules/clothing/spacesuits/miscellaneous.dm +++ b/code/modules/clothing/spacesuits/miscellaneous.dm @@ -29,6 +29,9 @@ siemens_coefficient = 0.2 max_heat_protection_temperature = FIRE_IMMUNITY_HELM_MAX_TEMP_PROTECT unacidable = 1 + vision_flags = SEE_MOBS + see_darkness = 0 + HUDType = MEDHUD /obj/item/clothing/suit/space/deathsquad name = "deathsquad suit" @@ -46,7 +49,6 @@ desc = "An armored beret commonly used by special operations officers." icon_state = "beret_badge" armor = list(melee = 65, bullet = 55, laser = 35,energy = 20, bomb = 30, bio = 30, rad = 30) - flags = STOPSPRESSUREDMAGE siemens_coefficient = 0.9 /obj/item/clothing/suit/space/deathsquad/officer diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index ad7508c5b8d..0afe9c08934 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1179,31 +1179,47 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc see_invisible = SEE_INVISIBLE_LIVING seer = 0 - if(glasses) - var/obj/item/clothing/glasses/G = glasses - if(istype(G)) - see_in_dark = (G.darkness_view ? see_in_dark + G.darkness_view : species.darksight) // Otherwise we keep our darkness view with togglable nightvision. - if(G.vision_flags) // MESONS - sight |= G.vision_flags - if(!druggy) + if(glasses || head) + if(glasses) + var/obj/item/clothing/glasses/G = glasses + if(istype(G)) + see_in_dark = (G.darkness_view ? see_in_dark + G.darkness_view : species.darksight) // Otherwise we keep our darkness view with togglable nightvision. + if(G.vision_flags) // MESONS + sight |= G.vision_flags + if(!G.see_darkness) see_invisible = SEE_INVISIBLE_MINIMUM - if(!G.see_darkness) - see_invisible = SEE_INVISIBLE_MINIMUM - /* HUD shit goes here, as long as it doesn't modify sight flags */ - // The purpose of this is to stop xray and w/e from preventing you from using huds -- Love, Doohl + /* HUD shit goes here, as long as it doesn't modify sight flags */ + // The purpose of this is to stop xray and w/e from preventing you from using huds -- Love, Doohl + + switch(G.HUDType) + if(SECHUD) + process_sec_hud(src,1) + if(MEDHUD) + process_med_hud(src,1) + if(ANTAGHUD) + process_antag_hud(src) + + if(head) + var/obj/item/clothing/head/H = head + if(istype(H)) + if(H.vision_flags) // MESONS + sight |= H.vision_flags + if(!H.see_darkness) + see_invisible = SEE_INVISIBLE_MINIMUM + /* HUD shit goes here, as long as it doesn't modify sight flags */ + // The purpose of this is to stop xray and w/e from preventing you from using huds -- Love, Doohl + + switch(H.HUDType) + if(SECHUD) + process_sec_hud(src,1) + if(MEDHUD) + process_med_hud(src,1) + if(ANTAGHUD) + process_antag_hud(src) + + - if(istype(glasses, /obj/item/clothing/glasses/sunglasses)) - see_in_dark = 1 - if(istype(glasses, /obj/item/clothing/glasses/sunglasses/sechud)) - var/obj/item/clothing/glasses/sunglasses/sechud/O = glasses - if(O.hud) O.hud.process_hud(src) - if(!druggy) see_invisible = (!O.see_darkness || O.vision_flags ? SEE_INVISIBLE_MINIMUM : SEE_INVISIBLE_LIVING) // So we can have meson/thermal/material sunglasses - if(istype(glasses, /obj/item/clothing/glasses/hud)) - var/obj/item/clothing/glasses/hud/O = glasses - O.process_hud(src) - if(!druggy) - see_invisible = (!O.see_darkness || O.vision_flags ? SEE_INVISIBLE_MINIMUM : SEE_INVISIBLE_LIVING) else if(!seer) see_in_dark = species.darksight see_invisible = SEE_INVISIBLE_LIVING diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 4694cf22d53..5400fa55d9d 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -195,15 +195,11 @@ regular_hud_updates() - var/obj/item/borg/sight/hud/hud = (locate(/obj/item/borg/sight/hud) in src) - if(hud && hud.hud) - hud.hud.process_hud(src) - else - switch(src.sensor_mode) - if (SEC_HUD) - process_sec_hud(src,1) - if (MED_HUD) - process_med_hud(src,1) + switch(src.sensor_mode) + if (SEC_HUD) + process_sec_hud(src,1) + if (MED_HUD) + process_med_hud(src,1) if (src.healths) if (src.stat != 2) diff --git a/icons/mob/head.dmi b/icons/mob/head.dmi index 4ba5b2af73c..fd65aed0202 100644 Binary files a/icons/mob/head.dmi and b/icons/mob/head.dmi differ diff --git a/icons/obj/clothing/hats.dmi b/icons/obj/clothing/hats.dmi index b0b48de7ae4..0732fc0be60 100644 Binary files a/icons/obj/clothing/hats.dmi and b/icons/obj/clothing/hats.dmi differ