Exemple #1
0
        // Main script
        public IEnumerator<float> MainScriptPhase1(GameObject thisShip)
        {
            BulletEmitter mainEmitter = new BulletEmitter(this, this.Center, false);
            mainEmitter.LockedToParentPosition = true;

            int bossPhase = 1;
            LerpPosition(new Vector2(300f, 125f), 2f);
            yield return 3f;
            Vulnerable = true;

            bool alive = true;
            while (alive)
            {
                int cycles = 0;

                while (bossPhase == 1)
                {
                    int shots = 0;

                    while (shots < 15)
                    {
                        AudioManager.PlaySoundEffect(GameScene.Shot1Sound, .8f, .4f);
                        mainEmitter.FireBulletSpread(((float)Math.PI / 2), 7, 90f, 140f, Color.Lerp(Color.White, Color.Orange, .45f), BulletType.Circle);
                        shots++;

                        yield return .25f;
                        AudioManager.PlaySoundEffect(GameScene.Shot1Sound, .8f, .2f);
                        mainEmitter.FireBulletSpread(((float)Math.PI / 2), 6, 70f, 140f, Color.Lerp(Color.White, Color.Orange, .45f), BulletType.Circle);
                        shots++;
                        yield return .25f;
                    }

                    shots = 0;
                    LerpPosition(new Vector2(25, 125), 1.5f);
                    yield return 1.5f;

                    while (shots < 20)
                    {
                        AudioManager.PlaySoundEffect(GameScene.Shot4Sound, .3f, -.6f);
                        mainEmitter.FireBulletSpread(((float)Math.PI / 2 * .6f) + (float)Math.Sin(currentGameTime * 3) / 4, 3, 25f, 220f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle);
                        shots++;
                        yield return .06f;
                    }

                    shots = 0;
                    LerpPosition(new Vector2(600, 125), 2.5f);
                    yield return 2.5f;

                    while (shots < 20)
                    {
                        AudioManager.PlaySoundEffect(GameScene.Shot4Sound, .3f, -.6f);
                        mainEmitter.FireBulletSpread(((float)Math.PI / 2 * 1.4f) + (float)Math.Sin(currentGameTime * 3) / 4, 3, 25f, 220f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle);
                        shots++;
                        yield return .06f;
                    }

                    LerpPosition(new Vector2(300f, 125f), 1.5f);
                    yield return 2.2f;
                    cycles++;
                    if (cycles > 1)
                        bossPhase++;
                }

                subEmitter1 = new BulletEmitter(this, this.Center, false);
                subEmitter1.LockedToParentPosition = true;
                subEmitter1.LockPositionOffset = new Vector2(-28f, -10f);
                subEmitter2 = new BulletEmitter(this, this.Center, false);
                subEmitter2.LockedToParentPosition = true;
                subEmitter2.LockPositionOffset = new Vector2(28f, -10f);

                scriptManager.Execute(Subemitter1Script, subEmitter1);
                scriptManager.Execute(Subemitter2Script, subEmitter2);
                scriptManager.Execute(SubemitterFirePhase2, subEmitter1);
                scriptManager.Execute(SubemitterFirePhase2, subEmitter2);

                yield return 1f;

                cycles = 0;
                while (bossPhase == 2)
                {
                    AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .6f, 0f);
                    mainEmitter.FireBulletExplosion(15, 100f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle);
                    yield return .5f;
                    LerpPosition(new Vector2(50, 400), 3f);
                    yield return 1.5f;
                    AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .6f, 0f);
                    mainEmitter.FireBulletExplosion(15, 100f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle);
                    yield return .5f;
                    LerpPosition(new Vector2(550, 400), 3f);
                    yield return 1.5f;
                    LerpPosition(new Vector2(300f, 250f), 2f);
                    AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .6f, 0f);
                    mainEmitter.FireBulletExplosion(15, 100f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle);
                    yield return .5f;
                    LerpPosition(new Vector2(300f, 125f), 4f);
                    yield return .25f;
                    AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .6f, 0f);
                    mainEmitter.FireBulletExplosion(15, 150f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle);
                    yield return .25f;
                    AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .6f, 0f);
                    mainEmitter.FireBulletExplosion(13, 150f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle);
                    yield return .25f;
                    AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .6f, 0f);
                    mainEmitter.FireBulletExplosion(11, 150f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle);
                    yield return .25f;
                    AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .6f, 0f);
                    mainEmitter.FireBulletExplosion(15, 150f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle);
                    yield return .25f;
                    AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .6f, 0f);
                    mainEmitter.FireBulletExplosion(13, 150f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle);
                    yield return .25f;
                    AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .6f, 0f);
                    mainEmitter.FireBulletExplosion(11, 150f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle);
                    yield return .5f;

                    cycles++;
                    if (cycles > 2)
                    {
                        bossPhase = 3;
                    }
                }

                cycles = 0;
                subEmitter1.Destroy();
                subEmitter2.Destroy();

                LerpPosition(new Vector2(300f, 125f), 3.5f);
                while (bossPhase == 3)
                {
                    int shots = 0;
                    while (shots < 25)
                    {
                        shots++;
                        AudioManager.PlaySoundEffect(GameScene.Shot3Sound, .5f, -.6f);
                        mainEmitter.FireBulletSpread(VectorMathHelper.GetAngleTo(this.Hitbox.Center, thisScene.player.InnerHitbox.Center), 5, 80f, 200f, Color.Lerp(Color.White, Color.Orange, .4f), BulletType.Circle);
                        yield return .175f;
                    }

                    int i = 1;

                    AudioManager.PlaySoundEffect(GameScene.Shot8Sound, 1f, 0f);
                    foreach (Bullet b in mainEmitter.FireBulletWave(0f, 4, 200f, 50f, Color.Lerp(Color.White, Color.Orange, .3f)))
                    {
                        b.CustomValue1 = i++;
                        scriptManager.Execute(ClusterBombs, b);
                    }

                    i = 1;
                    foreach (Bullet b in mainEmitter.FireBulletWave((float)Math.PI, 4, 200f, 50f, Color.Lerp(Color.White, Color.Orange, .3f)))
                    {
                        b.CustomValue1 = i++;
                        scriptManager.Execute(ClusterBombs, b);
                    }

                    yield return 3.5f;
                    cycles++;

                    if (cycles > 2)
                    {
                        bossPhase = 1;
                    }
                }
            }
        }
Exemple #2
0
        public IEnumerator<float> FirstKomodo(GameObject go)
        {
            yield return 2f;

            BulletEmitter be = new BulletEmitter(go, go.Center);
            be.LockedToParentPosition = true;
            be.LockPositionOffset = Vector2.Zero;

            while(true)
            {
                int shots = 0;

                while (shots < 15)
                {
                    be.FireBulletSpread(VectorMathHelper.GetAngleTo(go.Center, manager.thisScene.player.InnerHitbox.Center), 5, 70f, 220f, Color.Orange);
                    AudioManager.PlaySoundEffect(GameScene.Shot3Sound, .5f);
                    shots++;
                    yield return .3f;
                }

                yield return .5f;
                go.LerpPosition(new Vector2(500, go.Center.Y), 1.5f);
                yield return 2f;

                shots = 0;
                float turnMod = 1;
                while (shots < 20)
                {
                    if (shots > 10)
                        turnMod = -1f;

                    be.FireBulletExplosion(15, 120f, Color.DeepSkyBlue);
                    AudioManager.PlaySoundEffect(GameScene.Shot6Sound, .5f);
                    be.Rotation += .1f * turnMod;

                    shots++;
                    yield return .1f;
                }

                yield return .5f;
                go.LerpPosition(new Vector2(300, go.Center.Y), 1.5f);
                yield return 2f;
            }
        }