Files
Bubberstation/code/game/objects/effects/decals/crayon.dm
MrMelbert 4b77c6f7c0 Decouples "Is this affected by a mop" from layer var (#88465)
## About The Pull Request

Rather than checking for object layer if we can clean something, has a
trait which accomplishes this

This better allows us to pick and choose what objects we want to clean
when mopping

Note: I didn't apply the trait to everything it previously affected
Currently, it cleans stuff like pipes and plumbing, which I deemed not
necessary to carry over since they can't get dirty anyways
I can re-add this if desired though

Fixes #88445
Fixes #88150

## Changelog

🆑 Melbert
fix: Gibs get bulk cleaned if you clean the turf again
refactor: Changed how things determine "I can be bulk cleaned if I clean
the turf underneath me", let me know if you notice anything not getting
bulk cleaned or weird things getting bulk cleaned
/🆑
2024-12-18 00:50:08 +01:00

76 lines
2.0 KiB
Plaintext

/obj/effect/decal/cleanable/crayon
name = "rune"
desc = "Graffiti. Damn kids."
icon = 'icons/effects/crayondecal.dmi'
icon_state = "rune1"
gender = NEUTER
mergeable_decal = FALSE
flags_1 = ALLOW_DARK_PAINTS_1
var/do_icon_rotate = TRUE
var/rotation = 0
var/paint_colour = COLOR_WHITE
/obj/effect/decal/cleanable/crayon/Initialize(mapload, main, type, e_name, graf_rot, alt_icon = null, desc_override = null)
. = ..()
if(isclosedturf(loc) && loc.density)
// allows for wall graffiti to be seen
SET_PLANE_IMPLICIT(src, GAME_PLANE)
layer = CLEANABLE_OBJECT_LAYER
if(e_name)
name = e_name
if(desc_override)
desc = "[desc_override]"
else
desc = "A [name] vandalizing the station."
if(alt_icon)
icon = alt_icon
if(type)
icon_state = type
if(graf_rot)
rotation = graf_rot
if(rotation && do_icon_rotate)
var/matrix/M = matrix()
M.Turn(rotation)
src.transform = M
if(main)
paint_colour = main
add_atom_colour(paint_colour, FIXED_COLOUR_PRIORITY)
RegisterSignal(src, COMSIG_OBJ_PAINTED, PROC_REF(on_painted))
/obj/effect/decal/cleanable/crayon/NeverShouldHaveComeHere(turf/here_turf)
return isgroundlessturf(here_turf)
/obj/effect/decal/cleanable/crayon/proc/on_painted(datum/source, mob/user, obj/item/toy/crayon/spraycan/spraycan, is_dark_color)
SIGNAL_HANDLER
var/cost = spraycan.all_drawables[icon_state] || CRAYON_COST_DEFAULT
if (HAS_TRAIT(user, TRAIT_TAGGER))
cost *= 0.5
spraycan.use_charges(user, cost, requires_full = FALSE)
return DONT_USE_SPRAYCAN_CHARGES
///Common crayon decals in map.
/obj/effect/decal/cleanable/crayon/rune4
icon_state = "rune4"
paint_colour = COLOR_CRAYON_RED
/obj/effect/decal/cleanable/crayon/rune2
icon_state = "rune2"
/obj/effect/decal/cleanable/crayon/x
icon_state = "x"
name = "graffiti"
paint_colour = COLOR_CRAYON_ORANGE
/obj/effect/decal/cleanable/crayon/l
icon_state = "l"
/obj/effect/decal/cleanable/crayon/i
icon_state = "i"
/obj/effect/decal/cleanable/crayon/e
icon_state = "e"
/obj/effect/decal/cleanable/crayon/i/orange
name = "graffiti"
paint_colour = COLOR_CRAYON_ORANGE