Esempio n. 1
0
        public virtual void Trigger(PlayerShip p)
        {
            SoundManager.PlaySound("BigBombExplode2", 1, 0, 0);
            SoundManager.DeafTone();

            p.ShakeScreen(2500);
            LinkedListNode <GameObject> CurrentNode = p.ParentScene.Children.First;

            Vector3 Position3 = new Vector3(p.Position.X(), 0, p.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);

            //ParticleManager.CreateParticle(Position3, Vector3.Zero, ParticleColor, 500, 7);
            //ParticleManager.CreateParticle(Position3, Vector3.Zero, ParticleColor, 750, 7);
            //ParticleManager.CreateParticle(Position3, Vector3.Zero, ParticleColor, 1000, 7);

            while (CurrentNode != null)
            {
                GameObject g = CurrentNode.Value;
                if (g.GetType().IsSubclassOf(typeof(UnitShip)))
                {
                    UnitShip u = (UnitShip)g;
                    u.Damage(100000, 0, Vector2.One, p, AttackType.Explosion);
                    u.Damage(100000, 0, Vector2.One, p, AttackType.Explosion);
                    WaveManager.EndWave();
                }

                CurrentNode = CurrentNode.Next;
            }
        }
        public override void Create()
        {
            self = this;

            if (WaveFont == null)
            {
                WaveFont = AssetManager.Load <SpriteFont>("Fonts/ShipGame/WaveFont");
            }
            AddTag(GameObjectTag.Update);

            base.Create();
        }
        public void Draw(Camera3D DrawCamera)
        {
            foreach (UIParticleBasic part in Particles)
            {
                part.Draw();
            }

            WaveManager.Draw(ParentShip.getSceneView());

            foreach (HudBox b in HudBoxes)
            {
                b.PreDraw();
            }
        }
        public override void BlowUp()
        {
            if (!Dead)
            {
                SoundManager.PlaySound("MiningRingExplode2", 1, 0, 0);
                SoundManager.DeafTone();

                Dead = true;
                DoExplosion();

                foreach (Faction f in FactionManager.Factions)
                {
                    if (f.Team != GetTeam())
                    {
                        f.roundReport.MiningPlatformsLost++;
                        f.AddEvent("Mining Platform Destroyed!", new Color(1, 0.5f, 0.5f), FactionEvent.KillTexture);
                    }
                    else
                    {
                        f.roundReport.MiningPlatformsLost++;
                        f.AddEvent("Mining Platform Lost!", new Color(1, 0.5f, 0.5f), FactionEvent.LossTexture);
                    }
                }

                FactionManager.TeamStreak[GetTeam()] = -1;
                FactionManager.Factions[FactionNumber].MiningPlatformCount--;

                if (FactionManager.Factions[FactionNumber].MiningPlatformCount < 1)
                {
                    FactionManager.Factions[FactionNumber].Dead = true;

                    bool TeamAlive = false;
                    foreach (Faction f in FactionManager.Factions)
                    {
                        if (!f.Dead && f.Team == GetTeam())
                        {
                            TeamAlive = true;
                            break;
                        }
                    }

                    if (!TeamAlive)
                    {
                        if (FactionManager.TeamDead.ContainsKey(GetTeam()))
                        {
                            FactionManager.TeamDead[GetTeam()] = true;
                        }
                        else
                        {
                            FactionManager.TeamDead.Add(GetTeam(), true);
                        }

                        WaveManager.SetState(PlayerEliminatedState.self);
                    }
                }

                MyRock.setPlatform(null);
                BulletExplosionDistance = 1000;
                BulletExplosionDamage   = 10;
            }
            Destroy();
        }