private void DoExplosion() { if (!Dead) { BulletExplosionDistance = 300 * (1 + (MaxBombs - Bombs) / MaxBombs) / WaveCard.LevelMult; BulletExplosionDamage = 1f / WaveCard.LevelMult; Vector3 Position3 = new Vector3(Position.X(), 0, Position.Y()); for (int i = 0; i < 10; i++) { ParticleManager.CreateParticle(Position3, Rand.V3() * 6, ParticleColor, 20 / WaveCard.LevelMult, 5); } ParticleManager.CreateParticle(Position3, Vector3.Zero, ParticleColor, 4000 / WaveCard.LevelMult, 5); ParticleManager.CreateParticle(Position3, Vector3.Zero, ParticleColor, 400 / WaveCard.LevelMult, 7); ParticleManager.CreateParticle(Position3, Vector3.Zero, ParticleColor, 300 / WaveCard.LevelMult, 7); ParticleManager.CreateParticle(Position3, Vector3.Zero, ParticleColor, 500 / WaveCard.LevelMult, 7); for (int i = 0; i < 10; i++) { FlamingChunkSystem.AddParticle(Position3, Rand.V3() / WaveCard.LevelMult, new Vector3(0, -0.25f, 0), Rand.V3(), Rand.V3() / 10, 20 / WaveCard.LevelMult, 60, new Vector3(1, 0.5f, 0.2f), new Vector3(1, 0.1f, 0.2f), 0, 3); } ParticleManager.CreateParticle(Position3, Vector3.Zero, new Color(1, 0.75f, 0.5f), 500 / WaveCard.LevelMult, 4); for (int i = 0; i < 30; i++) { ParticleManager.CreateParticle(Position3, Rand.V3() * 10, new Color(1, 0.75f, 0.5f), 200 / WaveCard.LevelMult, 5); } } else { foreach (PlayerShip p in ParentScene.Enumerate(typeof(PlayerShip))) { p.ShakeScreen(250); } Vector3 Position3 = new Vector3(Position.X(), 0, Position.Y()); for (int i = 0; i < 100; i++) { ParticleManager.CreateParticle(Position3, Rand.V3() * 20, ParticleColor, 60, 5); } ParticleManager.CreateParticle(Position3, Vector3.Zero, ParticleColor, 4000, 5); for (int i = 0; i < 20; i++) { FlamingChunkSystem.AddParticle(Position3, Rand.V3() * 10, new Vector3(0, -0.25f, 0), Rand.V3(), Rand.V3() / 10, 40, 30, new Vector3(1, 0.5f, 0.2f), new Vector3(1, 0.1f, 0.2f), 0, 3); } for (int i = 0; i < 50; i++) { ParticleManager.CreateParticle(Position3, Rand.V3() * 15, new Color(1, 0.75f, 0.5f), 200, 5); } ParticleManager.CreateParticle(Position3, Vector3.Zero, new Color(1, 0.75f, 0.5f), 2000, 4); ParticleManager.CreateParticle(Position3, Vector3.Zero, new Color(1, 0.75f, 0.5f), 3000, 4); ParticleManager.CreateParticle(Position3, Vector3.Zero, new Color(1, 0.75f, 0.5f), 4000, 4); ParticleManager.CreateParticle(Position3, Vector3.Zero, new Color(1, 0.75f, 0.5f), 500, 5); ParticleManager.CreateParticle(Position3, Vector3.Zero, new Color(1, 0.75f, 0.5f), 1000, 5); ParticleManager.CreateParticle(Position3, Vector3.Zero, new Color(1, 0.75f, 0.5f), 2000, 5); ParticleManager.CreateParticle(Position3, Vector3.Zero, new Color(1, 0.75f, 0.5f), 3000, 5); ParticleManager.CreateParticle(Position3, Vector3.Zero, new Color(1, 0.75f, 0.5f), 4000, 5); BulletExplosionDistance = 1200 / WaveCard.LevelMult; BulletExplosionDamage = 5f / WaveCard.LevelMult; } QuadGrid grid = Parent2DScene.quadGrids.First.Value; for (int i = 0; i < 2; i++) { foreach (Basic2DObject o in grid.Enumerate(Position.get(), new Vector2(BulletExplosionDistance * 2))) { if (o.GetType().IsSubclassOf(typeof(UnitShip))) { BasicShipGameObject s = (BasicShipGameObject)o; float dist = Vector2.Distance(s.Position.get(), Position.get()) - o.Size.X() / 2; if (dist < BulletExplosionDistance && GetTeam() != s.GetTeam()) { float DistMult = 1; if (dist > 0) { DistMult = (BulletExplosionDistance - dist) / BulletExplosionDistance; } s.Damage(DistMult * BulletExplosionDamage, DistMult, Vector2.Normalize(s.Position.get() - Position.get()), this, AttackType.Explosion); } } } } }