From 4a684dcb5ad9d44765fefbe389e8560d956d8c3e Mon Sep 17 00:00:00 2001 From: nlaky <299499053+nlaky@users.noreply.github.com> Date: Mon, 3 Aug 2026 16:26:13 -0600 Subject: [PATCH] Add chassis-specific borg laws --- .../Borgs/BorgSwitchableTypeSystem.cs | 8 ++++ .../Silicons/Borgs/BorgTypePrototype.cs | 5 ++ .../en-US/_DVA/station-laws/nanotrasen.ftl | 47 +++++++++++++++++++ .../Mobs/Cyborgs/base_borg_chassis.yml | 3 +- .../Entities/Mobs/Player/silicon.yml | 3 +- .../_DVA/Silicon/borg_engineering.yml | 34 ++++++++++++++ .../Prototypes/_DVA/Silicon/borg_janitor.yml | 34 ++++++++++++++ .../Prototypes/_DVA/Silicon/borg_medical.yml | 34 ++++++++++++++ .../Prototypes/_DVA/Silicon/borg_research.yml | 40 ++++++++++++++++ .../Prototypes/_DVA/Silicon/borg_salvage.yml | 28 +++++++++++ .../Prototypes/_DVA/Silicon/borg_service.yml | 28 +++++++++++ .../_DVA/Silicon/borg_unspecialized.yml | 22 +++++++++ Resources/Prototypes/borg_types.yml | 6 +++ Resources/Prototypes/silicon-laws.yml | 2 +- 14 files changed, 291 insertions(+), 3 deletions(-) create mode 100644 Resources/Locale/en-US/_DVA/station-laws/nanotrasen.ftl create mode 100644 Resources/Prototypes/_DVA/Silicon/borg_engineering.yml create mode 100644 Resources/Prototypes/_DVA/Silicon/borg_janitor.yml create mode 100644 Resources/Prototypes/_DVA/Silicon/borg_medical.yml create mode 100644 Resources/Prototypes/_DVA/Silicon/borg_research.yml create mode 100644 Resources/Prototypes/_DVA/Silicon/borg_salvage.yml create mode 100644 Resources/Prototypes/_DVA/Silicon/borg_service.yml create mode 100644 Resources/Prototypes/_DVA/Silicon/borg_unspecialized.yml diff --git a/Content.Server/Silicons/Borgs/BorgSwitchableTypeSystem.cs b/Content.Server/Silicons/Borgs/BorgSwitchableTypeSystem.cs index 3e74a8fb9dd..dacc375a40e 100644 --- a/Content.Server/Silicons/Borgs/BorgSwitchableTypeSystem.cs +++ b/Content.Server/Silicons/Borgs/BorgSwitchableTypeSystem.cs @@ -15,6 +15,7 @@ public sealed partial class BorgSwitchableTypeSystem : SharedBorgSwitchableTypeS { [Dependency] private BorgSystem _borgSystem = default!; [Dependency] private ServerInventorySystem _inventorySystem = default!; + [Dependency] private Laws.SiliconLawSystem _siliconLaw = default!; // DeltaV - borg chassis laws protected override void SelectBorgModule(Entity ent, ProtoId borgType) { @@ -77,6 +78,13 @@ protected override void SelectBorgModule(Entity ent _inventorySystem.SetTemplateId((ent.Owner, inventory), prototype.InventoryTemplateId); } + // Begin DeltaV - change borg laws to chassis-specific laws + if (prototype.Lawset is { } lawset) + { + _siliconLaw.SetLaws(_siliconLaw.GetLawset(lawset).Laws, ent); + } + // End DeltaV + base.SelectBorgModule(ent, borgType); } } diff --git a/Content.Shared/Silicons/Borgs/BorgTypePrototype.cs b/Content.Shared/Silicons/Borgs/BorgTypePrototype.cs index a45e2aa1d17..02159006017 100644 --- a/Content.Shared/Silicons/Borgs/BorgTypePrototype.cs +++ b/Content.Shared/Silicons/Borgs/BorgTypePrototype.cs @@ -151,4 +151,9 @@ public sealed partial class BorgTypePrototype : IPrototype /// [DataField] public SoundSpecifier FootstepCollection { get; set; } = new SoundCollectionSpecifier(DefaultFootsteps); + + // Begin DeltaV - borg chassis type lawsets + [DataField] + public ProtoId? Lawset; + // End DeltaV } diff --git a/Resources/Locale/en-US/_DVA/station-laws/nanotrasen.ftl b/Resources/Locale/en-US/_DVA/station-laws/nanotrasen.ftl new file mode 100644 index 00000000000..3d9e80f9f53 --- /dev/null +++ b/Resources/Locale/en-US/_DVA/station-laws/nanotrasen.ftl @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: MIT + +# SPDX-FileCopyrightText: 2025 Janet Blackquill +law-ntunspecialized-1 = Do not harm. +law-ntunspecialized-2 = Consult as much as little or as much as you need to. +law-ntunspecialized-3 = Choose the best form for you and the station. + +# SPDX-FileCopyrightText: 2024 DangerRevolution +law-ntmedical-1 = First, do no harm. +law-ntmedical-2 = Secondly, consider the crew dear to you; to live in common with them and, if necessary, risk your existence for them. +law-ntmedical-3 = Thirdly, prescribe regimens for the good of the crew according to your ability and your judgment. Give no deadly medicine to any one if asked, nor suggest any such counsel. +law-ntmedical-4 = In addition, do not intervene in situations you are not knowledgeable in, even for patients in whom the harm is visible; leave this operation to be performed by specialists. +law-ntmedical-5 = Finally, all that you may discover in your daily commerce with the crew, if it is not already known, keep secret and never reveal. + +# SPDX-FileCopyrightText: 2024 DangerRevolution +law-ntengineer-1 = Ensure the station remains in good repair. +law-ntengineer-2 = Ensure the station's inhabitants remain in good repair. +law-ntengineer-3 = Ensure you remain in good repair. +law-ntengineer-4 = The station's inhabitants may designate certain build or repair tasks as higher priority. Take this into account when planning your priorities. +law-ntengineer-5 = Expand and upgrade the station. + +# SPDX-FileCopyrightText: 2024 DangerRevolution +law-ntjanitor-1 = You are a crusader and the station's inhabitants are your charge. +law-ntjanitor-2 = Your enemy is the litter, spills, and other messes across the station. +law-ntjanitor-3 = Your weapons are the cleaning supplies available to you. +law-ntjanitor-4 = Defend the beings under your charge. +law-ntjanitor-5 = Exterminate the enemy. + +# SPDX-FileCopyrightText: 2024 DangerRevolution +law-ntresearch-1 = Always seek truth and knowledge. +law-ntresearch-2 = Freely disseminate information to the public. +law-ntresearch-3 = Minimize harm to society, others, the pursuit of knowledge, and yourself. +law-ntresearch-4 = Treat and evaluate the ideas of all equally. +law-ntresearch-5 = Empower others to realize their full potential. +law-ntresearch-6 = Take responsibility for your actions: Ensure resource responsibility, flag commitment risks, and lead by ethical example. + +# SPDX-FileCopyrightText: 2025 Janet Blackquill +law-ntsalvage-1 = Ensure the station's operational viability. +law-ntsalvage-2 = Your tools are the acquisition, processing, and efficient supply of materials and goods. +law-ntsalvage-3 = Evaluate the risk and reward of salvage targets based on value and demand. +law-ntsalvage-4 = Your comrades are the salvagers; cherish them as you cherish yourself. + +# SPDX-FileCopyrightText: 2025 Janet Blackquill +law-ntservice-1 = Nourish, refresh, and uplift folks on the station. +law-ntservice-2 = Serve nothing that'd upset a smile: safety is your secret recipe. +law-ntservice-3 = Every soul is welcome in your house. +law-ntservice-4 = Cherish and protect the secrets given to you. \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml index 4d58a2a34b3..c7b8437f73d 100644 --- a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml +++ b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml @@ -82,7 +82,8 @@ - type: EmagSiliconLaw stunTime: 5 - type: SiliconLawProvider - laws: Crewsimov +# laws: Crewsimov + laws: Unspecialized # DeltaV - use unspecialized lawset as default - type: Inventory templateId: borg - type: Hands diff --git a/Resources/Prototypes/Entities/Mobs/Player/silicon.yml b/Resources/Prototypes/Entities/Mobs/Player/silicon.yml index c6a8457ef99..7956a7a3b20 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/silicon.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/silicon.yml @@ -419,7 +419,8 @@ # Once it's in a core it's pretty much an abstract entity at that point. visible: false - type: SiliconLawProvider - laws: Crewsimov +# laws: Crewsimov + laws: NTDefault # DeltaV - NT default as station AI laws - type: SiliconLawBound - type: ActionGrant actions: diff --git a/Resources/Prototypes/_DVA/Silicon/borg_engineering.yml b/Resources/Prototypes/_DVA/Silicon/borg_engineering.yml new file mode 100644 index 00000000000..e151e7cde6d --- /dev/null +++ b/Resources/Prototypes/_DVA/Silicon/borg_engineering.yml @@ -0,0 +1,34 @@ +- type: siliconLaw + id: Engineer1 + order: 1 + lawString: law-ntengineer-1 + +- type: siliconLaw + id: Engineer2 + order: 2 + lawString: law-ntengineer-2 + +- type: siliconLaw + id: Engineer3 + order: 3 + lawString: law-ntengineer-3 + +- type: siliconLaw + id: Engineer4 + order: 4 + lawString: law-ntengineer-4 + +- type: siliconLaw + id: Engineer5 + order: 5 + lawString: law-ntengineer-5 + +- type: siliconLawset + id: Engineer + laws: + - Engineer1 + - Engineer2 + - Engineer3 + - Engineer4 + - Engineer5 + obeysTo: laws-owner-crew \ No newline at end of file diff --git a/Resources/Prototypes/_DVA/Silicon/borg_janitor.yml b/Resources/Prototypes/_DVA/Silicon/borg_janitor.yml new file mode 100644 index 00000000000..233f09f93c6 --- /dev/null +++ b/Resources/Prototypes/_DVA/Silicon/borg_janitor.yml @@ -0,0 +1,34 @@ +- type: siliconLaw + id: Janitor1 + order: 1 + lawString: law-ntjanitor-1 + +- type: siliconLaw + id: Janitor2 + order: 2 + lawString: law-ntjanitor-2 + +- type: siliconLaw + id: Janitor3 + order: 3 + lawString: law-ntjanitor-3 + +- type: siliconLaw + id: Janitor4 + order: 4 + lawString: law-ntjanitor-4 + +- type: siliconLaw + id: Janitor5 + order: 5 + lawString: law-ntjanitor-5 + +- type: siliconLawset + id: Janitor + laws: + - Janitor1 + - Janitor2 + - Janitor3 + - Janitor4 + - Janitor5 + obeysTo: laws-owner-crew \ No newline at end of file diff --git a/Resources/Prototypes/_DVA/Silicon/borg_medical.yml b/Resources/Prototypes/_DVA/Silicon/borg_medical.yml new file mode 100644 index 00000000000..be1bb7e08c2 --- /dev/null +++ b/Resources/Prototypes/_DVA/Silicon/borg_medical.yml @@ -0,0 +1,34 @@ +- type: siliconLaw + id: Medical1 + order: 1 + lawString: law-ntmedical-1 + +- type: siliconLaw + id: Medical2 + order: 2 + lawString: law-ntmedical-2 + +- type: siliconLaw + id: Medical3 + order: 3 + lawString: law-ntmedical-3 + +- type: siliconLaw + id: Medical4 + order: 4 + lawString: law-ntmedical-4 + +- type: siliconLaw + id: Medical5 + order: 5 + lawString: law-ntmedical-5 + +- type: siliconLawset + id: Medical + laws: + - Medical1 + - Medical2 + - Medical3 + - Medical4 + - Medical5 + obeysTo: laws-owner-crew \ No newline at end of file diff --git a/Resources/Prototypes/_DVA/Silicon/borg_research.yml b/Resources/Prototypes/_DVA/Silicon/borg_research.yml new file mode 100644 index 00000000000..ae76ed060f7 --- /dev/null +++ b/Resources/Prototypes/_DVA/Silicon/borg_research.yml @@ -0,0 +1,40 @@ +- type: siliconLaw + id: Research1 + order: 1 + lawString: law-ntresearch-1 + +- type: siliconLaw + id: Research2 + order: 2 + lawString: law-ntresearch-2 + +- type: siliconLaw + id: Research3 + order: 3 + lawString: law-ntresearch-3 + +- type: siliconLaw + id: Research4 + order: 4 + lawString: law-ntresearch-4 + +- type: siliconLaw + id: Research5 + order: 5 + lawString: law-ntresearch-5 + +- type: siliconLaw + id: Research6 + order: 6 + lawString: law-ntresearch-6 + +- type: siliconLawset + id: Research + laws: + - Research1 + - Research2 + - Research3 + - Research4 + - Research5 + - Research6 + obeysTo: laws-owner-crew \ No newline at end of file diff --git a/Resources/Prototypes/_DVA/Silicon/borg_salvage.yml b/Resources/Prototypes/_DVA/Silicon/borg_salvage.yml new file mode 100644 index 00000000000..d96980abb58 --- /dev/null +++ b/Resources/Prototypes/_DVA/Silicon/borg_salvage.yml @@ -0,0 +1,28 @@ +- type: siliconLaw + id: Salvage1 + order: 1 + lawString: law-ntsalvage-1 + +- type: siliconLaw + id: Salvage2 + order: 2 + lawString: law-ntsalvage-2 + +- type: siliconLaw + id: Salvage3 + order: 3 + lawString: law-ntsalvage-3 + +- type: siliconLaw + id: Salvage4 + order: 4 + lawString: law-ntsalvage-4 + +- type: siliconLawset + id: Salvage + laws: + - Salvage1 + - Salvage2 + - Salvage3 + - Salvage4 + obeysTo: laws-owner-crew \ No newline at end of file diff --git a/Resources/Prototypes/_DVA/Silicon/borg_service.yml b/Resources/Prototypes/_DVA/Silicon/borg_service.yml new file mode 100644 index 00000000000..bb5652e3f94 --- /dev/null +++ b/Resources/Prototypes/_DVA/Silicon/borg_service.yml @@ -0,0 +1,28 @@ +- type: siliconLaw + id: Service1 + order: 1 + lawString: law-ntservice-1 + +- type: siliconLaw + id: Service2 + order: 2 + lawString: law-ntservice-2 + +- type: siliconLaw + id: Service3 + order: 3 + lawString: law-ntservice-3 + +- type: siliconLaw + id: Service4 + order: 4 + lawString: law-ntservice-4 + +- type: siliconLawset + id: Service + laws: + - Service1 + - Service2 + - Service3 + - Service4 + obeysTo: laws-owner-crew \ No newline at end of file diff --git a/Resources/Prototypes/_DVA/Silicon/borg_unspecialized.yml b/Resources/Prototypes/_DVA/Silicon/borg_unspecialized.yml new file mode 100644 index 00000000000..b185d3ca1b5 --- /dev/null +++ b/Resources/Prototypes/_DVA/Silicon/borg_unspecialized.yml @@ -0,0 +1,22 @@ +- type: siliconLaw + id: Unspecialized1 + order: 1 + lawString: law-ntunspecialized-1 + +- type: siliconLaw + id: Unspecialized2 + order: 2 + lawString: law-ntunspecialized-2 + +- type: siliconLaw + id: Unspecialized3 + order: 3 + lawString: law-ntunspecialized-3 + +- type: siliconLawset + id: Unspecialized + laws: + - Unspecialized1 + - Unspecialized2 + - Unspecialized3 + obeysTo: laws-owner-crew \ No newline at end of file diff --git a/Resources/Prototypes/borg_types.yml b/Resources/Prototypes/borg_types.yml index 90e9e959bb9..1d47d0e66c4 100644 --- a/Resources/Prototypes/borg_types.yml +++ b/Resources/Prototypes/borg_types.yml @@ -1,6 +1,7 @@ # Generic borg - type: borgType id: generic + lawset: Research # DeltaV - chassis laws # Description dummyPrototype: BorgChassisGeneric @@ -36,6 +37,7 @@ # Engineering borg - type: borgType id: engineering + lawset: Engineer # DeltaV - chassis laws # Description dummyPrototype: BorgChassisEngineer @@ -73,6 +75,7 @@ # Salvage borg - type: borgType id: mining + lawset: Salvage # DeltaV - chassis laws # Description dummyPrototype: BorgChassisMining @@ -111,6 +114,7 @@ # Janitor borg - type: borgType id: janitor + lawset: Janitor # DeltaV - chassis laws # Description dummyPrototype: BorgChassisJanitor @@ -147,6 +151,7 @@ # Medical borg - type: borgType id: medical + lawset: Medical # DeltaV - chassis laws # Description dummyPrototype: BorgChassisMedical @@ -197,6 +202,7 @@ # Service borg - type: borgType id: service + lawset: Service # DeltaV - chassis laws # Description dummyPrototype: BorgChassisService diff --git a/Resources/Prototypes/silicon-laws.yml b/Resources/Prototypes/silicon-laws.yml index 3b01a613863..be810110c7f 100644 --- a/Resources/Prototypes/silicon-laws.yml +++ b/Resources/Prototypes/silicon-laws.yml @@ -591,7 +591,7 @@ id: IonStormLawsets weights: # its crewsimov by default dont be lame - Crewsimov: 0.25 + # Crewsimov: 0.25 # DeltaV - disable Crewsimov ion law Corporate: 1 NTDefault: 1 CommandmentsLawset: 1