[MIRROR] Tweaked insulated spray-on gloves (#2783)

* Tweaked insulated spray-on gloves (#56232)

Some tweaking and code smoothing of the spray-on gloves. The only
mechanical change is in also letting them be washed off (although it
takes a while under a shower or using a sink).

A visible message also provides better feedback.

* Make /wash a SHOULD_CALL_PARENT proc

A number of things depend on that signal being called.

* Makes suggested changes

- Adds SIGNAL_HANDLER to signal handler
- Changes name of turf variable for readability
- Reenables lighting object override of parent

* Tweaked insulated spray-on gloves

Co-authored-by: coiax <yellowbounder@gmail.com>
This commit is contained in:
SkyratBot
2021-01-19 10:36:10 +00:00
committed by GitHub
co-authored by coiax
parent 74fb54dd76
commit 5c59e5d537
3 changed files with 16 additions and 13 deletions
+13 -13
View File
@@ -23,7 +23,7 @@
if(iscarbon(target) && proximity)
var/mob/living/carbon/C = target
var/mob/living/carbon/U = user
var/success = C.equip_to_slot_if_possible(new /obj/item/clothing/gloves/color/yellow/sprayon, ITEM_SLOT_GLOVES, TRUE, TRUE)
var/success = C.equip_to_slot_if_possible(new /obj/item/clothing/gloves/color/yellow/sprayon, ITEM_SLOT_GLOVES, qdel_on_fail = TRUE, disable_warning = TRUE)
if(success)
if(C == user)
C.visible_message("<span class='notice'>[U] sprays their hands with glittery rubber!</span>")
@@ -32,33 +32,33 @@
else
C.visible_message("<span class='warning'>The rubber fails to stick to [C]'s hands!</span>")
qdel(src)
/obj/item/clothing/gloves/color/yellow/sprayon
desc = "How're you gonna get 'em off, nerd?"
name = "spray-on insulated gloves"
icon_state = "sprayon"
inhand_icon_state = "sprayon"
item_flags = DROPDEL
permeability_coefficient = 0
resistance_flags = ACID_PROOF
var/shocks_remaining = 10
var/charges_remaining = 10
/obj/item/clothing/gloves/color/yellow/sprayon/Initialize()
.=..()
ADD_TRAIT(src, TRAIT_NODROP, CLOTHING_TRAIT)
ADD_TRAIT(src, TRAIT_NODROP, INNATE_TRAIT)
/obj/item/clothing/gloves/color/yellow/sprayon/equipped(mob/user, slot)
. = ..()
RegisterSignal(user, COMSIG_LIVING_SHOCK_PREVENTED, .proc/Shocked)
RegisterSignal(user, COMSIG_LIVING_SHOCK_PREVENTED, .proc/use_charge)
RegisterSignal(src, COMSIG_COMPONENT_CLEAN_ACT, .proc/use_charge)
/obj/item/clothing/gloves/color/yellow/sprayon/proc/Shocked()
shocks_remaining--
if(shocks_remaining < 0)
qdel(src) //if we run out of uses, the gloves crumble away into nothing, just like my dreams after working with .dm
/obj/item/clothing/gloves/color/yellow/sprayon/proc/use_charge()
SIGNAL_HANDLER
/obj/item/clothing/gloves/color/yellow/sprayon/dropped()
.=..()
qdel(src) //loose nodrop items bad
charges_remaining--
if(charges_remaining <= 0)
var/turf/location = get_turf(src)
location.visible_message("<span class='warning'>[src] crumble[p_s()] away into nothing.</span>") // just like my dreams after working with .dm
qdel(src)
/obj/item/clothing/gloves/color/fyellow //Cheap Chinese Crap
desc = "These gloves are cheap knockoffs of the coveted ones - no way this can end badly."
+1
View File
@@ -146,6 +146,7 @@
return
/atom/movable/lighting_object/wash(clean_types)
SHOULD_CALL_PARENT(FALSE) // lighting objects are dirty, confirmed
return
// Override here to prevent things accidentally moving around overlays.