70677 {
70679 {
70681 {
70683 steps = (int)((
double)steps * (1.0 + (double)
genRand.Next(-80, 81) * 0.01));
70684 }
70686 {
70688 }
70690 {
70693 }
70694 }
70696 double num2 = steps;
70697 Vector2D
vector2D =
default(Vector2D);
70698 vector2D.X = i;
70700 Vector2D
vector2D2 =
default(Vector2D);
70701 vector2D2.X = (double)
genRand.Next(-10, 11) * 0.1;
70702 vector2D2.Y = (double)
genRand.Next(-10, 11) * 0.1;
70704 {
70707 }
70708 bool flag = type == 368;
70709 bool flag2 = type == 367;
70710 bool lava = false;
70712 {
70713 lava = true;
70714 }
70715 while (
num > 0.0 &&
num2 > 0.0)
70716 {
70718 {
70719 vector2D.X += (double)
genRand.Next(-100, 101) * 0.05;
70720 vector2D.Y += (double)
genRand.Next(-100, 101) * 0.05;
70721 }
70723 {
70725 }
70733 {
70735 }
70736 if (
num4 > Main.maxTilesX - 1)
70737 {
70738 num4 = Main.maxTilesX - 1;
70739 }
70741 {
70743 }
70744 if (
num6 > Main.maxTilesY - 1)
70745 {
70746 num6 = Main.maxTilesY - 1;
70747 }
70749 {
70751 {
70752 lava = false;
70753 }
70755 {
70757 {
70758 continue;
70759 }
70761 {
70763 {
70764 if (Main.tile[
k,
l - 1].wall != 64 && Main.tile[
k,
l + 1].wall != 64 && Main.tile[
k - 1,
l].wall != 64 && Main.tile[
k + 1,
l].wall != 64)
70765 {
70767 }
70768 }
70769 else if (Main.tile[
k,
l - 1].wall != 15 && Main.tile[
k,
l + 1].wall != 15 && Main.tile[
k - 1,
l].wall != 15 && Main.tile[
k + 1,
l].wall != 15)
70770 {
70772 }
70773 }
70774 if (type < 0)
70775 {
70776 if (Main.tile[
k,
l].type == 53)
70777 {
70778 continue;
70779 }
70781 {
70782 Main.tile[
k,
l].liquid =
byte.MaxValue;
70783 Main.tile[
k,
l].lava(lava);
70785 {
70787 {
70788 Main.tile[
k,
l].lava(lava:
true);
70789 }
70790 }
70792 {
70793 Main.tile[
k,
l].lava(lava:
true);
70794 }
70795 }
70796 Main.tile[
k,
l].active(active:
false);
70797 continue;
70798 }
70800 {
70802 }
70804 {
70806 }
70808 {
70809 Tile tile = Main.tile[
k,
l];
70810 bool flag3 =
false;
70811 flag3 = Main.tileStone[type] && tile.type != 1;
70813 {
70815 }
70816 switch (tile.type)
70817 {
70818 case 53:
70820 {
70822 }
70823 if (type == 40)
70824 {
70826 }
70827 if ((
double)
l < Main.worldSurface && type != 59)
70828 {
70830 }
70831 break;
70832 case 45:
70833 case 147:
70834 case 189:
70835 case 190:
70836 case 196:
70837 case 460:
70839 break;
70840 case 396:
70841 case 397:
70843 break;
70844 case 1:
70845 if (type == 59 && (
double)
l < Main.worldSurface + (
double)
genRand.Next(-50, 50))
70846 {
70848 }
70849 break;
70850 case 367:
70851 case 368:
70852 if (type == 59)
70853 {
70855 }
70856 break;
70857 }
70859 {
70860 tile.type = (ushort)type;
70861 }
70862 }
70863 if (addTile)
70864 {
70865 Main.tile[
k,
l].active(active:
true);
70866 Main.tile[
k,
l].liquid = 0;
70867 Main.tile[
k,
l].lava(lava:
false);
70868 }
70869 if (
noYChange && (
double)
l < Main.worldSurface && type != 59)
70870 {
70871 Main.tile[
k,
l].wall = 2;
70872 }
70874 {
70875 Main.tile[
k,
l].lava(lava:
false);
70876 Main.tile[
k,
l].liquid = 0;
70877 }
70878 }
70879 }
70882 {
70885 vector2D2.Y += (double)
genRand.Next(-10, 11) * 0.05;
70886 vector2D2.X += (double)
genRand.Next(-10, 11) * 0.05;
70888 {
70891 vector2D2.Y += (double)
genRand.Next(-10, 11) * 0.05;
70892 vector2D2.X += (double)
genRand.Next(-10, 11) * 0.05;
70894 {
70897 vector2D2.Y += (double)
genRand.Next(-10, 11) * 0.05;
70898 vector2D2.X += (double)
genRand.Next(-10, 11) * 0.05;
70900 {
70903 vector2D2.Y += (double)
genRand.Next(-10, 11) * 0.05;
70904 vector2D2.X += (double)
genRand.Next(-10, 11) * 0.05;
70906 {
70909 vector2D2.Y += (double)
genRand.Next(-10, 11) * 0.05;
70910 vector2D2.X += (double)
genRand.Next(-10, 11) * 0.05;
70912 {
70915 vector2D2.Y += (double)
genRand.Next(-10, 11) * 0.05;
70916 vector2D2.X += (double)
genRand.Next(-10, 11) * 0.05;
70918 {
70921 vector2D2.Y += (double)
genRand.Next(-10, 11) * 0.05;
70922 vector2D2.X += (double)
genRand.Next(-10, 11) * 0.05;
70924 {
70927 vector2D2.Y += (double)
genRand.Next(-10, 11) * 0.05;
70928 vector2D2.X += (double)
genRand.Next(-10, 11) * 0.05;
70930 {
70933 vector2D2.Y += (double)
genRand.Next(-10, 11) * 0.05;
70934 vector2D2.X += (double)
genRand.Next(-10, 11) * 0.05;
70936 {
70939 vector2D2.Y += (double)
genRand.Next(-10, 11) * 0.05;
70940 vector2D2.X += (double)
genRand.Next(-10, 11) * 0.05;
70942 {
70945 vector2D2.Y += (double)
genRand.Next(-10, 11) * 0.05;
70946 vector2D2.X += (double)
genRand.Next(-10, 11) * 0.05;
70948 {
70951 vector2D2.Y += (double)
genRand.Next(-10, 11) * 0.05;
70952 vector2D2.X += (double)
genRand.Next(-10, 11) * 0.05;
70953 }
70954 }
70955 }
70956 }
70957 }
70958 }
70959 }
70960 }
70961 }
70962 }
70963 }
70964 }
70965 vector2D2.X += (double)
genRand.Next(-10, 11) * 0.05;
70967 {
70968 vector2D2.X += (double)
genRand.Next(-10, 11) * 0.25;
70969 }
70971 {
70972 vector2D2.X = 1.0;
70973 }
70975 {
70976 vector2D2.X = -1.0;
70977 }
70979 {
70980 vector2D2.Y += (double)
genRand.Next(-10, 11) * 0.05;
70982 {
70983 vector2D2.Y = 1.0;
70984 }
70986 {
70987 vector2D2.Y = -1.0;
70988 }
70989 }
70990 else if (type != 59 &&
num < 3.0)
70991 {
70993 {
70994 vector2D2.Y = 1.0;
70995 }
70997 {
70998 vector2D2.Y = -1.0;
70999 }
71000 }
71002 {
71004 {
71005 vector2D2.Y = 0.5;
71006 }
71008 {
71009 vector2D2.Y = -0.5;
71010 }
71011 if (
vector2D.Y < Main.rockLayer + 100.0)
71012 {
71013 vector2D2.Y = 1.0;
71014 }
71015 if (
vector2D.Y > (
double)(Main.maxTilesY - 300))
71016 {
71017 vector2D2.Y = -1.0;
71018 }
71019 }
71020 }
71021 }
static bool[] Ore
Indicates that the tile is an ore. Used in worldgen code for various purposes and by Fairies.
static bool[] CanBeClearedDuringGeneration
static Rectangle UndergroundDesertLocation
static bool remixWorldGen
static UnifiedRandom genRand
static bool oceanDepths(int x, int y)
static readonly int beachDistance
static void PlaceWall(int i, int j, int type, bool mute=false)
static bool drunkWorldGen
static bool getGoodWorldGen