Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ SnowCloudIsland()

static void Terraria.WorldGen.SnowCloudIsland ( int i,
int j )
inlinestatic

Definition at line 67343 of file WorldGen.cs.

67344 {
67345 //IL_0089: Unknown result type (might be due to invalid IL or missing references)
67346 //IL_009a: Unknown result type (might be due to invalid IL or missing references)
67347 //IL_00ef: Unknown result type (might be due to invalid IL or missing references)
67348 //IL_0104: Unknown result type (might be due to invalid IL or missing references)
67349 //IL_011a: Unknown result type (might be due to invalid IL or missing references)
67350 //IL_012f: Unknown result type (might be due to invalid IL or missing references)
67351 //IL_0563: Unknown result type (might be due to invalid IL or missing references)
67352 //IL_0574: Unknown result type (might be due to invalid IL or missing references)
67353 //IL_018f: Unknown result type (might be due to invalid IL or missing references)
67354 //IL_05c9: Unknown result type (might be due to invalid IL or missing references)
67355 //IL_05de: Unknown result type (might be due to invalid IL or missing references)
67356 //IL_05f9: Unknown result type (might be due to invalid IL or missing references)
67357 //IL_02d3: Unknown result type (might be due to invalid IL or missing references)
67358 //IL_02d4: Unknown result type (might be due to invalid IL or missing references)
67359 //IL_02d5: Unknown result type (might be due to invalid IL or missing references)
67360 //IL_02da: Unknown result type (might be due to invalid IL or missing references)
67361 //IL_02ff: Unknown result type (might be due to invalid IL or missing references)
67362 //IL_01ca: Unknown result type (might be due to invalid IL or missing references)
67363 //IL_0320: Unknown result type (might be due to invalid IL or missing references)
67364 //IL_01dc: Unknown result type (might be due to invalid IL or missing references)
67365 //IL_01d2: Unknown result type (might be due to invalid IL or missing references)
67366 //IL_0341: Unknown result type (might be due to invalid IL or missing references)
67367 //IL_01ee: Unknown result type (might be due to invalid IL or missing references)
67368 //IL_0362: Unknown result type (might be due to invalid IL or missing references)
67369 //IL_0659: Unknown result type (might be due to invalid IL or missing references)
67370 //IL_077b: Unknown result type (might be due to invalid IL or missing references)
67371 //IL_077c: Unknown result type (might be due to invalid IL or missing references)
67372 //IL_077d: Unknown result type (might be due to invalid IL or missing references)
67373 //IL_0782: Unknown result type (might be due to invalid IL or missing references)
67374 //IL_07a7: Unknown result type (might be due to invalid IL or missing references)
67375 //IL_0215: Unknown result type (might be due to invalid IL or missing references)
67376 //IL_0224: Unknown result type (might be due to invalid IL or missing references)
67377 //IL_0694: Unknown result type (might be due to invalid IL or missing references)
67378 //IL_07c8: Unknown result type (might be due to invalid IL or missing references)
67379 //IL_06a6: Unknown result type (might be due to invalid IL or missing references)
67380 //IL_069c: Unknown result type (might be due to invalid IL or missing references)
67381 //IL_07e9: Unknown result type (might be due to invalid IL or missing references)
67382 //IL_06b8: Unknown result type (might be due to invalid IL or missing references)
67383 //IL_080a: Unknown result type (might be due to invalid IL or missing references)
67384 //IL_06df: Unknown result type (might be due to invalid IL or missing references)
67385 //IL_06ee: Unknown result type (might be due to invalid IL or missing references)
67386 double num = genRand.Next(100, 150);
67387 double num2 = num;
67388 double num3 = genRand.Next(20, 30);
67389 int num4 = i;
67390 int num5 = i;
67391 int num6 = i;
67392 int num7 = j;
67393 Vector2D val = default(Vector2D);
67394 val.X = i;
67395 val.Y = j;
67396 Vector2D val2 = default(Vector2D);
67397 val2.X = (double)genRand.Next(-20, 21) * 0.2;
67398 while (val2.X > -2.0 && val2.X < 2.0)
67399 {
67400 val2.X = (double)genRand.Next(-20, 21) * 0.2;
67401 }
67402 val2.Y = (double)genRand.Next(-20, -10) * 0.02;
67403 while (num > 0.0 && num3 > 0.0)
67404 {
67405 num -= (double)genRand.Next(4);
67406 num3 -= 1.0;
67407 int num8 = (int)(val.X - num * 0.5);
67408 int num9 = (int)(val.X + num * 0.5);
67409 int num10 = (int)(val.Y - num * 0.5);
67410 int num11 = (int)(val.Y + num * 0.5);
67411 if (num8 < 0)
67412 {
67413 num8 = 0;
67414 }
67415 if (num9 > Main.maxTilesX)
67416 {
67417 num9 = Main.maxTilesX;
67418 }
67419 if (num10 < 0)
67420 {
67421 num10 = 0;
67422 }
67423 if (num11 > Main.maxTilesY)
67424 {
67425 num11 = Main.maxTilesY;
67426 }
67427 num2 = num * (double)genRand.Next(80, 120) * 0.01;
67428 double num12 = val.Y + 1.0;
67429 for (int k = num8; k < num9; k++)
67430 {
67431 if (genRand.Next(2) == 0)
67432 {
67433 num12 += (double)genRand.Next(-1, 2);
67434 }
67435 if (num12 < val.Y)
67436 {
67437 num12 = val.Y;
67438 }
67439 if (num12 > val.Y + 2.0)
67440 {
67441 num12 = val.Y + 2.0;
67442 }
67443 for (int l = num10; l < num11; l++)
67444 {
67445 if (!((double)l > num12))
67446 {
67447 continue;
67448 }
67449 double num13 = Math.Abs((double)k - val.X);
67450 double num14 = Math.Abs((double)l - val.Y) * 3.0;
67451 if (Math.Sqrt(num13 * num13 + num14 * num14) < num2 * 0.4)
67452 {
67453 if (k < num4)
67454 {
67455 num4 = k;
67456 }
67457 if (k > num5)
67458 {
67459 num5 = k;
67460 }
67461 if (l < num6)
67462 {
67463 num6 = l;
67464 }
67465 if (l > num7)
67466 {
67467 num7 = l;
67468 }
67469 Main.tile[k, l].active(active: true);
67470 Main.tile[k, l].type = 189;
67472 }
67473 }
67474 }
67475 val += val2;
67476 val2.X += (double)genRand.Next(-20, 21) * 0.05;
67477 if (val2.X > 1.0)
67478 {
67479 val2.X = 1.0;
67480 }
67481 if (val2.X < -1.0)
67482 {
67483 val2.X = -1.0;
67484 }
67485 if (val2.Y > 0.2)
67486 {
67487 val2.Y = -0.2;
67488 }
67489 if (val2.Y < -0.2)
67490 {
67491 val2.Y = -0.2;
67492 }
67493 }
67494 int num15 = num4;
67495 int num17;
67496 for (num15 += genRand.Next(5); num15 < num5; num15 += genRand.Next(num17, (int)((double)num17 * 1.5)))
67497 {
67498 int num16 = num7;
67499 while (!Main.tile[num15, num16].active())
67500 {
67501 num16--;
67502 }
67503 num16 += genRand.Next(-3, 4);
67504 num17 = genRand.Next(4, 8);
67505 int num18 = 189;
67506 if (genRand.Next(4) == 0)
67507 {
67508 num18 = 460;
67509 }
67510 for (int m = num15 - num17; m <= num15 + num17; m++)
67511 {
67512 for (int n = num16 - num17; n <= num16 + num17; n++)
67513 {
67514 if (n > num6)
67515 {
67516 double num19 = Math.Abs(m - num15);
67517 double num20 = Math.Abs(n - num16) * 2;
67518 if (Math.Sqrt(num19 * num19 + num20 * num20) < (double)(num17 + genRand.Next(2)))
67519 {
67520 Main.tile[m, n].active(active: true);
67521 Main.tile[m, n].type = (ushort)num18;
67523 }
67524 }
67525 }
67526 }
67527 }
67528 num = genRand.Next(80, 95);
67529 num2 = num;
67530 num3 = genRand.Next(10, 15);
67531 val.X = i;
67532 val.Y = num6;
67533 val2.X = (double)genRand.Next(-20, 21) * 0.2;
67534 while (val2.X > -2.0 && val2.X < 2.0)
67535 {
67536 val2.X = (double)genRand.Next(-20, 21) * 0.2;
67537 }
67538 val2.Y = (double)genRand.Next(-20, -10) * 0.02;
67539 while (num > 0.0 && num3 > 0.0)
67540 {
67541 num -= (double)genRand.Next(4);
67542 num3 -= 1.0;
67543 int num8 = (int)(val.X - num * 0.5);
67544 int num9 = (int)(val.X + num * 0.5);
67545 int num10 = num6 - 1;
67546 int num11 = (int)(val.Y + num * 0.5);
67547 if (num8 < 0)
67548 {
67549 num8 = 0;
67550 }
67551 if (num9 > Main.maxTilesX)
67552 {
67553 num9 = Main.maxTilesX;
67554 }
67555 if (num10 < 0)
67556 {
67557 num10 = 0;
67558 }
67559 if (num11 > Main.maxTilesY)
67560 {
67561 num11 = Main.maxTilesY;
67562 }
67563 num2 = num * (double)genRand.Next(80, 120) * 0.01;
67564 double num21 = val.Y + 1.0;
67565 for (int num22 = num8; num22 < num9; num22++)
67566 {
67567 if (genRand.Next(2) == 0)
67568 {
67569 num21 += (double)genRand.Next(-1, 2);
67570 }
67571 if (num21 < val.Y)
67572 {
67573 num21 = val.Y;
67574 }
67575 if (num21 > val.Y + 2.0)
67576 {
67577 num21 = val.Y + 2.0;
67578 }
67579 for (int num23 = num10; num23 < num11; num23++)
67580 {
67581 if ((double)num23 > num21)
67582 {
67583 double num24 = Math.Abs((double)num22 - val.X);
67584 double num25 = Math.Abs((double)num23 - val.Y) * 3.0;
67585 if (Math.Sqrt(num24 * num24 + num25 * num25) < num2 * 0.4 && Main.tile[num22, num23].type == 189)
67586 {
67587 Main.tile[num22, num23].type = 147;
67589 }
67590 }
67591 }
67592 }
67593 val += val2;
67594 val2.X += (double)genRand.Next(-20, 21) * 0.05;
67595 if (val2.X > 1.0)
67596 {
67597 val2.X = 1.0;
67598 }
67599 if (val2.X < -1.0)
67600 {
67601 val2.X = -1.0;
67602 }
67603 if (val2.Y > 0.2)
67604 {
67605 val2.Y = -0.2;
67606 }
67607 if (val2.Y < -0.2)
67608 {
67609 val2.Y = -0.2;
67610 }
67611 }
67612 int num26 = num4;
67613 num26 += genRand.Next(5);
67614 while (num26 < num5)
67615 {
67616 int num27 = num7;
67617 while ((!Main.tile[num26, num27].active() || Main.tile[num26, num27].type != 0) && num26 < num5)
67618 {
67619 num27--;
67620 if (num27 < num6)
67621 {
67622 num27 = num7;
67623 num26 += genRand.Next(1, 4);
67624 }
67625 }
67626 if (num26 >= num5)
67627 {
67628 continue;
67629 }
67630 num27 += genRand.Next(0, 4);
67631 int num28 = genRand.Next(2, 5);
67632 int num29 = 189;
67633 for (int num30 = num26 - num28; num30 <= num26 + num28; num30++)
67634 {
67635 for (int num31 = num27 - num28; num31 <= num27 + num28; num31++)
67636 {
67637 if (num31 > num6)
67638 {
67639 double num32 = Math.Abs(num30 - num26);
67640 double num33 = Math.Abs(num31 - num27) * 2;
67641 if (Math.Sqrt(num32 * num32 + num33 * num33) < (double)num28)
67642 {
67643 Main.tile[num30, num31].type = (ushort)num29;
67645 }
67646 }
67647 }
67648 }
67649 num26 += genRand.Next(num28, (int)((double)num28 * 1.5));
67650 }
67651 for (int num34 = num4 - 20; num34 <= num5 + 20; num34++)
67652 {
67653 for (int num35 = num6 - 20; num35 <= num7 + 20; num35++)
67654 {
67655 bool flag = true;
67656 for (int num36 = num34 - 1; num36 <= num34 + 1; num36++)
67657 {
67658 for (int num37 = num35 - 1; num37 <= num35 + 1; num37++)
67659 {
67660 if (!Main.tile[num36, num37].active())
67661 {
67662 flag = false;
67663 }
67664 }
67665 }
67666 if (flag)
67667 {
67668 Main.tile[num34, num35].wall = 73;
67670 }
67671 }
67672 }
67673 for (int num38 = num4; num38 <= num5; num38++)
67674 {
67675 int num39;
67676 for (num39 = num6 - 10; !Main.tile[num38, num39 + 1].active(); num39++)
67677 {
67678 }
67679 if (num39 >= num7 || Main.tile[num38, num39 + 1].type != 189)
67680 {
67681 continue;
67682 }
67683 if (genRand.Next(10) == 0)
67684 {
67685 int num40 = genRand.Next(1, 3);
67686 for (int num41 = num38 - num40; num41 <= num38 + num40; num41++)
67687 {
67688 if (Main.tile[num41, num39].type == 189 && WillWaterPlacedHereStayPut(num41, num39))
67689 {
67690 Main.tile[num41, num39].active(active: false);
67691 Main.tile[num41, num39].liquid = byte.MaxValue;
67692 Main.tile[num41, num39].lava(lava: false);
67694 }
67695 if (Main.tile[num41, num39 + 1].type == 189 && WillWaterPlacedHereStayPut(num41, num39 + 1))
67696 {
67697 Main.tile[num41, num39 + 1].active(active: false);
67698 Main.tile[num41, num39 + 1].liquid = byte.MaxValue;
67699 Main.tile[num41, num39 + 1].lava(lava: false);
67701 }
67702 if (num41 > num38 - num40 && num41 < num38 + 2 && Main.tile[num41, num39 + 2].type == 189 && WillWaterPlacedHereStayPut(num41, num39 + 2))
67703 {
67704 Main.tile[num41, num39 + 2].active(active: false);
67705 Main.tile[num41, num39 + 2].liquid = byte.MaxValue;
67706 Main.tile[num41, num39 + 2].lava(lava: false);
67708 }
67709 }
67710 }
67711 if (genRand.Next(5) == 0 && WillWaterPlacedHereStayPut(num38, num39))
67712 {
67713 Main.tile[num38, num39].liquid = byte.MaxValue;
67714 }
67715 Main.tile[num38, num39].lava(lava: false);
67717 }
67718 int num42 = genRand.Next(4);
67719 for (int num43 = 0; num43 <= num42; num43++)
67720 {
67721 int num44 = genRand.Next(num4 - 5, num5 + 5);
67722 int num45 = num6 - genRand.Next(20, 40);
67723 int num46 = genRand.Next(4, 8);
67724 int num47 = 189;
67725 if (genRand.Next(2) == 0)
67726 {
67727 num47 = 460;
67728 }
67729 for (int num48 = num44 - num46; num48 <= num44 + num46; num48++)
67730 {
67731 for (int num49 = num45 - num46; num49 <= num45 + num46; num49++)
67732 {
67733 double num50 = Math.Abs(num48 - num44);
67734 double num51 = Math.Abs(num49 - num45) * 2;
67735 if (Math.Sqrt(num50 * num50 + num51 * num51) < (double)(num46 + genRand.Next(-1, 2)))
67736 {
67737 Main.tile[num48, num49].active(active: true);
67738 Main.tile[num48, num49].type = (ushort)num47;
67740 }
67741 }
67742 }
67743 for (int num52 = num44 - num46 + 2; num52 <= num44 + num46 - 2; num52++)
67744 {
67745 int num53;
67746 for (num53 = num45 - num46; !Main.tile[num52, num53].active(); num53++)
67747 {
67748 }
67750 {
67751 Main.tile[num52, num53].active(active: false);
67752 Main.tile[num52, num53].liquid = byte.MaxValue;
67754 }
67755 }
67756 }
67757 }
static double Sqrt(double d)
static double Abs(double value)
static UnifiedRandom genRand
Definition WorldGen.cs:1215
static void SquareWallFrame(int i, int j, bool resetFrame=true)
static bool WillWaterPlacedHereStayPut(int x, int y)
static void SquareTileFrame(int i, int j, bool resetFrame=true)

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

Referenced by Terraria.WorldGen.GenerateWorld().