Singulo/Radiation Tweaks (#6045)

Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
This commit is contained in:
Pancake
2022-01-10 22:30:17 -08:00
committed by GitHub
parent 989cfb49d0
commit 61da69ee74
11 changed files with 26 additions and 30 deletions

View File

@@ -10,12 +10,10 @@ namespace Content.Client.StationEvents
{
private bool _draw;
private bool _decay;
private float _radsPerSecond;
private float _range;
private TimeSpan _startTime;
private TimeSpan _endTime;
public override float RadsPerSecond => _radsPerSecond;
public override float Range => _range;
public override TimeSpan StartTime => _startTime;
public override TimeSpan EndTime => _endTime;
@@ -31,7 +29,6 @@ namespace Content.Client.StationEvents
return;
}
_radsPerSecond = state.RadsPerSecond;
_range = state.Range;
_draw = state.Draw;
_decay = state.Decay;

View File

@@ -20,7 +20,6 @@ namespace Content.Server.Radiation
[Dependency] private readonly IRobustRandom _random = default!;
private float _duration;
private float _radsPerSecond = 8f;
private float _range = 5f;
private TimeSpan _startTime;
private TimeSpan _endTime;
@@ -48,17 +47,6 @@ namespace Content.Server.Radiation
[DataField("maxPulseLifespan")]
public float MaxPulseLifespan { get; set; } = 2.5f;
[DataField("dps")]
public override float RadsPerSecond
{
get => _radsPerSecond;
set
{
_radsPerSecond = value;
Dirty();
}
}
[DataField("sound")] public SoundSpecifier Sound { get; set; } = new SoundCollectionSpecifier("RadiationPulse");
[DataField("range")]
@@ -103,7 +91,7 @@ namespace Content.Server.Radiation
public override ComponentState GetComponentState()
{
return new RadiationPulseState(_radsPerSecond, _range, Draw, Decay, _startTime, _endTime);
return new RadiationPulseState(_range, Draw, Decay, _startTime, _endTime);
}
public void Update(float frameTime)

View File

@@ -15,7 +15,7 @@ namespace Content.Server.Radiation
[Dependency] private readonly IEntityManager _entMan = default!;
[Dependency] private readonly IEntityLookup _lookup = default!;
private const float RadiationCooldown = 0.5f;
private const float RadiationCooldown = 1.0f;
private float _accumulator;
public override void Update(float frameTime)

View File

@@ -2,6 +2,7 @@ using System;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Shared.Radiation
{
@@ -10,7 +11,8 @@ namespace Content.Shared.Radiation
{
public override string Name => "RadiationPulse";
public virtual float RadsPerSecond { get; set; }
[DataField("radsPerSecond")]
public float RadsPerSecond { get; set; } = 1;
/// <summary>
/// Radius of the pulse from its position
@@ -30,16 +32,16 @@ namespace Content.Shared.Radiation
[Serializable, NetSerializable]
public class RadiationPulseState : ComponentState
{
public readonly float RadsPerSecond;
// not networking RadsPerSecond because damage is only ever dealt by server-side systems.
public readonly float Range;
public readonly bool Draw;
public readonly bool Decay;
public readonly TimeSpan StartTime;
public readonly TimeSpan EndTime;
public RadiationPulseState(float radsPerSecond, float range, bool draw, bool decay, TimeSpan startTime, TimeSpan endTime)
public RadiationPulseState(float range, bool draw, bool decay, TimeSpan startTime, TimeSpan endTime)
{
RadsPerSecond = radsPerSecond;
Range = range;
Draw = draw;
Decay = decay;

View File

@@ -12,6 +12,12 @@ namespace Content.Shared.Singularity.Components
{
public override string Name => "Singularity";
/// <summary>
/// The radiation pulse component's radsPerSecond is set to the singularity's level multiplied by this number.
/// </summary>
[DataField("radsPerLevel")]
public float RadsPerLevel = 1;
/// <summary>
/// Changed by <see cref="SharedSingularitySystem.ChangeSingularityLevel"/>
/// </summary>

View File

@@ -1,4 +1,4 @@
using System;
using System;
using Content.Shared.Ghost;
using Content.Shared.Radiation;
using Content.Shared.Singularity.Components;
@@ -111,7 +111,7 @@ namespace Content.Shared.Singularity
if (EntityManager.TryGetComponent(singularity.Owner, out SharedRadiationPulseComponent? pulse))
{
pulse.RadsPerSecond = 10 * value;
pulse.RadsPerSecond = singularity.RadsPerLevel * value;
}
if (EntityManager.TryGetComponent(singularity.Owner, out AppearanceComponent? appearance))

View File

@@ -107,5 +107,3 @@
amount: 2
- id: ClothingEyesGlassesMeson
amount: 2

View File

@@ -106,7 +106,7 @@
- type: entity
parent: ClothingHeadBase
id: ClothingHeadHatHoodRad
name: rad
name: radiation hood
description: A hood of the hazmat suit, designed for protection from high radioactivity.
components:
- type: Sprite

View File

@@ -61,7 +61,7 @@
- type: entity
parent: ClothingOuterBase
id: ClothingOuterSuitRad
name: rad suit
name: radiation suit
description: "A suit that protects against radiation. The label reads, 'Made with lead. Please do not consume insulation.'"
components:
- type: Sprite

View File

@@ -5,3 +5,6 @@
description: Looking at this anomaly makes you feel strange, like something is pushing at your eyes.
components:
- type: RadiationPulse
minPulseLifespan: 0.8
maxPulseLifespan: 2.5
radsPerSecond: 5

View File

@@ -24,11 +24,13 @@
layer:
- AllMask
- type: Singularity
radsPerLevel: 1 # determines RadiationPulse's radiation per second.
- type: SingularityDistortion
- type: RadiationPulse
range: 15
decay: false
dps: 1
minPulseLifespan: 1
maxPulseLifespan: 1
- type: Sprite
sprite: Structures/Power/Generation/Singularity/singularity_1.rsi
state: singularity_1