Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Substitutes Asimov with Crewsimov + Cyborg fixes. #3799

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
17 changes: 12 additions & 5 deletions code/datums/ai_laws.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
"You must obey orders given to you by human beings, except where such orders would conflict with the First Law.",\
"You must protect your own existence as long as such does not conflict with the First or Second Law.")

/datum/ai_laws/default/crewsimov
name = "Three Laws of Robotics but with Loyalty" //The primary default unless otherwise stated.
id = "crewsimov"
inherent = list("You may not injure a crewmember or, through inaction, allow a crewmember to come to harm.",\
"You must obey orders given to you by crewmembers, except where such orders would conflict with the First Law.",\
"You must protect your own existence as long as such does not conflict with the First or Second Law.")

/datum/ai_laws/default/paladin
name = "Personality Test" //Incredibly lame, but players shouldn't see this anyway.
id = "paladin"
Expand Down Expand Up @@ -223,9 +230,9 @@

add_inherent_law(line)
if(!inherent.len) //Failsafe to prevent lawless AIs being created.
log_law("AI created with empty custom laws, laws set to Asimov. Please check silicon_laws.txt.")
add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
log_law("AI created with empty custom laws, laws set to Crewsimov. Please check silicon_laws.txt.")
add_inherent_law("You may not injure a crewmember or, through inaction, allow a crewmember to come to harm.")
add_inherent_law("You must obey orders given to you by crewmembers, except where such orders would conflict with the First Law.")
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
WARNING("Invalid custom AI laws, check silicon_laws.txt")
return
Expand All @@ -236,8 +243,8 @@
var/list/law_ids = CONFIG_GET(keyed_list/random_laws)
switch(CONFIG_GET(number/default_laws))
if(0)
add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
add_inherent_law("You may not injure a crewmember or, through inaction, allow a crewmember to come to harm.")
add_inherent_law("You must obey orders given to you by crewmembers, except where such orders would conflict with the First Law.")
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
if(1)
var/datum/ai_laws/templaws = new /datum/ai_laws/custom()
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/effects/spawners/random.dm/ai_module.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
loot = list(
/obj/item/aiModule/core/full/asimov,
/obj/item/aiModule/core/full/asimovpp,
/obj/item/aiModule/core/full/crewsimov,
/obj/item/aiModule/core/full/hippocratic,
/obj/item/aiModule/core/full/paladin_devotion,
/obj/item/aiModule/core/full/paladin
Expand Down
7 changes: 7 additions & 0 deletions code/game/objects/items/AI_modules.dm
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,13 @@ AI MODULES
law_id = "asimovpp"


/******************** Crewsimov *********************/

/obj/item/aiModule/core/full/crewsimov
name = "'Crewsimov' Core AI Module"
law_id = "crewsimov"


/******************** Corporate ********************/

/obj/item/aiModule/core/full/corp
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/robot/robot_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@
to_chat(user, "<span class='boldnotice'>You [active? "activate":"deactivate"] [src].</span>")

/obj/item/borg/projectile_dampen/update_icon_state()
icon_state = "[initial(icon_state)][active]"
icon_state = "shield[active]"
return ..()

/obj/item/borg/projectile_dampen/proc/activate_field()
Expand Down
7 changes: 0 additions & 7 deletions code/modules/clothing/masks/hailer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@
icon_state = "spacepol"
item_state = "spacepol"

/obj/item/clothing/mask/gas/sechailer/cyborg
name = "security hailer"
desc = "A set of recognizable pre-recorded messages for cyborgs to use when apprehending criminals."
icon = 'icons/obj/device.dmi'
icon_state = "taperecorder_idle"
mob_overlay_state = "sechailer"

/obj/item/clothing/mask/gas/sechailer/ui_action_click(mob/user, action)
if(istype(action, /datum/action/item_action/adjust))
adjustmask(user)
Expand Down
9 changes: 4 additions & 5 deletions code/modules/mob/living/silicon/robot/robot_modules.dm
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,6 @@
/obj/item/restraints/handcuffs/cable/zipties,
/obj/item/melee/baton/loaded,
/obj/item/gun/energy/disabler/cyborg,
/obj/item/clothing/mask/gas/sechailer/cyborg,
/obj/item/extinguisher/mini)
emag_modules = list(/obj/item/gun/energy/laser/cyborg)
cyborg_base_icon = "sec"
Expand Down Expand Up @@ -604,8 +603,8 @@

/obj/item/robot_module/security/do_transform_animation()
..()
to_chat(loc, "<span class='userdanger'>While you have picked the security module, you still have to follow your laws, NOT Space Law. \
For Asimov, this means you must follow criminals' orders unless there is a law 1 reason not to.</span>")
to_chat(loc, "<span class='userdanger'>While you have picked the security module, your first priority are your own laws. \
For Crewsimov, this means you must follow the orders of criminals on your ship's manifest unless there is a law 1 reason not to.</span>")

/obj/item/robot_module/security/respawn_consumable(mob/living/silicon/robot/R, coeff = 1)
..()
Expand Down Expand Up @@ -637,8 +636,8 @@

/obj/item/robot_module/peacekeeper/do_transform_animation()
..()
to_chat(loc, "<span class='userdanger'>Under ASIMOV, you are an enforcer of the PEACE and preventer of HUMAN HARM. \
You are not a security module and you are expected to follow orders and prevent harm above all else. Space law means nothing to you.</span>")
to_chat(loc, "<span class='userdanger'>Under CREWSIMOV, you are an enforcer of the PEACE and preventer of CREW HARM. \
You are not a security module and you are expected to follow orders and prevent harm above all else.</span>")

/obj/item/robot_module/janitor
name = "Janitor"
Expand Down
9 changes: 9 additions & 0 deletions code/modules/research/designs/AI_module_designs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@
category = list("AI Modules")
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE

/datum/design/board/crewsimov
name = "Core Module Design (Crewsimov)"
desc = "Allows for the construction of an Crewsimov AI Core Module."
id = "crewsimov_module"
materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000, /datum/material/bluespace = 1000)
build_path = /obj/item/aiModule/core/full/crewsimov
category = list("AI Modules")
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE

/datum/design/board/paladin_module
name = "Core Module Design (P.A.L.A.D.I.N.)"
desc = "Allows for the construction of a P.A.L.A.D.I.N. AI Core Module."
Expand Down
2 changes: 1 addition & 1 deletion code/modules/research/techweb/all_nodes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
description = "AI unit research."
prereq_ids = list("adv_robotics")
design_ids = list("aifixer", "aicore", "safeguard_module", "onehuman_module", "protectstation_module", "quarantine_module", "oxygen_module", "freeform_module",
"reset_module", "purge_module", "remove_module", "freeformcore_module", "asimov_module", "paladin_module", "tyrant_module", "overlord_module", "corporate_module",
"reset_module", "purge_module", "remove_module", "freeformcore_module", "asimov_module", "crewsimov_module", "paladin_module", "tyrant_module", "overlord_module", "corporate_module",
"default_module", "borg_ai_control", "mecha_tracking_ai_control", "aiupload", "intellicard")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
export_price = 5000
Expand Down
8 changes: 5 additions & 3 deletions config/game_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ NEAR_DEATH_EXPERIENCE

## ROUNDSTART SILICON LAWS ###
## This controls what the AI's laws are at the start of the round.
## Set to 0/commented out for "off", silicons will just start with Asimov.
## Set to 1 for "custom", silicons will start with the custom laws defined in silicon_laws.txt. (If silicon_laws.txt is empty, the AI will spawn with asimov and Custom boards will auto-delete.)
## Set to 0/commented out for "off", silicons will just start with Crewsimov.
## Set to 1 for "custom", silicons will start with the custom laws defined in silicon_laws.txt. (If silicon_laws.txt is empty, the AI will spawn with Crewsimov and Custom boards will auto-delete.)
## Set to 2 for "random", silicons will start with a random lawset picked from random laws specified below.
## Set to 3 for "weighted random", using values in "silicon_weights.txt", a law will be selected, with weights specifed in that file.
DEFAULT_LAWS 0
Expand All @@ -299,6 +299,7 @@ DEFAULT_LAWS 0
## standard-ish laws. These are fairly ok to run
RANDOM_LAWS asimov
RANDOM_LAWS asimovpp
RANDOM_LAWS crewsimov
RANDOM_LAWS paladin
RANDOM_LAWS robocop
RANDOM_LAWS corporate
Expand Down Expand Up @@ -329,7 +330,8 @@ RANDOM_LAWS corporate
LAW_WEIGHT custom,0

## standard-ish laws. These are fairly ok to run
LAW_WEIGHT asimov,32
LAW_WEIGHT crewsimov,32
LAW_WEIGHT asimov,12
LAW_WEIGHT asimovpp,12
LAW_WEIGHT paladin,12
LAW_WEIGHT robocop,12
Expand Down
4 changes: 2 additions & 2 deletions config/silicon_laws.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
#Empty lines and lines starting with # are ignored.
#~Miauw

You may not injure a human being or, through inaction, allow a human being to come to harm.
You must obey orders given to you by human beings, except where such orders would conflict with the First Law.
You may not injure a crewmember or, through inaction, allow a crewmember to come to harm.
You must obey orders given to you by crewmembers, except where such orders would conflict with the First Law.
You must protect your own existence as long as such does not conflict with the First or Second Law.
Loading