Make anomalies harder (#16760)

This commit is contained in:
Nemanja
2023-05-24 23:28:40 -04:00
committed by GitHub
parent 945d026406
commit 91585f5efb
4 changed files with 12 additions and 9 deletions

View File

@@ -145,9 +145,7 @@ public sealed partial class AnomalySystem
Appearance.SetData(uid, AnomalyVesselVisuals.HasAnomaly, on, appearanceComponent); Appearance.SetData(uid, AnomalyVesselVisuals.HasAnomaly, on, appearanceComponent);
if (TryComp<SharedPointLightComponent>(uid, out var pointLightComponent)) if (TryComp<SharedPointLightComponent>(uid, out var pointLightComponent))
{ _pointLight.SetEnabled(uid, on, pointLightComponent);
pointLightComponent.Enabled = on;
}
// arbitrary value for the generic visualizer to use. // arbitrary value for the generic visualizer to use.
// i didn't feel like making an enum for this. // i didn't feel like making an enum for this.

View File

@@ -27,6 +27,7 @@ public sealed partial class AnomalySystem : SharedAnomalySystem
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!; [Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly ExplosionSystem _explosion = default!; [Dependency] private readonly ExplosionSystem _explosion = default!;
[Dependency] private readonly MaterialStorageSystem _material = default!; [Dependency] private readonly MaterialStorageSystem _material = default!;
[Dependency] private readonly SharedPointLightSystem _pointLight = default!;
[Dependency] private readonly RadioSystem _radio = default!; [Dependency] private readonly RadioSystem _radio = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!; [Dependency] private readonly UserInterfaceSystem _ui = default!;

View File

@@ -103,14 +103,16 @@ public sealed class AnomalyComponent : Component
/// A percentage by which the length of a pulse might vary. /// A percentage by which the length of a pulse might vary.
/// </summary> /// </summary>
[DataField("pulseVariation")] [DataField("pulseVariation")]
public float PulseVariation = .1f; public float PulseVariation = 0.1f;
/// <summary> /// <summary>
/// The largest value by which the anomaly will vary in stability for each pulse. /// The range that an anomaly's stability can vary each pulse. Scales with severity.
/// In simple terms, every pulse, stability changes from a range of -this_value to this_value
/// </summary> /// </summary>
/// <remarks>
/// This is more likely to trend upwards than donwards, because that's funny
/// </remarks>
[DataField("pulseStabilityVariation")] [DataField("pulseStabilityVariation")]
public float PulseStabilityVariation = 0.05f; public Vector2 PulseStabilityVariation = (-0.125f, 0.20f);
/// <summary> /// <summary>
/// The sound played when an anomaly pulses /// The sound played when an anomaly pulses
@@ -180,7 +182,7 @@ public sealed class AnomalyComponent : Component
/// This doesn't include the point bonus for being unstable. /// This doesn't include the point bonus for being unstable.
/// </summary> /// </summary>
[DataField("maxPointsPerSecond")] [DataField("maxPointsPerSecond")]
public int MaxPointsPerSecond = 100; public int MaxPointsPerSecond = 75;
/// <summary> /// <summary>
/// The multiplier applied to the point value for the /// The multiplier applied to the point value for the

View File

@@ -139,7 +139,9 @@ public abstract class SharedAnomalySystem : EntitySystem
ChangeAnomalySeverity(uid, GetSeverityIncreaseFromGrowth(component), component); ChangeAnomalySeverity(uid, GetSeverityIncreaseFromGrowth(component), component);
} }
var stability = Random.NextFloat(-component.PulseStabilityVariation, component.PulseStabilityVariation); var minStability = component.PulseStabilityVariation.X * component.Severity;
var maxStability = component.PulseStabilityVariation.Y * component.Severity;
var stability = Random.NextFloat(minStability, maxStability);
ChangeAnomalyStability(uid, stability, component); ChangeAnomalyStability(uid, stability, component);
Log.Add(LogType.Anomaly, LogImpact.Medium, $"Anomaly {ToPrettyString(uid)} pulsed with severity {component.Severity}."); Log.Add(LogType.Anomaly, LogImpact.Medium, $"Anomaly {ToPrettyString(uid)} pulsed with severity {component.Severity}.");