Move rotting stages and examine to shared (#24183)

This commit is contained in:
DrSmugleaf
2024-01-17 01:49:21 -08:00
committed by GitHub
parent 1f0cdf5af8
commit 8902701271
5 changed files with 81 additions and 46 deletions

View File

@@ -6,38 +6,40 @@ namespace Content.Shared.Atmos.Rotting;
/// <summary>
/// Tracking component for stuff that has started to rot.
/// Only the current stage is networked to the client.
/// </summary>
[RegisterComponent, NetworkedComponent]
[Access(typeof(SharedRottingSystem))]
public sealed partial class RottingComponent : Component
{
/// <summary>
/// Whether or not the rotting should deal damage
/// </summary>
[DataField("dealDamage"), ViewVariables(VVAccess.ReadWrite)]
[DataField]
public bool DealDamage = true;
/// <summary>
/// When the next check will happen for rot progression + effects like damage and ammonia
/// </summary>
[DataField("nextRotUpdate", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
public TimeSpan NextRotUpdate = TimeSpan.Zero;
/// <summary>
/// How long in between each rot update.
/// </summary>
[DataField("rotUpdateRate"), ViewVariables(VVAccess.ReadWrite)]
[DataField]
public TimeSpan RotUpdateRate = TimeSpan.FromSeconds(5);
/// <summary>
/// How long has this thing been rotting?
/// </summary>
[DataField("totalRotTime"), ViewVariables(VVAccess.ReadWrite)]
[DataField]
public TimeSpan TotalRotTime = TimeSpan.Zero;
/// <summary>
/// The damage dealt by rotting.
/// </summary>
[DataField("damage")]
[DataField]
public DamageSpecifier Damage = new()
{
DamageDict = new()