public IEnumerator<float> BombExplosion(GameObject go) { yield return 2f; AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .9f, 0f); BulletEmitter explosion = new BulletEmitter(this, go.Center, true); explosion.FireBulletExplosion(20, 110f, Color.Lerp(Color.White, Color.Orange, .7f)); explosion.FireBulletExplosion(30, 130f, Color.Lerp(Color.White, Color.Orange, .7f), BulletType.CircleSmall); go.Destroy(); }
public IEnumerator<float> FirstKomodo(GameObject go) { go.Rotation = (float)Math.PI / 2f; go.Velocity = 35f; yield return 1.5f; go.LerpVelocity(0f, 1.5f); yield return 1.5f; BulletEmitter emitter = new BulletEmitter(go, go.Center); while (true) { int shots = 0; while(shots < 10) { shots++; emitter.Rotation += .2f; AudioManager.PlaySoundEffect(GameScene.Shot8Sound, .7f, .5f); foreach(Bullet b in emitter.FireBulletExplosion(20, 200f, Color.DeepSkyBlue)) { b.LerpVelocity(40f, 4f); } yield return .2f; } yield return 4f; } }
public void Explode() { BulletEmitter emitter = new BulletEmitter(this, Center, true); AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .9f, -.2f); foreach (Bullet b in emitter.FireBulletExplosion(100, 250, Color.DarkGreen)) scriptManager.Execute(CrablordBoss.ToxicBulletEffect, b); Destroy(); }
public IEnumerator<float> ClusterBombs(GameObject go) { Bullet thisBullet = (Bullet)go; thisBullet.LerpVelocity(0f, 3f); yield return 3f + (thisBullet.CustomValue1 * .6f); BulletEmitter explosion = new BulletEmitter(this, thisBullet.Center); AudioManager.PlaySoundEffect(GameScene.Shot1Sound, .7f, 0f); AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .7f, 0f); explosion.FireBulletExplosion(6, 160f, Color.Lerp(Color.White, Color.DeepSkyBlue, .4f)); explosion.FireBulletCluster(VectorMathHelper.GetAngleTo(thisBullet.Center, thisScene.player.InnerHitbox.Center), 3, 40f, 160f, 40f, Color.Lerp(Color.White, Color.DeepSkyBlue, .4f), BulletType.Circle); explosion.FireBulletCluster(VectorMathHelper.GetAngleTo(thisBullet.Center, thisScene.player.InnerHitbox.Center), 4, 50f, 140f, 50f, Color.Lerp(Color.White, Color.DeepSkyBlue, .4f), BulletType.CircleSmall); explosion.Destroy(); thisBullet.Destroy(); }
public IEnumerator<float> MainScriptPhase2(GameObject thisShip) { if(subEmitter1 != null) subEmitter1.Destroy(); if(subEmitter2 != null) subEmitter2.Destroy(); BulletEmitter mainEmitter1 = new BulletEmitter(this, this.Center, false); mainEmitter1.CustomValue1 = 1; // Rotate this emitter counter clockwise mainEmitter1.CustomValue2 = 35; // Rotate at this distance. BulletEmitter mainEmitter2 = new BulletEmitter(this, this.Center, false); mainEmitter2.CustomValue2 = 35f; // This is the distance to orbit. scriptManager.Execute(RotatingEmitters, mainEmitter1); scriptManager.Execute(RotatingEmitters, mainEmitter2); while (true) { LerpPosition(new Vector2(350, 255), 2f); yield return .9f; CustomValue1 = (float)Math.PI / 2f * 3; CustomValue2 = CustomValue1; yield return .075f; int shots = 0; while (shots < 120) { int subshots = 0; while (subshots < 4) { AudioManager.PlaySoundEffect(GameScene.Shot4Sound, .29f, .5f); mainEmitter1.FireBullet(VectorMathHelper.GetAngleTo(this.Center, mainEmitter1.Center), 170f, Color.Lerp(Color.White, Color.DeepSkyBlue, .6f)); mainEmitter2.FireBullet(VectorMathHelper.GetAngleTo(this.Center, mainEmitter2.Center), 170f, Color.Lerp(Color.White, Color.DeepSkyBlue, .6f)); subshots++; shots++; yield return .03f; } subshots = 0; yield return .03f; } LerpPosition(new Vector2(350, 135), 1.5f); shots = 0; // Randomize the rotation CustomValue1 = (float)(new Random().NextDouble() * ((float)Math.PI*2)); CustomValue2 = CustomValue1; while (shots < 10) { AudioManager.PlaySoundEffect(GameScene.Shot1Sound, .8f, -.15f); foreach (Bullet b in (mainEmitter1.FireBulletExplosion(15, 170f, Color.Lerp(Color.White, Color.Orange, .4f)))) { b.LerpVelocity(90f, 3f); } foreach (Bullet b in (mainEmitter2.FireBulletExplosion(15, 190f, Color.Lerp(Color.White, Color.Red, .4f), BulletType.CircleSmall))) { b.LerpVelocity(90f, 3f); } shots++; yield return .15f; } yield return 1.5f; } }
// 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; } } } }
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; } }