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
+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)