mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* it begins * Update gun.dm * misc fixes * Update gun.dm * more fixes * Update lightning_flow.dm * i may be stupid * Update suicide.dm * fix mech strafing * Update mecha.dm * let there be qol * ghost stuff * Update screen_clockwork.dmi * does the stuff * stuff * Update worldbreaker.dm * moltial arts * Update worldbreaker.dm * CRITICAL FIX * mech stuff * Update tables_racks.dm * stuff * fix seismic arm * buster/seismic arm fix 2 * saber + lockers * stuff * hand tele and pre_attack_secondary * more right click acts * Update closets.dm * who did this * heck * Update mob.dm * Update items.dm * darkspawn fix * fixes wound healing * Update item_attack.dm * minor qol stuff * Update kinetic_crusher.dm * Update kinetic_crusher.dm * runtime fix * Update kinetic_crusher.dm * Update screen_plasmafire.dmi * stuff * syringes * i am very silly * death to /obj/item/toolset_handler * Update assembly.dm * surgery fix + hypo stuff * mantis fix * gas harpoon * atmos machines --------- Co-authored-by: Molti <gamingjoelouis@gmail.com>
30 lines
1008 B
Plaintext
30 lines
1008 B
Plaintext
/datum/component/spraycan_paintable
|
|
var/current_paint
|
|
|
|
/datum/component/spraycan_paintable/Initialize()
|
|
RegisterSignal(parent, COMSIG_ATOM_ATTACKBY, 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.combat_mode)
|
|
return
|
|
. = COMPONENT_NO_AFTERATTACK
|
|
if(spraycan.is_capped)
|
|
to_chat(user, span_warning("Take the cap off first!"))
|
|
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_notice("You spray [spraycan] on [A], painting it."))
|