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

◆ AI_168_FirstFractal()

void Terraria.Projectile.AI_168_FirstFractal ( )
inlineprivate

Definition at line 38457 of file Projectile.cs.

38458 {
38459 float num = 60f;
38460 if ((localAI[0] += 1f) >= num - 1f)
38461 {
38462 Kill();
38463 return;
38464 }
38465 if (frameCounter == 0)
38466 {
38467 frameCounter = 1;
38468 frame = Main.rand.Next(15);
38469 }
38470 velocity = velocity.RotatedBy(ai[0]);
38471 Opacity = Utils.GetLerpValue(0f, 12f, localAI[0], clamped: true) * Utils.GetLerpValue(num, num - 12f, localAI[0], clamped: true);
38472 direction = ((velocity.X > 0f) ? 1 : (-1));
38474 rotation = (float)Math.PI / 4f * (float)spriteDirection + velocity.ToRotation();
38475 if (spriteDirection == -1)
38476 {
38477 rotation += (float)Math.PI;
38478 }
38479 if (localAI[0] > 7f)
38480 {
38481 int num2 = 5;
38482 _ = base.Center - new Vector2(num2);
38483 if (Main.rand.Next(15) == 0)
38484 {
38485 Dust dust = Dust.NewDustPerfect(base.Center, 278, null, 100, Color.Lerp(GetFirstFractalColor(), Color.White, Main.rand.NextFloat() * 0.3f));
38486 dust.scale = 0.7f;
38487 dust.noGravity = true;
38488 dust.velocity *= 0.5f;
38489 dust.velocity += velocity * 2f;
38490 }
38491 }
38492 }
const double PI
Definition Math.cs:16
Vector2 velocity
Definition Entity.cs:16
static Color Lerp(Color value1, Color value2, float amount)
Definition Color.cs:491

References Terraria.Utils.GetLerpValue(), Microsoft.Xna.Framework.Color.Lerp(), Terraria.Dust.NewDustPerfect(), System.Math.PI, Terraria.Main.rand, and Microsoft.Xna.Framework.Color.White.