mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Merge pull request #16218 from DamianX/SpookyLantern
Lanterns can be spooked
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
if(start_with_lantern)
|
||||
lantern = new /obj/item/device/flashlight/lantern/on(src)
|
||||
|
||||
update_brightness()
|
||||
update()
|
||||
|
||||
/obj/structure/hanging_lantern/attack_hand(mob/user)
|
||||
|
||||
@@ -44,8 +44,7 @@
|
||||
lantern.add_fingerprint(user)
|
||||
user.put_in_hands(lantern)
|
||||
lantern = null
|
||||
update_brightness()
|
||||
update_icon()
|
||||
update()
|
||||
|
||||
/obj/structure/hanging_lantern/examine(mob/user)
|
||||
..()
|
||||
@@ -85,8 +84,7 @@
|
||||
"<span class='notice'>You put \a [W.name] on the \the [src].</span>")
|
||||
playsound(get_turf(src), 'sound/machines/click.ogg', 20, 1)
|
||||
lantern = W
|
||||
update_brightness()
|
||||
update_icon()
|
||||
update()
|
||||
return 1
|
||||
|
||||
/obj/structure/hanging_lantern/update_icon()
|
||||
@@ -105,16 +103,17 @@
|
||||
spawn()
|
||||
for(var/i = 0; i < amount; i++)
|
||||
if(!lantern)
|
||||
update_brightness()
|
||||
break
|
||||
set_light(0)
|
||||
toggle_lantern()
|
||||
sleep(rand(5, 15))
|
||||
update_brightness()
|
||||
|
||||
toggle_lantern()
|
||||
flickering = 0
|
||||
|
||||
/obj/structure/hanging_lantern/proc/update_brightness()
|
||||
/obj/structure/hanging_lantern/proc/update()
|
||||
update_icon()
|
||||
update_brightness()
|
||||
|
||||
/obj/structure/hanging_lantern/proc/update_brightness()
|
||||
if(lantern)
|
||||
light_range = lantern.light_range
|
||||
light_power = lantern.light_power
|
||||
@@ -126,7 +125,13 @@
|
||||
|
||||
set_light(light_range, light_power, light_color)
|
||||
|
||||
/obj/structure/hanging_lantern/verb/toggle_lantern()
|
||||
/obj/structure/hanging_lantern/proc/toggle_lantern()
|
||||
if(lantern)
|
||||
lantern.on = !lantern.on
|
||||
lantern.update_brightness()
|
||||
update()
|
||||
|
||||
/obj/structure/hanging_lantern/verb/toggle_lantern_verb()
|
||||
set name = "Toggle Mounted Lantern"
|
||||
set desc = "Toggle the lantern mounted on a nearby lantern hook."
|
||||
set category = "Object"
|
||||
@@ -140,8 +145,7 @@
|
||||
to_chat(usr, "<span class='warning>You don't have the dexterity to do this!</span>")
|
||||
return 0
|
||||
|
||||
lantern.on = !lantern.on
|
||||
lantern.update_brightness()
|
||||
toggle_lantern()
|
||||
usr.visible_message("<span class='notice'>[usr] toggles \the [lantern] hanging on \the [src] [lantern.on ? "on":"off"].</span>", \
|
||||
"<span class='notice'>You toggle \the [lantern] hanging on \the [src] [lantern.on ? "on":"off"].</span>")
|
||||
|
||||
@@ -149,6 +153,13 @@
|
||||
if(..(ghost, TRUE))
|
||||
flicker()
|
||||
|
||||
/obj/structure/hanging_lantern/attack_ghost(var/mob/user)
|
||||
if(!can_spook())
|
||||
return
|
||||
add_hiddenprint(user)
|
||||
flicker(1)
|
||||
investigation_log(I_GHOST, "|| was made to flicker by [key_name(user)][user.locked_to ? ", who was haunting [user.locked_to]" : ""]")
|
||||
|
||||
/obj/structure/hanging_lantern/Destroy()
|
||||
|
||||
if(lantern)
|
||||
@@ -160,4 +171,4 @@
|
||||
/obj/structure/hanging_lantern/hook
|
||||
|
||||
icon_state = "hanginglantern-construct"
|
||||
start_with_lantern = 0
|
||||
start_with_lantern = 0
|
||||
Reference in New Issue
Block a user