mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-27 02:32:20 +00:00
Stuff goes under types. Types have procs. Never have 500 lines of repeated code again. I came very close to crying while editing this. You should appreciate that. ---- This commit entirely reworks how placing things on walls work- Posters have intentionally been left alone to reduce the amount of lines changed. With this commit, wall-mounted objects are no longer snowflaked into the wall file.
39 lines
1.3 KiB
Plaintext
39 lines
1.3 KiB
Plaintext
/obj/item/mounted/frame/light_fixture
|
|
name = "light fixture frame"
|
|
desc = "Used for building lights."
|
|
icon = 'icons/obj/lighting.dmi'
|
|
icon_state = "tube-construct-item"
|
|
var/fixture_type = "tube"
|
|
mount_reqs = list("simfloor")
|
|
|
|
/obj/item/mounted/frame/light_fixture/do_build(turf/on_wall, mob/user)
|
|
user << "You begin attaching [src] to \the [on_wall]."
|
|
playsound(get_turf(src), 'sound/machines/click.ogg', 75, 1)
|
|
var/constrdir = user.dir
|
|
var/constrloc = get_turf(user)
|
|
if (!do_after(user, 30))
|
|
return
|
|
var/obj/machinery/light_construct/newlight
|
|
switch(fixture_type)
|
|
if("bulb")
|
|
newlight = new /obj/machinery/light_construct/small(constrloc)
|
|
if("tube")
|
|
newlight = new /obj/machinery/light_construct(constrloc)
|
|
else
|
|
newlight = new /obj/machinery/light_construct/small(constrloc)
|
|
newlight.dir = constrdir
|
|
newlight.fingerprints = src.fingerprints
|
|
newlight.fingerprintshidden = src.fingerprintshidden
|
|
newlight.fingerprintslast = src.fingerprintslast
|
|
|
|
user.visible_message("[user] attaches \the [src] to \the [on_wall].", \
|
|
"You attach \the [src] to \the [on_wall].")
|
|
qdel(src)
|
|
|
|
/obj/item/mounted/frame/light_fixture/small
|
|
name = "small light fixture frame"
|
|
desc = "Used for building small lights."
|
|
icon = 'icons/obj/lighting.dmi'
|
|
icon_state = "bulb-construct-item"
|
|
fixture_type = "bulb"
|
|
sheets_refunded = 1 |