mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 11:05:03 +01:00
Darkness handling update
This commit is contained in:
@@ -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."
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user