using Content.Shared.Singularity.Components;
using Content.Server.Singularity.EntitySystems;
using Robust.Shared.Audio;
namespace Content.Server.Singularity.Components;
///
/// The server-side version of .
/// Primarily managed by .
///
[RegisterComponent]
[ComponentReference(typeof(SharedSingularityComponent))]
public sealed class SingularityComponent : SharedSingularityComponent
{
///
/// The amount of energy this singularity contains.
/// If you want to set this go through
///
[DataField("energy")]
[Access(friends:typeof(SingularitySystem))]
public float Energy = 180f;
///
/// The rate at which this singularity loses energy over time.
///
[DataField("energyLoss")]
[ViewVariables(VVAccess.ReadWrite)]
public float EnergyDrain;
#region Audio
///
/// The sound that this singularity produces by existing.
///
[DataField("ambientSound")]
[ViewVariables(VVAccess.ReadOnly)]
public SoundSpecifier? AmbientSound = new SoundPathSpecifier(
"/Audio/Effects/singularity_form.ogg",
AudioParams.Default.WithVolume(5).WithLoop(true).WithMaxDistance(20f)
);
///
/// The audio stream that plays the sound specified by on loop.
///
[ViewVariables(VVAccess.ReadWrite)]
public IPlayingAudioStream? AmbientSoundStream = null;
///
/// The sound that the singularity produces when it forms.
///
[DataField("formationSound")]
[ViewVariables(VVAccess.ReadOnly)]
public SoundSpecifier? FormationSound = null;
///
/// The sound that the singularity produces when it dissipates.
///
[DataField("dissipationSound")]
[ViewVariables(VVAccess.ReadWrite)]
public SoundSpecifier? DissipationSound = new SoundPathSpecifier(
"/Audio/Effects/singularity_collapse.ogg",
AudioParams.Default
);
#endregion Audio
#region Update Timing
///
/// The amount of time that should elapse between automated updates to this singularity.
///
[DataField("updatePeriod")]
[ViewVariables(VVAccess.ReadOnly)]
[Access(typeof(SingularitySystem))]
public TimeSpan TargetUpdatePeriod { get; internal set; } = TimeSpan.FromSeconds(1.0);
///
/// The next time this singularity should be updated by
///
[ViewVariables(VVAccess.ReadOnly)]
[Access(typeof(SingularitySystem))]
public TimeSpan NextUpdateTime { get; internal set; } = default!;
///
/// The last time this singularity was be updated by
///
[ViewVariables(VVAccess.ReadOnly)]
[Access(typeof(SingularitySystem))]
public TimeSpan LastUpdateTime { get; internal set; } = default!;
#endregion Update Timing
}