* InitialCommit (Broken) * Fixes compile errors * PR comments. More doc comments. Fixes * Makes a singularity/event horizon without radiation/physics a valid state to be in * VV 'fake' setters, fixes the visualizer, fixes the singularity trying to eat itself instead of nearby things. * Removes unused dependency from Content.Client.GravityWellSystem * Testing containment and fake VV setters for SingularityGeneratorComponent * Fixes gravity wells (broken due to LookupFlags.None). Adds recursive Event Horizon consumption * Fix merge skew * Fixes for the master merge * Fix engine commit * Dirty is obsolete * Switch over dirty * Fix requested changes * ambiant -> ambient * Moves EventHorionComponent to Shared * Proper container handling * Fixes master merge. Fixes post insertion assertions for singularities. Extends proper container handling to gravity wells and the distortion shader. * Better support for admemes throwing singularities. * Moves update timing from accumulators to target times * Update doc comments
93 lines
3.1 KiB
C#
93 lines
3.1 KiB
C#
using Content.Shared.Singularity.Components;
|
|
using Content.Server.Singularity.EntitySystems;
|
|
using Robust.Shared.Audio;
|
|
|
|
namespace Content.Server.Singularity.Components;
|
|
|
|
/// <summary>
|
|
/// The server-side version of <see cref="SharedSingularityComponent">.
|
|
/// Primarily managed by <see cref="SingularitySystem">.
|
|
/// </summary>
|
|
[RegisterComponent]
|
|
[ComponentReference(typeof(SharedSingularityComponent))]
|
|
public sealed class SingularityComponent : SharedSingularityComponent
|
|
{
|
|
/// <summary>
|
|
/// The amount of energy this singularity contains.
|
|
/// If you want to set this go through <see cref="SingularitySystem.SetEnergy"/>
|
|
/// </summary>
|
|
[DataField("energy")]
|
|
[Access(friends:typeof(SingularitySystem))]
|
|
public float Energy = 180f;
|
|
|
|
/// <summary>
|
|
/// The rate at which this singularity loses energy over time.
|
|
/// </summary>
|
|
[DataField("energyLoss")]
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
public float EnergyDrain;
|
|
|
|
#region Audio
|
|
|
|
/// <summary>
|
|
/// The sound that this singularity produces by existing.
|
|
/// </summary>
|
|
[DataField("ambientSound")]
|
|
[ViewVariables(VVAccess.ReadOnly)]
|
|
public SoundSpecifier? AmbientSound = new SoundPathSpecifier(
|
|
"/Audio/Effects/singularity_form.ogg",
|
|
AudioParams.Default.WithVolume(5).WithLoop(true).WithMaxDistance(20f)
|
|
);
|
|
|
|
/// <summary>
|
|
/// The audio stream that plays the sound specified by <see cref="AmbientSound"> on loop.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
public IPlayingAudioStream? AmbientSoundStream = null;
|
|
|
|
/// <summary>
|
|
/// The sound that the singularity produces when it forms.
|
|
/// </summary>
|
|
[DataField("formationSound")]
|
|
[ViewVariables(VVAccess.ReadOnly)]
|
|
public SoundSpecifier? FormationSound = null;
|
|
|
|
/// <summary>
|
|
/// The sound that the singularity produces when it dissipates.
|
|
/// </summary>
|
|
[DataField("dissipationSound")]
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
public SoundSpecifier? DissipationSound = new SoundPathSpecifier(
|
|
"/Audio/Effects/singularity_collapse.ogg",
|
|
AudioParams.Default
|
|
);
|
|
|
|
#endregion Audio
|
|
|
|
#region Update Timing
|
|
|
|
/// <summary>
|
|
/// The amount of time that should elapse between automated updates to this singularity.
|
|
/// </summary>
|
|
[DataField("updatePeriod")]
|
|
[ViewVariables(VVAccess.ReadOnly)]
|
|
[Access(typeof(SingularitySystem))]
|
|
public TimeSpan TargetUpdatePeriod { get; internal set; } = TimeSpan.FromSeconds(1.0);
|
|
|
|
/// <summary>
|
|
/// The next time this singularity should be updated by <see cref="SingularitySystem"/>
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadOnly)]
|
|
[Access(typeof(SingularitySystem))]
|
|
public TimeSpan NextUpdateTime { get; internal set; } = default!;
|
|
|
|
/// <summary>
|
|
/// The last time this singularity was be updated by <see cref="SingularitySystem"/>
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadOnly)]
|
|
[Access(typeof(SingularitySystem))]
|
|
public TimeSpan LastUpdateTime { get; internal set; } = default!;
|
|
|
|
#endregion Update Timing
|
|
}
|