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

◆ ConvertSkyIslands()

static void Terraria.WorldGen.ConvertSkyIslands ( int convertType,
bool growTrees )
inlinestaticprivate

Definition at line 17220 of file WorldGen.cs.

17221 {
17222 int num = 0;
17223 for (int i = 20; (double)i < Main.worldSurface; i++)
17224 {
17225 for (int j = 20; j < Main.maxTilesX - 20; j++)
17226 {
17227 Tile tile = Main.tile[j, i];
17228 if (tile.active() && TileID.Sets.Clouds[tile.type])
17229 {
17230 num = i;
17231 break;
17232 }
17233 }
17234 }
17235 for (int k = 20; k <= Main.maxTilesX - 20; k++)
17236 {
17237 for (int l = 20; l < num; l++)
17238 {
17239 Tile tile2 = Main.tile[k, l];
17240 Tile tile3 = Main.tile[k, l - 1];
17241 if (tile2.active() && tile2.type == 2)
17242 {
17243 if (tile3.type == 596 || tile3.type == 616)
17244 {
17245 KillTile(k, l - 1);
17246 }
17247 Convert(k, l, convertType, 1);
17248 ushort type = tile3.type;
17249 if ((uint)(type - 82) <= 1u || (uint)(type - 185) <= 2u || type == 227)
17250 {
17251 KillTile(k, l - 1);
17252 }
17253 if (growTrees && _genRand.Next(3) == 0)
17254 {
17255 GrowTree(k, l);
17256 }
17257 }
17258 }
17259 }
17260 }
static bool[] Clouds
Definition TileID.cs:125
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static void Convert(int i, int j, int conversionType, int size=4)
static UnifiedRandom _genRand
Definition WorldGen.cs:1011
static bool GrowTree(int i, int y)

References Terraria.Tile.active(), Terraria.ID.TileID.Sets.Clouds, Terraria.Main.tile, System.type, Terraria.Tile.type, and Terraria.Main.worldSurface.