mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Merge pull request #5669 from VOREStation/pol-binocs
Stop usage of multiple vision modifiers
This commit is contained in:
@@ -629,7 +629,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
|
|||||||
|
|
||||||
var/cannotzoom
|
var/cannotzoom
|
||||||
|
|
||||||
if(usr.stat || !(istype(usr,/mob/living/carbon/human)))
|
if((usr.stat && !zoom) || !(istype(usr,/mob/living/carbon/human)))
|
||||||
usr << "You are unable to focus through the [devicename]"
|
usr << "You are unable to focus through the [devicename]"
|
||||||
cannotzoom = 1
|
cannotzoom = 1
|
||||||
else if(!zoom && global_hud.darkMask[1] in usr.client.screen)
|
else if(!zoom && global_hud.darkMask[1] in usr.client.screen)
|
||||||
@@ -639,39 +639,46 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
|
|||||||
usr << "You are too distracted to look through the [devicename], perhaps if it was in your active hand this might work better"
|
usr << "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
|
||||||
|
|
||||||
|
//We checked above if they are a human and returned already if they weren't.
|
||||||
|
var/mob/living/carbon/human/H = usr
|
||||||
|
|
||||||
if(!zoom && !cannotzoom)
|
if(!zoom && !cannotzoom)
|
||||||
if(usr.hud_used.hud_shown)
|
if(H.hud_used.hud_shown)
|
||||||
usr.toggle_zoom_hud() // If the user has already limited their HUD this avoids them having a HUD when they zoom in
|
H.toggle_zoom_hud() // If the user has already limited their HUD this avoids them having a HUD when they zoom in
|
||||||
usr.client.view = viewsize
|
H.client.view = viewsize
|
||||||
zoom = 1
|
zoom = 1
|
||||||
|
|
||||||
var/tilesize = 32
|
var/tilesize = 32
|
||||||
var/viewoffset = tilesize * tileoffset
|
var/viewoffset = tilesize * tileoffset
|
||||||
|
|
||||||
switch(usr.dir)
|
switch(H.dir)
|
||||||
if (NORTH)
|
if (NORTH)
|
||||||
usr.client.pixel_x = 0
|
H.client.pixel_x = 0
|
||||||
usr.client.pixel_y = viewoffset
|
H.client.pixel_y = viewoffset
|
||||||
if (SOUTH)
|
if (SOUTH)
|
||||||
usr.client.pixel_x = 0
|
H.client.pixel_x = 0
|
||||||
usr.client.pixel_y = -viewoffset
|
H.client.pixel_y = -viewoffset
|
||||||
if (EAST)
|
if (EAST)
|
||||||
usr.client.pixel_x = viewoffset
|
H.client.pixel_x = viewoffset
|
||||||
usr.client.pixel_y = 0
|
H.client.pixel_y = 0
|
||||||
if (WEST)
|
if (WEST)
|
||||||
usr.client.pixel_x = -viewoffset
|
H.client.pixel_x = -viewoffset
|
||||||
usr.client.pixel_y = 0
|
H.client.pixel_y = 0
|
||||||
|
|
||||||
usr.visible_message("[usr] peers through the [zoomdevicename ? "[zoomdevicename] of the [src.name]" : "[src.name]"].")
|
H.visible_message("[usr] peers through the [zoomdevicename ? "[zoomdevicename] of the [src.name]" : "[src.name]"].")
|
||||||
|
H.looking_elsewhere = TRUE
|
||||||
|
H.handle_vision()
|
||||||
|
|
||||||
else
|
else
|
||||||
usr.client.view = world.view
|
H.client.view = world.view
|
||||||
if(!usr.hud_used.hud_shown)
|
if(!H.hud_used.hud_shown)
|
||||||
usr.toggle_zoom_hud()
|
H.toggle_zoom_hud()
|
||||||
zoom = 0
|
zoom = 0
|
||||||
|
|
||||||
usr.client.pixel_x = 0
|
H.client.pixel_x = 0
|
||||||
usr.client.pixel_y = 0
|
H.client.pixel_y = 0
|
||||||
|
H.looking_elsewhere = FALSE
|
||||||
|
H.handle_vision()
|
||||||
|
|
||||||
if(!cannotzoom)
|
if(!cannotzoom)
|
||||||
usr.visible_message("[zoomdevicename ? "[usr] looks up from the [src.name]" : "[usr] lowers the [src.name]"].")
|
usr.visible_message("[zoomdevicename ? "[usr] looks up from the [src.name]" : "[usr] lowers the [src.name]"].")
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ Works together with spawning an observer, noted above.
|
|||||||
if(!client) return 0
|
if(!client) return 0
|
||||||
|
|
||||||
handle_regular_hud_updates()
|
handle_regular_hud_updates()
|
||||||
|
handle_vision()
|
||||||
|
|
||||||
/mob/proc/ghostize(var/can_reenter_corpse = 1)
|
/mob/proc/ghostize(var/can_reenter_corpse = 1)
|
||||||
if(key)
|
if(key)
|
||||||
|
|||||||
@@ -103,6 +103,7 @@
|
|||||||
|
|
||||||
updateicon()
|
updateicon()
|
||||||
handle_regular_hud_updates()
|
handle_regular_hud_updates()
|
||||||
|
handle_vision()
|
||||||
|
|
||||||
if(ticker && ticker.mode)
|
if(ticker && ticker.mode)
|
||||||
ticker.mode.check_win()
|
ticker.mode.check_win()
|
||||||
|
|||||||
@@ -1077,38 +1077,41 @@
|
|||||||
var/obj/machinery/camera/cam = client.eye
|
var/obj/machinery/camera/cam = client.eye
|
||||||
client.screen |= cam.client_huds
|
client.screen |= cam.client_huds
|
||||||
|
|
||||||
if(stat != DEAD)
|
if(stat == DEAD) //Dead
|
||||||
if(stat == UNCONSCIOUS && health <= 0)
|
if(!druggy) see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||||
//Critical damage passage overlay
|
if(healths) healths.icon_state = "health7" //DEAD healthmeter
|
||||||
|
|
||||||
|
else if(stat == UNCONSCIOUS && health <= 0) //Crit
|
||||||
|
//Critical damage passage overlay
|
||||||
|
var/severity = 0
|
||||||
|
switch(health)
|
||||||
|
if(-20 to -10) severity = 1
|
||||||
|
if(-30 to -20) severity = 2
|
||||||
|
if(-40 to -30) severity = 3
|
||||||
|
if(-50 to -40) severity = 4
|
||||||
|
if(-60 to -50) severity = 5
|
||||||
|
if(-70 to -60) severity = 6
|
||||||
|
if(-80 to -70) severity = 7
|
||||||
|
if(-90 to -80) severity = 8
|
||||||
|
if(-95 to -90) severity = 9
|
||||||
|
if(-INFINITY to -95) severity = 10
|
||||||
|
overlay_fullscreen("crit", /obj/screen/fullscreen/crit, severity)
|
||||||
|
else //Alive
|
||||||
|
clear_fullscreen("crit")
|
||||||
|
//Oxygen damage overlay
|
||||||
|
if(oxyloss)
|
||||||
var/severity = 0
|
var/severity = 0
|
||||||
switch(health)
|
switch(oxyloss)
|
||||||
if(-20 to -10) severity = 1
|
if(10 to 20) severity = 1
|
||||||
if(-30 to -20) severity = 2
|
if(20 to 25) severity = 2
|
||||||
if(-40 to -30) severity = 3
|
if(25 to 30) severity = 3
|
||||||
if(-50 to -40) severity = 4
|
if(30 to 35) severity = 4
|
||||||
if(-60 to -50) severity = 5
|
if(35 to 40) severity = 5
|
||||||
if(-70 to -60) severity = 6
|
if(40 to 45) severity = 6
|
||||||
if(-80 to -70) severity = 7
|
if(45 to INFINITY) severity = 7
|
||||||
if(-90 to -80) severity = 8
|
overlay_fullscreen("oxy", /obj/screen/fullscreen/oxy, severity)
|
||||||
if(-95 to -90) severity = 9
|
|
||||||
if(-INFINITY to -95) severity = 10
|
|
||||||
overlay_fullscreen("crit", /obj/screen/fullscreen/crit, severity)
|
|
||||||
else
|
else
|
||||||
clear_fullscreen("crit")
|
clear_fullscreen("oxy")
|
||||||
//Oxygen damage overlay
|
|
||||||
if(oxyloss)
|
|
||||||
var/severity = 0
|
|
||||||
switch(oxyloss)
|
|
||||||
if(10 to 20) severity = 1
|
|
||||||
if(20 to 25) severity = 2
|
|
||||||
if(25 to 30) severity = 3
|
|
||||||
if(30 to 35) severity = 4
|
|
||||||
if(35 to 40) severity = 5
|
|
||||||
if(40 to 45) severity = 6
|
|
||||||
if(45 to INFINITY) severity = 7
|
|
||||||
overlay_fullscreen("oxy", /obj/screen/fullscreen/oxy, severity)
|
|
||||||
else
|
|
||||||
clear_fullscreen("oxy")
|
|
||||||
|
|
||||||
//Fire and Brute damage overlay (BSSR)
|
//Fire and Brute damage overlay (BSSR)
|
||||||
var/hurtdamage = src.getShockBruteLoss() + src.getShockFireLoss() + damageoverlaytemp //Doesn't call the overlay if you can't actually feel it
|
var/hurtdamage = src.getShockBruteLoss() + src.getShockFireLoss() + damageoverlaytemp //Doesn't call the overlay if you can't actually feel it
|
||||||
@@ -1126,66 +1129,6 @@
|
|||||||
else
|
else
|
||||||
clear_fullscreen("brute")
|
clear_fullscreen("brute")
|
||||||
|
|
||||||
if( stat == DEAD )
|
|
||||||
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS|SEE_SELF
|
|
||||||
see_in_dark = 8
|
|
||||||
if(!druggy) see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
|
||||||
if(healths) healths.icon_state = "health7" //DEAD healthmeter
|
|
||||||
if(client)
|
|
||||||
if(client.view != world.view) // If mob dies while zoomed in with device, unzoom them.
|
|
||||||
for(var/obj/item/item in contents)
|
|
||||||
if(item.zoom)
|
|
||||||
item.zoom()
|
|
||||||
break
|
|
||||||
|
|
||||||
else
|
|
||||||
sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS)
|
|
||||||
see_invisible = see_in_dark>2 ? SEE_INVISIBLE_LEVEL_ONE : see_invisible_default
|
|
||||||
|
|
||||||
if(XRAY in mutations)
|
|
||||||
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
|
|
||||||
see_in_dark = 8
|
|
||||||
if(!druggy) see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
|
||||||
|
|
||||||
if(seer==1)
|
|
||||||
var/obj/effect/rune/R = locate() in loc
|
|
||||||
if(R && R.word1 == cultwords["see"] && R.word2 == cultwords["hell"] && R.word3 == cultwords["join"])
|
|
||||||
see_invisible = SEE_INVISIBLE_CULT
|
|
||||||
else
|
|
||||||
see_invisible = see_invisible_default
|
|
||||||
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_default
|
|
||||||
|
|
||||||
var/tmp/glasses_processed = 0
|
|
||||||
var/obj/item/weapon/rig/rig = back
|
|
||||||
if(istype(rig) && rig.visor)
|
|
||||||
if(!rig.helmet || (head && rig.helmet == head))
|
|
||||||
if(rig.visor && rig.visor.vision && rig.visor.active && rig.visor.vision.glasses)
|
|
||||||
glasses_processed = 1
|
|
||||||
process_glasses(rig.visor.vision.glasses)
|
|
||||||
|
|
||||||
if(glasses && !glasses_processed)
|
|
||||||
glasses_processed = 1
|
|
||||||
process_glasses(glasses)
|
|
||||||
if(XRAY in mutations)
|
|
||||||
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
|
|
||||||
see_in_dark = 8
|
|
||||||
if(!druggy) see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
|
||||||
|
|
||||||
if(!glasses_processed && (species.get_vision_flags(src) > 0))
|
|
||||||
sight |= species.get_vision_flags(src)
|
|
||||||
if(!seer && !glasses_processed && seedarkness)
|
|
||||||
see_invisible = see_invisible_default
|
|
||||||
|
|
||||||
if(healths)
|
if(healths)
|
||||||
if (chem_effects[CE_PAINKILLER] > 100)
|
if (chem_effects[CE_PAINKILLER] > 100)
|
||||||
healths.icon_state = "health_numb"
|
healths.icon_state = "health_numb"
|
||||||
@@ -1333,11 +1276,70 @@
|
|||||||
if(found_welder)
|
if(found_welder)
|
||||||
client.screen |= global_hud.darkMask
|
client.screen |= global_hud.darkMask
|
||||||
|
|
||||||
|
/mob/living/carbon/human/handle_vision()
|
||||||
|
if(stat == DEAD)
|
||||||
|
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS|SEE_SELF
|
||||||
|
see_in_dark = 8
|
||||||
|
if(client)
|
||||||
|
if(client.view != world.view) // If mob dies while zoomed in with device, unzoom them.
|
||||||
|
for(var/obj/item/item in contents)
|
||||||
|
if(item.zoom)
|
||||||
|
item.zoom()
|
||||||
|
break
|
||||||
|
|
||||||
|
else //We aren't dead
|
||||||
|
sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS)
|
||||||
|
see_invisible = see_in_dark>2 ? SEE_INVISIBLE_LEVEL_ONE : see_invisible_default
|
||||||
|
|
||||||
|
if(XRAY in mutations)
|
||||||
|
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
|
||||||
|
see_in_dark = 8
|
||||||
|
if(!druggy) see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||||
|
|
||||||
|
if(seer==1)
|
||||||
|
var/obj/effect/rune/R = locate() in loc
|
||||||
|
if(R && R.word1 == cultwords["see"] && R.word2 == cultwords["hell"] && R.word3 == cultwords["join"])
|
||||||
|
see_invisible = SEE_INVISIBLE_CULT
|
||||||
|
else
|
||||||
|
see_invisible = see_invisible_default
|
||||||
|
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_default
|
||||||
|
|
||||||
|
var/tmp/glasses_processed = 0
|
||||||
|
var/obj/item/weapon/rig/rig = back
|
||||||
|
if(istype(rig) && rig.visor && !looking_elsewhere)
|
||||||
|
if(!rig.helmet || (head && rig.helmet == head))
|
||||||
|
if(rig.visor && rig.visor.vision && rig.visor.active && rig.visor.vision.glasses)
|
||||||
|
glasses_processed = 1
|
||||||
|
process_glasses(rig.visor.vision.glasses)
|
||||||
|
|
||||||
|
if(glasses && !glasses_processed && !looking_elsewhere)
|
||||||
|
glasses_processed = 1
|
||||||
|
process_glasses(glasses)
|
||||||
|
if(XRAY in mutations)
|
||||||
|
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
|
||||||
|
see_in_dark = 8
|
||||||
|
if(!druggy) see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||||
|
|
||||||
|
if(!glasses_processed && (species.get_vision_flags(src) > 0))
|
||||||
|
sight |= species.get_vision_flags(src)
|
||||||
|
if(!seer && !glasses_processed && seedarkness)
|
||||||
|
see_invisible = see_invisible_default
|
||||||
|
|
||||||
if(machine)
|
if(machine)
|
||||||
var/viewflags = machine.check_eye(src)
|
var/viewflags = machine.check_eye(src)
|
||||||
if(viewflags < 0)
|
if(viewflags < 0)
|
||||||
reset_view(null, 0)
|
reset_view(null, 0)
|
||||||
else if(viewflags)
|
else if(viewflags && !looking_elsewhere)
|
||||||
sight |= viewflags
|
sight |= viewflags
|
||||||
else if(eyeobj)
|
else if(eyeobj)
|
||||||
if(eyeobj.owner != src)
|
if(eyeobj.owner != src)
|
||||||
|
|||||||
@@ -62,6 +62,8 @@
|
|||||||
|
|
||||||
handle_regular_hud_updates()
|
handle_regular_hud_updates()
|
||||||
|
|
||||||
|
handle_vision()
|
||||||
|
|
||||||
/mob/living/proc/handle_breathing()
|
/mob/living/proc/handle_breathing()
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -173,9 +175,6 @@
|
|||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
/mob/living/proc/handle_vision()
|
|
||||||
return
|
|
||||||
|
|
||||||
/mob/living/proc/update_sight()
|
/mob/living/proc/update_sight()
|
||||||
if(!seedarkness)
|
if(!seedarkness)
|
||||||
see_invisible = SEE_INVISIBLE_NOLIGHTING
|
see_invisible = SEE_INVISIBLE_NOLIGHTING
|
||||||
|
|||||||
@@ -61,4 +61,7 @@
|
|||||||
var/list/hud_list //Holder for health hud, status hud, wanted hud, etc (not like inventory slots)
|
var/list/hud_list //Holder for health hud, status hud, wanted hud, etc (not like inventory slots)
|
||||||
var/has_huds = FALSE //Whether or not we should bother initializing the above list
|
var/has_huds = FALSE //Whether or not we should bother initializing the above list
|
||||||
|
|
||||||
var/makes_dirt = TRUE //FALSE if the mob shouldn't be making dirt on the ground when it walks
|
var/makes_dirt = TRUE //FALSE if the mob shouldn't be making dirt on the ground when it walks
|
||||||
|
|
||||||
|
var/looking_elsewhere = FALSE //If the mob's view has been relocated to somewhere else, like via a camera or with binocs
|
||||||
|
|
||||||
@@ -152,6 +152,7 @@
|
|||||||
|
|
||||||
process_queued_alarms()
|
process_queued_alarms()
|
||||||
handle_regular_hud_updates()
|
handle_regular_hud_updates()
|
||||||
|
handle_vision()
|
||||||
|
|
||||||
/mob/living/silicon/ai/proc/lacks_power()
|
/mob/living/silicon/ai/proc/lacks_power()
|
||||||
if(APU_power)
|
if(APU_power)
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
src.cable = null
|
src.cable = null
|
||||||
|
|
||||||
handle_regular_hud_updates()
|
handle_regular_hud_updates()
|
||||||
|
handle_vision()
|
||||||
|
|
||||||
if(silence_time)
|
if(silence_time)
|
||||||
if(world.timeofday >= silence_time)
|
if(world.timeofday >= silence_time)
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
if(client)
|
if(client)
|
||||||
handle_regular_hud_updates()
|
handle_regular_hud_updates()
|
||||||
|
handle_vision()
|
||||||
update_items()
|
update_items()
|
||||||
if (src.stat != DEAD) //still using power
|
if (src.stat != DEAD) //still using power
|
||||||
use_power()
|
use_power()
|
||||||
|
|||||||
@@ -617,6 +617,10 @@ var/list/global/organ_rel_size = list(
|
|||||||
/mob/proc/handle_regular_hud_updates()
|
/mob/proc/handle_regular_hud_updates()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
//Handle eye things like the Byond SEE_TURFS, SEE_OBJS, etc.
|
||||||
|
/mob/proc/handle_vision()
|
||||||
|
return
|
||||||
|
|
||||||
//Icon is used to occlude things like huds from the faulty byond context menu.
|
//Icon is used to occlude things like huds from the faulty byond context menu.
|
||||||
// http://www.byond.com/forum/?post=2336679
|
// http://www.byond.com/forum/?post=2336679
|
||||||
var/global/image/backplane
|
var/global/image/backplane
|
||||||
|
|||||||
Reference in New Issue
Block a user