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

◆ AI_110_Betsy()

void Terraria.NPC.AI_110_Betsy ( )
inlineprivate

Definition at line 65732 of file NPC.cs.

65733 {
65734 //IL_01a0: Unknown result type (might be due to invalid IL or missing references)
65735 //IL_01be: Unknown result type (might be due to invalid IL or missing references)
65736 //IL_01c3: Unknown result type (might be due to invalid IL or missing references)
65737 //IL_01c8: Unknown result type (might be due to invalid IL or missing references)
65738 //IL_01cb: Unknown result type (might be due to invalid IL or missing references)
65739 //IL_01cd: Unknown result type (might be due to invalid IL or missing references)
65740 //IL_01d4: Unknown result type (might be due to invalid IL or missing references)
65741 //IL_01d9: Unknown result type (might be due to invalid IL or missing references)
65742 //IL_01dc: Unknown result type (might be due to invalid IL or missing references)
65743 //IL_01e6: Unknown result type (might be due to invalid IL or missing references)
65744 //IL_01f2: Unknown result type (might be due to invalid IL or missing references)
65745 //IL_0180: Unknown result type (might be due to invalid IL or missing references)
65746 //IL_018c: Unknown result type (might be due to invalid IL or missing references)
65747 //IL_047a: Unknown result type (might be due to invalid IL or missing references)
65748 //IL_076f: Unknown result type (might be due to invalid IL or missing references)
65749 //IL_077b: Unknown result type (might be due to invalid IL or missing references)
65750 //IL_0529: Unknown result type (might be due to invalid IL or missing references)
65751 //IL_0535: Unknown result type (might be due to invalid IL or missing references)
65752 //IL_0504: Unknown result type (might be due to invalid IL or missing references)
65753 //IL_1278: Unknown result type (might be due to invalid IL or missing references)
65754 //IL_127d: Unknown result type (might be due to invalid IL or missing references)
65755 //IL_0a8d: Unknown result type (might be due to invalid IL or missing references)
65756 //IL_0aa5: Unknown result type (might be due to invalid IL or missing references)
65757 //IL_0aab: Unknown result type (might be due to invalid IL or missing references)
65758 //IL_0aad: Unknown result type (might be due to invalid IL or missing references)
65759 //IL_0ab2: Unknown result type (might be due to invalid IL or missing references)
65760 //IL_0aca: Unknown result type (might be due to invalid IL or missing references)
65761 //IL_0ad2: Unknown result type (might be due to invalid IL or missing references)
65762 //IL_0ad7: Unknown result type (might be due to invalid IL or missing references)
65763 //IL_0ae1: Unknown result type (might be due to invalid IL or missing references)
65764 //IL_0ae6: Unknown result type (might be due to invalid IL or missing references)
65765 //IL_0aeb: Unknown result type (might be due to invalid IL or missing references)
65766 //IL_0b24: Unknown result type (might be due to invalid IL or missing references)
65767 //IL_0bbd: Unknown result type (might be due to invalid IL or missing references)
65768 //IL_0bcc: Unknown result type (might be due to invalid IL or missing references)
65769 //IL_0bd1: Unknown result type (might be due to invalid IL or missing references)
65770 //IL_0bd6: Unknown result type (might be due to invalid IL or missing references)
65771 //IL_0bd9: Unknown result type (might be due to invalid IL or missing references)
65772 //IL_0bdb: Unknown result type (might be due to invalid IL or missing references)
65773 //IL_0be2: Unknown result type (might be due to invalid IL or missing references)
65774 //IL_0bec: Unknown result type (might be due to invalid IL or missing references)
65775 //IL_0bf1: Unknown result type (might be due to invalid IL or missing references)
65776 //IL_0bf4: Unknown result type (might be due to invalid IL or missing references)
65777 //IL_0c04: Unknown result type (might be due to invalid IL or missing references)
65778 //IL_0c10: Unknown result type (might be due to invalid IL or missing references)
65779 //IL_0b7e: Unknown result type (might be due to invalid IL or missing references)
65780 //IL_0b88: Unknown result type (might be due to invalid IL or missing references)
65781 //IL_0b8d: Unknown result type (might be due to invalid IL or missing references)
65782 //IL_07a9: Unknown result type (might be due to invalid IL or missing references)
65783 //IL_07bf: Unknown result type (might be due to invalid IL or missing references)
65784 //IL_07c4: Unknown result type (might be due to invalid IL or missing references)
65785 //IL_07c9: Unknown result type (might be due to invalid IL or missing references)
65786 //IL_07cc: Unknown result type (might be due to invalid IL or missing references)
65787 //IL_07ce: Unknown result type (might be due to invalid IL or missing references)
65788 //IL_07d5: Unknown result type (might be due to invalid IL or missing references)
65789 //IL_07da: Unknown result type (might be due to invalid IL or missing references)
65790 //IL_07de: Unknown result type (might be due to invalid IL or missing references)
65791 //IL_07e3: Unknown result type (might be due to invalid IL or missing references)
65792 //IL_07e7: Unknown result type (might be due to invalid IL or missing references)
65793 //IL_07ec: Unknown result type (might be due to invalid IL or missing references)
65794 //IL_07f2: Unknown result type (might be due to invalid IL or missing references)
65795 //IL_07fe: Unknown result type (might be due to invalid IL or missing references)
65796 //IL_0563: Unknown result type (might be due to invalid IL or missing references)
65797 //IL_0579: Unknown result type (might be due to invalid IL or missing references)
65798 //IL_057e: Unknown result type (might be due to invalid IL or missing references)
65799 //IL_0583: Unknown result type (might be due to invalid IL or missing references)
65800 //IL_0586: Unknown result type (might be due to invalid IL or missing references)
65801 //IL_0588: Unknown result type (might be due to invalid IL or missing references)
65802 //IL_058f: Unknown result type (might be due to invalid IL or missing references)
65803 //IL_0594: Unknown result type (might be due to invalid IL or missing references)
65804 //IL_0597: Unknown result type (might be due to invalid IL or missing references)
65805 //IL_08fe: Unknown result type (might be due to invalid IL or missing references)
65806 //IL_0903: Unknown result type (might be due to invalid IL or missing references)
65807 //IL_0925: Unknown result type (might be due to invalid IL or missing references)
65808 //IL_0934: Unknown result type (might be due to invalid IL or missing references)
65809 //IL_0939: Unknown result type (might be due to invalid IL or missing references)
65810 //IL_093e: Unknown result type (might be due to invalid IL or missing references)
65811 //IL_0864: Unknown result type (might be due to invalid IL or missing references)
65812 //IL_0869: Unknown result type (might be due to invalid IL or missing references)
65813 //IL_086e: Unknown result type (might be due to invalid IL or missing references)
65814 //IL_0880: Unknown result type (might be due to invalid IL or missing references)
65815 //IL_0882: Unknown result type (might be due to invalid IL or missing references)
65816 //IL_088e: Unknown result type (might be due to invalid IL or missing references)
65817 //IL_0893: Unknown result type (might be due to invalid IL or missing references)
65818 //IL_0898: Unknown result type (might be due to invalid IL or missing references)
65819 //IL_089b: Unknown result type (might be due to invalid IL or missing references)
65820 //IL_05fa: Unknown result type (might be due to invalid IL or missing references)
65821 //IL_0605: Unknown result type (might be due to invalid IL or missing references)
65822 //IL_05ae: Unknown result type (might be due to invalid IL or missing references)
65823 //IL_05b3: Unknown result type (might be due to invalid IL or missing references)
65824 //IL_05b5: Unknown result type (might be due to invalid IL or missing references)
65825 //IL_05ba: Unknown result type (might be due to invalid IL or missing references)
65826 //IL_05a3: Unknown result type (might be due to invalid IL or missing references)
65827 //IL_0cd3: Unknown result type (might be due to invalid IL or missing references)
65828 //IL_0cdd: Unknown result type (might be due to invalid IL or missing references)
65829 //IL_0ce2: Unknown result type (might be due to invalid IL or missing references)
65830 //IL_0cbb: Unknown result type (might be due to invalid IL or missing references)
65831 //IL_0cc5: Unknown result type (might be due to invalid IL or missing references)
65832 //IL_0cca: Unknown result type (might be due to invalid IL or missing references)
65833 //IL_0c4d: Unknown result type (might be due to invalid IL or missing references)
65834 //IL_096d: Unknown result type (might be due to invalid IL or missing references)
65835 //IL_0987: Unknown result type (might be due to invalid IL or missing references)
65836 //IL_0995: Unknown result type (might be due to invalid IL or missing references)
65837 //IL_099b: Unknown result type (might be due to invalid IL or missing references)
65838 //IL_099d: Unknown result type (might be due to invalid IL or missing references)
65839 //IL_09a2: Unknown result type (might be due to invalid IL or missing references)
65840 //IL_09a7: Unknown result type (might be due to invalid IL or missing references)
65841 //IL_0823: Unknown result type (might be due to invalid IL or missing references)
65842 //IL_0826: Unknown result type (might be due to invalid IL or missing references)
65843 //IL_06c2: Unknown result type (might be due to invalid IL or missing references)
65844 //IL_06cd: Unknown result type (might be due to invalid IL or missing references)
65845 //IL_05bf: Unknown result type (might be due to invalid IL or missing references)
65846 //IL_05c2: Unknown result type (might be due to invalid IL or missing references)
65847 //IL_08b3: Unknown result type (might be due to invalid IL or missing references)
65848 //IL_0620: Unknown result type (might be due to invalid IL or missing references)
65849 //IL_062a: Unknown result type (might be due to invalid IL or missing references)
65850 //IL_062f: Unknown result type (might be due to invalid IL or missing references)
65851 //IL_033a: Unknown result type (might be due to invalid IL or missing references)
65852 //IL_033f: Unknown result type (might be due to invalid IL or missing references)
65853 //IL_0344: Unknown result type (might be due to invalid IL or missing references)
65854 //IL_0347: Unknown result type (might be due to invalid IL or missing references)
65855 //IL_039e: Unknown result type (might be due to invalid IL or missing references)
65856 //IL_03a9: Unknown result type (might be due to invalid IL or missing references)
65857 //IL_03f6: Unknown result type (might be due to invalid IL or missing references)
65858 //IL_03fb: Unknown result type (might be due to invalid IL or missing references)
65859 //IL_0400: Unknown result type (might be due to invalid IL or missing references)
65860 //IL_0403: Unknown result type (might be due to invalid IL or missing references)
65861 //IL_08db: Unknown result type (might be due to invalid IL or missing references)
65862 //IL_08df: Unknown result type (might be due to invalid IL or missing references)
65863 //IL_08e4: Unknown result type (might be due to invalid IL or missing references)
65864 //IL_0695: Unknown result type (might be due to invalid IL or missing references)
65865 //IL_0656: Unknown result type (might be due to invalid IL or missing references)
65866 //IL_065c: Unknown result type (might be due to invalid IL or missing references)
65867 //IL_0d66: Unknown result type (might be due to invalid IL or missing references)
65868 //IL_0d6b: Unknown result type (might be due to invalid IL or missing references)
65869 //IL_0d70: Unknown result type (might be due to invalid IL or missing references)
65870 //IL_0d7d: Unknown result type (might be due to invalid IL or missing references)
65871 //IL_09d8: Unknown result type (might be due to invalid IL or missing references)
65872 //IL_09db: Unknown result type (might be due to invalid IL or missing references)
65873 //IL_035f: Unknown result type (might be due to invalid IL or missing references)
65874 //IL_03c5: Unknown result type (might be due to invalid IL or missing references)
65875 //IL_041b: Unknown result type (might be due to invalid IL or missing references)
65876 //IL_0fa3: Unknown result type (might be due to invalid IL or missing references)
65877 //IL_0387: Unknown result type (might be due to invalid IL or missing references)
65878 //IL_038b: Unknown result type (might be due to invalid IL or missing references)
65879 //IL_0390: Unknown result type (might be due to invalid IL or missing references)
65880 //IL_0443: Unknown result type (might be due to invalid IL or missing references)
65881 //IL_0447: Unknown result type (might be due to invalid IL or missing references)
65882 //IL_044c: Unknown result type (might be due to invalid IL or missing references)
65883 //IL_0d91: Unknown result type (might be due to invalid IL or missing references)
65884 //IL_03dd: Unknown result type (might be due to invalid IL or missing references)
65885 //IL_03e4: Unknown result type (might be due to invalid IL or missing references)
65886 //IL_03e9: Unknown result type (might be due to invalid IL or missing references)
65887 //IL_0f8c: Unknown result type (might be due to invalid IL or missing references)
65888 //IL_100f: Unknown result type (might be due to invalid IL or missing references)
65889 //IL_1024: Unknown result type (might be due to invalid IL or missing references)
65890 //IL_1033: Unknown result type (might be due to invalid IL or missing references)
65891 //IL_1038: Unknown result type (might be due to invalid IL or missing references)
65892 //IL_1042: Unknown result type (might be due to invalid IL or missing references)
65893 //IL_105d: Unknown result type (might be due to invalid IL or missing references)
65894 //IL_1062: Unknown result type (might be due to invalid IL or missing references)
65895 //IL_1067: Unknown result type (might be due to invalid IL or missing references)
65896 //IL_1069: Unknown result type (might be due to invalid IL or missing references)
65897 //IL_106d: Unknown result type (might be due to invalid IL or missing references)
65898 //IL_107e: Unknown result type (might be due to invalid IL or missing references)
65899 //IL_1080: Unknown result type (might be due to invalid IL or missing references)
65900 //IL_1085: Unknown result type (might be due to invalid IL or missing references)
65901 //IL_108d: Unknown result type (might be due to invalid IL or missing references)
65902 //IL_1094: Unknown result type (might be due to invalid IL or missing references)
65903 //IL_10ca: Unknown result type (might be due to invalid IL or missing references)
65904 //IL_0ed0: Unknown result type (might be due to invalid IL or missing references)
65905 //IL_0ee8: Unknown result type (might be due to invalid IL or missing references)
65906 //IL_0eed: Unknown result type (might be due to invalid IL or missing references)
65907 //IL_0f73: Unknown result type (might be due to invalid IL or missing references)
65908 //IL_0f78: Unknown result type (might be due to invalid IL or missing references)
65909 //IL_1158: Unknown result type (might be due to invalid IL or missing references)
65910 //IL_115d: Unknown result type (might be due to invalid IL or missing references)
65911 //IL_1162: Unknown result type (might be due to invalid IL or missing references)
65912 //IL_116a: Unknown result type (might be due to invalid IL or missing references)
65913 //IL_1171: Unknown result type (might be due to invalid IL or missing references)
65914 //IL_11a4: Unknown result type (might be due to invalid IL or missing references)
65917 int num = -1;
65918 float num12 = 1f;
65919 int num23 = 35;
65920 int num34 = 35;
65921 float num43 = 10f;
65922 float num44 = 0.45f;
65923 float num45 = 7.5f;
65924 float num46 = 30f;
65925 float num47 = 30f;
65926 float num2 = 23f;
65927 float num3 = 600f;
65928 float num4 = 12f;
65929 float num5 = 40f;
65930 float num6 = 80f;
65931 float num7 = num5 + num6;
65932 float num8 = 1500f;
65933 float num9 = 60f;
65934 float num10 = 13f;
65935 float amount = 1f / 30f;
65936 float num11 = 12f;
65937 int num13 = 10;
65938 int num14 = 6 * num13;
65939 float num15 = 60f;
65940 float num16 = num9 + (float)num14 + num15;
65941 float num17 = 60f;
65942 float num18 = 1f;
65943 float num19 = (float)Math.PI * 2f * (num18 / num17);
65944 float num20 = 0.1f;
65945 float num21 = 32f;
65946 float num22 = 90f;
65947 float num24 = 20f;
65948 _ = ai[0];
65949 if (ai[0] == 0f)
65950 {
65951 if ((ai[1] += 1f) >= num43)
65952 {
65953 ai[1] = 0f;
65954 ai[0] = 1f;
65955 ai[2] = 0f;
65956 netUpdate = true;
65957 }
65958 }
65959 else if (ai[0] == 1f)
65960 {
65961 if (ai[2] == 0f)
65962 {
65963 ai[2] = ((base.Center.X < targetData.Center.X) ? 1 : (-1));
65964 }
65965 Vector2 destination = targetData.Center + new Vector2((0f - ai[2]) * 300f, -200f);
65968 int num25 = ((base.Center.X < targetData.Center.X) ? 1 : (-1));
65970 if ((ai[1] += 1f) >= num46)
65971 {
65972 int num26 = 1;
65973 if (ai[3] == 5f && Main.rand.Next(3) == 0)
65974 {
65975 ai[3] += 1f;
65976 }
65977 switch ((int)ai[3])
65978 {
65979 case 0:
65980 case 1:
65981 case 3:
65982 num26 = 2;
65983 break;
65984 case 2:
65985 num26 = 3;
65986 break;
65987 case 4:
65988 num26 = 4;
65989 break;
65990 case 5:
65991 num26 = 5;
65992 break;
65993 case 6:
65994 num26 = 3;
65995 break;
65996 case 7:
65997 num26 = 6;
65998 break;
65999 }
66000 ai[0] = num26;
66001 ai[1] = 0f;
66002 ai[2] = 0f;
66003 ai[3] += 1f;
66004 netUpdate = true;
66005 if (ai[3] >= 8f)
66006 {
66007 ai[3] = 0f;
66008 }
66009 switch (num26)
66010 {
66011 case 2:
66012 {
66013 Vector2 vector2 = DirectionTo(targetData.Center);
66014 spriteDirection = ((vector2.X > 0f) ? 1 : (-1));
66015 rotation = vector2.ToRotation();
66016 if (spriteDirection == -1)
66017 {
66018 rotation += (float)Math.PI;
66019 }
66020 velocity = vector2 * num2;
66021 break;
66022 }
66023 case 3:
66024 {
66025 Vector2 vector3 = default(Vector2);
66026 ((Vector2)(ref vector3))._002Ector((float)((targetData.Center.X > base.Center.X) ? 1 : (-1)), 0f);
66027 spriteDirection = ((vector3.X > 0f) ? 1 : (-1));
66028 velocity = vector3 * -2f;
66029 break;
66030 }
66031 case 5:
66032 {
66033 Vector2 vector = DirectionTo(targetData.Center);
66034 spriteDirection = ((vector.X > 0f) ? 1 : (-1));
66035 rotation = vector.ToRotation();
66036 if (spriteDirection == -1)
66037 {
66038 rotation += (float)Math.PI;
66039 }
66040 velocity = vector * num21;
66041 break;
66042 }
66043 }
66044 }
66045 }
66046 else if (ai[0] == 2f)
66047 {
66048 if (ai[1] == 0f)
66049 {
66051 }
66052 if ((ai[1] += 1f) >= num47)
66053 {
66054 ai[0] = 1f;
66055 ai[1] = 0f;
66056 ai[2] = 0f;
66057 }
66058 }
66059 else if (ai[0] == 3f)
66060 {
66062 if (activeSound != null)
66063 {
66064 activeSound.Position = base.Center;
66065 }
66066 ai[1] += 1f;
66067 int num27 = ((base.Center.X < targetData.Center.X) ? 1 : (-1));
66068 ai[2] = num27;
66069 if (ai[1] < num5)
66070 {
66071 Vector2 vector4 = targetData.Center + new Vector2((float)num27 * (0f - num3), -250f);
66072 Vector2 vector5 = DirectionTo(vector4) * num4;
66073 if (Distance(vector4) < num4)
66074 {
66075 base.Center = vector4;
66076 }
66077 else
66078 {
66079 position += vector5;
66080 }
66081 if (Vector2.Distance(vector4, base.Center) < 16f)
66082 {
66083 ai[1] = num5 - 1f;
66084 }
66085 num12 = 1.5f;
66086 }
66087 if (ai[1] == num5)
66088 {
66089 int num28 = ((targetData.Center.X > base.Center.X) ? 1 : (-1));
66090 velocity = new Vector2((float)num28, 0f) * 10f;
66092 if (Main.netMode != 1)
66093 {
66094 Projectile.NewProjectile(GetSpawnSource_ForProjectile(), base.Center, velocity, 687, num23, 0f, Main.myPlayer, 0f, whoAmI);
66095 }
66097 }
66098 if (ai[1] >= num5)
66099 {
66100 num12 = 1.5f;
66101 if (Math.Abs(targetData.Center.X - base.Center.X) > 550f && Math.Abs(velocity.X) < 20f)
66102 {
66103 velocity.X += (float)Math.Sign(velocity.X) * 0.5f;
66104 }
66105 }
66106 if (ai[1] >= num7)
66107 {
66108 ai[0] = 1f;
66109 ai[1] = 0f;
66110 ai[2] = 0f;
66111 }
66112 }
66113 else if (ai[0] == 4f)
66114 {
66115 int num29 = ((base.Center.X < targetData.Center.X) ? 1 : (-1));
66116 ai[2] = num29;
66117 if (ai[1] < num9)
66118 {
66119 Vector2 vector6 = targetData.Center + new Vector2((float)num29 * (0f - num8), -350f);
66120 Vector2 value = DirectionTo(vector6) * num10;
66121 velocity = Vector2.Lerp(velocity, value, amount);
66122 int num30 = ((base.Center.X < targetData.Center.X) ? 1 : (-1));
66124 if (Vector2.Distance(vector6, base.Center) < 16f)
66125 {
66126 ai[1] = num9 - 1f;
66127 }
66128 num12 = 1.5f;
66129 }
66130 else if (ai[1] == num9)
66131 {
66132 Vector2 v = DirectionTo(targetData.Center);
66133 v.Y *= 0.25f;
66134 v = v.SafeNormalize(Vector2.UnitX * (float)direction);
66135 spriteDirection = ((v.X > 0f) ? 1 : (-1));
66136 rotation = v.ToRotation();
66137 if (spriteDirection == -1)
66138 {
66139 rotation += (float)Math.PI;
66140 }
66141 velocity = v * num11;
66142 }
66143 else
66144 {
66145 position.X += DirectionTo(targetData.Center).X * 7f;
66146 position.Y += DirectionTo(targetData.Center + new Vector2(0f, -400f)).Y * 6f;
66147 if (ai[1] <= num16 - num15)
66148 {
66149 num12 = 1.5f;
66150 }
66151 float num31 = 30f;
66152 Vector2 vector7 = base.Center + Utils.RotatedBy(new Vector2((110f + num31) * (float)direction, 20f), rotation);
66153 int num32 = (int)(ai[1] - num9 + 1f);
66154 if (num32 <= num14 && num32 % num13 == 0 && Main.netMode != 1)
66155 {
66156 Projectile.NewProjectile(GetSpawnSource_ForProjectile(), vector7, velocity, 686, num34, 0f, Main.myPlayer);
66157 }
66158 }
66159 if (ai[1] > num16 - num15)
66160 {
66161 velocity.Y -= 0.1f;
66162 }
66163 ai[1] += 1f;
66164 if (ai[1] >= num16)
66165 {
66166 ai[0] = 1f;
66167 ai[1] = 0f;
66168 ai[2] = 0f;
66169 }
66170 }
66171 else if (ai[0] == 5f)
66172 {
66173 velocity = velocity.RotatedBy((0f - num19) * (float)direction);
66174 position.Y -= num20;
66175 position += DirectionTo(targetData.Center) * 10f;
66176 rotation -= num19 * (float)direction;
66177 num12 *= 0.7f;
66178 if (ai[1] == 1f)
66179 {
66181 }
66182 if ((ai[1] += 1f) >= num17)
66183 {
66184 ai[0] = 1f;
66185 ai[1] = 0f;
66186 ai[2] = 0f;
66187 velocity /= 2f;
66188 }
66189 }
66190 else if (ai[0] == 6f)
66191 {
66192 if (ai[1] == 0f)
66193 {
66194 Vector2 destination2 = targetData.Center + new Vector2(0f, -200f);
66197 int num33 = ((base.Center.X < targetData.Center.X) ? 1 : (-1));
66199 ai[2] += 1f;
66200 if (Distance(targetData.Center) < 350f || ai[2] >= 180f)
66201 {
66202 ai[1] = 1f;
66203 netUpdate = true;
66204 }
66205 }
66206 else
66207 {
66208 if (ai[1] == 1f)
66209 {
66211 }
66212 if (ai[1] < num24)
66213 {
66214 velocity *= 0.95f;
66215 }
66216 else
66217 {
66218 velocity *= 0.98f;
66219 }
66220 if (ai[1] == num24)
66221 {
66222 if (velocity.Y > 0f)
66223 {
66224 velocity.Y /= 3f;
66225 }
66226 velocity.Y -= 3f;
66227 }
66228 num12 *= 0.85f;
66229 if (ai[1] == 20f || ai[1] == 25f || ai[1] == 30f)
66230 {
66231 Point point = base.Center.ToTileCoordinates();
66232 int num35 = 30;
66233 int num36 = 35;
66234 int num37 = 4;
66235 for (int i = point.X - num35; i <= point.X + num35; i++)
66236 {
66237 bool flag = false;
66238 for (int j = point.Y - num36 / 3; j < point.Y + num36; j++)
66239 {
66240 Tile tileSafely = Framing.GetTileSafely(i, j);
66241 bool flag2 = tileSafely.active() && Main.tileSolid[tileSafely.type] && !Main.tileFrameImportant[tileSafely.type];
66242 if (flag && flag2)
66243 {
66244 int num38 = WorldGen.KillTile_GetTileDustAmount(fail: true, tileSafely, i, j);
66245 for (int k = 0; k < num38; k++)
66246 {
66247 Dust obj = Main.dust[WorldGen.KillTile_MakeTileDust(i, j, tileSafely)];
66248 obj.velocity.Y -= 3f + (float)num37 * 1.5f;
66249 obj.velocity.Y *= Main.rand.NextFloat();
66250 obj.scale += (float)num37 * 0.03f;
66251 }
66252 for (int l = 0; l < num38 - 1; l++)
66253 {
66254 Dust obj2 = Main.dust[WorldGen.KillTile_MakeTileDust(i, j, tileSafely)];
66255 obj2.velocity.Y -= 1f + (float)num37;
66256 obj2.velocity.Y *= Main.rand.NextFloat();
66257 }
66258 if (num38 > 0 && Main.rand.Next(3) != 0)
66259 {
66260 float num39 = Math.Abs(point.X - i) / (num35 / 2);
66261 Gore gore = Gore.NewGoreDirect(position, Vector2.Zero, 61 + Main.rand.Next(3), 1f - (float)num37 * 0.15f + num39 * 0.5f);
66262 gore.velocity.Y -= 0.1f + (float)num37 * 0.5f + num39 * (float)num37 * 1f;
66263 gore.velocity.Y *= Main.rand.NextFloat();
66264 gore.position = new Vector2((float)(i * 16 + 20), (float)(j * 16 + 20));
66265 }
66266 }
66267 flag = !flag2;
66268 }
66269 }
66270 }
66271 bool flag3 = ai[1] == 20f || ai[1] == 45f || ai[1] == 70f;
66272 if (CountNPCS(560) > 4)
66273 {
66274 flag3 = false;
66275 }
66276 if (flag3 && Main.netMode != 1)
66277 {
66278 for (int m = 0; m < 1; m++)
66279 {
66280 Vector2 vector8 = base.Center + ((float)Math.PI * 2f * Main.rand.NextFloat()).ToRotationVector2() * new Vector2(2f, 1f) * 300f * (0.6f + Main.rand.NextFloat() * 0.4f);
66281 if (Vector2.Distance(vector8, targetData.Center) > 100f)
66282 {
66283 Point point2 = vector8.ToPoint();
66286 }
66287 }
66288 List<NPC> list = new List<NPC>();
66289 for (int n = 0; n < 200; n++)
66290 {
66291 NPC nPC = Main.npc[n];
66292 if (nPC.active && nPC.type == 549)
66293 {
66294 list.Add(nPC);
66295 }
66296 }
66297 if (list.Count > 0)
66298 {
66299 for (int num40 = 0; num40 < 3; num40++)
66300 {
66301 NPC nPC2 = list[Main.rand.Next(list.Count)];
66302 Point point3 = nPC2.Center.ToPoint();
66305 }
66306 }
66307 }
66308 ai[1] += 1f;
66309 }
66310 if (ai[1] >= num22)
66311 {
66312 ai[0] = 1f;
66313 ai[1] = 0f;
66314 ai[2] = 0f;
66315 }
66316 }
66317 localAI[0] += num12;
66318 if (localAI[0] >= 36f)
66319 {
66320 localAI[0] = 0f;
66321 }
66322 if (num != -1)
66323 {
66324 localAI[0] = num * 4;
66325 }
66326 if ((localAI[1] += 1f) >= 60f)
66327 {
66328 localAI[1] = 0f;
66329 }
66330 float num41 = DirectionTo(targetData.Center).ToRotation();
66331 float num42 = 0.04f;
66332 switch ((int)ai[0])
66333 {
66334 case 2:
66335 case 5:
66336 num42 = 0f;
66337 break;
66338 case 3:
66339 num42 = 0.01f;
66340 num41 = 0f;
66341 if (spriteDirection == -1)
66342 {
66343 num41 -= (float)Math.PI;
66344 }
66345 if (ai[1] >= num5)
66346 {
66347 num41 += (float)spriteDirection * (float)Math.PI / 12f;
66348 num42 = 0.05f;
66349 }
66350 break;
66351 case 4:
66352 num42 = 0.01f;
66353 num41 = (float)Math.PI;
66354 if (spriteDirection == 1)
66355 {
66356 num41 += (float)Math.PI;
66357 }
66358 break;
66359 case 6:
66360 num42 = 0.02f;
66361 num41 = 0f;
66362 if (spriteDirection == -1)
66363 {
66364 num41 -= (float)Math.PI;
66365 }
66366 break;
66367 }
66368 if (spriteDirection == -1)
66369 {
66370 num41 += (float)Math.PI;
66371 }
66372 if (num42 != 0f)
66373 {
66374 rotation = rotation.AngleTowards(num41, num42);
66375 }
66376 if (SoundEngine.GetActiveSound(SlotId.FromFloat(localAI[2])) == null)
66377 {
66378 localAI[2] = SlotId.Invalid.ToFloat();
66379 }
66380 }
static ? ActiveSound GetActiveSound(SlotId slotId)
static SlotId PlayTrackedSound(in SoundStyle style, Vector2? position=null)
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
float Distance(Vector2 Other)
Definition Entity.cs:275
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
Vector2 DirectionTo(Vector2 Destination)
Definition Entity.cs:289
static readonly SoundStyle DD2_BetsyFlyingCircleAttack
Definition SoundID.cs:77
static readonly SoundStyle DD2_BetsyWindAttack
Definition SoundID.cs:85
static readonly SoundStyle DD2_BetsySummon
Definition SoundID.cs:83
static readonly SoundStyle DD2_BetsyFlameBreath
Definition SoundID.cs:75
static readonly SoundStyle DD2_BetsyScream
Definition SoundID.cs:81
static int CountNPCS(int Type)
Returns the number of active NPC in the world of the given NPC type (F:Terraria.NPC....
Definition NPC.cs:106585
float[] localAI
Acts like F:Terraria.NPC.ai, but does not sync to the server. Many vanilla T:Terraria....
Definition NPC.cs:1003
int spriteDirection
Definition NPC.cs:1143
NPCAimedTarget GetTargetData(bool ignorePlayerTankPets=true)
Definition NPC.cs:1668
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
float value
How many copper coins the NPC will drop when killed (100 copper coins = 1 silver coin etc....
Definition NPC.cs:1156
float rotation
Definition NPC.cs:1116
IEntitySource GetSpawnSourceForNPCFromNPCAI()
Definition NPC.cs:107568
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)
Spawns an NPC into the game world with the given type. This method should not be called on multipla...
Definition NPC.cs:91239
IEntitySource GetSpawnSource_ForProjectile()
Definition NPC.cs:107558
void SimpleFlyMovement(Vector2 desiredVelocity, float moveSpeed)
Definition NPC.cs:82824
bool netUpdate
Definition NPC.cs:1130
static void TargetClosestBetsy(NPC searcher, bool faceTarget=true, Vector2? checkPosition=null)
Definition NPCUtils.cs:333

References Terraria.NPC.ai, Terraria.NPC.CountNPCS(), Terraria.ID.SoundID.DD2_BetsyFlameBreath, Terraria.ID.SoundID.DD2_BetsyFlyingCircleAttack, Terraria.ID.SoundID.DD2_BetsyScream, Terraria.ID.SoundID.DD2_BetsySummon, Terraria.ID.SoundID.DD2_BetsyWindAttack, Terraria.Entity.direction, Terraria.Entity.DirectionTo(), Terraria.Entity.Distance(), Terraria.Main.dust, Terraria.Audio.SoundEngine.GetActiveSound(), Terraria.NPC.GetSpawnSource_ForProjectile(), Terraria.NPC.GetSpawnSourceForNPCFromNPCAI(), Terraria.NPC.GetTargetData(), Terraria.Framing.GetTileSafely(), Terraria.WorldGen.KillTile_GetTileDustAmount(), Terraria.WorldGen.KillTile_MakeTileDust(), Terraria.NPC.localAI, Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.NPC.netUpdate, Terraria.Gore.NewGoreDirect(), Terraria.NPC.NewNPC(), Terraria.Projectile.NewProjectile(), Terraria.Main.npc, Terraria.Audio.SoundEngine.PlayTrackedSound(), Terraria.Entity.position, Terraria.Main.rand, Terraria.Utils.RotatedBy(), Terraria.NPC.rotation, Terraria.NPC.SimpleFlyMovement(), Terraria.NPC.spriteDirection, Terraria.Utilities.NPCUtils.TargetClosestBetsy(), Terraria.Main.tileFrameImportant, Terraria.Main.tileSolid, Terraria.NPC.value, Terraria.Entity.velocity, and Terraria.Entity.whoAmI.

Referenced by Terraria.NPC.VanillaAI_Inner().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: