diff --git a/code/__DEFINES/robots.dm b/code/__DEFINES/robots.dm index 9b450765db..38dc9e48cc 100644 --- a/code/__DEFINES/robots.dm +++ b/code/__DEFINES/robots.dm @@ -39,4 +39,5 @@ #define NEW_BORG 1 #define NEW_MODULE 2 #define RENAME 3 -#define AI_SHELL 4 \ No newline at end of file +#define AI_SHELL 4 +#define DISCONNECT 5 diff --git a/code/datums/wires/robot.dm b/code/datums/wires/robot.dm index ad2cf8e3c3..d4eeb0cc39 100644 --- a/code/datums/wires/robot.dm +++ b/code/datums/wires/robot.dm @@ -26,12 +26,17 @@ status += "The reset module hardware light is [R.has_module() ? "on" : "off"]." return status -/datum/wires/robot/on_pulse(wire) +/datum/wires/robot/on_pulse(wire, user) var/mob/living/silicon/robot/R = holder switch(wire) if(WIRE_AI) // Pulse to pick a new AI. if(!R.emagged) - var/new_ai = select_active_ai(R) + var/new_ai + if(user) + new_ai = select_active_ai(user) + else + new_ai = select_active_ai(R) + R.notify_ai(DISCONNECT) if(new_ai && (new_ai != R.connected_ai)) R.connected_ai = new_ai if(R.shell) @@ -59,8 +64,10 @@ switch(wire) if(WIRE_AI) // Cut the AI wire to reset AI control. if(!mend) + R.notify_ai(DISCONNECT) + if(R.shell) + R.undeploy() R.connected_ai = null - R.undeploy() //Forced disconnect of an AI should this body be a shell. if(WIRE_LAWSYNC) // Cut the law wire, and the borg will no longer receive law updates from its AI. Repair and it will re-sync. if(mend) if(!R.emagged) diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm index bd4094cfaa..fa25b38862 100644 --- a/code/datums/wires/wires.dm +++ b/code/datums/wires/wires.dm @@ -127,13 +127,13 @@ for(var/wire in wires) cut(wire) -/datum/wires/proc/pulse(wire) +/datum/wires/proc/pulse(wire, user) if(is_cut(wire)) return - on_pulse(wire) + on_pulse(wire, user) -/datum/wires/proc/pulse_color(color) - pulse(get_wire(color)) +/datum/wires/proc/pulse_color(color, mob/living/user) + pulse(get_wire(color), user) /datum/wires/proc/pulse_assembly(obj/item/device/assembly/S) for(var/color in assemblies) @@ -177,7 +177,7 @@ /datum/wires/proc/on_cut(wire, mend = FALSE) return -/datum/wires/proc/on_pulse(wire) +/datum/wires/proc/on_pulse(wire, user) return // End Overridable Procs @@ -236,7 +236,7 @@ if("pulse") if(istype(I, /obj/item/device/multitool) || IsAdminGhost(usr)) playsound(holder, 'sound/weapons/empty.ogg', 20, 1) - pulse_color(target_wire) + pulse_color(target_wire, L) . = TRUE else to_chat(L, "You need a multitool!") diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 0cc9261861..fbefc33d9c 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -889,6 +889,8 @@ to_chat(connected_ai, "

NOTICE - Cyborg reclassification detected: [oldname] is now designated as [newname].
") if(AI_SHELL) //New Shell to_chat(connected_ai, "

NOTICE - New cyborg shell detected: [name]
") + if(DISCONNECT) //Tampering with the wires + to_chat(connected_ai, "

NOTICE - Remote telemetry lost with [name].
") /mob/living/silicon/robot/canUseTopic(atom/movable/M, be_close = 0) if(stat || lockcharge || low_power_mode)