Beispiel #1
0
        public IEnemyState Conditions(float timeElapsed)
        {
            // End attack when AttackTarget is reached
            if (Host.Distance(false, AttackTarget, Host.transform.position, 0.1f, true))
            {
                return(new JumpAttackRecovery());

                // backup return if over 3s has elapsed
            }
            else if (timeElapsed > 3)
            {
                return(new JumpAttackRecovery());
            }

            // Go to shield hit stun if Shield is hit
            if (Host.Hitcast.HitType.Equals(HitCast.HitCastType.SHIELD))
            {
                return(new ShieldStun());
            }
            else if (Host.Hitcast.HitType.Equals(HitCast.HitCastType.PLAYER))
            {
                return(new JumpAttackRecovery());
            }

            return(null);
        }
Beispiel #2
0
        public IEnemyState Conditions(float timeElapsed)
        {
            // Get back chasing target, when fallbackpoint is reached
            if (Host.Distance(false, Host.transform.position, FallBackPoint, 0.1f, true))
            {
                return(new ApproachTarget());
            }

            return(null);
        }
Beispiel #3
0
        public IEnemyState Conditions(float timeElapsed)
        {
            // search for target
            if (Host.SearhForTarget(Host.SearchRange))
            {
                return(new ApproachTarget());
            }

            // check if IdleTarget is reached
            if (Host.Distance(false, IdleTarget, Host.transform.position, 0.1f, true))
            {
                return(new IdleStanding());
            }

            return(null);
        }
Beispiel #4
0
        public IEnemyState Conditions(float timeElapsed)
        {
            // check that target is still alive
            if (!Host.ValidateTarget(Host.ChaseRange))
            {
                Host.IdleWanderAnchor = Host.transform.position;
                return(new IdleStanding());
            }

            // check if target is withing attack range
            if (Host.Distance(false, Host.transform.position, Host.Target.transform.position, Host.AttackRange * 0.8f, false))
            {
                return(new JumpAttackStartup());
            }

            return(null);
        }