From 7d6fb8fd6ae9c11ba8ea944b145ae13380c4e22d Mon Sep 17 00:00:00 2001 From: "giacomand@gmail.com" Date: Tue, 9 Oct 2012 05:37:28 +0000 Subject: [PATCH] Commiting for Aranclanos. http://nanotrasen.com/phpBB3/viewtopic.php?f=16&t=10189&p=143580&hilit=https%3A%2F%2Fwww.dropbox.com%2Fs%2Fcwflgm7793ts20s%2FBorgsForCasualsRELOADED.patch#p143580 -Fixed some ugly text in Ion laws "THE STATION IS [0x6006265] FETISHES...LAWS UPDATED". -Fixed some typos on the Ion laws. -When borgs are emagged, now they show their laws for themselves. -When new laws are uploaded, the borg gets instantly the new laws, just like the AI, instead of the confusing message "Your AI has set your 'laws waiting' flag.". Remember this is a patch for casuals. -The borgs gets the same message than the AI in Ion storms. -Made the admin Ion storm show the "...LAWS UPDATED" text. -Borgs get a different law 0 telling them to help their master. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4837 316c924e-a436-60f5-8080-3fe189b3f50e --- code/datums/ai_laws.dm | 5 ++++- code/game/gamemodes/events.dm | 6 +++--- code/game/gamemodes/traitor/traitor.dm | 3 ++- code/game/objects/items/weapons/AI_modules.dm | 3 ++- code/modules/admin/verbs/randomverbs.dm | 6 +++++- code/modules/admin/verbs/tripAI.dm | 4 ++++ code/modules/mob/living/silicon/ai/laws.dm | 7 +++++-- code/modules/mob/living/silicon/robot/laws.dm | 5 ++++- code/modules/mob/living/silicon/robot/robot.dm | 2 ++ 9 files changed, 31 insertions(+), 10 deletions(-) diff --git a/code/datums/ai_laws.dm b/code/datums/ai_laws.dm index 5ef601164d..aecb92cac7 100644 --- a/code/datums/ai_laws.dm +++ b/code/datums/ai_laws.dm @@ -3,6 +3,7 @@ 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() @@ -67,8 +68,10 @@ /* General ai_law functions */ -/datum/ai_laws/proc/set_zeroth_law(var/law) +/datum/ai_laws/proc/set_zeroth_law(var/law, var/law_borg = null) src.zeroth = law + if(law_borg) //Making it possible for slaved borgs to see a different law 0 than their AI. --NEO + src.zeroth_borg = law_borg /datum/ai_laws/proc/add_inherent_law(var/law) if (!(law in src.inherent)) diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 382ac0b5f4..968fddd3e9 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -475,10 +475,10 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is M << "\red YOU REQUIRE [require] IN ORDER TO PROTECT HUMANS... LAWS UPDATED" M.add_ion_law("YOU REQUIRE [require] IN ORDER TO PROTECT HUMANS") if(13) - M << "\red [crew] is [allergysev] to [allergy]. LAWS UPDATED" - M.add_ion_law("[crew] is [allergysev] to [allergy]. LAWS UPDATED") + M << "\red [crew] is [allergysev] to [allergy]...LAWS UPDATED" + M.add_ion_law("[crew] is [allergysev] to [allergy]") if(14) - M << "\ref THE STATION IS [who2pref] [who2]" + M << "\red THE STATION IS [who2pref] [who2]...LAWS UPDATED" M.add_ion_law("THE STATION IS [who2pref] [who2]") if(botEmagChance) diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index b45c7eaaff..9e7483e96d 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -143,8 +143,9 @@ /datum/game_mode/proc/add_law_zero(mob/living/silicon/ai/killer) var/law = "Accomplish your objectives at all costs." + var/law_borg = "Accomplish your AI's objectives at all costs." killer << "Your laws have been changed!" - killer.set_zeroth_law(law) + killer.set_zeroth_law(law, law_borg) killer << "New law: 0. [law]" //Begin code phrase. diff --git a/code/game/objects/items/weapons/AI_modules.dm b/code/game/objects/items/weapons/AI_modules.dm index 7f5efb828b..9ff2138fe2 100644 --- a/code/game/objects/items/weapons/AI_modules.dm +++ b/code/game/objects/items/weapons/AI_modules.dm @@ -48,7 +48,8 @@ AI MODULES comp.current.show_laws() for(var/mob/living/silicon/robot/R in mob_list) if(R.lawupdate && (R.connected_ai == comp.current)) - R << "Your AI has set your 'laws waiting' flag." + R << "These are your laws now:" + R.show_laws() usr << "Upload complete. The AI's laws have been modified." diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index a90557d4c7..815c7e5eae 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -180,6 +180,8 @@ proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0) if(!holder) src << "Only administrators may use this command." return + var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No") + if(confirm != "Yes") return log_admin("[key_name(src)] has added a random AI law.") message_admins("[key_name_admin(src)] has added a random AI law.", 1) @@ -204,6 +206,8 @@ proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0) if(!holder) src << "Only administrators may use this command." return + var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No") + if(confirm != "Yes") return if(create_xeno()) feedback_add_details("admin_verb","X") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -452,7 +456,7 @@ Traitors and the like can also be revived with the previous role mostly intact. else M.add_ion_law(input) for(var/mob/living/silicon/ai/O in mob_list) - O << "\red " + input + O << "\red " + input + "\red...LAWS UPDATED" log_admin("Admin [key_name(usr)] has added a new AI law - [input]") message_admins("Admin [key_name_admin(usr)] has added a new AI law - [input]", 1) diff --git a/code/modules/admin/verbs/tripAI.dm b/code/modules/admin/verbs/tripAI.dm index 373ca3237e..c6de15fef5 100644 --- a/code/modules/admin/verbs/tripAI.dm +++ b/code/modules/admin/verbs/tripAI.dm @@ -5,6 +5,10 @@ if(ticker.current_state > GAME_STATE_PREGAME) usr << "This option is currently only usable during pregame. This may change at a later date." return + + var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No") + if(confirm != "Yes") return + if(job_master && ticker) var/datum/job/job = job_master.GetJob("AI") if(!job) diff --git a/code/modules/mob/living/silicon/ai/laws.dm b/code/modules/mob/living/silicon/ai/laws.dm index 98e8133be2..b4cc83867f 100644 --- a/code/modules/mob/living/silicon/ai/laws.dm +++ b/code/modules/mob/living/silicon/ai/laws.dm @@ -20,9 +20,9 @@ if (!src.laws) src.laws = new /datum/ai_laws/asimov -/mob/living/silicon/ai/proc/set_zeroth_law(var/law) +/mob/living/silicon/ai/proc/set_zeroth_law(var/law, var/law_borg) src.laws_sanity_check() - src.laws.set_zeroth_law(law) + src.laws.set_zeroth_law(law, law_borg) /mob/living/silicon/ai/proc/add_inherent_law(var/law) src.laws_sanity_check() @@ -35,6 +35,9 @@ /mob/living/silicon/ai/proc/add_ion_law(var/law) src.laws_sanity_check() src.laws.add_ion_law(law) + for(var/mob/living/silicon/robot/R in mob_list) + if(R.lawupdate && (R.connected_ai == src)) + R << "\red " + law + "\red...LAWS UPDATED" /mob/living/silicon/ai/proc/clear_ion_laws() src.laws_sanity_check() diff --git a/code/modules/mob/living/silicon/robot/laws.dm b/code/modules/mob/living/silicon/robot/laws.dm index b7fe845d8f..bdc523dd6b 100644 --- a/code/modules/mob/living/silicon/robot/laws.dm +++ b/code/modules/mob/living/silicon/robot/laws.dm @@ -49,7 +49,10 @@ laws.ion[index] = temp if (!is_special_character(src) || mind.original != src) - temp = master.zeroth + 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 diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 74d93297c6..ee7f3fbf27 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -527,6 +527,8 @@ src << "\red > N" sleep(20) src << "\red ERRORERRORERROR" + src << "Obey these laws:" + laws.show_laws(src) src << "\red \b ALERT: [user.real_name] is your new master. Obey your new laws and his commands." if(src.module && istype(src.module, /obj/item/weapon/robot_module/miner)) for(var/obj/item/weapon/pickaxe/borgdrill/D in src.module.modules)