[MIRROR] Fixes lightbulb injections (#1821)

* Fixes lightbulb injections (#55132)

Co-authored-by: itseasytosee <55666666+itseasytosee@ users.noreply.github.com>
Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@ users.noreply.github.com>

* Fixes lightbulb injections

Co-authored-by: Coffee <CoffeeDragon16@gmail.com>
Co-authored-by: itseasytosee <55666666+itseasytosee@ users.noreply.github.com>
Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@ users.noreply.github.com>
This commit is contained in:
SkyratBot
2020-11-25 01:00:09 +01:00
committed by GitHub
parent 8540dbc674
commit d6c12e331d
+9 -15
View File
@@ -15,6 +15,9 @@
#define LIGHT_DRAIN_TIME 25
#define LIGHT_POWER_GAIN 35
//How many reagents the lights can hold
#define LIGHT_REAGENT_CAPACITY 5
/obj/item/wallframe/light_fixture
name = "light fixture frame"
desc = "Used for building lights."
@@ -883,6 +886,7 @@
/obj/item/light/Initialize()
. = ..()
create_reagents(LIGHT_REAGENT_CAPACITY, INJECTABLE | DRAINABLE)
update()
/obj/item/light/ComponentInitialize()
@@ -901,21 +905,11 @@
// attack bulb/tube with object
// if a syringe, can inject plasma to make it explode
/obj/item/light/attackby(obj/item/I, mob/user, params)
..()
if(istype(I, /obj/item/reagent_containers/syringe))
var/obj/item/reagent_containers/syringe/S = I
to_chat(user, "<span class='notice'>You inject the solution into \the [src].</span>")
if(S.reagents.has_reagent(/datum/reagent/toxin/plasma, 5))
rigged = TRUE
S.reagents.clear_reagents()
else
..()
return
/obj/item/light/on_reagent_change(changetype)
rigged = (reagents.has_reagent(/datum/reagent/toxin/plasma, LIGHT_REAGENT_CAPACITY)) //has_reagent returns the reagent datum
return ..()
#undef LIGHT_REAGENT_CAPACITY
/obj/item/light/attack(mob/living/M, mob/living/user, def_zone)
..()