Makes pulsing the AI wire of a borg offer the user the option to change it and properly notifies the AI when it is cut.

This commit is contained in:
CitadelStationBot
2017-07-06 09:53:35 -05:00
parent 2871a73236
commit 9c5b764058
4 changed files with 20 additions and 10 deletions
+2 -1
View File
@@ -39,4 +39,5 @@
#define NEW_BORG 1
#define NEW_MODULE 2
#define RENAME 3
#define AI_SHELL 4
#define AI_SHELL 4
#define DISCONNECT 5
+10 -3
View File
@@ -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)
+6 -6
View File
@@ -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, "<span class='warning'>You need a multitool!</span>")
@@ -889,6 +889,8 @@
to_chat(connected_ai, "<br><br><span class='notice'>NOTICE - Cyborg reclassification detected: [oldname] is now designated as [newname].</span><br>")
if(AI_SHELL) //New Shell
to_chat(connected_ai, "<br><br><span class='notice'>NOTICE - New cyborg shell detected: <a href='?src=\ref[connected_ai];track=[html_encode(name)]'>[name]</a></span><br>")
if(DISCONNECT) //Tampering with the wires
to_chat(connected_ai, "<br><br><span class='notice'>NOTICE - Remote telemetry lost with [name].</span><br>")
/mob/living/silicon/robot/canUseTopic(atom/movable/M, be_close = 0)
if(stat || lockcharge || low_power_mode)