Example #1
0
        public bool TryInvoke(BaseAspect aspect)
        {
            if (CanInvoke(aspect))
            {
                return(VitaNexCore.TryCatchGet(
                           () =>
                {
                    SetLock(aspect, true);

                    OnInvoke(aspect);

                    aspect.OnAbility(this);

                    var locked = Lockdown.TotalSeconds;

                    if (locked > 0)
                    {
                        locked -= aspect.Scale(locked * 0.10);
                    }

                    locked = Math.Max(0, locked);

                    Timer.DelayCall(TimeSpan.FromSeconds(locked), a => SetLock(a, false), aspect);

                    return true;
                },
                           x => x.ToConsole(true)));
            }

            return(false);
        }