Merge pull request #3661 from Anewbe/update_sight

Changes how darkvision works
This commit is contained in:
Neerti
2017-07-31 17:36:38 -04:00
committed by GitHub
5 changed files with 20 additions and 2 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images
var/anonsay = 0
var/image/ghostimage = null //this mobs ghost image, for deleting and stuff
var/ghostvision = 1 //is the ghost able to see things humans can't?
var/seedarkness = 1
// var/seedarkness = 1
incorporeal_move = 1
var/is_manifest = 0 //If set to 1, the ghost is able to whisper. Usually only set if a cultist drags them through the veil.
+7 -1
View File
@@ -1128,10 +1128,16 @@
see_invisible = SEE_INVISIBLE_LIVING
seer = 0
if(!seedarkness)
sight = species.get_vision_flags(src)
see_in_dark = 8
see_invisible = SEE_INVISIBLE_NOLIGHTING
else
sight = species.get_vision_flags(src)
see_in_dark = species.darksight
see_invisible = see_in_dark>2 ? SEE_INVISIBLE_LEVEL_ONE : SEE_INVISIBLE_LIVING
var/tmp/glasses_processed = 0
var/obj/item/weapon/rig/rig = back
if(istype(rig) && rig.visor)
@@ -1150,7 +1156,7 @@
if(!glasses_processed && (species.get_vision_flags(src) > 0))
sight |= species.get_vision_flags(src)
if(!seer && !glasses_processed)
if(!seer && !glasses_processed && seedarkness)
see_invisible = SEE_INVISIBLE_LIVING
if(healths)
+4
View File
@@ -179,6 +179,10 @@
return
/mob/living/proc/update_sight()
if(!seedarkness)
see_invisible = SEE_INVISIBLE_NOLIGHTING
else
see_invisible = initial(see_invisible)
return
/mob/living/proc/handle_hud_icons()
@@ -172,6 +172,12 @@
src.sight |= SEE_MOBS
src.see_in_dark = 8
src.see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if (!seedarkness)
src.sight &= ~SEE_MOBS
src.sight &= ~SEE_TURFS
src.sight &= ~SEE_OBJS
src.see_in_dark = 8
src.see_invisible = SEE_INVISIBLE_NOLIGHTING
else if (src.stat != 2)
src.sight &= ~SEE_MOBS
src.sight &= ~SEE_TURFS
+2
View File
@@ -210,3 +210,5 @@
var/list/active_genes=list()
var/mob_size = MOB_MEDIUM
var/forbid_seeing_deadchat = FALSE // Used for lings to not see deadchat, and to have ghosting behave as if they were not really dead.
var/seedarkness = 1 //Determines mob's ability to see shadows. 1 = Normal vision, 0 = darkvision