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

◆ Spawn_Keybrand()

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

Definition at line 1460 of file ParticleOrchestrator.cs.

1461 {
1462 float num = Main.rand.NextFloat() * ((float)Math.PI * 2f);
1463 float num2 = 3f;
1464 Vector2 vector = new Vector2(0.7f);
1465 for (float num3 = 0f; num3 < 1f; num3 += 1f / num2)
1466 {
1467 float num4 = (float)Math.PI * 2f * num3 + num + Main.rand.NextFloatDirection() * 0.1f;
1468 Vector2 vector2 = 1.5f * vector;
1469 float num5 = 60f;
1470 Vector2 vector3 = Main.rand.NextVector2Circular(4f, 4f) * vector;
1471 PrettySparkleParticle prettySparkleParticle = _poolPrettySparkle.RequestParticle();
1472 prettySparkleParticle.Velocity = num4.ToRotationVector2() * vector2;
1473 prettySparkleParticle.AccelerationPerFrame = num4.ToRotationVector2() * -(vector2 / num5);
1474 prettySparkleParticle.ColorTint = Color.Lerp(Color.Gold, Color.OrangeRed, Main.rand.NextFloat());
1475 prettySparkleParticle.LocalPosition = settings.PositionInWorld + vector3;
1476 prettySparkleParticle.Rotation = num4;
1477 prettySparkleParticle.Scale = vector * 0.8f;
1478 Main.ParticleSystem_World_OverPlayers.Add(prettySparkleParticle);
1479 }
1480 num += 1f / num2 / 2f * ((float)Math.PI * 2f);
1481 num = Main.rand.NextFloat() * ((float)Math.PI * 2f);
1482 for (float num6 = 0f; num6 < 1f; num6 += 1f / num2)
1483 {
1484 float num7 = (float)Math.PI * 2f * num6 + num + Main.rand.NextFloatDirection() * 0.1f;
1485 Vector2 vector4 = 1f * vector;
1486 float num8 = 30f;
1487 Color value = Color.Lerp(Color.Gold, Color.OrangeRed, Main.rand.NextFloat());
1488 value = Color.Lerp(Color.White, value, 0.5f);
1489 value.A = 0;
1490 Vector2 vector5 = Main.rand.NextVector2Circular(4f, 4f) * vector;
1491 FadingParticle fadingParticle = _poolFading.RequestParticle();
1492 fadingParticle.SetBasicInfo(TextureAssets.Extra[98], null, Vector2.Zero, Vector2.Zero);
1493 fadingParticle.SetTypeInfo(num8);
1494 fadingParticle.Velocity = num7.ToRotationVector2() * vector4;
1495 fadingParticle.AccelerationPerFrame = num7.ToRotationVector2() * -(vector4 / num8);
1496 fadingParticle.ColorTint = value;
1497 fadingParticle.LocalPosition = settings.PositionInWorld + num7.ToRotationVector2() * vector4 * vector * num8 * 0.2f + vector5;
1498 fadingParticle.Rotation = num7 + (float)Math.PI / 2f;
1499 fadingParticle.FadeInNormalizedTime = 0.3f;
1500 fadingParticle.FadeOutNormalizedTime = 0.4f;
1501 fadingParticle.Scale = new Vector2(0.5f, 1.2f) * 0.8f * vector;
1502 Main.ParticleSystem_World_OverPlayers.Add(fadingParticle);
1503 }
1504 num2 = 1f;
1505 num = Main.rand.NextFloat() * ((float)Math.PI * 2f);
1506 for (float num9 = 0f; num9 < 1f; num9 += 1f / num2)
1507 {
1508 float num10 = (float)Math.PI * 2f * num9 + num;
1509 float typeInfo = 30f;
1510 Color colorTint = Color.Lerp(Color.CornflowerBlue, Color.White, Main.rand.NextFloat());
1511 colorTint.A = 127;
1512 Vector2 vector6 = Main.rand.NextVector2Circular(4f, 4f) * vector;
1513 Vector2 vector7 = Main.rand.NextVector2Square(0.7f, 1.3f);
1514 FadingParticle fadingParticle2 = _poolFading.RequestParticle();
1515 fadingParticle2.SetBasicInfo(TextureAssets.Extra[174], null, Vector2.Zero, Vector2.Zero);
1516 fadingParticle2.SetTypeInfo(typeInfo);
1517 fadingParticle2.ColorTint = colorTint;
1518 fadingParticle2.LocalPosition = settings.PositionInWorld + vector6;
1519 fadingParticle2.Rotation = num10 + (float)Math.PI / 2f;
1520 fadingParticle2.FadeInNormalizedTime = 0.1f;
1521 fadingParticle2.FadeOutNormalizedTime = 0.4f;
1522 fadingParticle2.Scale = new Vector2(0.1f, 0.1f) * vector;
1523 fadingParticle2.ScaleVelocity = vector7 * 1f / 60f;
1524 fadingParticle2.ScaleAcceleration = vector7 * (-1f / 60f) / 60f;
1525 Main.ParticleSystem_World_OverPlayers.Add(fadingParticle2);
1526 }
1527 }
const double PI
Definition Math.cs:16
static ParticlePool< PrettySparkleParticle > _poolPrettySparkle
static ParticlePool< FadingParticle > _poolFading
virtual void SetBasicInfo(Asset< Texture2D > textureAsset, Rectangle? frame, Vector2 initialVelocity, Vector2 initialLocalPosition)
static Color CornflowerBlue
Definition Color.cs:112
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._poolFading, Terraria.GameContent.Drawing.ParticleOrchestrator._poolPrettySparkle, Microsoft.Xna.Framework.Color.CornflowerBlue, Terraria.GameContent.TextureAssets.Extra, Microsoft.Xna.Framework.Color.Gold, Microsoft.Xna.Framework.Color.Lerp(), Microsoft.Xna.Framework.Color.OrangeRed, Terraria.Main.ParticleSystem_World_OverPlayers, System.Math.PI, Terraria.Main.rand, Terraria.Graphics.Renderers.ABasicParticle.SetBasicInfo(), Terraria.Graphics.Renderers.FadingParticle.SetTypeInfo(), System.value, Microsoft.Xna.Framework.Color.White, and Microsoft.Xna.Framework.Vector2.Zero.

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