1
0

LightningArcShooterComponent.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using Content.Server.Tesla.EntitySystems;
  2. using Robust.Shared.Prototypes;
  3. namespace Content.Server.Tesla.Components;
  4. /// <summary>
  5. /// Periodically fires electric arcs at surrounding objects.
  6. /// </summary>
  7. [RegisterComponent, Access(typeof(LightningArcShooterSystem)), AutoGenerateComponentPause]
  8. public sealed partial class LightningArcShooterComponent : Component
  9. {
  10. /// <summary>
  11. /// The number of lightning bolts that are fired at the same time. From 0 to N
  12. /// Important balance value: if there aren't a N number of coils or grounders around the tesla,
  13. /// the tesla will have a chance to shoot into something important and break.
  14. /// </summary>
  15. [DataField, ViewVariables(VVAccess.ReadWrite)]
  16. public int MaxLightningArc = 1;
  17. /// <summary>
  18. /// Minimum interval between shooting.
  19. /// </summary>
  20. [DataField, ViewVariables(VVAccess.ReadWrite)]
  21. public float ShootMinInterval = 0.5f;
  22. /// <summary>
  23. /// Maximum interval between shooting.
  24. /// </summary>
  25. [DataField, ViewVariables(VVAccess.ReadWrite)]
  26. public float ShootMaxInterval = 8.0f;
  27. /// <summary>
  28. /// the target selection radius for lightning bolts.
  29. /// </summary>
  30. [DataField, ViewVariables(VVAccess.ReadWrite)]
  31. public float ShootRange = 5f;
  32. /// <summary>
  33. /// How many times after a hit the lightning bolt will bounce into an adjacent target
  34. /// </summary>
  35. [DataField, ViewVariables(VVAccess.ReadWrite)]
  36. public int ArcDepth = 1;
  37. /// <summary>
  38. /// The time, upon reaching which the next batch of lightning bolts will be fired.
  39. /// </summary>
  40. [DataField, ViewVariables(VVAccess.ReadWrite)]
  41. [AutoPausedField]
  42. public TimeSpan NextShootTime;
  43. /// <summary>
  44. /// The type of lightning bolts we shoot
  45. /// </summary>
  46. [DataField, ViewVariables(VVAccess.ReadWrite)]
  47. public EntProtoId LightningPrototype = "Lightning";
  48. }