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

◆ Spawn_BlackLightningSmall()

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

Definition at line 1350 of file ParticleOrchestrator.cs.

1351 {
1352 float num = Main.rand.NextFloat() * ((float)Math.PI * 2f);
1353 float num2 = Main.rand.Next(1, 3);
1354 float num3 = 0.7f;
1355 int num4 = 916;
1356 Main.instance.LoadProjectile(num4);
1357 Color value = new Color(255, 255, 255, 255);
1358 Color indigo = Color.Indigo;
1359 indigo.A = 0;
1360 for (float num5 = 0f; num5 < 1f; num5 += 1f / num2)
1361 {
1362 float f = (float)Math.PI * 2f * num5 + num + Main.rand.NextFloatDirection() * 0.25f;
1363 float num6 = Main.rand.NextFloat() * 4f + 0.1f;
1364 Vector2 vector = Main.rand.NextVector2Circular(12f, 12f) * num3;
1365 Color.Lerp(Color.Lerp(Color.Black, indigo, Main.rand.NextFloat() * 0.5f), value, Main.rand.NextFloat() * 0.6f);
1366 Color colorTint = new Color(0, 0, 0, 255);
1367 int num7 = Main.rand.Next(4);
1368 if (num7 == 1)
1369 {
1370 colorTint = Color.Lerp(new Color(106, 90, 205, 127), Color.Black, 0.1f + 0.7f * Main.rand.NextFloat());
1371 }
1372 if (num7 == 2)
1373 {
1374 colorTint = Color.Lerp(new Color(106, 90, 205, 60), Color.Black, 0.1f + 0.8f * Main.rand.NextFloat());
1375 }
1376 RandomizedFrameParticle randomizedFrameParticle = _poolRandomizedFrame.RequestParticle();
1377 randomizedFrameParticle.SetBasicInfo(TextureAssets.Projectile[num4], null, Vector2.Zero, vector);
1378 randomizedFrameParticle.SetTypeInfo(Main.projFrames[num4], 2, 24f);
1379 randomizedFrameParticle.Velocity = f.ToRotationVector2() * num6 * new Vector2(1f, 0.5f) * 0.2f + settings.MovementVector;
1380 randomizedFrameParticle.ColorTint = colorTint;
1381 randomizedFrameParticle.LocalPosition = settings.PositionInWorld + vector;
1382 randomizedFrameParticle.Rotation = randomizedFrameParticle.Velocity.ToRotation();
1383 randomizedFrameParticle.Scale = Vector2.One * 0.5f;
1384 randomizedFrameParticle.FadeInNormalizedTime = 0.01f;
1385 randomizedFrameParticle.FadeOutNormalizedTime = 0.5f;
1386 randomizedFrameParticle.ScaleVelocity = new Vector2(0.025f);
1387 Main.ParticleSystem_World_OverPlayers.Add(randomizedFrameParticle);
1388 }
1389 }
const double PI
Definition Math.cs:16
static ParticlePool< RandomizedFrameParticle > _poolRandomizedFrame
virtual void SetBasicInfo(Asset< Texture2D > textureAsset, Rectangle? frame, Vector2 initialVelocity, Vector2 initialLocalPosition)
void SetTypeInfo(int animationFramesAmount, int gameFramesPerAnimationFrame, float timeToLive)
static Color Lerp(Color value1, Color value2, float amount)
Definition Color.cs:491

References Terraria.GameContent.Drawing.ParticleOrchestrator._poolRandomizedFrame, Microsoft.Xna.Framework.Color.Black, Microsoft.Xna.Framework.Color.Indigo, Terraria.Main.instance, Microsoft.Xna.Framework.Color.Lerp(), Terraria.GameContent.Drawing.ParticleOrchestraSettings.MovementVector, Terraria.Main.ParticleSystem_World_OverPlayers, System.Math.PI, Terraria.GameContent.TextureAssets.Projectile, Terraria.Main.projFrames, Terraria.Main.rand, Terraria.Graphics.Renderers.ABasicParticle.SetBasicInfo(), Terraria.Graphics.Renderers.RandomizedFrameParticle.SetTypeInfo(), System.value, Terraria.Graphics.Renderers.ABasicParticle.Velocity, and Microsoft.Xna.Framework.Vector2.Zero.

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