From: faint <46868845+ficcialfaint@users.noreply.github.com> Date: Sat, 28 Oct 2023 02:28:20 +0000 (+0300) Subject: Fix nukies sound not played (#21268) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=59176f7613a233641a074d35bd5e526446be74ab;p=space-station-14.git Fix nukies sound not played (#21268) * Play sound and sending greeting message works for nukies now!!!!! * oops * silly change --- diff --git a/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs b/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs index 4d3eee81e2..5be6820b97 100644 --- a/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs @@ -46,6 +46,7 @@ using Robust.Server.Player; using Robust.Shared.Audio; using Robust.Shared.Map; using Robust.Shared.Player; +using Robust.Shared.Players; using Robust.Shared.Prototypes; using Robust.Shared.Random; using Robust.Shared.Timing; @@ -334,7 +335,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem var eligibleQuery = EntityQueryEnumerator(); while (eligibleQuery.MoveNext(out var eligibleUid, out var eligibleComp, out var member)) { - if (!_npcFaction.IsFactionFriendly(component.Faction, eligibleUid, member)) + if (!_npcFaction.IsFactionHostile(component.Faction, eligibleUid, member)) continue; eligible.Add((eligibleUid, eligibleComp, member)); @@ -349,8 +350,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem var query = EntityQueryEnumerator(); while (query.MoveNext(out _, out var nukeops, out var actor)) { - _chatManager.DispatchServerMessage(actor.PlayerSession, Loc.GetString("nukeops-welcome", ("station", component.TargetStation.Value))); - _audio.PlayGlobal(nukeops.GreetSoundNotification, actor.PlayerSession); + NotifyNukie(actor.PlayerSession, nukeops, component); filter.AddPlayer(actor.PlayerSession); } } @@ -793,10 +793,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem if (nukeops.TargetStation != null && !string.IsNullOrEmpty(Name(nukeops.TargetStation.Value))) { - _chatManager.DispatchServerMessage(playerSession, Loc.GetString("nukeops-welcome", ("station", nukeops.TargetStation.Value))); - - // Notificate player about new role assignment - _audio.PlayGlobal(component.GreetSoundNotification, playerSession); + NotifyNukie(playerSession, component, nukeops); } } } @@ -994,6 +991,18 @@ public sealed class NukeopsRuleSystem : GameRuleSystem SpawnOperatives(numNukies, operatives, true, component); } + /// + /// Display a greeting message and play a sound for a nukie + /// + private void NotifyNukie(ICommonSession session, NukeOperativeComponent nukeop, NukeopsRuleComponent nukeopsRule) + { + if (nukeopsRule.TargetStation is not { } station) + return; + + _chatManager.DispatchServerMessage(session, Loc.GetString("nukeops-welcome", ("station", station))); + _audio.PlayGlobal(nukeop.GreetSoundNotification, session); + } + //For admins forcing someone to nukeOps. public void MakeLoneNukie(EntityUid mindId, MindComponent mind) { diff --git a/Resources/Locale/en-US/administration/antag.ftl b/Resources/Locale/en-US/administration/antag.ftl index 3d098c1c54..f3b3d91945 100644 --- a/Resources/Locale/en-US/administration/antag.ftl +++ b/Resources/Locale/en-US/administration/antag.ftl @@ -1,7 +1,7 @@ verb-categories-antag = Antag ctrl admin-verb-make-traitor = Make the target into a traitor. admin-verb-make-zombie = Zombifies the target immediately. -admin-verb-make-nuclear-operative = Make target a into lone Nuclear Operative. +admin-verb-make-nuclear-operative = Make target into a lone Nuclear Operative. admin-verb-make-pirate = Make the target into a pirate. Note this doesn't configure the game rule. admin-verb-make-head-rev = Make the target into a Head Revolutionary.