Exemple #1
0
    private void PhaseFour()
    {
        float startAngle = Random.Range(0, 361);
        int   step       = 0;

        if (difficulty == Global.RECRUIT)
        {
            step = 20;
        }
        else if (difficulty == Global.VETEREN)
        {
            step = 10;
        }
        else if (difficulty == Global.BATTLEH)
        {
            step = 6;
        }
        if (shootTime > shootDelay)
        {
            //bulletReferenceCurve.setCurveSpeed = -bulletReferenceCurve.setCurveSpeed;
            for (int i = 0; i < 360; i += step)
            {
                EnemyRedBulletCurve e = Instantiate(projectiles [4], shootPos [0].position,
                                                    Quaternion.Euler(0, 0, i + startAngle)).GetComponent <EnemyRedBulletCurve>();
                if (difficulty == Global.BATTLEH)
                {
                    e.Setup(player, 1.8f, 1);
                    e.setCurveSpeed = 8 * switchDirection;
                }
                else
                {
                    e.Setup(player, 3.5f, 1);
                    e.setCurveSpeed = 15 * switchDirection;
                }
            }
            switchDirection = -switchDirection;
            if (shootDelay > 0.5f)
            {
                shootDelay = shootDelay / 1.05f;
            }
            shootTime = 0;
        }
    }
Exemple #2
0
    private void PhaseSeven()
    {
        float startAngle = Random.Range(0, 360);
        int   step       = 0;
        int   gapCount   = 8;
        int   gapCounter = 0;
        int   gapSize    = 0;

        if (boss)
        {
            if (boss.health > boss.phase8 - boss.phase8p1)
            {
                shootTime = 0;
            }
            if (shootTime > 1.5 && !p7First && boss.health <= boss.phase8 - boss.phase8p1)
            {
                p7First = true;
                if (difficulty == Global.RECRUIT)
                {
                    step    = 5;
                    gapSize = 20;
                }
                else if (difficulty == Global.VETEREN)
                {
                    step    = 5;
                    gapSize = 10;
                }
                else if (difficulty == Global.BATTLEH)
                {
                    step    = 3;
                    gapSize = 6;
                }

                for (int i = 0; i < 360; i += step)
                {
                    if (gapCounter >= gapCount)
                    {
                        gapCounter = 0;
                        i         += gapSize;
                    }
                    EnemyProjectile e = Instantiate(projectiles [0], shootPos [0].position,
                                                    Quaternion.Euler(0, 0, startAngle + i)).GetComponent <EnemyProjectile>();
                    e.Setup(player, 3.88f, 1);
                    e.SetRadius(0.1f);
                    gapCounter++;
                }
            }
            if (shootTime > 3 && !p7Second && boss.health <= boss.phase8 - boss.phase8p2)
            {
                p7Second = true;
                if (difficulty == Global.RECRUIT)
                {
                    step = 20;
                }
                else if (difficulty == Global.VETEREN)
                {
                    step = 10;
                }
                else if (difficulty == Global.BATTLEH)
                {
                    step = 6;
                }
                startAngle = Random.Range(0, 361);
                for (int i = 0; i < 360; i += step)
                {
                    EnemyRedBulletCurve e = Instantiate(projectiles [4], shootPos [0].position,
                                                        Quaternion.Euler(0, 0, i + startAngle)).GetComponent <EnemyRedBulletCurve>();
                    if (difficulty == Global.BATTLEH)
                    {
                        e.Setup(player, 3.1f, 1);
                        e.setCurveSpeed = 8 * switchDirection;
                    }
                    else
                    {
                        e.Setup(player, 3.1f, 1);
                        e.setCurveSpeed = 15 * switchDirection;
                    }
                }
                switchDirection = -switchDirection;
            }
            if (shootTime > 4.5 && !p7Third && boss.health <= boss.phase8 - boss.phase8p3)
            {
                p7Third = true;
                float Rad = Mathf.Atan2(
                    player.position.y - transform.position.y,
                    player.position.x - transform.position.x
                    );
                float Deg = (180 / Mathf.PI) * Rad - 90;

                EnemyProjectile e = Instantiate(projectiles [1], shootPos [0].position,
                                                Quaternion.Euler(0, 0, Deg)).GetComponent <EnemyProjectile>();
                e.Setup(player);
                e.SetRadius(0.45f);
            }
            if (shootTime > 6 && boss.health <= boss.phase8 - boss.phase8p4)
            {
                shootTime = 0;
                p7First   = p7Second = p7Third = false;
                ChangePhase(6);
            }
            else if (shootTime > 6)
            {
                shootTime = 0;
                p7First   = p7Second = p7Third = false;
            }
        }
        else
        {
            if (bossw.health > bossw.phase8 - bossw.phase8p1)
            {
                shootTime = 0;
            }
            if (shootTime > 1.5 && !p7First && bossw.health <= bossw.phase8 - bossw.phase8p1)
            {
                p7First = true;
                if (difficulty == Global.RECRUIT)
                {
                    step    = 5;
                    gapSize = 20;
                }
                else if (difficulty == Global.VETEREN)
                {
                    step    = 5;
                    gapSize = 10;
                }
                else if (difficulty == Global.BATTLEH)
                {
                    step    = 3;
                    gapSize = 6;
                }

                for (int i = 0; i < 360; i += step)
                {
                    if (gapCounter >= gapCount)
                    {
                        gapCounter = 0;
                        i         += gapSize;
                    }
                    EnemyProjectile e = Instantiate(projectiles [0], shootPos [0].position,
                                                    Quaternion.Euler(0, 0, startAngle + i)).GetComponent <EnemyProjectile>();
                    e.Setup(player, 3.88f, 1);
                    e.SetRadius(0.1f);
                    gapCounter++;
                }
            }
            if (shootTime > 3 && !p7Second && bossw.health <= bossw.phase8 - bossw.phase8p2)
            {
                p7Second = true;
                if (difficulty == Global.RECRUIT)
                {
                    step = 20;
                }
                else if (difficulty == Global.VETEREN)
                {
                    step = 10;
                }
                else if (difficulty == Global.BATTLEH)
                {
                    step = 6;
                }
                startAngle = Random.Range(0, 361);
                for (int i = 0; i < 360; i += step)
                {
                    EnemyRedBulletCurve e = Instantiate(projectiles [4], shootPos [0].position,
                                                        Quaternion.Euler(0, 0, i + startAngle)).GetComponent <EnemyRedBulletCurve>();
                    if (difficulty == Global.BATTLEH)
                    {
                        e.Setup(player, 3.1f, 1);
                        e.setCurveSpeed = 8 * switchDirection;
                    }
                    else
                    {
                        e.Setup(player, 3.1f, 1);
                        e.setCurveSpeed = 15 * switchDirection;
                    }
                }
                switchDirection = -switchDirection;
            }
            if (shootTime > 4.5 && !p7Third && bossw.health <= bossw.phase8 - bossw.phase8p3)
            {
                p7Third = true;
                float Rad = Mathf.Atan2(
                    player.position.y - transform.position.y,
                    player.position.x - transform.position.x
                    );
                float Deg = (180 / Mathf.PI) * Rad - 90;

                EnemyProjectile e = Instantiate(projectiles [1], shootPos [0].position,
                                                Quaternion.Euler(0, 0, Deg)).GetComponent <EnemyProjectile>();
                e.Setup(player);
                e.SetRadius(0.45f);
            }
            if (shootTime > 6 && bossw.health <= bossw.phase8 - bossw.phase8p4)
            {
                shootTime = 0;
                p7First   = p7Second = p7Third = false;
                ChangePhase(6);
            }
            else if (shootTime > 6)
            {
                shootTime = 0;
                p7First   = p7Second = p7Third = false;
            }
        }
    }