Esempio n. 1
0
        private static void Spawn_StellarTune(ParticleOrchestraSettings settings)
        {
            float   num1      = Main.rand.NextFloat() * 6.283185f;
            float   num2      = 5f;
            Vector2 vector2_1 = new Vector2(0.7f);

            for (float num3 = 0.0f; (double)num3 < 1.0; num3 += 1f / num2)
            {
                float   f         = (float)(6.28318548202515 * (double)num3 + (double)num1 + (double)Main.rand.NextFloatDirection() * 0.25);
                Vector2 vector2_2 = 1.5f * vector2_1;
                float   num4      = 60f;
                Vector2 vector2_3 = Main.rand.NextVector2Circular(12f, 12f) * vector2_1;
                Color   color     = Color.Lerp(Color.Gold, Color.HotPink, Main.rand.NextFloat());
                if (Main.rand.Next(2) == 0)
                {
                    color = Color.Lerp(Color.Violet, Color.HotPink, Main.rand.NextFloat());
                }
                PrettySparkleParticle prettySparkleParticle = ParticleOrchestrator._poolPrettySparkle.RequestParticle();
                prettySparkleParticle.Velocity             = f.ToRotationVector2() * vector2_2;
                prettySparkleParticle.AccelerationPerFrame = f.ToRotationVector2() * -(vector2_2 / num4);
                prettySparkleParticle.ColorTint            = color;
                prettySparkleParticle.LocalPosition        = settings.PositionInWorld + vector2_3;
                prettySparkleParticle.Rotation             = f;
                prettySparkleParticle.Scale = vector2_1 * (float)((double)Main.rand.NextFloat() * 0.800000011920929 + 0.200000002980232);
                Main.ParticleSystem_World_OverPlayers.Add((IParticle)prettySparkleParticle);
            }
        }
Esempio n. 2
0
        private static void Spawn_StellarTune(ParticleOrchestraSettings settings)
        {
            float   num    = Main.rand.NextFloat() * ((float)Math.PI * 2f);
            float   num2   = 5f;
            Vector2 vector = new Vector2(0.7f);

            for (float num3 = 0f; num3 < 1f; num3 += 1f / num2)
            {
                float   num4      = (float)Math.PI * 2f * num3 + num + Main.rand.NextFloatDirection() * 0.25f;
                Vector2 vector2   = 1.5f * vector;
                float   divider   = 60f;
                Vector2 value     = Main.rand.NextVector2Circular(12f, 12f) * vector;
                Color   colorTint = Color.Lerp(Color.Gold, Color.HotPink, Main.rand.NextFloat());
                if (Main.rand.Next(2) == 0)
                {
                    colorTint = Color.Lerp(Color.Violet, Color.HotPink, Main.rand.NextFloat());
                }
                PrettySparkleParticle prettySparkleParticle = _poolPrettySparkle.RequestParticle();
                prettySparkleParticle.Velocity             = num4.ToRotationVector2() * vector2;
                prettySparkleParticle.AccelerationPerFrame = num4.ToRotationVector2() * -(vector2 / divider);
                prettySparkleParticle.ColorTint            = colorTint;
                prettySparkleParticle.LocalPosition        = settings.PositionInWorld + value;
                prettySparkleParticle.Rotation             = num4;
                prettySparkleParticle.Scale = vector * (Main.rand.NextFloat() * 0.8f + 0.2f);
                Main.ParticleSystem_World_OverPlayers.Add(prettySparkleParticle);
            }
            num2 = 1f;
        }
Esempio n. 3
0
        private static void Spawn_RainbowRodHit(ParticleOrchestraSettings settings)
        {
            float num  = Main.rand.NextFloat() * ((float)Math.PI * 2f);
            float num2 = 6f;
            float num3 = Main.rand.NextFloat();

            for (float num4 = 0f; num4 < 1f; num4 += 1f / num2)
            {
                Vector2 vector   = settings.MovementVector * Main.rand.NextFloatDirection() * 0.15f;
                Vector2 vector2  = new Vector2(Main.rand.NextFloat() * 0.4f + 0.4f);
                float   f        = num + Main.rand.NextFloat() * ((float)Math.PI * 2f);
                float   rotation = (float)Math.PI / 2f;
                Vector2 vector3  = 1.5f * vector2;
                float   divider  = 60f;
                Vector2 value    = Main.rand.NextVector2Circular(8f, 8f) * vector2;
                PrettySparkleParticle prettySparkleParticle = _poolPrettySparkle.RequestParticle();
                prettySparkleParticle.Velocity             = f.ToRotationVector2() * vector3 + vector;
                prettySparkleParticle.AccelerationPerFrame = f.ToRotationVector2() * -(vector3 / divider) - vector * 1f / 60f;
                prettySparkleParticle.ColorTint            = Main.hslToRgb((num3 + Main.rand.NextFloat() * 0.33f) % 1f, 1f, 0.4f + Main.rand.NextFloat() * 0.25f);
                prettySparkleParticle.ColorTint.A          = 0;
                prettySparkleParticle.LocalPosition        = settings.PositionInWorld + value;
                prettySparkleParticle.Rotation             = rotation;
                prettySparkleParticle.Scale = vector2;
                Main.ParticleSystem_World_OverPlayers.Add(prettySparkleParticle);
                prettySparkleParticle                      = _poolPrettySparkle.RequestParticle();
                prettySparkleParticle.Velocity             = f.ToRotationVector2() * vector3 + vector;
                prettySparkleParticle.AccelerationPerFrame = f.ToRotationVector2() * -(vector3 / divider) - vector * 1f / 60f;
                prettySparkleParticle.ColorTint            = new Color(255, 255, 255, 0);
                prettySparkleParticle.LocalPosition        = settings.PositionInWorld + value;
                prettySparkleParticle.Rotation             = rotation;
                prettySparkleParticle.Scale                = vector2 * 0.6f;
                Main.ParticleSystem_World_OverPlayers.Add(prettySparkleParticle);
            }
            for (int i = 0; i < 12; i++)
            {
                Color newColor = Main.hslToRgb((num3 + Main.rand.NextFloat() * 0.12f) % 1f, 1f, 0.4f + Main.rand.NextFloat() * 0.25f);
                int   num5     = Dust.NewDust(settings.PositionInWorld, 0, 0, 267, 0f, 0f, 0, newColor);
                Main.dust[num5].velocity  = Main.rand.NextVector2Circular(1f, 1f);
                Main.dust[num5].velocity += settings.MovementVector * Main.rand.NextFloatDirection() * 0.5f;
                Main.dust[num5].noGravity = true;
                Main.dust[num5].scale     = 0.6f + Main.rand.NextFloat() * 0.9f;
                Main.dust[num5].fadeIn    = 0.7f + Main.rand.NextFloat() * 0.8f;
                if (num5 != 6000)
                {
                    Dust dust = Dust.CloneDust(num5);
                    dust.scale  /= 2f;
                    dust.fadeIn *= 0.75f;
                    dust.color   = new Color(255, 255, 255, 255);
                }
            }
        }
Esempio n. 4
0
        private static void Spawn_RainbowRodHit(ParticleOrchestraSettings settings)
        {
            float num1 = Main.rand.NextFloat() * 6.283185f;
            float num2 = 6f;
            float num3 = Main.rand.NextFloat();

            for (float num4 = 0.0f; (double)num4 < 1.0; num4 += 1f / num2)
            {
                Vector2 vector2_1 = settings.MovementVector * Main.rand.NextFloatDirection() * 0.15f;
                Vector2 vector2_2 = new Vector2((float)((double)Main.rand.NextFloat() * 0.400000005960464 + 0.400000005960464));
                float   f         = num1 + Main.rand.NextFloat() * 6.283185f;
                float   num5      = 1.570796f;
                Vector2 vector2_3 = 1.5f * vector2_2;
                float   num6      = 60f;
                Vector2 vector2_4 = Main.rand.NextVector2Circular(8f, 8f) * vector2_2;
                PrettySparkleParticle prettySparkleParticle1 = ParticleOrchestrator._poolPrettySparkle.RequestParticle();
                prettySparkleParticle1.Velocity             = f.ToRotationVector2() * vector2_3 + vector2_1;
                prettySparkleParticle1.AccelerationPerFrame = f.ToRotationVector2() * -(vector2_3 / num6) - vector2_1 * 1f / 60f;
                prettySparkleParticle1.ColorTint            = Main.hslToRgb((float)(((double)num3 + (double)Main.rand.NextFloat() * 0.330000013113022) % 1.0), 1f, (float)(0.400000005960464 + (double)Main.rand.NextFloat() * 0.25));
                prettySparkleParticle1.ColorTint.A          = (byte)0;
                prettySparkleParticle1.LocalPosition        = settings.PositionInWorld + vector2_4;
                prettySparkleParticle1.Rotation             = num5;
                prettySparkleParticle1.Scale = vector2_2;
                Main.ParticleSystem_World_OverPlayers.Add((IParticle)prettySparkleParticle1);
                PrettySparkleParticle prettySparkleParticle2 = ParticleOrchestrator._poolPrettySparkle.RequestParticle();
                prettySparkleParticle2.Velocity             = f.ToRotationVector2() * vector2_3 + vector2_1;
                prettySparkleParticle2.AccelerationPerFrame = f.ToRotationVector2() * -(vector2_3 / num6) - vector2_1 * 1f / 60f;
                prettySparkleParticle2.ColorTint            = new Color((int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue, 0);
                prettySparkleParticle2.LocalPosition        = settings.PositionInWorld + vector2_4;
                prettySparkleParticle2.Rotation             = num5;
                prettySparkleParticle2.Scale = vector2_2 * 0.6f;
                Main.ParticleSystem_World_OverPlayers.Add((IParticle)prettySparkleParticle2);
            }
            for (int index = 0; index < 12; ++index)
            {
                Color rgb       = Main.hslToRgb((float)(((double)num3 + (double)Main.rand.NextFloat() * 0.119999997317791) % 1.0), 1f, (float)(0.400000005960464 + (double)Main.rand.NextFloat() * 0.25));
                int   dustIndex = Dust.NewDust(settings.PositionInWorld, 0, 0, 267, 0.0f, 0.0f, 0, rgb, 1f);
                Main.dust[dustIndex].velocity  = Main.rand.NextVector2Circular(1f, 1f);
                Main.dust[dustIndex].velocity += settings.MovementVector * Main.rand.NextFloatDirection() * 0.5f;
                Main.dust[dustIndex].noGravity = true;
                Main.dust[dustIndex].scale     = (float)(0.600000023841858 + (double)Main.rand.NextFloat() * 0.899999976158142);
                Main.dust[dustIndex].fadeIn    = (float)(0.699999988079071 + (double)Main.rand.NextFloat() * 0.800000011920929);
                if (dustIndex != 6000)
                {
                    Dust dust = Dust.CloneDust(dustIndex);
                    dust.scale  /= 2f;
                    dust.fadeIn *= 0.75f;
                    dust.color   = new Color((int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue);
                }
            }
        }
Esempio n. 5
0
        private static void Spawn_StardustPunch(ParticleOrchestraSettings settings)
        {
            float num1 = Main.rand.NextFloat() * 6.283185f;
            float num2 = 1f;

            for (float num3 = 0.0f; (double)num3 < 1.0; num3 += 1f / num2)
            {
                Vector2 vector2_1 = settings.MovementVector * (float)(0.300000011920929 + (double)Main.rand.NextFloat() * 0.349999994039536);
                Vector2 vector2_2 = new Vector2((float)((double)Main.rand.NextFloat() * 0.400000005960464 + 0.400000005960464));
                float   f         = num1 + Main.rand.NextFloat() * 6.283185f;
                float   num4      = 1.570796f;
                Vector2 vector2_3 = 0.1f * vector2_2;
                float   num5      = 60f;
                Vector2 vector2_4 = Main.rand.NextVector2Circular(8f, 8f) * vector2_2;
                PrettySparkleParticle prettySparkleParticle1 = ParticleOrchestrator._poolPrettySparkle.RequestParticle();
                prettySparkleParticle1.Velocity             = f.ToRotationVector2() * vector2_3 + vector2_1;
                prettySparkleParticle1.AccelerationPerFrame = f.ToRotationVector2() * -(vector2_3 / num5) - vector2_1 * 1f / 60f;
                prettySparkleParticle1.ColorTint            = Main.hslToRgb((float)((0.600000023841858 + (double)Main.rand.NextFloat() * 0.0500000007450581) % 1.0), 1f, (float)(0.400000005960464 + (double)Main.rand.NextFloat() * 0.25));
                prettySparkleParticle1.ColorTint.A          = (byte)0;
                prettySparkleParticle1.LocalPosition        = settings.PositionInWorld + vector2_4;
                prettySparkleParticle1.Rotation             = num4;
                prettySparkleParticle1.Scale = vector2_2;
                Main.ParticleSystem_World_OverPlayers.Add((IParticle)prettySparkleParticle1);
                PrettySparkleParticle prettySparkleParticle2 = ParticleOrchestrator._poolPrettySparkle.RequestParticle();
                prettySparkleParticle2.Velocity             = f.ToRotationVector2() * vector2_3 + vector2_1;
                prettySparkleParticle2.AccelerationPerFrame = f.ToRotationVector2() * -(vector2_3 / num5) - vector2_1 * 1f / 30f;
                prettySparkleParticle2.ColorTint            = new Color((int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue, 0);
                prettySparkleParticle2.LocalPosition        = settings.PositionInWorld + vector2_4;
                prettySparkleParticle2.Rotation             = num4;
                prettySparkleParticle2.Scale = vector2_2 * 0.6f;
                Main.ParticleSystem_World_OverPlayers.Add((IParticle)prettySparkleParticle2);
            }
            for (int index = 0; index < 2; ++index)
            {
                Color rgb       = Main.hslToRgb((float)((0.589999973773956 + (double)Main.rand.NextFloat() * 0.0500000007450581) % 1.0), 1f, (float)(0.400000005960464 + (double)Main.rand.NextFloat() * 0.25));
                int   dustIndex = Dust.NewDust(settings.PositionInWorld, 0, 0, 267, 0.0f, 0.0f, 0, rgb, 1f);
                Main.dust[dustIndex].velocity  = Main.rand.NextVector2Circular(2f, 2f);
                Main.dust[dustIndex].velocity += settings.MovementVector * (float)(0.5 + 0.5 * (double)Main.rand.NextFloat()) * 1.4f;
                Main.dust[dustIndex].noGravity = true;
                Main.dust[dustIndex].scale     = (float)(0.600000023841858 + (double)Main.rand.NextFloat() * 2.0);
                Main.dust[dustIndex].position += Main.rand.NextVector2Circular(16f, 16f);
                if (dustIndex != 6000)
                {
                    Dust dust = Dust.CloneDust(dustIndex);
                    dust.scale  /= 2f;
                    dust.fadeIn *= 0.75f;
                    dust.color   = new Color((int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue);
                }
            }
        }
Esempio n. 6
0
        private static void Spawn_WallOfFleshGoatMountFlames(ParticleOrchestraSettings settings)
        {
            float num = 50f;

            for (int i = -1; i <= 1; i++)
            {
                int num2 = Main.rand.NextFromList(new short[3]
                {
                    326,
                    327,
                    328
                });
                Main.instance.LoadProjectile(num2);
                Player        player        = Main.player[settings.IndexOfPlayerWhoInvokedThis];
                float         scaleFactor   = Main.rand.NextFloat() * 0.9f + 0.1f;
                Vector2       vector        = settings.PositionInWorld + new Vector2((float)i * 5.33333349f, 0f);
                FlameParticle flameParticle = _poolFlame.RequestParticle();
                flameParticle.SetBasicInfo(TextureAssets.Projectile[num2], null, Vector2.Zero, vector);
                flameParticle.SetTypeInfo(num, settings.IndexOfPlayerWhoInvokedThis, player.cMount);
                flameParticle.FadeOutNormalizedTime = 0.3f;
                flameParticle.ScaleAcceleration     = Vector2.One * scaleFactor * -0.0166666675f / num;
                flameParticle.Scale = Vector2.One * scaleFactor;
                Main.ParticleSystem_World_BehindPlayers.Add(flameParticle);
                if (Main.rand.Next(8) == 0)
                {
                    Dust dust = Dust.NewDustDirect(vector, 4, 4, 6, 0f, 0f, 100);
                    if (Main.rand.Next(2) == 0)
                    {
                        dust.noGravity = true;
                        dust.fadeIn    = 1.15f;
                    }
                    else
                    {
                        dust.scale = 0.6f;
                    }
                    dust.velocity   *= 0.6f;
                    dust.velocity.Y -= 1.2f;
                    dust.noLight     = true;
                    dust.position.Y -= 4f;
                    dust.shader      = GameShaders.Armor.GetSecondaryShader(player.cMount, player);
                }
            }
        }
Esempio n. 7
0
        public static void SpawnParticlesDirect(
            ParticleOrchestraType type,
            ParticleOrchestraSettings settings)
        {
            if (Main.netMode == 2)
            {
                return;
            }
            switch (type)
            {
            case ParticleOrchestraType.Keybrand:
                ParticleOrchestrator.Spawn_Keybrand(settings);
                break;

            case ParticleOrchestraType.FlameWaders:
                ParticleOrchestrator.Spawn_FlameWaders(settings);
                break;

            case ParticleOrchestraType.StellarTune:
                ParticleOrchestrator.Spawn_StellarTune(settings);
                break;

            case ParticleOrchestraType.WallOfFleshGoatMountFlames:
                ParticleOrchestrator.Spawn_WallOfFleshGoatMountFlames(settings);
                break;

            case ParticleOrchestraType.BlackLightningHit:
                ParticleOrchestrator.Spawn_BlackLightningHit(settings);
                break;

            case ParticleOrchestraType.RainbowRodHit:
                ParticleOrchestrator.Spawn_RainbowRodHit(settings);
                break;

            case ParticleOrchestraType.BlackLightningSmall:
                ParticleOrchestrator.Spawn_BlackLightningSmall(settings);
                break;

            case ParticleOrchestraType.StardustPunch:
                ParticleOrchestrator.Spawn_StardustPunch(settings);
                break;
            }
        }
Esempio n. 8
0
        private static void Spawn_BlackLightningHit(ParticleOrchestraSettings settings)
        {
            float num         = Main.rand.NextFloat() * ((float)Math.PI * 2f);
            float num2        = 7f;
            float scaleFactor = 0.7f;
            int   num3        = 916;

            Main.instance.LoadProjectile(num3);
            Color value  = new Color(255, 255, 255, 255);
            Color indigo = Color.Indigo;

            indigo.A = 0;
            for (float num4 = 0f; num4 < 1f; num4 += 1f / num2)
            {
                float   num5         = (float)Math.PI * 2f * num4 + num + Main.rand.NextFloatDirection() * 0.25f;
                float   scaleFactor2 = Main.rand.NextFloat() * 4f + 0.1f;
                Vector2 vector       = Main.rand.NextVector2Circular(12f, 12f) * scaleFactor;
                Color.Lerp(Color.Lerp(Color.Black, indigo, Main.rand.NextFloat() * 0.5f), value, Main.rand.NextFloat() * 0.6f);
                Color colorTint = new Color(0, 0, 0, 255);
                int   num6      = Main.rand.Next(4);
                if (num6 == 1)
                {
                    colorTint = Color.Lerp(new Color(106, 90, 205, 127), Color.Black, 0.1f + 0.7f * Main.rand.NextFloat());
                }
                if (num6 == 2)
                {
                    colorTint = Color.Lerp(new Color(106, 90, 205, 60), Color.Black, 0.1f + 0.8f * Main.rand.NextFloat());
                }
                RandomizedFrameParticle randomizedFrameParticle = _poolRandomizedFrame.RequestParticle();
                randomizedFrameParticle.SetBasicInfo(TextureAssets.Projectile[num3], null, Vector2.Zero, vector);
                randomizedFrameParticle.SetTypeInfo(Main.projFrames[num3], 2, 24f);
                randomizedFrameParticle.Velocity              = num5.ToRotationVector2() * scaleFactor2 * new Vector2(1f, 0.5f);
                randomizedFrameParticle.ColorTint             = colorTint;
                randomizedFrameParticle.LocalPosition         = settings.PositionInWorld + vector;
                randomizedFrameParticle.Rotation              = num5;
                randomizedFrameParticle.Scale                 = Vector2.One;
                randomizedFrameParticle.FadeInNormalizedTime  = 0.01f;
                randomizedFrameParticle.FadeOutNormalizedTime = 0.5f;
                randomizedFrameParticle.ScaleVelocity         = new Vector2(0.05f);
                Main.ParticleSystem_World_OverPlayers.Add(randomizedFrameParticle);
            }
        }
Esempio n. 9
0
        private static void Spawn_BlackLightningHit(ParticleOrchestraSettings settings)
        {
            float num1 = Main.rand.NextFloat() * 6.283185f;
            float num2 = 7f;
            float num3 = 0.7f;
            int   i    = 916;

            Main.instance.LoadProjectile(i);
            Color color1 = new Color((int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue);
            Color indigo = Color.Indigo;

            indigo.A = (byte)0;
            for (float num4 = 0.0f; (double)num4 < 1.0; num4 += 1f / num2)
            {
                float   f    = (float)(6.28318548202515 * (double)num4 + (double)num1 + (double)Main.rand.NextFloatDirection() * 0.25);
                float   num5 = (float)((double)Main.rand.NextFloat() * 4.0 + 0.100000001490116);
                Vector2 initialLocalPosition = Main.rand.NextVector2Circular(12f, 12f) * num3;
                Color.Lerp(Color.Lerp(Color.Black, indigo, Main.rand.NextFloat() * 0.5f), color1, Main.rand.NextFloat() * 0.6f);
                Color color2 = new Color(0, 0, 0, (int)byte.MaxValue);
                int   num6   = Main.rand.Next(4);
                if (num6 == 1)
                {
                    color2 = Color.Lerp(new Color(106, 90, 205, (int)sbyte.MaxValue), Color.Black, (float)(0.100000001490116 + 0.699999988079071 * (double)Main.rand.NextFloat()));
                }
                if (num6 == 2)
                {
                    color2 = Color.Lerp(new Color(106, 90, 205, 60), Color.Black, (float)(0.100000001490116 + 0.800000011920929 * (double)Main.rand.NextFloat()));
                }
                RandomizedFrameParticle randomizedFrameParticle = ParticleOrchestrator._poolRandomizedFrame.RequestParticle();
                randomizedFrameParticle.SetBasicInfo(TextureAssets.Projectile[i], new Rectangle?(), Vector2.Zero, initialLocalPosition);
                randomizedFrameParticle.SetTypeInfo(Main.projFrames[i], 2, 24f);
                randomizedFrameParticle.Velocity              = f.ToRotationVector2() * num5 * new Vector2(1f, 0.5f);
                randomizedFrameParticle.ColorTint             = color2;
                randomizedFrameParticle.LocalPosition         = settings.PositionInWorld + initialLocalPosition;
                randomizedFrameParticle.Rotation              = f;
                randomizedFrameParticle.Scale                 = Vector2.One;
                randomizedFrameParticle.FadeInNormalizedTime  = 0.01f;
                randomizedFrameParticle.FadeOutNormalizedTime = 0.5f;
                randomizedFrameParticle.ScaleVelocity         = new Vector2(0.05f);
                Main.ParticleSystem_World_OverPlayers.Add((IParticle)randomizedFrameParticle);
            }
        }
Esempio n. 10
0
 public static void RequestParticleSpawn(
     bool clientOnly,
     ParticleOrchestraType type,
     ParticleOrchestraSettings settings,
     int?overrideInvokingPlayerIndex = null)
 {
     settings.IndexOfPlayerWhoInvokedThis = (byte)Main.myPlayer;
     if (overrideInvokingPlayerIndex.HasValue)
     {
         settings.IndexOfPlayerWhoInvokedThis = (byte)overrideInvokingPlayerIndex.Value;
     }
     if (clientOnly)
     {
         ParticleOrchestrator.SpawnParticlesDirect(type, settings);
     }
     else
     {
         NetManager.Instance.SendToServerOrLoopback(NetParticlesModule.Serialize(type, settings));
     }
 }
Esempio n. 11
0
        private static void Spawn_WallOfFleshGoatMountFlames(ParticleOrchestraSettings settings)
        {
            float timeToLive = 50f;

            for (int index = -1; index <= 1; ++index)
            {
                int i = (int)Main.rand.NextFromList <short>((short)326, (short)327, (short)328);
                Main.instance.LoadProjectile(i);
                Player        player        = Main.player[(int)settings.IndexOfPlayerWhoInvokedThis];
                float         num           = (float)((double)Main.rand.NextFloat() * 0.899999976158142 + 0.100000001490116);
                Vector2       vector2       = settings.PositionInWorld + new Vector2((float)index * 5.333333f, 0.0f);
                FlameParticle flameParticle = ParticleOrchestrator._poolFlame.RequestParticle();
                flameParticle.SetBasicInfo(TextureAssets.Projectile[i], new Rectangle?(), Vector2.Zero, vector2);
                flameParticle.SetTypeInfo(timeToLive, (int)settings.IndexOfPlayerWhoInvokedThis, player.cMount);
                flameParticle.FadeOutNormalizedTime = 0.3f;
                flameParticle.ScaleAcceleration     = Vector2.One * num * -0.01666667f / timeToLive;
                flameParticle.Scale = Vector2.One * num;
                Main.ParticleSystem_World_BehindPlayers.Add((IParticle)flameParticle);
                if (Main.rand.Next(8) == 0)
                {
                    Dust dust = Dust.NewDustDirect(vector2, 4, 4, 6, 0.0f, 0.0f, 100, new Color(), 1f);
                    if (Main.rand.Next(2) == 0)
                    {
                        dust.noGravity = true;
                        dust.fadeIn    = 1.15f;
                    }
                    else
                    {
                        dust.scale = 0.6f;
                    }
                    dust.velocity   *= 0.6f;
                    dust.velocity.Y -= 1.2f;
                    dust.noLight     = true;
                    dust.position.Y -= 4f;
                    dust.shader      = GameShaders.Armor.GetSecondaryShader(player.cMount, player);
                }
            }
        }
Esempio n. 12
0
        private static void Spawn_Keybrand(ParticleOrchestraSettings settings)
        {
            float   num    = Main.rand.NextFloat() * ((float)Math.PI * 2f);
            float   num2   = 3f;
            Vector2 vector = new Vector2(0.7f);

            for (float num3 = 0f; num3 < 1f; num3 += 1f / num2)
            {
                float   num4    = (float)Math.PI * 2f * num3 + num + Main.rand.NextFloatDirection() * 0.1f;
                Vector2 vector2 = 1.5f * vector;
                float   divider = 60f;
                Vector2 value   = Main.rand.NextVector2Circular(4f, 4f) * vector;
                PrettySparkleParticle prettySparkleParticle = _poolPrettySparkle.RequestParticle();
                prettySparkleParticle.Velocity             = num4.ToRotationVector2() * vector2;
                prettySparkleParticle.AccelerationPerFrame = num4.ToRotationVector2() * -(vector2 / divider);
                prettySparkleParticle.ColorTint            = Color.Lerp(Color.Gold, Color.OrangeRed, Main.rand.NextFloat());
                prettySparkleParticle.LocalPosition        = settings.PositionInWorld + value;
                prettySparkleParticle.Rotation             = num4;
                prettySparkleParticle.Scale = vector * 0.8f;
                Main.ParticleSystem_World_OverPlayers.Add(prettySparkleParticle);
            }
            num += 1f / num2 / 2f * ((float)Math.PI * 2f);
            num  = Main.rand.NextFloat() * ((float)Math.PI * 2f);
            for (float num5 = 0f; num5 < 1f; num5 += 1f / num2)
            {
                float   num6    = (float)Math.PI * 2f * num5 + num + Main.rand.NextFloatDirection() * 0.1f;
                Vector2 vector3 = 1f * vector;
                float   num7    = 30f;
                Color   value2  = Color.Lerp(Color.Gold, Color.OrangeRed, Main.rand.NextFloat());
                value2   = Color.Lerp(Color.White, value2, 0.5f);
                value2.A = 0;
                Vector2        value3         = Main.rand.NextVector2Circular(4f, 4f) * vector;
                FadingParticle fadingParticle = _poolFading.RequestParticle();
                fadingParticle.SetBasicInfo(TextureAssets.Extra[98], null, Vector2.Zero, Vector2.Zero);
                fadingParticle.SetTypeInfo(num7);
                fadingParticle.Velocity              = num6.ToRotationVector2() * vector3;
                fadingParticle.AccelerationPerFrame  = num6.ToRotationVector2() * -(vector3 / num7);
                fadingParticle.ColorTint             = value2;
                fadingParticle.LocalPosition         = settings.PositionInWorld + num6.ToRotationVector2() * vector3 * vector * num7 * 0.2f + value3;
                fadingParticle.Rotation              = num6 + (float)Math.PI / 2f;
                fadingParticle.FadeInNormalizedTime  = 0.3f;
                fadingParticle.FadeOutNormalizedTime = 0.4f;
                fadingParticle.Scale = new Vector2(0.5f, 1.2f) * 0.8f * vector;
                Main.ParticleSystem_World_OverPlayers.Add(fadingParticle);
            }
            num2 = 1f;
            num  = Main.rand.NextFloat() * ((float)Math.PI * 2f);
            for (float num8 = 0f; num8 < 1f; num8 += 1f / num2)
            {
                float num9      = (float)Math.PI * 2f * num8 + num;
                float typeInfo  = 30f;
                Color colorTint = Color.Lerp(Color.CornflowerBlue, Color.White, Main.rand.NextFloat());
                colorTint.A = 127;
                Vector2        value4          = Main.rand.NextVector2Circular(4f, 4f) * vector;
                Vector2        value5          = Main.rand.NextVector2Square(0.7f, 1.3f);
                FadingParticle fadingParticle2 = _poolFading.RequestParticle();
                fadingParticle2.SetBasicInfo(TextureAssets.Extra[174], null, Vector2.Zero, Vector2.Zero);
                fadingParticle2.SetTypeInfo(typeInfo);
                fadingParticle2.ColorTint             = colorTint;
                fadingParticle2.LocalPosition         = settings.PositionInWorld + value4;
                fadingParticle2.Rotation              = num9 + (float)Math.PI / 2f;
                fadingParticle2.FadeInNormalizedTime  = 0.1f;
                fadingParticle2.FadeOutNormalizedTime = 0.4f;
                fadingParticle2.Scale             = new Vector2(0.1f, 0.1f) * vector;
                fadingParticle2.ScaleVelocity     = value5 * 1f / 60f;
                fadingParticle2.ScaleAcceleration = value5 * -0.0166666675f / 60f;
                Main.ParticleSystem_World_OverPlayers.Add(fadingParticle2);
            }
        }
Esempio n. 13
0
        private static void Spawn_Keybrand(ParticleOrchestraSettings settings)
        {
            float   num1      = Main.rand.NextFloat() * 6.283185f;
            float   num2      = 3f;
            Vector2 vector2_1 = new Vector2(0.7f);

            for (float num3 = 0.0f; (double)num3 < 1.0; num3 += 1f / num2)
            {
                float   f         = (float)(6.28318548202515 * (double)num3 + (double)num1 + (double)Main.rand.NextFloatDirection() * 0.100000001490116);
                Vector2 vector2_2 = 1.5f * vector2_1;
                float   num4      = 60f;
                Vector2 vector2_3 = Main.rand.NextVector2Circular(4f, 4f) * vector2_1;
                PrettySparkleParticle prettySparkleParticle = ParticleOrchestrator._poolPrettySparkle.RequestParticle();
                prettySparkleParticle.Velocity             = f.ToRotationVector2() * vector2_2;
                prettySparkleParticle.AccelerationPerFrame = f.ToRotationVector2() * -(vector2_2 / num4);
                prettySparkleParticle.ColorTint            = Color.Lerp(Color.Gold, Color.OrangeRed, Main.rand.NextFloat());
                prettySparkleParticle.LocalPosition        = settings.PositionInWorld + vector2_3;
                prettySparkleParticle.Rotation             = f;
                prettySparkleParticle.Scale = vector2_1 * 0.8f;
                Main.ParticleSystem_World_OverPlayers.Add((IParticle)prettySparkleParticle);
            }
            float num5 = num1 + (float)(1.0 / (double)num2 / 2.0 * 6.28318548202515);
            float num6 = Main.rand.NextFloat() * 6.283185f;

            for (float num3 = 0.0f; (double)num3 < 1.0; num3 += 1f / num2)
            {
                float   f          = (float)(6.28318548202515 * (double)num3 + (double)num6 + (double)Main.rand.NextFloatDirection() * 0.100000001490116);
                Vector2 vector2_2  = 1f * vector2_1;
                float   timeToLive = 30f;
                Color   color      = Color.Lerp(Color.White, Color.Lerp(Color.Gold, Color.OrangeRed, Main.rand.NextFloat()), 0.5f);
                color.A = (byte)0;
                Vector2        vector2_3      = Main.rand.NextVector2Circular(4f, 4f) * vector2_1;
                FadingParticle fadingParticle = ParticleOrchestrator._poolFading.RequestParticle();
                fadingParticle.SetBasicInfo(TextureAssets.Extra[98], new Rectangle?(), Vector2.Zero, Vector2.Zero);
                fadingParticle.SetTypeInfo(timeToLive);
                fadingParticle.Velocity              = f.ToRotationVector2() * vector2_2;
                fadingParticle.AccelerationPerFrame  = f.ToRotationVector2() * -(vector2_2 / timeToLive);
                fadingParticle.ColorTint             = color;
                fadingParticle.LocalPosition         = settings.PositionInWorld + f.ToRotationVector2() * vector2_2 * vector2_1 * timeToLive * 0.2f + vector2_3;
                fadingParticle.Rotation              = f + 1.570796f;
                fadingParticle.FadeInNormalizedTime  = 0.3f;
                fadingParticle.FadeOutNormalizedTime = 0.4f;
                fadingParticle.Scale = new Vector2(0.5f, 1.2f) * 0.8f * vector2_1;
                Main.ParticleSystem_World_OverPlayers.Add((IParticle)fadingParticle);
            }
            float num7 = 1f;
            float num8 = Main.rand.NextFloat() * 6.283185f;

            for (float num3 = 0.0f; (double)num3 < 1.0; num3 += 1f / num7)
            {
                float num4       = 6.283185f * num3 + num8;
                float timeToLive = 30f;
                Color color      = Color.Lerp(Color.CornflowerBlue, Color.White, Main.rand.NextFloat());
                color.A = (byte)127;
                Vector2        vector2_2      = Main.rand.NextVector2Circular(4f, 4f) * vector2_1;
                Vector2        vector2_3      = Main.rand.NextVector2Square(0.7f, 1.3f);
                FadingParticle fadingParticle = ParticleOrchestrator._poolFading.RequestParticle();
                fadingParticle.SetBasicInfo(TextureAssets.Extra[174], new Rectangle?(), Vector2.Zero, Vector2.Zero);
                fadingParticle.SetTypeInfo(timeToLive);
                fadingParticle.ColorTint             = color;
                fadingParticle.LocalPosition         = settings.PositionInWorld + vector2_2;
                fadingParticle.Rotation              = num4 + 1.570796f;
                fadingParticle.FadeInNormalizedTime  = 0.1f;
                fadingParticle.FadeOutNormalizedTime = 0.4f;
                fadingParticle.Scale             = new Vector2(0.1f, 0.1f) * vector2_1;
                fadingParticle.ScaleVelocity     = vector2_3 * 1f / 60f;
                fadingParticle.ScaleAcceleration = vector2_3 * -0.01666667f / 60f;
                Main.ParticleSystem_World_OverPlayers.Add((IParticle)fadingParticle);
            }
        }