Radiation rework (#10970)
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using Content.Server.Radiation.Systems;
|
||||
|
||||
namespace Content.Server.Radiation.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Blocks radiation when placed on tile.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(RadiationSystem))]
|
||||
public sealed class RadiationBlockerComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Does it block radiation at all?
|
||||
/// </summary>
|
||||
[DataField("enabled")]
|
||||
public bool Enabled = true;
|
||||
|
||||
/// <summary>
|
||||
/// How many rads per second does the blocker absorb?
|
||||
/// </summary>
|
||||
[DataField("resistance")]
|
||||
public float RadResistance = 1f;
|
||||
|
||||
/// <summary>
|
||||
/// Current position of the rad blocker in grid coordinates.
|
||||
/// Null if doesn't anchored or doesn't block rads.
|
||||
/// </summary>
|
||||
public (EntityUid Grid, Vector2i Tile)? CurrentPosition;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using Content.Server.Radiation.Systems;
|
||||
|
||||
namespace Content.Server.Radiation.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Grid component that stores radiation resistance of <see cref="RadiationBlockerComponent"/> per tile.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(RadiationSystem), Other = AccessPermissions.ReadExecute)]
|
||||
public sealed class RadiationGridResistanceComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Radiation resistance per tile.
|
||||
/// </summary>
|
||||
public readonly Dictionary<Vector2i, float> ResistancePerTile = new();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using Content.Server.Radiation.Systems;
|
||||
using Content.Shared.Radiation.Components;
|
||||
|
||||
namespace Content.Server.Radiation.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Marks component that receive radiation from <see cref="RadiationSourceComponent"/>.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(RadiationSystem))]
|
||||
public sealed class RadiationReceiverComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Current radiation value in rads per second.
|
||||
/// Periodically updated by radiation system.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public float CurrentRadiation;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user