2020-08-14 06:52:17 +10:00
|
|
|
using System;
|
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.GameObjects.Components
|
|
|
|
|
{
|
|
|
|
|
public abstract class SharedRadiationPulseComponent : Component
|
|
|
|
|
{
|
|
|
|
|
public override string Name => "RadiationPulse";
|
|
|
|
|
public override uint? NetID => ContentNetIDs.RADIATION_PULSE;
|
|
|
|
|
|
2020-09-21 01:49:40 +02:00
|
|
|
public virtual float RadsPerSecond { get; set; }
|
|
|
|
|
|
2020-08-14 06:52:17 +10:00
|
|
|
/// <summary>
|
|
|
|
|
/// Radius of the pulse from its position
|
|
|
|
|
/// </summary>
|
2020-09-21 01:49:40 +02:00
|
|
|
public virtual float Range { get; set; }
|
2020-08-14 06:52:17 +10:00
|
|
|
|
2020-09-21 01:49:40 +02:00
|
|
|
public virtual bool Decay { get; set; }
|
|
|
|
|
public virtual bool Draw { get; set; }
|
|
|
|
|
|
|
|
|
|
public virtual TimeSpan EndTime { get; }
|
2020-08-14 06:52:17 +10:00
|
|
|
}
|
2020-09-21 01:49:40 +02:00
|
|
|
|
2020-08-14 06:52:17 +10:00
|
|
|
/// <summary>
|
|
|
|
|
/// For syncing the pulse's lifespan between client and server for the overlay
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Serializable, NetSerializable]
|
2020-09-21 01:49:40 +02:00
|
|
|
public class RadiationPulseState : ComponentState
|
2020-08-14 06:52:17 +10:00
|
|
|
{
|
2020-09-21 01:49:40 +02:00
|
|
|
public readonly float RadsPerSecond;
|
|
|
|
|
public readonly float Range;
|
|
|
|
|
public readonly bool Draw;
|
|
|
|
|
public readonly bool Decay;
|
|
|
|
|
public readonly TimeSpan EndTime;
|
2020-08-14 06:52:17 +10:00
|
|
|
|
2020-09-21 01:49:40 +02:00
|
|
|
public RadiationPulseState(float radsPerSecond, float range, bool draw, bool decay, TimeSpan endTime) : base(ContentNetIDs.RADIATION_PULSE)
|
2020-08-14 06:52:17 +10:00
|
|
|
{
|
2020-09-21 01:49:40 +02:00
|
|
|
RadsPerSecond = radsPerSecond;
|
|
|
|
|
Range = range;
|
|
|
|
|
Draw = draw;
|
|
|
|
|
Decay = decay;
|
2020-08-14 06:52:17 +10:00
|
|
|
EndTime = endTime;
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-09-21 01:49:40 +02:00
|
|
|
}
|