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

◆ AI_019_Spears_GetExtensionHitbox()

bool Terraria.Projectile.AI_019_Spears_GetExtensionHitbox ( out Rectangle extensionBox)
inline

Definition at line 48890 of file Projectile.cs.

48891 {
48892 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
48893 //IL_00df: Unknown result type (might be due to invalid IL or missing references)
48894 //IL_00ec: Unknown result type (might be due to invalid IL or missing references)
48895 //IL_00f3: Unknown result type (might be due to invalid IL or missing references)
48896 //IL_00fa: Unknown result type (might be due to invalid IL or missing references)
48897 //IL_00ff: Unknown result type (might be due to invalid IL or missing references)
48898 //IL_0104: Unknown result type (might be due to invalid IL or missing references)
48899 //IL_0107: Unknown result type (might be due to invalid IL or missing references)
48900 //IL_010d: Unknown result type (might be due to invalid IL or missing references)
48901 //IL_0112: Unknown result type (might be due to invalid IL or missing references)
48902 //IL_0117: Unknown result type (might be due to invalid IL or missing references)
48903 extensionBox = default(Rectangle);
48904 Player player = Main.player[owner];
48905 if (player.itemAnimation < player.itemAnimationMax / 3)
48906 {
48907 return false;
48908 }
48909 int itemAnimationMax = player.itemAnimationMax;
48910 int itemAnimation = player.itemAnimation;
48911 int num = player.itemAnimationMax / 3;
48912 float num2 = Utils.Remap(itemAnimation, itemAnimationMax, num, 0f, 1f);
48913 float num3 = 10f;
48914 float num4 = 30f;
48915 float num5 = 10f;
48916 float num6 = 10f;
48917 switch (type)
48918 {
48919 default:
48920 return false;
48921 case 105:
48922 num4 = 50f;
48923 num6 = 20f;
48924 break;
48925 case 46:
48926 num4 = 50f;
48927 num6 = 15f;
48928 break;
48929 case 153:
48930 num4 = 40f;
48931 num6 = 10f;
48932 break;
48933 }
48934 num4 *= 1f / player.inverseMeleeSpeed;
48935 float num7 = num3 + num4 * num2;
48936 float num8 = num5 + num6 * num2;
48937 float f = velocity.ToRotation();
48938 Vector2 center = base.Center + f.ToRotationVector2() * num7;
48939 extensionBox = Utils.CenteredRectangle(center, new Vector2(num8, num8));
48940 return true;
48941 }
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...

References Terraria.Utils.CenteredRectangle(), Terraria.Player.inverseMeleeSpeed, Terraria.Player.itemAnimation, Terraria.Player.itemAnimationMax, Terraria.Main.player, and Terraria.Utils.Remap().

Referenced by Terraria.Projectile.Colliding(), and Terraria.Projectile.CutTiles().

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