SalvageExpeditionComponent.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System.Numerics;
  2. using Content.Shared.Salvage;
  3. using Content.Shared.Salvage.Expeditions;
  4. using Robust.Shared.Audio;
  5. using Robust.Shared.Prototypes;
  6. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  7. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
  8. namespace Content.Server.Salvage.Expeditions;
  9. /// <summary>
  10. /// Designates this entity as holding a salvage expedition.
  11. /// </summary>
  12. [RegisterComponent, AutoGenerateComponentPause]
  13. public sealed partial class SalvageExpeditionComponent : SharedSalvageExpeditionComponent
  14. {
  15. public SalvageMissionParams MissionParams = default!;
  16. /// <summary>
  17. /// Where the dungeon is located for initial announcement.
  18. /// </summary>
  19. [DataField("dungeonLocation")]
  20. public Vector2 DungeonLocation = Vector2.Zero;
  21. /// <summary>
  22. /// When the expeditions ends.
  23. /// </summary>
  24. [ViewVariables(VVAccess.ReadWrite), DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
  25. [AutoPausedField]
  26. public TimeSpan EndTime;
  27. /// <summary>
  28. /// Station whose mission this is.
  29. /// </summary>
  30. [DataField("station")]
  31. public EntityUid Station;
  32. [ViewVariables] public bool Completed = false;
  33. /// <summary>
  34. /// Countdown audio stream.
  35. /// </summary>
  36. [DataField, AutoNetworkedField]
  37. public EntityUid? Stream = null;
  38. /// <summary>
  39. /// Sound that plays when the mission end is imminent.
  40. /// </summary>
  41. [ViewVariables(VVAccess.ReadWrite), DataField]
  42. public SoundSpecifier Sound = new SoundCollectionSpecifier("ExpeditionEnd")
  43. {
  44. Params = AudioParams.Default.WithVolume(-5),
  45. };
  46. /// <summary>
  47. /// Song selected on MapInit so we can predict the audio countdown properly.
  48. /// </summary>
  49. [DataField]
  50. public ResolvedSoundSpecifier SelectedSong;
  51. }