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

◆ DoConfettiMinecartEffect()

void Terraria.Mount.DoConfettiMinecartEffect ( Player mountedPlayer)
inlineprivate

Definition at line 4023 of file Mount.cs.

4024 {
4025 float num = mountedPlayer.velocity.Length();
4026 if ((num < 1f && Main.rand.Next(6) != 0) || (num < 3f && Main.rand.Next(3) != 0))
4027 {
4028 return;
4029 }
4030 int num2 = 1 + (int)num / 6;
4031 while (num2 > 0)
4032 {
4033 num2--;
4034 float num3 = Main.rand.NextFloat() * 2f;
4035 Vector2 vector = Main.rand.NextVector2Square(-1f, 1f) * new Vector2(3f, 8f);
4036 Vector2 vector2 = new Vector2(-18f, 4f) * mountedPlayer.Directions;
4037 vector2.X += num * (float)mountedPlayer.direction * 0.5f + (float)(mountedPlayer.direction * num2) * num3;
4038 if (num2 > 0)
4039 {
4040 vector2 += mountedPlayer.velocity * (num2 / 3);
4041 }
4042 Vector2 pos = mountedPlayer.Center + vector2 + vector;
4043 pos = mountedPlayer.RotatedRelativePoint(pos);
4044 Dust dust = Dust.NewDustPerfect(pos, 139 + Main.rand.Next(4));
4045 dust.noGravity = true;
4046 dust.fadeIn = 0.6f;
4047 dust.scale = 0.5f + num3 / 2f;
4048 dust.velocity *= 0.2f;
4049 if (num < 1f)
4050 {
4051 dust.velocity.X -= 0.5f * (float)mountedPlayer.direction;
4052 }
4053 dust.shader = GameShaders.Armor.GetSecondaryShader(mountedPlayer.cMinecart, mountedPlayer);
4054 }
4055 }
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().