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

◆ DoExhaustMinecartEffect()

void Terraria.Mount.DoExhaustMinecartEffect ( Player mountedPlayer,
int dustType )
inlineprivate

Definition at line 3987 of file Mount.cs.

3988 {
3989 float num = mountedPlayer.velocity.Length();
3990 if (num < 1f && Main.rand.Next(4) != 0)
3991 {
3992 return;
3993 }
3994 int num2 = 1 + (int)num / 6;
3995 while (num2 > 0)
3996 {
3997 num2--;
3998 Vector2 vector = Main.rand.NextVector2Square(-1f, 1f) * new Vector2(3f, 3f);
3999 Vector2 vector2 = new Vector2(-18f, 20f) * mountedPlayer.Directions;
4000 if (num > 6f)
4001 {
4002 vector2.X += 4 * mountedPlayer.direction;
4003 }
4004 if (num2 > 0)
4005 {
4006 vector2 += mountedPlayer.velocity * (num2 / 3);
4007 }
4008 Vector2 pos = mountedPlayer.Center + vector2 + vector;
4009 pos = mountedPlayer.RotatedRelativePoint(pos);
4010 Dust dust = Dust.NewDustPerfect(pos, dustType);
4011 dust.noGravity = true;
4012 dust.fadeIn = 0.6f;
4013 dust.scale = 1.2f;
4014 dust.velocity *= 0.2f;
4015 if (num < 1f)
4016 {
4017 dust.velocity.X -= 0.5f * (float)mountedPlayer.direction;
4018 }
4019 dust.shader = GameShaders.Armor.GetSecondaryShader(mountedPlayer.cMinecart, mountedPlayer);
4020 }
4021 }
static ArmorShaderDataSet Armor
Definition GameShaders.cs:7

References Terraria.Graphics.Shaders.GameShaders.Armor, Terraria.Dust.NewDustPerfect(), Terraria.Main.rand, and Microsoft.Xna.Framework.Graphics.Vector2.

Referenced by Terraria.Mount.UpdateEffects().