Files
TheFurryFeline 52f9805971 APC Frames Deconstruction Fix
No more of getting more steel from the frame than what's actually used. Two sheets for two sheets. Not two sheets, then get five back. Ported from https://github.com/VOREStation/VOREStation/pull/5061
2019-04-18 23:03:01 -04:00

39 lines
1.3 KiB
Plaintext

// APC HULL
/obj/item/frame/apc
name = "\improper APC frame"
desc = "Used for repairing or building APCs"
icon = 'icons/obj/apc_repair.dmi'
icon_state = "apc_frame"
flags = CONDUCT
refund_amt = 2 //TFF 18/4/19: Polaris fix for APC frames giving more steel than used when made.
/obj/item/frame/apc/try_build(turf/on_wall, mob/user as mob)
if (get_dist(on_wall, user)>1)
return
var/ndir = get_dir(user, on_wall)
if (!(ndir in cardinal))
return
var/turf/loc = get_turf(user)
var/area/A = loc.loc
if (!istype(loc, /turf/simulated/floor))
to_chat(user, "<span class='warning'>APC cannot be placed on this spot.</span>")
return
if (A.requires_power == 0 || istype(A, /area/space))
to_chat(user, "<span class='warning'>APC cannot be placed in this area.</span>")
return
if (A.get_apc())
to_chat(user, "<span class='warning'>This area already has an APC.</span>")
return //only one APC per area
for(var/obj/machinery/power/terminal/T in loc)
if (T.master)
to_chat(user, "<span class='warning'>There is another network terminal here.</span>")
return
else
var/obj/item/stack/cable_coil/C = new /obj/item/stack/cable_coil(loc)
C.amount = 10
to_chat(user, "You cut the cables and disassemble the unused power terminal.")
qdel(T)
new /obj/machinery/power/apc(loc, ndir, 1)
qdel(src)