mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-27 22:18:27 +01:00
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:
@@ -44,6 +44,11 @@
|
||||
icon_state = "aiupload"
|
||||
var/mob/living/silicon/ai/current = null
|
||||
|
||||
/obj/machinery/computer/borgupload
|
||||
name = "Cyborg Upload"
|
||||
icon_state = "aiupload"
|
||||
var/mob/living/silicon/robot/current = null
|
||||
|
||||
/obj/machinery/computer/atmosphere
|
||||
name = "atmos"
|
||||
|
||||
|
||||
@@ -533,6 +533,28 @@
|
||||
M.real_name = newname
|
||||
M.name = newname
|
||||
|
||||
/proc/freeborg()
|
||||
var/select = null
|
||||
var/list/names = list()
|
||||
var/list/borgs = list()
|
||||
var/list/namecounts = list()
|
||||
for (var/mob/living/silicon/robot/A in world)
|
||||
var/name = A.real_name
|
||||
if (A.stat == 2)
|
||||
continue
|
||||
if (A.connected_ai == 1)
|
||||
continue
|
||||
else
|
||||
if(A.module)
|
||||
name += " ([A.module.name])"
|
||||
names.Add(name)
|
||||
namecounts[name] = 1
|
||||
borgs[name] = A
|
||||
|
||||
if (borgs.len)
|
||||
select = input("Unshackled borg signals detected:", "Borg selection", null, null) as null|anything in borgs
|
||||
return borgs[select]
|
||||
|
||||
/proc/activeais()
|
||||
var/select = null
|
||||
var/list/names = list()
|
||||
|
||||
@@ -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: "
|
||||
|
||||
@@ -834,6 +834,30 @@ Frequency:
|
||||
/mob/living/silicon/robot/proc/self_destruct()
|
||||
src.gib(1)
|
||||
|
||||
/mob/living/silicon/robot/proc/laws_sanity_check()
|
||||
if (!src.laws)
|
||||
src.laws = new /datum/ai_laws/asimov
|
||||
|
||||
/mob/living/silicon/robot/proc/set_zeroth_law(var/law)
|
||||
src.laws_sanity_check()
|
||||
src.laws.set_zeroth_law(law)
|
||||
|
||||
/mob/living/silicon/robot/proc/add_inherent_law(var/number, var/law)
|
||||
src.laws_sanity_check()
|
||||
src.laws.add_inherent_law(number, law)
|
||||
|
||||
/mob/living/silicon/robot/proc/add_supplied_law(var/number, var/law)
|
||||
src.laws_sanity_check()
|
||||
src.laws.add_supplied_law(number, law)
|
||||
|
||||
/mob/living/silicon/robot/proc/clear_supplied_laws()
|
||||
src.laws_sanity_check()
|
||||
src.laws.clear_supplied_laws()
|
||||
|
||||
/mob/living/silicon/robot/proc/clear_inherent_laws()
|
||||
src.laws_sanity_check()
|
||||
src.laws.clear_inherent_laws()
|
||||
|
||||
|
||||
///mob/living/silicon/robot/proc/eyecheck()
|
||||
// return
|
||||
Reference in New Issue
Block a user