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

◆ AI_137_CanHit()

bool Terraria.Projectile.AI_137_CanHit ( Vector2 targetPosition)
inline

Definition at line 77753 of file Projectile.cs.

77754 {
77755 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
77756 //IL_000a: Unknown result type (might be due to invalid IL or missing references)
77757 //IL_001f: Unknown result type (might be due to invalid IL or missing references)
77758 //IL_0024: Unknown result type (might be due to invalid IL or missing references)
77759 //IL_002e: Unknown result type (might be due to invalid IL or missing references)
77760 //IL_0033: Unknown result type (might be due to invalid IL or missing references)
77761 //IL_0038: Unknown result type (might be due to invalid IL or missing references)
77762 //IL_0039: Unknown result type (might be due to invalid IL or missing references)
77763 //IL_003c: Unknown result type (might be due to invalid IL or missing references)
77764 //IL_004b: Unknown result type (might be due to invalid IL or missing references)
77765 //IL_004c: Unknown result type (might be due to invalid IL or missing references)
77766 //IL_004d: Unknown result type (might be due to invalid IL or missing references)
77767 //IL_0052: Unknown result type (might be due to invalid IL or missing references)
77768 //IL_0053: Unknown result type (might be due to invalid IL or missing references)
77769 //IL_0054: Unknown result type (might be due to invalid IL or missing references)
77770 //IL_0059: Unknown result type (might be due to invalid IL or missing references)
77771 //IL_005e: Unknown result type (might be due to invalid IL or missing references)
77772 //IL_005f: Unknown result type (might be due to invalid IL or missing references)
77773 //IL_0060: Unknown result type (might be due to invalid IL or missing references)
77774 //IL_0066: Unknown result type (might be due to invalid IL or missing references)
77775 //IL_006b: Unknown result type (might be due to invalid IL or missing references)
77776 //IL_006d: Unknown result type (might be due to invalid IL or missing references)
77777 //IL_006f: Unknown result type (might be due to invalid IL or missing references)
77778 //IL_007b: Unknown result type (might be due to invalid IL or missing references)
77779 //IL_0081: Unknown result type (might be due to invalid IL or missing references)
77780 //IL_0083: Unknown result type (might be due to invalid IL or missing references)
77781 //IL_008f: Unknown result type (might be due to invalid IL or missing references)
77782 //IL_0099: Unknown result type (might be due to invalid IL or missing references)
77783 //IL_009e: Unknown result type (might be due to invalid IL or missing references)
77784 //IL_00a3: Unknown result type (might be due to invalid IL or missing references)
77785 //IL_00a5: Unknown result type (might be due to invalid IL or missing references)
77786 //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
77787 //IL_00b3: Unknown result type (might be due to invalid IL or missing references)
77788 //IL_00b7: Unknown result type (might be due to invalid IL or missing references)
77789 //IL_00c6: Unknown result type (might be due to invalid IL or missing references)
77790 //IL_00c8: Unknown result type (might be due to invalid IL or missing references)
77791 //IL_00d4: Unknown result type (might be due to invalid IL or missing references)
77792 //IL_00da: Unknown result type (might be due to invalid IL or missing references)
77793 //IL_00dc: Unknown result type (might be due to invalid IL or missing references)
77794 //IL_00e8: Unknown result type (might be due to invalid IL or missing references)
77795 //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
77796 //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
77797 //IL_00fc: Unknown result type (might be due to invalid IL or missing references)
77798 //IL_00fe: Unknown result type (might be due to invalid IL or missing references)
77799 //IL_0101: Unknown result type (might be due to invalid IL or missing references)
77800 //IL_010c: Unknown result type (might be due to invalid IL or missing references)
77801 //IL_0110: Unknown result type (might be due to invalid IL or missing references)
77802 if (WorldGen.SolidTile((int)targetPosition.X / 16, (int)targetPosition.Y / 16))
77803 {
77804 return false;
77805 }
77806 Vector2 vector = base.Top + Vector2.UnitY * 20f;
77807 bool flag = Collision.CanHitLine(vector, 0, 0, targetPosition, 0, 0);
77808 if (!flag)
77809 {
77810 Vector2 v = targetPosition - vector;
77811 Vector2 spinningpoint = v.SafeNormalize(Vector2.UnitY);
77812 Vector2 vector2 = Vector2.Lerp(vector, targetPosition, 0.5f);
77813 Vector2 vector3 = vector2 + spinningpoint.RotatedBy(1.5707963705062866) * ((Vector2)(ref v)).Length() * 0.2f;
77814 if (Collision.CanHitLine(vector, 0, 0, vector3, 0, 0) && Collision.CanHitLine(vector3, 0, 0, targetPosition, 0, 0))
77815 {
77816 flag = true;
77817 }
77818 if (!flag)
77819 {
77820 Vector2 vector4 = vector2 + spinningpoint.RotatedBy(-1.5707963705062866) * ((Vector2)(ref v)).Length() * 0.2f;
77821 if (Collision.CanHitLine(vector, 0, 0, vector4, 0, 0) && Collision.CanHitLine(vector4, 0, 0, targetPosition, 0, 0))
77822 {
77823 flag = true;
77824 }
77825 }
77826 }
77827 return flag;
77828 }

References Terraria.Collision.CanHitLine(), and Terraria.WorldGen.SolidTile().

Referenced by Terraria.Projectile.Colliding().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: