Nemanja
2023-01-17 19:38:12 -05:00
committed by GitHub
parent 2c1c1c45c3
commit 4d57226335
11 changed files with 28 additions and 25 deletions

View File

@@ -179,7 +179,7 @@ public sealed class AnomalyComponent : Component
/// of an anomalous particle of <seealso cref="DestabilizingParticleType"/>.
/// </summary>
[DataField("stabilityPerWeakeningeHit")]
public float StabilityPerWeakeningeHit = -0.02f;
public float StabilityPerWeakeningeHit = -0.1f;
#region Points and Vessels
/// <summary>

View File

@@ -1,8 +1,6 @@
using System.Linq;
using Content.Shared.Anomaly.Components;
using Content.Shared.Anomaly.Effects.Components;
using Content.Shared.Construction.Components;
using Content.Shared.Construction.EntitySystems;
using Content.Shared.Throwing;
using Robust.Shared.Map;
@@ -12,7 +10,6 @@ public abstract class SharedGravityAnomalySystem : EntitySystem
{
[Dependency] private readonly IMapManager _map = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly SharedAnchorableSystem _anchorable = default!;
[Dependency] private readonly ThrowingSystem _throwing = default!;
[Dependency] private readonly SharedTransformSystem _xform = default!;

View File

@@ -91,6 +91,7 @@ public abstract class SharedAnomalySystem : EntitySystem
if (!Resolve(uid, ref component))
return;
DebugTools.Assert(component.MinPulseLength > TimeSpan.FromSeconds(3)); // this is just to prevent lagspikes mispredicting pulses
var variation = Random.NextFloat(-component.PulseVariation, component.PulseVariation) + 1;
component.NextPulseTime = Timing.CurTime + GetPulseLength(component) * variation;
@@ -107,7 +108,8 @@ public abstract class SharedAnomalySystem : EntitySystem
}
Log.Add(LogType.Anomaly, LogImpact.Medium, $"Anomaly {ToPrettyString(uid)} pulsed with severity {component.Severity}.");
Audio.PlayPvs(component.PulseSound, uid);
if (_net.IsServer)
Audio.PlayPvs(component.PulseSound, uid);
var pulse = EnsureComp<AnomalyPulsingComponent>(uid);
pulse.EndTime = Timing.CurTime + pulse.PulseDuration;

View File

@@ -1135,6 +1135,16 @@ namespace Content.Shared.CCVar
public static readonly CVarDef<bool> BiomassEasyMode =
CVarDef.Create("biomass.easy_mode", true, CVar.SERVERONLY);
/*
* Anomaly
*/
/// <summary>
/// A scale factor applied to a grid's bounds when trying to find a spot to randomly generate an anomaly.
/// </summary>
public static readonly CVarDef<float> AnomalyGenerationGridBoundsScale =
CVarDef.Create("anomaly.generation_grid_bounds_scale", 0.6f, CVar.SERVERONLY);
/*
* VIEWPORT
*/