Added a second computer to the AI upload chamber. Its purpose is to modify the laws of cyborgs that do not get their laws from an existing AI.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@279 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
n3ophyt3@gmail.com
2010-10-14 21:41:37 +00:00
parent 6bb290d7c7
commit 208091d903
5 changed files with 3834 additions and 3738 deletions
+63 -19
View File
@@ -41,32 +41,76 @@ AI MODULES
usr << "[src.current.name] selected for law changes."
/obj/item/weapon/aiModule/proc/install(var/obj/machinery/computer/aiupload/comp)
if(comp.stat & NOPOWER)
/obj/item/weapon/aiModule/proc/install(var/obj/machinery/computer/C)
if (istype(C, /obj/machinery/computer/aiupload))
var/obj/machinery/computer/aiupload/comp = C
if(comp.stat & NOPOWER)
usr << "The upload computer has no power!"
return
if(comp.stat & BROKEN)
usr << "The upload computer is broken!"
return
if (!comp.current)
usr << "You haven't selected an AI to transmit laws to!"
return
if (comp.current.stat == 2 || comp.current.control_disabled == 1)
usr << "Upload failed. No signal is being detected from the AI."
else if (comp.current.see_in_dark == 0)
usr << "Upload failed. Only a faint signal is being detected from the AI, and it is not responding to our requests. It may be low on power."
else
src.transmitInstructions(comp.current, usr)
comp.current << "These are your laws now:"
comp.current.show_laws()
usr << "Upload complete. The AI's laws have been modified."
else if (istype(C, /obj/machinery/computer/borgupload))
var/obj/machinery/computer/borgupload/comp = C
if(comp.stat & NOPOWER)
usr << "The upload computer has no power!"
return
if(comp.stat & BROKEN)
usr << "The upload computer is broken!"
return
if (!comp.current)
usr << "You haven't selected a cyborg to transmit laws to!"
return
if (comp.current.stat == 2)
usr << "Upload failed. No signal is being detected from the cyborg."
else if (comp.current.connected_ai)
usr << "Upload failed. The cyborg is slaved to an AI."
else
src.transmitInstructions(comp.current, usr)
comp.current << "These are your laws now:"
comp.current.show_laws()
usr << "Upload complete. The cyborg's laws have been modified."
/obj/machinery/computer/borgupload/attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob)
if(istype(module, /obj/item/weapon/aiModule))
module.install(src)
else
return ..()
/obj/machinery/computer/borgupload/attack_hand(var/mob/user as mob)
if(src.stat & NOPOWER)
usr << "The upload computer has no power!"
return
if(comp.stat & BROKEN)
if(src.stat & BROKEN)
usr << "The upload computer is broken!"
return
if (!comp.current)
usr << "You haven't selected an AI to transmit laws to!"
return
var/found=0
src.current = freeborg()
if (comp.current.stat == 2 || comp.current.control_disabled == 1)
usr << "Upload failed. No signal is being detected from the AI."
else if (comp.current.see_in_dark == 0)
usr << "Upload failed. Only a faint signal is being detected from the AI, and it is not responding to our requests. It may be low on power."
if (!src.current)
usr << "No free cyborgs detected."
else
src.transmitInstructions(comp.current, usr)
comp.current << "These are your laws now:"
comp.current.show_laws()
usr << "Upload complete. The AI's laws have been modified."
found=1
if (!found)
usr << "Upload failed. No signal is being detected from the AI."
usr << "[src.current.name] selected for law changes."
/obj/item/weapon/aiModule/proc/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
target << "[sender] has uploaded a change to the laws you must follow, using a [name]. From now on: "