using Content.Shared.Damage.Components; using Content.Shared.FixedPoint; using Robust.Shared.Serialization; namespace Content.Shared.Destructible.Thresholds.Triggers; /// /// A trigger that will activate when the total amount of damage received /// is above the specified threshold. /// [Serializable, NetSerializable] [DataDefinition] public sealed partial class DamageTrigger : IThresholdTrigger { /// /// The amount of damage at which this threshold will trigger. /// [DataField(required: true)] public FixedPoint2 Damage = default!; public bool Reached(Entity damageable, SharedDestructibleSystem system) { return damageable.Comp.TotalDamage >= Damage; } }