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;
455 value.A = byte.MaxValue;
457 for (float num3 = 0f; num3 < 4f; num3 += 1f)
458 {
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 = 5
E-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 {
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 = 5
E-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 }
static ParticlePool< PrettySparkleParticle > _poolPrettySparkle
static Color Lerp(Color value1, Color value2, float amount)
static Vector2 Add(Vector2 value1, Vector2 value2)