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

◆ AI_153_ToiletPop()

void Terraria.Projectile.AI_153_ToiletPop ( )
inlineprivate

Definition at line 42500 of file Projectile.cs.

42501 {
42502 Vector2 center = base.Center;
42503 float speedY = -2f;
42504 int num = 0;
42505 int num2 = 0;
42506 if (ai[0] == 0f)
42507 {
42508 num = 6;
42509 num2 = 1;
42510 }
42511 else
42512 {
42513 if (!(ai[0] <= 10f))
42514 {
42515 Kill();
42516 return;
42517 }
42518 if (Main.rand.Next(5) == 0)
42519 {
42520 num2 = 1;
42521 }
42522 num = 2;
42523 }
42524 ai[0] += 1f;
42525 for (int i = 0; i < num; i++)
42526 {
42527 Dust dust = Dust.NewDustDirect(center, 3, 6, 216, 0f, speedY);
42528 dust.velocity.X *= 0.5f;
42529 dust.velocity.Y = 0f - Math.Abs(dust.velocity.Y);
42530 dust.position -= dust.velocity;
42531 dust.scale = 0.8f;
42532 }
42533 for (int j = 0; j < num2; j++)
42534 {
42535 Gore gore = Gore.NewGoreDirect(center, Vector2.UnitY * -3f + Main.rand.NextVector2Circular(1f, 1f), Main.rand.Next(580, 583));
42536 gore.velocity.Y = 0f - Math.Abs(gore.velocity.Y);
42537 }
42538 }
static double Abs(double value)

References System.Math.Abs(), Terraria.Dust.NewDustDirect(), Terraria.Gore.NewGoreDirect(), Terraria.Main.rand, Microsoft.Xna.Framework.Vector2.UnitY, Terraria.Dust.velocity, Terraria.Gore.velocity, and Microsoft.Xna.Framework.Vector2.Y.