Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ Spawn_SilverBulletSparkle()

static void Terraria.GameContent.Drawing.ParticleOrchestrator.Spawn_SilverBulletSparkle ( ParticleOrchestraSettings settings)
inlinestaticprivate

Definition at line 1115 of file ParticleOrchestrator.cs.

1116 {
1117 _ = Main.rand.NextFloat() * ((float)Math.PI * 2f);
1118 Vector2 movementVector = settings.MovementVector;
1119 Vector2 vector = new Vector2(Main.rand.NextFloat() * 0.2f + 0.4f);
1120 Main.rand.NextFloat();
1121 float rotation = (float)Math.PI / 2f;
1122 Vector2 vector2 = Main.rand.NextVector2Circular(4f, 4f) * vector;
1123 PrettySparkleParticle prettySparkleParticle = _poolPrettySparkle.RequestParticle();
1124 prettySparkleParticle.AccelerationPerFrame = -movementVector * 1f / 30f;
1125 prettySparkleParticle.Velocity = movementVector;
1126 prettySparkleParticle.ColorTint = Color.White;
1127 prettySparkleParticle.LocalPosition = settings.PositionInWorld + vector2;
1128 prettySparkleParticle.Rotation = rotation;
1129 prettySparkleParticle.Scale = vector;
1130 prettySparkleParticle.FadeInNormalizedTime = 5E-06f;
1131 prettySparkleParticle.FadeOutNormalizedTime = 0.95f;
1132 prettySparkleParticle.FadeInEnd = 10f;
1133 prettySparkleParticle.FadeOutStart = 20f;
1134 prettySparkleParticle.FadeOutEnd = 30f;
1135 prettySparkleParticle.TimeToLive = 30f;
1136 Main.ParticleSystem_World_OverPlayers.Add(prettySparkleParticle);
1137 }
const double PI
Definition Math.cs:16
static ParticlePool< PrettySparkleParticle > _poolPrettySparkle
static Vector2 Add(Vector2 value1, Vector2 value2)
Definition Vector2.cs:587

References Terraria.GameContent.Drawing.ParticleOrchestrator._poolPrettySparkle, System.E, Terraria.GameContent.Drawing.ParticleOrchestraSettings.MovementVector, Terraria.Main.ParticleSystem_World_OverPlayers, System.Math.PI, Terraria.Main.rand, and Microsoft.Xna.Framework.Color.White.

Referenced by Terraria.GameContent.Drawing.ParticleOrchestrator.SpawnParticlesDirect().