public void SetParent(ParasiteBoss parasiteParent)
 {
     parentBoss = parasiteParent;
 }
Esempio n. 2
0
 public void SetParent(ParasiteBoss parasiteParent)
 {
     parentBoss = parasiteParent;
 }
Esempio n. 3
0
        public override IEnumerator<float> LevelScript()
        {
            // Time remaining: 57 seconds.
            manager.thisScene.fader.LerpColor(Color.Transparent, 1f);
            Enemy e;

            AudioManager.PlaySong(Level4Theme, false, .5f);

            TitleShown = true;
            manager.thisScene.LerpTitleColor(Color.White, 1f);
            yield return 1f;

            yield return 2f;

            manager.thisScene.LerpTitleColor(Color.Transparent, 1f);
            yield return 1f;
            TitleShown = false;

            // Time remaining: 53 seconds.

            // For the beginning, spawn two lines of firing dragonflies
            for (int i = 0; i < 20; i++)
            {
                e = SpawnEnemyAtAngle(EnemyType.Dragonfly, new Vector2(100 + (i * 27), -35), (float)Math.PI / 2f, 160f);
                e.CustomValue1 = 1.5f;
                e.CustomValue2 = (i / 20f) * 2f;
                scriptManager.Execute(DragonflyDelayedShoot, e);
                e = SpawnEnemyAtAngle(EnemyType.Dragonfly, new Vector2(600 - (i * 27), 685), (float)(Math.PI / 2f) * 3, 160f);
                e.CustomValue1 = 1.5f;
                e.CustomValue2 = (i / 20f) * 2f;
                scriptManager.Execute(DragonflyDelayedShoot, e);
                yield return .5f;
            }

            yield return 3f;

            // Time remaining 40

            // Drop down turtles...
            e = SpawnEnemy(EnemyType.Tortoise, new Vector2(350, -35f));
            e.Rotation = (float)Math.PI / 2f;
            e.CustomValue1 = 1f;
            e.CustomValue2 = (float)Math.PI / 2f;
            e.Velocity = 40f;
            scriptManager.Execute(TurtleBarrage, e);

            e = SpawnEnemy(EnemyType.Tortoise, new Vector2(320, -65f));
            e.Rotation = (float)Math.PI / 2f;
            e.CustomValue1 = 2f;
            e.CustomValue2 = (float)(Math.PI / 4f) * 3;
            e.Velocity = 40f;
            scriptManager.Execute(TurtleBarrage, e);

            e = SpawnEnemy(EnemyType.Tortoise, new Vector2(380, -65f));
            e.Rotation = (float)Math.PI / 2f;
            e.CustomValue1 = 2f;
            e.CustomValue2 = (float)(Math.PI / 4f) * 1;
            e.Velocity = 40f;
            scriptManager.Execute(TurtleBarrage, e);

            yield return 6f;
            // Remaining time: 36
            // Spawn dragonflies from the sides
            SpawnEnemyAtAngle(EnemyType.Dragonfly, new Vector2(-30, 400), 0f, 160f);
            SpawnEnemyAtAngle(EnemyType.Dragonfly, new Vector2(730, 550), (float)Math.PI, 160f);
            yield return 1f;

            SpawnEnemyAtAngle(EnemyType.Dragonfly, new Vector2(-30, 450), 0f, 160f);
            SpawnEnemyAtAngle(EnemyType.Dragonfly, new Vector2(730, 300), (float)Math.PI, 160f);
            yield return 1f;

            SpawnEnemyAtAngle(EnemyType.Dragonfly, new Vector2(-30, 200), 0f, 160f);
            SpawnEnemyAtAngle(EnemyType.Dragonfly, new Vector2(730, 150), (float)Math.PI, 160f);
            yield return 1f;

            SpawnEnemyAtAngle(EnemyType.Dragonfly, new Vector2(-30, 350), 0f, 160f);
            SpawnEnemyAtAngle(EnemyType.Dragonfly, new Vector2(730, 250), (float)Math.PI, 160f);
            yield return 1f;

            SpawnEnemyAtAngle(EnemyType.Dragonfly, new Vector2(-30, 570), 0f, 160f);
            SpawnEnemyAtAngle(EnemyType.Dragonfly, new Vector2(730, 600), (float)Math.PI, 160f);
            yield return 1f;

            SpawnEnemyAtAngle(EnemyType.Dragonfly, new Vector2(-30, 320), 0f, 160f);
            SpawnEnemyAtAngle(EnemyType.Dragonfly, new Vector2(730, 470), (float)Math.PI, 160f);
            yield return 1f;

            SpawnEnemyAtAngle(EnemyType.Dragonfly, new Vector2(-30, 210), 0f, 160f);
            SpawnEnemyAtAngle(EnemyType.Dragonfly, new Vector2(730, 350), (float)Math.PI, 160f);
            yield return 1f;

            // Time remaining: 30

            yield return 1f;

            // Time remaining: 28

            // Spawn a strafing Komodo from below
            e = SpawnEnemyAtAngle(EnemyType.Komodo, new Vector2(150, 680), (float)Math.PI / 2 * 3, 60f);
            scriptManager.Execute(KomodoStrafe, e);
            yield return 4f;
            e = SpawnEnemyAtAngle(EnemyType.Komodo, new Vector2(550, -30), (float)Math.PI / 2, 60f);
            scriptManager.Execute(KomodoStrafeBlue, e);
            yield return 4f;

            yield return 4f;

            // Now have the enemies zoom in from the bottom
            for (int i = 0; i < 13; i++)
            {
                for (int j = 0; j < 15; j++)
                {
                    SpawnEnemyAtAngle(EnemyType.Dragonfly, new Vector2(0 + j * 80, 680), (float)(Math.PI / 2f) * 3, 90f);
                }

                yield return .5f;

                for (int j = 0; j < 15; j++)
                {
                    SpawnEnemyAtAngle(EnemyType.Dragonfly, new Vector2(40 + j * 80, 680), (float)(Math.PI / 2f) * 3, 90f);
                }

                yield return .5f;
            }

            yield return .7f;

            // Lerp the background to INFECTION COLORS!
            scrollingBackground[0].LerpColor(Color.Lerp(Color.Yellow, Color.White, .5f), 6f);
            scrollingBackground[1].LerpColor(Color.DarkRed, 6f);
            scrollingBackground[1].LerpSpeed(150f, 6f);
            scrollingBackground[2].LerpColor(Color.DarkRed, 6f);
            scrollingBackground[2].LerpSpeed(200f, 6f);
            scrollingBackground[3].LerpColor(Color.DarkRed, 6f);
            scrollingBackground[3].LerpSpeed(250f, 6f);
            scrollingBackground[4].LerpColor(Color.DarkRed, 6f);
            scrollingBackground[4].LerpSpeed(300f, 6f);

            manager.thisScene.PlayBossWarning();
            scriptManager.Execute(Warning1Flash);
            scriptManager.Execute(Warning2Flash);
            yield return 6.6f;
            //SPAWN THE BOSS

            Boss boss = new ParasiteBoss(manager.thisScene, new Vector2(300f, -150f));
            BeginBossBattle(boss);

            yield return 1.5f;
            bossTheme = AudioManager.PlaySong(BossTheme);

            while (boss.Health > 0)
            {
                yield return .03f;
            }

            // Stop the boss theme and hide the health bar
            bossTheme.Dispose();
            manager.thisScene.HideBossHealthbar();

            // Explode the boss!!
            scriptManager.AbortObjectScripts(boss);
            manager.thisScene.player.Phasing = true;
            foreach (GameObject b in manager.thisScene.gameObjects.FindAll(x => x is Bullet))
            {
                scriptManager.AbortObjectScripts(b);
                b.Phasing = true;
                b.LerpColor(Color.Transparent, 1f);
            }

            scriptManager.Execute(manager.thisScene.BossExplosion, boss);
            yield return 3.3f;

            yield return 1f;

            WarningFlashing = false;
            scrollingBackground[0].LerpColor(Color.White, 1f);
            scrollingBackground[1].LerpColor(Color.White, 1f);
            scrollingBackground[2].LerpColor(Color.White, 1f);
            scrollingBackground[3].LerpColor(Color.White, 1f);
            scrollingBackground[4].LerpColor(Color.White, 1f);
            scrollingBackground[5].LerpColor(Color.Transparent, 1f);
            scrollingBackground[6].LerpColor(Color.Transparent, 1f);

            yield return 1f;

            manager.thisScene.fader.LerpColor(Color.Transparent, 3f);
            yield return 3f;

            manager.thisScene.fader.LerpColor(Color.Black, 2f);

            yield return 2f;
            manager.thisScene.player.Phasing = false;
            manager.SetLevel(5);
        }