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

◆ AI_005_EaterOfSouls()

void Terraria.NPC.AI_005_EaterOfSouls ( )
inlineprivate

Definition at line 43476 of file NPC.cs.

43477 {
43478 if (type == 210 || type == 211)
43479 {
43481 }
43482 else if (target < 0 || target <= 255 || Main.player[target].dead)
43483 {
43484 TargetClosest();
43485 }
43486 if (type == 619)
43487 {
43488 if (Main.dayTime)
43489 {
43490 velocity.Y -= 0.3f;
43491 EncourageDespawn(60);
43492 }
43494 if (alpha == 255)
43495 {
43497 velocity.Y = -6f;
43498 for (int i = 0; i < 35; i++)
43499 {
43500 Dust dust = Dust.NewDustDirect(position, width, height, 5);
43501 dust.velocity *= 1f;
43502 dust.scale = 1f + Main.rand.NextFloat() * 0.5f;
43503 dust.fadeIn = 1.5f + Main.rand.NextFloat() * 0.5f;
43504 dust.velocity += velocity * 0.5f;
43505 }
43506 }
43507 alpha -= 15;
43508 if (alpha < 0)
43509 {
43510 alpha = 0;
43511 }
43512 if (alpha != 0)
43513 {
43514 for (int j = 0; j < 2; j++)
43515 {
43516 Dust dust2 = Dust.NewDustDirect(position, width, height, 5);
43517 dust2.velocity *= 1f;
43518 dust2.scale = 1f + Main.rand.NextFloat() * 0.5f;
43519 dust2.fadeIn = 1.5f + Main.rand.NextFloat() * 0.5f;
43520 dust2.velocity += velocity * 0.3f;
43521 }
43522 }
43524 }
43526 bool flag = false;
43527 if (targetData.Type == NPCTargetType.Player)
43528 {
43529 flag = Main.player[target].dead;
43530 }
43531 float num = 6f;
43532 float num2 = 0.05f;
43533 if (type == 6 || type == 173)
43534 {
43535 num = 4f;
43536 num2 = 0.02f;
43537 if (type == 6 && Main.expertMode)
43538 {
43539 num2 = 0.035f;
43540 }
43541 if (Main.remixWorld)
43542 {
43543 num2 = 0.06f;
43544 num = 5f;
43545 }
43546 }
43547 else if (type == 94)
43548 {
43549 num = 4.2f;
43550 num2 = 0.022f;
43551 }
43552 else if (type == 619)
43553 {
43554 num = 6f;
43555 num2 = 0.1f;
43556 }
43557 else if (type == 252)
43558 {
43559 if (targetData.Type != 0 && Collision.CanHit(this, targetData))
43560 {
43561 num = 6f;
43562 num2 = 0.1f;
43563 }
43564 else
43565 {
43566 num2 = 0.01f;
43567 num = 2f;
43568 }
43569 }
43570 else if (type == 42 || (type >= 231 && type <= 235))
43571 {
43572 num = 3.5f;
43573 num2 = 0.021f;
43574 if (type == 231)
43575 {
43576 num = 3f;
43577 num2 = 0.017f;
43578 }
43579 num *= 1f - scale;
43580 num2 *= 1f - scale;
43581 if ((double)(position.Y / 16f) < Main.worldSurface)
43582 {
43583 if (Main.player[target].position.Y - position.Y > 300f && velocity.Y < 0f)
43584 {
43585 velocity.Y *= 0.97f;
43586 }
43587 if (Main.player[target].position.Y - position.Y < 80f && velocity.Y > 0f)
43588 {
43589 velocity.Y *= 0.97f;
43590 }
43591 }
43592 }
43593 else if (type == 205)
43594 {
43595 num = 3.25f;
43596 num2 = 0.018f;
43597 }
43598 else if (type == 176)
43599 {
43600 num = 4f;
43601 num2 = 0.017f;
43602 }
43603 else if (type == 23)
43604 {
43605 num = 1f;
43606 num2 = 0.03f;
43607 }
43608 else if (type == 5)
43609 {
43610 num = 5f;
43611 num2 = 0.03f;
43612 }
43613 else if (type == 210 || type == 211)
43614 {
43615 ai[1] += 1f;
43616 float num3 = (ai[1] - 60f) / 60f;
43617 if (num3 > 1f)
43618 {
43619 num3 = 1f;
43620 }
43621 else
43622 {
43623 if (velocity.X > 6f)
43624 {
43625 velocity.X = 6f;
43626 }
43627 if (velocity.X < -6f)
43628 {
43629 velocity.X = -6f;
43630 }
43631 if (velocity.Y > 6f)
43632 {
43633 velocity.Y = 6f;
43634 }
43635 if (velocity.Y < -6f)
43636 {
43637 velocity.Y = -6f;
43638 }
43639 }
43640 num = 5f;
43641 num2 = 0.1f;
43642 num2 *= num3;
43643 }
43644 else if (type == 139 && Main.zenithWorld)
43645 {
43646 num = 3f;
43647 }
43648 Vector2 vector = new Vector2(position.X + (float)width * 0.5f, position.Y + (float)height * 0.5f);
43649 float num4 = targetData.Position.X + (float)(targetData.Width / 2);
43650 float num5 = targetData.Position.Y + (float)(targetData.Height / 2);
43651 num4 = (int)(num4 / 8f) * 8;
43652 num5 = (int)(num5 / 8f) * 8;
43653 vector.X = (int)(vector.X / 8f) * 8;
43654 vector.Y = (int)(vector.Y / 8f) * 8;
43655 num4 -= vector.X;
43656 num5 -= vector.Y;
43657 float num6 = (float)Math.Sqrt(num4 * num4 + num5 * num5);
43658 float num7 = num6;
43659 bool flag2 = false;
43660 if (num6 > 600f)
43661 {
43662 flag2 = true;
43663 }
43664 if (num6 == 0f)
43665 {
43666 num4 = velocity.X;
43667 num5 = velocity.Y;
43668 }
43669 else
43670 {
43671 num6 = num / num6;
43672 num4 *= num6;
43673 num5 *= num6;
43674 }
43675 bool num8 = type == 6 || type == 139 || type == 173 || type == 205;
43676 bool flag3 = type == 42 || type == 94 || type == 619 || type == 176 || type == 210 || type == 211 || (type >= 231 && type <= 235);
43677 bool flag4 = type != 173 && type != 6 && type != 42 && (type < 231 || type > 235) && type != 94 && type != 139 && type != 619;
43678 if (num8 || flag3)
43679 {
43680 if (num7 > 100f || flag3)
43681 {
43682 ai[0] += 1f;
43683 if (ai[0] > 0f)
43684 {
43685 velocity.Y += 0.023f;
43686 }
43687 else
43688 {
43689 velocity.Y -= 0.023f;
43690 }
43691 if (ai[0] < -100f || ai[0] > 100f)
43692 {
43693 velocity.X += 0.023f;
43694 }
43695 else
43696 {
43697 velocity.X -= 0.023f;
43698 }
43699 if (ai[0] > 200f)
43700 {
43701 ai[0] = -200f;
43702 }
43703 }
43704 if (num7 < 150f && (type == 6 || type == 94 || type == 173 || type == 619))
43705 {
43706 velocity.X += num4 * 0.007f;
43707 velocity.Y += num5 * 0.007f;
43708 }
43709 }
43710 if (flag)
43711 {
43712 num4 = (float)direction * num / 2f;
43713 num5 = (0f - num) / 2f;
43714 }
43715 else if (type == 619 && base.Center.Y > targetData.Center.Y - 200f)
43716 {
43717 velocity.Y -= 0.3f;
43718 }
43719 if (type == 139 && ai[3] != 0f)
43720 {
43721 if (IsMechQueenUp)
43722 {
43723 NPC nPC = Main.npc[mechQueen];
43724 Vector2 vector2 = new Vector2(26f * ai[3], 0f);
43725 int num9 = (int)ai[2];
43726 if (num9 < 0 || num9 >= 200)
43727 {
43728 num9 = FindFirstNPC(134);
43729 ai[2] = num9;
43730 netUpdate = true;
43731 }
43732 if (num9 > -1)
43733 {
43734 NPC nPC2 = Main.npc[num9];
43735 if (!nPC2.active || nPC2.type != 134)
43736 {
43737 dontTakeDamage = false;
43738 if (ai[3] > 0f)
43739 {
43740 netUpdate = true;
43741 }
43742 ai[3] = 0f;
43743 }
43744 else
43745 {
43746 Vector2 spinningpoint = nPC2.Center + vector2;
43747 spinningpoint = spinningpoint.RotatedBy(nPC2.rotation, nPC2.Center);
43748 base.Center = spinningpoint;
43749 velocity = nPC.velocity;
43750 dontTakeDamage = true;
43751 }
43752 }
43753 else
43754 {
43755 dontTakeDamage = false;
43756 if (ai[3] > 0f)
43757 {
43758 netUpdate = true;
43759 }
43760 ai[3] = 0f;
43761 }
43762 }
43763 else
43764 {
43765 dontTakeDamage = false;
43766 if (ai[3] > 0f)
43767 {
43768 netUpdate = true;
43769 }
43770 ai[3] = 0f;
43771 }
43772 }
43773 else
43774 {
43775 if (type == 139)
43776 {
43777 dontTakeDamage = false;
43778 }
43779 if (velocity.X < num4)
43780 {
43781 velocity.X += num2;
43782 if (flag4 && velocity.X < 0f && num4 > 0f)
43783 {
43784 velocity.X += num2;
43785 }
43786 }
43787 else if (velocity.X > num4)
43788 {
43789 velocity.X -= num2;
43790 if (flag4 && velocity.X > 0f && num4 < 0f)
43791 {
43792 velocity.X -= num2;
43793 }
43794 }
43795 if (velocity.Y < num5)
43796 {
43797 velocity.Y += num2;
43798 if (flag4 && velocity.Y < 0f && num5 > 0f)
43799 {
43800 velocity.Y += num2;
43801 }
43802 }
43803 else if (velocity.Y > num5)
43804 {
43805 velocity.Y -= num2;
43806 if (flag4 && velocity.Y > 0f && num5 < 0f)
43807 {
43808 velocity.Y -= num2;
43809 }
43810 }
43811 }
43812 if (type == 23)
43813 {
43814 if (num4 > 0f)
43815 {
43816 spriteDirection = 1;
43817 rotation = (float)Math.Atan2(num5, num4);
43818 }
43819 else if (num4 < 0f)
43820 {
43821 spriteDirection = -1;
43822 rotation = (float)Math.Atan2(num5, num4) + 3.14f;
43823 }
43824 }
43825 else if (type == 139)
43826 {
43827 localAI[0] += 1f;
43828 if (ai[3] != 0f)
43829 {
43830 localAI[0] += 2f;
43831 }
43832 if (justHit)
43833 {
43834 localAI[0] = 0f;
43835 }
43836 float num10 = 120f;
43837 if (IsMechQueenUp)
43838 {
43839 num10 = 360f;
43840 }
43841 if (Main.netMode != 1 && localAI[0] >= num10)
43842 {
43843 localAI[0] = 0f;
43844 if (targetData.Type != 0 && Collision.CanHit(this, targetData))
43845 {
43847 int num11 = 84;
43849 if (IsMechQueenUp)
43850 {
43851 Vector2 v = targetData.Center - base.Center - targetData.Velocity * 20f;
43852 float num12 = 8f;
43853 vector3 = v.SafeNormalize(Vector2.UnitY) * num12;
43854 }
43855 Projectile.NewProjectile(GetSpawnSource_ForProjectile(), vector.X, vector.Y, vector3.X, vector3.Y, num11, attackDamage_ForProjectiles, 0f, Main.myPlayer);
43856 }
43857 }
43858 int num13 = (int)position.X + width / 2;
43859 int num14 = (int)position.Y + height / 2;
43860 num13 /= 16;
43861 num14 /= 16;
43862 if (WorldGen.InWorld(num13, num14) && !WorldGen.SolidTile(num13, num14))
43863 {
43864 Lighting.AddLight((int)((position.X + (float)(width / 2)) / 16f), (int)((position.Y + (float)(height / 2)) / 16f), 0.3f, 0.1f, 0.05f);
43865 }
43866 if (num4 > 0f)
43867 {
43868 spriteDirection = 1;
43869 rotation = (float)Math.Atan2(num5, num4);
43870 }
43871 if (num4 < 0f)
43872 {
43873 spriteDirection = -1;
43874 rotation = (float)Math.Atan2(num5, num4) + 3.14f;
43875 }
43876 }
43877 else if (type == 6 || type == 94 || type == 173 || type == 619)
43878 {
43879 rotation = (float)Math.Atan2(num5, num4) - 1.57f;
43880 }
43881 else if (type == 42 || type == 176 || type == 205 || (type >= 231 && type <= 235))
43882 {
43883 if (velocity.X > 0f)
43884 {
43885 spriteDirection = 1;
43886 }
43887 if (velocity.X < 0f)
43888 {
43889 spriteDirection = -1;
43890 }
43891 rotation = velocity.X * 0.1f;
43892 }
43893 else
43894 {
43895 rotation = (float)Math.Atan2(velocity.Y, velocity.X) - 1.57f;
43896 }
43897 if (type == 6 || type == 619 || type == 23 || type == 42 || type == 94 || type == 139 || type == 173 || type == 176 || type == 205 || type == 210 || type == 211 || (type >= 231 && type <= 235))
43898 {
43899 float num15 = 0.7f;
43900 if (type == 6 || type == 173)
43901 {
43902 num15 = 0.4f;
43903 }
43904 if (collideX)
43905 {
43906 netUpdate = true;
43907 velocity.X = oldVelocity.X * (0f - num15);
43908 if (direction == -1 && velocity.X > 0f && velocity.X < 2f)
43909 {
43910 velocity.X = 2f;
43911 }
43912 if (direction == 1 && velocity.X < 0f && velocity.X > -2f)
43913 {
43914 velocity.X = -2f;
43915 }
43916 }
43917 if (collideY)
43918 {
43919 netUpdate = true;
43920 velocity.Y = oldVelocity.Y * (0f - num15);
43921 if (velocity.Y > 0f && (double)velocity.Y < 1.5)
43922 {
43923 velocity.Y = 2f;
43924 }
43925 if (velocity.Y < 0f && (double)velocity.Y > -1.5)
43926 {
43927 velocity.Y = -2f;
43928 }
43929 }
43931 if (type == 619)
43932 {
43933 int num16 = Dust.NewDust(position, width, height, 5, velocity.X * 0.2f, velocity.Y * 0.2f, 100);
43934 Main.dust[num16].velocity *= 0.5f;
43935 }
43936 else if (type != 42 && type != 139 && type != 176 && type != 205 && type != 210 && type != 211 && type != 252 && (type < 231 || type > 235) && Main.rand.Next(20) == 0)
43937 {
43938 int num17 = 18;
43939 if (type == 173)
43940 {
43941 num17 = 5;
43942 }
43943 int num18 = Dust.NewDust(new Vector2(position.X, position.Y + (float)height * 0.25f), width, (int)((float)height * 0.5f), num17, velocity.X, 2f, 75, color, scale);
43944 Main.dust[num18].velocity.X *= 0.5f;
43945 Main.dust[num18].velocity.Y *= 0.1f;
43946 }
43948 }
43949 else if (type != 252 && Main.rand.Next(40) == 0)
43950 {
43951 int num19 = Dust.NewDust(new Vector2(position.X, position.Y + (float)height * 0.25f), width, (int)((float)height * 0.5f), 5, velocity.X, 2f);
43952 Main.dust[num19].velocity.X *= 0.5f;
43953 Main.dust[num19].velocity.Y *= 0.1f;
43954 }
43955 if ((type == 6 || type == 94 || type == 173 || type == 619) && wet)
43956 {
43957 if (velocity.Y > 0f)
43958 {
43959 velocity.Y *= 0.95f;
43960 }
43961 velocity.Y -= 0.3f;
43962 if (velocity.Y < -2f)
43963 {
43964 velocity.Y = -2f;
43965 }
43966 }
43967 if (type == 205 && wet)
43968 {
43969 if (velocity.Y > 0f)
43970 {
43971 velocity.Y *= 0.95f;
43972 }
43973 velocity.Y -= 0.5f;
43974 if (velocity.Y < -4f)
43975 {
43976 velocity.Y = -4f;
43977 }
43978 TargetClosest();
43979 }
43980 if (type == 42 || type == 176 || (type >= 231 && type <= 235))
43981 {
43982 if (wet)
43983 {
43984 if (velocity.Y > 0f)
43985 {
43986 velocity.Y *= 0.95f;
43987 }
43988 velocity.Y -= 0.5f;
43989 if (velocity.Y < -4f)
43990 {
43991 velocity.Y = -4f;
43992 }
43993 TargetClosest();
43994 }
43995 if (ai[1] == 101f)
43996 {
43998 ai[1] = 0f;
43999 }
44000 if (Main.netMode != 1)
44001 {
44002 ai[1] += (float)Main.rand.Next(5, 20) * 0.1f * scale;
44003 if (type == 176)
44004 {
44005 ai[1] += (float)Main.rand.Next(5, 20) * 0.1f * scale;
44006 }
44007 if (Main.getGoodWorld)
44008 {
44009 ai[1] += (float)Main.rand.Next(5, 20) * 0.1f * scale;
44010 }
44011 if (targetData.Type == NPCTargetType.Player)
44012 {
44013 Player player = Main.player[target];
44014 if (player != null && player.stealth == 0f && player.itemAnimation == 0)
44015 {
44016 ai[1] = 0f;
44017 }
44018 }
44019 if (ai[1] >= 130f)
44020 {
44021 if (targetData.Type != 0 && Collision.CanHit(this, targetData))
44022 {
44023 float num20 = 8f;
44024 Vector2 vector4 = new Vector2(position.X + (float)width * 0.5f, position.Y + (float)(height / 2));
44025 float num21 = targetData.Center.X - vector4.X + (float)Main.rand.Next(-20, 21);
44026 float num22 = targetData.Center.Y - vector4.Y + (float)Main.rand.Next(-20, 21);
44027 if ((num21 < 0f && velocity.X < 0f) || (num21 > 0f && velocity.X > 0f))
44028 {
44029 float num23 = (float)Math.Sqrt(num21 * num21 + num22 * num22);
44030 num23 = num20 / num23;
44031 num21 *= num23;
44032 num22 *= num23;
44033 int num24 = (int)(10f * scale);
44034 if (type == 176)
44035 {
44036 num24 = (int)(30f * scale);
44037 }
44038 int num25 = 55;
44039 int num26 = Projectile.NewProjectile(GetSpawnSource_ForProjectile(), vector4.X, vector4.Y, num21, num22, num25, num24, 0f, Main.myPlayer);
44040 Main.projectile[num26].timeLeft = 300;
44041 ai[1] = 101f;
44042 netUpdate = true;
44043 }
44044 else
44045 {
44046 ai[1] = 0f;
44047 }
44048 }
44049 else
44050 {
44051 ai[1] = 0f;
44052 }
44053 }
44054 }
44055 }
44056 if (type == 139 && flag2)
44057 {
44058 if ((velocity.X > 0f && num4 > 0f) || (velocity.X < 0f && num4 < 0f))
44059 {
44060 int num27 = 12;
44061 if (IsMechQueenUp)
44062 {
44063 num27 = 5;
44064 }
44065 if (Math.Abs(velocity.X) < (float)num27)
44066 {
44067 velocity.X *= 1.05f;
44068 }
44069 }
44070 else
44071 {
44072 velocity.X *= 0.9f;
44073 }
44074 }
44075 if (type == 139 && IsMechQueenUp && ai[2] == 0f)
44076 {
44078 Vector2 v2 = center - base.Center;
44079 int num28 = 120;
44080 if (v2.Length() < (float)num28)
44081 {
44082 base.Center = center - v2.SafeNormalize(Vector2.UnitY) * num28;
44083 }
44084 }
44085 if (Main.netMode != 1)
44086 {
44087 if (Main.getGoodWorld && type == 6 && AnyNPCs(13))
44088 {
44089 if (justHit)
44090 {
44091 localAI[0] = 0f;
44092 }
44093 localAI[0] += 1f;
44094 if (localAI[0] == 60f)
44095 {
44096 if (targetData.Type != 0 && Collision.CanHit(this, targetData))
44097 {
44098 NewNPC(GetSpawnSourceForNPCFromNPCAI(), (int)(position.X + (float)(width / 2) + velocity.X), (int)(position.Y + (float)(height / 2) + velocity.Y), 666);
44099 }
44100 localAI[0] = 0f;
44101 }
44102 }
44103 if (type == 94 && !flag)
44104 {
44105 if (justHit)
44106 {
44107 localAI[0] = 0f;
44108 }
44109 localAI[0] += 1f;
44110 if (localAI[0] == 180f)
44111 {
44112 if (targetData.Type != 0 && Collision.CanHit(this, targetData))
44113 {
44114 NewNPC(GetSpawnSourceForNPCFromNPCAI(), (int)(position.X + (float)(width / 2) + velocity.X), (int)(position.Y + (float)(height / 2) + velocity.Y), 112);
44115 }
44116 localAI[0] = 0f;
44117 }
44118 }
44119 if (type == 619 && !flag)
44120 {
44121 if (justHit)
44122 {
44123 localAI[0] += 10f;
44124 }
44125 localAI[0] += 1f;
44126 if (localAI[0] >= 120f)
44127 {
44128 if (targetData.Type != 0 && Collision.CanHit(this, targetData))
44129 {
44130 if ((base.Center - targetData.Center).Length() < 400f)
44131 {
44132 Vector2 vector5 = DirectionTo(new Vector2(targetData.Center.X, targetData.Position.Y));
44133 velocity = -vector5 * 5f;
44134 netUpdate = true;
44135 localAI[0] = 0f;
44136 vector5 = DirectionTo(new Vector2(targetData.Center.X + (float)Main.rand.Next(-100, 101), targetData.Position.Y + (float)Main.rand.Next(-100, 101)));
44137 Projectile.NewProjectile(GetSpawnSource_ForProjectile(), base.Center, vector5 * 15f, 811, 35, 1f, Main.myPlayer);
44138 }
44139 else
44140 {
44141 localAI[0] = 50f;
44142 }
44143 }
44144 else
44145 {
44146 localAI[0] = 50f;
44147 }
44148 }
44149 }
44150 }
44151 if ((Main.IsItDay() && type != 173 && type != 619 && type != 6 && type != 23 && type != 42 && type != 94 && type != 176 && type != 205 && type != 210 && type != 211 && type != 252 && (type < 231 || type > 235)) || flag)
44152 {
44153 velocity.Y -= num2 * 2f;
44154 EncourageDespawn(10);
44155 }
44156 if (((velocity.X > 0f && oldVelocity.X < 0f) || (velocity.X < 0f && oldVelocity.X > 0f) || (velocity.Y > 0f && oldVelocity.Y < 0f) || (velocity.Y < 0f && oldVelocity.Y > 0f)) && !justHit)
44157 {
44158 netUpdate = true;
44159 }
44160 }
static double Atan2(double y, double x)
static double Sqrt(double d)
static double Abs(double value)
static void PlaySound(int type, Vector2 position, int style=1)
Vector2 velocity
Definition Entity.cs:16
Vector2 position
Definition Entity.cs:14
Vector2 oldVelocity
Definition Entity.cs:20
Vector2 DirectionTo(Vector2 Destination)
Definition Entity.cs:197
static readonly LegacySoundStyle Item17
Definition SoundID.cs:448
Vector2 netOffset
Definition NPC.cs:103
float[] localAI
Definition NPC.cs:449
int spriteDirection
Definition NPC.cs:517
void EncourageDespawn(int despawnTime)
Definition NPC.cs:1390
void TargetClosest(bool faceTarget=true)
Definition NPC.cs:69934
static int FindFirstNPC(int Type)
Definition NPC.cs:86701
NPCAimedTarget GetTargetData(bool ignorePlayerTankPets=true)
Definition NPC.cs:864
float[] ai
Definition NPC.cs:447
bool dontTakeDamage
Definition NPC.cs:527
static bool IsMechQueenUp
Definition NPC.cs:834
float scale
Definition NPC.cs:493
bool collideX
Definition NPC.cs:511
bool collideY
Definition NPC.cs:513
static bool AnyNPCs(int Type)
Definition NPC.cs:86689
int type
Definition NPC.cs:445
int alpha
Definition NPC.cs:489
Color color
Definition NPC.cs:487
float rotation
Definition NPC.cs:501
IEntitySource GetSpawnSourceForNPCFromNPCAI()
Definition NPC.cs:87546
static int NewNPC(IEntitySource source, int X, int Y, int Type, int Start=0, float ai0=0f, float ai1=0f, float ai2=0f, float ai3=0f, int Target=255)
Definition NPC.cs:77654
int GetAttackDamage_ForProjectiles(float normalDamage, float expertDamage)
Definition NPC.cs:1082
bool justHit
Definition NPC.cs:455
static int mechQueen
Definition NPC.cs:581
IEntitySource GetSpawnSource_ForProjectile()
Definition NPC.cs:87526
bool netUpdate
Definition NPC.cs:507
int target
Definition NPC.cs:459
static void TargetClosestNonBees(NPC searcher, bool faceTarget=true, Vector2? checkPosition=null)
Definition NPCUtils.cs:275

References System.Math.Abs(), Terraria.Lighting.AddLight(), Terraria.NPC.ai, Terraria.NPC.alpha, Terraria.NPC.AnyNPCs(), System.Math.Atan2(), Terraria.Collision.CanHit(), Terraria.DataStructures.NPCAimedTarget.Center, Terraria.NPC.collideX, Terraria.NPC.collideY, Terraria.NPC.color, Terraria.Main.dayTime, Terraria.Entity.direction, Terraria.Entity.DirectionTo(), Terraria.NPC.dontTakeDamage, Terraria.Main.dust, Terraria.NPC.EncourageDespawn(), Terraria.Main.expertMode, Terraria.NPC.FindFirstNPC(), Terraria.NPC.GetAttackDamage_ForProjectiles(), Terraria.Main.getGoodWorld, Terraria.NPC.GetSpawnSource_ForProjectile(), Terraria.NPC.GetSpawnSourceForNPCFromNPCAI(), Terraria.NPC.GetTargetData(), Terraria.Entity.height, Terraria.WorldGen.InWorld(), Terraria.Main.IsItDay(), Terraria.NPC.IsMechQueenUp, Terraria.ID.SoundID.Item17, Terraria.Player.itemAnimation, Terraria.NPC.justHit, Terraria.NPC.localAI, Terraria.NPC.mechQueen, Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.NPC.netOffset, Terraria.NPC.netUpdate, Terraria.Dust.NewDust(), Terraria.Dust.NewDustDirect(), Terraria.NPC.NewNPC(), Terraria.Projectile.NewProjectile(), Terraria.Main.npc, Terraria.Entity.oldVelocity, Terraria.Main.player, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Entity.position, Terraria.Main.projectile, Terraria.Main.rand, Terraria.Main.remixWorld, Terraria.NPC.rotation, Terraria.NPC.scale, Terraria.WorldGen.SolidTile(), Terraria.NPC.spriteDirection, System.Math.Sqrt(), Terraria.Player.stealth, Terraria.NPC.target, Terraria.NPC.TargetClosest(), Terraria.Utilities.NPCUtils.TargetClosestNonBees(), Terraria.NPC.type, Microsoft.Xna.Framework.Vector2.UnitY, Microsoft.Xna.Framework.Graphics.Vector2, Terraria.Entity.velocity, Terraria.Entity.wet, Terraria.Entity.width, Terraria.Main.worldSurface, Microsoft.Xna.Framework.Vector2.X, Microsoft.Xna.Framework.Vector2.Y, and Terraria.Main.zenithWorld.

Referenced by Terraria.NPC.AI().