FoamArtifactComponent.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;
  2. using Content.Shared.Chemistry.Reagent;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
  4. namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
  5. /// <summary>
  6. /// Generates foam from the artifact when activated
  7. /// </summary>
  8. [RegisterComponent, Access(typeof(FoamArtifactSystem))]
  9. public sealed partial class FoamArtifactComponent : Component
  10. {
  11. /// <summary>
  12. /// The list of reagents that will randomly be picked from
  13. /// to choose the foam reagent
  14. /// </summary>
  15. [DataField("reagents", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer<ReagentPrototype>))]
  16. public List<string> Reagents = new();
  17. /// <summary>
  18. /// The foam reagent
  19. /// </summary>
  20. [DataField("selectedReagent"), ViewVariables(VVAccess.ReadWrite)]
  21. public string? SelectedReagent;
  22. /// <summary>
  23. /// How long does the foam last?
  24. /// </summary>
  25. [DataField("duration"), ViewVariables(VVAccess.ReadWrite)]
  26. public float Duration = 10;
  27. /// <summary>
  28. /// How much reagent is in the foam?
  29. /// </summary>
  30. [DataField("reagentAmount"), ViewVariables(VVAccess.ReadWrite)]
  31. public float ReagentAmount = 100;
  32. /// <summary>
  33. /// Minimum radius of foam spawned
  34. /// </summary>
  35. [DataField("minFoamAmount"), ViewVariables(VVAccess.ReadWrite)]
  36. public int MinFoamAmount = 15;
  37. /// <summary>
  38. /// Maximum radius of foam spawned
  39. /// </summary>
  40. [DataField("maxFoamAmount"), ViewVariables(VVAccess.ReadWrite)]
  41. public int MaxFoamAmount = 20;
  42. }