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

◆ neonMossBiome()

static void Terraria.WorldGen.neonMossBiome ( int i,
int j,
int maxY = 99999 )
inlinestatic

Definition at line 5889 of file WorldGen.cs.

5890 {
5891 //IL_005c: Unknown result type (might be due to invalid IL or missing references)
5892 //IL_007f: Unknown result type (might be due to invalid IL or missing references)
5893 //IL_0089: Unknown result type (might be due to invalid IL or missing references)
5894 //IL_008e: Unknown result type (might be due to invalid IL or missing references)
5895 //IL_010f: Unknown result type (might be due to invalid IL or missing references)
5896 //IL_011a: Unknown result type (might be due to invalid IL or missing references)
5897 //IL_0125: Unknown result type (might be due to invalid IL or missing references)
5898 //IL_0130: Unknown result type (might be due to invalid IL or missing references)
5899 //IL_01c1: Unknown result type (might be due to invalid IL or missing references)
5900 //IL_018c: Unknown result type (might be due to invalid IL or missing references)
5901 //IL_01ea: Unknown result type (might be due to invalid IL or missing references)
5902 //IL_0328: Unknown result type (might be due to invalid IL or missing references)
5903 //IL_0329: Unknown result type (might be due to invalid IL or missing references)
5904 //IL_032a: Unknown result type (might be due to invalid IL or missing references)
5905 //IL_032f: Unknown result type (might be due to invalid IL or missing references)
5906 //IL_0384: Unknown result type (might be due to invalid IL or missing references)
5907 //IL_03a8: Unknown result type (might be due to invalid IL or missing references)
5908 //IL_024c: Unknown result type (might be due to invalid IL or missing references)
5909 //IL_025b: Unknown result type (might be due to invalid IL or missing references)
5910 //IL_0267: Unknown result type (might be due to invalid IL or missing references)
5911 //IL_026c: Unknown result type (might be due to invalid IL or missing references)
5912 Vector2D val = default(Vector2D);
5913 val.X = i;
5914 val.Y = j;
5915 Vector2D val2 = default(Vector2D);
5916 val2.X = genRand.NextDouble() * 4.0 - 2.0;
5917 val2.Y = genRand.NextDouble() * 4.0 - 2.0;
5918 if (val2.X == 0.0)
5919 {
5920 val2.X = 1.0;
5921 }
5922 while (((Vector2D)(ref val2)).Length() < 4.0)
5923 {
5924 val2 *= 1.5;
5925 }
5926 double num = genRand.Next(60, 80);
5927 double num2 = genRand.Next(30, 40);
5928 double num3 = (double)Main.maxTilesX / 4200.0;
5929 if (getGoodWorldGen)
5930 {
5931 num3 *= 1.5;
5932 }
5933 num *= num3;
5934 num2 *= num3;
5935 while (num2 > 0.0)
5936 {
5937 num *= 0.98;
5938 num2 -= 1.0;
5939 int num4 = (int)(val.X - num);
5940 int num5 = (int)(val.X + num);
5941 int num6 = (int)(val.Y - num);
5942 int num7 = (int)(val.Y + num);
5943 if (num4 < 1)
5944 {
5945 num4 = 1;
5946 }
5947 if (num5 > Main.maxTilesX - 1)
5948 {
5949 num5 = Main.maxTilesX - 1;
5950 }
5951 if (num6 < 1)
5952 {
5953 num6 = 1;
5954 }
5955 if (num7 > Main.maxTilesY - 1)
5956 {
5957 num7 = Main.maxTilesY - 1;
5958 }
5959 if (Main.remixWorld)
5960 {
5961 if ((double)num6 < Main.worldSurface)
5962 {
5963 num6 = (int)Main.worldSurface;
5964 if (val2.Y < 5.0)
5965 {
5966 val2.Y = 5.0;
5967 }
5968 }
5969 }
5970 else if ((double)num6 < Main.rockLayer)
5971 {
5972 num6 = (int)Main.rockLayer;
5973 if (val2.Y < 5.0)
5974 {
5975 val2.Y = 5.0;
5976 }
5977 }
5978 if (num7 > maxY)
5979 {
5980 num7 = maxY;
5981 if (val2.Y > -5.0)
5982 {
5983 val2.Y = -5.0;
5984 }
5985 }
5986 double num8 = num * (1.0 + genRand.NextDouble() * 0.4 - 0.2);
5987 for (int k = num4; k < num5; k++)
5988 {
5989 for (int l = num6; l < num7; l++)
5990 {
5991 Vector2D val3 = new Vector2D(Math.Abs((double)k - val.X), Math.Abs((double)l - val.Y));
5992 if (((Vector2D)(ref val3)).Length() < num8 * 0.8 && TileType(k, l) == 1 && (!Main.tile[k - 1, l].active() || !Main.tile[k + 1, l].active() || !Main.tile[k, l - 1].active() || !Main.tile[k, l + 1].active()))
5993 {
5994 SpreadGrass(k - 1, l, 1, neonMossType);
5995 }
5996 }
5997 }
5998 val += val2;
5999 val2.X += genRand.NextDouble() * 4.0 - 2.0;
6000 val2.Y += genRand.NextDouble() * 4.0 - 2.0;
6001 val2.Y = Utils.Clamp(val2.Y, -10.0, 10.0);
6002 val2.X = Utils.Clamp(val2.X, -10.0, 10.0);
6003 }
6004 }
static double Abs(double value)
static int TileType(int x, int y)
static UnifiedRandom genRand
Definition WorldGen.cs:1215
static ushort neonMossType
Definition WorldGen.cs:1130
static void SpreadGrass(int i, int j, int dirt=0, int grass=2, bool repeat=true, TileColorCache color=default(TileColorCache))
static bool getGoodWorldGen
Definition WorldGen.cs:1156

References System.Math.Abs(), Terraria.WorldGen.genRand, Terraria.WorldGen.getGoodWorldGen, Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.WorldGen.neonMossType, Terraria.Main.remixWorld, Terraria.Main.rockLayer, Terraria.WorldGen.SpreadGrass(), Terraria.Main.tile, Terraria.WorldGen.TileType(), Terraria.Main.worldSurface, ReLogic.Utilities.Vector2D.X, and ReLogic.Utilities.Vector2D.Y.