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

◆ AI_164_GetHomeLocation()

static Vector2 Terraria.Projectile.AI_164_GetHomeLocation ( Player master,
int stackedIndex,
int totalIndexes )
inlinestatic

Definition at line 49505 of file Projectile.cs.

49506 {
49507 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
49508 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
49509 //IL_0106: Unknown result type (might be due to invalid IL or missing references)
49510 //IL_0118: Unknown result type (might be due to invalid IL or missing references)
49511 //IL_011e: Unknown result type (might be due to invalid IL or missing references)
49512 //IL_0120: Unknown result type (might be due to invalid IL or missing references)
49513 //IL_0125: Unknown result type (might be due to invalid IL or missing references)
49514 //IL_0127: Unknown result type (might be due to invalid IL or missing references)
49515 //IL_0128: Unknown result type (might be due to invalid IL or missing references)
49516 //IL_013b: Unknown result type (might be due to invalid IL or missing references)
49517 //IL_0140: Unknown result type (might be due to invalid IL or missing references)
49518 //IL_0145: Unknown result type (might be due to invalid IL or missing references)
49519 //IL_014a: Unknown result type (might be due to invalid IL or missing references)
49520 //IL_014c: Unknown result type (might be due to invalid IL or missing references)
49521 //IL_0169: Unknown result type (might be due to invalid IL or missing references)
49522 //IL_016e: Unknown result type (might be due to invalid IL or missing references)
49523 //IL_0173: Unknown result type (might be due to invalid IL or missing references)
49524 //IL_0174: Unknown result type (might be due to invalid IL or missing references)
49525 //IL_0179: Unknown result type (might be due to invalid IL or missing references)
49526 //IL_018c: Unknown result type (might be due to invalid IL or missing references)
49527 //IL_018e: Unknown result type (might be due to invalid IL or missing references)
49528 int num = master.bodyFrame.Height;
49529 if (num == 0)
49530 {
49531 num = 1;
49532 }
49533 Vector2 vector = Main.OffsetsPlayerHeadgear[master.bodyFrame.Y / num];
49534 vector.Y -= 2f;
49535 float num2 = master.miscCounterNormalized * 2f;
49536 int num3 = stackedIndex / 4;
49537 int num4 = totalIndexes / 4;
49538 if (totalIndexes % 4 > 0)
49539 {
49540 num4++;
49541 }
49542 int num5 = (totalIndexes - num3 * 4) % 4;
49543 if (num5 == 0)
49544 {
49545 num5 = 4;
49546 }
49547 if (num4 - 1 != num3)
49548 {
49549 num5 = 4;
49550 }
49551 int num6 = stackedIndex % num5;
49552 float num7 = (float)num6 / (float)num5;
49553 num2 += (float)num3 / 8f;
49554 if (stackedIndex >= (num4 - 1) * 4 && num3 > 0)
49555 {
49556 num2 = 0f;
49557 switch (num5)
49558 {
49559 case 1:
49560 num7 = 0f;
49561 break;
49562 case 2:
49563 num7 = 0.25f + (float)num6 * 0.5f;
49564 break;
49565 case 3:
49566 num7 = (float)(num6 - 1) / 6f;
49567 break;
49568 case 4:
49569 num7 = ((float)num6 - 1.5f) / 6f;
49570 break;
49571 }
49572 }
49573 Vector2 vector2 = Utils.RotatedBy(new Vector2(0f, (float)(-8 - 12 * num3)), (num2 + num7) * ((float)Math.PI * 2f));
49574 vector += vector2 + new Vector2(0f, master.gravDir * -40f);
49575 Vector2 mountedCenter = master.MountedCenter;
49576 _ = master.direction;
49577 Vector2 vec = mountedCenter + new Vector2(0f, master.gravDir * -21f) + vector;
49578 vec.Y += master.gfxOffY;
49579 return vec.Floor();
49580 }

References Terraria.Player.bodyFrame, Terraria.Entity.direction, Terraria.Player.gfxOffY, Terraria.Player.gravDir, Terraria.Player.MountedCenter, Terraria.Main.OffsetsPlayerHeadgear, and Terraria.Utils.RotatedBy().

+ Here is the call graph for this function: