A return to foam (foam rework) (#20831)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
|
||||
namespace Content.Shared.Chemistry.Components;
|
||||
|
||||
/// <summary>
|
||||
/// This is used for entities which are currently being affected by smoke.
|
||||
/// Manages the gradual metabolism every second.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class SmokeAffectedComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The time at which the next smoke metabolism will occur.
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
public TimeSpan NextSecond;
|
||||
|
||||
/// <summary>
|
||||
/// The smoke that is currently affecting this entity.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public EntityUid SmokeEntity;
|
||||
}
|
||||
34
Content.Shared/Chemistry/Components/SmokeComponent.cs
Normal file
34
Content.Shared/Chemistry/Components/SmokeComponent.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Fluids.Components;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Chemistry.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Stores solution on an anchored entity that has touch and ingestion reactions
|
||||
/// to entities that collide with it. Similar to <see cref="PuddleComponent"/>
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class SmokeComponent : Component
|
||||
{
|
||||
public const string SolutionName = "solutionArea";
|
||||
|
||||
/// <summary>
|
||||
/// The max amount of tiles this smoke cloud can spread to.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public int SpreadAmount;
|
||||
|
||||
/// <summary>
|
||||
/// The max rate at which chemicals are transferred from the smoke to the person inhaling it.
|
||||
/// Calculated as (total volume of chemicals in smoke) / (<see cref="Duration"/>)
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public FixedPoint2 TransferRate;
|
||||
|
||||
/// <summary>
|
||||
/// The total lifespan of the smoke.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
||||
public float Duration = 10;
|
||||
}
|
||||
Reference in New Issue
Block a user