mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-28 11:11:52 +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.
29 lines
1007 B
Plaintext
29 lines
1007 B
Plaintext
/obj/item/mounted/frame/apc_frame
|
|
name = "APC frame"
|
|
desc = "Used for repairing or building APCs"
|
|
icon = 'icons/obj/apc_repair.dmi'
|
|
icon_state = "apc_frame"
|
|
mount_reqs = list("simfloor", "nospace")
|
|
|
|
/obj/item/mounted/frame/apc_frame/try_build(turf/on_wall, mob/user)
|
|
if(..())
|
|
var/turf/turf_loc = get_turf(user)
|
|
var/area/area_loc = turf_loc.loc
|
|
if (area_loc.get_apc())
|
|
user << "<span class='rose'>This area already has an APC.</span>"
|
|
return //only one APC per area
|
|
for(var/obj/machinery/power/terminal/T in turf_loc)
|
|
if (T.master)
|
|
user << "<span class='rose'>There is another network terminal here.</span>"
|
|
return
|
|
else
|
|
var/obj/item/stack/cable_coil/C = new /obj/item/stack/cable_coil(turf_loc)
|
|
C.amount = 10
|
|
user << "You cut the cables and disassemble the unused power terminal."
|
|
qdel(T)
|
|
return 1
|
|
return
|
|
|
|
/obj/item/mounted/frame/apc_frame/do_build(turf/on_wall, mob/user)
|
|
new /obj/machinery/power/apc(get_turf(src), get_dir(user, on_wall), 1)
|
|
qdel(src) |