Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ProjectileSmartInteractCandidateProvider.cs
Go to the documentation of this file.
3
5
7{
9 {
11
12 public float DistanceFromCursor { get; private set; }
13
14 public void WinCandidacy()
15 {
16 Main.SmartInteractProj = _projectileIndexToTarget;
17 Main.SmartInteractShowingGenuine = true;
18 }
19
25 }
26
28
30 {
31 Main.SmartInteractProj = -1;
32 }
33
35 {
36 candidate = null;
37 if (!settings.FullInteraction)
38 {
39 return false;
40 }
42 bool flag = false;
43 Vector2 mousevec = settings.mousevec;
44 mousevec.ToPoint();
45 int num = -1;
47 for (int i = 0; i < listOfProjectilesToInteractWithHack.Count; i++)
48 {
50 Projectile projectile = Main.projectile[num2];
51 if (projectile.active)
52 {
53 float num3 = projectile.Hitbox.Distance(mousevec);
54 if (num == -1 || Main.projectile[num].Hitbox.Distance(mousevec) > num3)
55 {
56 num = num2;
58 }
59 if (num3 == 0f)
60 {
61 flag = true;
62 num = num2;
64 break;
65 }
66 }
67 }
68 if (settings.DemandOnlyZeroDistanceTargets && !flag)
69 {
70 return false;
71 }
72 if (num != -1)
73 {
76 return true;
77 }
78 return false;
79 }
80}
Rectangle Hitbox
Definition Entity.cs:164
bool ProvideCandidate(SmartInteractScanSettings settings, out ISmartInteractCandidate candidate)
static Projectile[] projectile
Definition Main.cs:1691
List< int > GetListOfProjectilesToInteractWithHack()
Definition Player.cs:29669