[Ready] Light bulbs shatter and hurt players when stepped on, spill plasma if rigged (#40625)

* v1

* Fixes code, lights spill plasma if rigged

* Yeah let's not do that
This commit is contained in:
81Denton
2018-10-05 08:10:47 +02:00
committed by yogstation13-bot
parent b148d7328a
commit 448bce4bda

View File

@@ -723,7 +723,7 @@
var/switchcount = 0 // number of times switched
materials = list(MAT_GLASS=100)
grind_results = list("silicon" = 5, "nitrogen" = 10) //Nitrogen is used as a cheaper alternative to argon in incandescent lighbulbs
var/rigged = 0 // true if rigged to explode
var/rigged = FALSE // true if rigged to explode
var/brightness = 2 //how much light it gives off
/obj/item/light/suicide_act(mob/living/carbon/user)
@@ -777,11 +777,23 @@
icon_state = "[base_state]-broken"
desc = "A broken [name]."
/obj/item/light/Initialize()
. = ..()
update()
/obj/item/light/ComponentInitialize()
. = ..()
AddComponent(/datum/component/caltrop, force)
/obj/item/light/Crossed(mob/living/L)
. = ..()
if(istype(L) && has_gravity(loc))
if(L.has_trait(TRAIT_LIGHT_STEP))
playsound(loc, 'sound/effects/glass_step.ogg', 30, 1)
else
playsound(loc, 'sound/effects/glass_step.ogg', 50, 1)
if(status == LIGHT_BURNED || status == LIGHT_OK)
shatter()
// attack bulb/tube with object
// if a syringe, can inject plasma to make it explode
@@ -794,7 +806,7 @@
if(S.reagents.has_reagent("plasma", 5))
rigged = 1
rigged = TRUE
S.reagents.clear_reagents()
else
@@ -815,6 +827,8 @@
status = LIGHT_BROKEN
force = 5
playsound(src.loc, 'sound/effects/glasshit.ogg', 75, 1)
if(rigged)
atmos_spawn_air("plasma=5") //5u of plasma are required to rig a light bulb/tube
update()