ReagentProducerAnomalyComponent.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. using Content.Server.Anomaly.Effects;
  2. using Content.Shared.Chemistry.Components;
  3. using Content.Shared.Chemistry.Reagent;
  4. using Robust.Shared.Audio;
  5. using Robust.Shared.Prototypes;
  6. using System.Numerics;
  7. namespace Content.Server.Anomaly.Components;
  8. /// <summary>
  9. /// This component allows the anomaly to generate a random type of reagent in the specified SolutionContainer.
  10. /// With the increasing severity of the anomaly, the type of reagent produced may change.
  11. /// The higher the severity of the anomaly, the higher the chance of dangerous or useful reagents.
  12. /// </summary>
  13. [RegisterComponent, Access(typeof(ReagentProducerAnomalySystem))]
  14. public sealed partial class ReagentProducerAnomalyComponent : Component
  15. {
  16. //the addition of the reagent will occur instantly when an anomaly appears,
  17. //and there will not be the first three seconds of a white empty anomaly.
  18. public float AccumulatedFrametime = 3.0f;
  19. /// <summary>
  20. /// How frequently should this reagent generation update, in seconds?
  21. /// </summary>
  22. [DataField, ViewVariables(VVAccess.ReadWrite)]
  23. public float UpdateInterval = 3.0f;
  24. /// <summary>
  25. /// The spread of the random weight of the choice of this category, depending on the severity.
  26. /// </summary>
  27. [DataField, ViewVariables(VVAccess.ReadWrite)]
  28. public Vector2 WeightSpreadDangerous = new(5.0f, 9.0f);
  29. /// <summary>
  30. /// The spread of the random weight of the choice of this category, depending on the severity.
  31. /// </summary>
  32. [DataField, ViewVariables(VVAccess.ReadWrite)]
  33. public Vector2 WeightSpreadFun = new(3.0f, 0.0f);
  34. /// <summary>
  35. /// The spread of the random weight of the choice of this category, depending on the severity.
  36. /// </summary>
  37. [DataField, ViewVariables(VVAccess.ReadWrite)]
  38. public Vector2 WeightSpreadUseful = new(1.0f, 1.0f);
  39. /// <summary>
  40. /// Category of dangerous reagents for injection. Various toxins and poisons
  41. /// </summary>
  42. [DataField, ViewVariables(VVAccess.ReadWrite)]
  43. public List<ProtoId<ReagentPrototype>> DangerousChemicals = new();
  44. /// <summary>
  45. /// Category of useful reagents for injection. Medicine and other things that players WANT to get
  46. /// </summary>
  47. [DataField, ViewVariables(VVAccess.ReadWrite)]
  48. public List<ProtoId<ReagentPrototype>> UsefulChemicals = new();
  49. /// <summary>
  50. /// Category of fun reagents for injection. Glue, drugs, beer. Something that will bring fun.
  51. /// </summary>
  52. [DataField, ViewVariables(VVAccess.ReadWrite)]
  53. public List<ProtoId<ReagentPrototype>> FunChemicals = new();
  54. /// <summary>
  55. /// Noise made when anomaly pulse.
  56. /// </summary>
  57. [DataField, ViewVariables(VVAccess.ReadWrite)]
  58. public SoundSpecifier ChangeSound = new SoundPathSpecifier("/Audio/Effects/waterswirl.ogg");
  59. /// <summary>
  60. /// The component will repaint the sprites of the object to match the current color of the solution,
  61. /// if the RandomSprite component is hung correctly.
  62. /// Ideally, this should be put into a separate component, but I suffered for 4 hours,
  63. /// and nothing worked out for me. So for now it will be like this.
  64. /// </summary>
  65. [DataField, ViewVariables(VVAccess.ReadOnly)]
  66. public bool NeedRecolor = false;
  67. /// <summary>
  68. /// the maximum amount of reagent produced per second
  69. /// </summary>
  70. [DataField, ViewVariables(VVAccess.ReadWrite)]
  71. public float MaxReagentProducing = 1.5f;
  72. /// <summary>
  73. /// how much does the reagent production increase before entering the supercritical state
  74. /// </summary>
  75. [DataField, ViewVariables(VVAccess.ReadWrite)]
  76. public float SupercriticalReagentProducingModifier = 100f;
  77. /// <summary>
  78. /// The name of the reagent that the anomaly produces.
  79. /// </summary>
  80. [DataField, ViewVariables(VVAccess.ReadWrite)]
  81. public ProtoId<ReagentPrototype> ProducingReagent = "Water";
  82. /// <summary>
  83. /// Solution name where the substance is generated
  84. /// </summary>
  85. [ViewVariables(VVAccess.ReadWrite)]
  86. [DataField("solution")]
  87. public string SolutionName = "default";
  88. /// <summary>
  89. /// Solution where the substance is generated
  90. /// </summary>
  91. [ViewVariables]
  92. public Entity<SolutionComponent>? Solution = null;
  93. }