GasArtifactComponent.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using Content.Shared.Atmos;
  2. namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
  3. /// <summary>
  4. /// Spawn a random gas with random temperature when artifact activated.
  5. /// </summary>
  6. [RegisterComponent]
  7. public sealed partial class GasArtifactComponent : Component
  8. {
  9. /// <summary>
  10. /// Gas that will be spawned when artifact activated.
  11. /// If null it will be picked on startup from <see cref="PossibleGases"/>.
  12. /// </summary>
  13. [ViewVariables(VVAccess.ReadWrite)]
  14. [DataField("spawnGas")]
  15. public Gas? SpawnGas;
  16. /// <summary>
  17. /// List of possible activation gases to pick on startup.
  18. /// </summary>
  19. [DataField("possibleGas")]
  20. public List<Gas> PossibleGases = new()
  21. {
  22. Gas.Oxygen,
  23. Gas.Plasma,
  24. Gas.Nitrogen,
  25. Gas.CarbonDioxide,
  26. Gas.Tritium,
  27. Gas.Ammonia,
  28. Gas.NitrousOxide,
  29. Gas.Frezon
  30. };
  31. /// <summary>
  32. /// Temperature of spawned gas. If null it will be picked on startup from range from
  33. /// <see cref="MinRandomTemperature"/> to <see cref="MaxRandomTemperature"/>.
  34. /// </summary>
  35. [ViewVariables(VVAccess.ReadWrite)]
  36. [DataField("spawnTemperature")]
  37. public float? SpawnTemperature;
  38. [DataField("minRandomTemp")]
  39. public float MinRandomTemperature = 100;
  40. [DataField("maxRandomTemp")]
  41. public float MaxRandomTemperature = 400;
  42. /// <summary>
  43. /// Max allowed external atmospheric pressure.
  44. /// Artifact will stop spawn gas.
  45. /// </summary>
  46. [ViewVariables(VVAccess.ReadWrite)]
  47. [DataField("maxExternalPressure")]
  48. public float MaxExternalPressure = Atmospherics.GasMinerDefaultMaxExternalPressure;
  49. /// <summary>
  50. /// Moles of gas to spawn each time when artifact activated.
  51. /// </summary>
  52. [ViewVariables(VVAccess.ReadWrite)]
  53. [DataField("spawnAmount")]
  54. public float SpawnAmount = Atmospherics.MolesCellStandard * 3;
  55. }