Files
tbd-station-14/Content.Shared/Respawn/SpecialRespawnComponent.cs
keronshb 3327c2998f 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
2022-12-19 20:38:34 -06:00

42 lines
1.2 KiB
C#

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;
}
}