Tweaks species night vision (#11416)

This commit is contained in:
Alberyk
2021-03-15 21:51:49 -03:00
committed by GitHub
parent 8cc103a7f3
commit c1793a4a33
5 changed files with 28 additions and 2 deletions

View File

@@ -696,6 +696,10 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
to_chat(M, SPAN_WARNING("You are too distracted to look through the [devicename], perhaps if it was in your active hand this might work better.")) to_chat(M, SPAN_WARNING("You are too distracted to look through the [devicename], perhaps if it was in your active hand this might work better."))
cannotzoom = 1 cannotzoom = 1
if(ishuman(M)) //this code is here to stop species night vision from being used on the cameras, since it does not make sense since cameras are just images. this is probably not the best way to do this, but it works
var/mob/living/carbon/human/H = M
H.disable_organ_night_vision()
if(!zoom && !cannotzoom) if(!zoom && !cannotzoom)
if(M.hud_used.hud_shown) if(M.hud_used.hud_shown)
M.toggle_zoom_hud() // If the user has already limited their HUD this avoids them having a HUD when they zoom in M.toggle_zoom_hud() // If the user has already limited their HUD this avoids them having a HUD when they zoom in

View File

@@ -2055,3 +2055,10 @@
set name = "click_suit_storage" set name = "click_suit_storage"
if(s_store) if(s_store)
s_store.Click() s_store.Click()
/mob/living/carbon/human/proc/disable_organ_night_vision()
var/obj/item/organ/E = internal_organs_by_name[BP_EYES]
if (istype(E, /obj/item/organ/internal/eyes/night))
var/obj/item/organ/internal/eyes/night/N = E
if(N.night_vision )
N.disable_night_vision()

View File

@@ -125,6 +125,10 @@
A.client.eye = A.eyeobj A.client.eye = A.eyeobj
return TRUE return TRUE
if(ishuman(user)) //this code is here to stop species night vision from being used on the cameras, since it does not make sense since cameras are just images. this is probably not the best way to do this, but it works
var/mob/living/carbon/human/H = user
H.disable_organ_night_vision()
set_current(C) set_current(C)
user.machine = ui_host() user.machine = ui_host()
user.reset_view(current_camera) user.reset_view(current_camera)

View File

@@ -42,6 +42,12 @@
if(!vision_mechanical_color && (status & ORGAN_ROBOT)) if(!vision_mechanical_color && (status & ORGAN_ROBOT))
return return
if(owner.client && ((owner.client.view != world.view) || (owner.client.pixel_x != 0) || (owner.client.pixel_y != 0))) //using binoculars
return
if(owner.machine && owner.machine.check_eye(owner) >= 0 && owner.client.eye != owner) //using cameras
return
if(!night_vision) if(!night_vision)
enable_night_vision() enable_night_vision()
else else

View File

@@ -0,0 +1,5 @@
author: Alberyk
delete-after: True
changes:
- tweak: "Species' night vision can no longer be used with cameras and binoculars."