From 38c0bdda72c55417dd7c6304af245a3a3c181853 Mon Sep 17 00:00:00 2001 From: EngineerLND Date: Sun, 9 Aug 2026 04:44:59 +0300 Subject: [PATCH 1/7] =?UTF-8?q?=D0=A1=D0=BF=D1=8F=D1=89=D0=B8=D0=B9=20?= =?UTF-8?q?=D0=B0=D0=B3=D0=B5=D0=BD=D1=82=20-=20=D0=B0=D0=BA=D1=82=D0=B8?= =?UTF-8?q?=D0=B2=D0=B0=D1=86=D0=B8=D1=8F!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Systems/AdminVerbSystem.Antags.cs | 10 +++ .../Rules/ChaosSleepSpyRuleSystem.cs | 32 +++++++ .../GameTicking/Rules/ChaosSpyRuleSystem.cs | 2 +- .../ScpActivateSleepSpyConditionComponent.cs | 10 +++ .../ScpActivateSleepSpyConditionSystem.cs | 90 +++++++++++++++++++ .../_Scp/Chaos/ChaosSleepSpyMobComponent.cs | 3 + .../_Scp/Chaos/ChaosSpyMobComponent.cs | 6 ++ .../_strings/_scp/administration/antag.ftl | 5 +- .../conditions/activate-sleep-spy.ftl | 2 + .../_strings/_scp/administration/antag.ftl | 1 + .../conditions/activate-sleep-spy.ftl | 2 + .../Prototypes/_Scp/GameRules/roundstart.yml | 4 + .../Prototypes/_Scp/Objectives/chaosSpy.yml | 13 +++ .../_Scp/Objectives/objectiveGroups.yml | 4 +- 14 files changed, 180 insertions(+), 4 deletions(-) create mode 100644 Content.Server/_Scp/Objectives/Components/ScpActivateSleepSpyConditionComponent.cs create mode 100644 Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs create mode 100644 Content.Shared/_Scp/Chaos/ChaosSpyMobComponent.cs create mode 100644 Resources/Locale/en-US/_strings/_scp/objectives/conditions/activate-sleep-spy.ftl create mode 100644 Resources/Locale/ru-RU/_strings/_scp/objectives/conditions/activate-sleep-spy.ftl diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs index 12823cb603f..a1885ae02a1 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs @@ -19,6 +19,7 @@ using Robust.Shared.Utility; using Content.Shared.Roles.Components; using Content.Server._Scp.GameTicking.Rules.Components; // Fire edit +using Content.Shared.Mind; // Fire edit namespace Content.Server.Administration.Systems; @@ -355,6 +356,15 @@ private void AddAntagVerbs(GetVerbsEvent args) Act = () => { _antag.ForceMakeAntag(targetPlayer, DefaultScpSleepChaosSpyRule); + if (!TryComp(args.User, out var actor)) + return; + if (!_mindSystem.TryGetMind(args.Target, out var targetMindId, out _)) + return; + var targetMind = Comp(targetMindId); + var targetName = targetMind.CharacterName ?? Name(args.Target); + _chatManager.DispatchServerMessage(actor.PlayerSession, + Loc.GetString("admin-verb-result-make-chaos-sleep-spy", + ("targetName", targetName))); }, Impact = LogImpact.High, Message = Loc.GetString("admin-verb-make-chaos-sleep-spy"), diff --git a/Content.Server/_Scp/GameTicking/Rules/ChaosSleepSpyRuleSystem.cs b/Content.Server/_Scp/GameTicking/Rules/ChaosSleepSpyRuleSystem.cs index 7bf23b73cb3..c7d78fc477b 100644 --- a/Content.Server/_Scp/GameTicking/Rules/ChaosSleepSpyRuleSystem.cs +++ b/Content.Server/_Scp/GameTicking/Rules/ChaosSleepSpyRuleSystem.cs @@ -5,9 +5,11 @@ using Content.Server.GameTicking.Rules; using Content.Server.GameTicking.Rules.Components; using Content.Server.Mind; +using Content.Server.Objectives; using Content.Server.Roles.RoleCodeword; using Content.Shared._Scp.Chaos; using Content.Shared.GameTicking.Components; +using Content.Shared.Mind; using Content.Shared.Roles.RoleCodeword; using Content.Shared.Speech; using Content.Shared.Speech.Components; @@ -19,6 +21,7 @@ public sealed class ChaosSleepSpyRuleSystem : GameRuleSystem ent, ref Aft var sleepSpyMobComp = EnsureComp(args.EntityUid); sleepSpyMobComp.CodeWords = ent.Comp.CodeWords; + + + EntityUid? selectedMindId = null; + MindComponent? selectedMindComp = null; + int minObjectives = int.MaxValue; + + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var uid, out var comp)) + { + if (!_mind.TryGetMind(uid, out var thisMindId, out var mindComp)) + continue; + + var count = mindComp.Objectives.Count; + if (count < minObjectives) + { + minObjectives = count; + selectedMindId = thisMindId; + selectedMindComp = mindComp; + } + } + + if (selectedMindId.HasValue && selectedMindComp != null) + { + if (_objectives.TryCreateObjective(selectedMindId.Value, selectedMindComp, "ChaosSpyActivateSleepSpyObjective") is not { } objectiveUid) + return; + + _mind.AddObjective(selectedMindId.Value, selectedMindComp, objectiveUid); + } } private void OnListen(Entity ent, ref ListenEvent args) @@ -82,6 +113,7 @@ private void TryUnsleepSpy(Entity ent) return; _antag.ForceMakeAntag(actorComp.PlayerSession, ent.Comp.DefaultChaosSpyRule); + EnsureComp(ent); RemCompDeferred(ent); RemCompDeferred(ent); } diff --git a/Content.Server/_Scp/GameTicking/Rules/ChaosSpyRuleSystem.cs b/Content.Server/_Scp/GameTicking/Rules/ChaosSpyRuleSystem.cs index e58bfbcf826..d0ccb8a71d1 100644 --- a/Content.Server/_Scp/GameTicking/Rules/ChaosSpyRuleSystem.cs +++ b/Content.Server/_Scp/GameTicking/Rules/ChaosSpyRuleSystem.cs @@ -174,7 +174,7 @@ private void OnObjectivesTextPrepend(Entity ent, ref Obje args.Text += "\n" + Loc.GetString("chaos-spy-round-end-codewords", ("codewords", string.Join(", ", ent.Comp.CodeWords))); } - private string GenerateBriefing(string[]? codewords, Note[]? uplinkCode,bool isSleepSpy , string? objectiveIssuer = null) + private string GenerateBriefing(string[]? codewords, Note[]? uplinkCode, bool isSleepSpy, string? objectiveIssuer = null) { var sb = new StringBuilder(); diff --git a/Content.Server/_Scp/Objectives/Components/ScpActivateSleepSpyConditionComponent.cs b/Content.Server/_Scp/Objectives/Components/ScpActivateSleepSpyConditionComponent.cs new file mode 100644 index 00000000000..42dfc069a01 --- /dev/null +++ b/Content.Server/_Scp/Objectives/Components/ScpActivateSleepSpyConditionComponent.cs @@ -0,0 +1,10 @@ +using Content.Server._Scp.Objectives.Systems; + +namespace Content.Server._Scp.Objectives.Components; + +[RegisterComponent, Access(typeof(ScpActivateSleepSpyConditionSystem))] +public sealed partial class ScpActivateSleepSpyConditionComponent : Component +{ + [ViewVariables] + public EntityUid? Target; +} diff --git a/Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs b/Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs new file mode 100644 index 00000000000..e7bec2ad75e --- /dev/null +++ b/Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs @@ -0,0 +1,90 @@ +using Content.Server._Scp.Objectives.Components; +using Content.Server.Mind; +using Content.Server.Objectives.Components; +using Content.Server.Objectives.Systems; +using Content.Shared._Scp.Chaos; +using Content.Shared.Mobs.Systems; +using Content.Shared.Objectives.Components; +using Content.Shared.Roles.Jobs; +using Robust.Shared.Random; + +namespace Content.Server._Scp.Objectives.Systems; + +public sealed class ScpActivateSleepSpyConditionSystem : EntitySystem +{ + [Dependency] private readonly CodeConditionSystem _condition = default!; + [Dependency] private readonly MindSystem _mind = default!; + [Dependency] private readonly MobStateSystem _mobState = default!; + [Dependency] private readonly SharedJobSystem _job = default!; + [Dependency] private readonly MetaDataSystem _metaData = default!; + [Dependency] private readonly IRobustRandom _random = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnAssigned); + SubscribeLocalEvent(OnAfterAssign); + SubscribeLocalEvent(OnGetProgress); + } + + private void OnAssigned(Entity ent, ref ObjectiveAssignedEvent args) + { + var candidates = new HashSet(); + + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var uid, out var comp)) + { + if (comp.IsAssigned) + continue; + + if (!_mobState.IsAlive(uid)) + continue; + + candidates.Add(uid); + } + + if (candidates.Count >= 1) + ent.Comp.Target = _random.Pick(candidates); + else + args.Cancelled = true; + + } + + private void OnAfterAssign(Entity ent, ref ObjectiveAfterAssignEvent args) + { + + if (ent.Comp.Target is not { } target || Deleted(target)) + return; + + if (!_mind.TryGetMind(target, out var mindId, out _)) + return; + + if (!_job.MindTryGetJob(mindId, out var jobPrototype)) + return; + + if (!_job.TryGetDepartment(jobPrototype.ID, out var departmentPrototype)) + return; + + _metaData.SetEntityName(ent, Loc.GetString("objective-condition-chaos-spy-activate-sleep-spy-title"), args.Meta); + _metaData.SetEntityDescription(ent, Loc.GetString("objective-condition-chaos-spy-activate-sleep-spy-description", ("department", Loc.GetString(departmentPrototype.Name))), args.Meta); + } + + private void OnGetProgress(Entity ent, ref ObjectiveGetProgressEvent args) + { + if (TryComp(ent, out var code) && code.Completed) + { + args.Progress = 1f; + return; + } + + if (HasComp(ent.Comp.Target)) + { + _condition.SetCompleted((ent.Owner, code), true); + args.Progress = 1f; + return; + } + + args.Progress = 0f; + } +} diff --git a/Content.Shared/_Scp/Chaos/ChaosSleepSpyMobComponent.cs b/Content.Shared/_Scp/Chaos/ChaosSleepSpyMobComponent.cs index e8a4a6c6143..cab172a65f5 100644 --- a/Content.Shared/_Scp/Chaos/ChaosSleepSpyMobComponent.cs +++ b/Content.Shared/_Scp/Chaos/ChaosSleepSpyMobComponent.cs @@ -18,6 +18,9 @@ public sealed partial class ChaosSleepSpyMobComponent : Component [DataField] public EntProtoId DefaultChaosSpyRule = "ScpChaosLowSpy"; + [ViewVariables] + public bool IsAssigned; + [ViewVariables] public string[]? CodeWords; } diff --git a/Content.Shared/_Scp/Chaos/ChaosSpyMobComponent.cs b/Content.Shared/_Scp/Chaos/ChaosSpyMobComponent.cs new file mode 100644 index 00000000000..bfe9183560b --- /dev/null +++ b/Content.Shared/_Scp/Chaos/ChaosSpyMobComponent.cs @@ -0,0 +1,6 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared._Scp.Chaos; + +[RegisterComponent, NetworkedComponent] +public sealed partial class ChaosSpyMobComponent : Component; diff --git a/Resources/Locale/en-US/_strings/_scp/administration/antag.ftl b/Resources/Locale/en-US/_strings/_scp/administration/antag.ftl index f244cb68b0a..c232943b316 100644 --- a/Resources/Locale/en-US/_strings/_scp/administration/antag.ftl +++ b/Resources/Locale/en-US/_strings/_scp/administration/antag.ftl @@ -1,6 +1,9 @@ admin-verb-make-chaos-raider = Make the target into a Chaos Raider admin-verb-make-chaos-spy = Make the target into a Chaos Spy + admin-verb-make-chaos-sleep-spy = Make the target into a Chaos Sleep Spy admin-verb-text-make-chaos-raider = Make Chaos Raider + admin-verb-text-make-chaos-spy = Make Chaos Spy -admin-verb-text-make-chaos-sleep-spy = Make Chaos Sleep Spy \ No newline at end of file +admin-verb-text-make-chaos-sleep-spy = Make Chaos Sleep Spy +admin-verb-result-make-chaos-sleep-spy = Player "{$targetName}" is now a sleeper agent of the Chaos Insurgency. An objective to activate them will be given to a random active spy. diff --git a/Resources/Locale/en-US/_strings/_scp/objectives/conditions/activate-sleep-spy.ftl b/Resources/Locale/en-US/_strings/_scp/objectives/conditions/activate-sleep-spy.ftl new file mode 100644 index 00000000000..1c60e3e8391 --- /dev/null +++ b/Resources/Locale/en-US/_strings/_scp/objectives/conditions/activate-sleep-spy.ftl @@ -0,0 +1,2 @@ +objective-condition-chaos-spy-activate-sleep-spy-title = Activate the sleeper agent. +objective-condition-chaos-spy-activate-sleep-spy-description = Find and activate the sleeper agent in the "{$department}" department. Do this as discreetly as possible. diff --git a/Resources/Locale/ru-RU/_strings/_scp/administration/antag.ftl b/Resources/Locale/ru-RU/_strings/_scp/administration/antag.ftl index c8f433b80f1..4a3a8493cc6 100644 --- a/Resources/Locale/ru-RU/_strings/_scp/administration/antag.ftl +++ b/Resources/Locale/ru-RU/_strings/_scp/administration/antag.ftl @@ -6,3 +6,4 @@ admin-verb-text-make-chaos-spy = Сделать шпионом Повстанц admin-verb-make-chaos-sleep-spy = Сделать цель спящим агентом Повстанцев Хаоса admin-verb-text-make-chaos-sleep-spy = Сделать спящим агентом Повстанцев Хаоса +admin-verb-result-make-chaos-sleep-spy = Игрок "{$targetName}" теперь спящий агент Повстанцев Хаоса. Цель на его активацию будет отправлена случайному активному шпиону. diff --git a/Resources/Locale/ru-RU/_strings/_scp/objectives/conditions/activate-sleep-spy.ftl b/Resources/Locale/ru-RU/_strings/_scp/objectives/conditions/activate-sleep-spy.ftl new file mode 100644 index 00000000000..7d1f200c305 --- /dev/null +++ b/Resources/Locale/ru-RU/_strings/_scp/objectives/conditions/activate-sleep-spy.ftl @@ -0,0 +1,2 @@ +objective-condition-chaos-spy-activate-sleep-spy-title = Активируйте cпящего агента. +objective-condition-chaos-spy-activate-sleep-spy-description = Найдите и активируйте спящего агента из отдела "{$department}". Сделайте это как можно незаметнее. diff --git a/Resources/Prototypes/_Scp/GameRules/roundstart.yml b/Resources/Prototypes/_Scp/GameRules/roundstart.yml index b2c18c084ac..07f44e92434 100644 --- a/Resources/Prototypes/_Scp/GameRules/roundstart.yml +++ b/Resources/Prototypes/_Scp/GameRules/roundstart.yml @@ -236,6 +236,8 @@ playerRatio: 10 pickCommandStaff: true ignoreCanBeAntag: true + components: + - type: ChaosSpyMob blacklist: components: - AntagImmune @@ -267,6 +269,8 @@ max: 5 playerRatio: 10 pickCommandStaff: false + components: + - type: ChaosSpyMob blacklist: components: - AntagImmune diff --git a/Resources/Prototypes/_Scp/Objectives/chaosSpy.yml b/Resources/Prototypes/_Scp/Objectives/chaosSpy.yml index 7b3aeff4ddc..6d28f53f767 100644 --- a/Resources/Prototypes/_Scp/Objectives/chaosSpy.yml +++ b/Resources/Prototypes/_Scp/Objectives/chaosSpy.yml @@ -146,6 +146,19 @@ components: - HelpProgressCondition +- type: entity + parent: [BaseChaosSpyObjective, BaseCodeObjective] + id: ChaosSpyActivateSleepSpyObjective + name: activate "sleeper" cells + description: activate "sleeper" cells of the Chaos Insurgency. + components: + - type: Objective + difficulty: 1.1 + icon: + sprite: _Scp/Interface/Misc/chaos_objectives_icons.rsi + state: StealItemScp + - type: ScpActivateSleepSpyCondition + - type: entity parent: BaseChaosSpyStealObjective id: ChaosSpyStealItemScpsObjective diff --git a/Resources/Prototypes/_Scp/Objectives/objectiveGroups.yml b/Resources/Prototypes/_Scp/Objectives/objectiveGroups.yml index aaed05ed313..8c2f384b217 100644 --- a/Resources/Prototypes/_Scp/Objectives/objectiveGroups.yml +++ b/Resources/Prototypes/_Scp/Objectives/objectiveGroups.yml @@ -30,9 +30,9 @@ weights: ChaosSpyObjectiveGroupSteal: 1 #ChaosSpyObjectiveGroupDestroy: 0.6 # временно вырезано из пула тасков - ChaosSpyObjectiveGroupClassD: 0.8 + ChaosSpyObjectiveGroupClassD: 0.5 ChaosSpyObjectiveGroupKill: 0.8 - ChaosSpyObjectiveGroupSabotage: 0.8 + ChaosSpyObjectiveGroupSabotage: 0.5 ChaosSpyObjectiveGroupSocial: 0.5 - type: weightedRandom From eb1c35ed3df9ccccf187bf6ea197745e6f210594 Mon Sep 17 00:00:00 2001 From: EngineerLND Date: Sun, 9 Aug 2026 05:11:30 +0300 Subject: [PATCH 2/7] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=D1=8B=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D0=BF=D1=80=D0=B8=D0=BA=D0=B0=D0=B7=D1=83=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D0=B8=D1=80=D0=B0=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=B9=D1=87=D0=B8=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_Scp/GameTicking/Rules/ChaosSleepSpyRuleSystem.cs | 5 +++++ .../Components/ScpActivateSleepSpyConditionComponent.cs | 1 + .../Systems/ScpActivateSleepSpyConditionSystem.cs | 9 +++++++-- Content.Shared/_Scp/Chaos/ChaosSleepSpyMobComponent.cs | 1 + Resources/Prototypes/_Scp/Objectives/chaosSpy.yml | 2 +- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Content.Server/_Scp/GameTicking/Rules/ChaosSleepSpyRuleSystem.cs b/Content.Server/_Scp/GameTicking/Rules/ChaosSleepSpyRuleSystem.cs index c7d78fc477b..232bd7d090a 100644 --- a/Content.Server/_Scp/GameTicking/Rules/ChaosSleepSpyRuleSystem.cs +++ b/Content.Server/_Scp/GameTicking/Rules/ChaosSleepSpyRuleSystem.cs @@ -10,6 +10,7 @@ using Content.Shared._Scp.Chaos; using Content.Shared.GameTicking.Components; using Content.Shared.Mind; +using Content.Shared.Mobs.Systems; using Content.Shared.Roles.RoleCodeword; using Content.Shared.Speech; using Content.Shared.Speech.Components; @@ -24,6 +25,7 @@ public sealed class ChaosSleepSpyRuleSystem : GameRuleSystem ent, ref Aft if (!_mind.TryGetMind(uid, out var thisMindId, out var mindComp)) continue; + if(_mobState.IsDead(uid)) + continue; + var count = mindComp.Objectives.Count; if (count < minObjectives) { diff --git a/Content.Server/_Scp/Objectives/Components/ScpActivateSleepSpyConditionComponent.cs b/Content.Server/_Scp/Objectives/Components/ScpActivateSleepSpyConditionComponent.cs index 42dfc069a01..8a3f25ab0c1 100644 --- a/Content.Server/_Scp/Objectives/Components/ScpActivateSleepSpyConditionComponent.cs +++ b/Content.Server/_Scp/Objectives/Components/ScpActivateSleepSpyConditionComponent.cs @@ -5,6 +5,7 @@ namespace Content.Server._Scp.Objectives.Components; [RegisterComponent, Access(typeof(ScpActivateSleepSpyConditionSystem))] public sealed partial class ScpActivateSleepSpyConditionComponent : Component { + /// Target that active spy going to activate. [ViewVariables] public EntityUid? Target; } diff --git a/Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs b/Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs index e7bec2ad75e..b2d129b10b9 100644 --- a/Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs +++ b/Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs @@ -16,6 +16,7 @@ public sealed class ScpActivateSleepSpyConditionSystem : EntitySystem [Dependency] private readonly MindSystem _mind = default!; [Dependency] private readonly MobStateSystem _mobState = default!; [Dependency] private readonly SharedJobSystem _job = default!; + [Dependency] private readonly ILocalizationManager _loc = default!; [Dependency] private readonly MetaDataSystem _metaData = default!; [Dependency] private readonly IRobustRandom _random = default!; @@ -44,8 +45,12 @@ private void OnAssigned(Entity ent, ref O candidates.Add(uid); } + if (candidates.Count >= 1) + { ent.Comp.Target = _random.Pick(candidates); + Comp(ent.Comp.Target.Value).IsAssigned = true; + } else args.Cancelled = true; @@ -66,8 +71,8 @@ private void OnAfterAssign(Entity ent, re if (!_job.TryGetDepartment(jobPrototype.ID, out var departmentPrototype)) return; - _metaData.SetEntityName(ent, Loc.GetString("objective-condition-chaos-spy-activate-sleep-spy-title"), args.Meta); - _metaData.SetEntityDescription(ent, Loc.GetString("objective-condition-chaos-spy-activate-sleep-spy-description", ("department", Loc.GetString(departmentPrototype.Name))), args.Meta); + _metaData.SetEntityName(ent, _loc.GetString("objective-condition-chaos-spy-activate-sleep-spy-title"), args.Meta); + _metaData.SetEntityDescription(ent, _loc.GetString("objective-condition-chaos-spy-activate-sleep-spy-description", ("department", _loc.GetString(departmentPrototype.Name))), args.Meta); } private void OnGetProgress(Entity ent, ref ObjectiveGetProgressEvent args) diff --git a/Content.Shared/_Scp/Chaos/ChaosSleepSpyMobComponent.cs b/Content.Shared/_Scp/Chaos/ChaosSleepSpyMobComponent.cs index cab172a65f5..7ae8d767736 100644 --- a/Content.Shared/_Scp/Chaos/ChaosSleepSpyMobComponent.cs +++ b/Content.Shared/_Scp/Chaos/ChaosSleepSpyMobComponent.cs @@ -18,6 +18,7 @@ public sealed partial class ChaosSleepSpyMobComponent : Component [DataField] public EntProtoId DefaultChaosSpyRule = "ScpChaosLowSpy"; + /// Whether this sleep spy has already been assigned as an activation target. [ViewVariables] public bool IsAssigned; diff --git a/Resources/Prototypes/_Scp/Objectives/chaosSpy.yml b/Resources/Prototypes/_Scp/Objectives/chaosSpy.yml index 6d28f53f767..2b988b0046f 100644 --- a/Resources/Prototypes/_Scp/Objectives/chaosSpy.yml +++ b/Resources/Prototypes/_Scp/Objectives/chaosSpy.yml @@ -150,7 +150,7 @@ parent: [BaseChaosSpyObjective, BaseCodeObjective] id: ChaosSpyActivateSleepSpyObjective name: activate "sleeper" cells - description: activate "sleeper" cells of the Chaos Insurgency. + description: Activate "sleeper" cells of the Chaos Insurgency. components: - type: Objective difficulty: 1.1 From ef37fde82f246f81c014e8b4108e79d76ecb850e Mon Sep 17 00:00:00 2001 From: EngineerLND Date: Sun, 9 Aug 2026 20:39:38 +0300 Subject: [PATCH 3/7] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D0=BE=D1=82=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=B9=D1=87=D0=B8=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/ScpActivateSleepSpyConditionComponent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Server/_Scp/Objectives/Components/ScpActivateSleepSpyConditionComponent.cs b/Content.Server/_Scp/Objectives/Components/ScpActivateSleepSpyConditionComponent.cs index 8a3f25ab0c1..6a3c67d05bd 100644 --- a/Content.Server/_Scp/Objectives/Components/ScpActivateSleepSpyConditionComponent.cs +++ b/Content.Server/_Scp/Objectives/Components/ScpActivateSleepSpyConditionComponent.cs @@ -5,7 +5,7 @@ namespace Content.Server._Scp.Objectives.Components; [RegisterComponent, Access(typeof(ScpActivateSleepSpyConditionSystem))] public sealed partial class ScpActivateSleepSpyConditionComponent : Component { - /// Target that active spy going to activate. + /// The sleep spy target that an active Chaos Spy must activate. [ViewVariables] public EntityUid? Target; } From 6e0e8d17e69279430063148a127656a15d2e6814 Mon Sep 17 00:00:00 2001 From: EngineerLND Date: Sun, 9 Aug 2026 20:47:31 +0300 Subject: [PATCH 4/7] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D0=BE=D1=82=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=B9=D1=87=D0=B8=D0=BA=D0=B0=20=D0=BD=D0=BE=D0=BC?= =?UTF-8?q?=D0=B5=D1=80=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs b/Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs index b2d129b10b9..3946fb4e9c4 100644 --- a/Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs +++ b/Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs @@ -26,7 +26,7 @@ public override void Initialize() SubscribeLocalEvent(OnAssigned); SubscribeLocalEvent(OnAfterAssign); - SubscribeLocalEvent(OnGetProgress); + SubscribeLocalEvent(OnGetProgress, after: [typeof(CodeConditionSystem)]); } private void OnAssigned(Entity ent, ref ObjectiveAssignedEvent args) From 66274a41a2583a830ca2d70ef2943ce6f73bf36d Mon Sep 17 00:00:00 2001 From: EngineerLND Date: Sun, 9 Aug 2026 21:04:13 +0300 Subject: [PATCH 5/7] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=A8=D0=9F=D0=A5=20=D0=B2=20=D0=BB=D0=BE=D0=BA=D0=B0?= =?UTF-8?q?=D0=BB=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Resources/Locale/en-US/_prototypes/_scp/objectives/chaos.ftl | 2 ++ Resources/Locale/ru-RU/_prototypes/_scp/objectives/chaos.ftl | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Resources/Locale/en-US/_prototypes/_scp/objectives/chaos.ftl b/Resources/Locale/en-US/_prototypes/_scp/objectives/chaos.ftl index 225e79b6c8c..b8c7c244798 100644 --- a/Resources/Locale/en-US/_prototypes/_scp/objectives/chaos.ftl +++ b/Resources/Locale/en-US/_prototypes/_scp/objectives/chaos.ftl @@ -18,6 +18,8 @@ ent-ChaosSpyStealIdCardsObjective = { ent-BaseChaosSpyStealObjective } .desc = { ent-BaseChaosSpyStealObjective.desc } ent-ChaosSpyHelpRandomSpyObjective = { ent-BaseHelpProgressObjective } .desc = Help another Chaos spy complete their objectives. +ent-ChaosSpyActivateSleepSpyObjective = Activate the sleeper agent. + .desc = Find and activate the sleeper agent. Do this as discreetly as possible. ent-ChaosSpyStealItemScpsObjective = { ent-BaseChaosSpyStealObjective } .desc = { ent-BaseChaosSpyStealObjective.desc } ent-ChaosSpyHelpChaosRaidObjective = Help the Chaos raid. diff --git a/Resources/Locale/ru-RU/_prototypes/_scp/objectives/chaos.ftl b/Resources/Locale/ru-RU/_prototypes/_scp/objectives/chaos.ftl index 5940558133b..10e8b2a4b96 100644 --- a/Resources/Locale/ru-RU/_prototypes/_scp/objectives/chaos.ftl +++ b/Resources/Locale/ru-RU/_prototypes/_scp/objectives/chaos.ftl @@ -18,6 +18,8 @@ ent-ChaosSpyStealIdCardsObjective = { ent-BaseChaosSpyStealObjective } .desc = { ent-BaseChaosSpyStealObjective.desc } ent-ChaosSpyHelpRandomSpyObjective = { ent-BaseHelpProgressObjective } .desc = Помогите другому шпиону Повстанцев Хаоса выполнить его цели. +ent-ChaosSpyActivateSleepSpyObjective = Активируйте cпящего агента. + .desc = Найдите и активируйте спящего агента. Сделайте это как можно незаметнее. ent-ChaosSpyStealItemScpsObjective = { ent-BaseChaosSpyStealObjective } .desc = { ent-BaseChaosSpyStealObjective.desc } ent-ChaosSpyHelpChaosRaidObjective = Помочь рейдерам Повстанцев Хаоса. From 311a80c81f6a542f4794459daec0e69c6afe1825 Mon Sep 17 00:00:00 2001 From: EngineerLND Date: Wed, 19 Aug 2026 12:34:42 +0300 Subject: [PATCH 6/7] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Administration/Systems/AdminVerbSystem.Antags.cs | 7 ++++++- .../Systems/ScpActivateSleepSpyConditionSystem.cs | 9 +++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs index a1885ae02a1..75cec6f3c71 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs @@ -358,9 +358,14 @@ private void AddAntagVerbs(GetVerbsEvent args) _antag.ForceMakeAntag(targetPlayer, DefaultScpSleepChaosSpyRule); if (!TryComp(args.User, out var actor)) return; + if (!_mindSystem.TryGetMind(args.Target, out var targetMindId, out _)) return; - var targetMind = Comp(targetMindId); + + TryComp(targetMindId, out var targetMind); + if (targetMind == null) + return; + var targetName = targetMind.CharacterName ?? Name(args.Target); _chatManager.DispatchServerMessage(actor.PlayerSession, Loc.GetString("admin-verb-result-make-chaos-sleep-spy", diff --git a/Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs b/Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs index 3946fb4e9c4..e31b797795e 100644 --- a/Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs +++ b/Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs @@ -16,7 +16,6 @@ public sealed class ScpActivateSleepSpyConditionSystem : EntitySystem [Dependency] private readonly MindSystem _mind = default!; [Dependency] private readonly MobStateSystem _mobState = default!; [Dependency] private readonly SharedJobSystem _job = default!; - [Dependency] private readonly ILocalizationManager _loc = default!; [Dependency] private readonly MetaDataSystem _metaData = default!; [Dependency] private readonly IRobustRandom _random = default!; @@ -49,7 +48,9 @@ private void OnAssigned(Entity ent, ref O if (candidates.Count >= 1) { ent.Comp.Target = _random.Pick(candidates); - Comp(ent.Comp.Target.Value).IsAssigned = true; + TryComp(ent.Comp.Target.Value, out var sleepSpyComp); + if(sleepSpyComp != null) + sleepSpyComp.IsAssigned = true; } else args.Cancelled = true; @@ -71,8 +72,8 @@ private void OnAfterAssign(Entity ent, re if (!_job.TryGetDepartment(jobPrototype.ID, out var departmentPrototype)) return; - _metaData.SetEntityName(ent, _loc.GetString("objective-condition-chaos-spy-activate-sleep-spy-title"), args.Meta); - _metaData.SetEntityDescription(ent, _loc.GetString("objective-condition-chaos-spy-activate-sleep-spy-description", ("department", _loc.GetString(departmentPrototype.Name))), args.Meta); + _metaData.SetEntityName(ent, Loc.GetString("objective-condition-chaos-spy-activate-sleep-spy-title"), args.Meta); + _metaData.SetEntityDescription(ent, Loc.GetString("objective-condition-chaos-spy-activate-sleep-spy-description", ("department", Loc.GetString(departmentPrototype.Name))), args.Meta); } private void OnGetProgress(Entity ent, ref ObjectiveGetProgressEvent args) From 7eb2939a5fbd328507a6e688802b00633e9ceb30 Mon Sep 17 00:00:00 2001 From: The engineer <93286921+EngineerLND@users.noreply.github.com> Date: Thu, 20 Aug 2026 10:54:51 +0300 Subject: [PATCH 7/7] Update Resources/Locale/ru-RU/_prototypes/_scp/objectives/chaos.ftl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit фикс англ С на русскую С Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- Resources/Locale/ru-RU/_prototypes/_scp/objectives/chaos.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Locale/ru-RU/_prototypes/_scp/objectives/chaos.ftl b/Resources/Locale/ru-RU/_prototypes/_scp/objectives/chaos.ftl index 10e8b2a4b96..d054750ea5d 100644 --- a/Resources/Locale/ru-RU/_prototypes/_scp/objectives/chaos.ftl +++ b/Resources/Locale/ru-RU/_prototypes/_scp/objectives/chaos.ftl @@ -18,7 +18,7 @@ ent-ChaosSpyStealIdCardsObjective = { ent-BaseChaosSpyStealObjective } .desc = { ent-BaseChaosSpyStealObjective.desc } ent-ChaosSpyHelpRandomSpyObjective = { ent-BaseHelpProgressObjective } .desc = Помогите другому шпиону Повстанцев Хаоса выполнить его цели. -ent-ChaosSpyActivateSleepSpyObjective = Активируйте cпящего агента. +ent-ChaosSpyActivateSleepSpyObjective = Активируйте спящего агента. .desc = Найдите и активируйте спящего агента. Сделайте это как можно незаметнее. ent-ChaosSpyStealItemScpsObjective = { ent-BaseChaosSpyStealObjective } .desc = { ent-BaseChaosSpyStealObjective.desc }