SharedCargoTelepadComponent.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using Content.Shared.DeviceLinking;
  2. using Robust.Shared.Audio;
  3. using Robust.Shared.GameStates;
  4. using Robust.Shared.Prototypes;
  5. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  6. namespace Content.Shared.Cargo.Components;
  7. /// <summary>
  8. /// Handles teleporting in requested cargo after the specified delay.
  9. /// </summary>
  10. [RegisterComponent, NetworkedComponent, Access(typeof(SharedCargoSystem))]
  11. public sealed partial class CargoTelepadComponent : Component
  12. {
  13. [DataField]
  14. public List<CargoOrderData> CurrentOrders = new();
  15. /// <summary>
  16. /// The actual amount of time it takes to teleport from the telepad
  17. /// </summary>
  18. [DataField("delay"), ViewVariables(VVAccess.ReadWrite)]
  19. public float Delay = 5f;
  20. /// <summary>
  21. /// How much time we've accumulated until next teleport.
  22. /// </summary>
  23. [DataField("accumulator"), ViewVariables(VVAccess.ReadWrite)]
  24. public float Accumulator;
  25. [DataField("currentState")]
  26. public CargoTelepadState CurrentState = CargoTelepadState.Unpowered;
  27. [DataField("teleportSound")]
  28. public SoundSpecifier TeleportSound = new SoundPathSpecifier("/Audio/Machines/phasein.ogg");
  29. /// <summary>
  30. /// The paper-type prototype to spawn with the order information.
  31. /// </summary>
  32. [DataField("printerOutput", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>)), ViewVariables(VVAccess.ReadWrite)]
  33. public string PrinterOutput = "PaperCargoInvoice";
  34. [DataField("receiverPort", customTypeSerializer: typeof(PrototypeIdSerializer<SinkPortPrototype>)), ViewVariables(VVAccess.ReadWrite)]
  35. public string ReceiverPort = "OrderReceiver";
  36. }