From 5b444325ed1a19c20a3aaf3a89df31f6ced26362 Mon Sep 17 00:00:00 2001 From: Zack Backmen Date: Wed, 28 Feb 2024 11:55:53 +0300 Subject: [PATCH] ReinforcementV2 --- .../Components/ReinforcementMindComponent.cs | 10 ++++++++++ .../Backmen/Reinforcement/ReinforcementSystem.cs | 14 ++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 Content.Server/Backmen/Reinforcement/Components/ReinforcementMindComponent.cs diff --git a/Content.Server/Backmen/Reinforcement/Components/ReinforcementMindComponent.cs b/Content.Server/Backmen/Reinforcement/Components/ReinforcementMindComponent.cs new file mode 100644 index 00000000000..fd9fe91c6dd --- /dev/null +++ b/Content.Server/Backmen/Reinforcement/Components/ReinforcementMindComponent.cs @@ -0,0 +1,10 @@ +using Content.Shared.Backmen.Reinforcement.Components; + +namespace Content.Server.Backmen.Reinforcement.Components; + +[RegisterComponent] +public sealed partial class ReinforcementMindComponent : Component +{ + [ViewVariables(VVAccess.ReadOnly)] + public Entity Linked; +} diff --git a/Content.Server/Backmen/Reinforcement/ReinforcementSystem.cs b/Content.Server/Backmen/Reinforcement/ReinforcementSystem.cs index 001145c61b9..d423b29ed35 100644 --- a/Content.Server/Backmen/Reinforcement/ReinforcementSystem.cs +++ b/Content.Server/Backmen/Reinforcement/ReinforcementSystem.cs @@ -8,6 +8,7 @@ using Content.Server.Mind; using Content.Server.Players.PlayTimeTracking; using Content.Server.Popups; +using Content.Server.Roles; using Content.Server.Station.Systems; using Content.Shared.Access.Systems; using Content.Shared.Backmen.Cryostorage; @@ -77,6 +78,7 @@ public override void Initialize() SubscribeLocalEvent(OnSpawnPlayer); SubscribeLocalEvent(OnTryOpenUi); SubscribeLocalEvent(OnMoveToSSD); + SubscribeLocalEvent(OnGetBrief); Subs.BuiEvents(ReinforcementConsoleKey.Key, subs => { @@ -87,6 +89,17 @@ public override void Initialize() }); } + private void OnGetBrief(Entity ent, ref GetBriefingEvent args) + { + args.Append("Вы вызваны как подкрепление, брифинг: "); + if (TerminatingOrDeleted(ent.Comp.Linked)) + { + args.Append("- нет связи с сервером -"); + return; + } + args.Append(ent.Comp.Linked.Comp.Brief); + } + private void OnMoveToSSD(Entity ent, ref MovedToStorageEvent args) { if (TerminatingOrDeleted(ent.Comp.Linked)) @@ -145,6 +158,7 @@ private void OnSpawnPlayer(ReinforcementSpawnPlayer args) var jobPrototype = _prototype.Index(args.Proto.Job); var job = new JobComponent { Prototype = args.Proto.Job }; _roles.MindAddRole(newMind, job, silent: false); + EnsureComp(newMind).Linked = ent.Comp.Linked; var jobName = _jobs.MindTryGetJobName(newMind); _playTimeTrackings.PlayerRolesChanged(args.Player);