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

◆ SpawnVoidLensDust()

void Terraria.GameContent.VoidLensHelper.SpawnVoidLensDust ( )
inline

Definition at line 40 of file VoidLensHelper.cs.

41 {
42 if (Main.rand.Next(3) == 0)
43 {
44 if (Main.rand.Next(2) == 0)
45 {
46 Vector2 vector = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
47 vector *= new Vector2(0.5f, 1f);
48 Dust dust = Dust.NewDustDirect(_position - vector * 30f, 0, 0, Utils.SelectRandom<int>(Main.rand, 86, 88));
49 dust.noGravity = true;
50 dust.noLightEmittence = true;
51 dust.position = _position - vector.SafeNormalize(Vector2.Zero) * Main.rand.Next(10, 21);
52 dust.velocity = vector.RotatedBy(1.5707963705062866) * 2f;
53 dust.scale = 0.5f + Main.rand.NextFloat();
54 dust.fadeIn = 0.5f;
55 dust.customData = this;
56 dust.position += dust.velocity * 10f;
57 dust.velocity *= -1f;
58 }
59 else
60 {
61 Vector2 vector2 = Vector2.UnitY.RotatedByRandom(6.2831854820251465);
62 vector2 *= new Vector2(0.5f, 1f);
63 Dust dust2 = Dust.NewDustDirect(_position - vector2 * 30f, 0, 0, Utils.SelectRandom<int>(Main.rand, 86, 88));
64 dust2.noGravity = true;
65 dust2.noLightEmittence = true;
66 dust2.position = _position - vector2.SafeNormalize(Vector2.Zero) * Main.rand.Next(5, 10);
67 dust2.velocity = vector2.RotatedBy(-1.5707963705062866) * 3f;
68 dust2.scale = 0.5f + Main.rand.NextFloat();
69 dust2.fadeIn = 0.5f;
70 dust2.customData = this;
71 dust2.position += dust2.velocity * 10f;
72 dust2.velocity *= -1f;
73 }
74 }
75 }

References Terraria.GameContent.VoidLensHelper._position, Terraria.Dust.NewDustDirect(), Terraria.Main.rand, Microsoft.Xna.Framework.Vector2.UnitY, Microsoft.Xna.Framework.Graphics.Vector2, and Microsoft.Xna.Framework.Vector2.Zero.

Referenced by Terraria.GameContent.VoidLensHelper.Update().