Darkness fixes

This commit is contained in:
Mark van Alphen
2019-04-24 00:47:55 +02:00
parent 44347029db
commit 9e9d72d2ae
11 changed files with 44 additions and 27 deletions
@@ -192,6 +192,8 @@
icon_state = "lantern-blue"
item_state = "lantern"
var/obj/effect/wisp/wisp
var/sight_flags = SEE_MOBS
var/lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
/obj/item/wisp_lantern/attack_self(mob/user)
if(!wisp)
@@ -203,26 +205,25 @@
to_chat(user, "<span class='notice'>You release the wisp. It begins to bob around your head.</span>")
icon_state = "lantern"
wisp.orbit(user, 20)
user.update_sight()
feedback_add_details("wisp_lantern","F") // freed
RegisterSignal(user, COMSIG_MOB_UPDATE_SIGHT, .proc/update_user_sight)
user.update_sight()
to_chat(user, "<span class='notice'>The wisp enhances your vision.</span>")
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)
target = wisp.orbiting
wisp.stop_orbit()
wisp.forceMove(src)
if (istype(target))
target.update_sight()
to_chat(target, "<span class='notice'>Your vision returns to normal.</span>")
UnregisterSignal(user, COMSIG_MOB_UPDATE_SIGHT)
user.update_sight()
to_chat(user, "<span class='notice'>Your vision returns to normal.</span>")
icon_state = "lantern-blue"
feedback_add_details("wisp_lantern","R") // returned
/obj/item/wisp_lantern/Initialize()
/obj/item/wisp_lantern/Initialize(mapload)
. = ..()
wisp = new(src)
@@ -232,7 +233,13 @@
qdel(wisp)
else
wisp.visible_message("<span class='notice'>[wisp] has a sad feeling for a moment, then it passes.</span>")
..()
return ..()
/obj/item/wisp_lantern/proc/update_user_sight(mob/user)
user.sight |= sight_flags
if(!isnull(lighting_alpha))
user.lighting_alpha = min(user.lighting_alpha, lighting_alpha)
user.sync_lighting_plane_alpha()
/obj/effect/wisp
name = "friendly wisp"
@@ -241,8 +248,6 @@
icon_state = "orb"
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
+1 -1
View File
@@ -691,7 +691,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
see_invisible = SEE_INVISIBLE_OBSERVER
updateghostimages()
..()
. = ..()
/mob/dead/observer/proc/updateghostsight()
if(!seedarkness)
+13 -7
View File
@@ -5,18 +5,21 @@
icon = 'icons/mob/alien.dmi'
gender = NEUTER
dna = null
alien_talk_understand = 1
var/nightvision = 1
alien_talk_understand = TRUE
var/nightvision = FALSE
see_in_dark = 4
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
var/has_fine_manipulation = FALSE
var/move_delay_add = FALSE // movement delay to add
status_flags = CANPARALYSE|CANPUSH
var/heal_rate = 5
var/large = 0
var/large = FALSE
var/heat_protection = 0.5
var/leaping = 0
var/leaping = FALSE
ventcrawler = 2
var/list/alien_organs = list()
var/death_message = "lets out a waning guttural screech, green blood bubbling from its maw..."
@@ -153,7 +156,7 @@
nightvision = TRUE
usr.hud_used.nightvisionicon.icon_state = "nightvision1"
else if(nightvision)
see_in_dark = 4
see_in_dark = initial(see_in_dark)
lighting_alpha = initial(lighting_alpha)
nightvision = FALSE
usr.hud_used.nightvisionicon.icon_state = "nightvision0"
@@ -298,3 +301,6 @@ Des: Removes all infected images from the alien.
if(see_override)
see_invisible = see_override
sync_lighting_plane_alpha()
SEND_SIGNAL(src, COMSIG_MOB_UPDATE_SIGHT)
+3 -1
View File
@@ -1162,4 +1162,6 @@ so that different stomachs can handle things in different ways VB*/
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
if(see_override)
see_invisible = see_override
see_invisible = see_override
SEND_SIGNAL(src, COMSIG_MOB_UPDATE_SIGHT)
@@ -551,6 +551,7 @@
return
dna.species.update_sight(src)
SEND_SIGNAL(src, COMSIG_MOB_UPDATE_SIGHT)
//Added a safety check in case you want to shock a human mob directly through electrocute_act.
/mob/living/carbon/human/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = FALSE, override = FALSE, tesla_shock = FALSE, illusion = FALSE, stun = TRUE)
@@ -641,9 +641,6 @@ It'll return null if the organ doesn't correspond, so include null checks when u
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.lighting_alpha = min(H.lighting_alpha, LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE)
if(H.client && H.client.eye != H)
var/atom/A = H.client.eye
if(A.update_remote_sight(H)) //returns 1 if we override all other sight updates.
+2
View File
@@ -1026,3 +1026,5 @@
if(stat == DEAD)
grant_death_vision()
return
. = ..()
+1
View File
@@ -1316,3 +1316,4 @@ var/list/ai_verbs_default = list(
see_invisible = see_override
sync_lighting_plane_alpha()
SEND_SIGNAL(src, COMSIG_MOB_UPDATE_SIGHT)
@@ -1424,4 +1424,6 @@ var/list/robot_verbs_default = list(
if(see_override)
see_invisible = see_override
sync_lighting_plane_alpha()
sync_lighting_plane_alpha()
SEND_SIGNAL(src, COMSIG_MOB_UPDATE_SIGHT)
+1
View File
@@ -1343,6 +1343,7 @@ var/list/slot_equipment_priority = list( \
return FALSE
/mob/proc/update_sight()
SEND_SIGNAL(src, COMSIG_MOB_UPDATE_SIGHT)
sync_lighting_plane_alpha()
/mob/proc/sync_lighting_plane_alpha()