TeslaEnergyBallComponent.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using Content.Server.Tesla.EntitySystems;
  2. using Robust.Shared.Audio;
  3. using Robust.Shared.Prototypes;
  4. namespace Content.Server.Tesla.Components;
  5. /// <summary>
  6. /// A component that tracks an entity's saturation level from absorbing other creatures by touch, and spawns new entities when the saturation limit is reached.
  7. /// </summary>
  8. [RegisterComponent, Access(typeof(TeslaEnergyBallSystem))]
  9. public sealed partial class TeslaEnergyBallComponent : Component
  10. {
  11. /// <summary>
  12. /// how much energy will Tesla get by eating various things. Walls, people, anything.
  13. /// </summary>
  14. [DataField, ViewVariables(VVAccess.ReadWrite)]
  15. public float ConsumeStuffEnergy = 2f;
  16. /// <summary>
  17. /// The amount of energy this entity contains. Once the limit is reached, the energy will be spent to spawn mini-energy balls
  18. /// </summary>
  19. [DataField, ViewVariables(VVAccess.ReadWrite)]
  20. public float Energy;
  21. /// <summary>
  22. /// The amount of energy an entity must reach in order to zero the energy and create another entity
  23. /// </summary>
  24. [DataField, ViewVariables(VVAccess.ReadWrite)]
  25. public float NeedEnergyToSpawn = 100f;
  26. /// <summary>
  27. /// The amount of energy to which the tesla must reach in order to be destroyed.
  28. /// </summary>
  29. [DataField, ViewVariables(VVAccess.ReadWrite)]
  30. public float EnergyToDespawn = -100f;
  31. /// <summary>
  32. /// Played when energy reaches the lower limit (and entity destroyed)
  33. /// </summary>
  34. [DataField]
  35. public SoundSpecifier? SoundCollapse;
  36. /// <summary>
  37. /// Entities that spawn when the energy limit is reached
  38. /// </summary>
  39. [DataField, ViewVariables(VVAccess.ReadWrite)]
  40. public EntProtoId SpawnProto = "TeslaMiniEnergyBall";
  41. /// <summary>
  42. /// Entity, spun when tesla gobbles with touch.
  43. /// </summary>
  44. [DataField, ViewVariables(VVAccess.ReadWrite)]
  45. public EntProtoId ConsumeEffectProto = "EffectTeslaSparks";
  46. }