Пример #1
0
        public override void ConfirmCast()
        {
            if (!AbilityHelper.TryRaycastActor(out var actor))
            {
                return;
            }

            if (!CheckBuilder.AllowCast())
            {
                return;
            }
            if (!CheckBuilder.AllowTarget(actor))
            {
                return;
            }

            if (actor.TryGetModule <ITargetable>(out var targetable))
            {
                if (!targetable.AllowSpellTargets)
                {
                    return;
                }
            }
            if (!AbilityHelper.HasModule <IDamageable>(actor.gameObject))
            {
                return;
            }

            CheckBuilder.DoCast();

            Cast(Self, actor);
            Modules.Abilitiable.NotifyAbilityCast(new AbilityEventArgs(Self, View.StatCost.Cost));
        }
Пример #2
0
#pragma warning restore 0649


        public override void ConfirmCast()
        {
            if (Active)
            {
                return;
            }

            if (!CheckBuilder.AllowCast())
            {
                return;
            }

            Active = true;
            _channelTimer.Reset();
            CheckBuilder.MagicCost.SpendCost();
            CastNoTarget();
            Modules.Abilitiable.NotifyAbilityCast(new AbilityEventArgs(Self, CheckBuilder.MagicCost.Cost));
        }
Пример #3
0
        public override void ConfirmCast()
        {
            var ray = AbilityHelper.GetScreenRay();

            if (!AbilityHelper.TryGetWorld(ray, out var hit))
            {
                return;
            }
            if (!CheckBuilder.AllowCast())
            {
                return;
            }
            CastRange.MaxDistance = _overheat.Active ? _overheatCastRange : _castRange;
            if (!CastRange.InRange(hit.point))
            {
                return;
            }
            CheckBuilder.DoCast();
            CastGroundTarget(hit.point);
            Modules.Abilitiable.NotifyAbilityCast(new AbilityEventArgs(Self, View.StatCost.Cost));
        }