Изменения рандомных артефактов (#2276)

This commit is contained in:
ThereDrD 2025-06-04 13:23:58 +03:00 committed by GitHub
parent bb7875df87
commit 20746ed59f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 32 additions and 4 deletions

View file

@ -24,7 +24,7 @@ public sealed class TimedRemoveComponentsSystem : EntitySystem
private void RemoveComponents(Entity<TimedRemoveComponentsComponent> ent)
{
if (!Exists(ent))
if (TerminatingOrDeleted(ent))
return;
EntityManager.RemoveComponents(ent, ent.Comp.Components);

View file

@ -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<TransformComponent> _xform;
private EntityQuery<DoorElectronicsComponent> _doorElectronics;
private EntityQuery<ApcElectronicsComponent> _apcElectronics;
private EntityQuery<OrganComponent> _organs;
private EntityQuery<BodyPartComponent> _bodyParts;
private EntityQuery<StationRandomXenoArtifactComponent> _avaliableStations;
private ISawmill _sawmill = default!;
@ -45,7 +54,14 @@ public sealed class RandomXenoArtifactsSystem : EntitySystem
SubscribeLocalEvent<RoundStartedEvent>(OnRoundStarted);
_xform = GetEntityQuery<TransformComponent>();
_doorElectronics = GetEntityQuery<DoorElectronicsComponent>();
_apcElectronics = GetEntityQuery<ApcElectronicsComponent>();
_organs = GetEntityQuery<OrganComponent>();
_bodyParts = GetEntityQuery<BodyPartComponent>();
_avaliableStations = GetEntityQuery<StationRandomXenoArtifactComponent>();
_sawmill = Logger.GetSawmill("sunrise.random_artifacts");
}
@ -100,13 +116,25 @@ public sealed class RandomXenoArtifactsSystem : EntitySystem
var station = _station.GetOwningStation(ent, ent.Comp);
if (!HasComp<StationRandomXenoArtifactComponent>(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;
}

View file

@ -282,7 +282,7 @@
- type: XAEApplyComponents
components:
- type: GravityWell
maxRange: 80
maxRange: 10
baseRadialAcceleration: 90
- type: TimedRemoveComponents
components: