From 20746ed59f0c407431848a845b93df2974853f8e Mon Sep 17 00:00:00 2001 From: ThereDrD <88589686+ThereDrD0@users.noreply.github.com> Date: Wed, 4 Jun 2025 13:23:58 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D1=80=D0=B0=D0=BD=D0=B4=D0=BE=D0=BC=D0=BD=D1=8B?= =?UTF-8?q?=D1=85=20=D0=B0=D1=80=D1=82=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D0=B2=20(#2276)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TimedRemoveComponentsSystem.cs | 2 +- .../RandomXenoArtifactsSystem.cs | 32 +++++++++++++++++-- .../_Sunrise/Research/Artifact/effects.yml | 2 +- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/Content.Server/_Sunrise/Misc/TimedRemoveComponents/TimedRemoveComponentsSystem.cs b/Content.Server/_Sunrise/Misc/TimedRemoveComponents/TimedRemoveComponentsSystem.cs index 18081de4a2..b3318adbff 100644 --- a/Content.Server/_Sunrise/Misc/TimedRemoveComponents/TimedRemoveComponentsSystem.cs +++ b/Content.Server/_Sunrise/Misc/TimedRemoveComponents/TimedRemoveComponentsSystem.cs @@ -24,7 +24,7 @@ public sealed class TimedRemoveComponentsSystem : EntitySystem private void RemoveComponents(Entity ent) { - if (!Exists(ent)) + if (TerminatingOrDeleted(ent)) return; EntityManager.RemoveComponents(ent, ent.Comp.Components); diff --git a/Content.Server/_Sunrise/Xenoarchaeology/RandomXenoArtifactsSystem.cs b/Content.Server/_Sunrise/Xenoarchaeology/RandomXenoArtifactsSystem.cs index 78f65ab4fe..3a4f0eedf4 100644 --- a/Content.Server/_Sunrise/Xenoarchaeology/RandomXenoArtifactsSystem.cs +++ b/Content.Server/_Sunrise/Xenoarchaeology/RandomXenoArtifactsSystem.cs @@ -1,8 +1,11 @@ using System.Linq; using Content.Server._Sunrise.Helpers; +using Content.Server.Power.Components; using Content.Server.Station.Systems; using Content.Shared._Sunrise.SunriseCCVars; using Content.Shared.Body.Organ; +using Content.Shared.Body.Part; +using Content.Shared.Doors.Electronics; using Content.Shared.GameTicking; using Content.Shared.Item; using Content.Shared.Xenoarchaeology.Artifact.Components; @@ -31,7 +34,13 @@ public sealed class RandomXenoArtifactsSystem : EntitySystem private static EntityPrototype? _baseParentPrototype; private EntityQuery _xform; + + private EntityQuery _doorElectronics; + private EntityQuery _apcElectronics; private EntityQuery _organs; + private EntityQuery _bodyParts; + + private EntityQuery _avaliableStations; private ISawmill _sawmill = default!; @@ -45,7 +54,14 @@ public sealed class RandomXenoArtifactsSystem : EntitySystem SubscribeLocalEvent(OnRoundStarted); _xform = GetEntityQuery(); + + _doorElectronics = GetEntityQuery(); + _apcElectronics = GetEntityQuery(); _organs = GetEntityQuery(); + _bodyParts = GetEntityQuery(); + + _avaliableStations = GetEntityQuery(); + _sawmill = Logger.GetSawmill("sunrise.random_artifacts"); } @@ -100,13 +116,25 @@ public sealed class RandomXenoArtifactsSystem : EntitySystem var station = _station.GetOwningStation(ent, ent.Comp); - if (!HasComp(station)) + if (!_avaliableStations.HasComp(station)) + return false; + + // Блеклист компонентов, которые не должны становиться артефактами. + // Все это какие-то предметы, внутри других предметов, которые достаются через жопу. + // Поэтому делать их артефактами ну такое себе + + if (_doorElectronics.HasComp(ent)) + return false; + + if (_apcElectronics.HasComp(ent)) return false; - // Чтобы органы внутри персонажей не становились артефактами if (_organs.HasComp(ent)) return false; + if (_bodyParts.HasComp(ent)) + return false; + return true; } diff --git a/Resources/Prototypes/_Sunrise/Research/Artifact/effects.yml b/Resources/Prototypes/_Sunrise/Research/Artifact/effects.yml index b6019bdb35..44262200f2 100644 --- a/Resources/Prototypes/_Sunrise/Research/Artifact/effects.yml +++ b/Resources/Prototypes/_Sunrise/Research/Artifact/effects.yml @@ -282,7 +282,7 @@ - type: XAEApplyComponents components: - type: GravityWell - maxRange: 80 + maxRange: 10 baseRadialAcceleration: 90 - type: TimedRemoveComponents components: