InnerBodyAnomalyComponent.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using Content.Shared.Anomaly.Effects;
  2. using Content.Shared.Body.Prototypes;
  3. using Robust.Shared.Audio;
  4. using Robust.Shared.GameStates;
  5. using Robust.Shared.Prototypes;
  6. using Robust.Shared.Utility;
  7. namespace Content.Shared.Anomaly.Components;
  8. /// <summary>
  9. /// An anomaly within the body of a living being. Controls the ability to return to the standard state.
  10. /// </summary>
  11. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true), Access(typeof(SharedInnerBodyAnomalySystem))]
  12. public sealed partial class InnerBodyAnomalyComponent : Component
  13. {
  14. [DataField]
  15. public bool Injected;
  16. /// <summary>
  17. /// A prototype of an entity whose components will be added to the anomaly host **AND** then removed at the right time
  18. /// </summary>
  19. [DataField(required: true)]
  20. public EntProtoId? InjectionProto;
  21. /// <summary>
  22. /// Duration of stun from the effect of the anomaly
  23. /// </summary>
  24. [DataField]
  25. public float StunDuration = 4f;
  26. /// <summary>
  27. /// A message sent in chat to a player who has become infected by an anomaly
  28. /// </summary>
  29. [DataField]
  30. public LocId? StartMessage = null;
  31. /// <summary>
  32. /// A message sent in chat to a player who has cleared an anomaly
  33. /// </summary>
  34. [DataField]
  35. public LocId? EndMessage = "inner-anomaly-end-message";
  36. /// <summary>
  37. /// Sound, playing on becoming anomaly
  38. /// </summary>
  39. [DataField]
  40. public SoundSpecifier? StartSound = new SoundPathSpecifier("/Audio/Effects/inneranomaly.ogg");
  41. /// <summary>
  42. /// Used to display messages to the player about their level of disease progression
  43. /// </summary>
  44. [DataField]
  45. public float LastSeverityInformed = 0f;
  46. /// <summary>
  47. /// The fallback sprite to be added on the original entity. Allows you to visually identify the feature and type of anomaly to other players
  48. /// </summary>
  49. [DataField, AutoNetworkedField]
  50. public SpriteSpecifier? FallbackSprite = null;
  51. /// <summary>
  52. /// Ability to use unique sprites for different body types
  53. /// </summary>
  54. [DataField, AutoNetworkedField]
  55. public Dictionary<ProtoId<BodyPrototype>, SpriteSpecifier> SpeciesSprites = new();
  56. /// <summary>
  57. /// The key of the entity layer into which the sprite will be inserted
  58. /// </summary>
  59. [DataField]
  60. public string LayerMap = "inner_anomaly_layer";
  61. }
  62. /// <summary>
  63. /// Event broadcast when an anomaly is being removed because the host is dying.
  64. /// Raised directed at the host entity with the anomaly.
  65. /// Cancel this if you want to prevent the host from losing their anomaly on death.
  66. /// </summary>
  67. [ByRefEvent]
  68. public record struct BeforeRemoveAnomalyOnDeathEvent(bool Cancelled = false);