2022-11-08 20:59:34 +01:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
|
|
2022-06-17 03:00:23 -04:00
|
|
|
namespace Content.Server.Atmos.Miasma
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// This makes mobs eventually start rotting when they die.
|
|
|
|
|
/// It may be expanded to food at some point, but it's just for mobs right now.
|
|
|
|
|
/// </summary>
|
2023-01-19 03:56:45 +01:00
|
|
|
[RegisterComponent]
|
2022-06-17 03:00:23 -04:00
|
|
|
public sealed class PerishableComponent : Component
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Is this progressing?
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
public bool Progressing = true;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// How long this creature has been dead.
|
|
|
|
|
/// </summary>
|
2022-11-08 20:59:34 +01:00
|
|
|
[DataField("timeOfDeath", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
2022-06-17 03:00:23 -04:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2022-11-08 20:59:34 +01:00
|
|
|
public TimeSpan TimeOfDeath = TimeSpan.Zero;
|
2022-06-17 03:00:23 -04:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// When DeathAccumulator is greater than this, start rotting.
|
|
|
|
|
/// </summary>
|
2022-06-19 01:51:55 -04:00
|
|
|
public TimeSpan RotAfter = TimeSpan.FromMinutes(5);
|
2022-06-17 03:00:23 -04:00
|
|
|
|
|
|
|
|
/// <summary>
|
2022-11-08 20:59:34 +01:00
|
|
|
/// Gasses are released, this is when the next gas release update will be.
|
2022-06-17 03:00:23 -04:00
|
|
|
/// </summary>
|
2022-11-08 20:59:34 +01:00
|
|
|
[DataField("rotNextUpdate", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
|
|
|
|
public TimeSpan RotNextUpdate = TimeSpan.Zero;
|
2022-06-17 03:00:23 -04:00
|
|
|
|
|
|
|
|
/// <summary>
|
2022-06-19 01:51:55 -04:00
|
|
|
/// How many moles of gas released per second, per unit of mass.
|
2022-06-17 03:00:23 -04:00
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2022-06-19 01:51:55 -04:00
|
|
|
[DataField("molsPerSecondPerUnitMass")]
|
2022-06-25 22:04:40 -04:00
|
|
|
public float MolsPerSecondPerUnitMass = 0.0025f;
|
2022-06-17 03:00:23 -04:00
|
|
|
}
|
|
|
|
|
}
|