Files
wwdpublic/Content.Client/Singularity/Systems/SingularitySystem.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

37 lines
1.3 KiB
C#

using Content.Shared.Singularity;
using Content.Shared.Singularity.Components;
using Content.Shared.Singularity.EntitySystems;
using Robust.Client.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Utility;
namespace Content.Client.Singularity.Systems;
/// <summary>
/// The client-side version of <see cref="SharedSingularitySystem"/>.
/// Primarily manages <see cref="SingularityComponent"/>s.
/// </summary>
public sealed class SingularitySystem : SharedSingularitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SingularityComponent, ComponentHandleState>(HandleSingularityState);
}
/// <summary>
/// Handles syncing singularities with their server-side versions.
/// </summary>
/// <param name="uid">The uid of the singularity to sync.</param>
/// <param name="comp">The state of the singularity to sync.</param>
/// <param name="args">The event arguments including the state to sync the singularity with.</param>
private void HandleSingularityState(EntityUid uid, SingularityComponent comp, ref ComponentHandleState args)
{
if (args.Current is not SingularityComponentState state)
return;
SetLevel(uid, state.Level, comp);
}
}