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

◆ CheckOasisPlant()

static void Terraria.WorldGen.CheckOasisPlant ( int i,
int j,
int type = 530 )
inlinestatic

Definition at line 38889 of file WorldGen.cs.

38890 {
38891 if (destroyObject)
38892 {
38893 return;
38894 }
38895 bool flag = false;
38896 int num = j;
38897 Tile tileSafely = Framing.GetTileSafely(i, j);
38898 int num2 = tileSafely.frameY % 36;
38899 num += num2 / 18 * -1;
38900 int num3 = tileSafely.frameX / 18;
38901 int num4 = 0;
38902 _ = Framing.GetTileSafely(num3, num).frameY / 36;
38903 while (num3 > 2)
38904 {
38905 num3 -= 3;
38906 num4++;
38907 }
38908 num3 = i - num3;
38909 int num5 = num4 * 54;
38910 for (int k = num3; k < num3 + 3; k++)
38911 {
38912 for (int l = num; l < num + 2; l++)
38913 {
38914 if (Main.tile[k, l] == null)
38915 {
38916 Main.tile[k, l] = new Tile();
38917 }
38918 if (!Main.tile[k, l].active() || Main.tile[k, l].type != type || Main.tile[k, l].frameX != (k - num3) * 18 + num5 || Main.tile[k, l].frameY != (l - num) * 18)
38919 {
38920 flag = true;
38921 }
38922 }
38923 if (Main.tile[k, num + 2] == null)
38924 {
38925 Main.tile[k, num + 2] = new Tile();
38926 }
38927 if (!SolidTile(k, num + 2) || !TileID.Sets.Conversion.Sand[Main.tile[k, num + 2].type])
38928 {
38929 flag = true;
38930 }
38931 }
38932 if (!flag)
38933 {
38934 return;
38935 }
38936 _ = Main.tile[i, j].frameX;
38937 destroyObject = true;
38938 for (int m = num3; m < num3 + 3; m++)
38939 {
38940 for (int n = num; n < num + 2; n++)
38941 {
38942 if (Main.tile[m, n] == null)
38943 {
38944 Main.tile[m, n] = new Tile();
38945 }
38946 if (Main.tile[m, n].type == type && Main.tile[m, n].active())
38947 {
38948 KillTile(m, n);
38949 }
38950 }
38951 }
38952 destroyObject = false;
38953 for (int num6 = num3 - 1; num6 < num3 + 4; num6++)
38954 {
38955 for (int num7 = num - 1; num7 < num + 3; num7++)
38956 {
38958 }
38959 }
38960 }
static bool destroyObject
Definition WorldGen.cs:1020
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static void TileFrame(int i, int j, bool resetFrame=false, bool noBreak=false)

References Terraria.Framing.GetTileSafely(), Terraria.ID.TileID.Sets.Conversion.Sand, Terraria.Enums.SolidTile, Terraria.DataStructures.Tile, Terraria.Main.tile, and System.type.