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

◆ PlotTileTale()

static bool Terraria.Utils.PlotTileTale ( Vector2D start,
Vector2D end,
double width,
TileActionAttempt plot )
inlinestatic

Definition at line 1712 of file Utils.cs.

1713 {
1714 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
1715 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
1716 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
1717 //IL_0027: Unknown result type (might be due to invalid IL or missing references)
1718 //IL_002c: Unknown result type (might be due to invalid IL or missing references)
1719 //IL_0031: Unknown result type (might be due to invalid IL or missing references)
1720 //IL_0032: Unknown result type (might be due to invalid IL or missing references)
1721 //IL_003a: Unknown result type (might be due to invalid IL or missing references)
1722 //IL_003f: Unknown result type (might be due to invalid IL or missing references)
1723 //IL_0041: Unknown result type (might be due to invalid IL or missing references)
1724 //IL_0048: Unknown result type (might be due to invalid IL or missing references)
1725 //IL_004e: Unknown result type (might be due to invalid IL or missing references)
1726 //IL_0053: Unknown result type (might be due to invalid IL or missing references)
1727 //IL_005a: Unknown result type (might be due to invalid IL or missing references)
1728 //IL_0069: Unknown result type (might be due to invalid IL or missing references)
1729 double halfWidth = width / 2.0;
1730 Vector2D val = end - start;
1731 Vector2D val2 = val / ((Vector2D)(ref val)).Length();
1732 Vector2D perpOffset = new Vector2D(0.0 - val2.Y, val2.X);
1733 Point pointStart = start.ToTileCoordinates();
1734 Point point = end.ToTileCoordinates();
1735 int length = 0;
1736 PlotLine(pointStart.X, pointStart.Y, point.X, point.Y, delegate
1737 {
1738 length++;
1739 return true;
1740 });
1741 length--;
1742 int curLength = 0;
1743 return PlotLine(pointStart.X, pointStart.Y, point.X, point.Y, delegate(int x, int y)
1744 {
1745 //IL_002d: Unknown result type (might be due to invalid IL or missing references)
1746 //IL_0033: Unknown result type (might be due to invalid IL or missing references)
1747 //IL_003e: Unknown result type (might be due to invalid IL or missing references)
1748 //IL_0044: Unknown result type (might be due to invalid IL or missing references)
1749 //IL_0049: Unknown result type (might be due to invalid IL or missing references)
1750 //IL_0055: Unknown result type (might be due to invalid IL or missing references)
1751 //IL_005b: Unknown result type (might be due to invalid IL or missing references)
1752 //IL_0066: Unknown result type (might be due to invalid IL or missing references)
1753 //IL_006c: Unknown result type (might be due to invalid IL or missing references)
1754 //IL_0071: Unknown result type (might be due to invalid IL or missing references)
1755 double num = 1.0 - (double)curLength / (double)length;
1756 curLength++;
1759 Point point4 = new Point(point2.X - pointStart.X, point2.Y - pointStart.Y);
1760 Point point5 = new Point(point3.X - pointStart.X, point3.Y - pointStart.Y);
1761 return PlotLine(x + point4.X, y + point4.Y, x + point5.X, y + point5.Y, plot, jump: false);
1762 });
1763 }
static Point ToTileCoordinates(this Vector2 vec)
Definition Utils.cs:1248
static bool PlotLine(Point16 p0, Point16 p1, TileActionAttempt plot, bool jump=true)
Definition Utils.cs:1566

References System.length, Terraria.Utils.PlotLine(), Microsoft.Xna.Framework.Graphics.Point, System.start, Terraria.Utils.ToTileCoordinates(), Microsoft.Xna.Framework.Point.X, and Microsoft.Xna.Framework.Point.Y.

Referenced by Terraria.WorldBuilding.Shapes.Tail.Perform().