Add BreakOnDistance to DoAfterEventArgs (#8902)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
themias
2022-07-04 02:56:31 -04:00
committed by GitHub
parent a12245c50e
commit a32c5e543b
3 changed files with 39 additions and 2 deletions

View File

@@ -20,6 +20,11 @@ namespace Content.Server.DoAfter
/// </summary>
public EntityUid? Target { get; }
/// <summary>
/// Entity used by the User on the Target.
/// </summary>
public EntityUid? Used { get; set; }
/// <summary>
/// Manually cancel the do_after so it no longer runs
/// </summary>
@@ -55,6 +60,11 @@ namespace Content.Server.DoAfter
public FixedPoint2 DamageThreshold { get; set; }
public bool BreakOnStun { get; set; }
/// <summary>
/// Threshold for distance user from the used OR target entities.
/// </summary>
public float? DistanceThreshold { get; set; }
/// <summary>
/// Requires a function call once at the end (like InRangeUnobstructed).
/// </summary>
@@ -102,12 +112,14 @@ namespace Content.Server.DoAfter
EntityUid user,
float delay,
CancellationToken cancelToken = default,
EntityUid? target = null)
EntityUid? target = null,
EntityUid? used = null)
{
User = user;
Delay = delay;
CancelToken = cancelToken;
Target = target;
Used = used;
MovementThreshold = 0.1f;
DamageThreshold = 1.0;