Files
Paradise/code/game/objects/items/mountable_frames/frames.dm
Luc 495afc5e60 Moves almost all wrench checks in attackby to wrench_act() (#25687)
* wrench a bunch of acts

* atmospherics

* some last few things

* last iswrench changes for anything that isn't construction

* Update code/game/machinery/pipe/pipe_construction.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

* thank you dgamer

* oopsie daisy

* tests and addresses some introduced bugs

* proper testing

* proper ci

* Update code/game/objects/structures/fluff.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

* Update code/game/objects/structures/fluff.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

* thank you burza 🙏

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/modules/recycling/disposal-construction.dm

Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

---------

Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
2024-07-30 13:51:00 +00:00

37 lines
1.3 KiB
Plaintext

/obj/item/mounted/frame
name = "mountable frame"
desc = "Place it on a wall."
origin_tech = "materials=1;engineering=1"
toolspeed = 1
usesound = 'sound/items/deconstruct.ogg'
///amount of metal sheets returned upon the frame being wrenched
var/metal_sheets_refunded = 2
///amount of glass sheets returned upon the frame being wrenched
var/glass_sheets_refunded = 0
///The requirements for this frame to be placed, uses bit flags
var/mount_requirements = 0
/obj/item/mounted/frame/wrench_act(mob/living/user, obj/item/I)
var/turf/user_turf = get_turf(user)
if(metal_sheets_refunded)
new /obj/item/stack/sheet/metal(user_turf, metal_sheets_refunded)
if(glass_sheets_refunded)
new /obj/item/stack/sheet/glass(user_turf, glass_sheets_refunded)
qdel(src)
/obj/item/mounted/frame/try_build(turf/on_wall, mob/user)
if(!..())
return
var/turf/build_turf = get_turf(user)
if((mount_requirements & MOUNTED_FRAME_SIMFLOOR) && !isfloorturf(build_turf))
to_chat(user, "<span class='warning'>[src] cannot be placed on this spot.</span>")
return
if(mount_requirements & MOUNTED_FRAME_NOSPACE)
var/area/my_area = get_area(build_turf)
if(!istype(my_area) || !my_area.requires_power || isspacearea(my_area))
to_chat(user, "<span class='warning'>[src] cannot be placed in this area.</span>")
return
return TRUE