Adds Special Respawn, spawns a new disk if the old one was deleted (#12762)

* Spawns a new disk if one was deleted

* Adds tiledef to space checks, also adds a way to randomly check for a respawn point on station

* Removes unused method

* Cuts down on tile checks needed by checking surrounding tiles first

* Fixes up an issue where the coords wouldn't spawn

* Removes disk system, adds special respawning system and comp

* Fixes spelling error

* Fixes linter issue

* Maybe fixes the linter with a ref event?

* Empty commit to rerun tests

* Maybe fix?

* check for deleted grid

* Moves shutdown code to terminating code

* Customtypeseralizer

* changes name of datafield

* Removes owning station references

* Trying the queue event again
This commit is contained in:
keronshb
2022-12-19 21:38:34 -05:00
committed by GitHub
parent 0549b22cbc
commit 3327c2998f
6 changed files with 251 additions and 18 deletions

View File

@@ -6,4 +6,7 @@ namespace Content.Shared.Nuke;
/// Used for tracking the nuke disk - isn't a tag for pinpointer purposes.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed class NukeDiskComponent : Component {}
public sealed class NukeDiskComponent : Component
{
}

View File

@@ -0,0 +1,6 @@
namespace Content.Shared.Respawn;
public abstract class SharedSpecialRespawnSystem : EntitySystem
{
}

View File

@@ -0,0 +1,41 @@
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.Respawn;
/// <summary>
/// This is to be used where you need some item respawned on station if it was deleted somehow in round
/// Items like the nuke disk.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed class SpecialRespawnComponent: Component
{
[ViewVariables]
[DataField("stationMap")]
public (EntityUid?, EntityUid?) StationMap;
/// <summary>
/// Checks if the entityentity should respawn on the station grid
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("respawn")]
public bool Respawn = true;
/// <summary>
/// The prototypeID of the entity to be respawned
/// </summary>
[ViewVariables]
[DataField("prototype", required:true, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string Prototype = "";
}
public sealed class SpecialRespawnSetupEvent : EntityEventArgs
{
public EntityUid Entity;
public SpecialRespawnSetupEvent(EntityUid entity)
{
Entity = entity;
}
}