Allows pickuppable animals to resist out of inventory (#7545)

Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
This commit is contained in:
keronshb
2022-05-12 03:58:27 -04:00
committed by GitHub
parent 7a08985994
commit e2ac92c3b5
5 changed files with 116 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
using Robust.Shared.Analyzers;
using System.Threading;
namespace Content.Server.Resist;
[RegisterComponent]
public sealed class CanEscapeInventoryComponent : Component
{
/// <summary>
/// How long it takes to break out of storage. Default at 5 seconds.
/// </summary>
[ViewVariables]
[DataField("resistTime")]
public float ResistTime = 5f;
/// <summary>
/// For quick exit if the player attempts to move while already resisting
/// </summary>
[ViewVariables]
public bool IsResisting = false;
/// <summary>
/// Cancellation token used to cancel the DoAfter if the mob is removed before it's complete
/// </summary>
public CancellationTokenSource? CancelToken;
}