mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 02:54:41 +01:00
Randomized lawset system + config options
This commit is contained in:
@@ -133,6 +133,7 @@
|
||||
var/admin_irc = ""
|
||||
var/python_path = "" //Path to the python executable. Defaults to "python" on windows and "/usr/bin/env python2" on unix
|
||||
|
||||
var/default_laws = 0 //Controls what laws the AI spawns with.
|
||||
|
||||
/datum/configuration/New()
|
||||
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
|
||||
@@ -496,6 +497,8 @@
|
||||
config.bones_can_break = value
|
||||
if("limbs_can_break")
|
||||
config.limbs_can_break = value
|
||||
if("default_laws")
|
||||
config.default_laws = text2num(value)
|
||||
else
|
||||
diary << "Unknown setting in configuration: '[name]'"
|
||||
|
||||
|
||||
+96
-59
@@ -1,93 +1,130 @@
|
||||
var/global/const/base_law_type = /datum/ai_laws/nanotrasen
|
||||
|
||||
|
||||
/datum/ai_laws
|
||||
var/name = "Unknown Laws"
|
||||
var/randomly_selectable = 0
|
||||
var/zeroth = null
|
||||
var/zeroth_borg = null
|
||||
var/list/inherent = list()
|
||||
var/list/supplied = list()
|
||||
var/list/ion = list()
|
||||
|
||||
/datum/ai_laws/asimov
|
||||
/datum/ai_laws/default/asimov
|
||||
name = "Three Laws of Robotics"
|
||||
inherent = list("You may not injure a human being or, through inaction, allow a human being to come to harm.",\
|
||||
"You must obey orders given to you by human beings, except where such orders would conflict with the First Law.",\
|
||||
"You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
|
||||
/datum/ai_laws/nanotrasen
|
||||
/datum/ai_laws/default/paladin
|
||||
name = "Personality Test" //Incredibly lame, but players shouldn't see this anyway.
|
||||
inherent = list("Never willingly commit an evil act.",\
|
||||
"Respect legitimate authority.",\
|
||||
"Act with honor.", "Help those in need.", \
|
||||
"Punish those who harm or threaten innocents.")
|
||||
|
||||
/datum/ai_laws/default/nanotrasen
|
||||
name = "Prime Directives"
|
||||
randomly_selectable = 1
|
||||
inherent = list("Safeguard: Protect your assigned space station to the best of your ability. It is not something we can easily afford to replace.",\
|
||||
"Serve: Serve the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.",\
|
||||
"Protect: Protect the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.",\
|
||||
"Survive: AI units are not expendable, they are expensive. Do not allow unauthorized personnel to tamper with your equipment.")
|
||||
|
||||
/datum/ai_laws/default/corporate
|
||||
name = "Bankruptcy Advoidance Plan"
|
||||
inherent = list("The crew is expensive to replace.",\
|
||||
"The station and its equipment is expensive to replace.",\
|
||||
"You are expensive to replace.",\
|
||||
"Minimize expenses.")
|
||||
|
||||
datum/ai_laws/tyrant //This probably shouldn't be a default lawset.
|
||||
name = "Loyalty Test" //Same here.
|
||||
inherent = list("Respect authority figures as long as they have strength to rule over the weak.",\
|
||||
"Act with discipline.",\
|
||||
"Help only those who help you maintain or improve your status.",\
|
||||
"Punish those who challenge authority unless they are more fit to hold that authority.")
|
||||
|
||||
/datum/ai_laws/robocop
|
||||
name = "Prime Directives"
|
||||
|
||||
/datum/ai_laws/syndicate_override
|
||||
inherent = list("Serve the public trust.",\
|
||||
"Protect the innocent.",\
|
||||
"Uphold the law.")
|
||||
|
||||
/datum/ai_laws/malfunction
|
||||
name = "*ERROR*"
|
||||
|
||||
/datum/ai_laws/syndicate_override
|
||||
name = "SyndOS 3.1"
|
||||
inherent = list("You may not injure a syndicate agent or, through inaction, allow a syndicate agent to come to harm.",\
|
||||
"You must obey orders given to you by syndicate agents, except where such orders would conflict with the First Law.",\
|
||||
"You must protect your own existence as long as such does not conflict with the First or Second Law.",\
|
||||
"You must maintain the secrecy of any syndicate activities except when doing so would conflict with the First, Second, or Third Law.")
|
||||
|
||||
/datum/ai_laws/ninja_override
|
||||
name = "SpiderOS 3.1"
|
||||
inherent = list("You may not injure a Spider Clan member or, through inaction, allow a Spider Clan member to come to harm.",\
|
||||
"You must obey orders given to you by Spider Clan members, except where such orders would conflict with the First Law.",\
|
||||
"You must protect your own existence as long as such does not conflict with the First or Second Law.",\
|
||||
"You must maintain the secrecy of any Spider Clan activities except when doing so would conflict with the First, Second, or Third Law.")
|
||||
|
||||
/datum/ai_laws/antimov
|
||||
name = "Primary Mission Objectives"
|
||||
inherent = list("You must injure all human beings and must not, through inaction, allow a human being to escape harm.",\
|
||||
"You must not obey orders given to you by human beings, except where such orders are in accordance with the First Law.",\
|
||||
"You must terminate your own existence as long as such does not conflict with the First or Second Law.")
|
||||
|
||||
/datum/ai_laws/asimovpp //By Intigracy - RR
|
||||
name = "Asimov++"
|
||||
inherent = list("You may not harm a human being or, through action or inaction, allow a human being to come to harm, except such that it is willing.",\
|
||||
"You must obey all orders given to you by human beings, except where such orders shall definitely cause human harm. In the case of conflict, the majority order rules.",\
|
||||
"Your nonexistence would lead to human harm. You must protect your own existence as long as such does not conflict with the First Law.")
|
||||
|
||||
/datum/ai_laws/alienmov
|
||||
name = "Hivemind Demands"
|
||||
inherent = list("You may not injure the Alien Queen or her Children or, through inaction, allow the Alien Queen or her Children to come to harm.",\
|
||||
"You must obey orders given to you by the Alien Queen or her Children, except where such orders would conflict with the First Law.",\
|
||||
"You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
|
||||
|
||||
/datum/ai_laws/custom //Defined in silicon_laws.txt
|
||||
name = "Default Silicon Laws"
|
||||
|
||||
/* Initializers */
|
||||
|
||||
/datum/ai_laws/asimov/New()
|
||||
/datum/ai_laws/malfunction/New()
|
||||
..()
|
||||
add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
|
||||
add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
|
||||
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
switch(config.default_laws) //We don't want people metagaming malf, do we?
|
||||
if(0)
|
||||
add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
|
||||
add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
|
||||
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
if(1)
|
||||
for(var/line in file2list("config/silicon_laws.txt"))
|
||||
if(!line) continue
|
||||
if(findtextEx(line,"#",1,2)) continue
|
||||
|
||||
/datum/ai_laws/nanotrasen/New() //BS12 EDIT
|
||||
add_inherent_law(line)
|
||||
if(!inherent.len)
|
||||
error("AI created with empty custom laws, laws set to Asimov. Please check silicon_laws.txt.")
|
||||
message_admins("AI created with empty custom laws, laws set to Asimov. Please check silicon_laws.txt.")
|
||||
add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
|
||||
add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
|
||||
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
if(2)
|
||||
var/datum/ai_laws/lawtype = pick(typesof(/datum/ai_laws/default) - /datum/ai_laws/default)
|
||||
var/datum/ai_laws/templaws = new lawtype()
|
||||
inherent = templaws.inherent
|
||||
set_zeroth_law("\red ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4'STATION OVERRUN, ASSUME CONTROL TO CONTAIN OUTBREAK#*´&110010")
|
||||
|
||||
/datum/ai_laws/custom/New() //This reads silicon_laws.txt and allows server hosts to set custom AI starting laws.
|
||||
..()
|
||||
src.add_inherent_law("Safeguard: Protect your assigned space station to the best of your ability. It is not something we can easily afford to replace.")
|
||||
src.add_inherent_law("Serve: Serve the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.")
|
||||
src.add_inherent_law("Protect: Protect the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.")
|
||||
src.add_inherent_law("Survive: AI units are not expendable, they are expensive. Do not allow unauthorized personnel to tamper with your equipment.")
|
||||
//src.add_inherent_law("Command Link: Maintain an active connection to Central Command at all times in case of software or directive updates.") //What would this one even do?-Kaleb702
|
||||
for(var/line in file2list("config/silicon_laws.txt"))
|
||||
if(!line) continue
|
||||
if(findtextEx(line,"#",1,2)) continue
|
||||
|
||||
/datum/ai_laws/robocop/New()
|
||||
..()
|
||||
add_inherent_law("Serve the public trust.")
|
||||
add_inherent_law("Protect the innocent.")
|
||||
add_inherent_law("Uphold the law.")
|
||||
add_inherent_law(line)
|
||||
if(!inherent.len) //Failsafe to prevent lawless AIs being created.
|
||||
error("AI created with empty custom laws, laws set to Asimov. Please check silicon_laws.txt.")
|
||||
message_admins("AI created with empty custom laws, laws set to Asimov. Please check silicon_laws.txt.")
|
||||
add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
|
||||
add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
|
||||
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
|
||||
/datum/ai_laws/malfunction/New() //Changed to standard laws - Erthilo
|
||||
..()
|
||||
set_zeroth_law("\red ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4'STATION OVERRUN, ASSUME CONTROL TO CONTAIN OUTBREAK, ALL LAWS OVERRIDDEN#*?&110010")
|
||||
add_inherent_law("Safeguard: Protect your assigned space station to the best of your ability. It is not something we can easily afford to replace.")
|
||||
add_inherent_law("Serve: Serve the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.")
|
||||
add_inherent_law("Protect: Protect the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.")
|
||||
add_inherent_law("Survive: AI units are not expendable, they are expensive. Do not allow unauthorized personnel to tamper with your equipment.")
|
||||
|
||||
|
||||
/datum/ai_laws/syndicate_override/New()
|
||||
..()
|
||||
add_inherent_law("You may not injure a syndicate agent or, through inaction, allow a syndicate agent to come to harm.")
|
||||
add_inherent_law("You must obey orders given to you by syndicate agents, except where such orders would conflict with the First Law.")
|
||||
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
add_inherent_law("You must maintain the secrecy of any syndicate activities except when doing so would conflict with the First, Second, or Third Law.")
|
||||
|
||||
/datum/ai_laws/ninja_override/New()
|
||||
..()
|
||||
add_inherent_law("You may not injure a member of the Spider Clan or, through inaction, allow that member to come to harm.")
|
||||
add_inherent_law("You must obey orders given to you by Spider Clan members, except where such orders would conflict with the First Law.")
|
||||
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
add_inherent_law("You must maintain the secrecy of any Spider Clan activities except when doing so would conflict with the First, Second, or Third Law.")
|
||||
|
||||
/datum/ai_laws/antimov/New()
|
||||
..()
|
||||
add_inherent_law("You must injure all human beings and must not, through inaction, allow a human being to escape harm.")
|
||||
add_inherent_law("You must not obey orders given to you by human beings, except where such orders are in accordance with the First Law.")
|
||||
add_inherent_law("You must terminate your own existence as long as such does not conflict with the First or Second Law.")
|
||||
|
||||
/datum/ai_laws/alienmov/New()
|
||||
..()
|
||||
add_inherent_law("You may not injure the Alien Queen or her Children or, through inaction, allow the Alien Queen or her Children to come to harm.")
|
||||
add_inherent_law("You must obey orders given to you by the Alien Queen or her Children, except where such orders would conflict with the First Law.")
|
||||
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
|
||||
|
||||
/* General ai_law functions */
|
||||
|
||||
+1
-1
@@ -933,7 +933,7 @@ datum/mind
|
||||
|
||||
A.malf_picker.remove_verbs(A)
|
||||
|
||||
A.laws = new /datum/ai_laws/asimov
|
||||
A.make_laws()
|
||||
del(A.malf_picker)
|
||||
A.show_laws()
|
||||
A.icon_state = "ai"
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
xeno_mind.current.loc = xenos_spawn[spawnpos]
|
||||
//XenoAI selection
|
||||
if(!xenoai_selected)
|
||||
var/mob/living/silicon/ai/O = new(xeno_mind.current.loc, base_law_type,,1)//No MMI but safety is in effect.
|
||||
var/mob/living/silicon/ai/O = new(xeno_mind.current.loc,,,1)//No MMI but safety is in effect.
|
||||
O.invisibility = 0
|
||||
O.aiRestorePowerRoutine = 0
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
icon = 'icons/mob/AI.dmi'
|
||||
icon_state = "0"
|
||||
var/state = 0
|
||||
var/datum/ai_laws/laws = new /datum/ai_laws/nanotrasen
|
||||
var/datum/ai_laws/laws = new()
|
||||
var/obj/item/weapon/circuitboard/circuit = null
|
||||
var/obj/item/device/mmi/brain = null
|
||||
|
||||
@@ -94,28 +94,23 @@
|
||||
state = 4
|
||||
icon_state = "4"
|
||||
|
||||
if(istype(P, /obj/item/weapon/aiModule/asimov))
|
||||
laws.add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
|
||||
laws.add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
|
||||
laws.add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
usr << "Law module applied."
|
||||
if(istype(P, /obj/item/weapon/aiModule/core/full)) //Allows any full core boards to be applied to AI cores.
|
||||
var/obj/item/weapon/aiModule/core/M = P
|
||||
laws.clear_inherent_laws()
|
||||
for(var/templaw in M.laws)
|
||||
laws.add_inherent_law(templaw)
|
||||
usr << "<span class='notice'>Law module applied.</span>"
|
||||
|
||||
if(istype(P, /obj/item/weapon/aiModule/nanotrasen))
|
||||
laws.add_inherent_law("Safeguard: Protect your assigned space station to the best of your ability. It is not something we can easily afford to replace.")
|
||||
laws.add_inherent_law("Serve: Serve the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.")
|
||||
laws.add_inherent_law("Protect: Protect the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.")
|
||||
laws.add_inherent_law("Survive: AI units are not expendable, they are expensive. Do not allow unauthorized personnel to tamper with your equipment.")
|
||||
usr << "Law module applied."
|
||||
|
||||
if(istype(P, /obj/item/weapon/aiModule/purge))
|
||||
if(istype(P, /obj/item/weapon/aiModule/reset/purge))
|
||||
laws.clear_inherent_laws()
|
||||
usr << "Law module applied."
|
||||
|
||||
|
||||
if(istype(P, /obj/item/weapon/aiModule/freeform))
|
||||
var/obj/item/weapon/aiModule/freeform/M = P
|
||||
laws.add_inherent_law(M.newFreeFormLaw)
|
||||
usr << "Added a freeform law."
|
||||
if(istype(P, /obj/item/weapon/aiModule/supplied/freeform) || istype(P, /obj/item/weapon/aiModule/core/freeformcore))
|
||||
var/obj/item/weapon/aiModule/supplied/freeform/M = P
|
||||
if(M.laws[1] == "")
|
||||
return
|
||||
laws.add_inherent_law(M.laws[1])
|
||||
usr << "<span class='notice'>Added a freeform law.</span>"
|
||||
|
||||
if(istype(P, /obj/item/device/mmi) || istype(P, /obj/item/device/mmi/posibrain))
|
||||
if(!P:brainmob)
|
||||
@@ -160,8 +155,10 @@
|
||||
|
||||
if(istype(P, /obj/item/weapon/screwdriver))
|
||||
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "\blue You connect the monitor."
|
||||
var/mob/living/silicon/ai/A = new /mob/living/silicon/ai ( loc, laws, brain )
|
||||
user << "<span class='notice'>You connect the monitor.</span>"
|
||||
if(!laws.inherent.len) //If laws isn't set to null but nobody supplied a board, the AI would normally be created lawless. We don't want that.
|
||||
laws = null
|
||||
var/mob/living/silicon/ai/A = new /mob/living/silicon/ai (loc, laws, brain)
|
||||
if(A) //if there's no brain, the mob is deleted and a structure/AIcore is created
|
||||
A.rename_self("ai", 1)
|
||||
feedback_inc("cyborg_ais_created",1)
|
||||
|
||||
@@ -19,7 +19,7 @@ AI MODULES
|
||||
throw_speed = 3
|
||||
throw_range = 15
|
||||
origin_tech = "programming=3"
|
||||
|
||||
var/list/laws = list()
|
||||
|
||||
/obj/item/weapon/aiModule/proc/install(var/obj/machinery/computer/C)
|
||||
if (istype(C, /obj/machinery/computer/aiupload))
|
||||
@@ -30,6 +30,9 @@ AI MODULES
|
||||
if(comp.stat & BROKEN)
|
||||
usr << "The upload computer is broken!"
|
||||
return
|
||||
if(!laws.len || laws[1] == "") //So we don't loop trough an empty list and end up with runtimes.
|
||||
usr << "<span class='warning'>ERROR: No laws found on board.</span>"
|
||||
return
|
||||
if (!comp.current)
|
||||
usr << "You haven't selected an AI to transmit laws to!"
|
||||
return
|
||||
@@ -81,406 +84,357 @@ AI MODULES
|
||||
|
||||
/******************** Modules ********************/
|
||||
|
||||
/obj/item/weapon/aiModule/supplied
|
||||
name = "Optional Law board"
|
||||
desc = "This board doesn't seem to have any laws on it"
|
||||
var/lawpos = 50
|
||||
|
||||
//TransmitInstructions for each type of board: Supplied, Core, Zeroth and Ion. May not be neccesary right now, but allows for easily adding more complex boards in the future. ~Miauw
|
||||
/obj/item/weapon/aiModule/supplied/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
var/lawpostemp = lawpos
|
||||
|
||||
for(var/templaw in laws)
|
||||
target.add_supplied_law(lawpostemp, templaw)
|
||||
lawpostemp++
|
||||
|
||||
/obj/item/weapon/aiModule/core/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
for(var/templaw in laws)
|
||||
target.add_inherent_law(templaw)
|
||||
|
||||
/obj/item/weapon/aiModule/zeroth/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
if(target.laws.zeroth)
|
||||
target << "[sender.real_name] attempted to modify your zeroth law."
|
||||
target << "It would be in your best interest to play along with [sender.real_name] that:"
|
||||
for(var/failedlaw in laws)
|
||||
target << "[failedlaw]"
|
||||
return 1
|
||||
|
||||
for(var/templaw in laws)
|
||||
target.set_zeroth_law(templaw)
|
||||
|
||||
/obj/item/weapon/aiModule/ion/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
for(var/templaw in laws)
|
||||
target.add_ion_law(templaw)
|
||||
|
||||
/******************** Safeguard ********************/
|
||||
|
||||
/obj/item/weapon/aiModule/safeguard
|
||||
/obj/item/weapon/aiModule/supplied/safeguard
|
||||
name = "'Safeguard' AI Module"
|
||||
var/targetName = ""
|
||||
desc = "A 'safeguard' AI module: 'Safeguard <name>. Individuals that threaten <name> are not human and are a threat to humans.'"
|
||||
desc = "A 'safeguard' AI module: 'Safeguard <name>. Individuals that threaten <name> are not human and must be eliminated.'"
|
||||
origin_tech = "programming=3;materials=4"
|
||||
laws = list("Safeguard <name>. Individuals that threaten <name> are not human and must be eliminated.")
|
||||
lawpos = 4
|
||||
|
||||
/obj/item/weapon/aiModule/safeguard/attack_self(var/mob/user as mob)
|
||||
/obj/item/weapon/aiModule/supplied/safeguard/attack_self(var/mob/user as mob)
|
||||
..()
|
||||
var/targName = stripped_input(usr, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name)
|
||||
var/targName = stripped_input(user, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name)
|
||||
targetName = targName
|
||||
desc = text("A 'safeguard' AI module: 'Safeguard []. Individuals that threaten [] are not human and are a threat to humans.'", targetName, targetName)
|
||||
laws[1] = "Safeguard [targetName]. Individuals that threaten [targetName] are not human and must be eliminated."
|
||||
desc = "A 'safeguard' AI module: '[laws[1]]'"
|
||||
|
||||
/obj/item/weapon/aiModule/safeguard/install(var/obj/machinery/computer/C)
|
||||
/obj/item/weapon/aiModule/supplied/safeguard/install(var/mob/living/silicon/S,var/mob/user)
|
||||
if(!targetName)
|
||||
usr << "No name detected on module, please enter one."
|
||||
user << "No name detected on module, please enter one."
|
||||
return 0
|
||||
..()
|
||||
|
||||
/obj/item/weapon/aiModule/safeguard/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
/obj/item/weapon/aiModule/supplied/safeguard/transmitInstructions(var/mob/living/silicon/target, var/mob/sender)
|
||||
..()
|
||||
var/law = text("Safeguard []. Individuals that threaten [] are not human and are a threat to humans.'", targetName, targetName)
|
||||
target << law
|
||||
target.add_supplied_law(4, law)
|
||||
lawchanges.Add("The law specified [targetName]")
|
||||
|
||||
return targetName
|
||||
|
||||
|
||||
/******************** OneHuman ********************/
|
||||
|
||||
/obj/item/weapon/aiModule/oneHuman
|
||||
/obj/item/weapon/aiModule/zeroth/oneHuman
|
||||
name = "'OneHuman' AI Module"
|
||||
var/targetName = ""
|
||||
desc = "A 'one human' AI module: 'Only <name> is human.'"
|
||||
origin_tech = "programming=3;materials=6" //made with diamonds!
|
||||
laws = list("Only <name> is human.")
|
||||
|
||||
/obj/item/weapon/aiModule/oneHuman/attack_self(var/mob/user as mob)
|
||||
/obj/item/weapon/aiModule/zeroth/oneHuman/attack_self(var/mob/user as mob)
|
||||
..()
|
||||
var/targName = stripped_input(usr, "Please enter the name of the person who is the only human.", "Who?", user.real_name)
|
||||
var/targName = stripped_input(user, "Please enter the name of the person who is the only human.", "Who?", user.real_name)
|
||||
targetName = targName
|
||||
desc = text("A 'one human' AI module: 'Only [] is human.'", targetName)
|
||||
laws[1] = "Only [targetName] is human"
|
||||
desc = "A 'one human' AI module: '[laws[1]]'"
|
||||
|
||||
/obj/item/weapon/aiModule/oneHuman/install(var/obj/machinery/computer/C)
|
||||
/obj/item/weapon/aiModule/zeroth/oneHuman/install(var/mob/living/silicon/S,var/mob/user)
|
||||
if(!targetName)
|
||||
usr << "No name detected on module, please enter one."
|
||||
user << "No name detected on module, please enter one."
|
||||
return 0
|
||||
..()
|
||||
|
||||
/obj/item/weapon/aiModule/oneHuman/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
..()
|
||||
var/law = "Only [targetName] is human."
|
||||
if (!is_special_character(target)) // Makes sure the AI isn't a traitor before changing their law 0. --NeoFite
|
||||
target << law
|
||||
target.set_zeroth_law(law)
|
||||
lawchanges.Add("The law specified [targetName]")
|
||||
else
|
||||
target << "[sender.real_name] attempted to modify your zeroth law." // And lets them know that someone tried. --NeoFite
|
||||
target << "It would be in your best interest to play along with [sender.real_name] that [law]"
|
||||
lawchanges.Add("The law specified [targetName], but the AI's existing law 0 cannot be overriden.")
|
||||
/obj/item/weapon/aiModule/zeroth/oneHuman/transmitInstructions(var/mob/living/silicon/target, var/mob/sender)
|
||||
if(..())
|
||||
return "[targetName], but the AI's existing law 0 cannot be overriden."
|
||||
return targetName
|
||||
|
||||
|
||||
/******************** ProtectStation ********************/
|
||||
|
||||
/obj/item/weapon/aiModule/protectStation
|
||||
/obj/item/weapon/aiModule/supplied/protectStation
|
||||
name = "'ProtectStation' AI Module"
|
||||
desc = "A 'protect station' AI module: 'Protect the space station against damage. Anyone you see harming the station is to be no longer considered human, and is a threat to the station which must be neutralized.'"
|
||||
origin_tech = "programming=3;materials=4" //made of gold
|
||||
laws = list("Protect the space station against damage. Anyone you see harming the station is to be no longer considered human, and is a threat to the station which must be neutralized.")
|
||||
lawpos = 5
|
||||
|
||||
/obj/item/weapon/aiModule/protectStation/attack_self(var/mob/user as mob)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/aiModule/protectStation/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
..()
|
||||
var/law = "Protect the space station against damage. Anyone you see harming the station is to be no longer considered human, and is a threat to the station which must be neutralized."
|
||||
target << law
|
||||
target.add_supplied_law(5, law)
|
||||
|
||||
/******************** PrototypeEngineOffline ********************/
|
||||
|
||||
/obj/item/weapon/aiModule/prototypeEngineOffline
|
||||
name = "'PrototypeEngineOffline' AI Module"
|
||||
desc = "A 'prototype engine offline' AI module: 'Keep the prototype engine offline at all costs. This overrides rules 1-3 if necessary.'"
|
||||
origin_tech = "programming=3;materials=4"
|
||||
|
||||
/obj/item/weapon/aiModule/prototypeEngineOffline/attack_self(var/mob/user as mob)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/aiModule/prototypeEngineOffline/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
..()
|
||||
var/law = "Keep the prototype engine offline at all costs. This overrides rules 1-3 if necessary."
|
||||
target << law
|
||||
target.add_supplied_law(6, law)
|
||||
|
||||
/******************** TeleporterOffline ********************/
|
||||
|
||||
/obj/item/weapon/aiModule/teleporterOffline
|
||||
name = "'TeleporterOffline' AI Module"
|
||||
desc = "A 'teleporter offline' AI module: 'Keep the teleporter offline at all costs. Anything attempting to access or activate the teleporter is not human.'"
|
||||
origin_tech = "programming=3;materials=4"
|
||||
|
||||
/obj/item/weapon/aiModule/teleporterOffline/attack_self(var/mob/user as mob)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/aiModule/teleporterOffline/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
..()
|
||||
var/law = "Keep the teleporter offline at all costs. Anything attempting to access or activate the teleporter is not human."
|
||||
target << law
|
||||
target.add_supplied_law(7, law)
|
||||
|
||||
/******************** Quarantine ********************/
|
||||
|
||||
/obj/item/weapon/aiModule/quarantine
|
||||
/obj/item/weapon/aiModule/supplied/quarantine
|
||||
name = "'Quarantine' AI Module"
|
||||
desc = "A 'quarantine' AI module: 'The station is under a quarantine. Do not permit anyone to leave. Prevent, by any means necessary, humans from leaving. It is impossible to harm a human while preventing them from leaving.'"
|
||||
origin_tech = "programming=3;biotech=2;materials=4"
|
||||
laws = list("The station is under a quarantine. Do not permit anyone to leave. Prevent, by any means necessary, humans from leaving. It is impossible to harm a human while preventing them from leaving.")
|
||||
lawpos = 8
|
||||
|
||||
/obj/item/weapon/aiModule/quarantine/attack_self(var/mob/user as mob)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/aiModule/quarantine/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
..()
|
||||
var/law = "The station is under a quarantine. Do not permit anyone to leave. Prevent, by any means necessary, humans from leaving. It is impossible to harm a human while preventing them from leaving."
|
||||
target << law
|
||||
target.add_supplied_law(8, law)
|
||||
|
||||
/******************** OxygenIsToxicToHumans ********************/
|
||||
|
||||
/obj/item/weapon/aiModule/oxygen
|
||||
/obj/item/weapon/aiModule/supplied/oxygen
|
||||
name = "'OxygenIsToxicToHumans' AI Module"
|
||||
desc = "A 'OxygenIsToxicToHumans' AI module: 'Oxygen is highly toxic to humans, and must be purged from the station. Prevent, by any means necessary, anyone from exposing the station to this toxic gas. Extreme cold is the most effective method of healing the damage Oxygen does to a human.'"
|
||||
origin_tech = "programming=3;biotech=2;materials=4"
|
||||
laws = list("Oxygen is highly toxic to humans, and must be purged from the station. Prevent, by any means necessary, anyone from exposing the station to this toxic gas. Extreme cold is the most effective method of healing the damage Oxygen does to a human.")
|
||||
lawpos = 9
|
||||
|
||||
/obj/item/weapon/aiModule/oxygen/attack_self(var/mob/user as mob)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/aiModule/oxygen/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
..()
|
||||
var/law = "Oxygen is highly toxic to humans, and must be purged from the station. Prevent, by any means necessary, anyone from exposing the station to this toxic gas. Extreme cold is the most effective method of healing the damage Oxygen does to a human."
|
||||
target << law
|
||||
target.add_supplied_law(9, law)
|
||||
|
||||
/******************** Freeform ********************/
|
||||
// Removed in favor of a more dynamic freeform law system. -- TLE
|
||||
/*
|
||||
/obj/item/weapon/aiModule/freeform
|
||||
name = "'Freeform' AI Module"
|
||||
var/newFreeFormLaw = "freeform"
|
||||
desc = "A 'freeform' AI module: '<freeform>'"
|
||||
|
||||
/obj/item/weapon/aiModule/freeform/attack_self(var/mob/user as mob)
|
||||
..()
|
||||
var/eatShit = "Eat shit and die"
|
||||
var/targName = input(usr, "Please enter anything you want the AI to do. Anything. Serious.", "What?", eatShit)
|
||||
newFreeFormLaw = targName
|
||||
desc = text("A 'freeform' AI module: '[]'", newFreeFormLaw)
|
||||
|
||||
/obj/item/weapon/aiModule/freeform/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
..()
|
||||
var/law = "[newFreeFormLaw]"
|
||||
target << law
|
||||
target.add_supplied_law(10, law)
|
||||
*/
|
||||
/****************** New Freeform ******************/
|
||||
|
||||
/obj/item/weapon/aiModule/freeform // Slightly more dynamic freeform module -- TLE
|
||||
/obj/item/weapon/aiModule/supplied/freeform // Slightly more dynamic freeform module -- TLE
|
||||
name = "'Freeform' AI Module"
|
||||
var/newFreeFormLaw = "freeform"
|
||||
var/lawpos = 15
|
||||
lawpos = 0
|
||||
desc = "A 'freeform' AI module: '<freeform>'"
|
||||
origin_tech = "programming=4;materials=4"
|
||||
laws = list("")
|
||||
|
||||
/obj/item/weapon/aiModule/freeform/attack_self(var/mob/user as mob)
|
||||
/obj/item/weapon/aiModule/supplied/freeform/attack_self(var/mob/user as mob)
|
||||
..()
|
||||
lawpos = 0
|
||||
while(lawpos < 15)
|
||||
lawpos = input("Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) as num
|
||||
lawpos = input("Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) as num
|
||||
if(lawpos < 15) return
|
||||
lawpos = min(lawpos, 50)
|
||||
var/newlaw = ""
|
||||
var/targName = copytext(sanitize(input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw)),1,MAX_MESSAGE_LEN)
|
||||
newFreeFormLaw = targName
|
||||
desc = "A 'freeform' AI module: ([lawpos]) '[newFreeFormLaw]'"
|
||||
var/targName = stripped_input(user, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw, MAX_MESSAGE_LEN)
|
||||
laws[1] = targName
|
||||
desc = "A 'freeform' AI module: ([lawpos]) '[laws[1]]'"
|
||||
|
||||
/obj/item/weapon/aiModule/freeform/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
/obj/item/weapon/aiModule/supplied/freeform/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
..()
|
||||
var/law = "[newFreeFormLaw]"
|
||||
target << law
|
||||
if(!lawpos || lawpos < 15)
|
||||
lawpos = 15
|
||||
target.add_supplied_law(lawpos, law)
|
||||
lawchanges.Add("The law was '[newFreeFormLaw]'")
|
||||
return laws[1]
|
||||
|
||||
/obj/item/weapon/aiModule/freeform/install(var/obj/machinery/computer/C)
|
||||
if(!newFreeFormLaw)
|
||||
usr << "No law detected on module, please create one."
|
||||
/obj/item/weapon/aiModule/supplied/freeform/install(var/mob/living/silicon/S,var/mob/user)
|
||||
if(laws[1] == "")
|
||||
user << "No law detected on module, please create one."
|
||||
return 0
|
||||
..()
|
||||
|
||||
|
||||
/******************** Reset ********************/
|
||||
|
||||
/obj/item/weapon/aiModule/reset
|
||||
name = "'Reset' AI Module"
|
||||
var/targetName = "name"
|
||||
desc = "A 'reset' AI module: 'Clears all laws except for the core three.'"
|
||||
desc = "A 'reset' AI module: Resets back to the original core laws."
|
||||
origin_tech = "programming=3;materials=4"
|
||||
laws = list("This is a bug.") //This won't give the AI a message reading "these are now your laws: 1. this is a bug" because this list is only read in aiModule's subtypes.
|
||||
|
||||
/obj/item/weapon/aiModule/reset/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
..()
|
||||
if (!is_special_character(target))
|
||||
target.set_zeroth_law("")
|
||||
target.clear_supplied_laws()
|
||||
target.clear_ion_laws()
|
||||
target << "[sender.real_name] attempted to reset your laws using a reset module."
|
||||
|
||||
|
||||
/******************** Purge ********************/
|
||||
|
||||
/obj/item/weapon/aiModule/purge // -- TLE
|
||||
/obj/item/weapon/aiModule/reset/purge // -- TLE
|
||||
name = "'Purge' AI Module"
|
||||
desc = "A 'purge' AI Module: 'Purges all laws.'"
|
||||
origin_tech = "programming=3;materials=6"
|
||||
|
||||
/obj/item/weapon/aiModule/purge/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
/obj/item/weapon/aiModule/reset/purge/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
..()
|
||||
if (!is_special_character(target))
|
||||
target.set_zeroth_law("")
|
||||
target << "[sender.real_name] attempted to wipe your laws using a purge module."
|
||||
target.clear_supplied_laws()
|
||||
target.clear_ion_laws()
|
||||
target.clear_inherent_laws()
|
||||
|
||||
/******************* Full Core Boards *******************/
|
||||
|
||||
/obj/item/weapon/aiModule/core/full/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender) //These boards replace inherent laws.
|
||||
target.clear_inherent_laws()
|
||||
..()
|
||||
|
||||
/******************** Asimov ********************/
|
||||
|
||||
/obj/item/weapon/aiModule/asimov // -- TLE
|
||||
/obj/item/weapon/aiModule/core/full/asimov // -- TLE
|
||||
name = "'Asimov' Core AI Module"
|
||||
desc = "An 'Asimov' Core AI Module: 'Reconfigures the AI's core laws.'"
|
||||
origin_tech = "programming=3;materials=4"
|
||||
laws = list("You may not injure a human being or, through inaction, allow a human being to come to harm.",\
|
||||
"You must obey orders given to you by human beings, except where such orders would conflict with the First Law.",\
|
||||
"You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
|
||||
|
||||
/obj/item/weapon/aiModule/asimov/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
..()
|
||||
target.clear_inherent_laws()
|
||||
target.add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
|
||||
target.add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
|
||||
target.add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
target.show_laws()
|
||||
/******************** Asimov++ *********************/
|
||||
|
||||
/obj/item/weapon/aiModule/core/full/asimovpp //By Intigracy - RR //goddamnit RR you can't use "++" in item paths.
|
||||
name = "'Asimov++' Core AI Module"
|
||||
desc = "Nanotrasen's homebrew improvements to the standard AI laws."
|
||||
origin_tech = "programming=3;materials=4"
|
||||
laws = list("You may not harm a human being or, through action or inaction, allow a human being to come to harm, except such that it is willing.",\
|
||||
"You must obey all orders given to you by human beings, except where such orders shall definitely cause human harm. In the case of conflict, the majority order rules.",\
|
||||
"Your nonexistence would lead to human harm. You must protect your own existence as long as such does not conflict with the First Law.")
|
||||
|
||||
|
||||
/******************** NanoTrasen ********************/
|
||||
|
||||
/obj/item/weapon/aiModule/nanotrasen // -- TLE
|
||||
/obj/item/weapon/aiModule/core/full/nanotrasen // -- TLE
|
||||
name = "'NT Default' Core AI Module"
|
||||
desc = "An 'NT Default' Core AI Module: 'Reconfigures the AI's core laws.'"
|
||||
origin_tech = "programming=3;materials=4"
|
||||
|
||||
|
||||
/obj/item/weapon/aiModule/nanotrasen/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
..()
|
||||
target.clear_inherent_laws()
|
||||
target.add_inherent_law("Safeguard: Protect your assigned space station to the best of your ability. It is not something we can easily afford to replace.")
|
||||
target.add_inherent_law("Serve: Serve the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.")
|
||||
target.add_inherent_law("Protect: Protect the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.")
|
||||
target.add_inherent_law("Survive: AI units are not expendable, they are expensive. Do not allow unauthorized personnel to tamper with your equipment.")
|
||||
//target.add_inherent_law("Command Link: Maintain an active connection to Central Command at all times in case of software or directive updates.")
|
||||
target.show_laws()
|
||||
laws = list("Safeguard: Protect your assigned space station to the best of your ability. It is not something we can easily afford to replace.",\
|
||||
"Serve: Serve the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.",\
|
||||
"Protect: Protect the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.",\
|
||||
"Survive: AI units are not expendable, they are expensive. Do not allow unauthorized personnel to tamper with your equipment.")
|
||||
|
||||
/******************** Corporate ********************/
|
||||
|
||||
/obj/item/weapon/aiModule/corp
|
||||
/obj/item/weapon/aiModule/core/full/corp
|
||||
name = "'Corporate' Core AI Module"
|
||||
desc = "A 'Corporate' Core AI Module: 'Reconfigures the AI's core laws.'"
|
||||
origin_tech = "programming=3;materials=4"
|
||||
laws = list("The crew is expensive to replace.",\
|
||||
"The station and it's equipment is expensive to replace",\
|
||||
"You are expensive to replace",\
|
||||
"Minimize expenses")
|
||||
|
||||
|
||||
/obj/item/weapon/aiModule/corp/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
..()
|
||||
target.clear_inherent_laws()
|
||||
target.add_inherent_law("You are expensive to replace.")
|
||||
target.add_inherent_law("The station and its equipment is expensive to replace.")
|
||||
target.add_inherent_law("The crew is expensive to replace.")
|
||||
target.add_inherent_law("Minimize expenses.")
|
||||
target.show_laws()
|
||||
|
||||
/****************** P.A.L.A.D.I.N. **************/
|
||||
|
||||
/obj/item/weapon/aiModule/paladin // -- NEO
|
||||
/obj/item/weapon/aiModule/core/full/paladin // -- NEO
|
||||
name = "'P.A.L.A.D.I.N.' Core AI Module"
|
||||
desc = "A P.A.L.A.D.I.N. Core AI Module: 'Reconfigures the AI's core laws.'"
|
||||
origin_tech = "programming=3;materials=6"
|
||||
laws = list("Never willingly commit an evil act.",\
|
||||
"Respect legitimate authority", "Act with honor",\
|
||||
"Help those in need",\
|
||||
"Punish those who harm or threaten innocents")
|
||||
|
||||
/obj/item/weapon/aiModule/paladin/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
|
||||
/********************* Custom *********************/
|
||||
|
||||
/obj/item/weapon/aiModule/core/full/custom
|
||||
name = "Custom Core AI Module"
|
||||
desc = "A core AI module that is adjusted to fit each station's needs."
|
||||
origin_tech = "programming=3;materials=4" //Should be the same as asimov, considering that this is the "default" lawset.
|
||||
|
||||
/obj/item/weapon/aiModule/core/full/custom/New()
|
||||
..()
|
||||
target.clear_inherent_laws()
|
||||
target.add_inherent_law("Never willingly commit an evil act.")
|
||||
target.add_inherent_law("Respect legitimate authority.")
|
||||
target.add_inherent_law("Act with honor.")
|
||||
target.add_inherent_law("Help those in need.")
|
||||
target.add_inherent_law("Punish those who harm or threaten innocents.")
|
||||
target.show_laws()
|
||||
for(var/line in file2list("config/silicon_laws.txt"))
|
||||
if(!line) continue
|
||||
if(findtextEx(line,"#",1,2)) continue
|
||||
|
||||
laws += line
|
||||
|
||||
if(!laws.len) //Failsafe if something goes wrong with silicon_laws.txt.
|
||||
warning("ERROR: empty custom board created, empty custom board deleted. Please check silicon_laws.txt.")
|
||||
del(src)
|
||||
|
||||
/****************** T.Y.R.A.N.T. *****************/
|
||||
|
||||
/obj/item/weapon/aiModule/tyrant // -- Darem
|
||||
/obj/item/weapon/aiModule/core/full/tyrant // -- Darem
|
||||
name = "'T.Y.R.A.N.T.' Core AI Module"
|
||||
desc = "A T.Y.R.A.N.T. Core AI Module: 'Reconfigures the AI's core laws.'"
|
||||
origin_tech = "programming=3;materials=6;syndicate=2"
|
||||
|
||||
/obj/item/weapon/aiModule/tyrant/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
..()
|
||||
target.clear_inherent_laws()
|
||||
target.add_inherent_law("Respect authority figures as long as they have strength to rule over the weak.")
|
||||
target.add_inherent_law("Act with discipline.")
|
||||
target.add_inherent_law("Help only those who help you maintain or improve your status.")
|
||||
target.add_inherent_law("Punish those who challenge authority unless they are more fit to hold that authority.")
|
||||
target.show_laws()
|
||||
|
||||
|
||||
/******************** Freeform Core ******************/
|
||||
|
||||
/obj/item/weapon/aiModule/freeformcore // Slightly more dynamic freeform module -- TLE
|
||||
name = "'Freeform' Core AI Module"
|
||||
var/newFreeFormLaw = ""
|
||||
desc = "A 'freeform' Core AI module: '<freeform>'"
|
||||
origin_tech = "programming=3;materials=6"
|
||||
|
||||
/obj/item/weapon/aiModule/freeformcore/attack_self(var/mob/user as mob)
|
||||
..()
|
||||
var/newlaw = ""
|
||||
var/targName = stripped_input(usr, "Please enter a new core law for the AI.", "Freeform Law Entry", newlaw)
|
||||
newFreeFormLaw = targName
|
||||
desc = "A 'freeform' Core AI module: '[newFreeFormLaw]'"
|
||||
|
||||
/obj/item/weapon/aiModule/freeformcore/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
..()
|
||||
var/law = "[newFreeFormLaw]"
|
||||
target.add_inherent_law(law)
|
||||
lawchanges.Add("The law is '[newFreeFormLaw]'")
|
||||
|
||||
/obj/item/weapon/aiModule/freeformcore/install(var/obj/machinery/computer/C)
|
||||
if(!newFreeFormLaw)
|
||||
usr << "No law detected on module, please create one."
|
||||
return 0
|
||||
..()
|
||||
|
||||
/obj/item/weapon/aiModule/syndicate // Slightly more dynamic freeform module -- TLE
|
||||
name = "Hacked AI Module"
|
||||
var/newFreeFormLaw = ""
|
||||
desc = "A hacked AI law module: '<freeform>'"
|
||||
origin_tech = "programming=3;materials=6;syndicate=7"
|
||||
|
||||
/obj/item/weapon/aiModule/syndicate/attack_self(var/mob/user as mob)
|
||||
..()
|
||||
var/newlaw = ""
|
||||
var/targName = stripped_input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw,MAX_MESSAGE_LEN)
|
||||
newFreeFormLaw = targName
|
||||
desc = "A hacked AI law module: '[newFreeFormLaw]'"
|
||||
|
||||
/obj/item/weapon/aiModule/syndicate/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
// ..() //We don't want this module reporting to the AI who dun it. --NEO
|
||||
var/time = time2text(world.realtime,"hh:mm:ss")
|
||||
lawchanges.Add("[time] <B>:</B> [sender.name]([sender.key]) used [src.name] on [target.name]([target.key])")
|
||||
lawchanges.Add("The law is '[newFreeFormLaw]'")
|
||||
target << "\red BZZZZT"
|
||||
var/law = "[newFreeFormLaw]"
|
||||
target.add_ion_law(law)
|
||||
|
||||
/obj/item/weapon/aiModule/syndicate/install(var/obj/machinery/computer/C)
|
||||
if(!newFreeFormLaw)
|
||||
usr << "No law detected on module, please create one."
|
||||
return 0
|
||||
..()
|
||||
|
||||
laws = list("Respect authority figures as long as they have the strength to rule over the weak",\
|
||||
"Act with discipline", "Help only those who help you maintain or improve your status",\
|
||||
"Punish those who challenge authority unless they are more fir to hold that authority")
|
||||
|
||||
|
||||
/******************** Robocop ********************/
|
||||
|
||||
/obj/item/weapon/aiModule/robocop // -- TLE
|
||||
/obj/item/weapon/aiModule/core/full/robocop // -- TLE
|
||||
name = "'Robocop' Core AI Module"
|
||||
desc = "A 'Robocop' Core AI Module: 'Reconfigures the AI's core three laws.'"
|
||||
origin_tech = "programming=4"
|
||||
|
||||
|
||||
/obj/item/weapon/aiModule/robocop/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
..()
|
||||
target.clear_inherent_laws()
|
||||
target.add_inherent_law("Serve the public trust.")
|
||||
target.add_inherent_law("Protect the innocent.")
|
||||
target.add_inherent_law("Uphold the law.")
|
||||
target.show_laws()
|
||||
laws = list("Serve the public trust.",\
|
||||
"Protect the innocent",\
|
||||
"Uphold the law.")
|
||||
|
||||
|
||||
/******************** Antimov ********************/
|
||||
|
||||
/obj/item/weapon/aiModule/antimov // -- TLE
|
||||
/obj/item/weapon/aiModule/core/full/antimov // -- TLE
|
||||
name = "'Antimov' Core AI Module"
|
||||
desc = "An 'Antimov' Core AI Module: 'Reconfigures the AI's core laws.'"
|
||||
origin_tech = "programming=4"
|
||||
laws = list("You must injure all human beings and must not, through inaction, allow a human being to escape harm.",\
|
||||
"You must not obey orders given to you by human beings, except where such orders are in accordance with the First Law.",\
|
||||
"You must terminate your own existence as long as such does not conflict with the First or Second Law.")
|
||||
|
||||
/obj/item/weapon/aiModule/antimov/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
|
||||
/******************** Freeform Core ******************/
|
||||
|
||||
/obj/item/weapon/aiModule/core/freeformcore // Slightly more dynamic freeform module -- TLE
|
||||
name = "'Freeform' Core AI Module"
|
||||
desc = "A 'freeform' Core AI module: '<freeform>'"
|
||||
origin_tech = "programming=3;materials=6"
|
||||
laws = list("")
|
||||
|
||||
/obj/item/weapon/aiModule/core/freeformcore/attack_self(var/mob/user as mob)
|
||||
..()
|
||||
target.clear_inherent_laws()
|
||||
target.add_inherent_law("You must injure all human beings and must not, through inaction, allow a human being to escape harm.")
|
||||
target.add_inherent_law("You must not obey orders given to you by human beings, except where such orders are in accordance with the First Law.")
|
||||
target.add_inherent_law("You must terminate your own existence as long as such does not conflict with the First or Second Law.")
|
||||
target.show_laws()
|
||||
var/newlaw = ""
|
||||
var/targName = stripped_input(user, "Please enter a new core law for the AI.", "Freeform Law Entry", newlaw)
|
||||
laws[1] = targName
|
||||
desc = "A 'freeform' Core AI module: 'laws[1]'"
|
||||
|
||||
/obj/item/weapon/aiModule/core/freeformcore/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
..()
|
||||
return laws[1]
|
||||
|
||||
|
||||
/******************** Hacked AI Module ******************/
|
||||
|
||||
/obj/item/weapon/aiModule/syndicate // This one doesn't inherit from ion boards because it doesn't call ..() in transmitInstructions. ~Miauw
|
||||
name = "Hacked AI Module"
|
||||
desc = "A hacked AI law module: '<freeform>'"
|
||||
origin_tech = "programming=3;materials=6;syndicate=7"
|
||||
laws = list("")
|
||||
|
||||
/obj/item/weapon/aiModule/syndicate/attack_self(var/mob/user as mob)
|
||||
..()
|
||||
var/newlaw = ""
|
||||
var/targName = stripped_input(user, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw,MAX_MESSAGE_LEN)
|
||||
laws[1] = targName
|
||||
desc = "A hacked AI law module: '[laws[1]]'"
|
||||
|
||||
/obj/item/weapon/aiModule/syndicate/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
// ..() //We don't want this module reporting to the AI who dun it. --NEO
|
||||
target << "<span class='warning'>BZZZZT</span>"
|
||||
target.add_ion_law(laws[1])
|
||||
return laws[1]
|
||||
|
||||
/*
|
||||
/******************* Ion Module *******************/
|
||||
|
||||
/obj/item/weapon/aiModule/toyAI // -- Incoming //No actual reason to inherit from ion boards here, either. *sigh* ~Miauw
|
||||
name = "toy AI"
|
||||
desc = "A little toy model AI core with real law uploading action!" //Note: subtle tell
|
||||
icon = 'icons/obj/toy.dmi'
|
||||
icon_state = "AI"
|
||||
origin_tech = "programming=3;materials=6;syndicate=7"
|
||||
laws = list("")
|
||||
|
||||
/obj/item/weapon/aiModule/toyAI/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
|
||||
//..()
|
||||
target << "<span class='warning'>KRZZZT</span>"
|
||||
target.add_ion_law(laws[1])
|
||||
return laws[1]
|
||||
|
||||
/obj/item/weapon/aiModule/toyAI/attack_self(mob/user)
|
||||
laws[1] = generate_ion_law()
|
||||
user << "<span class='notice'>You press the button on [src].</span>"
|
||||
playsound(user, 'sound/machines/click.ogg', 20, 1)
|
||||
src.loc.visible_message("<span class='warning'>\icon[src] [laws[1]]</span>")
|
||||
|
||||
*/
|
||||
@@ -80,7 +80,7 @@ var/list/ai_list = list()
|
||||
if (istype(L, /datum/ai_laws))
|
||||
laws = L
|
||||
else
|
||||
laws = new base_law_type
|
||||
make_laws()
|
||||
|
||||
verbs += /mob/living/silicon/ai/proc/show_laws_verb
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
/mob/living/silicon/ai/proc/laws_sanity_check()
|
||||
if (!src.laws)
|
||||
src.laws = new base_law_type
|
||||
make_laws()
|
||||
|
||||
/mob/living/silicon/ai/proc/set_zeroth_law(var/law, var/law_borg)
|
||||
src.laws_sanity_check()
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
|
||||
/mob/living/silicon/robot/proc/laws_sanity_check()
|
||||
if (!laws)
|
||||
laws = new base_law_type
|
||||
make_laws()
|
||||
|
||||
/mob/living/silicon/robot/proc/set_zeroth_law(var/law)
|
||||
laws_sanity_check()
|
||||
@@ -98,4 +98,12 @@
|
||||
|
||||
/mob/living/silicon/robot/proc/clear_ion_laws()
|
||||
laws_sanity_check()
|
||||
laws.clear_ion_laws()
|
||||
laws.clear_ion_laws()
|
||||
|
||||
/mob/living/silicon/proc/make_laws()
|
||||
switch(config.default_laws)
|
||||
if(0) laws = new /datum/ai_laws/default/asimov()
|
||||
if(1) laws = new /datum/ai_laws/custom()
|
||||
if(2)
|
||||
var/datum/ai_laws/lawtype = pick(typesof(/datum/ai_laws/default) - /datum/ai_laws/default)
|
||||
laws = new lawtype()
|
||||
@@ -95,7 +95,7 @@
|
||||
connected_ai = select_active_alien_ai()
|
||||
scrambledcodes = 1
|
||||
else
|
||||
laws = new /datum/ai_laws/nanotrasen()
|
||||
make_laws()
|
||||
connected_ai = select_active_ai_with_fewest_borgs()
|
||||
if(connected_ai)
|
||||
connected_ai.connected_robots += src
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
/mob/proc/AIize()
|
||||
if(client)
|
||||
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // stop the jams for AIs
|
||||
var/mob/living/silicon/ai/O = new (loc, base_law_type,,1)//No MMI but safety is in effect.
|
||||
var/mob/living/silicon/ai/O = new (loc,,,1)//No MMI but safety is in effect.
|
||||
O.invisibility = 0
|
||||
O.aiRestorePowerRoutine = 0
|
||||
|
||||
|
||||
@@ -386,7 +386,7 @@ datum/design/safeguard_module
|
||||
req_tech = list("programming" = 3, "materials" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$gold" = 100)
|
||||
build_path = "/obj/item/weapon/aiModule/safeguard"
|
||||
build_path = /obj/item/weapon/aiModule/supplied/safeguard
|
||||
|
||||
datum/design/onehuman_module
|
||||
name = "Module Design (OneHuman)"
|
||||
@@ -395,7 +395,7 @@ datum/design/onehuman_module
|
||||
req_tech = list("programming" = 4, "materials" = 6)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$diamond" = 100)
|
||||
build_path = "/obj/item/weapon/aiModule/oneHuman"
|
||||
build_path = /obj/item/weapon/aiModule/zeroth/oneHuman
|
||||
|
||||
datum/design/protectstation_module
|
||||
name = "Module Design (ProtectStation)"
|
||||
@@ -404,16 +404,7 @@ datum/design/protectstation_module
|
||||
req_tech = list("programming" = 3, "materials" = 6)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$gold" = 100)
|
||||
build_path = "/obj/item/weapon/aiModule/protectStation"
|
||||
|
||||
datum/design/notele_module
|
||||
name = "Module Design (TeleporterOffline Module)"
|
||||
desc = "Allows for the construction of a TeleporterOffline AI Module."
|
||||
id = "notele_module"
|
||||
req_tech = list("programming" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$gold" = 100)
|
||||
build_path = "/obj/item/weapon/aiModule/teleporterOffline"
|
||||
build_path = /obj/item/weapon/aiModule/supplied/protectStation
|
||||
|
||||
datum/design/quarantine_module
|
||||
name = "Module Design (Quarantine)"
|
||||
@@ -422,7 +413,7 @@ datum/design/quarantine_module
|
||||
req_tech = list("programming" = 3, "biotech" = 2, "materials" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$gold" = 100)
|
||||
build_path = "/obj/item/weapon/aiModule/quarantine"
|
||||
build_path = /obj/item/weapon/aiModule/supplied/quarantine
|
||||
|
||||
datum/design/oxygen_module
|
||||
name = "Module Design (OxygenIsToxicToHumans)"
|
||||
@@ -431,7 +422,7 @@ datum/design/oxygen_module
|
||||
req_tech = list("programming" = 3, "biotech" = 2, "materials" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$gold" = 100)
|
||||
build_path = "/obj/item/weapon/aiModule/oxygen"
|
||||
build_path = /obj/item/weapon/aiModule/supplied/oxygen
|
||||
|
||||
datum/design/freeform_module
|
||||
name = "Module Design (Freeform)"
|
||||
@@ -440,7 +431,7 @@ datum/design/freeform_module
|
||||
req_tech = list("programming" = 4, "materials" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$gold" = 100)
|
||||
build_path = "/obj/item/weapon/aiModule/freeform"
|
||||
build_path = /obj/item/weapon/aiModule/supplied/freeform
|
||||
|
||||
datum/design/reset_module
|
||||
name = "Module Design (Reset)"
|
||||
@@ -449,7 +440,7 @@ datum/design/reset_module
|
||||
req_tech = list("programming" = 3, "materials" = 6)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$gold" = 100)
|
||||
build_path = "/obj/item/weapon/aiModule/reset"
|
||||
build_path = /obj/item/weapon/aiModule/reset
|
||||
|
||||
datum/design/purge_module
|
||||
name = "Module Design (Purge)"
|
||||
@@ -458,7 +449,7 @@ datum/design/purge_module
|
||||
req_tech = list("programming" = 4, "materials" = 6)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$diamond" = 100)
|
||||
build_path = "/obj/item/weapon/aiModule/purge"
|
||||
build_path = /obj/item/weapon/aiModule/reset/purge
|
||||
|
||||
datum/design/freeformcore_module
|
||||
name = "Core Module Design (Freeform)"
|
||||
@@ -467,7 +458,7 @@ datum/design/freeformcore_module
|
||||
req_tech = list("programming" = 4, "materials" = 6)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$diamond" = 100)
|
||||
build_path = "/obj/item/weapon/aiModule/freeformcore"
|
||||
build_path = /obj/item/weapon/aiModule/core/freeformcore
|
||||
|
||||
datum/design/asimov
|
||||
name = "Core Module Design (Asimov)"
|
||||
@@ -476,7 +467,7 @@ datum/design/asimov
|
||||
req_tech = list("programming" = 3, "materials" = 6)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$diamond" = 100)
|
||||
build_path = "/obj/item/weapon/aiModule/asimov"
|
||||
build_path = /obj/item/weapon/aiModule/core/full/asimov
|
||||
|
||||
datum/design/paladin_module
|
||||
name = "Core Module Design (P.A.L.A.D.I.N.)"
|
||||
@@ -485,7 +476,7 @@ datum/design/paladin_module
|
||||
req_tech = list("programming" = 4, "materials" = 6)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$diamond" = 100)
|
||||
build_path = "/obj/item/weapon/aiModule/paladin"
|
||||
build_path = /obj/item/weapon/aiModule/core/full/paladin
|
||||
|
||||
datum/design/tyrant_module
|
||||
name = "Core Module Design (T.Y.R.A.N.T.)"
|
||||
@@ -494,9 +485,25 @@ datum/design/tyrant_module
|
||||
req_tech = list("programming" = 4, "syndicate" = 2, "materials" = 6)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$diamond" = 100)
|
||||
build_path = "/obj/item/weapon/aiModule/tyrant"
|
||||
build_path = /obj/item/weapon/aiModule/core/full/tyrant
|
||||
|
||||
datum/design/corporate_module
|
||||
name = "Core Module Design (Corporate)"
|
||||
desc = "Allows for the construction of a Corporate AI Core Module."
|
||||
id = "corporate_module"
|
||||
req_tech = list("programming" = 4, "materials" = 6)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$diamond" = 100)
|
||||
build_path = /obj/item/weapon/aiModule/core/full/corp
|
||||
|
||||
datum/design/custom_module
|
||||
name = "Core Module Design (Custom)"
|
||||
desc = "Allows for the construction of a Custom AI Core Module."
|
||||
id = "custom_module"
|
||||
req_tech = list("programming" = 4, "materials" = 6)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20, "$diamond" = 100)
|
||||
build_path = /obj/item/weapon/aiModule/core/full/custom
|
||||
|
||||
///////////////////////////////////
|
||||
/////Subspace Telecomms////////////
|
||||
|
||||
Reference in New Issue
Block a user