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
@@ -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."