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

◆ Spawn_ShimmerArrow()

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

Definition at line 446 of file ParticleOrchestrator.cs.

447 {
448 float num = 20f;
449 for (int i = 0; i < 2; i++)
450 {
451 float num2 = (float)Math.PI * 2f * Main.rand.NextFloatDirection() * 0.05f;
452 Color color = Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.5f);
453 color.A /= 2;
454 Color value = color;
455 value.A = byte.MaxValue;
456 value = Color.Lerp(value, Color.White, 0.5f);
457 for (float num3 = 0f; num3 < 4f; num3 += 1f)
458 {
459 PrettySparkleParticle prettySparkleParticle = _poolPrettySparkle.RequestParticle();
460 Vector2 vector = ((float)Math.PI / 2f * num3 + num2).ToRotationVector2() * 4f;
461 prettySparkleParticle.ColorTint = color;
462 prettySparkleParticle.LocalPosition = settings.PositionInWorld;
463 prettySparkleParticle.Rotation = vector.ToRotation();
464 prettySparkleParticle.Scale = new Vector2((num3 % 2f == 0f) ? 2f : 4f, 0.5f) * 1.1f;
465 prettySparkleParticle.FadeInNormalizedTime = 5E-06f;
466 prettySparkleParticle.FadeOutNormalizedTime = 0.95f;
467 prettySparkleParticle.TimeToLive = num;
468 prettySparkleParticle.FadeOutEnd = num;
469 prettySparkleParticle.FadeInEnd = num / 2f;
470 prettySparkleParticle.FadeOutStart = num / 2f;
471 prettySparkleParticle.AdditiveAmount = 0.35f;
472 prettySparkleParticle.Velocity = -vector * 0.2f;
473 prettySparkleParticle.DrawVerticalAxis = false;
474 if (num3 % 2f == 1f)
475 {
476 prettySparkleParticle.Scale *= 0.9f;
477 prettySparkleParticle.Velocity *= 0.9f;
478 }
479 Main.ParticleSystem_World_OverPlayers.Add(prettySparkleParticle);
480 }
481 for (float num4 = 0f; num4 < 4f; num4 += 1f)
482 {
483 PrettySparkleParticle prettySparkleParticle2 = _poolPrettySparkle.RequestParticle();
484 Vector2 vector2 = ((float)Math.PI / 2f * num4 + num2).ToRotationVector2() * 4f;
485 prettySparkleParticle2.ColorTint = value;
486 prettySparkleParticle2.LocalPosition = settings.PositionInWorld;
487 prettySparkleParticle2.Rotation = vector2.ToRotation();
488 prettySparkleParticle2.Scale = new Vector2((num4 % 2f == 0f) ? 2f : 4f, 0.5f) * 0.7f;
489 prettySparkleParticle2.FadeInNormalizedTime = 5E-06f;
490 prettySparkleParticle2.FadeOutNormalizedTime = 0.95f;
491 prettySparkleParticle2.TimeToLive = num;
492 prettySparkleParticle2.FadeOutEnd = num;
493 prettySparkleParticle2.FadeInEnd = num / 2f;
494 prettySparkleParticle2.FadeOutStart = num / 2f;
495 prettySparkleParticle2.Velocity = vector2 * 0.2f;
496 prettySparkleParticle2.DrawVerticalAxis = false;
497 if (num4 % 2f == 1f)
498 {
499 prettySparkleParticle2.Scale *= 1.2f;
500 prettySparkleParticle2.Velocity *= 1.2f;
501 }
502 Main.ParticleSystem_World_OverPlayers.Add(prettySparkleParticle2);
503 if (i == 0)
504 {
505 for (int j = 0; j < 1; j++)
506 {
507 Dust dust = Dust.NewDustPerfect(settings.PositionInWorld, 306, vector2.RotatedBy(Main.rand.NextFloatDirection() * ((float)Math.PI * 2f) * 0.025f) * Main.rand.NextFloat());
508 dust.noGravity = true;
509 dust.scale = 1.4f;
510 dust.fadeIn = 1.2f;
511 dust.color = color;
512 Dust dust2 = Dust.NewDustPerfect(settings.PositionInWorld, 306, -vector2.RotatedBy(Main.rand.NextFloatDirection() * ((float)Math.PI * 2f) * 0.025f) * Main.rand.NextFloat());
513 dust2.noGravity = true;
514 dust2.scale = 1.4f;
515 dust2.fadeIn = 1.2f;
516 dust2.color = color;
517 }
518 }
519 }
520 }
521 }
const double PI
Definition Math.cs:16
static ParticlePool< PrettySparkleParticle > _poolPrettySparkle
static Color Lerp(Color value1, Color value2, float amount)
Definition Color.cs:491
static Vector2 Add(Vector2 value1, Vector2 value2)
Definition Vector2.cs:587

References Terraria.GameContent.Drawing.ParticleOrchestrator._poolPrettySparkle, System.E, Terraria.Main.hslToRgb(), Microsoft.Xna.Framework.Color.Lerp(), Terraria.Dust.NewDustPerfect(), Terraria.Main.ParticleSystem_World_OverPlayers, System.Math.PI, Terraria.GameContent.Drawing.ParticleOrchestraSettings.PositionInWorld, Terraria.Main.rand, System.value, and Microsoft.Xna.Framework.Color.White.

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