Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        if (bhcooldown > 0)
        {
            bhcooldown--;
        }
        if (lcooldown > 0)
        {
            lcooldown--;
        }
        if (scooldown > 0)
        {
            scooldown--;
        }
        if (bhcooldown == 0)
        {
            bossattack.Add(0);
        }
        if (lcooldown == 0)
        {
            bossattack.Add(1);
        }
        if (scooldown == 0)
        {
            bossattack.Add(2);
        }
        if (bossattack.Count > 0)
        {
            int decision = Random.Range(0, bossattack.Count);

            switch (((int)bossattack [decision]))
            {
            case 0:             //Black Hole
                blackHole.enabled = true;
                blackHole.enabled = false;
                bhcooldown        = 420;
                break;

            case 1:             //Lasers
                lasers.enabled = true;
                lcooldown      = 120;
                break;

            case 2:             //Spawn
                spawner.enabled = true;
                spawner.enabled = false;
                scooldown       = 300;
                break;
            }
            bossattack.Clear();
        }
        else
        {
            move.Move();
        }
        if (lcooldown == 60)
        {
            lasers.enabled = false;
        }
    }
Esempio n. 2
0
    // Update is called once per frame
    void Update()
    {
        if (acooldown > 0)
        {
            acooldown--;
        }
        if (dcooldown > 0)
        {
            dcooldown--;
        }
        if (acooldown == 0)
        {
            bossattacks.Add(0);
        }
        if (dcooldown == 0)
        {
            bossattacks.Add(1);
        }
        if (dv.enemyHealth < 200)
        {
            bossattacks.Add(2);
        }
        if (bossattacks.Count > 0)
        {
            int decision = Random.Range(0, bossattacks.Count);
            switch (((int)bossattacks [decision]))
            {
            case 0:            //Arena Distort
                arena.enabled = true;
                arena.enabled = false;
                acooldown     = 720;
                break;

            case 1:            //Disrupt Controls
                disruption.enabled = true;
                dcooldown          = 240;
                break;

            case 2:            //Heal
                heal.enabled = true;
                heal.enabled = false;
                break;
            }
            bossattacks.Clear();
        }
        else
        {
            move.Move();
        }
        if (dcooldown == 120)
        {
            disruption.enabled = false;
        }
    }
Esempio n. 3
0
    // Update is called once per frame
    void Update()
    {
        if (tcooldown > 0)
        {
            tcooldown--;
        }
        if (bcooldown > 0)
        {
            bcooldown--;
        }
        if (rcooldown > 0)
        {
            rcooldown--;
        }
        if (tcooldown == 0)
        {
            bossattacks.Add(0);
        }
        if (bcooldown == 0)
        {
            bossattacks.Add(1);
        }
        if (rcooldown == 0)
        {
            bossattacks.Add(2);
        }
        if (bossattacks.Count > 0)
        {
            int decision = Random.Range(0, bossattacks.Count);
            switch (((int)bossattacks [decision]))
            {
            case 0:             //Trailing laser
                tlaser.enabled = true;
                tcooldown      = 300;
                break;

            case 1:             //Buster Laser
                move.enabled = false;
                blaser.SetActive(true);
                blaserSprite.SetActive(false);
                bcooldown = 300;
                break;

            case 2:             //Revive
                revive.enabled = true;
                revive.enabled = false;
                this.gameObject.SetActive(false);
                //Play anim
                break;
            }
            bossattacks.Clear();
        }
        else
        {
            move.Move();
        }
        if (tcooldown == 150)
        {
            tlaser.enabled = false;
        }
        if (bcooldown == 150)
        {
            blaser.SetActive(false);
            move.enabled = true;
        }
        if (bcooldown == 75)
        {
            blaserSprite.SetActive(true);
        }
        if (bcooldown == 20)
        {
            move.enabled = false;
        }
    }