Darkness handling update

This commit is contained in:
Mark van Alphen
2019-04-23 22:59:00 +02:00
parent 9213b89179
commit 0d883a5b88
63 changed files with 412 additions and 370 deletions
+5 -2
View File
@@ -154,6 +154,7 @@
var/darkness_view = 0 //Base human is 2
var/invis_view = SEE_INVISIBLE_LIVING
var/invis_override = 0
var/lighting_alpha
var/emagged = 0
var/list/color_view = null//overrides client.color while worn
@@ -281,9 +282,11 @@ BLIND // can't see anything
slot_flags = SLOT_HEAD
var/blockTracking // Do we block AI tracking?
var/HUDType = null
var/darkness_view = 0
var/helmet_goggles_invis_view = 0
var/vision_flags = 0
var/darkness_view = 0
var/lighting_alpha
var/can_toggle = null
//Mask
+18 -16
View File
@@ -37,7 +37,7 @@
item_state = "glasses"
origin_tech = "magnets=1;engineering=2"
vision_flags = SEE_TURFS
invis_view = SEE_INVISIBLE_MINIMUM //don't render darkness while wearing these
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
prescription_upgradable = 1
species_fit = list("Vox")
sprite_sheets = list(
@@ -53,6 +53,7 @@
item_state = "glasses"
origin_tech = "magnets=4;engineering=5;plasmatech=4"
darkness_view = 8
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
prescription_upgradable = 0
/obj/item/clothing/glasses/meson/prescription
@@ -104,7 +105,7 @@
icon_state = "nvpurple"
item_state = "glasses"
darkness_view = 8
invis_view = SEE_INVISIBLE_MINIMUM //don't render darkness while wearing these
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE //don't render darkness while wearing these
/obj/item/clothing/glasses/janitor
name = "Janitorial Goggles"
@@ -123,7 +124,7 @@
item_state = "glasses"
origin_tech = "materials=4;magnets=4;plasmatech=4;engineering=4"
darkness_view = 8
invis_view = SEE_INVISIBLE_MINIMUM //don't render darkness while wearing these
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE //don't render darkness while wearing these
species_fit = list("Vox")
sprite_sheets = list(
"Vox" = 'icons/mob/species/vox/eyes.dmi',
@@ -382,6 +383,7 @@
item_state = "glasses"
origin_tech = "magnets=3"
vision_flags = SEE_MOBS
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
flash_protect = -1
species_fit = list("Vox")
sprite_sheets = list(
@@ -389,18 +391,18 @@
"Grey" = 'icons/mob/species/grey/eyes.dmi'
)
emp_act(severity)
if(istype(src.loc, /mob/living/carbon/human))
var/mob/living/carbon/human/M = src.loc
to_chat(M, "<span class='warning'>The Optical Thermal Scanner overloads and blinds you!</span>")
if(M.glasses == src)
M.EyeBlind(3)
M.EyeBlurry(5)
if(!(M.disabilities & NEARSIGHTED))
M.BecomeNearsighted()
spawn(100)
M.CureNearsighted()
..()
/obj/item/clothing/glasses/thermal/emp_act(severity)
if(istype(src.loc, /mob/living/carbon/human))
var/mob/living/carbon/human/M = src.loc
to_chat(M, "<span class='warning'>The Optical Thermal Scanner overloads and blinds you!</span>")
if(M.glasses == src)
M.EyeBlind(3)
M.EyeBlurry(5)
if(!(M.disabilities & NEARSIGHTED))
M.BecomeNearsighted()
spawn(100)
M.CureNearsighted()
..()
/obj/item/clothing/glasses/thermal/syndi //These are now a traitor item, concealed as mesons. -Pete
name = "Optical Meson Scanner"
@@ -507,7 +509,7 @@
scan_reagents = 1
flags = NODROP
flags_cover = null
invis_view = SEE_INVISIBLE_MINIMUM
lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE
/obj/item/clothing/glasses/godeye/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, src) && W != src && W.loc == user)
+5 -4
View File
@@ -51,7 +51,7 @@
item_state = "glasses"
origin_tech = "magnets=4;biotech=4;plasmatech=4;engineering=5"
darkness_view = 8
invis_view = SEE_INVISIBLE_MINIMUM //don't render darkness while wearing these
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
prescription_upgradable = 0
/obj/item/clothing/glasses/hud/diagnostic
@@ -73,7 +73,7 @@
item_state = "glasses"
origin_tech = "magnets=4;powerstorage=4;plasmatech=4;engineering=5"
darkness_view = 8
invis_view = SEE_INVISIBLE_MINIMUM //don't render darkness while wearing these
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
prescription_upgradable = 0
/obj/item/clothing/glasses/hud/security
@@ -105,6 +105,7 @@
icon_state = "jensenshades"
item_state = "jensenshades"
vision_flags = SEE_MOBS
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
/obj/item/clothing/glasses/hud/security/night
name = "\improper Night Vision Security HUD"
@@ -112,7 +113,7 @@
icon_state = "securityhudnight"
origin_tech = "magnets=4;combat=4;plasmatech=4;engineering=5"
darkness_view = 8
invis_view = SEE_INVISIBLE_MINIMUM //don't render darkness while wearing these
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE //don't render darkness while wearing these
prescription_upgradable = 0
/obj/item/clothing/glasses/hud/security/sunglasses/read_only
@@ -154,7 +155,7 @@
icon_state = "hydroponichudnight"
item_state = "glasses"
darkness_view = 8
invis_view = SEE_INVISIBLE_MINIMUM //don't render darkness while wearing these
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
prescription_upgradable = 0
/obj/item/clothing/glasses/hud/security/tajblind
+2 -1
View File
@@ -50,6 +50,7 @@
desc = "A helmet with a built-in thermal scanning visor."
icon_state = "helmetthermals"
vision_flags = SEE_MOBS
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
/obj/item/clothing/head/helmet/meson
name = "meson visor helmet"
@@ -67,7 +68,7 @@
name = "night-vision helmet"
desc = "A helmet with a built-in pair of night vision goggles."
icon_state = "helmetNVG"
helmet_goggles_invis_view = SEE_INVISIBLE_MINIMUM //don't render darkness while wearing these
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE //don't render darkness while wearing these
/obj/item/clothing/head/helmet/alt
name = "bulletproof helmet"
@@ -47,7 +47,7 @@
max_heat_protection_temperature = FIRE_IMMUNITY_MAX_TEMP_PROTECT
unacidable = 1
vision_flags = SEE_MOBS
helmet_goggles_invis_view = SEE_INVISIBLE_MINIMUM //don't render darkness while wearing these
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE //don't render darkness while wearing these
HUDType = MEDHUD
strip_delay = 130
@@ -184,42 +184,46 @@
generic_pixel_x = 1
vehicle_move_delay = 1
// Wisp Lantern
//Wisp Lantern
/obj/item/wisp_lantern
name = "spooky lantern"
desc = "This lantern gives off no light, but is home to a friendly wisp."
icon = 'icons/obj/lighting.dmi'
icon_state = "lantern-blue"
item_state = "lantern"
var/obj/effect/wisp/wisp
/obj/item/wisp_lantern/attack_self(mob/user)
if(!wisp)
to_chat(user, "<span class='warning'>The wisp has gone missing!</span>")
icon_state = "lantern"
return
if(wisp.loc == src)
to_chat(user, "<span class='notice'>You release the wisp. It begins to bob around your head.</span>")
user.sight |= SEE_MOBS
icon_state = "lantern"
wisp.orbit(user, 20, forceMove = TRUE)
wisp.orbit(user, 20)
user.update_sight()
feedback_add_details("wisp_lantern","F") // freed
else
to_chat(user, "<span class='notice'>You return the wisp to the lantern.</span>")
var/mob/target
if(wisp.orbiting)
var/atom/A = wisp.orbiting
if(isliving(A))
var/mob/living/M = A
M.sight &= ~SEE_MOBS
to_chat(M, "<span class='notice'>Your vision returns to normal.</span>")
target = wisp.orbiting
wisp.stop_orbit()
wisp.loc = src
wisp.forceMove(src)
if (istype(target))
target.update_sight()
to_chat(target, "<span class='notice'>Your vision returns to normal.</span>")
icon_state = "lantern-blue"
feedback_add_details("wisp_lantern","R") // returned
/obj/item/wisp_lantern/New()
..()
/obj/item/wisp_lantern/Initialize()
. = ..()
wisp = new(src)
/obj/item/wisp_lantern/Destroy()
@@ -228,19 +232,19 @@
qdel(wisp)
else
wisp.visible_message("<span class='notice'>[wisp] has a sad feeling for a moment, then it passes.</span>")
return ..()
..()
/obj/effect/wisp
name = "friendly wisp"
desc = "Happy to light your way."
icon = 'icons/obj/lighting.dmi'
icon_state = "orb"
layer = ABOVE_ALL_MOB_LAYER
light_power = 1
light_range = 7
layer = ABOVE_ALL_MOB_LAYER
var/sight_flags = SEE_MOBS
var/lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
//Red/Blue Cubes
/obj/item/warp_cube
name = "blue cube"
desc = "A mysterious blue cube."
+9 -25
View File
@@ -184,28 +184,6 @@
mode = MINEDRONE_COLLECT
SetCollectBehavior()
/mob/living/simple_animal/hostile/mining_drone/update_sight()
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
if(mesons_active)
sight |= SEE_TURFS
see_invisible = SEE_INVISIBLE_MINIMUM
else
sight &= ~SEE_TURFS
see_invisible = SEE_INVISIBLE_LIVING
see_in_dark = initial(see_in_dark)
if(client.eye != src)
var/atom/A = client.eye
if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates.
return
//Actions for sentient minebots
/datum/action/innate/minedrone
@@ -232,10 +210,16 @@
/datum/action/innate/minedrone/toggle_meson_vision/Activate()
var/mob/living/simple_animal/hostile/mining_drone/user = owner
user.mesons_active = !user.mesons_active
user.update_sight()
if(user.sight & SEE_TURFS)
user.sight &= ~SEE_TURFS
user.lighting_alpha = initial(user.lighting_alpha)
else
user.sight |= SEE_TURFS
user.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
to_chat(user, "<span class='notice'>You toggle your meson vision [(user.mesons_active) ? "on" : "off"].</span>")
user.sync_lighting_plane_alpha()
to_chat(user, "<span class='notice'>You toggle your meson vision [(user.sight & SEE_TURFS) ? "on" : "off"].</span>")
/datum/action/innate/minedrone/toggle_mode
name = "Toggle Mode"
+23 -4
View File
@@ -666,14 +666,32 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set desc = "Toggles your ability to see things only ghosts can see, like other ghosts"
set category = "Ghost"
ghostvision = !(ghostvision)
updateghostsight()
update_sight()
to_chat(usr, "You [(ghostvision?"now":"no longer")] have ghost vision.")
/mob/dead/observer/verb/toggle_darkness()
set name = "Toggle Darkness"
set category = "Ghost"
seedarkness = !(seedarkness)
updateghostsight()
switch(lighting_alpha)
if (LIGHTING_PLANE_ALPHA_VISIBLE)
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
if (LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE)
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
if (LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE)
lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE
else
lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE
update_sight()
/mob/dead/observer/update_sight()
if (!ghostvision)
see_invisible = SEE_INVISIBLE_LIVING
else
see_invisible = SEE_INVISIBLE_OBSERVER
updateghostimages()
..()
/mob/dead/observer/proc/updateghostsight()
if(!seedarkness)
@@ -681,7 +699,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
else
see_invisible = SEE_INVISIBLE_OBSERVER
if(!ghostvision)
see_invisible = SEE_INVISIBLE_LIVING;
see_invisible = SEE_INVISIBLE_LIVING
updateghostimages()
/proc/updateallghostimages()
+40 -6
View File
@@ -6,7 +6,7 @@
gender = NEUTER
dna = null
alien_talk_understand = 1
nightvision = 1
var/nightvision = 1
var/obj/item/card/id/wear_id = null // Fix for station bounced radios -- Skie
var/has_fine_manipulation = 0
var/move_delay_add = 0 // movement delay to add
@@ -149,15 +149,17 @@
if(!nightvision)
see_in_dark = 8
see_invisible = SEE_INVISIBLE_MINIMUM
nightvision = 1
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
nightvision = TRUE
usr.hud_used.nightvisionicon.icon_state = "nightvision1"
else if(nightvision == 1)
else if(nightvision)
see_in_dark = 4
see_invisible = 45
nightvision = 0
lighting_alpha = initial(lighting_alpha)
nightvision = FALSE
usr.hud_used.nightvisionicon.icon_state = "nightvision0"
update_sight()
/mob/living/carbon/alien/assess_threat(var/mob/living/simple_animal/bot/secbot/judgebot, var/lasercolor)
if(judgebot.emagged == 2)
@@ -264,3 +266,35 @@ Des: Removes all infected images from the alien.
return pick("xltrails_1", "xltrails_2")
else
return pick("xttrails_1", "xttrails_2")
/mob/living/carbon/alien/update_sight()
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
sight = SEE_MOBS
if(nightvision)
see_in_dark = 8
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
else
see_in_dark = initial(see_in_dark)
lighting_alpha = initial(lighting_alpha)
if(client.eye != src)
var/atom/A = client.eye
if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates.
return
for(var/obj/item/organ/internal/cyberimp/eyes/E in internal_organs)
sight |= E.vision_flags
if(E.see_in_dark)
see_in_dark = max(see_in_dark, E.see_in_dark)
if(E.see_invisible)
see_invisible = min(see_invisible, E.see_invisible)
if(!isnull(E.lighting_alpha))
lighting_alpha = min(lighting_alpha, E.lighting_alpha)
if(see_override)
see_invisible = see_override
@@ -28,33 +28,3 @@
//BREATH TEMPERATURE
handle_breath_temperature(breath)
/mob/living/carbon/alien/update_sight()
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
sight = SEE_MOBS
if(nightvision)
see_in_dark = 8
see_invisible = SEE_INVISIBLE_MINIMUM
else
see_in_dark = 4
see_invisible = SEE_INVISIBLE_LEVEL_TWO
if(client.eye != src)
var/atom/A = client.eye
if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates.
return
for(var/obj/item/organ/internal/cyberimp/eyes/E in internal_organs)
sight |= E.vision_flags
if(E.dark_view)
see_in_dark = max(see_in_dark, E.dark_view)
if(E.see_invisible)
see_invisible = min(see_invisible, E.see_invisible)
if(see_override)
see_invisible = see_override
+36 -3
View File
@@ -323,8 +323,8 @@
return
var/extra_darkview = 0
if(E.dark_view)
extra_darkview = max(E.dark_view - 2, 0)
if(E.see_in_dark)
extra_darkview = max(E.see_in_dark - 2, 0)
extra_damage = extra_darkview
var/light_amount = 10 // assume full brightness
@@ -1129,4 +1129,37 @@ so that different stomachs can handle things in different ways VB*/
/mob/living/carbon/proc/shock_internal_organs(intensity)
for(var/obj/item/organ/O in internal_organs)
O.shock_organ(intensity)
O.shock_organ(intensity)
/mob/living/carbon/update_sight()
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
sight = initial(sight)
lighting_alpha = initial(lighting_alpha)
for(var/obj/item/organ/internal/cyberimp/eyes/E in internal_organs)
sight |= E.vision_flags
if(E.see_in_dark)
see_in_dark = max(see_in_dark, E.see_in_dark)
if(E.see_invisible)
see_invisible = min(see_invisible, E.see_invisible)
if(!isnull(E.lighting_alpha))
lighting_alpha = min(lighting_alpha, E.lighting_alpha)
if(client.eye != src)
var/atom/A = client.eye
if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates.
return
if(XRAY in mutations)
sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS)
see_in_dark = 8
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
if(see_override)
see_invisible = see_override
@@ -545,6 +545,7 @@
/mob/living/carbon/human/update_sight()
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
@@ -1427,11 +1428,7 @@
dna.species.on_species_gain(src)
see_in_dark = dna.species.get_resultant_darksight(src)
if(see_in_dark > 2)
see_invisible = SEE_INVISIBLE_LEVEL_ONE
else
see_invisible = SEE_INVISIBLE_LIVING
update_sight()
dna.species.handle_dna(src) //Give them whatever special dna business they got.
@@ -115,7 +115,7 @@
update_tint()
if(G.prescription)
update_nearsighted_effects()
if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view)
if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view || !isnull(G.lighting_alpha))
update_sight()
update_inv_glasses()
update_client_colour()
@@ -128,7 +128,7 @@
// Bandanas and paper hats go on the head but are not head clothing
if(istype(I,/obj/item/clothing/head))
var/obj/item/clothing/head/hat = I
if(hat.vision_flags || hat.darkness_view || hat.helmet_goggles_invis_view)
if(hat.vision_flags || hat.darkness_view || !isnull(hat.lighting_alpha))
update_sight()
head_update(I)
update_inv_head()
@@ -267,7 +267,7 @@
update_tint()
if(G.prescription)
update_nearsighted_effects()
if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view)
if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view || !isnull(G.lighting_alpha))
update_sight()
update_inv_glasses(redraw_mob)
update_client_colour()
@@ -283,7 +283,7 @@
// paper + bandanas
if(istype(W, /obj/item/clothing/head))
var/obj/item/clothing/head/hat = W
if(hat.vision_flags || hat.darkness_view || hat.helmet_goggles_invis_view)
if(hat.vision_flags || hat.darkness_view || !isnull(hat.lighting_alpha))
update_sight()
head_update(W)
update_inv_head(redraw_mob)
@@ -39,8 +39,6 @@
var/siemens_coeff = 1 //base electrocution coefficient
var/invis_sight = SEE_INVISIBLE_LIVING
var/hazard_high_pressure = HAZARD_HIGH_PRESSURE // Dangerously high pressure.
var/warning_high_pressure = WARNING_HIGH_PRESSURE // High pressure warning.
var/warning_low_pressure = WARNING_LOW_PRESSURE // Low pressure warning.
@@ -630,22 +628,21 @@ It'll return null if the organ doesn't correspond, so include null checks when u
return null
return has_organ[organ_slot]
/datum/species/proc/get_resultant_darksight(mob/living/carbon/human/H) //Returns default value of 2 if the mob doesn't have eyes, otherwise it grabs the eyes darksight.
var/resultant_darksight = 2
/datum/species/proc/update_sight(mob/living/carbon/human/H)
var/obj/item/organ/internal/eyes/eyes = H.get_int_organ(/obj/item/organ/internal/eyes)
if(eyes)
resultant_darksight = eyes.get_dark_view()
return resultant_darksight
/datum/species/proc/update_sight(mob/living/carbon/human/H)
H.sight = initial(H.sight)
H.see_in_dark = get_resultant_darksight(H)
H.see_invisible = invis_sight
H.sight |= eyes.vision_flags
H.see_in_dark = eyes.see_in_dark
H.see_invisible = eyes.see_invisible
H.lighting_alpha = eyes.lighting_alpha
else
H.sight = initial(H.sight)
H.see_in_dark = initial(H.see_in_dark)
H.see_invisible = initial(H.see_invisible)
H.lighting_alpha = initial(H.lighting_alpha)
if(H.see_in_dark > 2) //Preliminary see_invisible handling as per set_species() in code\modules\mob\living\carbon\human\human.dm.
H.see_invisible = SEE_INVISIBLE_LEVEL_ONE
else
H.see_invisible = SEE_INVISIBLE_LIVING
H.lighting_alpha = min(H.lighting_alpha, LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE)
if(H.client && H.client.eye != H)
var/atom/A = H.client.eye
@@ -656,39 +653,43 @@ It'll return null if the organ doesn't correspond, so include null checks when u
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
H.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
else if(H.mind.vampire.get_ability(/datum/vampire_passive/vision))
H.sight |= SEE_MOBS
H.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
for(var/obj/item/organ/internal/cyberimp/eyes/E in H.internal_organs)
H.sight |= E.vision_flags
if(E.dark_view)
H.see_in_dark = E.dark_view
if(E.see_in_dark)
H.see_in_dark = max(H.see_in_dark, E.see_in_dark)
if(E.see_invisible)
H.see_invisible = min(H.see_invisible, E.see_invisible)
if(E.lighting_alpha)
H.lighting_alpha = min(H.lighting_alpha, E.lighting_alpha)
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
lesser_darkview_bonus = G.darkness_view
H.see_in_dark = max(G.darkness_view, H.see_in_dark)
if(G.invis_override)
H.see_invisible = G.invis_override
else
H.see_invisible = min(G.invis_view, H.see_invisible)
if(!isnull(G.lighting_alpha))
H.lighting_alpha = min(G.lighting_alpha, H.lighting_alpha)
// 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
H.see_in_dark = max(hat.darkness_view, H.see_in_dark)
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.helmet_goggles_invis_view)
H.see_invisible = min(hat.helmet_goggles_invis_view, H.see_invisible)
if(!isnull(hat.lighting_alpha))
H.lighting_alpha = min(hat.lighting_alpha, H.lighting_alpha)
if(istype(H.back, /obj/item/rig)) ///aghhh so snowflakey
var/obj/item/rig/rig = H.back
@@ -697,28 +698,33 @@ It'll return null if the organ doesn't correspond, so include null checks when u
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 : get_resultant_darksight(H)) // Otherwise we keep our darkness view with togglable nightvision.
if(G.vision_flags) // MESONS
H.sight |= G.vision_flags
H.sight |= G.vision_flags
H.see_in_dark = max(G.darkness_view, H.see_in_dark)
H.see_invisible = min(G.invis_view, H.see_invisible)
if(lesser_darkview_bonus != INFINITY)
H.see_in_dark = max(lesser_darkview_bonus, H.see_in_dark)
if(!isnull(G.lighting_alpha))
H.lighting_alpha = min(G.lighting_alpha, H.lighting_alpha)
if(H.vision_type)
H.see_in_dark = max(H.see_in_dark, H.vision_type.see_in_dark, get_resultant_darksight(H))
H.see_invisible = H.vision_type.see_invisible
if(H.vision_type.light_sensitive)
H.weakeyes = 1
H.sight |= H.vision_type.sight_flags
H.see_in_dark = max(H.see_in_dark, H.vision_type.see_in_dark)
if(!isnull(H.vision_type.lighting_alpha))
H.lighting_alpha = min(H.vision_type.lighting_alpha, H.lighting_alpha)
if(H.vision_type.light_sensitive)
H.weakeyes = TRUE
if(XRAY in H.mutations)
H.sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS)
H.see_in_dark = 8
H.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
if(H.see_override) //Override all
H.see_invisible = H.see_override
H.sync_lighting_plane_alpha()
/datum/species/proc/water_act(mob/living/carbon/human/M, volume, temperature, source)
if(abs(temperature - M.bodytemperature) > 10) //If our water and mob temperature varies by more than 10K, cool or/ heat them appropriately
M.bodytemperature = (temperature + M.bodytemperature) * 0.5 //Approximation for gradual heating or cooling
-30
View File
@@ -343,36 +343,6 @@
Sleeping(2)
return sleeping
/mob/living/carbon/update_sight()
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
see_invisible = initial(see_invisible)
see_in_dark = initial(see_in_dark)
sight = initial(sight)
if(XRAY in mutations)
grant_xray_vision()
if(client.eye != src)
var/atom/A = client.eye
if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates.
return
for(var/obj/item/organ/internal/cyberimp/eyes/E in internal_organs)
sight |= E.vision_flags
if(E.dark_view)
see_in_dark = max(see_in_dark,E.dark_view)
if(E.see_invisible)
see_invisible = min(see_invisible, E.see_invisible)
if(see_override)
see_invisible = see_override
/mob/living/carbon/handle_hud_icons()
return
+2 -15
View File
@@ -197,28 +197,15 @@
if(!remote_view && !client.adminobs)
reset_perspective(null)
/mob/living/proc/update_sight()
if(stat == DEAD)
grant_death_vision()
return
// Gives a mob the vision of being dead
/mob/living/proc/grant_death_vision()
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE
see_in_dark = 8
see_invisible = SEE_INVISIBLE_OBSERVER
// See through walls, dark, etc.
// basically the same as death vision except you can't
// see ghosts
/mob/living/proc/grant_xray_vision()
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
sync_lighting_plane_alpha()
/mob/living/proc/handle_hud_icons()
handle_hud_icons_health()
+34
View File
@@ -992,3 +992,37 @@
for(var/atom/A in src)
if(A.light_range > 0)
A.extinguish_light()
/mob/living/vv_edit_var(var_name, var_value)
switch(var_name)
if("stat")
if((stat == DEAD) && (var_value < DEAD))//Bringing the dead back to life
GLOB.dead_mob_list -= src
GLOB.living_mob_list += src
if((stat < DEAD) && (var_value == DEAD))//Kill he
GLOB.living_mob_list -= src
GLOB.dead_mob_list += src
. = ..()
switch(var_name)
if("weakened")
SetWeakened(var_value)
if("stunned")
SetStunned(var_value)
if("paralysis")
SetParalysis(var_value)
if("sleeping")
SetSleeping(var_value)
if("maxHealth")
updatehealth()
if("resize")
update_transform()
if("lighting_alpha")
sync_lighting_plane_alpha()
/mob/living/update_sight()
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
@@ -33,7 +33,6 @@
var/mob_size = MOB_SIZE_HUMAN
var/metabolism_efficiency = 1 //more or less efficiency to metabolize helpful/harmful reagents and regulate body temperature..
var/digestion_ratio = 1 //controls how quickly reagents metabolize; largely governered by species attributes.
var/nightvision = 0
var/bloodcrawl = 0 //0 No blood crawling, 1 blood crawling, 2 blood crawling+mob devour
var/holder = null //The holder for blood crawling
+26 -1
View File
@@ -1290,4 +1290,29 @@ var/list/ai_verbs_default = list(
return FALSE
/mob/living/silicon/ai/ExtinguishMob()
return
return
/mob/living/silicon/ai/update_sight()
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
see_invisible = initial(see_invisible)
see_in_dark = initial(see_in_dark)
lighting_alpha = initial(lighting_alpha)
sight = initial(sight)
if(aiRestorePowerRoutine)
sight = sight &~ SEE_TURFS
sight = sight &~ SEE_MOBS
sight = sight &~ SEE_OBJS
see_in_dark = 0
if(see_override)
see_invisible = see_override
sync_lighting_plane_alpha()
@@ -152,16 +152,3 @@
/mob/living/silicon/ai/rejuvenate()
..()
add_ai_verbs(src)
/mob/living/silicon/ai/update_sight()
see_invisible = initial(see_invisible)
see_in_dark = initial(see_in_dark)
sight = initial(sight)
if(aiRestorePowerRoutine)
sight = sight&~SEE_TURFS
sight = sight&~SEE_MOBS
sight = sight&~SEE_OBJS
see_in_dark = 0
if(see_override)
see_invisible = see_override
@@ -88,40 +88,6 @@
return 1
/mob/living/silicon/robot/update_sight()
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
see_invisible = initial(see_invisible)
see_in_dark = initial(see_in_dark)
sight = initial(sight)
if(client.eye != src)
var/atom/A = client.eye
if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates.
return
if(sight_mode & BORGMESON)
sight |= SEE_TURFS
see_invisible = min(see_invisible, SEE_INVISIBLE_MINIMUM)
see_in_dark = 1
if(sight_mode & BORGXRAY)
sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS)
see_invisible = SEE_INVISIBLE_LIVING
see_in_dark = 8
if(sight_mode & BORGTHERM)
sight |= SEE_MOBS
see_invisible = min(see_invisible, SEE_INVISIBLE_LIVING)
see_in_dark = 8
if(see_override)
see_invisible = see_override
/mob/living/silicon/robot/handle_hud_icons()
update_items()
update_cell()
@@ -1385,3 +1385,43 @@ var/list/robot_verbs_default = list(
/mob/living/silicon/robot/check_ear_prot()
return ear_protection
/mob/living/silicon/robot/update_sight()
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
see_invisible = initial(see_invisible)
see_in_dark = initial(see_in_dark)
sight = initial(sight)
lighting_alpha = initial(lighting_alpha)
if(client.eye != src)
var/atom/A = client.eye
if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates.
return
if(sight_mode & BORGMESON)
sight |= SEE_TURFS
lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE
see_in_dark = 1
if(sight_mode & BORGXRAY)
sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS)
see_invisible = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
see_invisible = SEE_INVISIBLE_LIVING
see_in_dark = 8
if(sight_mode & BORGTHERM)
sight |= SEE_MOBS
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
see_invisible = min(see_invisible, SEE_INVISIBLE_LIVING)
see_in_dark = 8
if(see_override)
see_invisible = see_override
sync_lighting_plane_alpha()
@@ -30,7 +30,7 @@
status_flags = CANPUSH
minbodytemp = 0
see_in_dark = 8
see_invisible = SEE_INVISIBLE_MINIMUM
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
gold_core_spawnable = CHEM_MOB_SPAWN_HOSTILE
death_sound = 'sound/voice/hiss6.ogg'
deathmessage = "lets out a waning guttural screech, green blood bubbling from its maw..."
@@ -17,6 +17,7 @@
speak_chance = 5
turns_per_move = 5
see_in_dark = 10
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
butcher_results = list(/obj/item/reagent_containers/food/snacks/spidermeat = 2, /obj/item/reagent_containers/food/snacks/spiderleg = 8)
response_help = "pets"
response_disarm = "gently pushes aside"
@@ -16,7 +16,7 @@
var/throw_message = "bounces off of"
var/icon_aggro = null // for swapping to when we get aggressive
see_in_dark = 8
see_invisible = SEE_INVISIBLE_MINIMUM
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
mob_size = MOB_SIZE_LARGE
/mob/living/simple_animal/hostile/asteroid/Aggro()
@@ -40,7 +40,7 @@
search_objects = 1 // So that it can see through walls
see_invisible = SEE_INVISIBLE_OBSERVER_NOLIGHTING
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
sight = SEE_SELF|SEE_MOBS|SEE_OBJS|SEE_TURFS
move_force = MOVE_FORCE_EXTREMELY_STRONG
move_resist = MOVE_FORCE_EXTREMELY_STRONG
@@ -189,13 +189,6 @@
L.EyeBlind(4)
return
/mob/living/simple_animal/hostile/statue/update_sight()
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
//Toggle Night Vision
/obj/effect/proc_holder/spell/targeted/night_vision
name = "Toggle Nightvision"
@@ -207,15 +200,23 @@
message = "<span class='notice'>You toggle your night vision!</span>"
range = -1
include_user = 1
var/non_night_vision = SEE_INVISIBLE_LIVING
var/night_vision = SEE_INVISIBLE_OBSERVER_NOLIGHTING
/obj/effect/proc_holder/spell/targeted/night_vision/cast(list/targets, mob/user = usr)
for(var/mob/living/target in targets)
if(target.see_invisible == non_night_vision)
target.see_invisible = night_vision
else
target.see_invisible = non_night_vision
switch(target.lighting_alpha)
if (LIGHTING_PLANE_ALPHA_VISIBLE)
target.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
name = "Toggle Nightvision \[More]"
if (LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE)
target.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
name = "Toggle Nightvision \[Full]"
if (LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE)
target.lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE
name = "Toggle Nightvision \[OFF]"
else
target.lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE
name = "Toggle Nightvision \[ON]"
target.update_sight()
/mob/living/simple_animal/hostile/statue/sentience_act()
faction -= "neutral"
@@ -95,8 +95,7 @@ var/global/list/ts_spiderling_list = list()
idle_vision_range = 10
aggro_vision_range = 10
see_in_dark = 10
nightvision = 1
see_invisible = 5
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
sight = SEE_MOBS
// AI aggression settings
@@ -564,21 +564,5 @@
/mob/living/simple_animal/proc/sentience_act() //Called when a simple animal gains sentience via gold slime potion
return
/mob/living/simple_animal/update_sight()
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
see_invisible = initial(see_invisible)
see_in_dark = initial(see_in_dark)
sight = initial(sight)
if(client.eye != src)
var/atom/A = client.eye
if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates.
return
/mob/living/simple_animal/can_hear()
. = TRUE
+9
View File
@@ -1341,3 +1341,12 @@ var/list/slot_equipment_priority = list( \
/mob/proc/is_literate()
return FALSE
/mob/proc/update_sight()
sync_lighting_plane_alpha()
/mob/proc/sync_lighting_plane_alpha()
if(hud_used)
var/obj/screen/plane_master/lighting/L = hud_used.plane_masters["[LIGHTING_PLANE]"]
if (L)
L.alpha = lighting_alpha
+2 -2
View File
@@ -1,6 +1,6 @@
/mob
density = 1
layer = 4.0
layer = MOB_LAYER
animate_movement = 2
pressure_resistance = 8
dont_save = TRUE //to avoid it messing up in buildmode saving
@@ -93,7 +93,7 @@
var/list/grabbed_by = list()
var/list/requests = list()
var/lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE
var/list/mapobjs = list()
var/in_throw_mode = 0
@@ -291,6 +291,8 @@
/mob/camera/aiEye/remote/shuttle_docker/update_remote_sight(mob/living/user)
user.sight = SEE_TURFS
..()
return TRUE
/datum/action/innate/shuttledocker_rotate
+6 -4
View File
@@ -8,8 +8,10 @@
w_class = WEIGHT_CLASS_TINY
var/vision_flags = 0
var/dark_view = 0
var/see_in_dark = 0
var/see_invisible = 0
var/lighting_alpha
var/eye_colour = "#000000"
var/old_eye_colour = "#000000"
var/flash_protect = 0
@@ -54,7 +56,7 @@
implant_color = "#AEFF00"
origin_tech = "materials=4;engineering=4;biotech=4;magnets=4"
vision_flags = SEE_TURFS
see_invisible = SEE_INVISIBLE_MINIMUM
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
aug_message = "Suddenly, you realize how much of a mess the station really is..."
/obj/item/organ/internal/cyberimp/eyes/xray
@@ -63,8 +65,8 @@
implant_color = "#000000"
origin_tech = "materials=4;programming=4;biotech=6;magnets=4"
vision_flags = SEE_MOBS | SEE_OBJS | SEE_TURFS
dark_view = 8
see_invisible = SEE_INVISIBLE_MINIMUM
see_in_dark = 8
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
/obj/item/organ/internal/cyberimp/eyes/thermals
name = "Thermals implant"
+7 -6
View File
@@ -10,9 +10,13 @@
var/list/colourblind_matrix = MATRIX_GREYSCALE //Special colourblindness parameters. By default, it's black-and-white.
var/list/replace_colours = LIST_GREYSCALE_REPLACE
var/dependent_disabilities = null //Gets set by eye-dependent disabilities such as colourblindness so the eyes can transfer the disability during transplantation.
var/dark_view = 2 //Default dark_view for Humans.
var/weld_proof = null //If set, the eyes will not take damage during welding. eg. IPC optical sensors do not take damage when they weld things while all other eyes will.
var/vision_flags = 0
var/see_in_dark = 2
var/see_invisible = SEE_INVISIBLE_LIVING
var/lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE
/obj/item/organ/internal/eyes/proc/update_colour()
dna.write_eyes_attributes(src)
@@ -31,11 +35,8 @@
else
return colourmatrix
/obj/item/organ/internal/eyes/proc/get_dark_view() //Returns dark_view (if the eyes are organic) for see_invisible handling in species.dm to be autoprocessed by life().
return dark_view
/obj/item/organ/internal/eyes/proc/shine()
if(is_robotic() || (dark_view > EYE_SHINE_THRESHOLD))
if(is_robotic() || (see_in_dark > EYE_SHINE_THRESHOLD))
return TRUE
/obj/item/organ/internal/eyes/insert(mob/living/carbon/human/M, special = 0)
@@ -70,7 +71,7 @@
colourmatrix = null
..() //Make sure the organ's got the robotic status indicators before updating the client colour.
if(owner)
owner.update_client_colour(0) //Since mechanical eyes give dark_view of 2 and full colour vision atm, just having this here is fine.
owner.update_client_colour(0) //Since mechanical eyes give see_in_dark of 2 and full colour vision atm, just having this here is fine.
/obj/item/organ/internal/eyes/cybernetic
name = "cybernetic eyes"
@@ -4,4 +4,4 @@
/obj/item/organ/internal/eyes/abductor
name = "abductor eyeballs"
dark_view = 3
see_in_dark = 3
@@ -26,4 +26,4 @@
name = "drask eyeballs"
icon = 'icons/obj/species_organs/drask.dmi'
desc = "Drask eyes. They look even stranger disembodied"
dark_view = 5
see_in_dark = 5
+1 -1
View File
@@ -23,7 +23,7 @@
name = "grey eyeballs"
desc = "They still look creepy and emotionless"
icon = 'icons/obj/species_organs/grey.dmi'
dark_view = 5
see_in_dark = 5
/obj/item/organ/internal/heart/grey
name = "grey heart"
@@ -1,3 +1,3 @@
/obj/item/organ/internal/eyes/shadow
name = "dark orbs"
dark_view = 8
see_in_dark = 8
@@ -8,12 +8,12 @@
name = "tajaran eyeballs"
colourblind_matrix = MATRIX_TAJ_CBLIND //The colour matrix and darksight parameters that the mob will recieve when they get the disability.
replace_colours = LIST_TAJ_REPLACE
dark_view = 8
see_in_dark = 8
/obj/item/organ/internal/eyes/tajaran/farwa //Being the lesser form of Tajara, Farwas have an utterly incurable version of their colourblindness.
name = "farwa eyeballs"
colourmatrix = MATRIX_TAJ_CBLIND
dark_view = 8
see_in_dark = 8
replace_colours = LIST_TAJ_REPLACE
/obj/item/organ/internal/heart/tajaran
@@ -7,7 +7,7 @@
/obj/item/organ/internal/eyes/unathi
name = "unathi eyeballs"
icon = 'icons/obj/species_organs/unathi.dmi'
dark_view = 3
see_in_dark = 3
/obj/item/organ/internal/heart/unathi
name = "unathi heart"
@@ -8,12 +8,12 @@
icon = 'icons/obj/species_organs/vulpkanin.dmi'
colourblind_matrix = MATRIX_VULP_CBLIND //The colour matrix and darksight parameters that the mob will recieve when they get the disability.
replace_colours = LIST_VULP_REPLACE
dark_view = 8
see_in_dark = 8
/obj/item/organ/internal/eyes/vulpkanin/wolpin //Being the lesser form of Vulpkanin, Wolpins have an utterly incurable version of their colourblindness.
name = "wolpin eyeballs"
colourmatrix = MATRIX_VULP_CBLIND
dark_view = 8
see_in_dark = 8
replace_colours = LIST_VULP_REPLACE
/obj/item/organ/internal/heart/vulpkanin
+1 -1
View File
@@ -8,4 +8,4 @@
slot = "hivenode"
/obj/item/organ/internal/eyes/wryn
dark_view = 3
see_in_dark = 3