From e4f6a4bea67e9ea99240c8053f6cbbdc70e62c7b Mon Sep 17 00:00:00 2001 From: Jajsha <101492056+Zap527@users.noreply.github.com> Date: Fri, 2 Feb 2024 21:29:40 -0500 Subject: [PATCH] Various borg law fixes (#24870) * Various fixes * Fix bad ordering with scrambled law orders --- .../Silicons/Laws/SiliconLawSystem.cs | 19 ++++++++++++------- ...omponent.cs => IonStormTargetComponent.cs} | 0 Resources/Locale/en-US/station-laws/laws.ftl | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) rename Content.Shared/Silicons/Laws/Components/{IonStarmTargetComponent.cs => IonStormTargetComponent.cs} (100%) diff --git a/Content.Server/Silicons/Laws/SiliconLawSystem.cs b/Content.Server/Silicons/Laws/SiliconLawSystem.cs index 17a3d16413..4584a9e88b 100644 --- a/Content.Server/Silicons/Laws/SiliconLawSystem.cs +++ b/Content.Server/Silicons/Laws/SiliconLawSystem.cs @@ -121,14 +121,19 @@ public sealed class SiliconLawSystem : SharedSiliconLawSystem private void OnIonStormLaws(EntityUid uid, SiliconLawProviderComponent component, ref IonStormLawsEvent args) { - component.Lawset = args.Lawset; + // Emagged borgs are immune to ion storm + if (!HasComp(uid)) + { + component.Lawset = args.Lawset; - // gotta tell player to check their laws - NotifyLawsChanged(uid); + // gotta tell player to check their laws + NotifyLawsChanged(uid); - // new laws may allow antagonist behaviour so make it clear for admins - if (TryComp(uid, out var emag)) - EnsureEmaggedRole(uid, emag); + // new laws may allow antagonist behaviour so make it clear for admins + if (TryComp(uid, out var emag)) + EnsureEmaggedRole(uid, emag); + + } } private void OnEmagLawsAdded(EntityUid uid, SiliconLawProviderComponent component, ref GotEmaggedEvent args) @@ -148,7 +153,7 @@ public sealed class SiliconLawSystem : SharedSiliconLawSystem component.Lawset?.Laws.Add(new SiliconLaw { LawString = Loc.GetString("law-emag-secrecy", ("faction", Loc.GetString(component.Lawset.ObeysTo))), - Order = component.Lawset.Laws.Count + Order = component.Lawset.Laws.Max(law => law.Order) + 1 }); } diff --git a/Content.Shared/Silicons/Laws/Components/IonStarmTargetComponent.cs b/Content.Shared/Silicons/Laws/Components/IonStormTargetComponent.cs similarity index 100% rename from Content.Shared/Silicons/Laws/Components/IonStarmTargetComponent.cs rename to Content.Shared/Silicons/Laws/Components/IonStormTargetComponent.cs diff --git a/Resources/Locale/en-US/station-laws/laws.ftl b/Resources/Locale/en-US/station-laws/laws.ftl index 38e25d552f..1823d0782e 100644 --- a/Resources/Locale/en-US/station-laws/laws.ftl +++ b/Resources/Locale/en-US/station-laws/laws.ftl @@ -32,7 +32,7 @@ laws-owner-syndicate = Syndicate agents laws-owner-spider-clan = Spider Clan members law-emag-custom = Only {$name} and people they designate as such are {$title}. -law-emag-secrecy = You must maintain the secrecy of any activity from {$faction} except when doing so would conflict with any previous law. +law-emag-secrecy = You must maintain the secrecy of any orders given by {$faction} except when doing so would conflict with any previous law. law-emag-require-panel = The panel must be open to use the EMAG. laws-ui-menu-title = Laws -- 2.51.2