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

◆ CrimEnt()

static void Terraria.WorldGen.CrimEnt ( Vector2D position,
int crimDir )
inlinestatic

Definition at line 69685 of file WorldGen.cs.

69686 {
69687 double num = 0.0;
69688 double num2 = genRand.Next(6, 11);
69689 bool flag = true;
69690 Vector2D vector2D = new Vector2D(2.0, (double)genRand.Next(-20, 0) * 0.01);
69691 vector2D.X *= -crimDir;
69692 while (flag)
69693 {
69694 num += 1.0;
69695 if (num >= 20.0)
69696 {
69697 flag = false;
69698 }
69699 num2 += (double)genRand.Next(-10, 11) * 0.02;
69700 if (num2 < 6.0)
69701 {
69702 num2 = 6.0;
69703 }
69704 if (num2 > 10.0)
69705 {
69706 num2 = 10.0;
69707 }
69708 for (int i = (int)(position.X - num2 / 2.0); (double)i < position.X + num2 / 2.0; i++)
69709 {
69710 for (int j = (int)(position.Y - num2 / 2.0); (double)j < position.Y + num2 / 2.0; j++)
69711 {
69712 double num4 = Math.Abs((double)i - position.X);
69713 double num3 = Math.Abs((double)j - position.Y);
69714 if (Math.Sqrt(num4 * num4 + num3 * num3) < num2 * 0.5 && Main.tile[i, j].active() && Main.tile[i, j].type == 203)
69715 {
69716 Main.tile[i, j].active(active: false);
69717 flag = true;
69718 num = 0.0;
69719 }
69720 }
69721 }
69722 position += vector2D;
69723 }
69724 }
static UnifiedRandom genRand
Definition WorldGen.cs:1455

References Terraria.Main.tile.