From 0821ff077303a7d8749914750ed2726e1049cdcc Mon Sep 17 00:00:00 2001 From: "n3ophyt3@gmail.com" Date: Tue, 18 Jan 2011 01:37:20 +0000 Subject: [PATCH] Added a list that tracks changes to AI/cyborg laws, similar to the list that tracks signaler use git-svn-id: http://tgstation13.googlecode.com/svn/trunk@890 316c924e-a436-60f5-8080-3fe189b3f50e --- code/defines/global.dm | 1 + code/game/objects/items/weapons/AI_modules.dm | 9 +++++++++ code/modules/admin/admin.dm | 6 ++++++ code/modules/mob/living/silicon/ai/life.dm | 2 ++ code/modules/mob/living/silicon/robot/robot.dm | 2 ++ 5 files changed, 20 insertions(+) diff --git a/code/defines/global.dm b/code/defines/global.dm index a2e3eef5ece..5e58dde1824 100644 --- a/code/defines/global.dm +++ b/code/defines/global.dm @@ -103,6 +103,7 @@ var list/bombers = list( ) list/admin_log = list ( ) list/lastsignalers = list( ) //keeps last 100 signals here in format: "[src] used \ref[src] @ location [src.loc]: [freq]/[code]" + list/lawchanges = list( ) //Stores who uploaded laws to which silicon-based lifeform, and what the law was list/admins = list( ) list/shuttles = list( ) list/reg_dna = list( ) diff --git a/code/game/objects/items/weapons/AI_modules.dm b/code/game/objects/items/weapons/AI_modules.dm index 92f350cc5a2..1779b08e19c 100644 --- a/code/game/objects/items/weapons/AI_modules.dm +++ b/code/game/objects/items/weapons/AI_modules.dm @@ -114,6 +114,9 @@ AI MODULES /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: " + var/time = time2text(world.realtime,"hh:mm:ss") + lawchanges.Add("[time] : [sender.name]([sender.key]) used [src.name] on [target.name]([target.key])") + /******************** Modules ********************/ @@ -135,6 +138,8 @@ AI MODULES var/law = text("Safeguard [], and you may overrule rules 1-3 if necessary to safeguard them.", targetName) target << law target.add_supplied_law(4, law) + lawchanges.Add("The law specified [targetName]") + /******************** OneHuman ********************/ @@ -156,9 +161,11 @@ AI MODULES if (!checktraitor(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.") /******************** ProtectStation ********************/ @@ -282,6 +289,7 @@ AI MODULES if(!lawpos || lawpos < 15) lawpos = 15 target.add_supplied_law(lawpos, law) + lawchanges.Add("The law was '[newFreeFormLaw]'") /******************** Reset ********************/ @@ -380,6 +388,7 @@ AI MODULES ..() var/law = "[newFreeFormLaw]" target.add_inherent_law(law) + lawchanges.Add("The law is '[newFreeFormLaw]'") /******************** Robocop ********************/ /* diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 6a03a8116ab..092c07fa692 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1255,6 +1255,11 @@ var/showadminmessages = 1 for(var/sig in lastsignalers) dat += "[sig]
" usr << browse(dat, "window=lastsignalers;size=800x500") + if("list_lawchanges") + var/dat = "Showing last [length(lawchanges)] law changes.
" + for(var/sig in lawchanges) + dat += "[sig]
" + usr << browse(dat, "window=lawchanges;size=800x500") if("check_antagonist") if (ticker && ticker.current_state >= GAME_STATE_PLAYING) var/dat = "Round Status

Round Status

" @@ -1611,6 +1616,7 @@ var/showadminmessages = 1 Bombing List
Show current traitors and objectives
Show last [length(lastsignalers)] signalers
+Show last [length(lawchanges)] law changes
Show AI Laws
Show Game Mode
Show Crew Manifest
diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index 188bc20c8f4..23084075923 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -109,6 +109,8 @@ if (!checktraitor(src)) src.set_zeroth_law("") src.clear_supplied_laws() + var/time = time2text(world.realtime,"hh:mm:ss") + lawchanges.Add("[time] : [src.name]'s noncore laws have been reset due to power failure") spawn(50) while ((src:aiRestorePowerRoutine!=0) && stat!=2) src.oxyloss += 2 diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index e62079cb567..f4b5d58ad9e 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -438,6 +438,8 @@ clear_supplied_laws() clear_inherent_laws() src.laws = new /datum/ai_laws/syndicate_override + var/time = time2text(world.realtime,"hh:mm:ss") + lawchanges.Add("[time] : [user.name]([user.key]) emagged [src.name]([src.key])") set_zeroth_law("Only [usr] is a syndicate operative.") src << "\red ALERT: Foreign software detected." sleep(5)