1
0

SmokeOnTriggerComponent.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using Content.Shared.Explosion.EntitySystems;
  2. using Content.Shared.Chemistry.Components;
  3. using Robust.Shared.GameStates;
  4. using Robust.Shared.Prototypes;
  5. namespace Content.Shared.Explosion.Components;
  6. /// <summary>
  7. /// Creates a smoke cloud when triggered, with an optional solution to include in it.
  8. /// No sound is played incase a grenade is stealthy, use <see cref="SoundOnTriggerComponent"/> if you want a sound.
  9. /// </summary>
  10. [RegisterComponent, NetworkedComponent, Access(typeof(SharedSmokeOnTriggerSystem))]
  11. public sealed partial class SmokeOnTriggerComponent : Component
  12. {
  13. /// <summary>
  14. /// How long the smoke stays for, after it has spread.
  15. /// </summary>
  16. [DataField, ViewVariables(VVAccess.ReadWrite)]
  17. public float Duration = 10;
  18. /// <summary>
  19. /// How much the smoke will spread.
  20. /// </summary>
  21. [DataField(required: true), ViewVariables(VVAccess.ReadWrite)]
  22. public int SpreadAmount;
  23. /// <summary>
  24. /// Smoke entity to spawn.
  25. /// Defaults to smoke but you can use foam if you want.
  26. /// </summary>
  27. [DataField, ViewVariables(VVAccess.ReadWrite)]
  28. public EntProtoId SmokePrototype = "Smoke";
  29. /// <summary>
  30. /// Solution to add to each smoke cloud.
  31. /// </summary>
  32. /// <remarks>
  33. /// When using repeating trigger this essentially gets multiplied so dont do anything crazy like omnizine or lexorin.
  34. /// </remarks>
  35. [DataField, ViewVariables(VVAccess.ReadWrite)]
  36. public Solution Solution = new();
  37. }