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

◆ Spawn_ShimmerTownNPCSend()

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

Definition at line 208 of file ParticleOrchestrator.cs.

209 {
210 Rectangle rect = Utils.CenteredRectangle(settings.PositionInWorld, new Vector2(30f, 60f));
211 for (float num = 0f; num < 20f; num += 1f)
212 {
213 PrettySparkleParticle prettySparkleParticle = _poolPrettySparkle.RequestParticle();
214 int num2 = Main.rand.Next(20, 40);
215 prettySparkleParticle.ColorTint = Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.5f, 0);
216 prettySparkleParticle.LocalPosition = Main.rand.NextVector2FromRectangle(rect);
217 prettySparkleParticle.Rotation = (float)Math.PI / 2f;
218 prettySparkleParticle.Scale = new Vector2(1f + Main.rand.NextFloat() * 2f, 0.7f + Main.rand.NextFloat() * 0.7f);
219 prettySparkleParticle.Velocity = new Vector2(0f, -1f);
220 prettySparkleParticle.FadeInNormalizedTime = 5E-06f;
221 prettySparkleParticle.FadeOutNormalizedTime = 0.95f;
222 prettySparkleParticle.TimeToLive = num2;
223 prettySparkleParticle.FadeOutEnd = num2;
224 prettySparkleParticle.FadeInEnd = num2 / 2;
225 prettySparkleParticle.FadeOutStart = num2 / 2;
226 prettySparkleParticle.AdditiveAmount = 0.35f;
227 prettySparkleParticle.DrawVerticalAxis = false;
228 Main.ParticleSystem_World_OverPlayers.Add(prettySparkleParticle);
229 PrettySparkleParticle prettySparkleParticle2 = _poolPrettySparkle.RequestParticle();
230 prettySparkleParticle2.ColorTint = new Color(255, 255, 255, 0);
231 prettySparkleParticle2.LocalPosition = Main.rand.NextVector2FromRectangle(rect);
232 prettySparkleParticle2.Rotation = (float)Math.PI / 2f;
233 prettySparkleParticle2.Scale = prettySparkleParticle.Scale * 0.5f;
234 prettySparkleParticle2.Velocity = new Vector2(0f, -1f);
235 prettySparkleParticle2.FadeInNormalizedTime = 5E-06f;
236 prettySparkleParticle2.FadeOutNormalizedTime = 0.95f;
237 prettySparkleParticle2.TimeToLive = num2;
238 prettySparkleParticle2.FadeOutEnd = num2;
239 prettySparkleParticle2.FadeInEnd = num2 / 2;
240 prettySparkleParticle2.FadeOutStart = num2 / 2;
241 prettySparkleParticle2.AdditiveAmount = 1f;
242 prettySparkleParticle2.DrawVerticalAxis = false;
243 Main.ParticleSystem_World_OverPlayers.Add(prettySparkleParticle2);
244 }
245 }
const double PI
Definition Math.cs:16
static ParticlePool< PrettySparkleParticle > _poolPrettySparkle

References Terraria.GameContent.Drawing.ParticleOrchestrator._poolPrettySparkle, Terraria.Utils.CenteredRectangle(), System.E, Terraria.Main.hslToRgb(), Terraria.Main.ParticleSystem_World_OverPlayers, System.Math.PI, Terraria.GameContent.Drawing.ParticleOrchestraSettings.PositionInWorld, and Terraria.Main.rand.

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