SpecialRespawnComponent.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Robust.Shared.GameStates;
  2. using Robust.Shared.Prototypes;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  4. namespace Content.Shared.Respawn;
  5. /// <summary>
  6. /// This is to be used where you need some item respawned on station if it was deleted somehow in round
  7. /// Items like the nuke disk.
  8. /// </summary>
  9. [RegisterComponent, NetworkedComponent]
  10. public sealed partial class SpecialRespawnComponent: Component
  11. {
  12. [ViewVariables]
  13. [DataField("stationMap")]
  14. public (EntityUid?, EntityUid?) StationMap;
  15. /// <summary>
  16. /// Checks if the entityentity should respawn on the station grid
  17. /// </summary>
  18. [ViewVariables(VVAccess.ReadWrite)]
  19. [DataField("respawn")]
  20. public bool Respawn = true;
  21. /// <summary>
  22. /// The prototypeID of the entity to be respawned
  23. /// </summary>
  24. [ViewVariables]
  25. [DataField("prototype", required:true, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
  26. public string Prototype = "";
  27. }
  28. public sealed class SpecialRespawnSetupEvent : EntityEventArgs
  29. {
  30. public EntityUid Entity;
  31. public SpecialRespawnSetupEvent(EntityUid entity)
  32. {
  33. Entity = entity;
  34. }
  35. }