From 2c6a91136f88896e7c8e1534fa39e36f244fe88f Mon Sep 17 00:00:00 2001 From: AwareFoxy Date: Tue, 5 Nov 2024 22:08:59 +0100 Subject: [PATCH 1/6] purr! mreow --- Content.Client/LateJoin/LateJoinGui.cs | 4 +- .../Backmen/Arrivals/CentcommSystem.cs | 373 ++++++++++++++++++ .../Systems/KillPersonConditionSystem.cs | 51 +++ .../Systems/EmergencyShuttleSystem.cs | 113 ++---- .../Components/IdCardConsoleComponent.cs | 4 +- .../Backmen/Abilities/CentcomFTLAction.cs | 8 + .../Components/CentcommShuttleComponent.cs | 7 + .../CentComm/AllowFtlToCentComComponent.cs | 9 + .../backmen/actions/centcomm_actions.ftl | 5 + .../Entities/Markers/Spawners/jobs.yml | 23 ++ .../Backmen/Roles/play_time_trackers.yml | 5 + .../Roles/Jobs/CentCom/centcom_official.yml | 78 ++++ .../Roles/Jobs/Command/centcom_admiral.yml | 15 - .../Corvax/Roles/Jobs/departments.yml | 8 + .../Entities/Stations/nanotrasen.yml | 6 +- Resources/Prototypes/Maps/centcomm.yml | 12 +- .../Prototypes/_CorvaxNext/centcomm_pool.yml | 6 + .../Prototypes/_CorvaxNext/idcardconsole.yml | 60 +++ .../Misc/job_icons.rsi/Nanotrasen.png | Bin 123 -> 171 bytes 19 files changed, 673 insertions(+), 114 deletions(-) create mode 100644 Content.Server/Backmen/Arrivals/CentcommSystem.cs create mode 100644 Content.Shared/Backmen/Abilities/CentcomFTLAction.cs create mode 100644 Content.Shared/Backmen/Shuttles/Components/CentcommShuttleComponent.cs create mode 100644 Content.Shared/_CorvaxNext/CentComm/AllowFtlToCentComComponent.cs create mode 100644 Resources/Locale/ru-RU/backmen/actions/centcomm_actions.ftl create mode 100644 Resources/Prototypes/Backmen/Entities/Markers/Spawners/jobs.yml create mode 100644 Resources/Prototypes/Backmen/Roles/play_time_trackers.yml create mode 100644 Resources/Prototypes/Corvax/Roles/Jobs/CentCom/centcom_official.yml delete mode 100644 Resources/Prototypes/Corvax/Roles/Jobs/Command/centcom_admiral.yml create mode 100644 Resources/Prototypes/Corvax/Roles/Jobs/departments.yml create mode 100644 Resources/Prototypes/_CorvaxNext/centcomm_pool.yml create mode 100644 Resources/Prototypes/_CorvaxNext/idcardconsole.yml diff --git a/Content.Client/LateJoin/LateJoinGui.cs b/Content.Client/LateJoin/LateJoinGui.cs index ac0a7a4aa99..f2c15593aad 100644 --- a/Content.Client/LateJoin/LateJoinGui.cs +++ b/Content.Client/LateJoin/LateJoinGui.cs @@ -84,7 +84,9 @@ private void RebuildUI() if (!_gameTicker.DisallowedLateJoin && _gameTicker.StationNames.Count == 0) Logger.Warning("No stations exist, nothing to display in late-join GUI"); - foreach (var (id, name) in _gameTicker.StationNames) + foreach (var (id, name) in _gameTicker.StationNames + .OrderBy(x=> x.Value.Contains("Central Command") ? 1 : -1) //backmen: centcom + ) { var jobList = new BoxContainer { diff --git a/Content.Server/Backmen/Arrivals/CentcommSystem.cs b/Content.Server/Backmen/Arrivals/CentcommSystem.cs new file mode 100644 index 00000000000..44a959edc3b --- /dev/null +++ b/Content.Server/Backmen/Arrivals/CentcommSystem.cs @@ -0,0 +1,373 @@ +using System.Numerics; +using Content.Server.Chat.Systems; +using Content.Server.GameTicking; +using Content.Server.GameTicking.Events; +using Content.Server.Maps; +using Content.Server.Popups; +using Content.Server.Power.EntitySystems; +using Content.Server.Salvage.Expeditions; +using Content.Server.Shuttles; +using Content.Server.Shuttles.Components; +using Content.Server.Shuttles.Events; +using Content.Server.Shuttles.Systems; +using Content.Server.Station.Components; +using Content.Server.Station.Systems; +using Content.Shared.Backmen.Abilities; +using Content.Shared._FishStation.CentComm; +using Content.Shared.Cargo.Components; +using Content.Shared.CCVar; +using Content.Shared.Emag.Components; +using Content.Shared.Emag.Systems; +using Content.Shared.GameTicking; +using Content.Shared.Random; +using Content.Shared.Random.Helpers; +using Content.Shared.Shuttles.Components; +using Content.Shared.Whitelist; +using Robust.Server.GameObjects; +using Robust.Server.Maps; +using Robust.Shared.Audio; +using Robust.Shared.Audio.Systems; +using Robust.Shared.Configuration; +using Robust.Shared.Map; +using Robust.Shared.Player; +using Robust.Shared.Prototypes; +using Robust.Shared.Random; +using Robust.Shared.Utility; + +namespace Content.Server.Backmen.Arrivals; + +public sealed class FtlCentComAnnounce : EntityEventArgs +{ + public Entity Source { get; set; } +} + +public sealed class CentcommSystem : EntitySystem +{ + [Dependency] private readonly PopupSystem _popup = default!; + [Dependency] private readonly ShuttleSystem _shuttleSystem = default!; + [Dependency] private readonly StationSystem _stationSystem = default!; + [Dependency] private readonly IMapManager _mapManager = default!; + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly GameTicker _gameTicker = default!; + [Dependency] private readonly ShuttleSystem _shuttle = default!; + [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private readonly ShuttleConsoleSystem _console = default!; + [Dependency] private readonly SharedAudioSystem _audio = default!; + [Dependency] private readonly PopupSystem _popupSystem = default!; + [Dependency] private readonly ChatSystem _chat = default!; + [Dependency] private readonly MetaDataSystem _metaDataSystem = default!; + private ISawmill _sawmill = default!; + + + public EntityUid CentComGrid { get; private set; } = EntityUid.Invalid; + public MapId CentComMap { get; private set; } = MapId.Nullspace; + public EntityUid CentComMapUid { get; private set; } = EntityUid.Invalid; + public float ShuttleIndex { get; set; } = 0; + + private WeightedRandomPrototype _stationCentComMapPool = default!; + + public override void Initialize() + { + base.Initialize(); + _sawmill = Logger.GetSawmill("centcom"); + SubscribeLocalEvent(OnFtlActionUsed); + SubscribeLocalEvent(OnPreGameMapLoad, after: new[] { typeof(StationSystem) }); + SubscribeLocalEvent(OnCentComInit, before: new[] { typeof(EmergencyShuttleSystem) }); + SubscribeLocalEvent(OnCentComEndRound); + SubscribeLocalEvent(OnCleanup); + SubscribeLocalEvent(OnShuttleConsoleEmaged); + SubscribeLocalEvent(OnFTLCompleted); + SubscribeLocalEvent(OnFtlAnnounce); + _cfg.OnValueChanged(CCVars.GridFill, OnGridFillChange); + + _stationCentComMapPool = _prototypeManager.Index(StationCentComMapPool); + } + + private void OnCentComEndRound(RoundEndedEvent ev) + { + if (CentComMapUid.IsValid() && _shuttleSystem.TryAddFTLDestination(CentComMap, true, out var ftl)) + { + EnableFtl((CentComMapUid, ftl)); + } + } + + private void OnFtlAnnounce(FtlCentComAnnounce ev) + { + if (!CentComGrid.IsValid()) + { + return; // not loaded centcom + } + + var transformQuery = EntityQueryEnumerator(); + + var shuttleName = "Неизвестный"; + + while (transformQuery.MoveNext(out var owner, out var transformComponent, out var iff)) + { + if (transformComponent.GridUid != ev.Source) + { + continue; + } + + var f = iff.AllowedFlags; + if (f.HasFlag(IFFFlags.Hide)) + { + continue; + } + + var name = MetaData(ev.Source).EntityName; + if (string.IsNullOrWhiteSpace(name)) + { + continue; + } + + shuttleName = name; + } + + if (_gameTicker.RunLevel != GameRunLevel.InRound) + { + return; // Do not announce out of round + } + + _chat.DispatchStationAnnouncement(CentComGrid, + $"Внимание! Радары обнаружили {shuttleName} шаттл, входящий в космическое пространство объекта Центрального Командования!", + "Радар", colorOverride: Color.Crimson); + } + + private void OnFTLCompleted(ref FTLCompletedEvent ev) + { + if (!CentComGrid.IsValid()) + { + return; // not loaded centcom + } + + if (ev.MapUid != _mapManager.GetMapEntityId(CentComMap)) + { + return; // not centcom + } + + if (!TryComp(ev.Entity, out var shuttleComponent)) + { + return; + } + + QueueLocalEvent(new FtlCentComAnnounce + { + Source = (ev.Entity, shuttleComponent!) + }); + } + + private static readonly SoundSpecifier SparkSound = new SoundCollectionSpecifier("sparks"); + + [ValidatePrototypeId] + private const string StationShuttleConsole = "ComputerShuttle"; + + private void OnShuttleConsoleEmaged(Entity ent, ref GotEmaggedEvent args) + { + if (Prototype(ent)?.ID != StationShuttleConsole) + { + return; + } + + if (!this.IsPowered(ent, EntityManager)) + return; + + var shuttle = Transform(ent).GridUid; + if (!HasComp(shuttle)) + return; + + if (!(HasComp(shuttle) || HasComp(shuttle))) + return; + + _audio.PlayPvs(SparkSound, ent); + _popupSystem.PopupEntity(Loc.GetString("shuttle-console-component-upgrade-emag-requirement"), ent); + args.Handled = true; + EnsureComp(shuttle.Value); // для обновления консоли нужно чтобы компонент был до вызыва RefreshShuttleConsoles + _console.RefreshShuttleConsoles(); + } + + private void OnGridFillChange(bool obj) + { + if (obj) + { + EnsureCentcom(true); + } + } + + private void OnCleanup(RoundRestartCleanupEvent ev) + { + _sawmill.Info("OnCleanup"); + QueueDel(CentComGrid); + CentComGrid = EntityUid.Invalid; + + if (_mapManager.MapExists(CentComMap)) + _mapManager.DeleteMap(CentComMap); + + CentComMap = MapId.Nullspace; + CentComMapUid = EntityUid.Invalid; + ShuttleIndex = 0; + } + + [ValidatePrototypeId] + private const string StationCentComMapPool = "DefaultCentcomPool"; + + [ValidatePrototypeId] + private const string StationCentComMapDefault = "centcommcorvax"; + + + public void EnsureCentcom(bool force = false) + { + if (!_cfg.GetCVar(CCVars.GridFill) && !force) + { + return; + } + + _sawmill.Info("EnsureCentcom"); + if (CentComGrid.IsValid()) + { + return; + } + + _sawmill.Info("Start load centcom"); + + if (CentComMap == MapId.Nullspace) + { + CentComMap = _mapManager.CreateMap(); + } + + CentComMapUid = _mapManager.GetMapEntityId(CentComMap); + + var mapId = _stationCentComMapPool.Pick(); + if (!_prototypeManager.TryIndex(mapId, out var map)) + { + mapId = StationCentComMapDefault; + map = _prototypeManager.Index(StationCentComMapDefault); + } + + + var ent = _gameTicker.LoadGameMap( + map, CentComMap, new MapLoadOptions() + { + LoadMap = false + }, "Central Command").FirstOrNull(HasComp); + + _metaDataSystem.SetEntityName(_mapManager.GetMapEntityId(CentComMap), "CentCom"); + + if (ent != null) + { + CentComGrid = ent.Value; + if (_shuttle.TryAddFTLDestination(CentComMap, true, out var ftl)) + { + DisableFtl((CentComMapUid,ftl)); + } + } + else + { + _sawmill.Warning("No CentComm map found, skipping setup."); + return; + } + + var q = EntityQueryEnumerator(); + while (q.MoveNext(out var station)) + { + station.MapEntity = CentComMapUid; + station.Entity = CentComGrid; + station.ShuttleIndex = ShuttleIndex; + } + } + + // ReSharper disable once MemberCanBePrivate.Global + public void DisableFtl(Entity ent) + { + var d = new EntityWhitelist(); + d.RequireAll = false; + d.Components = new[] { "AllowFtlToCentCom" }; + d.UpdateRegistrations(); + _shuttle.SetFTLWhitelist(ent, d); + } + + public void EnableFtl(Entity ent) + { + _shuttle.SetFTLWhitelist(ent, null); + } + + private void OnCentComInit(RoundStartingEvent ev) + { + { + return; + } + } + + private void OnPreGameMapLoad(PreGameMapLoad ev) + { + if (!_stationCentComMapPool.Weights.ContainsKey(ev.GameMap.ID)) + { + if(ev.GameMap.ID != StationCentComMapDefault) // fallback + return; + } + + ev.Options.Offset = new Vector2(0, 0); + } + + private void OnFtlActionUsed(EntityUid uid, ActorComponent component, CentcomFtlAction args) + { + var grid = Transform(args.Performer); + if (grid.GridUid == null) + { + return; + } + + if (!TryComp(args.Performer, out var pilotComponent) || pilotComponent.Console == null) + { + _popup.PopupEntity(Loc.GetString("centcom-ftl-action-no-pilot"), args.Performer, args.Performer); + return; + } + + TransformComponent shuttle; + + if (TryComp(pilotComponent.Console, out var droneConsoleComponent) && + droneConsoleComponent.Entity != null) + { + shuttle = Transform(droneConsoleComponent.Entity.Value); + } + else + { + shuttle = grid; + } + + + if (!TryComp(shuttle.GridUid, out var comp) || HasComp(shuttle.GridUid) || ( + HasComp(shuttle.GridUid) && + !( + HasComp(shuttle.GridUid) || + HasComp(shuttle.GridUid) + ) + )) + { + return; + } + + var stationUid = _stationSystem.GetStations().FirstOrNull(HasComp); + + if (!TryComp(stationUid, out var centcomm) || + centcomm.Entity == null || !centcomm.Entity.Value.IsValid() || Deleted(centcomm.Entity)) + { + _popup.PopupEntity(Loc.GetString("centcom-ftl-action-no-station"), args.Performer, args.Performer); + return; + } +/* + if (shuttle.MapUid == centcomm.MapEntity) + { + _popup.PopupEntity(Loc.GetString("centcom-ftl-action-at-centcomm"), args.Performer, args.Performer); + return; + } +*/ + if (!_shuttleSystem.CanFTL(shuttle.GridUid.Value, out var reason)) + { + _popup.PopupEntity(reason, args.Performer, args.Performer); + return; + } + + _shuttleSystem.FTLToDock(shuttle.GridUid.Value, comp, centcomm.Entity.Value); + } +} diff --git a/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs b/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs index 8dcbf191b36..f251afed936 100644 --- a/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs +++ b/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs @@ -1,10 +1,15 @@ +using System.Linq; using Content.Server.Objectives.Components; using Content.Server.Revolutionary.Components; using Content.Server.Shuttles.Systems; +using Content.Server.Station.Components; using Content.Shared.CCVar; using Content.Shared.Mind; using Content.Shared.Objectives.Components; +using Content.Shared.Roles; +using Content.Shared.Roles.Jobs; using Robust.Shared.Configuration; +using Robust.Shared.Prototypes; using Robust.Shared.Random; namespace Content.Server.Objectives.Systems; @@ -19,6 +24,10 @@ public sealed class KillPersonConditionSystem : EntitySystem [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly SharedMindSystem _mind = default!; [Dependency] private readonly TargetObjectiveSystem _target = default!; + [Dependency] private readonly SharedRoleSystem _roleSystem = default!; + [Dependency] private readonly IPrototypeManager _prototype = default!; + + private static readonly ProtoId _ccDep = "CentCom"; public override void Initialize() { @@ -60,9 +69,41 @@ private void OnPersonAssigned(EntityUid uid, PickRandomPersonComponent comp, ref return; } + // start-backmen: centcom + FilterCentCom(allHumans); + + if (allHumans.Count == 0) + { + args.Cancelled = true; + return; + } + // end-backmen: centcom + _target.SetTarget(uid, _random.Pick(allHumans), target); + } + // start-backmen: centcom + private void FilterCentCom(List minds) + { + var centcom = _prototype.Index(_ccDep); + foreach (var mindId in minds.ToArray()) + { + if (!TryComp(mindId, out var job) || job.Prototype == null) + { + continue; + } + + if (!centcom.Roles.Contains(job.Prototype)) + { + continue; + } + + minds.Remove(mindId); + } + } + // end-backmen: centcom + private void OnHeadAssigned(EntityUid uid, PickRandomHeadComponent comp, ref ObjectiveAssignedEvent args) { // invalid prototype @@ -84,6 +125,16 @@ private void OnHeadAssigned(EntityUid uid, PickRandomHeadComponent comp, ref Obj return; } + // start-backmen: centcom + FilterCentCom(allHumans); + + if (allHumans.Count == 0) + { + args.Cancelled = true; + return; + } + // end-backmen: centcom + var allHeads = new List(); foreach (var person in allHumans) { diff --git a/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs b/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs index 6c4bdc08148..e4e4ba175f7 100644 --- a/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs +++ b/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs @@ -35,6 +35,7 @@ using Robust.Shared.Map; using Robust.Shared.Map.Components; using Robust.Shared.Player; +using Robust.Shared.Prototypes; using Robust.Shared.Random; using Robust.Shared.Timing; using Robust.Shared.Utility; @@ -69,6 +70,8 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem [Dependency] private readonly StationSystem _station = default!; [Dependency] private readonly TransformSystem _transformSystem = default!; [Dependency] private readonly UserInterfaceSystem _uiSystem = default!; + [Dependency] private readonly Content.Server.Backmen.Arrivals.CentcommSystem _centcommSystem = default!; + private const float ShuttleSpawnBuffer = 1f; @@ -81,13 +84,14 @@ public override void Initialize() { _emergencyShuttleEnabled = _configManager.GetCVar(CCVars.EmergencyShuttleEnabled); // Don't immediately invoke as roundstart will just handle it. - Subs.CVar(_configManager, CCVars.EmergencyShuttleEnabled, SetEmergencyShuttleEnabled); + + //Subs.CVar(_configManager, CCVars.EmergencyShuttleEnabled, SetEmergencyShuttleEnabled); + _configManager.OnValueChanged(CCVars.EmergencyShuttleEnabled, value => SetEmergencyShuttleEnabled(value), true); SubscribeLocalEvent(OnRoundStart); - SubscribeLocalEvent(OnRoundCleanup); - SubscribeLocalEvent(OnStationStartup); - SubscribeLocalEvent(OnCentcommShutdown); - SubscribeLocalEvent(OnStationInit); + SubscribeLocalEvent(OnStationStartup); + //SubscribeLocalEvent(OnCentcommShutdown); // backmen: centcom + SubscribeLocalEvent(OnCentcommInit); SubscribeLocalEvent(OnEmergencyFTL); SubscribeLocalEvent(OnEmergencyFTLComplete); @@ -495,90 +499,27 @@ private void SetupEmergencyShuttle() } } - private void AddCentcomm(EntityUid station, StationCentcommComponent component) +// start-backmen: centcom + private void AddCentcomm(StationCentcommComponent component) { - DebugTools.Assert(LifeStage(station) >= EntityLifeStage.MapInitialized); - if (component.MapEntity != null || component.Entity != null) - { - Log.Warning("Attempted to re-add an existing centcomm map."); - return; - } - - // Check for existing centcomms and just point to that - var query = AllEntityQuery(); - while (query.MoveNext(out var otherComp)) - { - if (otherComp == component) - continue; - - if (!Exists(otherComp.MapEntity) || !Exists(otherComp.Entity)) - { - Log.Error($"Discovered invalid centcomm component?"); - ClearCentcomm(otherComp); - continue; - } - - component.MapEntity = otherComp.MapEntity; - component.Entity = otherComp.Entity; - component.ShuttleIndex = otherComp.ShuttleIndex; - return; - } - - if (string.IsNullOrEmpty(component.Map.ToString())) - { - Log.Warning("No CentComm map found, skipping setup."); - return; - } - - var map = _mapSystem.CreateMap(out var mapId); - var grid = _map.LoadGrid(mapId, component.Map.ToString(), new MapLoadOptions() - { - LoadMap = false, - }); - - if (!Exists(map)) - { - Log.Error($"Failed to set up centcomm map!"); - QueueDel(grid); - return; - } - - if (!Exists(grid)) - { - Log.Error($"Failed to set up centcomm grid!"); - QueueDel(map); - return; - } + var centcom = EntityManager.System(); - var xform = Transform(grid.Value); - if (xform.ParentUid != map || xform.MapUid != map) - { - Log.Error($"Centcomm grid is not parented to its own map?"); - QueueDel(map); - QueueDel(grid); - return; - } - - component.MapEntity = map; - _metaData.SetEntityName(map, Loc.GetString("map-name-centcomm")); - component.Entity = grid; - _shuttle.TryAddFTLDestination(mapId, true, out _); - Log.Info($"Created centcomm grid {ToPrettyString(grid)} on map {ToPrettyString(map)} for station {ToPrettyString(station)}"); + centcom.EnsureCentcom(true); + component.MapEntity = centcom.CentComMapUid; + component.Entity = centcom.CentComGrid; + component.ShuttleIndex = centcom.ShuttleIndex; } public HashSet GetCentcommMaps() { - var query = AllEntityQuery(); - var maps = new HashSet(Count()); + var maps = new HashSet(); - while (query.MoveNext(out var comp)) - { - if (comp.MapEntity != null) - maps.Add(comp.MapEntity.Value); - } + if(_centcommSystem.CentComMapUid.IsValid()) + maps.Add(_centcommSystem.CentComMapUid); return maps; } +// end-backmen: centcom private void AddEmergencyShuttle(Entity ent) { @@ -622,18 +563,8 @@ private void AddEmergencyShuttle(Entity(shuttle.Value).LocalAABB.Width + ShuttleSpawnBuffer; - - // Update indices for all centcomm comps pointing to same map - var query = AllEntityQuery(); - - while (query.MoveNext(out var comp)) - { - if (comp == ent.Comp2 || comp.MapEntity != ent.Comp2.MapEntity) - continue; - - comp.ShuttleIndex = ent.Comp2.ShuttleIndex; - } + centcomm.ShuttleIndex = _centcommSystem.ShuttleIndex; + _centcommSystem.ShuttleIndex += _mapManager.GetGrid(shuttle.Value).LocalAABB.Width + ShuttleSpawnBuffer; ent.Comp1.EmergencyShuttle = shuttle; EnsureComp(shuttle.Value); diff --git a/Content.Shared/Access/Components/IdCardConsoleComponent.cs b/Content.Shared/Access/Components/IdCardConsoleComponent.cs index 4f1c27fb4d3..7c6da919fc2 100644 --- a/Content.Shared/Access/Components/IdCardConsoleComponent.cs +++ b/Content.Shared/Access/Components/IdCardConsoleComponent.cs @@ -10,8 +10,8 @@ namespace Content.Shared.Access.Components; [Access(typeof(SharedIdCardConsoleSystem))] public sealed partial class IdCardConsoleComponent : Component { - public const int MaxFullNameLength = 30; - public const int MaxJobTitleLength = 30; + public const int MaxFullNameLength = 64; + public const int MaxJobTitleLength = 64; public static string PrivilegedIdCardSlotId = "IdCardConsole-privilegedId"; public static string TargetIdCardSlotId = "IdCardConsole-targetId"; diff --git a/Content.Shared/Backmen/Abilities/CentcomFTLAction.cs b/Content.Shared/Backmen/Abilities/CentcomFTLAction.cs new file mode 100644 index 00000000000..4726504f5cc --- /dev/null +++ b/Content.Shared/Backmen/Abilities/CentcomFTLAction.cs @@ -0,0 +1,8 @@ +using Content.Shared.Actions; + +namespace Content.Shared.Backmen.Abilities; + +public sealed partial class CentcomFtlAction : InstantActionEvent +{ + +} diff --git a/Content.Shared/Backmen/Shuttles/Components/CentcommShuttleComponent.cs b/Content.Shared/Backmen/Shuttles/Components/CentcommShuttleComponent.cs new file mode 100644 index 00000000000..f68f2f63df5 --- /dev/null +++ b/Content.Shared/Backmen/Shuttles/Components/CentcommShuttleComponent.cs @@ -0,0 +1,7 @@ +namespace Content.Shared.Backmen.Shuttles.Components; + +[RegisterComponent] +public sealed partial class CentcommShuttleComponent : Component +{ + +} diff --git a/Content.Shared/_CorvaxNext/CentComm/AllowFtlToCentComComponent.cs b/Content.Shared/_CorvaxNext/CentComm/AllowFtlToCentComComponent.cs new file mode 100644 index 00000000000..84f27ade33b --- /dev/null +++ b/Content.Shared/_CorvaxNext/CentComm/AllowFtlToCentComComponent.cs @@ -0,0 +1,9 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared._FishStation.CentComm; + +[RegisterComponent, NetworkedComponent] +public sealed partial class AllowFtlToCentComComponent : Component +{ + +} diff --git a/Resources/Locale/ru-RU/backmen/actions/centcomm_actions.ftl b/Resources/Locale/ru-RU/backmen/actions/centcomm_actions.ftl new file mode 100644 index 00000000000..b218b75ede1 --- /dev/null +++ b/Resources/Locale/ru-RU/backmen/actions/centcomm_actions.ftl @@ -0,0 +1,5 @@ +centcom-ftl-action-at-centcomm = Вы уже находитесь на ЦентКомме +centcom-ftl-action-no-station = Станция ЦентКомма не найдена +centcom-ftl-action-no-pilot = Вы не пилотируете шаттл +centcom-ftl-action-name = Ключ навигации ЦентКомма +centcom-ftl-action-description = Позволяет совершить прыжок на станцию ЦентКомма diff --git a/Resources/Prototypes/Backmen/Entities/Markers/Spawners/jobs.yml b/Resources/Prototypes/Backmen/Entities/Markers/Spawners/jobs.yml new file mode 100644 index 00000000000..5db3f183456 --- /dev/null +++ b/Resources/Prototypes/Backmen/Entities/Markers/Spawners/jobs.yml @@ -0,0 +1,23 @@ +- type: entity + id: SpawnPointCCOperator + parent: SpawnPointJobBase + name: ЦК Оператор + components: + - type: SpawnPoint + job_id: CCOperator + - type: Sprite + layers: + - state: green + - state: captain + +- type: entity + id: SpawnPointCCSecurity + parent: SpawnPointJobBase + name: ЦК Охрана + components: + - type: SpawnPoint + job_id: CCSecurity + - type: Sprite + layers: + - state: green + - state: captain diff --git a/Resources/Prototypes/Backmen/Roles/play_time_trackers.yml b/Resources/Prototypes/Backmen/Roles/play_time_trackers.yml new file mode 100644 index 00000000000..f0bdc69734e --- /dev/null +++ b/Resources/Prototypes/Backmen/Roles/play_time_trackers.yml @@ -0,0 +1,5 @@ +- type: playTimeTracker + id: JobCentralCommandOperator + +- type: playTimeTracker + id: JobCentralCommandSecurity diff --git a/Resources/Prototypes/Corvax/Roles/Jobs/CentCom/centcom_official.yml b/Resources/Prototypes/Corvax/Roles/Jobs/CentCom/centcom_official.yml new file mode 100644 index 00000000000..6940b72220b --- /dev/null +++ b/Resources/Prototypes/Corvax/Roles/Jobs/CentCom/centcom_official.yml @@ -0,0 +1,78 @@ +- type: job + id: CCOperator + name: Оператор ЦК + description: Оператор Центрального Командования. Истинный бюрократ. + playTimeTracker: JobCentralCommandOperator + setPreference: true + startingGear: CCOperator + icon: "JobIconNanotrasen" + supervisors: job-supervisors-centcom2 # Corvax-JobSupervisors + whitelisted: true + canBeAntag: false + weight: 1 + requireAdminNotify: true + joinNotifyCrew: true + setHideFromConsole: true + accessGroups: + - AllAccess + access: + - CentralCommand + special: + - !type:AddImplantSpecial + implants: [ MindShieldImplant, TrackingImplant ] + +- type: job + id: CCSecurity + name: Служба Безопасности ЦентКом + description: Не звонит вам и не просит последние три цифры с карты. + playTimeTracker: JobCentralCommandSecurity + setPreference: true + startingGear: OfficerCentCom + icon: "JobIconNanotrasen" + supervisors: job-supervisors-centcom2 # Corvax-JobSupervisors + whitelisted: true + canBeAntag: false + weight: 1 + requireAdminNotify: true + joinNotifyCrew: true + setHideFromConsole: true + accessGroups: + - AllAccess + access: + - CentralCommand + special: + - !type:AddImplantSpecial + implants: [ MindShieldImplant, TrackingImplant ] + +- type: startingGear + id: Operator + equipment: + jumpsuit: ClothingUniformJumpsuitCentcomOfficer + back: ClothingBackpackFilled + shoes: ClothingShoesBootsJack + eyes: ClothingEyesGlassesSunglasses + head: ClothingHeadHatBeretCentcomNaval + id: CentcomPDA + ears: ClothingHeadsetCentCom + pocket1: PenCentcom + pocket2: BoxFolderCentComClipboard + gloves: ClothingHandsGlovesCombat + satchel: ClothingBackpackSatchelFilled + duffelbag: ClothingBackpackDuffelFilled + +- type: startingGear + id: OfficerCentCom + equipment: + jumpsuit: ClothingUniformJumpsuitHoSAlt + back: ClothingBackpackFilled + mask: ClothingMaskGasSecurity + shoes: ClothingShoesBootsJack + eyes: ClothingEyesGlassesSecurity + gloves: ClothingHandsGlovesCombat + outerClothing: ClothingOuterArmorBasic + suitstorage: WeaponPistolMk58 + head: ClothingHeadHatBeretHoS + id: CentcomPDA + ears: ClothingHeadsetCentCom + belt: ClothingBeltSecurity + pocket2: MagazinePistol diff --git a/Resources/Prototypes/Corvax/Roles/Jobs/Command/centcom_admiral.yml b/Resources/Prototypes/Corvax/Roles/Jobs/Command/centcom_admiral.yml deleted file mode 100644 index a652fc346ea..00000000000 --- a/Resources/Prototypes/Corvax/Roles/Jobs/Command/centcom_admiral.yml +++ /dev/null @@ -1,15 +0,0 @@ -# Just equipment preset, no custom role - -- type: startingGear - id: CentcomAdmiralGear - equipment: - jumpsuit: ClothingUniformJumpsuitCentcomAdmiral - shoes: ClothingShoesBootsJack - head: ClothingHeadCapCentcomNaval - eyes: ClothingEyesGlassesSunglasses - gloves: ClothingHandsGlovesCentcomNaval - outerClothing: ClothingOuterArmorCentcomCarapace - neck: ClothingNeckCloakCentcomAdmiral - id: CentcomPDA - ears: ClothingHeadsetCentCom - pocket1: RubberStampCentcom diff --git a/Resources/Prototypes/Corvax/Roles/Jobs/departments.yml b/Resources/Prototypes/Corvax/Roles/Jobs/departments.yml new file mode 100644 index 00000000000..d01d0e9e767 --- /dev/null +++ b/Resources/Prototypes/Corvax/Roles/Jobs/departments.yml @@ -0,0 +1,8 @@ +- type: department + id: Центральное Командование + description: Лучшие из лучших. Только по вайтлисту. + color: "#13db0f" + roles: + - CCSecurity + - CCOperator + - CCIntern diff --git a/Resources/Prototypes/Entities/Stations/nanotrasen.yml b/Resources/Prototypes/Entities/Stations/nanotrasen.yml index c2a4bfb11a8..4181cfa85f2 100644 --- a/Resources/Prototypes/Entities/Stations/nanotrasen.yml +++ b/Resources/Prototypes/Entities/Stations/nanotrasen.yml @@ -36,7 +36,11 @@ - BaseStation - BaseStationAlertLevels - BaseStationNanotrasen - categories: [ HideSpawnMenu ] + - BaseStationCargo #Backmen + - BaseStationJobsSpawning #Backmen + - BaseStationRecords #Backmen + - BaseStationShuttles #Backmen + noSpawn: true components: - type: Transform diff --git a/Resources/Prototypes/Maps/centcomm.yml b/Resources/Prototypes/Maps/centcomm.yml index 47dc5ca1f3e..328d193a295 100644 --- a/Resources/Prototypes/Maps/centcomm.yml +++ b/Resources/Prototypes/Maps/centcomm.yml @@ -1,10 +1,10 @@ - type: gameMap - id: CentComm + id: centcommcorvax mapName: 'Central Command' - mapPath: /Maps/centcomm.yml - minPlayers: 10 + mapPath: /Maps/corvax_centcomm.yml + minPlayers: 0 stations: - centcomm: + centcommcorvax: stationProto: NanotrasenCentralCommand components: - type: StationNameSetup @@ -12,3 +12,7 @@ nameGenerator: !type:NanotrasenNameGenerator prefixCreator: 'TG' + - type: StationJobs + availableJobs: + CCOperator: [ 2, 2] + CCSecurity: [ 3, 3] diff --git a/Resources/Prototypes/_CorvaxNext/centcomm_pool.yml b/Resources/Prototypes/_CorvaxNext/centcomm_pool.yml new file mode 100644 index 00000000000..b71bb291523 --- /dev/null +++ b/Resources/Prototypes/_CorvaxNext/centcomm_pool.yml @@ -0,0 +1,6 @@ +- type: weightedRandom + id: DefaultCentcomPool + weights: + centcommcorvax: 1 +# CentCommv2: 0.35 // soon +# CentCommv3: 0.7 // soon diff --git a/Resources/Prototypes/_CorvaxNext/idcardconsole.yml b/Resources/Prototypes/_CorvaxNext/idcardconsole.yml new file mode 100644 index 00000000000..e2e6e5fad0d --- /dev/null +++ b/Resources/Prototypes/_CorvaxNext/idcardconsole.yml @@ -0,0 +1,60 @@ +- type: entity + parent: ComputerId + id: CCComputerId + name: Консоль ID карт ЦК + description: Terminal for programming Nanotrasen employee ID cards to access parts of the station. + components: + - type: IdCardConsole + accessLevels: + - CentralCommand + - Armory + - Atmospherics + - Bar + - Brig + - Blueshield + - Detective + - Captain + - Cargo + - Chapel + - Chemistry + - ChiefEngineer + - ChiefMedicalOfficer + - Command + - Cryogenics + - Engineering + - External + - HeadOfPersonnel + - HeadOfSecurity + - Hydroponics + - Janitor + - Kitchen + - Lawyer + - Magistrat + - Maintenance + - Medical + - NanotrasenRepresentive + - Quartermaster + - Research + - ResearchDirector + - Salvage + - Security + - Service + - Theatre + privilegedIdSlot: + name: id-card-console-privileged-id + ejectSound: /Audio/Machines/id_swipe.ogg + insertSound: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg + ejectOnBreak: true + swap: false + whitelist: + components: + - IdCard + targetIdSlot: + name: id-card-console-target-id + ejectSound: /Audio/Machines/id_swipe.ogg + insertSound: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg + ejectOnBreak: true + swap: false + whitelist: + components: + - IdCard diff --git a/Resources/Textures/Interface/Misc/job_icons.rsi/Nanotrasen.png b/Resources/Textures/Interface/Misc/job_icons.rsi/Nanotrasen.png index ff24b4c04c120e68d188c69d52ce6729e9ad8bdc..8a0814ffb50e1289ad6c3015ada9716ef29c53ce 100644 GIT binary patch delta 154 zcmb+0nftnOf5mo~}55-+d8#oPE6{PN(xYhLiDf%nU ztn49fm(RptCL!DgV From f6351e9d9f386a063ab2e7d9ab5f2671e0be953d Mon Sep 17 00:00:00 2001 From: AwareFoxy Date: Wed, 6 Nov 2024 01:56:38 +0100 Subject: [PATCH 2/6] purr mreoww part 2 --- .../Backmen/Arrivals/CentcommSystem.cs | 91 +++++++++++-------- .../Systems/KillPersonConditionSystem.cs | 4 +- .../Systems/EmergencyShuttleSystem.cs | 28 ++++-- .../CentComm/AllowFtlToCentComComponent.cs | 2 +- .../CentComm/FtlActionComponent.cs | 8 ++ 5 files changed, 82 insertions(+), 51 deletions(-) create mode 100644 Content.Shared/_CorvaxNext/CentComm/FtlActionComponent.cs diff --git a/Content.Server/Backmen/Arrivals/CentcommSystem.cs b/Content.Server/Backmen/Arrivals/CentcommSystem.cs index 44a959edc3b..de085487f79 100644 --- a/Content.Server/Backmen/Arrivals/CentcommSystem.cs +++ b/Content.Server/Backmen/Arrivals/CentcommSystem.cs @@ -1,4 +1,4 @@ -using System.Numerics; +using System.Numerics; using Content.Server.Chat.Systems; using Content.Server.GameTicking; using Content.Server.GameTicking.Events; @@ -13,7 +13,7 @@ using Content.Server.Station.Components; using Content.Server.Station.Systems; using Content.Shared.Backmen.Abilities; -using Content.Shared._FishStation.CentComm; +using Content.Shared.Backmen.CentComm; using Content.Shared.Cargo.Components; using Content.Shared.CCVar; using Content.Shared.Emag.Components; @@ -56,8 +56,8 @@ public sealed class CentcommSystem : EntitySystem [Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly ChatSystem _chat = default!; [Dependency] private readonly MetaDataSystem _metaDataSystem = default!; - private ISawmill _sawmill = default!; - + [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly EntityLookupSystem _lookup = default!; public EntityUid CentComGrid { get; private set; } = EntityUid.Invalid; public MapId CentComMap { get; private set; } = MapId.Nullspace; @@ -69,7 +69,6 @@ public sealed class CentcommSystem : EntitySystem public override void Initialize() { base.Initialize(); - _sawmill = Logger.GetSawmill("centcom"); SubscribeLocalEvent(OnFtlActionUsed); SubscribeLocalEvent(OnPreGameMapLoad, after: new[] { typeof(StationSystem) }); SubscribeLocalEvent(OnCentComInit, before: new[] { typeof(EmergencyShuttleSystem) }); @@ -78,11 +77,19 @@ public override void Initialize() SubscribeLocalEvent(OnShuttleConsoleEmaged); SubscribeLocalEvent(OnFTLCompleted); SubscribeLocalEvent(OnFtlAnnounce); + SubscribeLocalEvent(OnLoadingMaps); _cfg.OnValueChanged(CCVars.GridFill, OnGridFillChange); _stationCentComMapPool = _prototypeManager.Index(StationCentComMapPool); } + private void OnLoadingMaps(LoadingMapsEvent ev) + { + if (!_cfg.GetCVar(CCVars.GridFill)) + return; + EnsureCentcom(true); + } + private void OnCentComEndRound(RoundEndedEvent ev) { if (CentComMapUid.IsValid() && _shuttleSystem.TryAddFTLDestination(CentComMap, true, out var ftl)) @@ -91,6 +98,7 @@ private void OnCentComEndRound(RoundEndedEvent ev) } } + private readonly HashSet> _iFfConsoleEntities = new(); private void OnFtlAnnounce(FtlCentComAnnounce ev) { if (!CentComGrid.IsValid()) @@ -98,17 +106,13 @@ private void OnFtlAnnounce(FtlCentComAnnounce ev) return; // not loaded centcom } - var transformQuery = EntityQueryEnumerator(); - var shuttleName = "Неизвестный"; - while (transformQuery.MoveNext(out var owner, out var transformComponent, out var iff)) - { - if (transformComponent.GridUid != ev.Source) - { - continue; - } + _iFfConsoleEntities.Clear(); + _lookup.GetGridEntities(ev.Source, _iFfConsoleEntities); + foreach (var (owner,iff) in _iFfConsoleEntities) + { var f = iff.AllowedFlags; if (f.HasFlag(IFFFlags.Hide)) { @@ -190,13 +194,13 @@ private void OnGridFillChange(bool obj) { if (obj) { - EnsureCentcom(true); + EnsureCentcom(); } } private void OnCleanup(RoundRestartCleanupEvent ev) { - _sawmill.Info("OnCleanup"); + Log.Info("OnCleanup"); QueueDel(CentComGrid); CentComGrid = EntityUid.Invalid; @@ -212,23 +216,21 @@ private void OnCleanup(RoundRestartCleanupEvent ev) private const string StationCentComMapPool = "DefaultCentcomPool"; [ValidatePrototypeId] - private const string StationCentComMapDefault = "centcommcorvax"; + private const string StationCentComMapDefault = "CentComm"; public void EnsureCentcom(bool force = false) { - if (!_cfg.GetCVar(CCVars.GridFill) && !force) - { + if (!force && (_gameTicker.RunLevel != GameRunLevel.InRound || !_cfg.GetCVar(CCVars.GridFill))) return; - } - _sawmill.Info("EnsureCentcom"); + Log.Info("EnsureCentcom"); if (CentComGrid.IsValid()) { return; } - _sawmill.Info("Start load centcom"); + Log.Info("Start load centcom"); if (CentComMap == MapId.Nullspace) { @@ -237,7 +239,7 @@ public void EnsureCentcom(bool force = false) CentComMapUid = _mapManager.GetMapEntityId(CentComMap); - var mapId = _stationCentComMapPool.Pick(); + var mapId = _stationCentComMapPool.Pick(_random); if (!_prototypeManager.TryIndex(mapId, out var map)) { mapId = StationCentComMapDefault; @@ -251,20 +253,19 @@ public void EnsureCentcom(bool force = false) LoadMap = false }, "Central Command").FirstOrNull(HasComp); - _metaDataSystem.SetEntityName(_mapManager.GetMapEntityId(CentComMap), "CentCom"); + _metaDataSystem.SetEntityName(_mapManager.GetMapEntityId(CentComMap), Loc.GetString("map-name-centcomm")); - if (ent != null) + if (ent == null) { - CentComGrid = ent.Value; - if (_shuttle.TryAddFTLDestination(CentComMap, true, out var ftl)) - { - DisableFtl((CentComMapUid,ftl)); - } + Log.Warning("No CentComm map found, skipping setup."); + return; } - else + + CentComGrid = ent.Value; + if (_shuttle.TryAddFTLDestination(CentComMap, true, false, false, out var ftl)) { - _sawmill.Warning("No CentComm map found, skipping setup."); - return; + ftl.RequireCoordinateDisk = false; + DisableFtl((CentComMapUid, ftl)); } var q = EntityQueryEnumerator(); @@ -279,23 +280,37 @@ public void EnsureCentcom(bool force = false) // ReSharper disable once MemberCanBePrivate.Global public void DisableFtl(Entity ent) { - var d = new EntityWhitelist(); - d.RequireAll = false; - d.Components = new[] { "AllowFtlToCentCom" }; - d.UpdateRegistrations(); + if(!Resolve(ent, ref ent.Comp)) + return; + + var d = new EntityWhitelist + { + RequireAll = false, + Components = new[] { "AllowFtlToCentCom" } + }; + + ent.Comp.RequireCoordinateDisk = false; + ent.Comp.BeaconsOnly = false; + _shuttle.SetFTLWhitelist(ent, d); } public void EnableFtl(Entity ent) { + if(!Resolve(ent, ref ent.Comp)) + return; + ent.Comp.RequireCoordinateDisk = false; + ent.Comp.BeaconsOnly = false; + _shuttle.SetFTLWhitelist(ent, null); } private void OnCentComInit(RoundStartingEvent ev) { - { + if (!_cfg.GetCVar(CCVars.GridFill)) return; - } + + EnsureCentcom(true); } private void OnPreGameMapLoad(PreGameMapLoad ev) diff --git a/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs b/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs index f251afed936..180d747f682 100644 --- a/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs +++ b/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs @@ -89,12 +89,12 @@ private void FilterCentCom(List minds) var centcom = _prototype.Index(_ccDep); foreach (var mindId in minds.ToArray()) { - if (!TryComp(mindId, out var job) || job.Prototype == null) + if (!_roleSystem.MindHasRole(mindId, out var job) || job.Value.Comp1.JobPrototype == null) { continue; } - if (!centcom.Roles.Contains(job.Prototype)) + if (!centcom.Roles.Contains(job.Value.Comp1.JobPrototype.Value)) { continue; } diff --git a/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs b/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs index e4e4ba175f7..1a493f8a562 100644 --- a/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs +++ b/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs @@ -84,14 +84,13 @@ public override void Initialize() { _emergencyShuttleEnabled = _configManager.GetCVar(CCVars.EmergencyShuttleEnabled); // Don't immediately invoke as roundstart will just handle it. - - //Subs.CVar(_configManager, CCVars.EmergencyShuttleEnabled, SetEmergencyShuttleEnabled); - _configManager.OnValueChanged(CCVars.EmergencyShuttleEnabled, value => SetEmergencyShuttleEnabled(value), true); + Subs.CVar(_configManager, CCVars.EmergencyShuttleEnabled, SetEmergencyShuttleEnabled); SubscribeLocalEvent(OnRoundStart); - SubscribeLocalEvent(OnStationStartup); - //SubscribeLocalEvent(OnCentcommShutdown); // backmen: centcom - SubscribeLocalEvent(OnCentcommInit); + SubscribeLocalEvent(OnRoundCleanup); + SubscribeLocalEvent(OnStationStartup); + //SubscribeLocalEvent(OnCentcommShutdown); + SubscribeLocalEvent(OnStationInit); SubscribeLocalEvent(OnEmergencyFTL); SubscribeLocalEvent(OnEmergencyFTLComplete); @@ -400,6 +399,8 @@ public void AnnounceShuttleDock(ShuttleDockResult result, bool extended) // TODO: Need filter extensions or something don't blame me. _audio.PlayGlobal(audioFile, Filter.Broadcast(), true); + + _centcommSystem.EnableFtl(_centcommSystem.CentComMapUid); // backmen: centcom } private void OnStationInit(EntityUid uid, StationCentcommComponent component, MapInitEvent args) @@ -500,14 +501,21 @@ private void SetupEmergencyShuttle() } // start-backmen: centcom - private void AddCentcomm(StationCentcommComponent component) + private void AddCentcomm(EntityUid station, StationCentcommComponent component) { var centcom = EntityManager.System(); + DebugTools.Assert(LifeStage(station)>= EntityLifeStage.MapInitialized); + if (component.MapEntity != null || component.Entity != null) + { + Log.Warning("Attempted to re-add an existing centcomm map."); + } centcom.EnsureCentcom(true); + component.MapEntity = centcom.CentComMapUid; component.Entity = centcom.CentComGrid; component.ShuttleIndex = centcom.ShuttleIndex; + Log.Info($"Attached centcomm grid {ToPrettyString(centcom.CentComGrid)} on map {ToPrettyString(centcom.CentComMapUid)} for station {ToPrettyString(station)}"); } public HashSet GetCentcommMaps() @@ -552,7 +560,7 @@ private void AddEmergencyShuttle(Entity(shuttle.Value).LocalAABB.Width + ShuttleSpawnBuffer; + ent.Comp2.ShuttleIndex = _centcommSystem.ShuttleIndex; ent.Comp1.EmergencyShuttle = shuttle; EnsureComp(shuttle.Value); diff --git a/Content.Shared/_CorvaxNext/CentComm/AllowFtlToCentComComponent.cs b/Content.Shared/_CorvaxNext/CentComm/AllowFtlToCentComComponent.cs index 84f27ade33b..4e360eee1d3 100644 --- a/Content.Shared/_CorvaxNext/CentComm/AllowFtlToCentComComponent.cs +++ b/Content.Shared/_CorvaxNext/CentComm/AllowFtlToCentComComponent.cs @@ -1,6 +1,6 @@ using Robust.Shared.GameStates; -namespace Content.Shared._FishStation.CentComm; +namespace Content.Shared.Backmen.CentComm; [RegisterComponent, NetworkedComponent] public sealed partial class AllowFtlToCentComComponent : Component diff --git a/Content.Shared/_CorvaxNext/CentComm/FtlActionComponent.cs b/Content.Shared/_CorvaxNext/CentComm/FtlActionComponent.cs new file mode 100644 index 00000000000..4df3283b10c --- /dev/null +++ b/Content.Shared/_CorvaxNext/CentComm/FtlActionComponent.cs @@ -0,0 +1,8 @@ +using Content.Shared.Actions; + +namespace Content.Shared.Backmen.Abilities; + +public sealed partial class CentcomFtlAction : InstantActionEvent +{ + +} From 05b6514a193715ecc37bfc7cb95806d2f869a3fa Mon Sep 17 00:00:00 2001 From: AwareFoxy Date: Wed, 6 Nov 2024 08:10:46 +0100 Subject: [PATCH 3/6] :3 --- Resources/Maps/corvax_centcomm.yml | 65 +++++++++++-------- .../Corvax/Roles/Jobs/departments.yml | 8 --- .../Roles/Jobs/CentCom/centcom_official.yml | 0 .../_CorvaxNext/Roles/Jobs/departments.yml | 8 +++ 4 files changed, 46 insertions(+), 35 deletions(-) delete mode 100644 Resources/Prototypes/Corvax/Roles/Jobs/departments.yml rename Resources/Prototypes/{Corvax => _CorvaxNext}/Roles/Jobs/CentCom/centcom_official.yml (100%) create mode 100644 Resources/Prototypes/_CorvaxNext/Roles/Jobs/departments.yml diff --git a/Resources/Maps/corvax_centcomm.yml b/Resources/Maps/corvax_centcomm.yml index dd5cc38c945..f246b03fe97 100644 --- a/Resources/Maps/corvax_centcomm.yml +++ b/Resources/Maps/corvax_centcomm.yml @@ -2,7 +2,6 @@ meta: format: 6 postmapinit: false tilemap: - 0: Space 55: FloorAstroGrass 36: FloorBlue 2: FloorDark @@ -5800,6 +5799,8 @@ entities: - 0 - 0 chunkSize: 4 + - type: BecomesStation + id: centcommcorvax - uid: 5 components: - type: MetaData @@ -8424,25 +8425,6 @@ entities: rot: 1.5707963267948966 rad pos: 28.5,32.5 parent: 2 -- proto: BaseAdvancedPen - entities: - - uid: 394 - components: - - type: Transform - rot: -1.5707963267948966 rad - pos: 74.00797,12.565628 - parent: 2 - - uid: 395 - components: - - type: Transform - pos: 57.72277,46.028847 - parent: 2 - - uid: 396 - components: - - type: Transform - rot: 3.141592653589793 rad - pos: 37.62642,48.595196 - parent: 2 - proto: BaseComputer entities: - uid: 397 @@ -26937,6 +26919,11 @@ entities: - type: Transform pos: 61.476036,44.66785 parent: 2 + - type: UserInterface + actors: + enum.StorageUiKey.Key: + - invalid + - type: ActiveUserInterface - proto: FoodBoxDonut entities: - uid: 3424 @@ -40251,13 +40238,6 @@ entities: - type: Transform pos: 62.5473,33.443535 parent: 2 -- proto: MaterialReclaimer - entities: - - uid: 4942 - components: - - type: Transform - pos: 37.5,56.5 - parent: 2 - proto: Mattress entities: - uid: 4943 @@ -41441,6 +41421,25 @@ entities: - type: Physics canCollide: False - type: InsideEntityStorage +- proto: Pen + entities: + - uid: 394 + components: + - type: Transform + rot: -1.5707963267948966 rad + pos: 74.00797,12.565628 + parent: 2 + - uid: 395 + components: + - type: Transform + pos: 57.72277,46.028847 + parent: 2 + - uid: 396 + components: + - type: Transform + rot: 3.141592653589793 rad + pos: 37.62642,48.595196 + parent: 2 - proto: PenCap entities: - uid: 5033 @@ -46245,6 +46244,18 @@ entities: - type: Transform pos: 62.5,31.5 parent: 2 +- proto: SpawnPointCCOperator + entities: + - uid: 4942 + components: + - type: Transform + pos: 74.5,38.5 + parent: 2 + - uid: 7129 + components: + - type: Transform + pos: 74.5,34.5 + parent: 2 - proto: SpeedLoaderMagnumAP entities: - uid: 2534 diff --git a/Resources/Prototypes/Corvax/Roles/Jobs/departments.yml b/Resources/Prototypes/Corvax/Roles/Jobs/departments.yml deleted file mode 100644 index d01d0e9e767..00000000000 --- a/Resources/Prototypes/Corvax/Roles/Jobs/departments.yml +++ /dev/null @@ -1,8 +0,0 @@ -- type: department - id: Центральное Командование - description: Лучшие из лучших. Только по вайтлисту. - color: "#13db0f" - roles: - - CCSecurity - - CCOperator - - CCIntern diff --git a/Resources/Prototypes/Corvax/Roles/Jobs/CentCom/centcom_official.yml b/Resources/Prototypes/_CorvaxNext/Roles/Jobs/CentCom/centcom_official.yml similarity index 100% rename from Resources/Prototypes/Corvax/Roles/Jobs/CentCom/centcom_official.yml rename to Resources/Prototypes/_CorvaxNext/Roles/Jobs/CentCom/centcom_official.yml diff --git a/Resources/Prototypes/_CorvaxNext/Roles/Jobs/departments.yml b/Resources/Prototypes/_CorvaxNext/Roles/Jobs/departments.yml new file mode 100644 index 00000000000..96567e1c556 --- /dev/null +++ b/Resources/Prototypes/_CorvaxNext/Roles/Jobs/departments.yml @@ -0,0 +1,8 @@ +- type: department + id: CentralCommandCorvax + name: Центральное Командование + description: Только по вайтлисту. + color: "#13db0f" + roles: + - CCSecurity + - CCOperator From d503b222878a076bcf3834500e4563a5a71d081a Mon Sep 17 00:00:00 2001 From: AwareFoxy Date: Wed, 6 Nov 2024 09:06:02 +0100 Subject: [PATCH 4/6] a bunch of fixes --- .../Backmen/Arrivals/CentcommSystem.cs | 27 -------- .../Maps/Shuttles/ert_corvaxcentcomm.yml | 1 + Resources/Maps/corvax_centcomm.yml | 65 ++++++++----------- 3 files changed, 28 insertions(+), 65 deletions(-) diff --git a/Content.Server/Backmen/Arrivals/CentcommSystem.cs b/Content.Server/Backmen/Arrivals/CentcommSystem.cs index de085487f79..36e34c49267 100644 --- a/Content.Server/Backmen/Arrivals/CentcommSystem.cs +++ b/Content.Server/Backmen/Arrivals/CentcommSystem.cs @@ -16,8 +16,6 @@ using Content.Shared.Backmen.CentComm; using Content.Shared.Cargo.Components; using Content.Shared.CCVar; -using Content.Shared.Emag.Components; -using Content.Shared.Emag.Systems; using Content.Shared.GameTicking; using Content.Shared.Random; using Content.Shared.Random.Helpers; @@ -74,7 +72,6 @@ public override void Initialize() SubscribeLocalEvent(OnCentComInit, before: new[] { typeof(EmergencyShuttleSystem) }); SubscribeLocalEvent(OnCentComEndRound); SubscribeLocalEvent(OnCleanup); - SubscribeLocalEvent(OnShuttleConsoleEmaged); SubscribeLocalEvent(OnFTLCompleted); SubscribeLocalEvent(OnFtlAnnounce); SubscribeLocalEvent(OnLoadingMaps); @@ -166,30 +163,6 @@ private void OnFTLCompleted(ref FTLCompletedEvent ev) [ValidatePrototypeId] private const string StationShuttleConsole = "ComputerShuttle"; - private void OnShuttleConsoleEmaged(Entity ent, ref GotEmaggedEvent args) - { - if (Prototype(ent)?.ID != StationShuttleConsole) - { - return; - } - - if (!this.IsPowered(ent, EntityManager)) - return; - - var shuttle = Transform(ent).GridUid; - if (!HasComp(shuttle)) - return; - - if (!(HasComp(shuttle) || HasComp(shuttle))) - return; - - _audio.PlayPvs(SparkSound, ent); - _popupSystem.PopupEntity(Loc.GetString("shuttle-console-component-upgrade-emag-requirement"), ent); - args.Handled = true; - EnsureComp(shuttle.Value); // для обновления консоли нужно чтобы компонент был до вызыва RefreshShuttleConsoles - _console.RefreshShuttleConsoles(); - } - private void OnGridFillChange(bool obj) { if (obj) diff --git a/Resources/Maps/Shuttles/ert_corvaxcentcomm.yml b/Resources/Maps/Shuttles/ert_corvaxcentcomm.yml index 4fc2410b2c2..7c6dff4f84e 100644 --- a/Resources/Maps/Shuttles/ert_corvaxcentcomm.yml +++ b/Resources/Maps/Shuttles/ert_corvaxcentcomm.yml @@ -388,6 +388,7 @@ entities: chunkSize: 4 - type: GasTileOverlay - type: RadiationGridResistance + - type: AllowFtlToCentCom - proto: AirAlarm entities: - uid: 7657 diff --git a/Resources/Maps/corvax_centcomm.yml b/Resources/Maps/corvax_centcomm.yml index f246b03fe97..dd5cc38c945 100644 --- a/Resources/Maps/corvax_centcomm.yml +++ b/Resources/Maps/corvax_centcomm.yml @@ -2,6 +2,7 @@ meta: format: 6 postmapinit: false tilemap: + 0: Space 55: FloorAstroGrass 36: FloorBlue 2: FloorDark @@ -5799,8 +5800,6 @@ entities: - 0 - 0 chunkSize: 4 - - type: BecomesStation - id: centcommcorvax - uid: 5 components: - type: MetaData @@ -8425,6 +8424,25 @@ entities: rot: 1.5707963267948966 rad pos: 28.5,32.5 parent: 2 +- proto: BaseAdvancedPen + entities: + - uid: 394 + components: + - type: Transform + rot: -1.5707963267948966 rad + pos: 74.00797,12.565628 + parent: 2 + - uid: 395 + components: + - type: Transform + pos: 57.72277,46.028847 + parent: 2 + - uid: 396 + components: + - type: Transform + rot: 3.141592653589793 rad + pos: 37.62642,48.595196 + parent: 2 - proto: BaseComputer entities: - uid: 397 @@ -26919,11 +26937,6 @@ entities: - type: Transform pos: 61.476036,44.66785 parent: 2 - - type: UserInterface - actors: - enum.StorageUiKey.Key: - - invalid - - type: ActiveUserInterface - proto: FoodBoxDonut entities: - uid: 3424 @@ -40238,6 +40251,13 @@ entities: - type: Transform pos: 62.5473,33.443535 parent: 2 +- proto: MaterialReclaimer + entities: + - uid: 4942 + components: + - type: Transform + pos: 37.5,56.5 + parent: 2 - proto: Mattress entities: - uid: 4943 @@ -41421,25 +41441,6 @@ entities: - type: Physics canCollide: False - type: InsideEntityStorage -- proto: Pen - entities: - - uid: 394 - components: - - type: Transform - rot: -1.5707963267948966 rad - pos: 74.00797,12.565628 - parent: 2 - - uid: 395 - components: - - type: Transform - pos: 57.72277,46.028847 - parent: 2 - - uid: 396 - components: - - type: Transform - rot: 3.141592653589793 rad - pos: 37.62642,48.595196 - parent: 2 - proto: PenCap entities: - uid: 5033 @@ -46244,18 +46245,6 @@ entities: - type: Transform pos: 62.5,31.5 parent: 2 -- proto: SpawnPointCCOperator - entities: - - uid: 4942 - components: - - type: Transform - pos: 74.5,38.5 - parent: 2 - - uid: 7129 - components: - - type: Transform - pos: 74.5,34.5 - parent: 2 - proto: SpeedLoaderMagnumAP entities: - uid: 2534 From 05d76397b56babea7f8a7f72560a69ab778654f0 Mon Sep 17 00:00:00 2001 From: AwareFoxy Date: Thu, 7 Nov 2024 03:22:00 +0100 Subject: [PATCH 5/6] meow!~ fixes --- .../Locale/ru-RU/_corvaxnext/centcomm.ftl | 2 + Resources/Maps/corvax_centcomm.yml | 59 ++++++++++-------- Resources/Prototypes/Maps/centcomm.yml | 3 +- .../Entities/Markers/Spawners/jobs.yml | 12 ---- .../Roles/Jobs/CentCom/centcom_official.yml | 50 ++-------------- .../_CorvaxNext/Roles/Jobs/departments.yml | 1 - .../Roles/Jobs}/play_time_trackers.yml | 3 - .../Prototypes/_CorvaxNext/centcomm_pool.yml | 2 +- .../Prototypes/_CorvaxNext/idcardconsole.yml | 60 ------------------- 9 files changed, 42 insertions(+), 150 deletions(-) create mode 100644 Resources/Locale/ru-RU/_corvaxnext/centcomm.ftl rename Resources/Prototypes/{Backmen => _CorvaxNext}/Entities/Markers/Spawners/jobs.yml (50%) rename Resources/Prototypes/{Backmen/Roles => _CorvaxNext/Roles/Jobs}/play_time_trackers.yml (50%) delete mode 100644 Resources/Prototypes/_CorvaxNext/idcardconsole.yml diff --git a/Resources/Locale/ru-RU/_corvaxnext/centcomm.ftl b/Resources/Locale/ru-RU/_corvaxnext/centcomm.ftl new file mode 100644 index 00000000000..527252a12d3 --- /dev/null +++ b/Resources/Locale/ru-RU/_corvaxnext/centcomm.ftl @@ -0,0 +1,2 @@ +department-CentralCommandCorvax = Центральное Командование +job-supervisors-centcom2 = руководству НТ diff --git a/Resources/Maps/corvax_centcomm.yml b/Resources/Maps/corvax_centcomm.yml index dd5cc38c945..ebf4f2b4560 100644 --- a/Resources/Maps/corvax_centcomm.yml +++ b/Resources/Maps/corvax_centcomm.yml @@ -5800,6 +5800,8 @@ entities: - 0 - 0 chunkSize: 4 + - type: BecomesStation + id: centcommcorvax - uid: 5 components: - type: MetaData @@ -8424,25 +8426,6 @@ entities: rot: 1.5707963267948966 rad pos: 28.5,32.5 parent: 2 -- proto: BaseAdvancedPen - entities: - - uid: 394 - components: - - type: Transform - rot: -1.5707963267948966 rad - pos: 74.00797,12.565628 - parent: 2 - - uid: 395 - components: - - type: Transform - pos: 57.72277,46.028847 - parent: 2 - - uid: 396 - components: - - type: Transform - rot: 3.141592653589793 rad - pos: 37.62642,48.595196 - parent: 2 - proto: BaseComputer entities: - uid: 397 @@ -40251,13 +40234,6 @@ entities: - type: Transform pos: 62.5473,33.443535 parent: 2 -- proto: MaterialReclaimer - entities: - - uid: 4942 - components: - - type: Transform - pos: 37.5,56.5 - parent: 2 - proto: Mattress entities: - uid: 4943 @@ -41441,6 +41417,25 @@ entities: - type: Physics canCollide: False - type: InsideEntityStorage +- proto: Pen + entities: + - uid: 394 + components: + - type: Transform + rot: -1.5707963267948966 rad + pos: 74.00797,12.565628 + parent: 2 + - uid: 395 + components: + - type: Transform + pos: 57.72277,46.028847 + parent: 2 + - uid: 396 + components: + - type: Transform + rot: 3.141592653589793 rad + pos: 37.62642,48.595196 + parent: 2 - proto: PenCap entities: - uid: 5033 @@ -46245,6 +46240,18 @@ entities: - type: Transform pos: 62.5,31.5 parent: 2 +- proto: SpawnPointCCOperator + entities: + - uid: 4942 + components: + - type: Transform + pos: 61.5,26.5 + parent: 2 + - uid: 7129 + components: + - type: Transform + pos: 65.5,26.5 + parent: 2 - proto: SpeedLoaderMagnumAP entities: - uid: 2534 diff --git a/Resources/Prototypes/Maps/centcomm.yml b/Resources/Prototypes/Maps/centcomm.yml index 328d193a295..192d7c56400 100644 --- a/Resources/Prototypes/Maps/centcomm.yml +++ b/Resources/Prototypes/Maps/centcomm.yml @@ -1,5 +1,5 @@ - type: gameMap - id: centcommcorvax + id: CorvaxCentcomm mapName: 'Central Command' mapPath: /Maps/corvax_centcomm.yml minPlayers: 0 @@ -15,4 +15,3 @@ - type: StationJobs availableJobs: CCOperator: [ 2, 2] - CCSecurity: [ 3, 3] diff --git a/Resources/Prototypes/Backmen/Entities/Markers/Spawners/jobs.yml b/Resources/Prototypes/_CorvaxNext/Entities/Markers/Spawners/jobs.yml similarity index 50% rename from Resources/Prototypes/Backmen/Entities/Markers/Spawners/jobs.yml rename to Resources/Prototypes/_CorvaxNext/Entities/Markers/Spawners/jobs.yml index 5db3f183456..a7c77049278 100644 --- a/Resources/Prototypes/Backmen/Entities/Markers/Spawners/jobs.yml +++ b/Resources/Prototypes/_CorvaxNext/Entities/Markers/Spawners/jobs.yml @@ -9,15 +9,3 @@ layers: - state: green - state: captain - -- type: entity - id: SpawnPointCCSecurity - parent: SpawnPointJobBase - name: ЦК Охрана - components: - - type: SpawnPoint - job_id: CCSecurity - - type: Sprite - layers: - - state: green - - state: captain diff --git a/Resources/Prototypes/_CorvaxNext/Roles/Jobs/CentCom/centcom_official.yml b/Resources/Prototypes/_CorvaxNext/Roles/Jobs/CentCom/centcom_official.yml index 6940b72220b..6fa1aae38a8 100644 --- a/Resources/Prototypes/_CorvaxNext/Roles/Jobs/CentCom/centcom_official.yml +++ b/Resources/Prototypes/_CorvaxNext/Roles/Jobs/CentCom/centcom_official.yml @@ -4,30 +4,7 @@ description: Оператор Центрального Командования. Истинный бюрократ. playTimeTracker: JobCentralCommandOperator setPreference: true - startingGear: CCOperator - icon: "JobIconNanotrasen" - supervisors: job-supervisors-centcom2 # Corvax-JobSupervisors - whitelisted: true - canBeAntag: false - weight: 1 - requireAdminNotify: true - joinNotifyCrew: true - setHideFromConsole: true - accessGroups: - - AllAccess - access: - - CentralCommand - special: - - !type:AddImplantSpecial - implants: [ MindShieldImplant, TrackingImplant ] - -- type: job - id: CCSecurity - name: Служба Безопасности ЦентКом - description: Не звонит вам и не просит последние три цифры с карты. - playTimeTracker: JobCentralCommandSecurity - setPreference: true - startingGear: OfficerCentCom + startingGear: OperatorGear icon: "JobIconNanotrasen" supervisors: job-supervisors-centcom2 # Corvax-JobSupervisors whitelisted: true @@ -45,10 +22,9 @@ implants: [ MindShieldImplant, TrackingImplant ] - type: startingGear - id: Operator + id: OperatorGear equipment: jumpsuit: ClothingUniformJumpsuitCentcomOfficer - back: ClothingBackpackFilled shoes: ClothingShoesBootsJack eyes: ClothingEyesGlassesSunglasses head: ClothingHeadHatBeretCentcomNaval @@ -57,22 +33,6 @@ pocket1: PenCentcom pocket2: BoxFolderCentComClipboard gloves: ClothingHandsGlovesCombat - satchel: ClothingBackpackSatchelFilled - duffelbag: ClothingBackpackDuffelFilled - -- type: startingGear - id: OfficerCentCom - equipment: - jumpsuit: ClothingUniformJumpsuitHoSAlt - back: ClothingBackpackFilled - mask: ClothingMaskGasSecurity - shoes: ClothingShoesBootsJack - eyes: ClothingEyesGlassesSecurity - gloves: ClothingHandsGlovesCombat - outerClothing: ClothingOuterArmorBasic - suitstorage: WeaponPistolMk58 - head: ClothingHeadHatBeretHoS - id: CentcomPDA - ears: ClothingHeadsetCentCom - belt: ClothingBeltSecurity - pocket2: MagazinePistol + storage: + back: + - Flash diff --git a/Resources/Prototypes/_CorvaxNext/Roles/Jobs/departments.yml b/Resources/Prototypes/_CorvaxNext/Roles/Jobs/departments.yml index 96567e1c556..ea26ed368f8 100644 --- a/Resources/Prototypes/_CorvaxNext/Roles/Jobs/departments.yml +++ b/Resources/Prototypes/_CorvaxNext/Roles/Jobs/departments.yml @@ -4,5 +4,4 @@ description: Только по вайтлисту. color: "#13db0f" roles: - - CCSecurity - CCOperator diff --git a/Resources/Prototypes/Backmen/Roles/play_time_trackers.yml b/Resources/Prototypes/_CorvaxNext/Roles/Jobs/play_time_trackers.yml similarity index 50% rename from Resources/Prototypes/Backmen/Roles/play_time_trackers.yml rename to Resources/Prototypes/_CorvaxNext/Roles/Jobs/play_time_trackers.yml index f0bdc69734e..a8d4ca5e8e6 100644 --- a/Resources/Prototypes/Backmen/Roles/play_time_trackers.yml +++ b/Resources/Prototypes/_CorvaxNext/Roles/Jobs/play_time_trackers.yml @@ -1,5 +1,2 @@ - type: playTimeTracker id: JobCentralCommandOperator - -- type: playTimeTracker - id: JobCentralCommandSecurity diff --git a/Resources/Prototypes/_CorvaxNext/centcomm_pool.yml b/Resources/Prototypes/_CorvaxNext/centcomm_pool.yml index b71bb291523..6ec42f0b95a 100644 --- a/Resources/Prototypes/_CorvaxNext/centcomm_pool.yml +++ b/Resources/Prototypes/_CorvaxNext/centcomm_pool.yml @@ -1,6 +1,6 @@ - type: weightedRandom id: DefaultCentcomPool weights: - centcommcorvax: 1 + CorvaxCentcomm: 1 # CentCommv2: 0.35 // soon # CentCommv3: 0.7 // soon diff --git a/Resources/Prototypes/_CorvaxNext/idcardconsole.yml b/Resources/Prototypes/_CorvaxNext/idcardconsole.yml deleted file mode 100644 index e2e6e5fad0d..00000000000 --- a/Resources/Prototypes/_CorvaxNext/idcardconsole.yml +++ /dev/null @@ -1,60 +0,0 @@ -- type: entity - parent: ComputerId - id: CCComputerId - name: Консоль ID карт ЦК - description: Terminal for programming Nanotrasen employee ID cards to access parts of the station. - components: - - type: IdCardConsole - accessLevels: - - CentralCommand - - Armory - - Atmospherics - - Bar - - Brig - - Blueshield - - Detective - - Captain - - Cargo - - Chapel - - Chemistry - - ChiefEngineer - - ChiefMedicalOfficer - - Command - - Cryogenics - - Engineering - - External - - HeadOfPersonnel - - HeadOfSecurity - - Hydroponics - - Janitor - - Kitchen - - Lawyer - - Magistrat - - Maintenance - - Medical - - NanotrasenRepresentive - - Quartermaster - - Research - - ResearchDirector - - Salvage - - Security - - Service - - Theatre - privilegedIdSlot: - name: id-card-console-privileged-id - ejectSound: /Audio/Machines/id_swipe.ogg - insertSound: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg - ejectOnBreak: true - swap: false - whitelist: - components: - - IdCard - targetIdSlot: - name: id-card-console-target-id - ejectSound: /Audio/Machines/id_swipe.ogg - insertSound: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg - ejectOnBreak: true - swap: false - whitelist: - components: - - IdCard From 4a62c2a2a73e24ed90b0497bbed34d10182c7705 Mon Sep 17 00:00:00 2001 From: AwareFoxy Date: Tue, 12 Nov 2024 04:24:52 +0100 Subject: [PATCH 6/6] fixes --- Content.Client/LateJoin/LateJoinGui.cs | 2 +- .../Systems/KillPersonConditionSystem.cs | 28 +++++++++---------- .../Systems/EmergencyShuttleSystem.cs | 20 ++++++------- .../Arrivals/CentcommSystem.cs | 8 +++--- .../Components/IdCardConsoleComponent.cs | 4 +-- .../Abilities/CentcomFTLAction.cs | 2 +- .../CentComm/AllowFtlToCentComComponent.cs | 2 +- .../CentComm/FtlActionComponent.cs | 2 +- .../Components/CentcommShuttleComponent.cs | 2 +- .../Locale/ru-RU/_corvaxnext/centcomm.ftl | 2 -- .../_corvaxnext/roles/departments.ftl | 2 ++ .../_CorvaxNext/Roles/Jobs/departments.yml | 4 +-- 12 files changed, 39 insertions(+), 39 deletions(-) rename Content.Server/{Backmen => _CorvaxNext}/Arrivals/CentcommSystem.cs (98%) rename Content.Shared/{Backmen => _CorvaxNext}/Abilities/CentcomFTLAction.cs (68%) rename Content.Shared/{Backmen => _CorvaxNext}/Shuttles/Components/CentcommShuttleComponent.cs (59%) delete mode 100644 Resources/Locale/ru-RU/_corvaxnext/centcomm.ftl create mode 100644 Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/roles/departments.ftl diff --git a/Content.Client/LateJoin/LateJoinGui.cs b/Content.Client/LateJoin/LateJoinGui.cs index f2c15593aad..47bdbfa4165 100644 --- a/Content.Client/LateJoin/LateJoinGui.cs +++ b/Content.Client/LateJoin/LateJoinGui.cs @@ -85,7 +85,7 @@ private void RebuildUI() Logger.Warning("No stations exist, nothing to display in late-join GUI"); foreach (var (id, name) in _gameTicker.StationNames - .OrderBy(x=> x.Value.Contains("Central Command") ? 1 : -1) //backmen: centcom + .OrderBy(x=> x.Value.Contains("Central Command") ? 1 : -1) // Corvax-Next-Centcomm ) { var jobList = new BoxContainer diff --git a/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs b/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs index 180d747f682..4a6a2ab85ed 100644 --- a/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs +++ b/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs @@ -1,15 +1,15 @@ -using System.Linq; +using System.Linq; // Corvax-Next-Centcomm using Content.Server.Objectives.Components; using Content.Server.Revolutionary.Components; using Content.Server.Shuttles.Systems; -using Content.Server.Station.Components; +using Content.Server.Station.Components; // Corvax-Next-Centcomm using Content.Shared.CCVar; using Content.Shared.Mind; using Content.Shared.Objectives.Components; -using Content.Shared.Roles; -using Content.Shared.Roles.Jobs; +using Content.Shared.Roles; // Corvax-Next-Centcomm +using Content.Shared.Roles.Jobs; // Corvax-Next-Centcomm using Robust.Shared.Configuration; -using Robust.Shared.Prototypes; +using Robust.Shared.Prototypes; // Corvax-Next-Centcomm using Robust.Shared.Random; namespace Content.Server.Objectives.Systems; @@ -24,10 +24,10 @@ public sealed class KillPersonConditionSystem : EntitySystem [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly SharedMindSystem _mind = default!; [Dependency] private readonly TargetObjectiveSystem _target = default!; - [Dependency] private readonly SharedRoleSystem _roleSystem = default!; - [Dependency] private readonly IPrototypeManager _prototype = default!; + [Dependency] private readonly SharedRoleSystem _roleSystem = default!; // Corvax-Next-Centcomm + [Dependency] private readonly IPrototypeManager _prototype = default!; // Corvax-Next-Centcomm - private static readonly ProtoId _ccDep = "CentCom"; + private static readonly ProtoId _ccDep = "CentralCommandCorvax"; // Corvax-Next-Centcomm public override void Initialize() { @@ -69,7 +69,7 @@ private void OnPersonAssigned(EntityUid uid, PickRandomPersonComponent comp, ref return; } - // start-backmen: centcom + // Corvax-Next-Centcomm-Start FilterCentCom(allHumans); if (allHumans.Count == 0) @@ -77,13 +77,13 @@ private void OnPersonAssigned(EntityUid uid, PickRandomPersonComponent comp, ref args.Cancelled = true; return; } - // end-backmen: centcom + // Corvax-Next-Centcomm-End _target.SetTarget(uid, _random.Pick(allHumans), target); } - // start-backmen: centcom + // Corvax-Next-Centcomm-Start private void FilterCentCom(List minds) { var centcom = _prototype.Index(_ccDep); @@ -102,7 +102,7 @@ private void FilterCentCom(List minds) minds.Remove(mindId); } } - // end-backmen: centcom + // Corvax-Next-Centcomm-End private void OnHeadAssigned(EntityUid uid, PickRandomHeadComponent comp, ref ObjectiveAssignedEvent args) { @@ -125,7 +125,7 @@ private void OnHeadAssigned(EntityUid uid, PickRandomHeadComponent comp, ref Obj return; } - // start-backmen: centcom + // Corvax-Next-Centcomm-Start FilterCentCom(allHumans); if (allHumans.Count == 0) @@ -133,7 +133,7 @@ private void OnHeadAssigned(EntityUid uid, PickRandomHeadComponent comp, ref Obj args.Cancelled = true; return; } - // end-backmen: centcom + // Corvax-Next-Centcomm-End var allHeads = new List(); foreach (var person in allHumans) diff --git a/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs b/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs index 1a493f8a562..88f18ad0307 100644 --- a/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs +++ b/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs @@ -35,7 +35,7 @@ using Robust.Shared.Map; using Robust.Shared.Map.Components; using Robust.Shared.Player; -using Robust.Shared.Prototypes; +using Robust.Shared.Prototypes; // Corvax-Next-Centcomm using Robust.Shared.Random; using Robust.Shared.Timing; using Robust.Shared.Utility; @@ -70,7 +70,7 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem [Dependency] private readonly StationSystem _station = default!; [Dependency] private readonly TransformSystem _transformSystem = default!; [Dependency] private readonly UserInterfaceSystem _uiSystem = default!; - [Dependency] private readonly Content.Server.Backmen.Arrivals.CentcommSystem _centcommSystem = default!; + [Dependency] private readonly Content.Server._CorvaxNext.Arrivals.CentcommSystem _centcommSystem = default!; // Corvax-Next-Centcomm private const float ShuttleSpawnBuffer = 1f; @@ -89,7 +89,7 @@ public override void Initialize() SubscribeLocalEvent(OnRoundStart); SubscribeLocalEvent(OnRoundCleanup); SubscribeLocalEvent(OnStationStartup); - //SubscribeLocalEvent(OnCentcommShutdown); + //SubscribeLocalEvent(OnCentcommShutdown);// Corvax-Next-Centcomm SubscribeLocalEvent(OnStationInit); SubscribeLocalEvent(OnEmergencyFTL); @@ -400,7 +400,7 @@ public void AnnounceShuttleDock(ShuttleDockResult result, bool extended) // TODO: Need filter extensions or something don't blame me. _audio.PlayGlobal(audioFile, Filter.Broadcast(), true); - _centcommSystem.EnableFtl(_centcommSystem.CentComMapUid); // backmen: centcom + _centcommSystem.EnableFtl(_centcommSystem.CentComMapUid); // // Corvax-Next-Centcomm } private void OnStationInit(EntityUid uid, StationCentcommComponent component, MapInitEvent args) @@ -500,10 +500,10 @@ private void SetupEmergencyShuttle() } } -// start-backmen: centcom +// Corvax-Next-Centcomm-Start private void AddCentcomm(EntityUid station, StationCentcommComponent component) { - var centcom = EntityManager.System(); + var centcom = EntityManager.System(); DebugTools.Assert(LifeStage(station)>= EntityLifeStage.MapInitialized); if (component.MapEntity != null || component.Entity != null) { @@ -527,7 +527,7 @@ public HashSet GetCentcommMaps() return maps; } -// end-backmen: centcom +// Corvax-Next-Centcomm-End private void AddEmergencyShuttle(Entity ent) { @@ -560,7 +560,7 @@ private void AddEmergencyShuttle(Entity(shuttle.Value).LocalAABB.Width + ShuttleSpawnBuffer; - ent.Comp2.ShuttleIndex = _centcommSystem.ShuttleIndex; + _centcommSystem.ShuttleIndex += Comp(shuttle.Value).LocalAABB.Width + ShuttleSpawnBuffer; // Corvax-Next-Centcomm + ent.Comp2.ShuttleIndex = _centcommSystem.ShuttleIndex; // Corvax-Next-Centcomm ent.Comp1.EmergencyShuttle = shuttle; EnsureComp(shuttle.Value); diff --git a/Content.Server/Backmen/Arrivals/CentcommSystem.cs b/Content.Server/_CorvaxNext/Arrivals/CentcommSystem.cs similarity index 98% rename from Content.Server/Backmen/Arrivals/CentcommSystem.cs rename to Content.Server/_CorvaxNext/Arrivals/CentcommSystem.cs index 36e34c49267..f5a6e6fceca 100644 --- a/Content.Server/Backmen/Arrivals/CentcommSystem.cs +++ b/Content.Server/_CorvaxNext/Arrivals/CentcommSystem.cs @@ -12,8 +12,8 @@ using Content.Server.Shuttles.Systems; using Content.Server.Station.Components; using Content.Server.Station.Systems; -using Content.Shared.Backmen.Abilities; -using Content.Shared.Backmen.CentComm; +using Content.Shared._CorvaxNext.Abilities; +using Content.Shared._CorvaxNext.CentComm; using Content.Shared.Cargo.Components; using Content.Shared.CCVar; using Content.Shared.GameTicking; @@ -32,7 +32,7 @@ using Robust.Shared.Random; using Robust.Shared.Utility; -namespace Content.Server.Backmen.Arrivals; +namespace Content.Server._CorvaxNext.Arrivals; public sealed class FtlCentComAnnounce : EntityEventArgs { @@ -189,7 +189,7 @@ private void OnCleanup(RoundRestartCleanupEvent ev) private const string StationCentComMapPool = "DefaultCentcomPool"; [ValidatePrototypeId] - private const string StationCentComMapDefault = "CentComm"; + private const string StationCentComMapDefault = "CorvaxCentcomm"; public void EnsureCentcom(bool force = false) diff --git a/Content.Shared/Access/Components/IdCardConsoleComponent.cs b/Content.Shared/Access/Components/IdCardConsoleComponent.cs index 7c6da919fc2..4f1c27fb4d3 100644 --- a/Content.Shared/Access/Components/IdCardConsoleComponent.cs +++ b/Content.Shared/Access/Components/IdCardConsoleComponent.cs @@ -10,8 +10,8 @@ namespace Content.Shared.Access.Components; [Access(typeof(SharedIdCardConsoleSystem))] public sealed partial class IdCardConsoleComponent : Component { - public const int MaxFullNameLength = 64; - public const int MaxJobTitleLength = 64; + public const int MaxFullNameLength = 30; + public const int MaxJobTitleLength = 30; public static string PrivilegedIdCardSlotId = "IdCardConsole-privilegedId"; public static string TargetIdCardSlotId = "IdCardConsole-targetId"; diff --git a/Content.Shared/Backmen/Abilities/CentcomFTLAction.cs b/Content.Shared/_CorvaxNext/Abilities/CentcomFTLAction.cs similarity index 68% rename from Content.Shared/Backmen/Abilities/CentcomFTLAction.cs rename to Content.Shared/_CorvaxNext/Abilities/CentcomFTLAction.cs index 4726504f5cc..38fabf07e90 100644 --- a/Content.Shared/Backmen/Abilities/CentcomFTLAction.cs +++ b/Content.Shared/_CorvaxNext/Abilities/CentcomFTLAction.cs @@ -1,6 +1,6 @@ using Content.Shared.Actions; -namespace Content.Shared.Backmen.Abilities; +namespace Content.Shared._CorvaxNext.Abilities; public sealed partial class CentcomFtlAction : InstantActionEvent { diff --git a/Content.Shared/_CorvaxNext/CentComm/AllowFtlToCentComComponent.cs b/Content.Shared/_CorvaxNext/CentComm/AllowFtlToCentComComponent.cs index 4e360eee1d3..f04b9653a98 100644 --- a/Content.Shared/_CorvaxNext/CentComm/AllowFtlToCentComComponent.cs +++ b/Content.Shared/_CorvaxNext/CentComm/AllowFtlToCentComComponent.cs @@ -1,6 +1,6 @@ using Robust.Shared.GameStates; -namespace Content.Shared.Backmen.CentComm; +namespace Content.Shared._CorvaxNext.CentComm; [RegisterComponent, NetworkedComponent] public sealed partial class AllowFtlToCentComComponent : Component diff --git a/Content.Shared/_CorvaxNext/CentComm/FtlActionComponent.cs b/Content.Shared/_CorvaxNext/CentComm/FtlActionComponent.cs index 4df3283b10c..bb1040e5e5e 100644 --- a/Content.Shared/_CorvaxNext/CentComm/FtlActionComponent.cs +++ b/Content.Shared/_CorvaxNext/CentComm/FtlActionComponent.cs @@ -1,6 +1,6 @@ using Content.Shared.Actions; -namespace Content.Shared.Backmen.Abilities; +namespace Content.Shared._CorvaxNext.Abilities; public sealed partial class CentcomFtlAction : InstantActionEvent { diff --git a/Content.Shared/Backmen/Shuttles/Components/CentcommShuttleComponent.cs b/Content.Shared/_CorvaxNext/Shuttles/Components/CentcommShuttleComponent.cs similarity index 59% rename from Content.Shared/Backmen/Shuttles/Components/CentcommShuttleComponent.cs rename to Content.Shared/_CorvaxNext/Shuttles/Components/CentcommShuttleComponent.cs index f68f2f63df5..ec873378aca 100644 --- a/Content.Shared/Backmen/Shuttles/Components/CentcommShuttleComponent.cs +++ b/Content.Shared/_CorvaxNext/Shuttles/Components/CentcommShuttleComponent.cs @@ -1,4 +1,4 @@ -namespace Content.Shared.Backmen.Shuttles.Components; +namespace Content.Shared._CorvaxNext.Shuttles.Components; [RegisterComponent] public sealed partial class CentcommShuttleComponent : Component diff --git a/Resources/Locale/ru-RU/_corvaxnext/centcomm.ftl b/Resources/Locale/ru-RU/_corvaxnext/centcomm.ftl deleted file mode 100644 index 527252a12d3..00000000000 --- a/Resources/Locale/ru-RU/_corvaxnext/centcomm.ftl +++ /dev/null @@ -1,2 +0,0 @@ -department-CentralCommandCorvax = Центральное Командование -job-supervisors-centcom2 = руководству НТ diff --git a/Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/roles/departments.ftl b/Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/roles/departments.ftl new file mode 100644 index 00000000000..4689e7ce738 --- /dev/null +++ b/Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/roles/departments.ftl @@ -0,0 +1,2 @@ +department-CentCom-name = Центральное Командование +department-CentCom-desc = Только по вайтлисту. diff --git a/Resources/Prototypes/_CorvaxNext/Roles/Jobs/departments.yml b/Resources/Prototypes/_CorvaxNext/Roles/Jobs/departments.yml index ea26ed368f8..dceb0486679 100644 --- a/Resources/Prototypes/_CorvaxNext/Roles/Jobs/departments.yml +++ b/Resources/Prototypes/_CorvaxNext/Roles/Jobs/departments.yml @@ -1,7 +1,7 @@ - type: department id: CentralCommandCorvax - name: Центральное Командование - description: Только по вайтлисту. + name: department-CentCom-name + description: department-CentCom-desc color: "#13db0f" roles: - CCOperator