Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions code/datums/ai_laws.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
55 changes: 38 additions & 17 deletions code/game/machinery/computer/law.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +55 to +69
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
if(!user.mind?.has_antag_datum(/datum/antagonist/rev/head))
return
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, 30 SECONDS, src))
to_chat(user, span_warning("You were interrupted!"))
return
if(upload_check(user))
M.install(current.laws, user)
else
to_chat(user, span_warning("The upload fails!"))
user.visible_message(span_warning("[user] stops typing on [src]."))
qdel(M)


/obj/machinery/computer/upload/ai
name = "\improper AI upload console"
desc = "Used to upload laws to the AI."
Expand Down
6 changes: 6 additions & 0 deletions code/game/objects/items/AI_modules.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"