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

◆ PlaceDye()

static void Terraria.WorldGen.PlaceDye ( int x,
int y,
int style )
inlinestatic

Definition at line 45609 of file WorldGen.cs.

45610 {
45611 bool flag = false;
45612 if (Main.tile[x, y + 1] == null || Main.tile[x, y - 1] == null)
45613 {
45614 return;
45615 }
45616 if (style == 7)
45617 {
45618 if (Main.tile[x, y + 1].active() && Main.tile[x, y + 1].type != 3 && Main.tile[x, y + 1].type != 51 && Main.tile[x, y + 1].type != 61 && Main.tile[x, y + 1].type != 73 && Main.tile[x, y + 1].type != 74 && Main.tile[x, y + 1].type != 184)
45619 {
45620 return;
45621 }
45622 if (SolidTile(x, y - 1) && !Main.tile[x, y + 1].active())
45623 {
45624 flag = true;
45625 }
45626 }
45627 else
45628 {
45629 if (Main.tile[x, y - 1].active() && Main.tile[x, y - 1].type != 3 && Main.tile[x, y - 1].type != 51 && Main.tile[x, y - 1].type != 61 && Main.tile[x, y - 1].type != 73 && Main.tile[x, y - 1].type != 74 && Main.tile[x, y - 1].type != 184)
45630 {
45631 return;
45632 }
45633 if (style == 6)
45634 {
45635 if (Main.tile[x, y + 1].nactive() && Main.tile[x, y + 1].type == 80 && !Main.tile[x - 1, y + 1].active() && !Main.tile[x + 1, y + 1].active())
45636 {
45637 flag = true;
45638 }
45639 }
45640 else if (SolidTile(x, y + 1) && !Main.tile[x, y - 1].active())
45641 {
45642 switch (style)
45643 {
45644 case 5:
45645 if (Main.tile[x, y].liquid == byte.MaxValue && !Main.tile[x, y].lava() && !Main.tile[x, y].honey() && !Main.tile[x, y].shimmer())
45646 {
45647 flag = true;
45648 }
45649 break;
45650 case 8:
45651 case 9:
45652 case 10:
45653 case 11:
45654 flag = true;
45655 break;
45656 default:
45657 if (Main.tile[x, y].liquid != 0)
45658 {
45659 break;
45660 }
45661 if (style == 3 || style == 4)
45662 {
45663 if (Main.tile[x, y].wall == 0)
45664 {
45665 flag = true;
45666 }
45667 }
45668 else
45669 {
45670 flag = true;
45671 }
45672 break;
45673 }
45674 }
45675 }
45676 if (flag)
45677 {
45678 Main.tile[x, y].type = 227;
45679 Main.tile[x, y].active(active: true);
45680 Main.tile[x, y].halfBrick(halfBrick: false);
45681 Main.tile[x, y].slope(0);
45682 Main.tile[x, y].frameY = 0;
45683 Main.tile[x, y].frameX = (short)(34 * style);
45684 }
45685 }

References Terraria.Enums.SolidTile, and Terraria.Main.tile.