Exemple #1
0
    void CheckTarget(Actor target)
    {
        if (SkillTargetIDList.Contains(target.ID))
        {
            return;
        }
        if (target.IsDead)
        {
            return;
        }
        float d = ActorTargetManager.GetTargetDistance(CurrentActor.RealPos, target.RealPos);

        if (m_skillInfo.AttackDistance >= d)
        {
            switch ((ENTargetType)m_skillInfo.TargetType)
            {
            case ENTargetType.enEnemy:
            {
                if (!ActorTargetManager.IsEnemy(CurrentActor, target))
                {
                    return;
                }
            }
            break;

            case ENTargetType.enFriendly:
            {
                if (!ActorTargetManager.IsFriendly(CurrentActor, target))
                {
                    return;
                }
            }
            break;

            case ENTargetType.enSelf:
            {
                if (CurrentActor != target)
                {
                    return;
                }
            }
            break;

            case ENTargetType.enNullTarget:
                break;

            case ENTargetType.enInteraction:
            {
                if (!ActorTargetManager.IsInteractionally(CurrentActor, target))
                {
                    return;
                }
            }
            break;

            case ENTargetType.enFriendlyAndSelf:
            {
                if (!ActorTargetManager.IsFriendly(CurrentActor, target) && CurrentActor != target)
                {
                    return;
                }
            }
            break;

            default:
                return;
            }
            if (d < m_closestDistance)
            {
                m_closestTargetID = target.ID;
            }
        }
    }