using Robust.Shared.Audio; using Robust.Shared.GameStates; namespace Content.Shared.Damage.Components; /// /// This component is added to entities that you want to damage the player /// if the player interacts with it. For example, if a player tries touching /// a hot light bulb or an anomaly. This damage can be cancelled if the user /// has a component that protects them from this. /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] public sealed partial class DamageOnInteractComponent : Component { /// /// How much damage to apply to the person making contact /// [DataField(required: true), AutoNetworkedField] public DamageSpecifier Damage = default!; /// /// Whether the damage should be resisted by a person's armor values /// and the /// [DataField] public bool IgnoreResistances; /// /// What kind of localized text should pop up when they interact with the entity /// [DataField] public LocId? PopupText; /// /// The sound that should be made when interacting with the entity /// [DataField] public SoundSpecifier InteractSound = new SoundPathSpecifier("/Audio/Effects/lightburn.ogg"); /// /// Generic boolean to toggle the damage application on and off /// This is useful for things that can be toggled on or off, like a stovetop /// [DataField, AutoNetworkedField] public bool IsDamageActive = true; /// /// Whether the thing should be thrown from its current position when they interact with the entity /// [DataField] public bool Throw = false; /// /// The speed applied to the thing when it is thrown /// [DataField] public int ThrowSpeed = 10; /// /// Time between being able to interact with this entity /// [DataField] public uint InteractTimer = 0; /// /// Tracks the last time this entity was interacted with, but only if the interaction resulted in the user taking damage /// [DataField] public TimeSpan LastInteraction = TimeSpan.Zero; /// /// Tracks the time that this entity can be interacted with, but only if the interaction resulted in the user taking damage /// [DataField] public TimeSpan NextInteraction = TimeSpan.Zero; /// /// Probability that the user will be stunned when they interact with with this entity and took damage /// [DataField] public float StunChance = 0.0f; /// /// Duration, in seconds, of the stun applied to the user when they interact with the entity and took damage /// [DataField] public float StunSeconds = 0.0f; }