Files
Batrachophreno eebb8b971c Materials Repath (#22388)
Soft-ish port of https://github.com/NebulaSS13/Nebula/pull/540. Except
we call them singletons.

Repaths all materials as singletons instead of datums, and replaces
material defines from strings to paths so that we can just run
GET_SINGLETON instead of needing to use SSMaterials. This is Step One.

This PR has no player-facing changes.

changes:
  - refactor: "Repaths /material to /singleton/material."
- refactor: "Replaces all material string defines to path defines,
replacing SSmaterials procs w/ GET_SINGLETON instead."
- refactor: "Removes all material var edited objects from all maps,
adding new presets where necessary."
- refactor: "Updates recipes unit test to run all recipes against all
material singletons."

---------

Signed-off-by: Batrachophreno <Batrochophreno@gmail.com>
Co-authored-by: kano-dot <bhutanlikanoxy@gmail.com>
2026-07-10 18:45:58 +00:00

49 lines
1.3 KiB
Plaintext

/obj/structure/easel
name = "easel"
desc = "Only for the finest of art!"
icon = 'icons/obj/canvas.dmi'
icon_state = "easel"
density = TRUE
build_amt = 5
var/obj/item/canvas/painting = null
/obj/structure/easel/Initialize(ml, _mat, _reinf_mat)
. = ..()
RegisterSignal(src, COMSIG_MOVABLE_MOVED, PROC_REF(move_painting))
material = GET_SINGLETON(MATERIAL_WOOD)
/obj/structure/easel/Destroy()
painting = null
UnregisterSignal(src, COMSIG_MOVABLE_MOVED)
return ..()
/*
* Adding canvases.
*/
/obj/structure/easel/attackby(obj/item/attacking_item, mob/user, params)
if(istype(attacking_item, /obj/item/canvas))
var/obj/item/canvas/C = attacking_item
if(user.unEquip(C))
painting = C
C.forceMove(get_turf(src))
C.layer = layer + 0.1
C.pixel_x = 0
C.pixel_y = 0
C.pixel_z = 0
user.visible_message("<b>[user]</b> puts \the [C] on \the [src].", SPAN_NOTICE("You place \the [C] on \the [src]."))
return TRUE
if(attacking_item.tool_behaviour == TOOL_WRENCH)
to_chat(user, SPAN_NOTICE("You dismantle \the [src]."))
dismantle()
return TRUE
return ..()
/*
* Stick to the easel like glue.
*/
/obj/structure/easel/proc/move_painting()
if(painting && Adjacent(painting)) // Only move if it's near us.
painting.forceMove(get_turf(src))
else
painting = null