Splits the singularity into its component parts + ECS singularity + Support for singularities in containers. (#12132)

* 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
This commit is contained in:
TemporalOroboros
2022-12-19 18:47:15 -08:00
committed by GitHub
parent 490aefecef
commit 9a72b05a50
35 changed files with 2561 additions and 683 deletions

View File

@@ -1,11 +0,0 @@
using Content.Shared.Singularity.Components;
using Robust.Shared.GameObjects;
namespace Content.Client.Singularity.Components
{
[RegisterComponent]
[ComponentReference(typeof(SharedSingularityComponent))]
public sealed class ClientSingularityComponent : SharedSingularityComponent
{
}
}

View File

@@ -0,0 +1,13 @@
using Content.Shared.Singularity.Components;
using Content.Client.Singularity.EntitySystems;
namespace Content.Client.Singularity.Components;
/// <summary>
/// The client-side version of <see cref="SharedSingularityComponent"/>.
/// Primarily managed by <see cref="SingularitySystem"/>.
/// </summary>
[RegisterComponent]
[ComponentReference(typeof(SharedSingularityComponent))]
public sealed class SingularityComponent : SharedSingularityComponent
{}

View File

@@ -1,8 +0,0 @@
using Content.Shared.Singularity;
namespace Content.Client.Singularity
{
public sealed class SingularitySystem : SharedSingularitySystem
{
}
}

View File

@@ -0,0 +1,12 @@
using Content.Shared.Singularity.EntitySystems;
using Content.Shared.Singularity.Components;
namespace Content.Client.Singularity.EntitySystems;
/// <summary>
/// The client-side version of <see cref="SharedEventHorizonSystem"/>.
/// Primarily manages <see cref="EventHorizonComponent"/>s.
/// Exists to make relevant signal handlers (ie: <see cref="SharedEventHorizonSystem.OnPreventCollide"/>) work on the client.
/// </summary>
public sealed class EventHorizonSystem : SharedEventHorizonSystem
{}

View File

@@ -0,0 +1,33 @@
using Robust.Shared.GameStates;
using Content.Shared.Singularity.Components;
using Content.Shared.Singularity.EntitySystems;
namespace Content.Client.Singularity.EntitySystems;
/// <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<SharedSingularityComponent, 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, SharedSingularityComponent comp, ref ComponentHandleState args)
{
if (args.Current is not SingularityComponentState state)
return;
SetLevel(uid, state.Level, comp);
}
}

View File

@@ -32,7 +32,7 @@ namespace Content.Client.Singularity.Visualizers
return;
}
if (!component.TryGetData(SingularityVisuals.Level, out int level))
if (!component.TryGetData(SingularityVisuals.Level, out byte level))
{
return;
}