1
0

BatteryDrainerComponent.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using Content.Shared.Ninja.Systems;
  2. using Robust.Shared.Audio;
  3. using Robust.Shared.GameStates;
  4. namespace Content.Shared.Ninja.Components;
  5. /// <summary>
  6. /// Component for draining power from APCs/substations/SMESes, when ProviderUid is set to a battery cell.
  7. /// Does not rely on relay, simply being on the user and having BatteryUid set is enough.
  8. /// </summary>
  9. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  10. [Access(typeof(SharedBatteryDrainerSystem))]
  11. public sealed partial class BatteryDrainerComponent : Component
  12. {
  13. /// <summary>
  14. /// The powercell entity to drain power into.
  15. /// Determines whether draining is possible.
  16. /// </summary>
  17. [DataField, AutoNetworkedField]
  18. public EntityUid? BatteryUid;
  19. /// <summary>
  20. /// Conversion rate between joules in a device and joules added to battery.
  21. /// Should be very low since powercells store nothing compared to even an APC.
  22. /// </summary>
  23. [DataField]
  24. public float DrainEfficiency = 0.001f;
  25. /// <summary>
  26. /// Time that the do after takes to drain charge from a battery, in seconds
  27. /// </summary>
  28. [DataField]
  29. public float DrainTime = 1f;
  30. /// <summary>
  31. /// Sound played after the doafter ends.
  32. /// </summary>
  33. [DataField]
  34. public SoundSpecifier SparkSound = new SoundCollectionSpecifier("sparks");
  35. }