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

◆ CrimEnt()

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

Definition at line 65634 of file WorldGen.cs.

65635 {
65636 //IL_00b8: Unknown result type (might be due to invalid IL or missing references)
65637 //IL_019e: Unknown result type (might be due to invalid IL or missing references)
65638 //IL_00d2: Unknown result type (might be due to invalid IL or missing references)
65639 //IL_01b5: Unknown result type (might be due to invalid IL or missing references)
65640 //IL_01b6: Unknown result type (might be due to invalid IL or missing references)
65641 //IL_01b7: Unknown result type (might be due to invalid IL or missing references)
65642 //IL_01bc: Unknown result type (might be due to invalid IL or missing references)
65643 //IL_017e: Unknown result type (might be due to invalid IL or missing references)
65644 //IL_00ef: Unknown result type (might be due to invalid IL or missing references)
65645 //IL_00fe: Unknown result type (might be due to invalid IL or missing references)
65646 double num = 0.0;
65647 double num2 = genRand.Next(6, 11);
65648 bool flag = true;
65649 Vector2D val = default(Vector2D);
65650 ((Vector2D)(ref val))._002Ector(2.0, (double)genRand.Next(-20, 0) * 0.01);
65651 val.X *= -crimDir;
65652 while (flag)
65653 {
65654 num += 1.0;
65655 if (num >= 20.0)
65656 {
65657 flag = false;
65658 }
65659 num2 += (double)genRand.Next(-10, 11) * 0.02;
65660 if (num2 < 6.0)
65661 {
65662 num2 = 6.0;
65663 }
65664 if (num2 > 10.0)
65665 {
65666 num2 = 10.0;
65667 }
65668 for (int i = (int)(position.X - num2 / 2.0); (double)i < position.X + num2 / 2.0; i++)
65669 {
65670 for (int j = (int)(position.Y - num2 / 2.0); (double)j < position.Y + num2 / 2.0; j++)
65671 {
65672 double num3 = Math.Abs((double)i - position.X);
65673 double num4 = Math.Abs((double)j - position.Y);
65674 if (Math.Sqrt(num3 * num3 + num4 * num4) < num2 * 0.5 && Main.tile[i, j].active() && Main.tile[i, j].type == 203)
65675 {
65676 Main.tile[i, j].active(active: false);
65677 flag = true;
65678 num = 0.0;
65679 }
65680 }
65681 }
65682 position += val;
65683 }
65684 }
static double Sqrt(double d)
static double Abs(double value)
static UnifiedRandom genRand
Definition WorldGen.cs:1215

References System.Math.Abs(), System.Math.Sqrt(), Terraria.Main.tile, ReLogic.Utilities.Vector2D.X, and ReLogic.Utilities.Vector2D.Y.