Exemplo n.º 1
0
        public override void Activate(Creature creature)
        {
            var poison_explosion = SpriteLoader.Instance.AddSprite("content/pop_blob_poison");
            var smoke            = SpriteLoader.Instance.AddSprite("content/smoke_small");

            var explosion = new ParticleExplosion(World, poison_explosion, Vector2.Zero, LerpHelper.Linear, LerpHelper.Linear, 20)
            {
                Position = creature.VisualTarget,
            };

            explosion.OnUpdate += (particle) =>
            {
                var flare_explosion = new ParticleBlob(World, smoke, Vector2.Zero, LerpHelper.Linear, LerpHelper.CubicIn, 10)
                {
                    Position = creature.VisualPosition() + creature.Mask.GetRandomPixel(Random),
                    SubImage = Random.Next(smoke.SubImageCount),
                    Color    = new Color(204, 100, 238),
                };
            };
        }
Exemplo n.º 2
0
        public override void Activate(Creature creature)
        {
            var fire_big   = SpriteLoader.Instance.AddSprite("content/black_fire_big");
            var fire_small = SpriteLoader.Instance.AddSprite("content/black_fire_small");

            var explosion = new ParticleExplosion(World, fire_big, Vector2.Zero, LerpHelper.Linear, LerpHelper.Linear, 20)
            {
                Position = creature.VisualTarget,
            };

            explosion.OnUpdate += (particle) =>
            {
                if (particle.Frame.Time > 5 && particle.Frame.Time % 3 == 0)
                {
                    var flame = new ParticleExplosion(World, fire_small, Vector2.Zero, LerpHelper.Linear, LerpHelper.Linear, 6)
                    {
                        Position = creature.VisualPosition() + creature.Mask.GetRandomPixel(Random),
                    };
                }
            };
        }
Exemplo n.º 3
0
        public override void Activate(Creature creature)
        {
            var arcane_explosion = SpriteLoader.Instance.AddSprite("content/pop_arcane");
            var flare            = SpriteLoader.Instance.AddSprite("content/flare_arcane");

            var explosion = new ParticleExplosion(World, arcane_explosion, Vector2.Zero, LerpHelper.Linear, LerpHelper.Linear, 10)
            {
                Position = creature.VisualTarget,
                Pass     = DrawPass.EffectAdditive,
            };

            explosion.OnUpdate += (particle) =>
            {
                var flare_explosion = new ParticleExplosion(World, flare, Vector2.Zero, LerpHelper.QuadraticOut, LerpHelper.Linear, 5)
                {
                    Position = creature.VisualPosition() + creature.Mask.GetRandomPixel(Random),
                    Scale    = Random.NextFloat() * 0.5f + 0.5f,
                    Pass     = DrawPass.EffectAdditive,
                };
            };
        }
Exemplo n.º 4
0
        public override void Activate(Creature creature)
        {
            var blob_acid = SpriteLoader.Instance.AddSprite("content/pop_acid");
            var particle  = SpriteLoader.Instance.AddSprite("content/bullet_acid");

            var explosion = new ParticleExplosion(World, blob_acid, Vector2.Zero, LerpHelper.Linear, LerpHelper.Linear, 10)
            {
                Position = creature.VisualTarget,
            };

            for (int i = 0; i < 6; i++)
            {
                float angle        = Random.NextFloat() * MathHelper.TwoPi;
                float distance     = 4 + Random.NextFloat() * 12;
                int   time         = Random.Next(10) + 10;
                var   acidParticle = new ParticleThrow(World, particle, creature.VisualTarget, creature.VisualTarget + Util.AngleToVector(angle) * distance, 4 + Random.NextFloat() * 8, LerpHelper.Linear, LerpHelper.QuadraticOut, time, 0.7f)
                {
                    Scale = Random.NextFloat() * 0.75f + 0.25f,
                };
            }
        }
Exemplo n.º 5
0
        public override void Activate(Creature creature)
        {
            var fire_big   = SpriteLoader.Instance.AddSprite("content/fire_big");
            var fire_small = SpriteLoader.Instance.AddSprite("content/fire_small");

            var explosion = new ParticleExplosion(World, fire_big, Vector2.Zero, LerpHelper.Linear, LerpHelper.Linear, 20)
            {
                Position = creature.VisualTarget,
            };

            explosion.OnUpdate += (particle) =>
            {
                if (particle.Frame.Time > 5 && particle.Frame.Time % 3 == 0)
                {
                    var flame = new ParticleExplosion(World, fire_small, Vector2.Zero, LerpHelper.Linear, LerpHelper.Linear, 6)
                    {
                        Position = creature.VisualPosition() + creature.Mask.GetRandomPixel(Random),
                    };
                }
            };
            creature.FlashHelper.AddFlash(ColorMatrix.TwoColorLight(Color.OrangeRed, Color.Orange), LerpHelper.QuadraticOut, 40);
        }
Exemplo n.º 6
0
        public override void Activate(Creature creature)
        {
            var blob_water     = SpriteLoader.Instance.AddSprite("content/pop_blob_water");
            var particle_water = SpriteLoader.Instance.AddSprite("content/bullet_water");
            var particle_ice   = SpriteLoader.Instance.AddSprite("content/rock");

            var explosion = new ParticleExplosion(World, blob_water, Vector2.Zero, LerpHelper.Linear, LerpHelper.Linear, 10)
            {
                Position = creature.VisualTarget,
                Pass     = DrawPass.EffectAdditive,
            };

            for (int i = 0; i < 6; i++)
            {
                float angle         = Random.NextFloat() * MathHelper.TwoPi;
                float distance      = 4 + Random.NextFloat() * 12;
                int   time          = Random.Next(10) + 10;
                var   waterParticle = new ParticleThrow(World, particle_water, creature.VisualTarget, creature.VisualTarget + Util.AngleToVector(angle) * distance, 4 + Random.NextFloat() * 8, LerpHelper.Linear, LerpHelper.QuadraticOut, time, 0.7f)
                {
                    Scale = Random.NextFloat() * 0.75f + 0.25f,
                    Pass  = DrawPass.EffectAdditive,
                };
            }

            for (int i = 0; i < 12; i++)
            {
                float angle       = Random.NextFloat() * MathHelper.TwoPi;
                float distance    = 4 + Random.NextFloat() * 12;
                int   time        = Random.Next(10) + 10;
                var   iceParticle = new ParticleThrow(World, particle_ice, creature.VisualTarget + Util.AngleToVector(angle) * 2, creature.VisualTarget + Util.AngleToVector(angle) * distance, 4 + Random.NextFloat() * 8, LerpHelper.Linear, LerpHelper.QuadraticOut, time, 0.7f)
                {
                    SubImage    = Random.Next(particle_ice.SubImageCount),
                    Angle       = Random.NextAngle(),
                    ColorMatrix = ColorMatrix.TwoColorLight(Color.Blue, Color.White),
                    Pass        = DrawPass.EffectAdditive,
                };
            }
        }
Exemplo n.º 7
0
        public override void Activate(Creature creature)
        {
            var thunder = SpriteLoader.Instance.AddSprite("content/hit_light");
            var spark   = SpriteLoader.Instance.AddSprite("content/lightning_spark_light");

            var explosion = new ParticleExplosion(World, thunder, Vector2.Zero, LerpHelper.Linear, LerpHelper.Linear, 20)
            {
                Position = creature.VisualTarget,
                Pass     = DrawPass.EffectAdditive,
            };

            explosion.OnUpdate += (particle) =>
            {
                var volt = new ParticleDynamic(World, Random.Next(5))
                {
                    Sprite   = spark,
                    SubImage = Random.Next(spark.SubImageCount),
                    Position = creature.VisualPosition() + creature.Mask.GetRandomPixel(Random),
                    Angle    = Random.NextAngle(),
                    Pass     = DrawPass.EffectAdditive,
                };
            };
        }
Exemplo n.º 8
0
        public override void Activate(Creature creature)
        {
            var sparkle          = SpriteLoader.Instance.AddSprite("content/sparkle_item");
            var particle_sparkle = SpriteLoader.Instance.AddSprite("content/sparkle");

            var explosion = new ParticleExplosion(World, sparkle, Vector2.Zero, LerpHelper.Linear, LerpHelper.Linear, 20)
            {
                Position = creature.VisualTarget,
                Pass     = DrawPass.EffectAdditive,
            };
            int   sparkles = 4;
            float fan      = MathHelper.Pi * 0.4f;

            for (int i = 0; i < sparkles; i++)
            {
                float angle        = -fan + i * fan * 2f / (sparkles - 1);
                var   holyParticle = new ParticleThrow(World, particle_sparkle, creature.VisualTarget, creature.VisualTarget + Util.AngleToVector(angle) * 16, 4, LerpHelper.QuadraticOut, LerpHelper.QuadraticOut, 15, 0.7f)
                {
                    SubImage   = Random.Next(particle_sparkle.SubImageCount),
                    ImageSpeed = 0.5f,
                    Pass       = DrawPass.EffectAdditive,
                };
            }
        }