Exemple #1
0
        /// <summary>
        /// Update the cuffed state of an entity
        /// </summary>
        private async void TryUpdateCuff(IEntity user, IEntity target, CuffableComponent cuffs)
        {
            var cuffTime = CuffTime;

            if (target.TryGetComponent <StunnableComponent>(out var stun) && stun.Stunned)
            {
                cuffTime = MathF.Max(0.1f, cuffTime - StunBonus);
            }

            var doAfterEventArgs = new DoAfterEventArgs(user, cuffTime, default, target)
        /// <summary>
        /// Update the cuffed state of an entity
        /// </summary>
        private async void TryUpdateCuff(EntityUid user, EntityUid target, CuffableComponent cuffs)
        {
            var cuffTime = CuffTime;

            if (_entities.HasComponent <StunnedComponent>(target))
            {
                cuffTime = MathF.Max(0.1f, cuffTime - StunBonus);
            }

            var doAfterEventArgs = new DoAfterEventArgs(user, cuffTime, default, target)
        /// <summary>
        /// Update the cuffed state of an entity
        /// </summary>
        public async void TryUpdateCuff(EntityUid user, EntityUid target, CuffableComponent cuffs)
        {
            var cuffTime = CuffTime;

            if (_entities.HasComponent <StunnedComponent>(target))
            {
                cuffTime = MathF.Max(0.1f, cuffTime - StunBonus);
            }

            if (_entities.HasComponent <DisarmProneComponent>(target))
            {
                cuffTime = 0.0f; // cuff them instantly.
            }
            var doAfterEventArgs = new DoAfterEventArgs(user, cuffTime, default, target)