1
0

MimePowersComponent.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using Content.Shared.Alert;
  2. using Robust.Shared.Prototypes;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  4. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  5. namespace Content.Server.Abilities.Mime
  6. {
  7. /// <summary>
  8. /// Lets its owner entity use mime powers, like placing invisible walls.
  9. /// </summary>
  10. [RegisterComponent]
  11. public sealed partial class MimePowersComponent : Component
  12. {
  13. /// <summary>
  14. /// Whether this component is active or not.
  15. /// </summarY>
  16. [DataField("enabled")]
  17. public bool Enabled = true;
  18. /// <summary>
  19. /// The wall prototype to use.
  20. /// </summary>
  21. [DataField("wallPrototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
  22. public string WallPrototype = "WallInvisible";
  23. [DataField("invisibleWallAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
  24. public string? InvisibleWallAction = "ActionMimeInvisibleWall";
  25. [DataField("invisibleWallActionEntity")] public EntityUid? InvisibleWallActionEntity;
  26. // The vow zone lies below
  27. public bool VowBroken = false;
  28. /// <summary>
  29. /// Whether this mime is ready to take the vow again.
  30. /// Note that if they already have the vow, this is also false.
  31. /// </summary>
  32. public bool ReadyToRepent = false;
  33. /// <summary>
  34. /// Time when the mime can repent their vow
  35. /// </summary>
  36. [DataField("vowRepentTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
  37. public TimeSpan VowRepentTime = TimeSpan.Zero;
  38. /// <summary>
  39. /// How long it takes the mime to get their powers back
  40. /// </summary>
  41. [DataField("vowCooldown")]
  42. public TimeSpan VowCooldown = TimeSpan.FromMinutes(5);
  43. [DataField]
  44. public ProtoId<AlertPrototype> VowAlert = "VowOfSilence";
  45. [DataField]
  46. public ProtoId<AlertPrototype> VowBrokenAlert = "VowBroken";
  47. /// <summary>
  48. /// Does this component prevent the mime from writing on paper while their vow is active?
  49. /// </summary>
  50. [DataField]
  51. public bool PreventWriting = false;
  52. /// <summary>
  53. /// What message is displayed when the mime fails to write?
  54. /// </summary>
  55. [DataField]
  56. public LocId FailWriteMessage = "paper-component-illiterate-mime";
  57. }
  58. }