More nukie tweaks (#9618)

This commit is contained in:
Kara
2022-07-11 00:29:51 -07:00
committed by GitHub
parent eb22cfbe43
commit 81a6f16591
3 changed files with 12 additions and 5 deletions

View File

@@ -104,7 +104,7 @@ namespace Content.Client.Nuke
SecondStatusLabel.Text = secondMsg; SecondStatusLabel.Text = secondMsg;
EjectButton.Disabled = !state.DiskInserted || state.Status == NukeStatus.ARMED; EjectButton.Disabled = !state.DiskInserted || state.Status == NukeStatus.ARMED;
AnchorButton.Disabled = !state.DiskInserted; AnchorButton.Disabled = state.Status == NukeStatus.ARMED;
AnchorButton.Pressed = state.IsAnchored; AnchorButton.Pressed = state.IsAnchored;
ArmButton.Disabled = !state.AllowArm; ArmButton.Disabled = !state.AllowArm;
} }

View File

@@ -128,8 +128,8 @@ namespace Content.Server.Nuke
private void CheckAnchorAttempt(EntityUid uid, NukeComponent component, BaseAnchoredAttemptEvent args) private void CheckAnchorAttempt(EntityUid uid, NukeComponent component, BaseAnchoredAttemptEvent args)
{ {
// cancel any anchor attempt without nuke disk // cancel any anchor attempt if armed
if (!component.DiskSlot.HasItem) if (component.Status == NukeStatus.ARMED)
{ {
var msg = Loc.GetString("nuke-component-cant-anchor"); var msg = Loc.GetString("nuke-component-cant-anchor");
_popups.PopupEntity(msg, uid, Filter.Entities(args.User)); _popups.PopupEntity(msg, uid, Filter.Entities(args.User));
@@ -422,15 +422,22 @@ namespace Content.Server.Nuke
_alertLevel.SetLevel(stationUid.Value, component.AlertLevelOnActivate, true, true, true, true); _alertLevel.SetLevel(stationUid.Value, component.AlertLevelOnActivate, true, true, true, true);
} }
var nukeXform = Transform(uid);
var pos = nukeXform.MapPosition;
var x = (int) pos.X;
var y = (int) pos.Y;
var posText = $"({x}, {y})";
// warn a crew // warn a crew
var announcement = Loc.GetString("nuke-component-announcement-armed", var announcement = Loc.GetString("nuke-component-announcement-armed",
("time", (int) component.RemainingTime)); ("time", (int) component.RemainingTime), ("position", posText));
var sender = Loc.GetString("nuke-component-announcement-sender"); var sender = Loc.GetString("nuke-component-announcement-sender");
_chatSystem.DispatchStationAnnouncement(uid, announcement, sender, false, Color.Red); _chatSystem.DispatchStationAnnouncement(uid, announcement, sender, false, Color.Red);
NukeArmedAudio(component); NukeArmedAudio(component);
_itemSlots.SetLock(uid, component.DiskSlot, true); _itemSlots.SetLock(uid, component.DiskSlot, true);
nukeXform.Anchored = true;
component.Status = NukeStatus.ARMED; component.Status = NukeStatus.ARMED;
UpdateUserInterface(uid, component); UpdateUserInterface(uid, component);
} }

View File

@@ -1,6 +1,6 @@
nuke-component-cant-anchor = The bolts seems to be blocked without disk! nuke-component-cant-anchor = The bolts seems to be blocked without disk!
nuke-component-announcement-sender = Nuclear Fission Explosive nuke-component-announcement-sender = Nuclear Fission Explosive
nuke-component-announcement-armed = Attention! The station's self-destruct mechanism has been engaged. {$time} seconds until detonation. nuke-component-announcement-armed = Attention! The station's self-destruct mechanism has been engaged at global coordinates {$position}. {$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! nuke-component-announcement-unarmed = The station's self-destruct was deactivated! Have a nice day!
nuke-component-announcement-send-codes = Attention! Requested self-destruction codes was sent to communication consoles. nuke-component-announcement-send-codes = Attention! Requested self-destruction codes was sent to communication consoles.
nuke-component-doafter-warning = You start fiddling with wires and knobs in order to disarm the nuke.. This may take a while. nuke-component-doafter-warning = You start fiddling with wires and knobs in order to disarm the nuke.. This may take a while.