mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Code rework of placing things on walls.
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.
This commit is contained in:
committed by
Tigercat2000
parent
35664b8708
commit
44aa2ba225
@@ -0,0 +1,32 @@
|
||||
/obj/item/mounted/frame/newscaster_frame
|
||||
name = "newscaster frame"
|
||||
desc = "Used to build newscasters, just secure to the wall."
|
||||
icon_state = "newscaster"
|
||||
item_state = "syringe_kit"
|
||||
m_amt = 14000
|
||||
g_amt = 8000
|
||||
mount_reqs = list("simfloor", "nospace")
|
||||
|
||||
/obj/item/mounted/frame/newscaster_frame/try_build(turf/on_wall, mob/user)
|
||||
if(..())
|
||||
var/turf/loc = get_turf(usr)
|
||||
var/area/A = loc.loc
|
||||
if (!istype(loc, /turf/simulated/floor))
|
||||
usr << "<span class='alert'>Newscaster cannot be placed on this spot.</span>"
|
||||
return
|
||||
if (A.requires_power == 0 || A.name == "Space")
|
||||
usr << "<span class='alert'>Newscaster cannot be placed in this area.</span>"
|
||||
return
|
||||
|
||||
for(var/obj/machinery/newscaster/T in loc)
|
||||
usr << "<span class='alert'>There is another newscaster here.</span>"
|
||||
return
|
||||
|
||||
return 1
|
||||
return
|
||||
|
||||
/obj/item/mounted/frame/newscaster_frame/do_build(turf/on_wall, mob/user)
|
||||
var/obj/machinery/newscaster/N = new /obj/machinery/newscaster(get_turf(src), get_dir(on_wall, user), 1)
|
||||
N.pixel_y -= (loc.y - on_wall.y) * 32
|
||||
N.pixel_x -= (loc.x - on_wall.x) * 32
|
||||
qdel(src)
|
||||
Reference in New Issue
Block a user