示例#1
0
 public override void ConfirmCast()
 {
     if (View.Toggleable.Active)
     {
         return;
     }
     if (!Checker.AllowCast())
     {
         return;
     }
     View.Toggleable.Active = true;
     CastNoTarget();
     Checker.DoCast();
     Checker.Cooldown.End();
     Modules.Abilitiable.NotifyAbilityCast(new AbilityEventArgs(Self, View.StatCost.Cost));
 }
示例#2
0
        public override void ConfirmCast()
        {
            if (!Checker.AllowCast())
            {
                return;
            }

            var ray = AbilityHelper.GetScreenRay();

            if (!AbilityHelper.TryGetWorldOrEntity(ray, out var hit))
            {
                return;
            }
            var unitCast = AbilityHelper.TryGetActor(hit.collider, out var actor);

            if (actor == Self)
            {
                return;
            }
            var position = unitCast
                ? actor.transform.position
                : hit.point;

            if (!CastRange.InRange(position))
            {
                return;
            }

            if (unitCast)
            {
                if (!Checker.AllowTarget(actor))
                {
                    return;
                }

                Checker.DoCast();
                CastObjectTarget(actor);
            }
            else
            {
                Checker.DoCast();
                CastGroundTarget(position);
            }

            Modules.Abilitiable.NotifyAbilityCast(new AbilityEventArgs(Self, Checker.MagicCost.Cost));
        }
示例#3
0
        public override void ConfirmCast()
        {
            if (!Checker.AllowCast())
            {
                return;
            }
            var ray = AbilityHelper.GetScreenRay();

            if (!AbilityHelper.TryGetWorldOrEntity(ray, out var hit))
            {
                return;
            }

            var unitTarget = AbilityHelper.TryGetActor(hit.collider, out var actor);

            if (actor == Self)
            {
                return;
            }

            if (!unitTarget && !CastRange.InRange(hit.point))
            {
                return;
            }
            if (unitTarget && !CastRange.InRange(actor))
            {
                return;
            }


            Checker.DoCast();
            if (!unitTarget)
            {
                CastGroundTarget(hit.point);
            }
            else
            {
                CastObjectTarget(actor);
            }

            Modules.Abilitiable.NotifyAbilityCast(new AbilityEventArgs(Self, View.StatCost.Cost));
        }