SmokeComponent.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using Content.Shared.FixedPoint;
  2. using Content.Shared.Fluids.Components;
  3. using Robust.Shared.GameStates;
  4. namespace Content.Shared.Chemistry.Components;
  5. /// <summary>
  6. /// Stores solution on an anchored entity that has touch and ingestion reactions
  7. /// to entities that collide with it. Similar to <see cref="PuddleComponent"/>
  8. /// </summary>
  9. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  10. public sealed partial class SmokeComponent : Component
  11. {
  12. public const string SolutionName = "solutionArea";
  13. /// <summary>
  14. /// The solution on the entity with touch and ingestion reactions.
  15. /// </summary>
  16. [ViewVariables]
  17. public Entity<SolutionComponent>? Solution = null;
  18. /// <summary>
  19. /// The max amount of tiles this smoke cloud can spread to.
  20. /// </summary>
  21. [DataField, ViewVariables(VVAccess.ReadWrite)]
  22. public int SpreadAmount;
  23. /// <summary>
  24. /// The max rate at which chemicals are transferred from the smoke to the person inhaling it.
  25. /// Calculated as (total volume of chemicals in smoke) / (<see cref="Duration"/>)
  26. /// </summary>
  27. [DataField, ViewVariables(VVAccess.ReadWrite)]
  28. public FixedPoint2 TransferRate;
  29. /// <summary>
  30. /// The total lifespan of the smoke.
  31. /// </summary>
  32. [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
  33. public float Duration = 10;
  34. }