Adds H.E.C.K. suits, spraycan_paintable component, and reworks item's attackby()
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/datum/component/spraycan_paintable
|
||||
var/current_paint
|
||||
|
||||
/datum/component/spraycan_paintable/Initialize()
|
||||
RegisterSignal(COMSIG_PARENT_ATTACKBY, .proc/Repaint)
|
||||
|
||||
/datum/component/spraycan_paintable/Destroy()
|
||||
RemoveCurrentCoat()
|
||||
return ..()
|
||||
|
||||
/datum/component/spraycan_paintable/proc/RemoveCurrentCoat()
|
||||
var/atom/A = parent
|
||||
A.remove_atom_colour(FIXED_COLOUR_PRIORITY, current_paint)
|
||||
|
||||
/datum/component/spraycan_paintable/proc/Repaint(obj/item/toy/crayon/spraycan/spraycan, mob/living/user)
|
||||
if(!istype(spraycan) || user.a_intent == INTENT_HARM)
|
||||
return FALSE
|
||||
. = TRUE
|
||||
if(spraycan.is_capped)
|
||||
to_chat(user, "<span class='warning'>Take the cap off first!</span>")
|
||||
return
|
||||
RemoveCurrentCoat()
|
||||
if(spraycan.use_charges(user, 2))
|
||||
var/colour = spraycan.paint_color
|
||||
current_paint = colour
|
||||
var/atom/A = parent
|
||||
A.add_atom_colour(colour, FIXED_COLOUR_PRIORITY)
|
||||
playsound(spraycan, 'sound/effects/spray.ogg', 5, 1, 5)
|
||||
to_chat(user, "<span class='notice'>You spray [spraycan] on [A], painting it.</span>")
|
||||
Reference in New Issue
Block a user