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

◆ ValidateShot()

static bool Terraria.GameContent.Golf.GolfHelper.ValidateShot ( Entity golfBall,
Player player,
ref Vector2 shotVector )
inlinestatic

Definition at line 670 of file GolfHelper.cs.

671 {
672 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
673 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
674 //IL_000c: Unknown result type (might be due to invalid IL or missing references)
675 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
676 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
677 //IL_0073: Unknown result type (might be due to invalid IL or missing references)
678 //IL_0078: Unknown result type (might be due to invalid IL or missing references)
679 //IL_007d: Unknown result type (might be due to invalid IL or missing references)
680 //IL_00b1: Unknown result type (might be due to invalid IL or missing references)
681 //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
682 //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
683 //IL_00d8: Unknown result type (might be due to invalid IL or missing references)
684 //IL_00e5: Unknown result type (might be due to invalid IL or missing references)
685 //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
686 //IL_00ff: Unknown result type (might be due to invalid IL or missing references)
687 Vector2 vector = golfBall.Center - player.Bottom;
688 if (player.direction == -1)
689 {
690 vector.X *= -1f;
691 shotVector.X *= -1f;
692 }
693 float num = shotVector.ToRotation();
694 if (num > 0f)
695 {
696 shotVector = ((Vector2)(ref shotVector)).Length() * new Vector2((float)Math.Cos(0.0), (float)Math.Sin(0.0));
697 }
698 else if (num < -1.5207964f)
699 {
700 shotVector = ((Vector2)(ref shotVector)).Length() * new Vector2((float)Math.Cos(-1.5207964181900024), (float)Math.Sin(-1.5207964181900024));
701 }
702 if (player.direction == -1)
703 {
704 shotVector.X *= -1f;
705 }
706 if (vector.X >= -16f && vector.X <= 32f && vector.Y <= 16f)
707 {
708 return vector.Y >= -16f;
709 }
710 return false;
711 }

References Terraria.Entity.Bottom, and Terraria.Entity.direction.

Referenced by Terraria.Projectile.AI_150_GolfClubHelper(), Terraria.Main.DrawProj_DrawNormalProjs(), and Terraria.GameContent.Golf.GolfHelper.FindGolfBallForHelper().

+ Here is the caller graph for this function: