]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Nuke Now Requires the Disk to be Inserted to Toggle Anchor (#29565)
authorCojoke <83733158+Cojoke-dot@users.noreply.github.com>
Mon, 9 Sep 2024 19:30:26 +0000 (14:30 -0500)
committerGitHub <noreply@github.com>
Mon, 9 Sep 2024 19:30:26 +0000 (13:30 -0600)
* Nuke Now Requires the Disk to be Inserted to Toggle Anchor

* message stating you need the disk to toggle floor bolts

Content.Client/Nuke/NukeMenu.xaml.cs
Content.Server/Nuke/NukeSystem.cs
Resources/Locale/en-US/nuke/nuke-component.ftl

index b498d0e3bbcb4b84489e034f0dd072e93b94179d..aa75758473304666a2771ab3719da9868f95f9d3 100644 (file)
@@ -107,7 +107,7 @@ namespace Content.Client.Nuke
             FirstStatusLabel.Text = firstMsg;
             SecondStatusLabel.Text = secondMsg;
 
-            EjectButton.Disabled = !state.DiskInserted || state.Status == NukeStatus.ARMED;
+            EjectButton.Disabled = !state.DiskInserted || state.Status == NukeStatus.ARMED || !state.IsAnchored;
             AnchorButton.Disabled = state.Status == NukeStatus.ARMED;
             AnchorButton.Pressed = state.IsAnchored;
             ArmButton.Disabled = !state.AllowArm || !state.IsAnchored;
index 109d790be1e975288852606513ab2f09534b1765..38c1070a8ab6f4c6315ecf44b40f38113196ed03 100644 (file)
@@ -167,12 +167,21 @@ public sealed class NukeSystem : EntitySystem
         if (component.Status == NukeStatus.ARMED)
             return;
 
+        // Nuke has to have the disk in it to be moved
+        if (!component.DiskSlot.HasItem)
+        {
+            var msg = Loc.GetString("nuke-component-cant-anchor-toggle");
+            _popups.PopupEntity(msg, uid, args.Actor, PopupType.MediumCaution);
+            return;
+        }
+
         // manually set transform anchor (bypassing anchorable)
         // todo: it will break pullable system
         var xform = Transform(uid);
         if (xform.Anchored)
         {
             _transform.Unanchor(uid, xform);
+            _itemSlots.SetLock(uid, component.DiskSlot, true);
         }
         else
         {
@@ -194,6 +203,7 @@ public sealed class NukeSystem : EntitySystem
 
             _transform.SetCoordinates(uid, xform, xform.Coordinates.SnapToGrid());
             _transform.AnchorEntity(uid, xform);
+            _itemSlots.SetLock(uid, component.DiskSlot, false);
         }
 
         UpdateUserInterface(uid, component);
index 981dd8b6ae37bb242d7599f76886dd9543f7076c..dfd56347ca33bb84af377a24cc87cc5ac74e2acb 100644 (file)
@@ -1,4 +1,5 @@
 nuke-component-cant-anchor-floor = The anchoring bolts fail to lock into the floor!
+nuke-component-cant-anchor-toggle = The nuclear authentication disk is required to toggle the floor bolts!
 nuke-component-announcement-sender = Nuclear Fission Explosive
 nuke-component-announcement-armed = Attention! The station's self-destruct mechanism has been engaged {$location}. {$time} seconds until detonation. If this was made in error, the mechanism may still be disarmed.
 nuke-component-announcement-unarmed = The station's self-destruct was deactivated! Have a nice day!