mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-18 22:18:52 +03:00
# Description By request from the very same person who assisted with https://github.com/Simple-Station/Einstein-Engines/pull/1618 This PR ports(and fixes) https://github.com/space-wizards/space-station-14/pull/23372 such that it works on modern Robust Toolbox. This PR essentially makes it so that the Singularity (And Tesla by extension) inherit some of the momentum of objects thrown into them. Im practice it means that they now work more like they do in SS13, whereby if a traitor does not actively intervene in a Singuloose(such as by using a Singularity Beacon), the singularity will usually be "Blown back into space" by space wind throwing objects at it in retaliation to it eating engineering. <details><summary><h1>Media</h1></summary> <p> https://github.com/user-attachments/assets/04e9e5b9-d873-4425-b19a-b854b57db486 </p> </details> # Changelog 🆑 - add: Singularity and Tesla are now affected by objects thrown into them, causing them to change directions. Unless a traitor intervenes (with a Singularity Beacon), a "Singuloose" is extremely likely to be blown out to space. --------- Signed-off-by: VMSolidus <evilexecutive@gmail.com> Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> (cherry picked from commit 34b55e14f51d562510b1d9954999fbb3085bdf02)
84 lines
2.9 KiB
C#
84 lines
2.9 KiB
C#
using Content.Shared.Singularity.Components;
|
|
using Content.Server.Singularity.EntitySystems;
|
|
|
|
namespace Content.Server.Singularity.Components;
|
|
|
|
/// <summary>
|
|
/// The server-side version of <see cref="SharedGravityWellComponent"/>.
|
|
/// Primarily managed by <see cref="GravityWellSystem"/>.
|
|
/// </summary>
|
|
[RegisterComponent]
|
|
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)]
|
|
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)]
|
|
public float MinRange = 0f;
|
|
|
|
/// <summary>
|
|
/// The acceleration entities will experience towards the gravity well at a distance of 1m.
|
|
/// 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)]
|
|
public float BaseRadialAcceleration = 0.0f;
|
|
|
|
/// <summary>
|
|
/// The acceleration entities will experience tangent to the gravity well at a distance of 1m.
|
|
/// Positive tangential acceleration is counter-clockwise.
|
|
/// Actual acceleration scales with the inverse of the distance to the singularity.
|
|
/// </summary>
|
|
[DataField("baseTangentialAcceleration")]
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
public float BaseTangentialAcceleration = 0.0f;
|
|
|
|
#region Update Timing
|
|
|
|
/// <summary>
|
|
/// The amount of time that should elapse between automated updates to this gravity well.
|
|
/// </summary>
|
|
[DataField("gravPulsePeriod")]
|
|
[ViewVariables(VVAccess.ReadOnly)]
|
|
[Access(typeof(GravityWellSystem))]
|
|
public TimeSpan TargetPulsePeriod { get; internal set; } = TimeSpan.FromSeconds(0.5);
|
|
|
|
/// <summary>
|
|
/// The next time at which this gravity well should pulse.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadOnly)]
|
|
[Access(typeof(GravityWellSystem))]
|
|
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!;
|
|
|
|
/// <summary>
|
|
/// Whether to also apply Newton's third law.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool ApplyCounterforce;
|
|
|
|
/// <summary>
|
|
/// If <see cref="ApplyCounterforce"/> is true, how much to pull self to static objects. Does not pull static objects if null.
|
|
/// </summary>
|
|
[DataField]
|
|
public float? StaticAttraction = null;
|
|
|
|
#endregion Update Timing
|
|
}
|