From bcb0cbe5cbbc90f70f015b75e7e8cb5af0cb48a8 Mon Sep 17 00:00:00 2001 From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> Date: Tue, 29 Jun 2021 06:44:18 -0400 Subject: [PATCH] Prevents built APCs from being hacked, Prevents AI from loosing points from apc destruction (#16192) * Prevents built APCs from being hacked, prevents deconstructing apcs from removing malf points * Spacing * whoops Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> * Affecteds other suggestions. * Grammer changes Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> * And autodoc for steel Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com> Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com> --- code/game/objects/items/mountable_frames/apc_frame.dm | 2 +- code/modules/power/apc.dm | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/code/game/objects/items/mountable_frames/apc_frame.dm b/code/game/objects/items/mountable_frames/apc_frame.dm index 548b77b85fe..8cabb9c6921 100644 --- a/code/game/objects/items/mountable_frames/apc_frame.dm +++ b/code/game/objects/items/mountable_frames/apc_frame.dm @@ -28,5 +28,5 @@ 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) + new /obj/machinery/power/apc(get_turf(src), get_dir(user, on_wall), TRUE) qdel(src) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index d192cb037eb..09d49a3330a 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -105,6 +105,8 @@ var/global/list/status_overlays_environ var/indestructible = 0 // If set, prevents aliens from destroying it var/keep_preset_name = 0 + /// Was this APC built instead of already existing? Used for malfhack to keep borgs from building apcs in space + var/constructed = FALSE var/report_power_alarm = TRUE @@ -171,14 +173,13 @@ operating = 0 name = "[area.name] APC" stat |= MAINT + constructed = TRUE update_icon() addtimer(CALLBACK(src, .proc/update), 5) /obj/machinery/power/apc/Destroy() SStgui.close_uis(wires) GLOB.apcs -= src - if(malfai && operating) - malfai.malf_picker.processing_time = clamp(malfai.malf_picker.processing_time - 10,0,1000) area.power_light = 0 area.power_equip = 0 area.power_environ = 0 @@ -973,6 +974,9 @@ if(malf.malfhacking) to_chat(malf, "You are already hacking an APC.") return + if(constructed) + to_chat(malf, "This APC was only recently constructed, and is not fully linked to station systems. Hacking it would be pointless.") + return to_chat(malf, "Beginning override of APC systems. This takes some time, and you cannot perform other actions during the process.") malf.malfhack = src malf.malfhacking = addtimer(CALLBACK(malf, /mob/living/silicon/ai/.proc/malfhacked, src), 600, TIMER_STOPPABLE)