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:
@@ -0,0 +1,33 @@
|
||||
using Content.Shared.Singularity.Components;
|
||||
using Robust.Shared.Containers;
|
||||
|
||||
namespace Content.Server.Singularity.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Event raised on the event horizon entity whenever an event horizon consumes an entity.
|
||||
/// </summary>
|
||||
public sealed class EntityConsumedByEventHorizonEvent : EntityEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The entity being consumed by the event horizon.
|
||||
/// </summary>
|
||||
public readonly EntityUid Entity;
|
||||
|
||||
/// <summary>
|
||||
/// The event horizon consuming the entity.
|
||||
/// </summary>
|
||||
public readonly EventHorizonComponent EventHorizon;
|
||||
|
||||
/// <summary>
|
||||
/// The innermost container of the entity being consumed by the event horizon that is not also in the process of being consumed by the event horizon.
|
||||
/// Used to correctly dump out the contents containers that are consumed by the event horizon.
|
||||
/// </summary>
|
||||
public readonly IContainer? Container;
|
||||
|
||||
public EntityConsumedByEventHorizonEvent(EntityUid entity, EventHorizonComponent eventHorizon, IContainer? container = null)
|
||||
{
|
||||
Entity = entity;
|
||||
EventHorizon = eventHorizon;
|
||||
Container = container;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using Content.Shared.Singularity.Components;
|
||||
|
||||
namespace Content.Server.Singularity.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Event raised on the target entity whenever an event horizon attempts to consume an entity.
|
||||
/// Can be cancelled to prevent the target entity from being consumed.
|
||||
/// </summary>
|
||||
public sealed class EventHorizonAttemptConsumeEntityEvent : CancellableEntityEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The entity that the event horizon is attempting to consume.
|
||||
/// </summary>
|
||||
public readonly EntityUid Entity;
|
||||
|
||||
/// <summary>
|
||||
/// The event horizon consuming the target entity.
|
||||
/// </summary>
|
||||
public readonly EventHorizonComponent EventHorizon;
|
||||
|
||||
public EventHorizonAttemptConsumeEntityEvent(EntityUid entity, EventHorizonComponent eventHorizon)
|
||||
{
|
||||
Entity = entity;
|
||||
EventHorizon = eventHorizon;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using Content.Shared.Singularity.Components;
|
||||
using Robust.Shared.Containers;
|
||||
|
||||
namespace Content.Server.Singularity.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Event raised on the event horizon entity whenever an event horizon consumes an entity.
|
||||
/// </summary>
|
||||
public sealed class EventHorizonConsumedEntityEvent : EntityEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The entity being consumed by the event horizon.
|
||||
/// </summary>
|
||||
public readonly EntityUid Entity;
|
||||
|
||||
/// <summary>
|
||||
/// The event horizon consuming the target entity.
|
||||
/// </summary>
|
||||
public readonly EventHorizonComponent EventHorizon;
|
||||
|
||||
/// <summary>
|
||||
/// The innermost container of the entity being consumed by the event horizon that is not also in the process of being consumed by the event horizon.
|
||||
/// Used to correctly dump out the contents containers that are consumed by the event horizon.
|
||||
/// </summary>
|
||||
public readonly IContainer? Container;
|
||||
|
||||
public EventHorizonConsumedEntityEvent(EntityUid entity, EventHorizonComponent eventHorizon, IContainer? container = null)
|
||||
{
|
||||
Entity = entity;
|
||||
EventHorizon = eventHorizon;
|
||||
Container = container;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using Robust.Shared.Containers;
|
||||
using Content.Shared.Singularity.Components;
|
||||
|
||||
namespace Content.Shared.Singularity.EntitySystems;
|
||||
|
||||
/// <summary>
|
||||
/// An event queued when an event horizon is contained (put into a container).
|
||||
/// Exists to delay the event horizon eating its way out of the container until events relating to the insertion have been processed.
|
||||
/// </summary>
|
||||
public sealed class EventHorizonContainedEvent : EntityEventArgs {
|
||||
/// <summary>
|
||||
/// The uid of the event horizon that has been contained.
|
||||
/// </summary>
|
||||
public readonly EntityUid Entity;
|
||||
|
||||
/// <summary>
|
||||
/// The state of the event horizon that has been contained.
|
||||
/// </summary>
|
||||
public readonly EventHorizonComponent EventHorizon;
|
||||
|
||||
/// <summary>
|
||||
/// The arguments of the action that resulted in the event horizon being contained.
|
||||
/// </summary>
|
||||
public readonly EntGotInsertedIntoContainerMessage Args;
|
||||
|
||||
public EventHorizonContainedEvent(EntityUid entity, EventHorizonComponent eventHorizon, EntGotInsertedIntoContainerMessage args) {
|
||||
Entity = entity;
|
||||
EventHorizon = eventHorizon;
|
||||
Args = args;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
|
||||
using Content.Shared.Singularity.Components;
|
||||
|
||||
namespace Content.Server.Singularity.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Event raised on the event horizon entity whenever an event horizon consumes an entity.
|
||||
/// </summary>
|
||||
public sealed class TilesConsumedByEventHorizonEvent : EntityEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The tiles that the event horizon is consuming.
|
||||
/// Ripped directly from the relevant proc so the second element of each element will be what the tiles are going to be after the grid is updated; usually <see cref="Tile.Empty"/>.
|
||||
/// </summary>
|
||||
public readonly IReadOnlyList<(Vector2i, Tile)> Tiles;
|
||||
|
||||
/// <summary>
|
||||
/// The mapgrid that the event horizon is consuming tiles of.
|
||||
/// </summary>
|
||||
public readonly MapGridComponent MapGrid;
|
||||
|
||||
/// <summary>
|
||||
/// The event horizon consuming the tiles.
|
||||
/// </summary>
|
||||
public readonly EventHorizonComponent EventHorizon;
|
||||
|
||||
public TilesConsumedByEventHorizonEvent(IReadOnlyList<(Vector2i, Tile)> tiles, MapGridComponent mapGrid, EventHorizonComponent eventHorizon)
|
||||
{
|
||||
Tiles = tiles;
|
||||
MapGrid = mapGrid;
|
||||
EventHorizon = eventHorizon;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user