mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 23:23:28 +01:00
for-the-strength-from-which-he-gives-is-unerring
This commit is contained in:
@@ -6,23 +6,26 @@
|
||||
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())
|
||||
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 turf_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(turf_loc)
|
||||
C.amount = 10
|
||||
to_chat(user, "You cut the cables and disassemble the unused power terminal.")
|
||||
qdel(T)
|
||||
return 1
|
||||
return
|
||||
if(!..())
|
||||
return
|
||||
var/turf/T = get_turf(user)
|
||||
var/area/A = get_area(T)
|
||||
if(A.get_apc())
|
||||
to_chat(user, "<span class='warning'>This area already has an APC!</span>")
|
||||
return //only one APC per area
|
||||
if(!A.requires_power)
|
||||
to_chat(user, "<span class='warning'>You cannot place [src] in this area!</span>")
|
||||
return //can't place apcs in areas with no power requirement
|
||||
for(var/obj/machinery/power/terminal/E in T)
|
||||
if(E.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(T)
|
||||
C.amount = 10
|
||||
to_chat(user, "<span class='notice'>You cut the cables and disassemble the unused power terminal.</span>")
|
||||
qdel(E)
|
||||
return TRUE
|
||||
|
||||
/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)
|
||||
|
||||
Reference in New Issue
Block a user