diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 6664c06dda0..53a927386bd 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -1028,7 +1028,7 @@ body to_chat(usr, "Mob doesn't exist anymore") return - if(!(locateUID(rem_organ) in M.internal_organs)) + if(!(rem_organ in M.internal_organs)) to_chat(usr, "Mob does not have that organ.") return diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 0d43bb9bfeb..39ed75d7cbf 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -471,109 +471,7 @@ return 0 /datum/species/proc/handle_vision(mob/living/carbon/human/H) - if(H.stat == DEAD) - H.sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) - H.see_in_dark = 8 - if(!H.druggy) - H.see_invisible = SEE_INVISIBLE_LEVEL_TWO - return - - H.sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS) - - H.see_in_dark = darksight //set their variables to default, modify them later - H.see_invisible = SEE_INVISIBLE_LIVING - - if(H.mind && H.mind.vampire) - if(H.mind.vampire.get_ability(/datum/vampire_passive/full)) - H.sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS - H.see_in_dark = 8 - H.see_invisible = SEE_INVISIBLE_MINIMUM - else if(H.mind.vampire.get_ability(/datum/vampire_passive/vision)) - H.sight |= SEE_MOBS - - - if(XRAY in H.mutations) - H.sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS - H.see_in_dark = 8 - - H.see_invisible = SEE_INVISIBLE_MINIMUM - - - if(H.seer == 1) - var/obj/effect/rune/R = locate() in H.loc - if(R && R.word1 == cultwords["see"] && R.word2 == cultwords["hell"] && R.word3 == cultwords["join"]) - H.see_invisible = SEE_INVISIBLE_OBSERVER - else - H.see_invisible = SEE_INVISIBLE_LIVING - H.seer = 0 - - var/minimum_darkness_view = INFINITY - if(H.glasses) - if(istype(H.glasses, /obj/item/clothing/glasses)) - var/obj/item/clothing/glasses/G = H.glasses - H.sight |= G.vision_flags - - if(G.darkness_view) - H.see_in_dark = G.darkness_view - minimum_darkness_view = G.darkness_view - - if(!G.see_darkness) - H.see_invisible = SEE_INVISIBLE_MINIMUM - - if(H.head) - if(istype(H.head, /obj/item/clothing/head)) - var/obj/item/clothing/head/hat = H.head - H.sight |= hat.vision_flags - - if(hat.darkness_view && hat.darkness_view < minimum_darkness_view) // Pick the lowest of the two darkness_views between the glasses and helmet. - H.see_in_dark = hat.darkness_view - - if(!hat.see_darkness) - H.see_invisible = SEE_INVISIBLE_MINIMUM - - //switch(hat.HUDType) - // if(SECHUD) - // process_sec_hud(H,1) - // if(MEDHUD) - // process_med_hud(H,1) - // if(ANTAGHUD) - // process_antag_hud(H) - - if(istype(H.back, /obj/item/weapon/rig)) ///ahhhg so snowflakey - var/obj/item/weapon/rig/rig = H.back - if(rig.visor) - if(!rig.helmet || (H.head && rig.helmet == H.head)) - if(rig.visor && rig.visor.vision && rig.visor.active && rig.visor.vision.glasses) - var/obj/item/clothing/glasses/G = rig.visor.vision.glasses - if(istype(G)) - H.see_in_dark = (G.darkness_view ? G.darkness_view : darksight) // Otherwise we keep our darkness view with togglable nightvision. - if(G.vision_flags) // MESONS - H.sight |= G.vision_flags - - if(!G.see_darkness) - H.see_invisible = SEE_INVISIBLE_MINIMUM - - //switch(G.HUDType) - // if(SECHUD) - // process_sec_hud(H,1) - // if(MEDHUD) - // process_med_hud(H,1) - // if(ANTAGHUD) - // process_antag_hud(H) - - if(H.vision_type) - H.see_in_dark = max(H.see_in_dark, H.vision_type.see_in_dark, darksight) - H.see_invisible = H.vision_type.see_invisible - if(H.vision_type.light_sensitive) - H.weakeyes = 1 - H.sight |= H.vision_type.sight_flags - - if(H.see_override) //Override all - H.see_invisible = H.see_override - - if(!H.client) - return 1 - + // Right now this just handles blind, blurry, and similar states if(H.blinded || H.eye_blind) H.overlay_fullscreen("blind", /obj/screen/fullscreen/blind) H.throw_alert("blind", /obj/screen/alert/blind) @@ -679,6 +577,8 @@ It'll return null if the organ doesn't correspond, so include null checks when u /datum/species/proc/update_sight(mob/living/carbon/human/H) + if(!H.client) + return 1 H.sight = initial(H.sight) H.see_in_dark = darksight H.see_invisible = invis_sight @@ -688,6 +588,14 @@ It'll return null if the organ doesn't correspond, so include null checks when u if(A.update_remote_sight(H)) //returns 1 if we override all other sight updates. return + if(H.mind && H.mind.vampire) + if(H.mind.vampire.get_ability(/datum/vampire_passive/full)) + H.sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS + H.see_in_dark = 8 + H.see_invisible = SEE_INVISIBLE_MINIMUM + else if(H.mind.vampire.get_ability(/datum/vampire_passive/vision)) + H.sight |= SEE_MOBS + for(var/obj/item/organ/internal/cyberimp/eyes/E in H.internal_organs) H.sight |= E.vision_flags if(E.dark_view) @@ -695,15 +603,62 @@ It'll return null if the organ doesn't correspond, so include null checks when u if(E.see_invisible) H.see_invisible = min(H.see_invisible, E.see_invisible) + + if(H.seer == 1) + var/obj/effect/rune/R = locate() in H.loc + if(R && R.word1 == cultwords["see"] && R.word2 == cultwords["hell"] && R.word3 == cultwords["join"]) + H.see_invisible = SEE_INVISIBLE_OBSERVER + else + H.see_invisible = SEE_INVISIBLE_LIVING + H.seer = 0 + + var/lesser_darkview_bonus = INFINITY + // my glasses, I can't see without my glasses if(H.glasses) var/obj/item/clothing/glasses/G = H.glasses H.sight |= G.vision_flags - H.see_in_dark = max(G.darkness_view, H.see_in_dark) + lesser_darkview_bonus = G.darkness_view if(G.invis_override) H.see_invisible = G.invis_override else H.see_invisible = min(G.invis_view, H.see_invisible) + // better living through hat trading + if(H.head) + if(istype(H.head, /obj/item/clothing/head)) + var/obj/item/clothing/head/hat = H.head + H.sight |= hat.vision_flags + + if(hat.darkness_view) // Pick the lowest of the two darkness_views between the glasses and helmet. + lesser_darkview_bonus = min(hat.darkness_view,lesser_darkview_bonus) + + if(!hat.see_darkness) + H.see_invisible = SEE_INVISIBLE_MINIMUM + + if(istype(H.back, /obj/item/weapon/rig)) ///ahhhg so snowflakey + var/obj/item/weapon/rig/rig = H.back + if(rig.visor) + if(!rig.helmet || (H.head && rig.helmet == H.head)) + if(rig.visor && rig.visor.vision && rig.visor.active && rig.visor.vision.glasses) + var/obj/item/clothing/glasses/G = rig.visor.vision.glasses + if(istype(G)) + H.see_in_dark = (G.darkness_view ? G.darkness_view : darksight) // Otherwise we keep our darkness view with togglable nightvision. + if(G.vision_flags) // MESONS + H.sight |= G.vision_flags + + if(!G.see_darkness) + H.see_invisible = SEE_INVISIBLE_MINIMUM + + if(lesser_darkview_bonus != INFINITY) + H.see_in_dark = max(lesser_darkview_bonus, H.see_in_dark) + + if(H.vision_type) + H.see_in_dark = max(H.see_in_dark, H.vision_type.see_in_dark, darksight) + H.see_invisible = H.vision_type.see_invisible + if(H.vision_type.light_sensitive) + H.weakeyes = 1 + H.sight |= H.vision_type.sight_flags + if(XRAY in H.mutations) H.sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) H.see_in_dark = max(H.see_in_dark, 8) diff --git a/code/modules/surgery/organs/augments_eyes.dm b/code/modules/surgery/organs/augments_eyes.dm index 83c9ab128b6..1c66bd2c31b 100644 --- a/code/modules/surgery/organs/augments_eyes.dm +++ b/code/modules/surgery/organs/augments_eyes.dm @@ -44,6 +44,8 @@ implant_color = "#000000" origin_tech = "materials=6;programming=4;biotech=6;magnets=5" vision_flags = SEE_MOBS | SEE_OBJS | SEE_TURFS + dark_view = 8 + see_invisible = SEE_INVISIBLE_MINIMUM /obj/item/organ/internal/cyberimp/eyes/thermals name = "Thermals implant"