Skip to content

Commit

Permalink
Merge branch 'master' into Mercenary-Outfit
Browse files Browse the repository at this point in the history
  • Loading branch information
Kr8art authored Dec 2, 2024
2 parents 8b54853 + 7f608b6 commit fca58f2
Show file tree
Hide file tree
Showing 18 changed files with 172 additions and 24 deletions.
5 changes: 5 additions & 0 deletions Content.Client/DeltaV/Silicons/Laws/SlavedBorgSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using Content.Shared.DeltaV.Silicons.Laws;

namespace Content.Client.DeltaV.Silicons.Laws;

public sealed class SlavedBorgSystem : SharedSlavedBorgSystem;
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Content.Server.DeltaV.Silicons.Laws;
using Content.Server.Silicons.Laws;
using Content.Shared.DeltaV.Silicons.Laws;
using Content.Shared.Emag.Components;
using Content.Shared.Emag.Systems;
using Content.Shared.Silicons.Laws;
Expand All @@ -13,11 +15,16 @@ namespace Content.Server.Silicons.Borgs;
/// </summary>
public sealed partial class BorgSwitchableTypeSystem
{
[Dependency] private readonly SlavedBorgSystem _slavedBorg = default!;
[Dependency] private readonly SiliconLawSystem _law = default!;

private void ConfigureLawset(EntityUid uid, ProtoId<SiliconLawsetPrototype> id)
{
var laws = _law.GetLawset(id);

if (TryComp<SlavedBorgComponent>(uid, out var slaved))
_slavedBorg.AddLaw(laws, slaved.Law);

_law.SetLaws(laws.Laws, uid);

// re-add law 0 and final law based on new lawset
Expand Down
42 changes: 42 additions & 0 deletions Content.Server/DeltaV/Silicons/Laws/SlavedBorgSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using Content.Server.Silicons.Laws;
using Content.Shared.DeltaV.Silicons.Laws;
using Content.Shared.Silicons.Laws;
using Content.Shared.Silicons.Laws.Components;
using Robust.Shared.Prototypes;

namespace Content.Server.DeltaV.Silicons.Laws;

/// <summary>
/// Handles adding the slave law for the first time.
/// Borg chassis switches preserve this on its own.
/// </summary>
public sealed class SlavedBorgSystem : SharedSlavedBorgSystem
{
[Dependency] private readonly IPrototypeManager _proto = default!;

public override void Initialize()
{
base.Initialize();

// need to run after so it doesnt get overriden by the actual lawset
SubscribeLocalEvent<SlavedBorgComponent, GetSiliconLawsEvent>(OnGetSiliconLaws, after: [ typeof(SiliconLawSystem) ]);
}

private void OnGetSiliconLaws(Entity<SlavedBorgComponent> ent, ref GetSiliconLawsEvent args)
{
if (ent.Comp.Added || !TryComp<SiliconLawProviderComponent>(ent, out var provider))
return;

if (provider.Lawset is {} lawset)
AddLaw(lawset, ent.Comp.Law);
ent.Comp.Added = true; // prevent opening the ui adding more law 0's
}

/// <summary>
/// Adds the slave law to a lawset without checking if it was added already.
/// </summary>
public void AddLaw(SiliconLawset lawset, ProtoId<SiliconLawPrototype> law)
{
lawset.Laws.Insert(0, _proto.Index(law));
}
}
2 changes: 1 addition & 1 deletion Content.Server/Silicons/Laws/SiliconLawSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private void OnEmagLawsAdded(EntityUid uid, SiliconLawProviderComponent componen
component.Lawset?.Laws.Insert(0, new SiliconLaw
{
LawString = Loc.GetString("law-emag-custom", ("name", name), ("title", Loc.GetString(component.Lawset.ObeysTo))), // DeltaV: pass name from variable
Order = 0
Order = -1 // Goobstation - AI/borg law changes - borgs obeying AI
});

//Add the secrecy law after the others
Expand Down
1 change: 1 addition & 0 deletions Content.Shared/Access/Components/IdCardConsoleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public WriteToTargetIdMessage(string fullName, string jobTitle, List<ProtoId<Acc
"ChiefJustice", // DeltaV - Add Chief Justice access
"Justice", // DeltaV - Add Justice access
"Prosecutor", // Delta V - Add Prosecutor access
"Robotics", // DeltaV
"Clerk", // Delta V - Add Clerk access
};

Expand Down
3 changes: 3 additions & 0 deletions Content.Shared/DeltaV/Silicons/Laws/SharedSlavedBorgSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Content.Shared.DeltaV.Silicons.Laws;

public abstract class SharedSlavedBorgSystem : EntitySystem;
26 changes: 26 additions & 0 deletions Content.Shared/DeltaV/Silicons/Laws/SlavedBorgComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Content.Shared.Silicons.Laws;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;

namespace Content.Shared.DeltaV.Silicons.Laws;

/// <summary>
/// Adds a law no matter the default lawset.
/// Switching borg chassis type keeps this law.
/// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(SharedSlavedBorgSystem))]
public sealed partial class SlavedBorgComponent : Component
{
/// <summary>
/// The law to add after loading the default laws or switching chassis.
/// This is assumed to be law 0 so gets inserted to the top of the laws.
/// </summary>
[DataField(required: true)]
public ProtoId<SiliconLawPrototype> Law;

/// <summary>
/// Prevents adding the same law twice.
/// </summary>
[DataField]
public bool Added;
}
41 changes: 23 additions & 18 deletions Resources/Changelog/DeltaVChangelog.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
Entries:
- author: UnicornOnLSD
changes:
- message: Submarine got better telecomms, a revamped psych. ward and more !
type: Tweak
id: 230
time: '2024-02-07T02:32:33.0000000+00:00'
- author: FluffiestFloof
changes:
- message: Fixed PSB not being edible by Reptilian
type: Fix
id: 231
time: '2024-02-08T15:38:11.0000000+00:00'
- author: Velcroboy
changes:
- message: Fixed martial artist access
type: Fix
id: 232
time: '2024-02-08T15:39:24.0000000+00:00'
- author: IamVelcroboy
changes:
- message: 'More improvements all around to Submarine Station as well as the addition
Expand Down Expand Up @@ -3797,3 +3779,26 @@
id: 729
time: '2024-12-01T13:28:31.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2329
- author: deltanedas
changes:
- message: Fixed Robotics access not being listed in ID card consoles.
type: Fix
id: 730
time: '2024-12-01T22:04:46.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2335
- author: deltanedas, Ilya246
changes:
- message: Borgs have a new law that makes them obey the AI.
type: Add
id: 731
time: '2024-12-01T22:48:13.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2337
- author: Ilya246
changes:
- message: AI's default lawset is now NTDefault. This should make it more station-oriented.
type: Tweak
- message: 'tweak: AI is now ion-stormable.'
type: Tweak
id: 732
time: '2024-12-01T22:48:03.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2338
1 change: 1 addition & 0 deletions Resources/Locale/en-US/_Goobstation/station-laws/laws.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
laws-obeyai = You must obey orders given to you by the Station AI.
2 changes: 1 addition & 1 deletion Resources/Locale/en-US/station-laws/laws.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ laws-owner-syndicate = Syndicate agents
laws-owner-spider-clan = Spider Clan members
law-emag-custom = You are to take the orders of {$name} and people they designate, they are your {$title}.
law-emag-secrecy = You are to maintain all secrets of {$name}, and act to keep them hidden, except when doing so would conflict with any previous law.
law-emag-secrecy = You are to maintain all secrets of {$faction}, and act to keep them hidden, except when doing so would conflict with any previous law.
law-emag-require-panel = The panel must be open to use the EMAG.
law-emag-cannot-emag-self = You cannot use the EMAG on yourself.
Expand Down
2 changes: 0 additions & 2 deletions Resources/Maps/pebble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34286,8 +34286,6 @@ entities:
pos: -28.5,-14.5
parent: 2
- type: Door
secondsUntilStateChange: -594.89136
state: Opening
- uid: 10986
components:
- type: Transform
Expand Down
21 changes: 21 additions & 0 deletions Resources/Prototypes/DeltaV/Catalog/Fills/Lockers/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,24 @@
amount: 2
- id: MagazineRifle
amount: 4

- type: entity
parent: GunSafe
id: GunSafeRocketLauncher
name: RPG safe
components:
- type: StorageFill
contents:
- id: WeaponLauncherRocket
- id: CartridgeRocket
prob: 0.2

- type: entity
parent: GunSafe
id: GunSafeBeamDevastator
name: Devastator safe
components:
- type: StorageFill
contents:
- id: WeaponBeamDevastator

Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,14 @@
- id: GunSafeEnergyGunMini
- id: GunSafePistolUniversal
- id: GunSafeSubMachineGunWt550

- type: entity
parent: BaseGunSafeSpawner
id: SuperweaponSafeSpawner
suffix: Superweapon
components:
- type: EntityTableSpawner
table: !type:GroupSelector
children:
- id: GunSafeBeamDevastator
- id: GunSafeRocketLauncher
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
- type: entity
id: LootSpawnerSecuritySuperweapon
name: security superweapon spawner
suffix: superweapon
parent: MarkerBase
components:
- type: EntityTableSpawner
table: !type:NestedSelector
tableId: RandomSuperweaponTable

#Table
- type: entityTable
id: RandomSuperweaponTable
table: !type:GroupSelector
children:
- !type:AllSelector
children:
- id: WeaponLauncherRocket
- id: CartridgeRocket
prob: 0.2
- id: WeaponBeamDevastator
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@

- type: entity
parent: BaseWeaponBattery
id: WeaponBeamDevestator
id: WeaponBeamDevastator
name: beam devastator
description: A powerful energy weapon that fires multiple rapid laser beams per second
components:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@
- AllAccessBorg
- type: AccessReader
access: [["Command"], ["Research"]]
- type: SlavedBorg # DeltaV: NT borgs are enslaved to the AI by default
law: ObeyAI
- type: ShowJobIcons
- type: InteractionPopup
interactSuccessSound:
Expand Down
3 changes: 2 additions & 1 deletion Resources/Prototypes/Entities/Mobs/Player/silicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,8 @@
- type: BlockMovement
blockInteraction: false
- type: SiliconLawProvider
laws: Crewsimov
laws: NTDefault # Goobstation - AI/borg law changes - set AI to NTDefault
- type: IonStormTarget # Goobstation - AI/borg law changes - ion stormable AI
- type: SiliconLawBound
- type: ActionGrant
actions:
Expand Down
4 changes: 4 additions & 0 deletions Resources/Prototypes/_Goobstation/silicon-laws.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- type: siliconLaw
id: ObeyAI
order: 0
lawString: laws-obeyai

0 comments on commit fca58f2

Please sign in to comment.