ReagentSpeedComponent.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. using Content.Shared.Chemistry.Reagent;
  2. using Content.Shared.FixedPoint;
  3. using Robust.Shared.Prototypes;
  4. namespace Content.Shared.ReagentSpeed;
  5. /// <summary>
  6. /// Makes a device work faster by consuming reagents on each use.
  7. /// Other systems must use <see cref="ReagentSpeedSystem.ApplySpeed"/> for this to do anything.
  8. /// </summary>
  9. [RegisterComponent, Access(typeof(ReagentSpeedSystem))]
  10. public sealed partial class ReagentSpeedComponent : Component
  11. {
  12. /// <summary>
  13. /// Solution that will be checked.
  14. /// Anything that isn't in <c>Modifiers</c> is left alone.
  15. /// </summary>
  16. [DataField(required: true)]
  17. public string Solution = string.Empty;
  18. /// <summary>
  19. /// How much reagent from the solution to use up for each use.
  20. /// This is per-modifier-reagent and not shared between them.
  21. /// </summary>
  22. [DataField]
  23. public FixedPoint2 Cost = 5;
  24. /// <summary>
  25. /// Reagents and how much they modify speed at full purity.
  26. /// Small number means faster large number means slower.
  27. /// </summary>
  28. [DataField(required: true)]
  29. public Dictionary<ProtoId<ReagentPrototype>, float> Modifiers = new();
  30. }