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

◆ UpdateNPC_UpdateTrails()

void Terraria.NPC.UpdateNPC_UpdateTrails ( )
inlineprivate

Definition at line 107578 of file NPC.cs.

107579 {
107580 //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
107581 //IL_00b3: Unknown result type (might be due to invalid IL or missing references)
107582 //IL_00c8: Unknown result type (might be due to invalid IL or missing references)
107583 //IL_00ce: Unknown result type (might be due to invalid IL or missing references)
107584 //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
107585 //IL_00d8: Unknown result type (might be due to invalid IL or missing references)
107586 //IL_0049: Unknown result type (might be due to invalid IL or missing references)
107587 //IL_004e: Unknown result type (might be due to invalid IL or missing references)
107588 //IL_0063: Unknown result type (might be due to invalid IL or missing references)
107589 //IL_0069: Unknown result type (might be due to invalid IL or missing references)
107590 //IL_006e: Unknown result type (might be due to invalid IL or missing references)
107591 //IL_0073: Unknown result type (might be due to invalid IL or missing references)
107592 //IL_01e6: Unknown result type (might be due to invalid IL or missing references)
107593 //IL_01eb: Unknown result type (might be due to invalid IL or missing references)
107594 //IL_0217: Unknown result type (might be due to invalid IL or missing references)
107595 //IL_021d: Unknown result type (might be due to invalid IL or missing references)
107596 //IL_0222: Unknown result type (might be due to invalid IL or missing references)
107597 //IL_0227: Unknown result type (might be due to invalid IL or missing references)
107598 //IL_012b: Unknown result type (might be due to invalid IL or missing references)
107599 //IL_0130: Unknown result type (might be due to invalid IL or missing references)
107600 //IL_0157: Unknown result type (might be due to invalid IL or missing references)
107601 //IL_015d: Unknown result type (might be due to invalid IL or missing references)
107602 //IL_0162: Unknown result type (might be due to invalid IL or missing references)
107603 //IL_0167: Unknown result type (might be due to invalid IL or missing references)
107604 //IL_0273: Unknown result type (might be due to invalid IL or missing references)
107605 //IL_0278: Unknown result type (might be due to invalid IL or missing references)
107606 //IL_02c2: Unknown result type (might be due to invalid IL or missing references)
107607 //IL_02c8: Unknown result type (might be due to invalid IL or missing references)
107608 //IL_02cd: Unknown result type (might be due to invalid IL or missing references)
107609 //IL_02d2: Unknown result type (might be due to invalid IL or missing references)
107610 //IL_02f8: Unknown result type (might be due to invalid IL or missing references)
107611 //IL_02fd: Unknown result type (might be due to invalid IL or missing references)
107612 //IL_0315: Unknown result type (might be due to invalid IL or missing references)
107613 //IL_031b: Unknown result type (might be due to invalid IL or missing references)
107614 //IL_0320: Unknown result type (might be due to invalid IL or missing references)
107615 //IL_0325: Unknown result type (might be due to invalid IL or missing references)
107616 //IL_034b: Unknown result type (might be due to invalid IL or missing references)
107617 //IL_0350: Unknown result type (might be due to invalid IL or missing references)
107618 //IL_0368: Unknown result type (might be due to invalid IL or missing references)
107619 //IL_036e: Unknown result type (might be due to invalid IL or missing references)
107620 //IL_0373: Unknown result type (might be due to invalid IL or missing references)
107621 //IL_0378: Unknown result type (might be due to invalid IL or missing references)
107622 //IL_039e: Unknown result type (might be due to invalid IL or missing references)
107623 //IL_03a3: Unknown result type (might be due to invalid IL or missing references)
107624 //IL_03cf: Unknown result type (might be due to invalid IL or missing references)
107625 //IL_03d5: Unknown result type (might be due to invalid IL or missing references)
107626 //IL_03da: Unknown result type (might be due to invalid IL or missing references)
107627 //IL_03df: Unknown result type (might be due to invalid IL or missing references)
107628 //IL_0193: Unknown result type (might be due to invalid IL or missing references)
107629 //IL_0199: Unknown result type (might be due to invalid IL or missing references)
107630 //IL_019e: Unknown result type (might be due to invalid IL or missing references)
107631 //IL_01a3: Unknown result type (might be due to invalid IL or missing references)
107632 int num = NPCID.Sets.TrailingMode[type];
107633 if (num == 0)
107634 {
107635 if (localAI[3] <= 0f)
107636 {
107637 localAI[3] = 2f;
107638 for (int num3 = oldPos.Length - 1; num3 > 0; num3--)
107639 {
107640 oldPos[num3] = oldPos[num3 - 1];
107641 }
107642 oldPos[0] = position + netOffset;
107643 }
107644 localAI[3] -= 1f;
107645 }
107646 if (num == 1)
107647 {
107648 for (int num4 = oldPos.Length - 1; num4 > 0; num4--)
107649 {
107650 oldPos[num4] = oldPos[num4 - 1];
107651 }
107652 oldPos[0] = position + netOffset;
107653 }
107654 if (num == 2)
107655 {
107656 if ((int)ai[0] == 4 || ai[0] == 5f || ai[0] == 6f)
107657 {
107658 for (int num5 = oldPos.Length - 1; num5 > 0; num5--)
107659 {
107660 oldPos[num5] = oldPos[num5 - 1];
107661 oldRot[num5] = oldRot[num5 - 1];
107662 }
107663 oldPos[0] = position + netOffset;
107664 oldRot[0] = rotation;
107665 }
107666 else
107667 {
107668 for (int num6 = oldPos.Length - 1; num6 >= 0; num6--)
107669 {
107671 oldRot[num6] = rotation;
107672 }
107673 }
107674 }
107675 if (num == 3)
107676 {
107677 for (int num7 = oldPos.Length - 1; num7 > 0; num7--)
107678 {
107679 oldPos[num7] = oldPos[num7 - 1];
107680 oldRot[num7] = oldRot[num7 - 1];
107681 }
107682 oldPos[0] = position + netOffset;
107683 oldRot[0] = rotation;
107684 }
107685 switch (num)
107686 {
107687 case 4:
107688 {
107689 for (int num10 = oldPos.Length - 1; num10 > 0; num10--)
107690 {
107691 oldPos[num10] = oldPos[num10 - 1];
107692 Lighting.AddLight((int)position.X / 16, (int)position.Y / 16, 0.3f, 0f, 0.2f);
107693 }
107694 oldPos[0] = position + netOffset;
107695 break;
107696 }
107697 case 5:
107698 {
107699 for (int num9 = oldPos.Length - 1; num9 > 0; num9--)
107700 {
107701 oldPos[num9] = oldPos[num9 - 1];
107702 }
107703 oldPos[0] = position + netOffset;
107704 break;
107705 }
107706 case 6:
107707 {
107708 for (int num2 = oldPos.Length - 1; num2 > 0; num2--)
107709 {
107710 oldPos[num2] = oldPos[num2 - 1];
107711 }
107712 oldPos[0] = position + netOffset;
107713 break;
107714 }
107715 case 7:
107716 {
107717 for (int num8 = oldPos.Length - 1; num8 > 0; num8--)
107718 {
107719 oldPos[num8] = oldPos[num8 - 1];
107720 oldRot[num8] = oldRot[num8 - 1];
107721 }
107722 oldPos[0] = position + netOffset;
107723 oldRot[0] = rotation;
107724 break;
107725 }
107726 }
107727 }
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
static int[] TrailingMode
If != -1 for a given NPC type (F:Terraria.NPC.type), then that NPC will store its past positions (and...
Definition NPCID.cs:277
Vector2 netOffset
Definition NPC.cs:502
float[] localAI
Acts like F:Terraria.NPC.ai, but does not sync to the server. Many vanilla T:Terraria....
Definition NPC.cs:1003
float[] oldRot
Definition NPC.cs:582
float[] ai
An array with 4 slots used for any sort of data storage, which is occasionally synced from the server...
Definition NPC.cs:997
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....
Definition NPC.cs:990
float rotation
Definition NPC.cs:1116
Vector2[] oldPos
Definition NPC.cs:580

References Terraria.Lighting.AddLight(), and Terraria.ID.NPCID.Sets.TrailingMode.

+ Here is the call graph for this function: