Gravity well improvements (#35027)
* Gravity well improvements - Fixed persistence - Removed dummy fields - Performance * Update Content.Server/Singularity/Components/GravityWellComponent.cs --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
@@ -7,22 +7,20 @@ namespace Content.Server.Singularity.Components;
|
||||
/// The server-side version of <see cref="SharedGravityWellComponent"/>.
|
||||
/// Primarily managed by <see cref="GravityWellSystem"/>.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, AutoGenerateComponentPause]
|
||||
public sealed partial class GravityWellComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The maximum range at which the gravity well can push/pull entities.
|
||||
/// </summary>
|
||||
[DataField("maxRange")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField]
|
||||
public float MaxRange;
|
||||
|
||||
/// <summary>
|
||||
/// The minimum range at which the gravity well can push/pull entities.
|
||||
/// This is effectively hardfloored at <see cref="GravityWellSystem.MinGravPulseRange"/>.
|
||||
/// </summary>
|
||||
[DataField("minRange")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField]
|
||||
public float MinRange = 0f;
|
||||
|
||||
/// <summary>
|
||||
@@ -30,8 +28,7 @@ public sealed partial class GravityWellComponent : Component
|
||||
/// Negative values accelerate entities away from the gravity well.
|
||||
/// Actual acceleration scales with the inverse of the distance to the singularity.
|
||||
/// </summary>
|
||||
[DataField("baseRadialAcceleration")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField]
|
||||
public float BaseRadialAcceleration = 0.0f;
|
||||
|
||||
/// <summary>
|
||||
@@ -39,8 +36,7 @@ public sealed partial class GravityWellComponent : Component
|
||||
/// Positive tangential acceleration is counter-clockwise.
|
||||
/// Actual acceleration scales with the inverse of the distance to the singularity.
|
||||
/// </summary>
|
||||
[DataField("baseTangentialAcceleration")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField]
|
||||
public float BaseTangentialAcceleration = 0.0f;
|
||||
|
||||
#region Update Timing
|
||||
@@ -56,16 +52,14 @@ public sealed partial class GravityWellComponent : Component
|
||||
/// <summary>
|
||||
/// The next time at which this gravity well should pulse.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
[Access(typeof(GravityWellSystem))]
|
||||
[DataField, Access(typeof(GravityWellSystem)), AutoPausedField]
|
||||
public TimeSpan NextPulseTime { get; internal set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The last time this gravity well pulsed.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
[Access(typeof(GravityWellSystem))]
|
||||
public TimeSpan LastPulseTime { get; internal set; } = default!;
|
||||
public TimeSpan LastPulseTime => NextPulseTime - TargetPulsePeriod;
|
||||
|
||||
#endregion Update Timing
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user