Files
Bubberstation/code/game/objects/items/apc_frame.dm
SkyratBot b15b16976a [MIRROR] Attack chain refactoring: Broadening tool_act into item_interact, moving some item interactions to... atom/item_interact / item/interact_with_atom [MDB IGNORE] (#25516)
* Attack chain refactoring: Broadening `tool_act` into `item_interact`, moving some item interactions to... `atom/item_interact` / `item/interact_with_atom`

* Patches up merge skew (#80197)

## About The Pull Request

Yeah #79968 (1e76fd70b4) was not
compatible with master but no one said anything on the PR so i got
jebaited into merging it. The code should be up to the same standards
per the documentation I read (preventing thwacking the target in certain
situations while not returning anything in other situations)

master will definitely compile now though

* Patches up merge skew

* Merge conflicts

* Modular adjustments

* Removes this entirely duplicated proc...

* Update tool_override.dm

* Update weldingtool.dm

* Update tool_override.dm

* Update tool_override.dm

* Nope. Copy paste begone.

A skyrat edit is so much easier to deal with here

* Update brand_intelligence.dm

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
2023-12-09 08:22:19 -05:00

40 lines
1.4 KiB
Plaintext

// APC HULL
/obj/item/wallframe/apc
name = "\improper APC frame"
desc = "Used for repairing or building APCs."
icon_state = "apc"
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/T = get_step(get_turf(user), user.dir)
if(iswallturf(T))
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.attackby(src, user)
return ITEM_INTERACT_SUCCESS
T.attackby(src, user)
return ITEM_INTERACT_SUCCESS