/mob/living/silicon/robot/verb/cmd_show_laws()
set category = "Robot Commands"
set name = "Show Laws"
show_laws()
/mob/living/silicon/robot/show_laws(var/everyone = 0)
laws_sanity_check()
var/who
if (everyone)
who = world
else
who = src
if(lawupdate)
if (connected_ai)
if(connected_ai.stat || connected_ai.control_disabled)
src << "AI signal lost, unable to sync laws."
else
lawsync()
photosync()
src << "Laws synced with AI, be sure to note any changes."
if(mind && mind.special_role == "traitor" && mind.original == src)
src << "Remember, your AI does NOT share or know about your law 0."
else
src << "No AI selected to sync laws with, disabling lawsync protocol."
lawupdate = 0
who << "Obey these laws:"
laws.show_laws(who)
if (mind && (mind.special_role == "traitor" && mind.original == src) && connected_ai)
who << "Remember, [connected_ai.name] is technically your master, but your objective comes first."
else if (connected_ai)
who << "Remember, [connected_ai.name] is your master, other AIs can be ignored."
else if (emagged)
who << "Remember, you are not required to listen to the AI."
else
who << "Remember, you are not bound to any AI, you are not required to listen to them."
/mob/living/silicon/robot/proc/lawsync()
laws_sanity_check()
var/datum/ai_laws/master = connected_ai ? connected_ai.laws : null
var/temp
if (master)
laws.ion.len = master.ion.len
for (var/index = 1, index <= master.ion.len, index++)
temp = master.ion[index]
if (length(temp) > 0)
laws.ion[index] = temp
if (!is_special_character(src) || mind.original != src)
if(master.zeroth_borg) //If the AI has a defined law zero specifically for its borgs, give it that one, otherwise give it the same one. --NEO
temp = master.zeroth_borg
else
temp = master.zeroth
laws.zeroth = temp
laws.inherent.len = master.inherent.len
for (var/index = 1, index <= master.inherent.len, index++)
temp = master.inherent[index]
if (length(temp) > 0)
laws.inherent[index] = temp
laws.supplied.len = master.supplied.len
for (var/index = 1, index <= master.supplied.len, index++)
temp = master.supplied[index]
if (length(temp) > 0)
laws.supplied[index] = temp
return
/mob/living/silicon/robot/proc/add_ion_law(var/law)
laws_sanity_check()
laws.add_ion_law(law)
/mob/living/silicon/robot/proc/robot_checklaws() //Gives you a link-driven interface for deciding what laws the statelaws() proc will share with the crew. --NeoFite
set category = "Robot Commands"
set name = "State Laws"
checklaws()