1
0

ChaoticJumpComponent.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using Content.Server.Physics.Controllers;
  2. using Content.Shared.Physics;
  3. using Robust.Shared.Prototypes;
  4. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  5. namespace Content.Server.Physics.Components;
  6. /// <summary>
  7. /// A component which makes its entity periodically chaotic jumps arounds
  8. /// </summary>
  9. [RegisterComponent, Access(typeof(ChaoticJumpSystem))]
  10. public sealed partial class ChaoticJumpComponent : Component
  11. {
  12. /// <summary>
  13. /// The next moment in time when the entity is pushed toward its goal
  14. /// </summary>
  15. [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
  16. public TimeSpan NextJumpTime;
  17. /// <summary>
  18. /// Minimum interval between jumps
  19. /// </summary>
  20. [DataField, ViewVariables(VVAccess.ReadWrite)]
  21. public float JumpMinInterval = 5f;
  22. /// <summary>
  23. /// Maximum interval between jumps
  24. /// </summary>
  25. [DataField, ViewVariables(VVAccess.ReadWrite)]
  26. public float JumpMaxInterval = 15f;
  27. /// <summary>
  28. /// collision limits for which it is impossible to make a jump
  29. /// </summary>
  30. [DataField, ViewVariables(VVAccess.ReadWrite)]
  31. public int CollisionMask = (int) CollisionGroup.Impassable;
  32. /// <summary>
  33. /// Minimum jump range
  34. /// </summary>
  35. [DataField, ViewVariables(VVAccess.ReadWrite)]
  36. public float RangeMin = 5f;
  37. /// <summary>
  38. /// Maximum jump range
  39. /// </summary>
  40. [DataField, ViewVariables(VVAccess.ReadWrite)]
  41. public float RangeMax = 10f;
  42. /// <summary>
  43. /// Spawn before jump
  44. /// </summary>
  45. [DataField, ViewVariables(VVAccess.ReadWrite)]
  46. public EntProtoId Effect = "EffectEmpPulse";
  47. }