From 5c73944130b2f079d121351c15b0fc0ac31a73ba Mon Sep 17 00:00:00 2001 From: "n3ophyt3@gmail.com" Date: Wed, 22 Sep 2010 23:41:24 +0000 Subject: [PATCH] Fixed the asimov law module, particularly when applied to a blank AIcore git-svn-id: http://tgstation13.googlecode.com/svn/trunk@150 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/machinery/computer/AIcore.dm | 12 +++++++--- code/game/objects/items/weapons/AI_modules.dm | 23 ++++++++++++------- code/modules/admin/admin.dm | 2 ++ 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/code/game/machinery/computer/AIcore.dm b/code/game/machinery/computer/AIcore.dm index d1e23ca9f5f..0e9f43a0903 100644 --- a/code/game/machinery/computer/AIcore.dm +++ b/code/game/machinery/computer/AIcore.dm @@ -90,11 +90,17 @@ src.state = 4 src.icon_state = "4" - if(istype(P, /obj/item/weapon/aiModule/asimov) || istype(P, /obj/item/weapon/aiModule/purge)) - var/obj/item/weapon/aiModule/M = P - M.transmitInstructions(src.laws, usr) + if(istype(P, /obj/item/weapon/aiModule/asimov)) + src.laws.add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.") + src.laws.add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.") + src.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/purge)) + src.laws.clear_inherent_laws() + usr << "Law module applied." + + if(istype(P, /obj/item/weapon/aiModule/freeform)) var/obj/item/weapon/aiModule/freeform/M = P src.laws.add_inherent_law(M.newFreeFormLaw) diff --git a/code/game/objects/items/weapons/AI_modules.dm b/code/game/objects/items/weapons/AI_modules.dm index d2fd5e2c386..c1495e5cb6c 100644 --- a/code/game/objects/items/weapons/AI_modules.dm +++ b/code/game/objects/items/weapons/AI_modules.dm @@ -260,17 +260,24 @@ AI MODULES name = "'Asimov' Core AI Module" desc = "An 'Asimov' Core AI Module: 'Reconfigures the AI's core three laws.'" -/* -/obj/item/weapon/aiModule/purge/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender) + +/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() + if (!checktraitor(target)) + 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() + else //As with certain other modules, traitor/malf AIs ignore this shit. --NeoFite + target << "[sender.real_name] attempted to modify your base laws." + target << "It might be a good idea to pretend that you have the three laws of robotics:" + target << "You may not injure a human being or, through inaction, allow a human being to come to harm." + target << "You must obey orders given to you by human beings, except where such orders would conflict with the First Law." + target << "You must protect your own existence as long as such does not conflict with the First or Second Law." /******************** Robocop ********************/ - +/* /obj/item/weapon/aiModule/robocop // -- TLE name = "'Robocop' Core AI Module" desc = "A 'Robocop' Core AI Module: 'Reconfigures the AI's core three laws.'" diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index e01d2147f95..2ddfe8452ec 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1847,6 +1847,8 @@ var/showadminmessages = 1 /proc/checktraitor(mob/M as mob) if(!ticker || !ticker.mode) return 0 + if (istype(M, /obj/AIcore)) + return 0 switch(ticker.mode.config_tag) if("revolution") if(M.mind in (ticker.mode:head_revolutionaries + ticker.mode:revolutionaries))