예제 #1
0
파일: Nightmare.cs 프로젝트: ModernMAK/BoEG
        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
        public override void ConfirmCast()
        {
            if (!CheckBuilder.AllowCast())
            {
                return;
            }

            if (!AbilityHelper.TryRaycastActor(out var actor))
            {
                return;
            }

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

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

            if (!AbilityHelper.AllowSpellTargets(actor))
            {
                return;
            }

            if (!AbilityHelper.HasModule <IDamageable>(actor.gameObject))
            {
                return;
            }



            CheckBuilder.DoCast();
            CastObjectTarget(actor);
            Modules.Abilitiable.NotifyAbilityCast(new AbilityEventArgs(Self, CheckBuilder.MagicCost.Cost));
        }