From 61da69ee74073dffbc4a39f428505bca76d44945 Mon Sep 17 00:00:00 2001 From: Pancake Date: Mon, 10 Jan 2022 22:30:17 -0800 Subject: [PATCH] Singulo/Radiation Tweaks (#6045) Co-authored-by: ElectroJr --- .../StationEvents/RadiationPulseComponent.cs | 3 --- .../Radiation/RadiationPulseComponent.cs | 14 +------------- Content.Server/Radiation/RadiationPulseSystem.cs | 2 +- Content.Shared/Radiation/SharedRadiationStorm.cs | 10 ++++++---- .../Components/SharedSingularityComponent.cs | 6 ++++++ .../Singularity/SharedSingularitySystem.cs | 4 ++-- .../Prototypes/Catalog/Fills/Lockers/engineer.yml | 4 +--- .../Prototypes/Entities/Clothing/Head/hoods.yml | 2 +- .../Entities/Clothing/OuterClothing/suits.yml | 2 +- .../Prototypes/Entities/Effects/radiation.yml | 5 ++++- .../Power/Generation/Singularity/singularity.yml | 4 +++- 11 files changed, 26 insertions(+), 30 deletions(-) diff --git a/Content.Client/StationEvents/RadiationPulseComponent.cs b/Content.Client/StationEvents/RadiationPulseComponent.cs index 065ec46599..fe8ce7e622 100644 --- a/Content.Client/StationEvents/RadiationPulseComponent.cs +++ b/Content.Client/StationEvents/RadiationPulseComponent.cs @@ -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; diff --git a/Content.Server/Radiation/RadiationPulseComponent.cs b/Content.Server/Radiation/RadiationPulseComponent.cs index 58ba2c6cef..14fe93bdab 100644 --- a/Content.Server/Radiation/RadiationPulseComponent.cs +++ b/Content.Server/Radiation/RadiationPulseComponent.cs @@ -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) diff --git a/Content.Server/Radiation/RadiationPulseSystem.cs b/Content.Server/Radiation/RadiationPulseSystem.cs index e7a2ba599a..4c87f7f656 100644 --- a/Content.Server/Radiation/RadiationPulseSystem.cs +++ b/Content.Server/Radiation/RadiationPulseSystem.cs @@ -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) diff --git a/Content.Shared/Radiation/SharedRadiationStorm.cs b/Content.Shared/Radiation/SharedRadiationStorm.cs index f0b4783bfc..b83bb84ede 100644 --- a/Content.Shared/Radiation/SharedRadiationStorm.cs +++ b/Content.Shared/Radiation/SharedRadiationStorm.cs @@ -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; /// /// 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; diff --git a/Content.Shared/Singularity/Components/SharedSingularityComponent.cs b/Content.Shared/Singularity/Components/SharedSingularityComponent.cs index 59e5afe7a0..7347afab5e 100644 --- a/Content.Shared/Singularity/Components/SharedSingularityComponent.cs +++ b/Content.Shared/Singularity/Components/SharedSingularityComponent.cs @@ -12,6 +12,12 @@ namespace Content.Shared.Singularity.Components { public override string Name => "Singularity"; + /// + /// The radiation pulse component's radsPerSecond is set to the singularity's level multiplied by this number. + /// + [DataField("radsPerLevel")] + public float RadsPerLevel = 1; + /// /// Changed by /// diff --git a/Content.Shared/Singularity/SharedSingularitySystem.cs b/Content.Shared/Singularity/SharedSingularitySystem.cs index 6716db5b16..7a40c6c42c 100644 --- a/Content.Shared/Singularity/SharedSingularitySystem.cs +++ b/Content.Shared/Singularity/SharedSingularitySystem.cs @@ -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)) diff --git a/Resources/Prototypes/Catalog/Fills/Lockers/engineer.yml b/Resources/Prototypes/Catalog/Fills/Lockers/engineer.yml index 1750fdac0d..ed17c651db 100644 --- a/Resources/Prototypes/Catalog/Fills/Lockers/engineer.yml +++ b/Resources/Prototypes/Catalog/Fills/Lockers/engineer.yml @@ -22,7 +22,7 @@ - id: Multitool prob: 0.2 - id: trayScanner - prob: 0.7 + prob: 0.7 - id: ClothingBeltUtility prob: 0.2 - id: ClothingHandsGlovesColorYellow @@ -107,5 +107,3 @@ amount: 2 - id: ClothingEyesGlassesMeson amount: 2 - - diff --git a/Resources/Prototypes/Entities/Clothing/Head/hoods.yml b/Resources/Prototypes/Entities/Clothing/Head/hoods.yml index 7fbb02dfe6..800755af89 100644 --- a/Resources/Prototypes/Entities/Clothing/Head/hoods.yml +++ b/Resources/Prototypes/Entities/Clothing/Head/hoods.yml @@ -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 diff --git a/Resources/Prototypes/Entities/Clothing/OuterClothing/suits.yml b/Resources/Prototypes/Entities/Clothing/OuterClothing/suits.yml index 0b89f54a16..7d0c21d2c4 100644 --- a/Resources/Prototypes/Entities/Clothing/OuterClothing/suits.yml +++ b/Resources/Prototypes/Entities/Clothing/OuterClothing/suits.yml @@ -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 diff --git a/Resources/Prototypes/Entities/Effects/radiation.yml b/Resources/Prototypes/Entities/Effects/radiation.yml index 81d20ca718..2f26bd1d5e 100644 --- a/Resources/Prototypes/Entities/Effects/radiation.yml +++ b/Resources/Prototypes/Entities/Effects/radiation.yml @@ -4,4 +4,7 @@ abstract: true description: Looking at this anomaly makes you feel strange, like something is pushing at your eyes. components: - - type: RadiationPulse \ No newline at end of file + - type: RadiationPulse + minPulseLifespan: 0.8 + maxPulseLifespan: 2.5 + radsPerSecond: 5 \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/singularity.yml b/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/singularity.yml index 4ca375f8dc..4f9d82e0a3 100644 --- a/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/singularity.yml +++ b/Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/singularity.yml @@ -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