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

◆ Spawn_LoadOutChange()

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

Definition at line 358 of file ParticleOrchestrator.cs.

359 {
360 Player player = Main.player[settings.IndexOfPlayerWhoInvokedThis];
361 if (player.active)
362 {
363 Rectangle hitbox = player.Hitbox;
364 int num = 6;
365 hitbox.Height -= num;
366 if (player.gravDir == 1f)
367 {
368 hitbox.Y += num;
369 }
370 for (int i = 0; i < 40; i++)
371 {
372 Dust dust = Dust.NewDustPerfect(Main.rand.NextVector2FromRectangle(hitbox), 16, null, 120, default(Color), Main.rand.NextFloat() * 0.8f + 0.8f);
373 dust.velocity = new Vector2(0f, (float)(-hitbox.Height) * Main.rand.NextFloat() * 0.04f).RotatedBy(Main.rand.NextFloatDirection() * ((float)Math.PI * 2f) * 0.1f);
374 dust.velocity += player.velocity * 2f * Main.rand.NextFloat();
375 dust.noGravity = true;
376 dust.noLight = (dust.noLightEmittence = true);
377 }
378 for (int j = 0; j < 5; j++)
379 {
380 Dust dust2 = Dust.NewDustPerfect(Main.rand.NextVector2FromRectangle(hitbox), 43, null, 254, Main.hslToRgb(Main.rand.NextFloat(), 0.3f, 0.8f), Main.rand.NextFloat() * 0.8f + 0.8f);
381 dust2.velocity = new Vector2(0f, (float)(-hitbox.Height) * Main.rand.NextFloat() * 0.04f).RotatedBy(Main.rand.NextFloatDirection() * ((float)Math.PI * 2f) * 0.1f);
382 dust2.velocity += player.velocity * 2f * Main.rand.NextFloat();
383 dust2.noGravity = true;
384 dust2.noLight = (dust2.noLightEmittence = true);
385 }
386 }
387 }
const double PI
Definition Math.cs:16

References Terraria.Entity.active, Terraria.Player.gravDir, Microsoft.Xna.Framework.Rectangle.Height, Terraria.Entity.Hitbox, Terraria.Main.hslToRgb(), Terraria.GameContent.Drawing.ParticleOrchestraSettings.IndexOfPlayerWhoInvokedThis, Terraria.Dust.NewDustPerfect(), System.Math.PI, Terraria.Main.player, and Terraria.Main.rand.

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