Files
Bubberstation/code/game/objects/effects/decals/crayon.dm
SkyratBot fd3b832bb8 [MIRROR] Makes decals only caught on mapload & removes turf_loc_check [MDB IGNORE] (#22051)
* Makes decals only caught on mapload & removes turf_loc_check (#76130)

Theres one player-facing change in this PR and it's that I removed human
gibs from being valid in space turfs, making it more consistent with the
other gib decals.

I've cleaned up many instances of decals spawning in bad turfs on
mapload in https://github.com/tgstation/tgstation/pull/75189, but making
it error anytime in-game a decal is put over an invalid turf is bad as
it punishes contributors for not optimizing their decals properly.
This changes it so it only errors if it's on mapload, unit testing or
not.

I've also removed ``turf_loc_check`` and replaced instances of it with
overwriting ``NeverShouldHaveComeHere``, which gives us greater control
of where decals can be placed.
This let me remove 2 subtypes that were made to have decals in specific
places (which then got placed elsewhere, ruining it all).

Mappers are still able to set decals to be placed anywhere, they just
need to add it as a valid turf for that decal.

* Makes decals only caught on mapload & removes turf_loc_check

---------

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
2023-06-24 16:06:58 -07:00

44 lines
1.3 KiB
Plaintext

/obj/effect/decal/cleanable/crayon
name = "rune"
desc = "Graffiti. Damn kids."
icon = 'icons/effects/crayondecal.dmi'
icon_state = "rune1"
gender = NEUTER
plane = GAME_PLANE //makes the graffiti visible over a wall.
mergeable_decal = FALSE
flags_1 = ALLOW_DARK_PAINTS_1
var/do_icon_rotate = TRUE
var/rotation = 0
var/paint_colour = "#FFFFFF"
/obj/effect/decal/cleanable/crayon/Initialize(mapload, main, type, e_name, graf_rot, alt_icon = null)
. = ..()
if(e_name)
name = e_name
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