Esempio n. 1
0
        public override float GetUtility(Character enemyCharacter, AICharacter ai)
        {
            if (AIMelee.IsEndState(ai.parent.state))
            {
                return(0.0f);
            }

            switch (ai.parent.state)
            {
            case Character.State.Attack:
                return(0.0f);
            }

            if (enemyCharacter == null)
            {
                return(0.1f);
            }

            if (ai.parent.NextAttackOn() == true)
            {
                return(0.0f);
            }

            if (MagiUtil.IsInRange(enemyCharacter.transform.position - ai.parent.transform.position, ai.parent.keepDistance + enemyCharacter.radius) == false)
            {
                return(0.0f);
            }

            return(0.1f);
        }
Esempio n. 2
0
        public override void Process(AICharacter ai)
        {
            if (ai.parent.GetCountAttackComboID() != 0)
            {
                end = true;
                return;
            }

            if (AIMelee.IsEndState(ai.parent.state))
            {
                end = true;
                return;
            }

            Character enemyPresent = ai.parent.EnemyPresent;

            if (enemyPresent == null)
            {
                end = true;
                return;
            }

            if (Time.time - checkTime_ > 2.0f)
            {
                checkTime_ = Time.time;
                float fLength = (lastChasePos_ - ai.parent.transform.position).magnitude;
                if (fLength < 1.0f)
                {
                    end = true;
                    return;
                }
                lastChasePos_ = ai.parent.transform.position;
            }

            if (MagiUtil.IsInRange(enemyPresent.transform.position - ai.parent.transform.position, ai.parent.keepDistance + enemyPresent.radius))
            {
                end = true;
                return;
            }

            if (MagiUtil.IsInRange(enemyPresent.transform.position - ai.parent.transform.position, ai.parent.AttackRange))
            {
                end = true;
                return;
            }

            if (MagiUtil.IsInRange(enemyPresent.transform.position - ai.parent.transform.position, ai.ChaseRange) == false)
            {
                end = true;
                return;
            }
        }
Esempio n. 3
0
        public override float GetUtility(Character enemyCharacter, AICharacter ai)
        {
            if (AIMelee.IsEndState(ai.parent.state))
            {
                return(0.0f);
            }

            if (enemyCharacter == null)
            {
                return(0.0f);
            }

            if (MagiUtil.IsInRange(enemyCharacter.transform.position - ai.parent.transform.position, ai.parent.keepDistance + enemyCharacter.radius))
            {
                return(0.0f);
            }
            if (MagiUtil.IsInRange(enemyCharacter.transform.position - ai.parent.transform.position, ai.ChaseRange))
            {
                return(0.6f);
            }
            return(0.0f);
        }