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

@@ -128,8 +128,8 @@ namespace Content.Server.Nuke
private void CheckAnchorAttempt(EntityUid uid, NukeComponent component, BaseAnchoredAttemptEvent args)
{
// cancel any anchor attempt without nuke disk
if (!component.DiskSlot.HasItem)
// cancel any anchor attempt if armed
if (component.Status == NukeStatus.ARMED)
{
var msg = Loc.GetString("nuke-component-cant-anchor");
_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);
}
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
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");
_chatSystem.DispatchStationAnnouncement(uid, announcement, sender, false, Color.Red);
NukeArmedAudio(component);
_itemSlots.SetLock(uid, component.DiskSlot, true);
nukeXform.Anchored = true;
component.Status = NukeStatus.ARMED;
UpdateUserInterface(uid, component);
}