Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SpawnFastRunParticles()

void Terraria.Player.SpawnFastRunParticles ( )
inlineprivate

Definition at line 19636 of file Player.cs.

19637 {
19638 int num = 0;
19639 if (gravDir == -1f)
19640 {
19641 num -= height;
19642 }
19643 if (runSoundDelay == 0 && velocity.Y == 0f)
19644 {
19647 }
19648 if (wings == 3)
19649 {
19650 int num2 = Dust.NewDust(new Vector2(position.X - 4f, position.Y + (float)height + (float)num), width + 8, 4, 186, (0f - velocity.X) * 0.5f, velocity.Y * 0.5f, 50, default(Color), 1.5f);
19651 Main.dust[num2].velocity *= 0.025f;
19652 Main.dust[num2].shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
19653 num2 = Dust.NewDust(new Vector2(position.X - 4f, position.Y + (float)height + (float)num), width + 8, 4, 186, (0f - velocity.X) * 0.5f, velocity.Y * 0.5f, 50, default(Color), 1.5f);
19654 Main.dust[num2].velocity *= 0.2f;
19655 Main.dust[num2].shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
19656 }
19657 else if (sailDash)
19658 {
19659 for (int i = 0; i < 4; i++)
19660 {
19661 int num3 = Dust.NewDust(new Vector2(position.X - 4f, position.Y), width + 8, height, 253, (0f - velocity.X) * 0.5f, velocity.Y * 0.5f, 100, default(Color), 1.5f);
19662 Main.dust[num3].noGravity = true;
19663 Main.dust[num3].velocity.X = Main.dust[num3].velocity.X * 0.2f;
19664 Main.dust[num3].velocity.Y = Main.dust[num3].velocity.Y * 0.2f;
19665 Main.dust[num3].shader = GameShaders.Armor.GetSecondaryShader(cShoe, this);
19666 Main.dust[num3].scale += (float)Main.rand.Next(-5, 3) * 0.1f;
19667 Vector2 vector = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101));
19668 vector.Normalize();
19669 vector *= (float)Main.rand.Next(81) * 0.1f;
19670 }
19671 }
19672 else if (desertDash)
19673 {
19674 Dust dust = Dust.NewDustDirect(new Vector2(position.X - 4f, position.Y + (float)height + (float)num), width + 8, 4, 32, (0f - velocity.X) * 0.5f, velocity.Y * 0.5f);
19675 dust.velocity *= 0.2f;
19676 dust.velocity.Y -= gravDir * 2f;
19677 dust.shader = GameShaders.Armor.GetSecondaryShader(cShoe, this);
19678 }
19679 else if (coldDash)
19680 {
19681 for (int j = 0; j < 2; j++)
19682 {
19683 int num4 = ((j != 0) ? Dust.NewDust(new Vector2(position.X + (float)(width / 2), position.Y + (float)height + gfxOffY), width / 2, 6, 76, 0f, 0f, 0, default(Color), 1.35f) : Dust.NewDust(new Vector2(position.X, position.Y + (float)height + gfxOffY), width / 2, 6, 76, 0f, 0f, 0, default(Color), 1.35f));
19684 Main.dust[num4].scale *= 1f + (float)Main.rand.Next(20, 40) * 0.01f;
19685 Main.dust[num4].noGravity = true;
19686 Main.dust[num4].noLight = true;
19687 Main.dust[num4].velocity *= 0.001f;
19688 Main.dust[num4].velocity.Y -= 0.003f;
19689 Main.dust[num4].shader = GameShaders.Armor.GetSecondaryShader(cShoe, this);
19690 }
19691 }
19692 else if (fairyBoots)
19693 {
19694 int type = Main.rand.NextFromList(new short[6] { 61, 61, 61, 242, 64, 63 });
19695 int alpha = 0;
19696 for (int k = 1; k < 3; k++)
19697 {
19698 float scale = 1.5f;
19699 if (k == 2)
19700 {
19701 scale = 1f;
19702 }
19703 int num5 = Dust.NewDust(new Vector2(position.X - 4f, position.Y + (float)height + (float)num), width + 8, 4, type, (0f - velocity.X) * 0.5f, velocity.Y * 0.5f, alpha, default(Color), scale);
19704 Main.dust[num5].velocity *= 1.5f;
19705 if (k == 2)
19706 {
19707 Main.dust[num5].position += Main.dust[num5].velocity;
19708 }
19709 Main.dust[num5].noGravity = true;
19710 Main.dust[num5].noLightEmittence = true;
19711 Main.dust[num5].shader = GameShaders.Armor.GetSecondaryShader(cShoe, this);
19712 }
19713 }
19714 else if (hellfireTreads)
19715 {
19716 int num6 = Dust.NewDust(new Vector2(position.X - 4f, position.Y + (float)height + (float)num), width + 8, 4, 6, (0f - velocity.X) * 0.5f, velocity.Y * 0.5f, 50, default(Color), 2f);
19717 Main.dust[num6].velocity.X = Main.dust[num6].velocity.X * 0.2f;
19718 Main.dust[num6].velocity.Y = -1.5f - Main.rand.NextFloat() * 0.5f;
19719 Main.dust[num6].fadeIn = 0.5f;
19720 Main.dust[num6].noGravity = true;
19721 Main.dust[num6].shader = GameShaders.Armor.GetSecondaryShader(cShoe, this);
19722 }
19723 else
19724 {
19725 int num7 = Dust.NewDust(new Vector2(position.X - 4f, position.Y + (float)height + (float)num), width + 8, 4, 16, (0f - velocity.X) * 0.5f, velocity.Y * 0.5f, 50, default(Color), 1.5f);
19726 Main.dust[num7].velocity.X = Main.dust[num7].velocity.X * 0.2f;
19727 Main.dust[num7].velocity.Y = Main.dust[num7].velocity.Y * 0.2f;
19728 Main.dust[num7].shader = GameShaders.Armor.GetSecondaryShader(cShoe, this);
19729 }
19730 }
static void PlaySound(int type, Vector2 position, int style=1)
Vector2 velocity
Definition Entity.cs:16
Vector2 position
Definition Entity.cs:14
static ArmorShaderDataSet Armor
Definition GameShaders.cs:7
bool hellfireTreads
Definition Player.cs:1711
SoundPlaySet hermesStepSound
Definition Player.cs:2151

References Terraria.Graphics.Shaders.GameShaders.Armor, Terraria.Main.dust, Terraria.Dust.NewDust(), Terraria.Dust.NewDustDirect(), Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.rand, System.type, and Microsoft.Xna.Framework.Vector2.Y.