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

◆ ShellPile()

static bool Terraria.WorldGen.ShellPile ( int X,
int Y )
inlinestatic

Definition at line 6475 of file WorldGen.cs.

6476 {
6477 //IL_03ef: Unknown result type (might be due to invalid IL or missing references)
6478 //IL_03f0: Unknown result type (might be due to invalid IL or missing references)
6479 //IL_03f1: Unknown result type (might be due to invalid IL or missing references)
6480 //IL_03f6: Unknown result type (might be due to invalid IL or missing references)
6481 //IL_0449: Unknown result type (might be due to invalid IL or missing references)
6482 //IL_0467: Unknown result type (might be due to invalid IL or missing references)
6483 //IL_0123: Unknown result type (might be due to invalid IL or missing references)
6484 //IL_012a: Unknown result type (might be due to invalid IL or missing references)
6485 //IL_012f: Unknown result type (might be due to invalid IL or missing references)
6486 //IL_0134: Unknown result type (might be due to invalid IL or missing references)
6487 int num = Y;
6488 while (!SolidTile(X, num))
6489 {
6490 num++;
6491 if ((double)num > Main.worldSurface)
6492 {
6493 return false;
6494 }
6495 }
6496 if (Main.tile[X, num].type != 53)
6497 {
6498 return false;
6499 }
6500 if (Main.tile[X, num].wall > 0)
6501 {
6502 return false;
6503 }
6504 num--;
6505 Vector2D val = default(Vector2D);
6506 ((Vector2D)(ref val))._002Ector((double)X, (double)num);
6507 Vector2D val2 = default(Vector2D);
6508 val2.X = genRand.NextDouble() * 0.6 - 0.3;
6509 val2.Y = genRand.NextDouble() * 0.5 + 0.5;
6510 double num2 = genRand.Next(2, 4);
6511 if (genRand.Next(10) == 0)
6512 {
6513 num2 += 1.0;
6514 }
6515 int num3 = genRand.Next(3, 6);
6516 while (num3 > 0)
6517 {
6518 num3--;
6519 for (int i = X - (int)num2 * 4; (double)i <= (double)X + num2 * 4.0; i++)
6520 {
6521 int num4 = num + (int)num2 * 4;
6522 while ((double)num4 > (double)num - num2 * 4.0)
6523 {
6524 double num5 = num2 * (double)genRand.Next(70, 91) * 0.01;
6525 Vector2D val3 = val - new Vector2D((double)i, (double)num4);
6526 val3.X *= 0.6;
6527 if (((Vector2D)(ref val3)).Length() < num5)
6528 {
6529 if (num4 <= num + 1 || genRand.Next(6) == 0)
6530 {
6531 Main.tile[i, num4].type = 495;
6532 Main.tile[i, num4].active(active: true);
6533 Main.tile[i, num4].halfBrick(halfBrick: false);
6534 Main.tile[i, num4].slope(0);
6535 if (!Main.tile[i, num4 + 1].active())
6536 {
6537 Main.tile[i, num4 + 1].type = 495;
6538 Main.tile[i, num4 + 1].active(active: true);
6539 Main.tile[i, num4 + 1].halfBrick(halfBrick: false);
6540 Main.tile[i, num4 + 1].slope(0);
6541 if (!Main.tile[i, num4 + 2].active())
6542 {
6543 Main.tile[i, num4 + 2].type = 53;
6544 Main.tile[i, num4 + 2].active(active: true);
6545 Main.tile[i, num4 + 2].halfBrick(halfBrick: false);
6546 Main.tile[i, num4 + 2].slope(0);
6547 if (!Main.tile[i, num4 + 3].active())
6548 {
6549 Main.tile[i, num4 + 3].type = 397;
6550 Main.tile[i, num4 + 3].active(active: true);
6551 Main.tile[i, num4 + 3].halfBrick(halfBrick: false);
6552 Main.tile[i, num4 + 3].slope(0);
6553 }
6554 }
6555 }
6556 if (!gen)
6557 {
6559 }
6560 }
6561 else if (Main.tile[i, num4].type != 495)
6562 {
6563 Main.tile[i, num4].active(active: true);
6564 Main.tile[i, num4].halfBrick(halfBrick: false);
6565 Main.tile[i, num4].slope(0);
6566 Main.tile[i, num4].type = 53;
6567 if (!gen)
6568 {
6570 }
6571 }
6572 }
6573 num4--;
6574 }
6575 }
6576 val += val2;
6577 val2.X += genRand.NextDouble() * 0.2 - 0.1;
6578 val2.Y += genRand.NextDouble() * 0.2 - 0.1;
6579 Utils.Clamp(val2.X, -0.3, 0.3);
6580 Utils.Clamp(val2.Y, 0.5, 1.0);
6581 }
6582 return true;
6583 }
static volatile bool gen
Definition WorldGen.cs:972
static UnifiedRandom genRand
Definition WorldGen.cs:1215
static void SquareTileFrame(int i, int j, bool resetFrame=true)

References Terraria.WorldGen.gen, Terraria.WorldGen.genRand, Terraria.Enums.SolidTile, Terraria.WorldGen.SquareTileFrame(), Terraria.Main.tile, Terraria.Main.worldSurface, System.X, and System.Y.