mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-19 07:01:09 +03:00
* i shitted * fsasfaasffasfsafsafsafsafsasfasfa * typo * remove TODO that I forgot about --------- Co-authored-by: iaada <iaada@users.noreply.github.com>
48 lines
1.5 KiB
C#
48 lines
1.5 KiB
C#
using Content.Server.Destructible.Thresholds.Behaviors;
|
|
using Content.Shared.Destructible.Thresholds.Triggers;
|
|
|
|
namespace Content.Server.Destructible.Thresholds;
|
|
|
|
[DataDefinition]
|
|
public sealed partial class DamageThreshold : IComparable<DamageThreshold>
|
|
{
|
|
/// <summary>
|
|
/// Whether or not this threshold was triggered in the previous call to
|
|
/// <see cref="Reached"/>.
|
|
/// </summary>
|
|
[ViewVariables] public bool OldTriggered;
|
|
|
|
/// <summary>
|
|
/// Whether or not this threshold has already been triggered.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool Triggered;
|
|
|
|
/// <summary>
|
|
/// Whether or not this threshold only triggers once.
|
|
/// If false, it will trigger again once the entity is healed
|
|
/// and then damaged to reach this threshold once again.
|
|
/// It will not repeatedly trigger as damage rises beyond that.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool TriggersOnce;
|
|
|
|
/// <summary>
|
|
/// The condition that decides if this threshold has been reached.
|
|
/// Gets evaluated each time the entity's damage changes.
|
|
/// </summary>
|
|
[DataField(required: true)]
|
|
public IThresholdTrigger Trigger;
|
|
|
|
/// <summary>
|
|
/// Behaviors to activate once this threshold is triggered.
|
|
/// TODO: Replace with EntityEffects.
|
|
/// </summary>
|
|
[DataField]
|
|
public List<IThresholdBehavior> Behaviors = new();
|
|
|
|
public int CompareTo(DamageThreshold? other)
|
|
{
|
|
return Trigger.CompareTo(other?.Trigger);
|
|
}
|
|
}
|