Radiation pulse ECS (#10641)

This commit is contained in:
Alex Evgrashin
2022-08-31 12:24:21 +02:00
committed by GitHub
parent ccb240ccca
commit cad6c760ad
18 changed files with 146 additions and 258 deletions

View File

@@ -0,0 +1,30 @@
using Content.Shared.Radiation.Systems;
using Content.Shared.Spawners.Components;
namespace Content.Shared.Radiation.Components;
/// <summary>
/// Create circle pulse animation of radiation around object.
/// Drawn on client after creation only once per component lifetime.
/// </summary>
[RegisterComponent]
[Access(typeof(RadiationPulseSystem))]
public sealed class RadiationPulseComponent : Component
{
/// <summary>
/// Timestamp when component was assigned to this entity.
/// </summary>
public TimeSpan StartTime;
/// <summary>
/// How long will animation play in seconds.
/// Can be overridden by <see cref="TimedDespawnComponent"/>.
/// </summary>
public float VisualDuration = 2f;
/// <summary>
/// The range of animation.
/// Can be overridden by <see cref="RadiationSourceComponent"/>.
/// </summary>
public float VisualRange = 5f;
}

View File

@@ -0,0 +1,20 @@
/// <summary>
/// Irradiate all objects in range.
/// </summary>
[RegisterComponent]
public sealed class RadiationSourceComponent : Component
{
/// <summary>
/// How many rads per second receive irradiated object.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("radsPerSecond")]
public float RadsPerSecond = 1;
/// <summary>
/// Radius of radiation source.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("range")]
public float Range = 5f;
}