From 7605aecd07d3adf62a1173dff8465e881b4cb7ec Mon Sep 17 00:00:00 2001 From: BIGZi0348 Date: Mon, 23 Dec 2024 00:01:19 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B0=D0=BA=D1=81=20=D1=81=D0=B8=D0=BD?= =?UTF-8?q?=D0=B4=D0=B8=D0=BA=D0=B0=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ERTRecruitment/ERTRecruitmentRule.cs | 63 +++++++++++-------- .../ERTRecruitmentRuleComponent.cs | 6 +- .../GhostRecruitmentSystem.cs | 48 +++++++------- .../_White/AuthPanel/SharedAuthPanel.cs | 2 +- .../GhostRecruitmentEvents.cs | 4 +- .../structures/machines/fax_machine.ftl | 3 + Resources/Maps/White/centcomm.yml | 2 +- .../Structures/Machines/fax_machine.yml | 19 +++++- .../Prototypes/_White/event_prototypes.yml | 5 +- 9 files changed, 93 insertions(+), 59 deletions(-) diff --git a/Content.Server/_White/ERTRecruitment/ERTRecruitmentRule.cs b/Content.Server/_White/ERTRecruitment/ERTRecruitmentRule.cs index 497f6c9be4..67aa919416 100644 --- a/Content.Server/_White/ERTRecruitment/ERTRecruitmentRule.cs +++ b/Content.Server/_White/ERTRecruitment/ERTRecruitmentRule.cs @@ -2,6 +2,7 @@ using System.Linq; using Content.Server.Chat.Managers; using Content.Server.Chat.Systems; using Content.Server.GameTicking; +using Content.Server.GameTicking.Events; using Content.Server.GameTicking.Rules.Components; using Content.Server.StationEvents.Events; using Content.Server._White.GhostRecruitment; @@ -26,6 +27,8 @@ public sealed class ERTRecruitmentRule : StationEventSystem(OnStartAttempt); - SubscribeLocalEvent(OnRecruitmentSuccess); + SubscribeLocalEvent(OnRoundStart); + SubscribeLocalEvent(OnRecruitmentSuccess); } protected override void Added(EntityUid uid, ERTRecruitmentRuleComponent component, GameRuleComponent gameRule, GameRuleAddedEvent args) @@ -51,9 +54,6 @@ public sealed class ERTRecruitmentRule : StationEventSystem(component.Shuttle, out var shuttle) && component.Outpost != null) @@ -104,49 +110,57 @@ public sealed class ERTRecruitmentRule : StationEventSystem(); + ertsys.IsDisabled = true; + } - if (component.TargetStation != null) - AcceptERT(component.TargetStation.Value); } private void OnRecruitmentSuccess(EntityUid uid, RecruitedComponent component, GhostRecruitmentSuccessEvent args) { var ev = new ERTRecruitedReasonEvent(); - RaiseLocalEvent(uid,ev); + RaiseLocalEvent(uid, ev); if (args.PlayerSession != null) { - _chat.DispatchServerMessage(args.PlayerSession, Loc.GetString("ert-description")); _chat.DispatchServerMessage(args.PlayerSession, Loc.GetString("ert-reason", ("reason", ev.Reason))); } } - private void OnStartAttempt(RoundStartAttemptEvent ev) + private void OnRoundStart(RoundStartingEvent ev) { - if(_cfgManager.GetCVar(WhiteCVars.LoadErtMap)) - SpawnMap(); + //if (_cfgManager.GetCVar(WhiteCVars.LoadErtMap)) + SpawnMap(); } - public void AcceptERT(EntityUid targetStation) { - _chatSystem.DispatchStationAnnouncement(targetStation,Loc.GetString("ert-accept-message"), - colorOverride: Color.Gold,announcementSound:ERTRecruitmentRuleComponent.ERTYes); + _chatSystem.DispatchStationAnnouncement(targetStation, Loc.GetString("ert-accept-message"), + colorOverride: Color.Gold, announcementSound: ERTRecruitmentRuleComponent.ERTYes); } public void DeclineERT(EntityUid targetStation) { - _chatSystem.DispatchStationAnnouncement(targetStation,Loc.GetString("ert-deny-message"), - colorOverride: Color.Gold,announcementSound:ERTRecruitmentRuleComponent.ERTNo); + _chatSystem.DispatchStationAnnouncement(targetStation, Loc.GetString("ert-deny-message"), + colorOverride: Color.Gold, announcementSound: ERTRecruitmentRuleComponent.ERTNo); } private bool SpawnMap() @@ -161,7 +175,7 @@ public sealed class ERTRecruitmentRule : StationEventSystem(outpost); ertMap.MapId = mapId; //ERTMap.Shuttle = shuttleId; diff --git a/Content.Server/_White/ERTRecruitment/ERTRecruitmentRuleComponent.cs b/Content.Server/_White/ERTRecruitment/ERTRecruitmentRuleComponent.cs index 3541043432..9e5f53c80e 100644 --- a/Content.Server/_White/ERTRecruitment/ERTRecruitmentRuleComponent.cs +++ b/Content.Server/_White/ERTRecruitment/ERTRecruitmentRuleComponent.cs @@ -13,6 +13,8 @@ public sealed partial class ERTRecruitmentRuleComponent : Component [DataField("minPlayer")] public int MinPlayer = 4; + [DataField("earliestStart")] public int EarliestStart = 45; + public static SoundSpecifier ERTYes = new SoundPathSpecifier("/Audio/Announcements/ert_yes.ogg"); public static SoundSpecifier ERTNo = new SoundPathSpecifier("/Audio/Announcements/ert_no.ogg"); @@ -21,8 +23,8 @@ public sealed partial class ERTRecruitmentRuleComponent : Component [ViewVariables] public EntityUid? Outpost; - //[ViewVariables] - // public EntityUid? Shuttle; + //[ViewVariables] + // public EntityUid? Shuttle; [ViewVariables] public EntityUid? TargetStation; } diff --git a/Content.Server/_White/GhostRecruitment/GhostRecruitmentSystem.cs b/Content.Server/_White/GhostRecruitment/GhostRecruitmentSystem.cs index bf2fcdb9cc..2564b3c533 100644 --- a/Content.Server/_White/GhostRecruitment/GhostRecruitmentSystem.cs +++ b/Content.Server/_White/GhostRecruitment/GhostRecruitmentSystem.cs @@ -32,10 +32,10 @@ public sealed class GhostRecruitmentSystem : EntitySystem /// name of recruitment. public void StartRecruitment(string recruitmentName) { - var query = EntityQueryEnumerator(); - while (query.MoveNext(out var uid,out _,out var actorComponent)) + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var uid, out _, out var actorComponent)) { - OpenEui(uid,recruitmentName,actorComponent); + OpenEui(uid, recruitmentName, actorComponent); } } @@ -44,7 +44,7 @@ public sealed class GhostRecruitmentSystem : EntitySystem /// /// /// name of recruitment. - public void Recruit(EntityUid uid,string recruitmentName) + public void Recruit(EntityUid uid, string recruitmentName) { EnsureComp(uid).RecruitmentName = recruitmentName; } @@ -63,31 +63,31 @@ public sealed class GhostRecruitmentSystem : EntitySystem var count = 0; - var maxCount = Math.Max(3, _playerManager.PlayerCount / 6); - + //var maxCount = Math.Max(3, _playerManager.PlayerCount / 8); + var maxCount = 1; var query = EntityQueryEnumerator(); - while (query.MoveNext(out var uid,out var ghostRecruitedComponent)) + while (query.MoveNext(out var uid, out var ghostRecruitedComponent)) { - if(ghostRecruitedComponent.RecruitmentName != recruitmentName) + if (ghostRecruitedComponent.RecruitmentName != recruitmentName) continue; if (!TryComp(uid, out var actorComponent)) continue; // if there are too many recruited, then just skip - if(count >= spawners.Count || count >= maxCount) + if (count >= spawners.Count || count >= maxCount) continue; var (spawnerUid, spawnerComponent) = spawners[count]; - TransferMind(uid,spawnerUid,spawnerComponent); + TransferMind(uid, spawnerUid, spawnerComponent); count++; EnsureComp(uid).RecruitmentName = recruitmentName; - var ghostEvent = new GhostRecruitmentSuccessEvent(recruitmentName,actorComponent.PlayerSession); - RaiseLocalEvent(uid,ghostEvent); + var ghostEvent = new GhostRecruitmentSuccessEvent(recruitmentName, actorComponent.PlayerSession); + RaiseLocalEvent(uid, ghostEvent); } var ghostsEvent = new GhostsRecruitmentSuccessEvent(recruitmentName); @@ -112,14 +112,14 @@ public sealed class GhostRecruitmentSystem : EntitySystem } } - private void TransferMind(EntityUid from,EntityUid spawnerUid,GhostRecruitmentSpawnPointComponent? component = null) + private void TransferMind(EntityUid from, EntityUid spawnerUid, GhostRecruitmentSpawnPointComponent? component = null) { - if (!Resolve(spawnerUid, ref component) || !TryComp(from,out var actorComponent)) + if (!Resolve(spawnerUid, ref component) || !TryComp(from, out var actorComponent)) return; var entityUid = Spawn(spawnerUid, component); - if(!entityUid.HasValue) + if (!entityUid.HasValue) return; var mind = actorComponent.PlayerSession.GetMind(); @@ -131,7 +131,7 @@ public sealed class GhostRecruitmentSystem : EntitySystem _mind.UnVisit(mind.Value); } - private EntityUid? Spawn(EntityUid spawnerUid,GhostRecruitmentSpawnPointComponent? component = null) + private EntityUid? Spawn(EntityUid spawnerUid, GhostRecruitmentSpawnPointComponent? component = null) { if (!Resolve(spawnerUid, ref component)) return null; @@ -166,27 +166,27 @@ public sealed class GhostRecruitmentSystem : EntitySystem } } - public void OpenEui(EntityUid uid,string recruitmentName,ActorComponent? actorComponent = null) + public void OpenEui(EntityUid uid, string recruitmentName, ActorComponent? actorComponent = null) { - if(!Resolve(uid,ref actorComponent)) + if (!Resolve(uid, ref actorComponent)) return; var eui = new GhostRecruitmentEuiAccept(uid, recruitmentName, this); - Logger.Debug("Added EUI to "+ uid); - if(_openUis.TryAdd(actorComponent.PlayerSession,eui)) - _eui.OpenEui(eui,actorComponent.PlayerSession); + Logger.Debug("Added EUI to " + uid); + if (_openUis.TryAdd(actorComponent.PlayerSession, eui)) + _eui.OpenEui(eui, actorComponent.PlayerSession); } public void ClearEui(string recruitmentName) { - foreach (var (session,eui) in _openUis) + foreach (var (session, eui) in _openUis) { if (session.AttachedEntity != null) CloseEui(session.AttachedEntity.Value, recruitmentName); } } - public void CloseEui(EntityUid uid,string recruitmentName,ActorComponent? actorComponent = null) + public void CloseEui(EntityUid uid, string recruitmentName, ActorComponent? actorComponent = null) { if (!Resolve(uid, ref actorComponent)) return; @@ -197,7 +197,7 @@ public sealed class GhostRecruitmentSystem : EntitySystem if (!_openUis.ContainsKey(session)) return; - Logger.Debug("Removed EUI from "+ uid); + Logger.Debug("Removed EUI from " + uid); _openUis.Remove(session, out var eui); eui?.Close(); diff --git a/Content.Shared/_White/AuthPanel/SharedAuthPanel.cs b/Content.Shared/_White/AuthPanel/SharedAuthPanel.cs index 9a659fc695..7f1d7c8f61 100644 --- a/Content.Shared/_White/AuthPanel/SharedAuthPanel.cs +++ b/Content.Shared/_White/AuthPanel/SharedAuthPanel.cs @@ -73,5 +73,5 @@ public sealed class AuthPanelPerformActionEvent : EntityEventArgs [Serializable, NetSerializable] public enum AuthPanelVisualLayers : byte { - Confirm + Confirm } diff --git a/Content.Shared/_White/GhostRecruitment/GhostRecruitmentEvents.cs b/Content.Shared/_White/GhostRecruitment/GhostRecruitmentEvents.cs index b291feee17..9d8ae19f42 100644 --- a/Content.Shared/_White/GhostRecruitment/GhostRecruitmentEvents.cs +++ b/Content.Shared/_White/GhostRecruitment/GhostRecruitmentEvents.cs @@ -2,7 +2,7 @@ using Robust.Shared.Serialization; namespace Content.Shared._White.GhostRecruitment; -[Serializable,NetSerializable] +[Serializable, NetSerializable] public sealed class GhostsRecruitmentSuccessEvent { public string RecruitmentName; @@ -15,7 +15,7 @@ public sealed class GhostsRecruitmentSuccessEvent -[Serializable,NetSerializable] +[Serializable, NetSerializable] public abstract class CancelableEventArgs { /// diff --git a/Resources/Locale/ru-RU/ss14-ru/prototypes/entities/structures/machines/fax_machine.ftl b/Resources/Locale/ru-RU/ss14-ru/prototypes/entities/structures/machines/fax_machine.ftl index 08d053001e..9c429a91a1 100644 --- a/Resources/Locale/ru-RU/ss14-ru/prototypes/entities/structures/machines/fax_machine.ftl +++ b/Resources/Locale/ru-RU/ss14-ru/prototypes/entities/structures/machines/fax_machine.ftl @@ -6,6 +6,9 @@ ent-FaxMachineCentcom = факс дальнего действия Центко ent-FaxMachineSyndie = факс дальнего действия Синдиката .suffix = Синдикат .desc = { ent-FaxMachineBase.desc } +ent-FaxMachineSyndieCommand = факс дальнего действия Командования Синдиката + .suffix = Командование Синдиката + .desc = { ent-FaxMachineBase.desc } ent-FaxMachineCaptain = факс дальнего действия капитана .suffix = ЯдерныеКоды .desc = { ent-FaxMachineBase.desc } diff --git a/Resources/Maps/White/centcomm.yml b/Resources/Maps/White/centcomm.yml index 2a13453b56..87dd367f5d 100644 --- a/Resources/Maps/White/centcomm.yml +++ b/Resources/Maps/White/centcomm.yml @@ -20883,7 +20883,7 @@ entities: parent: 1668 - type: FaxMachine name: CentComm -- proto: FaxMachineSyndie +- proto: FaxMachineSyndieCommand entities: - uid: 3902 components: diff --git a/Resources/Prototypes/Entities/Structures/Machines/fax_machine.yml b/Resources/Prototypes/Entities/Structures/Machines/fax_machine.yml index cbefa86808..d858f9b752 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/fax_machine.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/fax_machine.yml @@ -98,7 +98,7 @@ - type: FaxMachine name: "ERR*?*%!" responsePings: false - notifyAdmins: true + notifyAdmins: false # WD - type: Emagged - type: entity @@ -113,3 +113,20 @@ receiveStationGoal: true # WD - type: StealTarget stealGroup: FaxMachineCaptain + +- type: entity # WD + parent: FaxMachineBase + id: FaxMachineSyndieCommand + name: syndicate long range fax machine + suffix: Syndicate Command + components: + - type: Sprite + layers: + - state: icon + map: [ "base" ] + color: "#a3a3a3" + - type: FaxMachine + name: "Syndicate Command" + responsePings: false + notifyAdmins: true + - type: Emagged diff --git a/Resources/Prototypes/_White/event_prototypes.yml b/Resources/Prototypes/_White/event_prototypes.yml index 84406e754a..1cdb0b0c01 100644 --- a/Resources/Prototypes/_White/event_prototypes.yml +++ b/Resources/Prototypes/_White/event_prototypes.yml @@ -4,9 +4,8 @@ noSpawn: true components: - type: StationEvent - earliestStart: 25 weight: 0 - minimumPlayers: 125 duration: 20 - type: ERTRecruitmentRule - + minPlayer: 4 + earliestStart: 30