public override WilesBossState Update(WilesBossController boss)
        {
            ////////////////////////////////////// STATE BEHAVIOR:

            // move towards the player:

            Vector3 vectorToPlayer = boss.VectorToAttackTarget();

            Vector3 dirToPlayer = vectorToPlayer.normalized;

            //vectorToPlayer.Normalize();
            boss.transform.position += dirToPlayer * boss.speed * Time.deltaTime;



            ///////////////////////////////////////////////////////////////////////////////////////////// TRANSITIONS:

            if (vectorToPlayer.sqrMagnitude < boss.pursueDistanceThreshold * boss.pursueDistanceThreshold) // If distance < threshold:
            {
                return(new WilesBossStateAttack());                                                        // transition to attack
            }



            if (!boss.CanSeeAttackTarget())       // if we can't see the player..
            {
                return(new WilesBossStateIdle()); // transition to idle
            }


            Debug.Log(this);
            return(null);
        }
Example #2
0
        // Update is called once per frame
        public override WilesBossState Update(WilesBossController boss)
        {
            // BOSS BEHAVIOR
            // While in this state, look for playerProjectiles being aimed at the boss (maybe using raycasts...???)
            // If there are playerProjectiles incoming, have blocking animation.
            // While in blocking animation, count a timer.
            // If that timer reaches a certain amount, transition into CounterAtk State
            // If no projectiles are found, wait a second, then animate back into idle before actualling transistioning into full idle state.

            Debug.Log(this);

            if (Input.GetMouseButton(0))
            {
                timer += Time.deltaTime;
                if (timer >= 10)
                {
                    return(new WilesBossStateCounterAtk());
                }
            }

            if (!Input.GetMouseButton(0))
            {
                return(new WilesBossStateIdle());
            }

            // TRANSISTIONS:

            return(null); // stay in current state
        }
        public override WilesBossState Update(WilesBossController boss)
        {
            // BOSS BEHAVIOR
            // Wait for there to be any PlayerProjectile Objects in the scene.
            // If projectiles are found, determine if they are a threat. (A raycast from the projectiles hitting the boss's head)
            // After a number of seconds (12sec @ 100% Health, 1sec @ 1/12th Health), go into the ChooseAtk State.

            Debug.Log(this);

            timer += Time.deltaTime;

            // TRANSISTIONS:

            if (Input.GetMouseButton(0))
            {
                return(new WilesBossStateBlock());
            }

            if (timer >= 12)
            {
                // transition to pursure state...
                return(new WilesBossStateChooseAtk());
            }

            return(null); // stay in current state
        }
        public override WilesBossState Update(WilesBossController boss)
        {
            ////////////////////////////////////// STATE BEHAVIOR:
            Debug.Log(this);
            // Do attack-ey stuff

            timeUntilNextShot -= Time.deltaTime;
            timer             += Time.deltaTime;

            if (timeUntilNextShot < 0)
            {
                //boss.ShootProjectile();
                boss.ShootHomingProjectile();
                timeUntilNextShot = timeBetweenShots;
            }

            ///////////////////////////////////////////////////////////////////////////////////////////// TRANSITIONS:

            /*
             * // If the attack target is too far away to attack, switch to pursue state.
             * if (boss.VectorToAttackTarget().sqrMagnitude > boss.pursueDistanceThreshold * boss.pursueDistanceThreshold)
             * {// If distance < threshold:
             *  return new WilesBossStatePursue();// transition to attack
             * }
             */

            if (timer >= 5)
            {
                return(new WilesBossStateReturn());
            }

            return(null);
        }
Example #5
0
        // Update is called once per frame
        public override WilesBossState Update(WilesBossController boss)
        {
            // BOSS BEHAVIOR
            // Play the dying Animation.
            // Once the animation is done, Do game over, congratultations, you win, etc.

            Debug.Log(this);

            timer += Time.deltaTime;

            // TRANSISTIONS:

            if (timer >= 12)
            {
                return(new WilesBossStateReturn()); // This is where we get a game over, but for now we will have it on a closed loop.
            }
            return(null);                           // stay in current state
        }
        // Update is called once per frame
        public override WilesBossState Update(WilesBossController boss)
        {
            // BOSS BEHAVIOR
            // Play the HeavyDamageRecoil animation.
            // Once animation is done, transition to Return2Center state.

            Debug.Log(this);

            timer += Time.deltaTime;

            // TRANSISTIONS:

            if (timer >= 10)
            {
                return(new WilesBossStateReturn());
            }

            return(null); // stay in current state
        }
Example #7
0
        // Update is called once per frame
        public override WilesBossState Update(WilesBossController boss)
        {
            // BOSS BEHAVIOR
            // Perform Atk Animation.
            // Once animation is complete, transition to Return2Center State.

            Debug.Log(this);

            timer += Time.deltaTime;

            // TRANSISTIONS:

            if (timer >= 5)
            {
                return(new WilesBossStateReturn());
            }

            return(null); // stay in current state
        }
        // Update is called once per frame
        public override WilesBossState Update(WilesBossController boss)
        {
            // BOSS BEHAVIOR
            // Return to the center of the Arena.
            // Once in position, transition into Idle.

            boss.transform.position = Vector3.MoveTowards(boss.transform.position, new Vector3(-60, 40, 100), boss.speed);

            Debug.Log(this);

            // TRANSISTIONS:

            if (boss.transform.position == new Vector3(-60, 40, 100))
            {
                return(new WilesBossStateIdle());
            }

            return(null); // stay in current state
        }
        // Update is called once per frame
        public override WilesBossState Update(WilesBossController boss)
        {
            // BOSS BEHAVIOR
            // Play the intoStunned, Stunned, and ExitStunned animations.
            // Once the animations are done, transition to Return2Center state.
            // However, if the boss loses too much health, immedeately transition to DamageRecoil State.

            Debug.Log(this);

            timer += Time.deltaTime;

            // TRANSISTIONS:

            if (timer >= 20)
            {
                return(new WilesBossStateReturn());
            }

            return(null); // stay in current state
        }
        // Update is called once per frame
        public override WilesBossState Update(WilesBossController boss)
        {
            // BOSS BEHAVIOR
            // Using a random number, select an ATK.
            // Once a pattern has been decided, there should be a specific position for the boss to go to based on the chosen ATK.
            // Once the boss is in position, transition into that boss state.

            Debug.Log(this);
            Debug.Log(chosenAtk);

            timer += Time.deltaTime;

            // TRANSISTIONS:

            if (timer >= chosenAtk)
            {
                return(new WilesBossStateAttack());
            }

            return(null); // stay in current state
        }
 // Update is called once per frame
 public abstract WilesBossState Update(WilesBossController boss);
 public virtual void OnEnd(WilesBossController boss)
 {
 }
 public virtual void OnStart(WilesBossController boss)
 {
 }
Example #14
0
 // Start is called before the first frame update
 void Start()
 {
     bossController = boss.GetComponent <WilesBossController>();
 }
 public override void OnStart(WilesBossController boss)
 {
     // base.OnStart(boss);
 }
Example #16
0
 // Start is called before the first frame update
 void Start()
 {
     levelScript       = level.GetComponent <WilesLevelScript>();
     bossController    = boss.GetComponent <WilesBossController>();
     gameOverText.text = $" ";
 }