diff --git a/code/defines/mob/living/silicon/robot.dm b/code/defines/mob/living/silicon/robot.dm index f288e30c02d..c65ae490386 100644 --- a/code/defines/mob/living/silicon/robot.dm +++ b/code/defines/mob/living/silicon/robot.dm @@ -56,4 +56,7 @@ var/speed = 0 //Cause sec borgs gotta go fast //No they dont! var/scrambledcodes = 0 // Used to determine if a borg shows up on the robotics console. Setting to one hides them. var/channels = list() - var/modlock = 0 \ No newline at end of file + var/modlock = 0 + + var/lawcheck[1] //For stating laws! + var/ioncheck[1] \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/laws.dm b/code/modules/mob/living/silicon/robot/laws.dm index e7f4904ede4..5afa42ee14b 100644 --- a/code/modules/mob/living/silicon/robot/laws.dm +++ b/code/modules/mob/living/silicon/robot/laws.dm @@ -93,4 +93,97 @@ /mob/living/silicon/robot/proc/clear_ion_laws() laws_sanity_check() - laws.clear_ion_laws() \ No newline at end of file + laws.clear_ion_laws() + +/mob/living/silicon/robot/proc/statelaws() // -- TLE +// set category = "AI Commands" +// set name = "State Laws" + src.say("Current Active Laws:") + //src.laws_sanity_check() + //src.laws.show_laws(world) + var/number = 1 + sleep(10) + + + + if (src.laws.zeroth) + if (src.lawcheck[1] == "Yes") //This line and the similar lines below make sure you don't state a law unless you want to. --NeoFite + src.say("0. [src.laws.zeroth]") + sleep(10) + + for (var/index = 1, index <= src.laws.ion.len, index++) + var/law = src.laws.ion[index] + var/num = ionnum() + if (length(law) > 0) + if (src.ioncheck[index] == "Yes") + src.say("[num]. [law]") + sleep(10) + + for (var/index = 1, index <= src.laws.inherent.len, index++) + var/law = src.laws.inherent[index] + + if (length(law) > 0) + if (src.lawcheck[index+1] == "Yes") + src.say("[number]. [law]") + sleep(10) + number++ + + + for (var/index = 1, index <= src.laws.supplied.len, index++) + var/law = src.laws.supplied[index] + + if (length(law) > 0) + if(src.lawcheck.len >= number+1) + if (src.lawcheck[number+1] == "Yes") + src.say("[number]. [law]") + sleep(10) + number++ + + +/mob/living/silicon/robot/verb/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" + + var/list = "Which laws do you want to include when stating them for the crew?

" + + + + if (src.laws.zeroth) + if (!src.lawcheck[1]) + src.lawcheck[1] = "No" //Given Law 0's usual nature, it defaults to NOT getting reported. --NeoFite + list += {"[src.lawcheck[1]] 0: [src.laws.zeroth]
"} + + for (var/index = 1, index <= src.laws.ion.len, index++) + var/law = src.laws.ion[index] + + if (length(law) > 0) + + + if (!src.ioncheck[index]) + src.ioncheck[index] = "Yes" + list += {"[src.ioncheck[index]] [ionnum()]: [law]
"} + src.ioncheck.len += 1 + + var/number = 1 + for (var/index = 1, index <= src.laws.inherent.len, index++) + var/law = src.laws.inherent[index] + + if (length(law) > 0) + src.lawcheck.len += 1 + + if (!src.lawcheck[number+1]) + src.lawcheck[number+1] = "Yes" + list += {"[src.lawcheck[number+1]] [number]: [law]
"} + number++ + + for (var/index = 1, index <= src.laws.supplied.len, index++) + var/law = src.laws.supplied[index] + if (length(law) > 0) + src.lawcheck.len += 1 + if (!src.lawcheck[number+1]) + src.lawcheck[number+1] = "Yes" + list += {"[src.lawcheck[number+1]] [number]: [law]
"} + number++ + list += {"

State Laws"} + + usr << browse(list, "window=laws") \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index be090aaa13f..13a2c20ded1 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -207,6 +207,20 @@ viewalerts = 1 src << browse(dat, "window=robotalerts&can_close=0") +/mob/living/silicon/robot/proc/ai_roster() + set category = "Robot Commands" + set name = "Show Crew Manifest" + + var/dat = "Crew RosterCrew Roster:

" + + for (var/datum/data/record/t in data_core.general) + dat += "[t.fields["name"]] - [t.fields["rank"]]
" + + dat += "" + + src << browse(dat, "window=airoster") + onclose(src, "airoster") + /mob/living/silicon/robot/blob_act() if (stat != 2) adjustBruteLoss(60) @@ -937,6 +951,26 @@ else src << "Module isn't activated" installed_modules() + + if (href_list["lawc"]) // Toggling whether or not a law gets stated by the State Laws verb --NeoFite + var/L = text2num(href_list["lawc"]) + switch(lawcheck[L+1]) + if ("Yes") lawcheck[L+1] = "No" + if ("No") lawcheck[L+1] = "Yes" +// src << text ("Switching Law [L]'s report status to []", lawcheck[L+1]) + checklaws() + + if (href_list["lawi"]) // Toggling whether or not a law gets stated by the State Laws verb --NeoFite + var/L = text2num(href_list["lawi"]) + switch(ioncheck[L]) + if ("Yes") ioncheck[L] = "No" + if ("No") ioncheck[L] = "Yes" +// src << text ("Switching Law [L]'s report status to []", lawcheck[L+1]) + checklaws() + + if (href_list["laws"]) // With how my law selection code works, I changed statelaws from a verb to a proc, and call it through my law selection panel. --NeoFite + statelaws() + return /mob/living/silicon/robot/proc/uneq_active() diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index c9e4dbd35ab..3d4ca7661d2 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -212,6 +212,8 @@ O << "To use something, simply click or double-click it." O << {"Use say ":s to speak to fellow cyborgs and the AI through binary."} + O.verbs += /mob/living/silicon/robot/proc/ai_roster + O.job = "Cyborg" O.mmi = new /obj/item/device/mmi(O) @@ -412,4 +414,4 @@ del(src) - return O + return O