Files
wwdpublic/Content.Shared/Singularity/Components/SingularityGeneratorComponent.cs
Saphire 937cef62b8 Temporarily make singularity a bit harder to loose as non-antag (#33358)
Temporarily make singularity a bit harder to loose as non-antag

(cherry picked from commit a68c6cb29ea4a3e3d78e16c867366e488c699fff)

Fix Fluent string ID copypaste fail

(cherry picked from commit 01d6df3d0ace170438aae3931339be539bd8b38e)

Fix the component defaults

(cherry picked from commit 476f90df095502089d9f60ad59099f405be36cd2)

Bump the failsafe timer down

(cherry picked from commit 68eaf6ff254e49789696f5a79691c119e26cbb18)

Add emag functionality

(cherry picked from commit 6e53cd98a400466640586bf19b41ec281944795e)

Move some of the new singularity code into shared

Hopefully without explosions yay

(cherry picked from commit 9c666457c2c13505725b7d3c336cae50f0666460)

Actually make the emagging popup work properly

(cherry picked from commit 44db676b24c8781e3290d499c7233125d7789cf6)
2025-09-20 20:32:54 +03:00

70 lines
2.4 KiB
C#

using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Content.Shared.Physics;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using Robust.Shared.GameStates;
namespace Content.Shared.Singularity.Components;
[RegisterComponent, AutoGenerateComponentPause, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class SingularityGeneratorComponent : Component
{
/// <summary>
/// The amount of power this generator has accumulated.
/// If you want to set this use <see cref="SingularityGeneratorSystem.SetPower"/>
/// </summary>
[DataField]
public float Power = 0;
/// <summary>
/// The power threshold at which this generator will spawn a singularity.
/// If you want to set this use <see cref="SingularityGeneratorSystem.SetThreshold"/>
/// </summary>
[DataField]
public float Threshold = 16;
/// <summary>
/// Allows the generator to ignore all the failsafe stuff, e.g. when emagged
/// </summary>
[DataField, AutoNetworkedField]
public bool FailsafeDisabled = false;
/// <summary>
/// Maximum distance at which the generator will check for a field at
/// </summary>
[DataField]
public float FailsafeDistance = 16;
/// <summary>
/// The prototype ID used to spawn a singularity.
/// </summary>
[DataField("spawnId", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string? SpawnPrototype = "Singularity";
/// <summary>
/// The masks the raycast should not go through
/// </summary>
[DataField]
public int CollisionMask = (int)CollisionGroup.FullTileMask;
/// <summary>
/// Message to use when there's no containment field on cardinal directions
/// </summary>
[DataField]
public LocId ContainmentFailsafeMessage = "comp-generator-failsafe";
/// <summary>
/// For how long the failsafe will cause the generator to stop working and not issue a failsafe warning
/// </summary>
[DataField]
public TimeSpan FailsafeCooldown = TimeSpan.FromSeconds(10);
/// <summary>
/// How long until the generator can issue a failsafe warning again
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextFailsafe = TimeSpan.Zero;
}