mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-18 21:15:21 +00:00
Hello everybuddy, your number three rated coder-failure here to clean up some mess. This PR accomplishes some of the more major structural clean up changes I wanted to do with /obj/ folder, but decided to wait on until wallening gets merged, and so, time has come. Several things to still be done, although I know these cleaning PR's are quite a load, so will wait for this one to get done with first. ## Why It's Good For The Game Saner spriters, better sprites, less annoyance. Also deleted a whole load of redundancy this time around, a lot of sprites which existed simultaniously in two places now got exit their quantum superposition.
41 lines
1.5 KiB
Plaintext
41 lines
1.5 KiB
Plaintext
// APC HULL
|
|
/obj/item/wallframe/apc
|
|
name = "\improper APC frame"
|
|
desc = "Used for repairing or building APCs."
|
|
icon = 'icons/obj/machines/APC.dmi'
|
|
icon_state = "frame"
|
|
result_path = /obj/machinery/power/apc/auto_name
|
|
|
|
/obj/item/wallframe/apc/try_build(turf/on_wall, user)
|
|
if(!..())
|
|
return
|
|
var/turf/T = get_turf(on_wall) //the user is not where it needs to be.
|
|
var/area/A = get_area(user)
|
|
if(A.apc)
|
|
to_chat(user, span_warning("This area already has an APC!"))
|
|
return //only one APC per area
|
|
if(!A.requires_power)
|
|
to_chat(user, span_warning("You cannot place [src] in this area!"))
|
|
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_warning("There is another network terminal here!"))
|
|
return
|
|
else
|
|
new /obj/item/stack/cable_coil(T, 10)
|
|
to_chat(user, span_notice("You cut the cables and disassemble the unused power terminal."))
|
|
qdel(E)
|
|
return TRUE
|
|
|
|
/obj/item/wallframe/apc/screwdriver_act(mob/living/user, obj/item/tool)
|
|
//overriding the wallframe parent screwdriver act with this one which allows applying to existing apc frames.
|
|
|
|
var/turf/turf = get_step(get_turf(user), user.dir)
|
|
if(iswallturf(turf))
|
|
if(locate(/obj/machinery/power/apc) in get_turf(user))
|
|
var/obj/machinery/power/apc/mounted_apc = locate(/obj/machinery/power/apc) in get_turf(user)
|
|
mounted_apc.wallframe_act(user, src)
|
|
return ITEM_INTERACT_SUCCESS
|
|
turf.attackby(src, user)
|
|
return ITEM_INTERACT_SUCCESS
|