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

◆ WetCollision()

static bool Terraria.Collision.WetCollision ( Vector2 Position,
int Width,
int Height )
inlinestatic

Definition at line 1685 of file Collision.cs.

1686 {
1687 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
1688 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
1689 //IL_003e: Unknown result type (might be due to invalid IL or missing references)
1690 //IL_0049: Unknown result type (might be due to invalid IL or missing references)
1691 //IL_0059: Unknown result type (might be due to invalid IL or missing references)
1692 //IL_0068: Unknown result type (might be due to invalid IL or missing references)
1693 //IL_007b: Unknown result type (might be due to invalid IL or missing references)
1694 //IL_008c: Unknown result type (might be due to invalid IL or missing references)
1695 //IL_00e0: Unknown result type (might be due to invalid IL or missing references)
1696 //IL_0197: Unknown result type (might be due to invalid IL or missing references)
1697 //IL_01a0: Unknown result type (might be due to invalid IL or missing references)
1698 //IL_01ac: Unknown result type (might be due to invalid IL or missing references)
1699 //IL_01b2: Unknown result type (might be due to invalid IL or missing references)
1700 //IL_01c4: Unknown result type (might be due to invalid IL or missing references)
1701 //IL_01cd: Unknown result type (might be due to invalid IL or missing references)
1702 //IL_01d9: Unknown result type (might be due to invalid IL or missing references)
1703 //IL_01df: Unknown result type (might be due to invalid IL or missing references)
1704 //IL_02c8: Unknown result type (might be due to invalid IL or missing references)
1705 //IL_02d1: Unknown result type (might be due to invalid IL or missing references)
1706 //IL_02dd: Unknown result type (might be due to invalid IL or missing references)
1707 //IL_02e3: Unknown result type (might be due to invalid IL or missing references)
1708 //IL_02f2: Unknown result type (might be due to invalid IL or missing references)
1709 //IL_02fb: Unknown result type (might be due to invalid IL or missing references)
1710 //IL_0304: Unknown result type (might be due to invalid IL or missing references)
1711 //IL_030a: Unknown result type (might be due to invalid IL or missing references)
1712 honey = false;
1713 shimmer = false;
1714 Vector2 vector = default(Vector2);
1715 ((Vector2)(ref vector))._002Ector(Position.X + (float)(Width / 2), Position.Y + (float)(Height / 2));
1716 int num = 10;
1717 int num2 = Height / 2;
1718 if (num > Width)
1719 {
1720 num = Width;
1721 }
1722 if (num2 > Height)
1723 {
1724 num2 = Height;
1725 }
1726 ((Vector2)(ref vector))._002Ector(vector.X - (float)(num / 2), vector.Y - (float)(num2 / 2));
1727 int value5 = (int)(Position.X / 16f) - 1;
1728 int value2 = (int)((Position.X + (float)Width) / 16f) + 2;
1729 int value3 = (int)(Position.Y / 16f) - 1;
1730 int value4 = (int)((Position.Y + (float)Height) / 16f) + 2;
1731 int num6 = Utils.Clamp(value5, 0, Main.maxTilesX - 1);
1732 value2 = Utils.Clamp(value2, 0, Main.maxTilesX - 1);
1733 value3 = Utils.Clamp(value3, 0, Main.maxTilesY - 1);
1734 value4 = Utils.Clamp(value4, 0, Main.maxTilesY - 1);
1735 Vector2 vector2 = default(Vector2);
1736 for (int i = num6; i < value2; i++)
1737 {
1738 for (int j = value3; j < value4; j++)
1739 {
1740 if (Main.tile[i, j] == null)
1741 {
1742 continue;
1743 }
1744 if (Main.tile[i, j].liquid > 0)
1745 {
1746 vector2.X = i * 16;
1747 vector2.Y = j * 16;
1748 int num3 = 16;
1749 float num4 = 256 - Main.tile[i, j].liquid;
1750 num4 /= 32f;
1751 vector2.Y += num4 * 2f;
1752 num3 -= (int)(num4 * 2f);
1753 if (vector.X + (float)num > vector2.X && vector.X < vector2.X + 16f && vector.Y + (float)num2 > vector2.Y && vector.Y < vector2.Y + (float)num3)
1754 {
1755 if (Main.tile[i, j].honey())
1756 {
1757 honey = true;
1758 }
1759 if (Main.tile[i, j].shimmer())
1760 {
1761 shimmer = true;
1762 }
1763 return true;
1764 }
1765 }
1766 else
1767 {
1768 if (!Main.tile[i, j].active() || Main.tile[i, j].slope() == 0 || j <= 0 || Main.tile[i, j - 1] == null || Main.tile[i, j - 1].liquid <= 0)
1769 {
1770 continue;
1771 }
1772 vector2.X = i * 16;
1773 vector2.Y = j * 16;
1774 int num5 = 16;
1775 if (vector.X + (float)num > vector2.X && vector.X < vector2.X + 16f && vector.Y + (float)num2 > vector2.Y && vector.Y < vector2.Y + (float)num5)
1776 {
1777 if (Main.tile[i, j - 1].honey())
1778 {
1779 honey = true;
1780 }
1781 else if (Main.tile[i, j - 1].shimmer())
1782 {
1783 shimmer = true;
1784 }
1785 return true;
1786 }
1787 }
1788 }
1789 }
1790 return false;
1791 }
static bool honey
Definition Collision.cs:24
static bool shimmer
Definition Collision.cs:26

References Terraria.Collision.honey, Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Collision.shimmer, and Terraria.Main.tile.

Referenced by Terraria.NPC.AI_007_TownEntities(), Terraria.Projectile.AI_145_BookStaffStorm(), Terraria.Player.CheckForGoodTeleportationSpot(), Terraria.NPC.Collision_WaterCollision(), Terraria.GameContent.Shaders.WaterShaderData.DrawWaves(), Terraria.MessageBuffer.GetData(), Terraria.GameContent.ShimmerHelper.IsSpotShimmerFree(), Terraria.Item.MoveInWorld(), Terraria.Dust.NewDust(), Terraria.Item.NewItem_Inner(), Terraria.NPC.NewNPC(), Terraria.Projectile.NewProjectile(), Terraria.Player.ShimmerUnstuck(), Terraria.Player.SporeSac(), Terraria.Gore.Update(), Terraria.Rain.Update(), Terraria.Player.Update(), Terraria.Projectile.Update(), Terraria.Dust.UpdateDust(), and Terraria.NPC.UpdateNPC_Inner().

+ Here is the caller graph for this function: