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

◆ InInteractionRange()

bool Terraria.Player.InInteractionRange ( int interactX,
int interactY,
TileReachCheckSettings settings )
inline

Definition at line 29768 of file Player.cs.

29769 {
29770 //IL_008f: Unknown result type (might be due to invalid IL or missing references)
29771 //IL_0094: Unknown result type (might be due to invalid IL or missing references)
29772 //IL_0099: Unknown result type (might be due to invalid IL or missing references)
29773 //IL_009c: Unknown result type (might be due to invalid IL or missing references)
29774 //IL_00a1: Unknown result type (might be due to invalid IL or missing references)
29775 //IL_00a6: Unknown result type (might be due to invalid IL or missing references)
29776 //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
29777 //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
29778 //IL_00c4: Unknown result type (might be due to invalid IL or missing references)
29779 //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
29780 int num = (int)(((double)position.X + (double)width * 0.5) / 16.0);
29781 int num2 = (int)(((double)position.Y + (double)height * 0.5) / 16.0);
29782 Tile tile = Main.tile[interactX, interactY];
29783 settings.GetRanges(this, out var x, out var y);
29784 if (tile.type == 597)
29785 {
29786 if (interactX < num)
29787 {
29788 interactX += 2;
29789 }
29790 if (interactY < num2)
29791 {
29792 interactY += 3;
29793 }
29794 Point point = position.ToTileCoordinates();
29795 Point point2 = base.BottomRight.ToTileCoordinates();
29796 if (point2.X >= interactX - x + 1 && point.X <= interactX + x - 1 && point2.Y >= interactY - y + 2)
29797 {
29798 return point.Y <= interactY + y - 1;
29799 }
29800 return false;
29801 }
29802 if (tile.type == 475)
29803 {
29804 if (num >= interactX - x - 1 && num <= interactX + x + 2 && num2 >= interactY - y - 1)
29805 {
29806 return num2 <= interactY + y + 2;
29807 }
29808 return false;
29809 }
29810 if (tile.type == 470)
29811 {
29812 if (num >= interactX - x - 1 && num <= interactX + x + 1 && num2 >= interactY - y - 1)
29813 {
29814 return num2 <= interactY + y + 2;
29815 }
29816 return false;
29817 }
29819 {
29820 return num2 <= interactY + y + 1;
29821 }
29822 return false;
29823 }
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51

References Terraria.Entity.height, Terraria.Entity.position, Terraria.Main.tile, Terraria.Tile.type, and Terraria.Entity.width.

Referenced by Terraria.GameContent.TeleportPylonsSystem.HandleTeleportRequest(), Terraria.GameContent.Tile_Entities.TEDisplayDoll.OnPlayerUpdate(), and Terraria.GameContent.Tile_Entities.TEHatRack.OnPlayerUpdate().

+ Here is the caller graph for this function: