]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Various borg law fixes (#24870)
authorJajsha <101492056+Zap527@users.noreply.github.com>
Sat, 3 Feb 2024 02:29:40 +0000 (21:29 -0500)
committerGitHub <noreply@github.com>
Sat, 3 Feb 2024 02:29:40 +0000 (21:29 -0500)
* Various fixes

* Fix bad ordering with scrambled law orders

Content.Server/Silicons/Laws/SiliconLawSystem.cs
Content.Shared/Silicons/Laws/Components/IonStormTargetComponent.cs [moved from Content.Shared/Silicons/Laws/Components/IonStarmTargetComponent.cs with 100% similarity]
Resources/Locale/en-US/station-laws/laws.ftl

index 17a3d16413b3f8ef79a825c2fa903734d782c158..4584a9e88b5f740e5a7a29d7d71be658cd58fcdd 100644 (file)
@@ -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<EmaggedComponent>(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<EmagSiliconLawComponent>(uid, out var emag))
-            EnsureEmaggedRole(uid, emag);
+            // new laws may allow antagonist behaviour so make it clear for admins
+            if (TryComp<EmagSiliconLawComponent>(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
         });
     }
 
index 38e25d552f8ec8ea5679dc0f496943f2f95dc8f7..1823d0782e5241960eaad19e5c55de04e5855ea6 100644 (file)
@@ -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