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

◆ AI_066_TryInterceptingTarget()

void Terraria.Projectile.AI_066_TryInterceptingTarget ( Vector2 targetDir,
Vector2 targetVelocity,
float speed )
inlineprivate

Definition at line 43620 of file Projectile.cs.

43621 {
43622 //IL_003f: Unknown result type (might be due to invalid IL or missing references)
43623 //IL_0042: Unknown result type (might be due to invalid IL or missing references)
43624 //IL_0047: Unknown result type (might be due to invalid IL or missing references)
43625 //IL_0056: Unknown result type (might be due to invalid IL or missing references)
43626 //IL_005c: Unknown result type (might be due to invalid IL or missing references)
43627 //IL_005d: Unknown result type (might be due to invalid IL or missing references)
43628 //IL_007b: Unknown result type (might be due to invalid IL or missing references)
43629 //IL_0080: Unknown result type (might be due to invalid IL or missing references)
43630 float num = 5f;
43631 float num2 = 30f;
43632 float num3 = num2 + num;
43633 int num4 = 1;
43634 int num5 = 4;
43635 int num6 = 2;
43636 bool flag = false;
43637 if (type == 533)
43638 {
43639 num4 = 2;
43640 }
43641 if (type == 388)
43642 {
43643 num4 = 2;
43644 num2 = 40f;
43645 }
43646 targetVelocity /= (float)num4;
43647 for (float num7 = 1f; num7 <= 1.5f; num7 += 0.1f)
43648 {
43649 Utils.ChaseResults chaseResults = Utils.GetChaseResults(base.Center, speed, targetDir, targetVelocity);
43650 if (chaseResults.InterceptionHappens && chaseResults.InterceptionTime <= num3)
43651 {
43652 velocity = chaseResults.ChaserVelocity;
43653 if (flag)
43654 {
43655 int num8 = (int)Utils.Clamp((float)Math.Ceiling(chaseResults.InterceptionTime) + (float)num6, num5, num2 - 1f) / num4;
43656 float num9 = num2 / (float)num4 - (float)num8;
43657 ai[1] += num9 * (float)num4;
43658 }
43659 break;
43660 }
43661 }
43662 }
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...

References Terraria.Utils.GetChaseResults().

+ Here is the call graph for this function: