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>
This commit is contained in:
Qwertytoforty
2021-06-29 06:44:18 -04:00
committed by GitHub
parent 9a21cf1d4b
commit bcb0cbe5cb
2 changed files with 7 additions and 3 deletions
@@ -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)
+6 -2
View File
@@ -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, "<span class='warning'>This APC was only recently constructed, and is not fully linked to station systems. Hacking it would be pointless.</span>")
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)