using Content.Shared.Damage;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Atmos.Rotting;
///
/// Tracking component for stuff that has started to rot.
///
[RegisterComponent, NetworkedComponent]
public sealed partial class RottingComponent : Component
{
///
/// Whether or not the rotting should deal damage
///
[DataField("dealDamage"), ViewVariables(VVAccess.ReadWrite)]
public bool DealDamage = true;
///
/// When the next check will happen for rot progression + effects like damage and ammonia
///
[DataField("nextRotUpdate", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
public TimeSpan NextRotUpdate = TimeSpan.Zero;
///
/// How long in between each rot update.
///
[DataField("rotUpdateRate"), ViewVariables(VVAccess.ReadWrite)]
public TimeSpan RotUpdateRate = TimeSpan.FromSeconds(5);
///
/// How long has this thing been rotting?
///
[DataField("totalRotTime"), ViewVariables(VVAccess.ReadWrite)]
public TimeSpan TotalRotTime = TimeSpan.Zero;
///
/// The damage dealt by rotting.
///
[DataField("damage")]
public DamageSpecifier Damage = new()
{
DamageDict = new()
{
{ "Blunt", 0.06 },
{ "Cellular", 0.06 }
}
};
}