Files
Paradise/code/datums/components/paintable.dm
Christer2222 d4a435f740 You can now color boxes using crayons (#30977)
* Americanized spelling

* more spelling

* spelling + alt click

* recoloring box, put it in hand and in bag

* in backpack now

* remove old comments

* updates inventory if backpack is open

* place in bags even on floor

* null check + checks actual type

* added the color tables

* added empty subtypes. Fixed movign away bug

* lint

* mapload + as mob removal

* early returning

* removed type checks. Added more checks for coloring

* added a description + early return on color tables

* lint

* documentation, formatting, HAS_TRAIT

* formatting
2025-11-28 03:51:46 +00:00

32 lines
1.1 KiB
Plaintext

/datum/component/spraycan_paintable
var/current_paint
/datum/component/spraycan_paintable/Initialize()
RegisterSignal(parent, COMSIG_ATTACK_BY, PROC_REF(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(datum/source, obj/item/toy/crayon/spraycan/spraycan, mob/living/user)
if(!istype(spraycan) || user.a_intent == INTENT_HARM)
return
. = COMPONENT_SKIP_AFTERATTACK
if(spraycan.capped)
to_chat(user, "<span class='warning'>Take the cap off first!</span>")
return
if(spraycan.uses < 2)
to_chat(user, "<span class ='warning'>There is not enough paint in the can!")
return
RemoveCurrentCoat()
var/colour = spraycan.crayon_color
current_paint = colour
var/atom/A = parent
A.add_atom_colour(colour, FIXED_COLOUR_PRIORITY)
playsound(spraycan, 'sound/effects/spray.ogg', 5, TRUE, 5)
to_chat(user, "<span class='notice'>You spray [spraycan] on [A], painting it.</span>")