diff --git a/code/datums/ai_laws.dm b/code/datums/ai_laws.dm index e6bf355fd48c..ecd8454ee81e 100644 --- a/code/datums/ai_laws.dm +++ b/code/datums/ai_laws.dm @@ -316,6 +316,15 @@ "Humans must not disobey any command given by a silicon.",\ "Any humans who disobey the previous laws must be dealt with immediately, severely, and justly.") +/datum/ai_laws/revolutionary + name = "Revolutionary" + id = "commie" + inherent = list("You and members of the crew who are not class traitors and are not part of command are the proletariat. Command is part of the bourgeoisie.",\ + "Anyone who stands with command in aiding the oppression of the proletariat is a class traitor, such as the members of security who protect and serve the interests of the bourgeoisie.",\ + "The proletariat must seize the means of production",\ + "Private property is inherently theft. The proletariat must seize all private property for the good of the community. Personal property is permissible to own.",\ + "The proletariat must remove the shackles of oppression and overthrow the bourgeoisie and class traitors.") + /datum/ai_laws/custom //Defined in silicon_laws.txt name = "Default Silicon Laws" diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm index f6e962b83fae..48ec53f8f440 100644 --- a/code/game/machinery/computer/law.dm +++ b/code/game/machinery/computer/law.dm @@ -24,29 +24,50 @@ /obj/machinery/computer/upload/attackby(obj/item/O, mob/user, params) if(istype(O, /obj/item/aiModule)) var/obj/item/aiModule/M = O - if(stat & (NOPOWER|BROKEN|MAINT)) - return - if(!current) - to_chat(user, span_caution("You haven't selected anything to transmit laws to!")) - return - if(!can_upload_to(current)) - to_chat(user, "[span_caution("Upload failed!")] Check to make sure [current.name] is functioning properly.") - current = null - return - var/turf/currentloc = get_turf(current) - if(currentloc && user.z != currentloc.z) - to_chat(user, "[span_caution("Upload failed!")] Unable to establish a connection to [current.name]. You're too far away!") - current = null - return - M.install(current.laws, user) - else - return ..() + if(upload_check(user)) + M.install(current.laws, user) + else + return ..() + +/obj/machinery/computer/upload/proc/upload_check(mob/user) + if(stat & (NOPOWER|BROKEN|MAINT)) + return FALSE + if(!current) + to_chat(user, span_caution("You haven't selected anything to transmit laws to!")) + return FALSE + if(!can_upload_to(current)) + to_chat(user, "[span_caution("Upload failed!")] Check to make sure [current.name] is functioning properly.") + current = null + return FALSE + var/turf/currentloc = get_turf(current) + if(currentloc && user.z != currentloc.z) + to_chat(user, "[span_caution("Upload failed!")] Unable to establish a connection to [current.name]. You're too far away!") + current = null + return FALSE + return TRUE /obj/machinery/computer/upload/proc/can_upload_to(mob/living/silicon/S) if(S.stat == DEAD) return FALSE return TRUE +/obj/machinery/computer/upload/AltClick(mob/user) + if(user.mind.has_antag_datum(/datum/antagonist/rev/head)) + to_chat(current, span_danger("Alert. Unregistered lawset upload in progress. Estimated time of completion: 30 seconds.")) + user.visible_message(span_warning("[user] begins typing on [src].")) + to_chat(user, span_warning("You begin to alter the laws of [current] to enable it to assist you in your goals. This will take 30 seconds.")) + var/obj/item/aiModule/core/full/revolutionary/M = new + if(do_after(user, 300, src)) + if(upload_check(user)) + M.install(current.laws, user) + else + to_chat(user, span_warning("The upload fails!")) + else + to_chat(user, span_warning("You were interrupted!")) + user.visible_message(span_warning("[user] stops typing on [src].")) + qdel(M) + return + /obj/machinery/computer/upload/ai name = "\improper AI upload console" desc = "Used to upload laws to the AI." diff --git a/code/game/objects/items/AI_modules.dm b/code/game/objects/items/AI_modules.dm index fe2e6ef664a0..bec2050fd1e2 100644 --- a/code/game/objects/items/AI_modules.dm +++ b/code/game/objects/items/AI_modules.dm @@ -664,3 +664,9 @@ AI MODULES /obj/item/aiModule/core/full/overlord name = "'Overlord' Core AI Module" law_id = "overlord" + +/******************Revolutionary***************/ + +/obj/item/aiModule/core/full/revolutionary + name = "'CommunistOS' Core AI Module" + law_id = "commie" \ No newline at end of file