public override void Activate(DeathCrate c, bool server = true)
        {
            float x    = c.x;
            float ypos = c.y - 2f;

            Level.Add((Thing) new ExplosionPart(x, ypos));
            int num1 = 6;

            if (Graphics.effectsLevel < 2)
            {
                num1 = 3;
            }
            for (int index = 0; index < num1; ++index)
            {
                float deg  = (float)index * 60f + Rando.Float(-10f, 10f);
                float num2 = Rando.Float(12f, 20f);
                Level.Add((Thing) new ExplosionPart(x + (float)Math.Cos((double)Maths.DegToRad(deg)) * num2, ypos - (float)Math.Sin((double)Maths.DegToRad(deg)) * num2));
            }
            if (server)
            {
                for (int index = 0; index < 10; ++index)
                {
                    Mine  mine = new Mine(c.x, c.y);
                    float num2 = (float)index / 9f;
                    mine.hSpeed = (float)((double)num2 * 40.0 - 20.0) * Rando.Float(0.5f, 1f);
                    mine.vSpeed = Rando.Float(-3f, -11f);
                    mine.PressAction();
                    mine.Arm();
                    Level.Add((Thing)mine);
                }
                Level.Remove((Thing)c);
            }
            Graphics.FlashScreen();
            SFX.Play("explode");
        }
Пример #2
0
        public override void Activate(DeathCrate c, bool server = true)
        {
            float x    = c.x;
            float ypos = c.y - 2f;

            Level.Add((Thing) new ExplosionPart(x, ypos));
            int num1 = 6;

            if (Graphics.effectsLevel < 2)
            {
                num1 = 3;
            }
            for (int index = 0; index < num1; ++index)
            {
                float deg  = (float)index * 60f + Rando.Float(-10f, 10f);
                float num2 = Rando.Float(12f, 20f);
                Level.Add((Thing) new ExplosionPart(x + (float)Math.Cos((double)Maths.DegToRad(deg)) * num2, ypos - (float)Math.Sin((double)Maths.DegToRad(deg)) * num2));
            }
            if (server)
            {
                for (int index = 0; index < 8; ++index)
                {
                    Sword sword = new Sword(c.x, c.y);
                    float num2  = (float)index / 7f;
                    sword.hSpeed          = (float)((double)num2 * 30.0 - 15.0) * Rando.Float(0.5f, 1f);
                    sword.vSpeed          = Rando.Float(-10f, 10f);
                    sword._wasLifted      = true;
                    sword._framesExisting = 16;
                    Level.Add((Thing)sword);
                }
                Level.Remove((Thing)c);
            }
            Graphics.FlashScreen();
            SFX.Play("explode");
        }
        public override void Activate(DeathCrate c, bool server = true)
        {
            float x    = c.x;
            float ypos = c.y - 2f;

            Level.Add((Thing) new ExplosionPart(x, ypos));
            int num1 = 6;

            if (Graphics.effectsLevel < 2)
            {
                num1 = 3;
            }
            for (int index = 0; index < num1; ++index)
            {
                float deg  = (float)index * 60f + Rando.Float(-10f, 10f);
                float num2 = Rando.Float(12f, 20f);
                Level.Add((Thing) new ExplosionPart(x + (float)Math.Cos((double)Maths.DegToRad(deg)) * num2, ypos - (float)Math.Sin((double)Maths.DegToRad(deg)) * num2));
            }
            if (server)
            {
                for (int index = 0; index < 18; ++index)
                {
                    float  deg  = (float)index * 22.5f;
                    double num2 = (double)Rando.Float(8f, 14f);
                    Level.Add((Thing) new QuadLaserBullet(c.x, c.y, new Vec2((float)Math.Cos((double)Maths.DegToRad(deg)), (float)-Math.Sin((double)Maths.DegToRad(deg)))));
                }
                Level.Remove((Thing)c);
            }
            Graphics.FlashScreen();
            SFX.Play("explode");
        }
        public override void Activate(DeathCrate c, bool server = true)
        {
            float x    = c.x;
            float ypos = c.y - 2f;

            Level.Add((Thing) new ExplosionPart(x, ypos));
            int num1 = 6;

            if (Graphics.effectsLevel < 2)
            {
                num1 = 3;
            }
            for (int index = 0; index < num1; ++index)
            {
                float deg  = (float)index * 60f + Rando.Float(-10f, 10f);
                float num2 = Rando.Float(12f, 20f);
                Level.Add((Thing) new ExplosionPart(x + (float)Math.Cos((double)Maths.DegToRad(deg)) * num2, ypos - (float)Math.Sin((double)Maths.DegToRad(deg)) * num2));
            }
            if (server)
            {
                for (int index = 0; index < 16; ++index)
                {
                    Level.Add((Thing)SmallFire.New(c.x - 6f + Rando.Float(12f), c.y - 8f + Rando.Float(4f), Rando.Float(12f) - 6f, 2f - Rando.Float(8.5f), firedFrom: ((Thing)c)));
                }
                Level.Remove((Thing)c);
            }
            Graphics.FlashScreen();
            SFX.Play("explode");
        }
        public override void Activate(DeathCrate c, bool server = true)
        {
            float x    = c.x;
            float ypos = c.y - 2f;

            Level.Add((Thing) new ExplosionPart(x, ypos));
            int num1 = 6;

            if (Graphics.effectsLevel < 2)
            {
                num1 = 3;
            }
            for (int index = 0; index < num1; ++index)
            {
                float deg  = (float)index * 60f + Rando.Float(-10f, 10f);
                float num2 = Rando.Float(12f, 20f);
                Level.Add((Thing) new ExplosionPart(x + (float)Math.Cos((double)Maths.DegToRad(deg)) * num2, ypos - (float)Math.Sin((double)Maths.DegToRad(deg)) * num2));
            }
            if (server)
            {
                for (int index = 0; index < 3; ++index)
                {
                    Thing thing;
                    if (index == 1)
                    {
                        thing = (Thing) new FireExtinguisher(c.x, c.y);
                    }
                    else
                    {
                        thing = (Thing) new RomanCandle(c.x, c.y);
                        (thing as Gun).PressAction();
                    }
                    float num2 = (float)index / 2f;
                    thing.hSpeed = (float)((double)num2 * 30.0 - 15.0) * Rando.Float(0.5f, 1f);
                    thing.vSpeed = Rando.Float(-3f, -11f);
                    Level.Add(thing);
                }
                Level.Remove((Thing)c);
            }
            Graphics.FlashScreen();
            SFX.Play("explode");
        }
        public override void Activate(DeathCrate c, bool server = true)
        {
            float x    = c.x;
            float ypos = c.y - 2f;

            Level.Add((Thing) new ExplosionPart(x, ypos));
            int num1 = 6;

            if (Graphics.effectsLevel < 2)
            {
                num1 = 3;
            }
            for (int index = 0; index < num1; ++index)
            {
                float deg  = (float)index * 60f + Rando.Float(-10f, 10f);
                float num2 = Rando.Float(12f, 20f);
                Level.Add((Thing) new ExplosionPart(x + (float)Math.Cos((double)Maths.DegToRad(deg)) * num2, ypos - (float)Math.Sin((double)Maths.DegToRad(deg)) * num2));
            }
            if (server)
            {
                for (int index = 0; index < 8; ++index)
                {
                    Present present = new Present(c.x, c.y);
                    float   num2    = (float)index / 7f;
                    present.hSpeed = (float)((double)num2 * 30.0 - 15.0) * Rando.Float(0.5f, 1f);
                    present.vSpeed = Rando.Float(-3f, -11f);
                    Level.Add((Thing)present);
                }
                for (int index = 0; index < 4; ++index)
                {
                    Flower flower = new Flower(c.x, c.y);
                    float  num2   = (float)index / 3f;
                    flower.hSpeed = (float)((double)num2 * 20.0 - 10.0) * Rando.Float(0.5f, 1f);
                    flower.vSpeed = Rando.Float(-3f, -11f);
                    Level.Add((Thing)flower);
                }
                Level.Remove((Thing)c);
            }
            Graphics.FlashScreen();
            SFX.Play("harp");
        }