1
0

ShuttleComponent.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using System.Numerics;
  2. namespace Content.Server.Shuttles.Components
  3. {
  4. [RegisterComponent]
  5. public sealed partial class ShuttleComponent : Component
  6. {
  7. [ViewVariables]
  8. public bool Enabled = true;
  9. [ViewVariables]
  10. public Vector2[] CenterOfThrust = new Vector2[4];
  11. /// <summary>
  12. /// Thrust gets multiplied by this value if it's for braking.
  13. /// </summary>
  14. public const float BrakeCoefficient = 1.5f;
  15. /// <summary>
  16. /// Maximum velocity assuming unupgraded, tier 1 thrusters
  17. /// </summary>
  18. [ViewVariables(VVAccess.ReadWrite)]
  19. public float BaseMaxLinearVelocity = 20f;
  20. public const float MaxAngularVelocity = 4f;
  21. /// <summary>
  22. /// The cached thrust available for each cardinal direction
  23. /// </summary>
  24. [ViewVariables]
  25. public readonly float[] LinearThrust = new float[4];
  26. /// <summary>
  27. /// The thrusters contributing to each direction for impulse.
  28. /// </summary>
  29. // No touchy
  30. public readonly List<EntityUid>[] LinearThrusters = new List<EntityUid>[]
  31. {
  32. new(),
  33. new(),
  34. new(),
  35. new(),
  36. };
  37. /// <summary>
  38. /// The thrusters contributing to the angular impulse of the shuttle.
  39. /// </summary>
  40. public readonly List<EntityUid> AngularThrusters = new();
  41. [ViewVariables]
  42. public float AngularThrust = 0f;
  43. /// <summary>
  44. /// A bitmask of all the directions we are considered thrusting.
  45. /// </summary>
  46. [ViewVariables]
  47. public DirectionFlag ThrustDirections = DirectionFlag.None;
  48. /// <summary>
  49. /// Damping applied to the shuttle's physics component when not in FTL.
  50. /// </summary>
  51. [DataField("linearDamping"), ViewVariables(VVAccess.ReadWrite)]
  52. public float LinearDamping = 0.05f;
  53. [DataField("angularDamping"), ViewVariables(VVAccess.ReadWrite)]
  54. public float AngularDamping = 0.05f;
  55. }
  56. }