More artifacts triggers and tweaks (#6723)

Co-authored-by: mirrorcult <lunarautomaton6@gmail.com>
This commit is contained in:
Alex Evgrashin
2022-02-19 22:16:49 +03:00
committed by GitHub
parent 162af7add5
commit 6eeaa81131
32 changed files with 347 additions and 61 deletions

View File

@@ -2,8 +2,6 @@
using Content.Server.Atmos.EntitySystems;
using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Random;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;

View File

@@ -1,7 +1,6 @@
using Content.Server.Radiation;
using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
using Robust.Shared.GameObjects;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;

View File

@@ -2,9 +2,6 @@ using Content.Server.Clothing.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
using Content.Shared.Hands.Components;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Random;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;

View File

@@ -2,9 +2,6 @@ using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
using Content.Shared.Popups;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Random;

View File

@@ -1,9 +1,7 @@
using System;
using Content.Server.Atmos;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;
@@ -21,10 +19,23 @@ public sealed class TemperatureArtifactSystem : EntitySystem
{
var transform = Transform(uid);
var environment = _atmosphereSystem.GetTileMixture(transform.Coordinates, true);
if (environment == null)
var center = _atmosphereSystem.GetTileMixture(transform.Coordinates, true);
if (center == null)
return;
UpdateTileTemperature(component, center);
if (component.EffectAdjacentTiles)
{
var adjacent = _atmosphereSystem.GetAdjacentTileMixtures(transform.Coordinates, invalidate: true);
foreach (var mixture in adjacent)
{
UpdateTileTemperature(component, mixture);
}
}
}
private void UpdateTileTemperature(TemperatureArtifactComponent component, GasMixture environment)
{
var dif = component.TargetTemperature - environment.Temperature;
var absDif = Math.Abs(dif);
if (absDif < component.MaxTemperatureDifference)