Singulo/Radiation Tweaks (#6045)
Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
This commit is contained in:
@@ -10,12 +10,10 @@ namespace Content.Client.StationEvents
|
|||||||
{
|
{
|
||||||
private bool _draw;
|
private bool _draw;
|
||||||
private bool _decay;
|
private bool _decay;
|
||||||
private float _radsPerSecond;
|
|
||||||
private float _range;
|
private float _range;
|
||||||
private TimeSpan _startTime;
|
private TimeSpan _startTime;
|
||||||
private TimeSpan _endTime;
|
private TimeSpan _endTime;
|
||||||
|
|
||||||
public override float RadsPerSecond => _radsPerSecond;
|
|
||||||
public override float Range => _range;
|
public override float Range => _range;
|
||||||
public override TimeSpan StartTime => _startTime;
|
public override TimeSpan StartTime => _startTime;
|
||||||
public override TimeSpan EndTime => _endTime;
|
public override TimeSpan EndTime => _endTime;
|
||||||
@@ -31,7 +29,6 @@ namespace Content.Client.StationEvents
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_radsPerSecond = state.RadsPerSecond;
|
|
||||||
_range = state.Range;
|
_range = state.Range;
|
||||||
_draw = state.Draw;
|
_draw = state.Draw;
|
||||||
_decay = state.Decay;
|
_decay = state.Decay;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ namespace Content.Server.Radiation
|
|||||||
[Dependency] private readonly IRobustRandom _random = default!;
|
[Dependency] private readonly IRobustRandom _random = default!;
|
||||||
|
|
||||||
private float _duration;
|
private float _duration;
|
||||||
private float _radsPerSecond = 8f;
|
|
||||||
private float _range = 5f;
|
private float _range = 5f;
|
||||||
private TimeSpan _startTime;
|
private TimeSpan _startTime;
|
||||||
private TimeSpan _endTime;
|
private TimeSpan _endTime;
|
||||||
@@ -48,17 +47,6 @@ namespace Content.Server.Radiation
|
|||||||
[DataField("maxPulseLifespan")]
|
[DataField("maxPulseLifespan")]
|
||||||
public float MaxPulseLifespan { get; set; } = 2.5f;
|
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("sound")] public SoundSpecifier Sound { get; set; } = new SoundCollectionSpecifier("RadiationPulse");
|
||||||
|
|
||||||
[DataField("range")]
|
[DataField("range")]
|
||||||
@@ -103,7 +91,7 @@ namespace Content.Server.Radiation
|
|||||||
|
|
||||||
public override ComponentState GetComponentState()
|
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)
|
public void Update(float frameTime)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace Content.Server.Radiation
|
|||||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||||
[Dependency] private readonly IEntityLookup _lookup = default!;
|
[Dependency] private readonly IEntityLookup _lookup = default!;
|
||||||
|
|
||||||
private const float RadiationCooldown = 0.5f;
|
private const float RadiationCooldown = 1.0f;
|
||||||
private float _accumulator;
|
private float _accumulator;
|
||||||
|
|
||||||
public override void Update(float frameTime)
|
public override void Update(float frameTime)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ using System;
|
|||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
|
|
||||||
namespace Content.Shared.Radiation
|
namespace Content.Shared.Radiation
|
||||||
{
|
{
|
||||||
@@ -10,7 +11,8 @@ namespace Content.Shared.Radiation
|
|||||||
{
|
{
|
||||||
public override string Name => "RadiationPulse";
|
public override string Name => "RadiationPulse";
|
||||||
|
|
||||||
public virtual float RadsPerSecond { get; set; }
|
[DataField("radsPerSecond")]
|
||||||
|
public float RadsPerSecond { get; set; } = 1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Radius of the pulse from its position
|
/// Radius of the pulse from its position
|
||||||
@@ -30,16 +32,16 @@ namespace Content.Shared.Radiation
|
|||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
public class RadiationPulseState : ComponentState
|
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 float Range;
|
||||||
public readonly bool Draw;
|
public readonly bool Draw;
|
||||||
public readonly bool Decay;
|
public readonly bool Decay;
|
||||||
public readonly TimeSpan StartTime;
|
public readonly TimeSpan StartTime;
|
||||||
public readonly TimeSpan EndTime;
|
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;
|
Range = range;
|
||||||
Draw = draw;
|
Draw = draw;
|
||||||
Decay = decay;
|
Decay = decay;
|
||||||
|
|||||||
@@ -12,6 +12,12 @@ namespace Content.Shared.Singularity.Components
|
|||||||
{
|
{
|
||||||
public override string Name => "Singularity";
|
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>
|
/// <summary>
|
||||||
/// Changed by <see cref="SharedSingularitySystem.ChangeSingularityLevel"/>
|
/// Changed by <see cref="SharedSingularitySystem.ChangeSingularityLevel"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using Content.Shared.Ghost;
|
using Content.Shared.Ghost;
|
||||||
using Content.Shared.Radiation;
|
using Content.Shared.Radiation;
|
||||||
using Content.Shared.Singularity.Components;
|
using Content.Shared.Singularity.Components;
|
||||||
@@ -111,7 +111,7 @@ namespace Content.Shared.Singularity
|
|||||||
|
|
||||||
if (EntityManager.TryGetComponent(singularity.Owner, out SharedRadiationPulseComponent? pulse))
|
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))
|
if (EntityManager.TryGetComponent(singularity.Owner, out AppearanceComponent? appearance))
|
||||||
|
|||||||
@@ -107,5 +107,3 @@
|
|||||||
amount: 2
|
amount: 2
|
||||||
- id: ClothingEyesGlassesMeson
|
- id: ClothingEyesGlassesMeson
|
||||||
amount: 2
|
amount: 2
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
- type: entity
|
- type: entity
|
||||||
parent: ClothingHeadBase
|
parent: ClothingHeadBase
|
||||||
id: ClothingHeadHatHoodRad
|
id: ClothingHeadHatHoodRad
|
||||||
name: rad
|
name: radiation hood
|
||||||
description: A hood of the hazmat suit, designed for protection from high radioactivity.
|
description: A hood of the hazmat suit, designed for protection from high radioactivity.
|
||||||
components:
|
components:
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
- type: entity
|
- type: entity
|
||||||
parent: ClothingOuterBase
|
parent: ClothingOuterBase
|
||||||
id: ClothingOuterSuitRad
|
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.'"
|
description: "A suit that protects against radiation. The label reads, 'Made with lead. Please do not consume insulation.'"
|
||||||
components:
|
components:
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
|
|||||||
@@ -5,3 +5,6 @@
|
|||||||
description: Looking at this anomaly makes you feel strange, like something is pushing at your eyes.
|
description: Looking at this anomaly makes you feel strange, like something is pushing at your eyes.
|
||||||
components:
|
components:
|
||||||
- type: RadiationPulse
|
- type: RadiationPulse
|
||||||
|
minPulseLifespan: 0.8
|
||||||
|
maxPulseLifespan: 2.5
|
||||||
|
radsPerSecond: 5
|
||||||
@@ -24,11 +24,13 @@
|
|||||||
layer:
|
layer:
|
||||||
- AllMask
|
- AllMask
|
||||||
- type: Singularity
|
- type: Singularity
|
||||||
|
radsPerLevel: 1 # determines RadiationPulse's radiation per second.
|
||||||
- type: SingularityDistortion
|
- type: SingularityDistortion
|
||||||
- type: RadiationPulse
|
- type: RadiationPulse
|
||||||
range: 15
|
range: 15
|
||||||
decay: false
|
decay: false
|
||||||
dps: 1
|
minPulseLifespan: 1
|
||||||
|
maxPulseLifespan: 1
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Structures/Power/Generation/Singularity/singularity_1.rsi
|
sprite: Structures/Power/Generation/Singularity/singularity_1.rsi
|
||||||
state: singularity_1
|
state: singularity_1
|
||||||
|
|||||||
Reference in New Issue
Block a user