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

◆ PaintTheLivingTrees()

static void Terraria.WorldGen.PaintTheLivingTrees ( byte livingTreePaintColor,
byte livingTreeWallPaintColor )
inlinestaticprivate

Definition at line 17170 of file WorldGen.cs.

17171 {
17172 for (int i = 0; i < Main.maxTilesX; i++)
17173 {
17174 for (int j = 0; j < Main.maxTilesY; j++)
17175 {
17176 Tile tile = Main.tile[i, j];
17177 if (tile.active())
17178 {
17179 if (tile.wall == 244)
17180 {
17181 tile.color(livingTreePaintColor);
17182 }
17183 else if (tile.type == 192 || tile.type == 191)
17184 {
17185 tile.color(livingTreePaintColor);
17186 }
17187 else if (tile.type == 52 || tile.type == 382)
17188 {
17189 int x = i;
17190 int y = j;
17191 GetVineTop(i, j, out x, out y);
17192 if (Main.tile[x, y].type == 192)
17193 {
17194 tile.color(livingTreePaintColor);
17195 }
17196 }
17197 else if (tile.type == 187)
17198 {
17199 Tile tile2 = tile;
17200 int num = 0;
17201 while (tile2.type == 187)
17202 {
17203 num++;
17204 tile2 = Main.tile[i, j + num];
17205 }
17206 if (tile2.type == 192)
17207 {
17208 tile.color(livingTreePaintColor);
17209 }
17210 }
17211 }
17212 if (tile.wall == 244)
17213 {
17214 tile.wallColor(livingTreeWallPaintColor);
17215 }
17216 }
17217 }
17218 }
static void GetVineTop(int i, int j, out int x, out int y)

References Terraria.Tile.active(), Terraria.Tile.color(), Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Main.tile, Terraria.Tile.type, Terraria.Tile.wall, and Terraria.Tile.wallColor().