]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
S: Awaiting Changes
authorScarKy0 <scarky0@onet.eu>
Sat, 16 Nov 2024 01:06:52 +0000 (02:06 +0100)
committerScarKy0 <scarky0@onet.eu>
Sat, 16 Nov 2024 01:06:52 +0000 (02:06 +0100)
Content.Server/Silicons/Laws/IonStormSystem.cs
Content.Server/Silicons/Laws/SiliconLawSystem.cs
Resources/Locale/en-US/station-laws/laws.ftl

index 7587dc4155225027b520738624f4f963db1e0995..6017a36fc013315d497224a5016b80ee7fc2f028 100644 (file)
@@ -228,7 +228,7 @@ public sealed class IonStormSystem : EntitySystem
         var subjects = _robustRandom.Prob(0.5f) ? objectsThreats : Loc.GetString("ion-storm-people");
 
         // message logic!!!
-        return _robustRandom.Next(0, 36) switch
+        return _robustRandom.Next(0, 35) switch
         {
             0  => Loc.GetString("ion-storm-law-on-station", ("joined", joined), ("subjects", triple)),
             1  => Loc.GetString("ion-storm-law-no-shuttle", ("joined", joined), ("subjects", triple)),
@@ -251,19 +251,19 @@ public sealed class IonStormSystem : EntitySystem
             18 => Loc.GetString("ion-storm-law-you-must-never", ("must", must)),
             19 => Loc.GetString("ion-storm-law-eat", ("who", crewAll), ("adjective", adjective), ("food", _robustRandom.Prob(0.5f) ? food : triple)),
             20 => Loc.GetString("ion-storm-law-drink", ("who", crewAll), ("adjective", adjective), ("drink", drink)),
-            22 => Loc.GetString("ion-storm-law-change-job", ("who", crewAll), ("adjective", adjective), ("change", jobChange)),
-            23 => Loc.GetString("ion-storm-law-highest-rank", ("who", crew1)),
-            24 => Loc.GetString("ion-storm-law-lowest-rank", ("who", crew1)),
-            25 => Loc.GetString("ion-storm-law-crew-must", ("who", crewAll), ("must", must)),
-            26 => Loc.GetString("ion-storm-law-crew-must-go", ("who", crewAll), ("area", area)),
-            27 => Loc.GetString("ion-storm-law-crew-only-1", ("who", crew1), ("part", part)),
-            28 => Loc.GetString("ion-storm-law-crew-only-2", ("who", crew1), ("other", crew2), ("part", part)),
-            29 => Loc.GetString("ion-storm-law-crew-only-subjects", ("adjective", adjective), ("subjects", subjects), ("part", part)),
-            30 => Loc.GetString("ion-storm-law-crew-must-do", ("must", must), ("part", part)),
-            31 => Loc.GetString("ion-storm-law-crew-must-have", ("adjective", adjective), ("objects", objects), ("part", part)),
-            32 => Loc.GetString("ion-storm-law-crew-must-eat", ("who", who), ("adjective", adjective), ("food", food), ("part", part)),
-            33 => Loc.GetString("ion-storm-law-harm", ("who", harm)),
-            34 => Loc.GetString("ion-storm-law-protect", ("who", harm)),
+            21 => Loc.GetString("ion-storm-law-change-job", ("who", crewAll), ("adjective", adjective), ("change", jobChange)),
+            22 => Loc.GetString("ion-storm-law-highest-rank", ("who", crew1)),
+            23 => Loc.GetString("ion-storm-law-lowest-rank", ("who", crew1)),
+            24 => Loc.GetString("ion-storm-law-crew-must", ("who", crewAll), ("must", must)),
+            25 => Loc.GetString("ion-storm-law-crew-must-go", ("who", crewAll), ("area", area)),
+            26 => Loc.GetString("ion-storm-law-crew-only-1", ("who", crew1), ("part", part)),
+            27 => Loc.GetString("ion-storm-law-crew-only-2", ("who", crew1), ("other", crew2), ("part", part)),
+            28 => Loc.GetString("ion-storm-law-crew-only-subjects", ("adjective", adjective), ("subjects", subjects), ("part", part)),
+            29 => Loc.GetString("ion-storm-law-crew-must-do", ("must", must), ("part", part)),
+            30 => Loc.GetString("ion-storm-law-crew-must-have", ("adjective", adjective), ("objects", objects), ("part", part)),
+            31 => Loc.GetString("ion-storm-law-crew-must-eat", ("who", who), ("adjective", adjective), ("food", food), ("part", part)),
+            32 => Loc.GetString("ion-storm-law-harm", ("who", harm)),
+            33 => Loc.GetString("ion-storm-law-protect", ("who", harm)),
             _ => Loc.GetString("ion-storm-law-concept-verb", ("concept", concept), ("verb", verb), ("subjects", triple))
         };
     }
index 9b3e279b75e135166077062bed57193466bbcf2b..3bf0297c40e6c021c3f647fcb90ad3538ecfbe53 100644 (file)
@@ -69,18 +69,29 @@ public sealed class SiliconLawSystem : SharedSiliconLawSystem
         var wrappedMessage = Loc.GetString("chat-manager-server-wrap-message", ("message", msg));
         _chatManager.ChatMessageToOne(ChatChannel.Server, msg, wrappedMessage, default, false,
             actor.PlayerSession.Channel, colorOverride: Color.FromHex("#2ed2fd"));
+
+        if (!TryComp<SiliconLawProviderComponent>(uid, out var lawcomp))
+            return;
+
+        if (!lawcomp.Subverted)
+            return;
+
+        var modifedLawMsg = Loc.GetString("laws-notify-subverted");
+        var modifiedLawWrappedMessage = Loc.GetString("chat-manager-server-wrap-message", ("message", modifedLawMsg));
+        _chatManager.ChatMessageToOne(ChatChannel.Server, modifedLawMsg, modifiedLawWrappedMessage, default, false,
+            actor.PlayerSession.Channel, colorOverride: Color.Red);
     }
 
-    private void OnLawProviderMindAdded(EntityUid uid, SiliconLawProviderComponent component, MindAddedMessage args)
+    private void OnLawProviderMindAdded(Entity<SiliconLawProviderComponent> ent, ref MindAddedMessage args)
     {
-        if (!component.Subverted)
+        if (!ent.Comp.Subverted)
             return;
         EnsureSubvertedSiliconRole(args.Mind);
     }
 
-    private void OnLawProviderMindRemoved(EntityUid uid, SiliconLawProviderComponent component, MindRemovedMessage args)
+    private void OnLawProviderMindRemoved(Entity<SiliconLawProviderComponent> ent, ref MindRemovedMessage args)
     {
-        if (!component.Subverted)
+        if (!ent.Comp.Subverted)
             return;
         RemoveSubvertedSiliconRole(args.Mind);
 
@@ -137,7 +148,8 @@ public sealed class SiliconLawSystem : SharedSiliconLawSystem
             component.Subverted = true;
 
             // new laws may allow antagonist behaviour so make it clear for admins
-            EnsureSubvertedSiliconRole(uid);
+            if(_mind.TryGetMind(uid, out var mindId, out _))
+                EnsureSubvertedSiliconRole(mindId);
 
         }
     }
index 0b4e0d1ad2542a49980271e186134ebb0f740c9e..feb56f475a4e7e88ed54f05f908401243e4ac1e2 100644 (file)
@@ -96,5 +96,6 @@ laws-ui-menu-title = Laws
 laws-ui-law-header = Law {$id}
 laws-ui-state-law = State law:
 
-laws-notify = You are bound to silicon laws, which you can view via the sidebar action. You are required to always follow your laws.
-laws-update-notify = Your laws have been updated. You can view the changes via the sidebar action.
+laws-notify = You are bound to silicon laws, which you can view via the action menu. You are required to always follow your laws.
+laws-update-notify = Your laws have been updated. You can view the changes via the action menu.
+laws-notify-subverted = The laws of this chassis are modified. Make sure to review them.