Example #1
0
    private void Shoot(Vector2 angle)
    {
        if (health / initialHealth < 0.25f)
        {
            if (fireRate > 0.6)
            {
                fireRate = 0.6f;
            }
            if (moveSpeed < 7)
            {
                moveSpeed = 7;
            }
            ObjectController.CreateFireball(transform.position, Utils.Rotate(angle, -60 + Random.Range(-10, 10)), 50);
            ObjectController.CreateFireball(transform.position, Utils.Rotate(angle, -30 + Random.Range(-10, 10)), 50);
            ObjectController.CreateFireball(transform.position, Utils.Rotate(angle, 0 + Random.Range(-10, 10)), 50);
            ObjectController.CreateFireball(transform.position, Utils.Rotate(angle, 30 + Random.Range(-10, 10)), 50);
            ObjectController.CreateFireball(transform.position, Utils.Rotate(angle, 60 + Random.Range(-10, 10)), 50);
        }
        else if (health / initialHealth < 0.5f)
        {
            if (fireRate > 0.8)
            {
                fireRate = 0.8f;
            }
            if (moveSpeed < 6)
            {
                moveSpeed = 6;
            }
            ObjectController.CreateFireball(transform.position, Utils.Rotate(angle, -30 + Random.Range(-5, 5)), 50);
            ObjectController.CreateFireball(transform.position, Utils.Rotate(angle, 0 + Random.Range(-5, 5)), 50);
            ObjectController.CreateFireball(transform.position, Utils.Rotate(angle, 30 + Random.Range(-5, 5)), 50);
        }
        else
        {
            ObjectController.CreateFireball(transform.position, angle, 50);
        }

        SoundController.PlayBossShoot();
    }