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

◆ AI_026()

void Terraria.Projectile.AI_026 ( )
inlineprivate

Definition at line 48040 of file Projectile.cs.

48041 {
48042 if (!Main.player[owner].active)
48043 {
48044 active = false;
48045 return;
48046 }
48047 bool flag = false;
48048 bool flag2 = false;
48049 bool flag3 = false;
48050 bool flag4 = false;
48051 bool flag5 = false;
48052 int num = 85;
48053 bool flag6 = type >= 191 && type <= 194;
48054 if (type == 324)
48055 {
48056 num = 120;
48057 }
48058 if (type == 112)
48059 {
48060 num = 100;
48061 }
48062 if (type == 127)
48063 {
48064 num = 50;
48065 }
48066 switch (type)
48067 {
48068 case 816:
48069 case 821:
48070 case 825:
48071 case 854:
48072 case 858:
48073 case 859:
48074 case 860:
48075 case 885:
48076 case 889:
48077 case 891:
48078 case 897:
48079 case 899:
48080 case 900:
48081 case 934:
48082 num = 95;
48083 break;
48084 case 884:
48085 case 890:
48086 num = 80;
48087 break;
48088 case 881:
48089 num = 95;
48090 if (Main.player[owner].ownedProjectileCounts[881] > 0)
48091 {
48092 num = 120;
48093 }
48094 break;
48095 }
48096 if (type == 960)
48097 {
48098 Main.CurrentFrameFlags.HadAnActiveInteractibleProjectile = true;
48099 flag = true;
48100 }
48101 if (flag6)
48102 {
48103 if (lavaWet)
48104 {
48105 ai[0] = 1f;
48106 ai[1] = 0f;
48107 }
48108 num = 60 + 30 * minionPos;
48109 }
48110 else if (type == 266)
48111 {
48112 num = 60 + 30 * minionPos;
48113 }
48114 bool flag7 = ai[0] == -1f || ai[0] == -2f;
48115 bool num2 = ai[0] == -1f;
48116 bool flag8 = ai[0] == -2f;
48117 if (type == 111)
48118 {
48119 if (Main.player[owner].dead)
48120 {
48121 Main.player[owner].bunny = false;
48122 }
48123 if (Main.player[owner].bunny)
48124 {
48125 timeLeft = 2;
48126 }
48127 }
48128 if (type == 112)
48129 {
48130 if (Main.player[owner].dead)
48131 {
48132 Main.player[owner].penguin = false;
48133 }
48134 if (Main.player[owner].penguin)
48135 {
48136 timeLeft = 2;
48137 }
48138 }
48139 if (type == 334)
48140 {
48141 if (Main.player[owner].dead)
48142 {
48143 Main.player[owner].puppy = false;
48144 }
48145 if (Main.player[owner].puppy)
48146 {
48147 timeLeft = 2;
48148 }
48149 }
48150 if (type == 353)
48151 {
48152 if (Main.player[owner].dead)
48153 {
48154 Main.player[owner].grinch = false;
48155 }
48156 if (Main.player[owner].grinch)
48157 {
48158 timeLeft = 2;
48159 }
48160 }
48161 if (type == 127)
48162 {
48163 if (Main.player[owner].dead)
48164 {
48165 Main.player[owner].turtle = false;
48166 }
48167 if (Main.player[owner].turtle)
48168 {
48169 timeLeft = 2;
48170 }
48171 }
48172 if (type == 175)
48173 {
48174 if (Main.player[owner].dead)
48175 {
48176 Main.player[owner].eater = false;
48177 }
48178 if (Main.player[owner].eater)
48179 {
48180 timeLeft = 2;
48181 }
48182 }
48183 if (type == 197)
48184 {
48185 if (Main.player[owner].dead)
48186 {
48187 Main.player[owner].skeletron = false;
48188 }
48189 if (Main.player[owner].skeletron)
48190 {
48191 timeLeft = 2;
48192 }
48193 }
48194 if (type == 198)
48195 {
48196 if (Main.player[owner].dead)
48197 {
48198 Main.player[owner].hornet = false;
48199 }
48200 if (Main.player[owner].hornet)
48201 {
48202 timeLeft = 2;
48203 }
48204 }
48205 if (type == 199)
48206 {
48207 if (Main.player[owner].dead)
48208 {
48209 Main.player[owner].tiki = false;
48210 }
48211 if (Main.player[owner].tiki)
48212 {
48213 timeLeft = 2;
48214 }
48215 }
48216 if (type == 200)
48217 {
48218 if (Main.player[owner].dead)
48219 {
48220 Main.player[owner].lizard = false;
48221 }
48222 if (Main.player[owner].lizard)
48223 {
48224 timeLeft = 2;
48225 }
48226 }
48227 if (type == 208)
48228 {
48229 if (Main.player[owner].dead)
48230 {
48231 Main.player[owner].parrot = false;
48232 }
48233 if (Main.player[owner].parrot)
48234 {
48235 timeLeft = 2;
48236 }
48237 }
48238 if (type == 209)
48239 {
48240 if (Main.player[owner].dead)
48241 {
48242 Main.player[owner].truffle = false;
48243 }
48244 if (Main.player[owner].truffle)
48245 {
48246 timeLeft = 2;
48247 }
48248 }
48249 if (type == 210)
48250 {
48251 if (Main.player[owner].dead)
48252 {
48253 Main.player[owner].sapling = false;
48254 }
48255 if (Main.player[owner].sapling)
48256 {
48257 timeLeft = 2;
48258 }
48259 }
48260 if (type == 324)
48261 {
48262 if (Main.player[owner].dead)
48263 {
48264 Main.player[owner].cSapling = false;
48265 }
48266 if (Main.player[owner].cSapling)
48267 {
48268 timeLeft = 2;
48269 }
48270 }
48271 if (type == 313)
48272 {
48273 if (Main.player[owner].dead)
48274 {
48275 Main.player[owner].spider = false;
48276 }
48277 if (Main.player[owner].spider)
48278 {
48279 timeLeft = 2;
48280 }
48281 }
48282 if (type == 314)
48283 {
48284 if (Main.player[owner].dead)
48285 {
48286 Main.player[owner].squashling = false;
48287 }
48288 if (Main.player[owner].squashling)
48289 {
48290 timeLeft = 2;
48291 }
48292 }
48293 if (type == 211)
48294 {
48295 if (Main.player[owner].dead)
48296 {
48297 Main.player[owner].wisp = false;
48298 }
48299 if (Main.player[owner].wisp)
48300 {
48301 timeLeft = 2;
48302 }
48303 }
48304 if (type == 236)
48305 {
48306 if (Main.player[owner].dead)
48307 {
48308 Main.player[owner].dino = false;
48309 }
48310 if (Main.player[owner].dino)
48311 {
48312 timeLeft = 2;
48313 }
48314 }
48315 if (type == 499)
48316 {
48317 if (Main.player[owner].dead)
48318 {
48319 Main.player[owner].babyFaceMonster = false;
48320 }
48321 if (Main.player[owner].babyFaceMonster)
48322 {
48323 timeLeft = 2;
48324 }
48325 }
48326 if (type == 765)
48327 {
48328 if (Main.player[owner].dead)
48329 {
48330 Main.player[owner].petFlagSugarGlider = false;
48331 }
48332 if (Main.player[owner].petFlagSugarGlider)
48333 {
48334 timeLeft = 2;
48335 }
48336 }
48337 if (type == 266)
48338 {
48339 if (Main.player[owner].dead)
48340 {
48341 Main.player[owner].slime = false;
48342 }
48343 if (Main.player[owner].slime)
48344 {
48345 timeLeft = 2;
48346 }
48347 }
48348 if (type == 268)
48349 {
48350 if (Main.player[owner].dead)
48351 {
48352 Main.player[owner].eyeSpring = false;
48353 }
48354 if (Main.player[owner].eyeSpring)
48355 {
48356 timeLeft = 2;
48357 }
48358 }
48359 if (type == 269)
48360 {
48361 if (Main.player[owner].dead)
48362 {
48363 Main.player[owner].snowman = false;
48364 }
48365 if (Main.player[owner].snowman)
48366 {
48367 timeLeft = 2;
48368 }
48369 }
48370 if (type == 319)
48371 {
48372 if (Main.player[owner].dead)
48373 {
48374 Main.player[owner].blackCat = false;
48375 }
48376 if (Main.player[owner].blackCat)
48377 {
48378 timeLeft = 2;
48379 }
48380 }
48381 if (type == 380)
48382 {
48383 if (Main.player[owner].dead)
48384 {
48385 Main.player[owner].zephyrfish = false;
48386 }
48387 if (Main.player[owner].zephyrfish)
48388 {
48389 timeLeft = 2;
48390 }
48391 }
48392 if (type == 774)
48393 {
48394 if (Main.player[owner].dead)
48395 {
48396 Main.player[owner].petFlagBabyShark = false;
48397 }
48398 if (Main.player[owner].petFlagBabyShark)
48399 {
48400 timeLeft = 2;
48401 }
48402 }
48403 if (type == 815)
48404 {
48405 if (Main.player[owner].dead)
48406 {
48407 Main.player[owner].petFlagLilHarpy = false;
48408 }
48409 if (Main.player[owner].petFlagLilHarpy)
48410 {
48411 timeLeft = 2;
48412 }
48413 }
48414 if (type == 816)
48415 {
48416 if (Main.player[owner].dead)
48417 {
48418 Main.player[owner].petFlagFennecFox = false;
48419 }
48420 if (Main.player[owner].petFlagFennecFox)
48421 {
48422 timeLeft = 2;
48423 }
48424 }
48425 if (type == 817)
48426 {
48427 if (Main.player[owner].dead)
48428 {
48429 Main.player[owner].petFlagGlitteryButterfly = false;
48430 }
48431 if (Main.player[owner].petFlagGlitteryButterfly)
48432 {
48433 timeLeft = 2;
48434 }
48435 }
48436 if (type == 821)
48437 {
48438 if (Main.player[owner].dead)
48439 {
48440 Main.player[owner].petFlagBabyImp = false;
48441 }
48442 if (Main.player[owner].petFlagBabyImp)
48443 {
48444 timeLeft = 2;
48445 }
48446 }
48447 if (type == 825)
48448 {
48449 if (Main.player[owner].dead)
48450 {
48451 Main.player[owner].petFlagBabyRedPanda = false;
48452 }
48453 if (Main.player[owner].petFlagBabyRedPanda)
48454 {
48455 timeLeft = 2;
48456 }
48457 }
48458 if (type == 854)
48459 {
48460 if (Main.player[owner].dead)
48461 {
48462 Main.player[owner].petFlagPlantero = false;
48463 }
48464 if (Main.player[owner].petFlagPlantero)
48465 {
48466 timeLeft = 2;
48467 }
48468 }
48469 if (type == 858)
48470 {
48471 if (Main.player[owner].dead)
48472 {
48473 Main.player[owner].petFlagDynamiteKitten = false;
48474 }
48475 if (Main.player[owner].petFlagDynamiteKitten)
48476 {
48477 timeLeft = 2;
48478 }
48479 }
48480 if (type == 859)
48481 {
48482 if (Main.player[owner].dead)
48483 {
48484 Main.player[owner].petFlagBabyWerewolf = false;
48485 }
48486 if (Main.player[owner].petFlagBabyWerewolf)
48487 {
48488 timeLeft = 2;
48489 }
48490 }
48491 if (type == 860)
48492 {
48493 if (Main.player[owner].dead)
48494 {
48495 Main.player[owner].petFlagShadowMimic = false;
48496 }
48497 if (Main.player[owner].petFlagShadowMimic)
48498 {
48499 timeLeft = 2;
48500 }
48501 }
48502 if (type == 875)
48503 {
48504 if (Main.player[owner].dead)
48505 {
48506 Main.player[owner].petFlagVoltBunny = false;
48507 }
48508 if (Main.player[owner].petFlagVoltBunny)
48509 {
48510 timeLeft = 2;
48511 }
48512 }
48513 if (type == 881)
48514 {
48515 if (Main.player[owner].dead)
48516 {
48517 Main.player[owner].petFlagKingSlimePet = false;
48518 }
48519 if (Main.player[owner].petFlagKingSlimePet)
48520 {
48521 timeLeft = 2;
48522 }
48523 }
48524 if (type == 884)
48525 {
48526 if (Main.player[owner].dead)
48527 {
48528 Main.player[owner].petFlagBrainOfCthulhuPet = false;
48529 }
48530 if (Main.player[owner].petFlagBrainOfCthulhuPet)
48531 {
48532 timeLeft = 2;
48533 }
48534 }
48535 if (type == 885)
48536 {
48537 if (Main.player[owner].dead)
48538 {
48539 Main.player[owner].petFlagSkeletronPet = false;
48540 }
48541 if (Main.player[owner].petFlagSkeletronPet)
48542 {
48543 timeLeft = 2;
48544 }
48545 }
48546 if (type == 886)
48547 {
48548 if (Main.player[owner].dead)
48549 {
48550 Main.player[owner].petFlagQueenBeePet = false;
48551 }
48552 if (Main.player[owner].petFlagQueenBeePet)
48553 {
48554 timeLeft = 2;
48555 }
48556 }
48557 if (type == 889)
48558 {
48559 if (Main.player[owner].dead)
48560 {
48561 Main.player[owner].petFlagSkeletronPrimePet = false;
48562 }
48563 if (Main.player[owner].petFlagSkeletronPrimePet)
48564 {
48565 timeLeft = 2;
48566 }
48567 }
48568 if (type == 890)
48569 {
48570 if (Main.player[owner].dead)
48571 {
48572 Main.player[owner].petFlagPlanteraPet = false;
48573 }
48574 if (Main.player[owner].petFlagPlanteraPet)
48575 {
48576 timeLeft = 2;
48577 }
48578 }
48579 if (type == 891)
48580 {
48581 if (Main.player[owner].dead)
48582 {
48583 Main.player[owner].petFlagGolemPet = false;
48584 }
48585 if (Main.player[owner].petFlagGolemPet)
48586 {
48587 timeLeft = 2;
48588 }
48589 }
48590 if (type == 892)
48591 {
48592 if (Main.player[owner].dead)
48593 {
48594 Main.player[owner].petFlagDukeFishronPet = false;
48595 }
48596 if (Main.player[owner].petFlagDukeFishronPet)
48597 {
48598 timeLeft = 2;
48599 }
48600 }
48601 if (type == 894)
48602 {
48603 if (Main.player[owner].dead)
48604 {
48605 Main.player[owner].petFlagMoonLordPet = false;
48606 }
48607 if (Main.player[owner].petFlagMoonLordPet)
48608 {
48609 timeLeft = 2;
48610 }
48611 }
48612 if (type == 897)
48613 {
48614 if (Main.player[owner].dead)
48615 {
48616 Main.player[owner].petFlagEverscreamPet = false;
48617 }
48618 if (Main.player[owner].petFlagEverscreamPet)
48619 {
48620 timeLeft = 2;
48621 }
48622 }
48623 if (type == 899)
48624 {
48625 if (Main.player[owner].dead)
48626 {
48627 Main.player[owner].petFlagMartianPet = false;
48628 }
48629 if (Main.player[owner].petFlagMartianPet)
48630 {
48631 timeLeft = 2;
48632 }
48633 }
48634 if (type == 900)
48635 {
48636 if (Main.player[owner].dead)
48637 {
48638 Main.player[owner].petFlagDD2OgrePet = false;
48639 }
48640 if (Main.player[owner].petFlagDD2OgrePet)
48641 {
48642 timeLeft = 2;
48643 }
48644 }
48645 if (type == 901)
48646 {
48647 if (Main.player[owner].dead)
48648 {
48649 Main.player[owner].petFlagDD2BetsyPet = false;
48650 }
48651 if (Main.player[owner].petFlagDD2BetsyPet)
48652 {
48653 timeLeft = 2;
48654 }
48655 }
48656 if (type == 934)
48657 {
48658 if (Main.player[owner].dead)
48659 {
48660 Main.player[owner].petFlagQueenSlimePet = false;
48661 }
48662 if (Main.player[owner].petFlagQueenSlimePet)
48663 {
48664 timeLeft = 2;
48665 }
48666 }
48667 if (type == 956)
48668 {
48669 if (Main.player[owner].dead)
48670 {
48671 Main.player[owner].petFlagBerniePet = false;
48672 }
48673 if (Main.player[owner].petFlagBerniePet)
48674 {
48675 timeLeft = 2;
48676 }
48677 }
48678 if (type == 958)
48679 {
48680 if (Main.player[owner].dead)
48681 {
48682 Main.player[owner].petFlagDeerclopsPet = false;
48683 }
48684 if (Main.player[owner].petFlagDeerclopsPet)
48685 {
48686 timeLeft = 2;
48687 }
48688 }
48689 if (type == 959)
48690 {
48691 if (Main.player[owner].dead)
48692 {
48693 Main.player[owner].petFlagPigPet = false;
48694 }
48695 if (Main.player[owner].petFlagPigPet)
48696 {
48697 timeLeft = 2;
48698 }
48699 }
48700 if (type == 960)
48701 {
48702 if (Main.player[owner].dead)
48703 {
48704 Main.player[owner].petFlagChesterPet = false;
48705 }
48706 if (Main.player[owner].petFlagChesterPet)
48707 {
48708 timeLeft = 2;
48709 }
48710 }
48711 if (type == 994)
48712 {
48713 if (Main.player[owner].dead)
48714 {
48715 Main.player[owner].petFlagJunimoPet = false;
48716 }
48717 if (Main.player[owner].petFlagJunimoPet)
48718 {
48719 timeLeft = 2;
48720 }
48721 }
48722 if (type == 998)
48723 {
48724 if (Main.player[owner].dead)
48725 {
48726 Main.player[owner].petFlagBlueChickenPet = false;
48727 }
48728 if (Main.player[owner].petFlagBlueChickenPet)
48729 {
48730 timeLeft = 2;
48731 }
48732 }
48733 if (type == 1003)
48734 {
48735 if (Main.player[owner].dead)
48736 {
48737 Main.player[owner].petFlagSpiffo = false;
48738 }
48739 if (Main.player[owner].petFlagSpiffo)
48740 {
48741 timeLeft = 2;
48742 }
48743 }
48744 if (type == 1004)
48745 {
48746 if (Main.player[owner].dead)
48747 {
48748 Main.player[owner].petFlagCaveling = false;
48749 }
48750 if (Main.player[owner].petFlagCaveling)
48751 {
48752 timeLeft = 2;
48753 }
48754 }
48755 if (flag6)
48756 {
48757 if (Main.player[owner].dead)
48758 {
48759 Main.player[owner].pygmy = false;
48760 }
48761 if (Main.player[owner].pygmy)
48762 {
48763 timeLeft = Main.rand.Next(2, 10);
48764 }
48765 }
48766 if (type >= 390 && type <= 392)
48767 {
48768 if (Main.player[owner].dead)
48769 {
48770 Main.player[owner].spiderMinion = false;
48771 }
48772 if (Main.player[owner].spiderMinion)
48773 {
48774 timeLeft = 2;
48775 }
48776 }
48777 if (type == 398)
48778 {
48779 if (Main.player[owner].dead)
48780 {
48781 Main.player[owner].miniMinotaur = false;
48782 }
48783 if (Main.player[owner].miniMinotaur)
48784 {
48785 timeLeft = 2;
48786 }
48787 }
48788 if (flag7)
48789 {
48790 timeLeft = 2;
48791 }
48792 if (flag6 || type == 266 || (type >= 390 && type <= 392))
48793 {
48794 num = 10;
48795 int num3 = 40 * (minionPos + 1) * Main.player[owner].direction;
48796 if (Main.player[owner].position.X + (float)(Main.player[owner].width / 2) < position.X + (float)(width / 2) - (float)num + (float)num3)
48797 {
48798 flag2 = true;
48799 }
48800 else if (Main.player[owner].position.X + (float)(Main.player[owner].width / 2) > position.X + (float)(width / 2) + (float)num + (float)num3)
48801 {
48802 flag3 = true;
48803 }
48804 }
48805 else if (type == 891)
48806 {
48807 num = 30;
48808 float num4 = -50 * -Main.player[owner].direction;
48809 float num5 = Main.player[owner].Center.X + num4;
48810 if (num5 < position.X + (float)(width / 2) - (float)num)
48811 {
48812 flag2 = true;
48813 }
48814 else if (num5 > position.X + (float)(width / 2) + (float)num)
48815 {
48816 flag3 = true;
48817 }
48818 }
48819 else if (type == 960 && !flag7)
48820 {
48821 num = 10;
48822 Player player = Main.player[owner];
48823 int num6 = ((player.Center.X - base.Center.X > 0f) ? 1 : (-1));
48824 if (player.velocity.X != 0f)
48825 {
48826 num6 = player.direction;
48827 }
48828 float num7 = -70 * num6;
48829 float num8 = player.Center.X + num7;
48830 if (num8 < base.Center.X - (float)num)
48831 {
48832 flag2 = true;
48833 }
48834 else if (num8 > base.Center.X + (float)num)
48835 {
48836 flag3 = true;
48837 }
48838 }
48839 else if (Main.player[owner].position.X + (float)(Main.player[owner].width / 2) < position.X + (float)(width / 2) - (float)num)
48840 {
48841 flag2 = true;
48842 }
48843 else if (Main.player[owner].position.X + (float)(Main.player[owner].width / 2) > position.X + (float)(width / 2) + (float)num)
48844 {
48845 flag3 = true;
48846 }
48847 if (num2)
48848 {
48849 flag2 = false;
48850 flag3 = true;
48851 num = 30;
48852 }
48853 if (flag8)
48854 {
48855 flag2 = false;
48856 flag3 = false;
48857 }
48858 if (type == 175)
48859 {
48860 float num9 = 0.1f;
48861 tileCollide = false;
48862 int num10 = 300;
48863 Vector2 vector = new Vector2(position.X + (float)width * 0.5f, position.Y + (float)height * 0.5f);
48864 float num11 = Main.player[owner].position.X + (float)(Main.player[owner].width / 2) - vector.X;
48865 float num12 = Main.player[owner].position.Y + (float)(Main.player[owner].height / 2) - vector.Y;
48866 if (type == 127)
48867 {
48868 num12 = Main.player[owner].position.Y - vector.Y;
48869 }
48870 float num13 = (float)Math.Sqrt(num11 * num11 + num12 * num12);
48871 float num14 = 7f;
48872 float num15 = 2000f;
48873 bool num16 = num13 > num15;
48874 if (num13 < (float)num10 && Main.player[owner].velocity.Y == 0f && position.Y + (float)height <= Main.player[owner].position.Y + (float)Main.player[owner].height && !Collision.SolidCollision(position, width, height))
48875 {
48876 ai[0] = 0f;
48877 if (velocity.Y < -6f)
48878 {
48879 velocity.Y = -6f;
48880 }
48881 }
48882 if (num13 < 150f)
48883 {
48884 if (Math.Abs(velocity.X) > 2f || Math.Abs(velocity.Y) > 2f)
48885 {
48886 velocity *= 0.99f;
48887 }
48888 num9 = 0.01f;
48889 if (num11 < -2f)
48890 {
48891 num11 = -2f;
48892 }
48893 if (num11 > 2f)
48894 {
48895 num11 = 2f;
48896 }
48897 if (num12 < -2f)
48898 {
48899 num12 = -2f;
48900 }
48901 if (num12 > 2f)
48902 {
48903 num12 = 2f;
48904 }
48905 }
48906 else
48907 {
48908 if (num13 > 300f)
48909 {
48910 num9 = 0.2f;
48911 }
48912 num13 = num14 / num13;
48913 num11 *= num13;
48914 num12 *= num13;
48915 }
48916 if (num16)
48917 {
48918 int num17 = 17;
48919 for (int i = 0; i < 12; i++)
48920 {
48921 float speedX = 1f - Main.rand.NextFloat() * 2f;
48922 float speedY = 1f - Main.rand.NextFloat() * 2f;
48923 int num18 = Dust.NewDust(position, width, height, num17, speedX, speedY);
48924 Main.dust[num18].noLightEmittence = true;
48925 Main.dust[num18].noGravity = true;
48926 }
48927 base.Center = Main.player[owner].Center;
48929 if (Main.myPlayer == owner)
48930 {
48931 netUpdate = true;
48932 }
48933 }
48934 if (Math.Abs(num11) > Math.Abs(num12) || num9 == 0.05f)
48935 {
48936 if (velocity.X < num11)
48937 {
48938 velocity.X += num9;
48939 if (num9 > 0.05f && velocity.X < 0f)
48940 {
48941 velocity.X += num9;
48942 }
48943 }
48944 if (velocity.X > num11)
48945 {
48946 velocity.X -= num9;
48947 if (num9 > 0.05f && velocity.X > 0f)
48948 {
48949 velocity.X -= num9;
48950 }
48951 }
48952 }
48953 if (Math.Abs(num11) <= Math.Abs(num12) || num9 == 0.05f)
48954 {
48955 if (velocity.Y < num12)
48956 {
48957 velocity.Y += num9;
48958 if (num9 > 0.05f && velocity.Y < 0f)
48959 {
48960 velocity.Y += num9;
48961 }
48962 }
48963 if (velocity.Y > num12)
48964 {
48965 velocity.Y -= num9;
48966 if (num9 > 0.05f && velocity.Y > 0f)
48967 {
48968 velocity.Y -= num9;
48969 }
48970 }
48971 }
48972 rotation = (float)Math.Atan2(velocity.Y, velocity.X) - 1.57f;
48973 frameCounter++;
48974 if (frameCounter > 6)
48975 {
48976 frame++;
48977 frameCounter = 0;
48978 }
48979 if (frame > 1)
48980 {
48981 frame = 0;
48982 }
48983 return;
48984 }
48985 if (type == 197)
48986 {
48987 float num19 = 0.1f;
48988 tileCollide = false;
48989 int num20 = 300;
48990 Vector2 vector2 = new Vector2(position.X + (float)width * 0.5f, position.Y + (float)height * 0.5f);
48991 float num21 = Main.player[owner].position.X + (float)(Main.player[owner].width / 2) - vector2.X;
48992 float num22 = Main.player[owner].position.Y + (float)(Main.player[owner].height / 2) - vector2.Y;
48993 if (type == 127)
48994 {
48995 num22 = Main.player[owner].position.Y - vector2.Y;
48996 }
48997 float num23 = (float)Math.Sqrt(num21 * num21 + num22 * num22);
48998 float num24 = 3f;
48999 if (num23 > 500f)
49000 {
49001 localAI[0] = 10000f;
49002 }
49003 if (localAI[0] >= 10000f)
49004 {
49005 num24 = 14f;
49006 }
49007 float num25 = 2000f;
49008 bool num26 = num23 > num25;
49009 if (num23 < (float)num20 && Main.player[owner].velocity.Y == 0f && position.Y + (float)height <= Main.player[owner].position.Y + (float)Main.player[owner].height && !Collision.SolidCollision(position, width, height))
49010 {
49011 ai[0] = 0f;
49012 if (velocity.Y < -6f)
49013 {
49014 velocity.Y = -6f;
49015 }
49016 }
49017 if (num23 < 150f)
49018 {
49019 if (Math.Abs(velocity.X) > 2f || Math.Abs(velocity.Y) > 2f)
49020 {
49021 velocity *= 0.99f;
49022 }
49023 num19 = 0.01f;
49024 if (num21 < -2f)
49025 {
49026 num21 = -2f;
49027 }
49028 if (num21 > 2f)
49029 {
49030 num21 = 2f;
49031 }
49032 if (num22 < -2f)
49033 {
49034 num22 = -2f;
49035 }
49036 if (num22 > 2f)
49037 {
49038 num22 = 2f;
49039 }
49040 }
49041 else
49042 {
49043 if (num23 > 300f)
49044 {
49045 num19 = 0.2f;
49046 }
49047 num23 = num24 / num23;
49048 num21 *= num23;
49049 num22 *= num23;
49050 }
49051 if (num26)
49052 {
49053 int num27 = 26;
49054 for (int j = 0; j < 12; j++)
49055 {
49056 float speedX2 = 1f - Main.rand.NextFloat() * 2f;
49057 float speedY2 = 1f - Main.rand.NextFloat() * 2f;
49058 int num28 = Dust.NewDust(position, width, height, num27, speedX2, speedY2);
49059 Main.dust[num28].noLightEmittence = true;
49060 Main.dust[num28].noGravity = true;
49061 }
49062 base.Center = Main.player[owner].Center;
49064 if (Main.myPlayer == owner)
49065 {
49066 netUpdate = true;
49067 }
49068 }
49069 if (velocity.X < num21)
49070 {
49071 velocity.X += num19;
49072 if (num19 > 0.05f && velocity.X < 0f)
49073 {
49074 velocity.X += num19;
49075 }
49076 }
49077 if (velocity.X > num21)
49078 {
49079 velocity.X -= num19;
49080 if (num19 > 0.05f && velocity.X > 0f)
49081 {
49082 velocity.X -= num19;
49083 }
49084 }
49085 if (velocity.Y < num22)
49086 {
49087 velocity.Y += num19;
49088 if (num19 > 0.05f && velocity.Y < 0f)
49089 {
49090 velocity.Y += num19;
49091 }
49092 }
49093 if (velocity.Y > num22)
49094 {
49095 velocity.Y -= num19;
49096 if (num19 > 0.05f && velocity.Y > 0f)
49097 {
49098 velocity.Y -= num19;
49099 }
49100 }
49101 localAI[0] += Main.rand.Next(10);
49102 if (localAI[0] > 10000f)
49103 {
49104 if (localAI[1] == 0f)
49105 {
49106 if (velocity.X < 0f)
49107 {
49108 localAI[1] = -1f;
49109 }
49110 else
49111 {
49112 localAI[1] = 1f;
49113 }
49114 }
49115 rotation += 0.25f * localAI[1];
49116 if (localAI[0] > 12000f)
49117 {
49118 localAI[0] = 0f;
49119 }
49120 }
49121 else
49122 {
49123 localAI[1] = 0f;
49124 float num29 = velocity.X * 0.1f;
49125 if (rotation > num29)
49126 {
49127 rotation -= (Math.Abs(velocity.X) + Math.Abs(velocity.Y)) * 0.01f;
49128 if (rotation < num29)
49129 {
49130 rotation = num29;
49131 }
49132 }
49133 if (rotation < num29)
49134 {
49135 rotation += (Math.Abs(velocity.X) + Math.Abs(velocity.Y)) * 0.01f;
49136 if (rotation > num29)
49137 {
49138 rotation = num29;
49139 }
49140 }
49141 }
49142 if ((double)rotation > 6.28)
49143 {
49144 rotation -= 6.28f;
49145 }
49146 if ((double)rotation < -6.28)
49147 {
49148 rotation += 6.28f;
49149 }
49150 return;
49151 }
49152 if (type == 198 || type == 380 || type == 774 || type == 815 || type == 817 || type == 886 || type == 892 || type == 894 || type == 901)
49153 {
49154 float num30 = 0.4f;
49155 if (type == 380)
49156 {
49157 num30 = 0.3f;
49158 }
49159 if (type == 774)
49160 {
49161 num30 = 0.3f;
49162 }
49163 tileCollide = false;
49164 int num31 = 100;
49165 float num32 = 50f;
49166 float num33 = 400f;
49167 float num34 = num33 / 2f;
49168 float num35 = 2000f;
49169 bool flag9 = false;
49170 Vector2 vector3 = new Vector2(position.X + (float)width * 0.5f, position.Y + (float)height * 0.5f);
49171 float num36 = Main.player[owner].position.X + (float)(Main.player[owner].width / 2) - vector3.X;
49172 float num37 = Main.player[owner].position.Y + (float)(Main.player[owner].height / 2) - vector3.Y;
49173 if (type == 774)
49174 {
49175 num32 = 2f;
49176 float num38 = (float)Math.Sin((float)Math.PI * 2f * ((float)Main.player[owner].miscCounter / 60f));
49177 float num39 = Utils.GetLerpValue(0.5f, 1f, num38, clamped: true);
49178 if (new Vector2(num36 - (float)(70 * Main.player[owner].direction), num37 - 60f).Length() > 50f)
49179 {
49180 num38 = 0f;
49181 num39 = 0f;
49182 }
49183 num37 += -60f + num39 * -8f + num38 * 8f;
49184 num36 += (float)(70 * -Main.player[owner].direction);
49185 }
49186 else
49187 {
49188 if (type != 892 && type != 894)
49189 {
49190 num37 += (float)Main.rand.Next(-10, 21);
49191 num36 += (float)Main.rand.Next(-10, 21);
49192 }
49193 num36 += (float)(60 * -Main.player[owner].direction);
49194 num37 -= 60f;
49195 }
49197 if (type == 127)
49198 {
49199 num37 = Main.player[owner].position.Y - vector3.Y;
49200 }
49201 float num40 = (float)Math.Sqrt(num36 * num36 + num37 * num37);
49202 float num41 = num40;
49203 float num42 = 14f;
49204 if (type == 380)
49205 {
49206 num42 = 6f;
49207 }
49208 if (type == 815 || type == 817)
49209 {
49210 num42 = ((!(num40 < num33)) ? 10f : 6f);
49211 }
49212 if (type == 892 || type == 894 || type == 901)
49213 {
49214 if (num40 < num34)
49215 {
49216 num42 = 6f;
49217 }
49218 num42 = ((!(num40 < num33)) ? 12f : 9f);
49219 }
49220 if (type == 774)
49221 {
49222 num42 = 5f;
49223 }
49224 if (num40 < (float)num31 && Main.player[owner].velocity.Y == 0f && position.Y + (float)height <= Main.player[owner].position.Y + (float)Main.player[owner].height && !Collision.SolidCollision(position, width, height))
49225 {
49226 ai[0] = 0f;
49227 if (velocity.Y < -6f)
49228 {
49229 velocity.Y = -6f;
49230 }
49231 }
49232 if (num40 < num32)
49233 {
49234 if (Math.Abs(velocity.X) > 2f || Math.Abs(velocity.Y) > 2f)
49235 {
49236 if (type == 892 || type == 892)
49237 {
49238 velocity *= 0.95f;
49239 }
49240 else
49241 {
49242 velocity *= 0.99f;
49243 }
49244 }
49245 num30 = 0.01f;
49246 }
49247 else
49248 {
49249 if (type == 892 || type == 894 || type == 901)
49250 {
49251 if (num40 < 100f)
49252 {
49253 num30 = 0.1f;
49254 }
49255 if (num40 > num35)
49256 {
49257 flag9 = true;
49258 }
49259 else if (num40 > num33)
49260 {
49261 num30 = 0.7f;
49262 }
49263 else if (num40 > num34)
49264 {
49265 num30 = 0.5f;
49266 }
49267 }
49268 else if (type == 815 || type == 817)
49269 {
49270 if (num40 < 100f)
49271 {
49272 num30 = 0.1f;
49273 }
49274 if (num40 > num35)
49275 {
49276 flag9 = true;
49277 }
49278 else if (type != 815 && num40 > num33)
49279 {
49280 num30 = 0.5f;
49281 }
49282 }
49283 else if (type == 380)
49284 {
49285 if (num40 < 100f)
49286 {
49287 num30 = 0.1f;
49288 }
49289 if (num40 > 300f)
49290 {
49291 num30 = 0.4f;
49292 }
49293 if (num40 > num35)
49294 {
49295 flag9 = true;
49296 }
49297 }
49298 else if (type == 198 || type == 886)
49299 {
49300 if (num40 < 100f)
49301 {
49302 num30 = 0.1f;
49303 }
49304 if (num40 > 300f)
49305 {
49306 num30 = 0.6f;
49307 }
49308 if (num40 > num35)
49309 {
49310 flag9 = true;
49311 }
49312 }
49313 else if (type == 774)
49314 {
49315 if (num40 < 40f)
49316 {
49317 num30 = 0.1f;
49318 }
49319 if (num40 > 300f)
49320 {
49321 num30 = 0.6f;
49322 }
49323 if (num40 > num35)
49324 {
49325 flag9 = true;
49326 }
49327 }
49328 num40 = num42 / num40;
49329 num36 *= num40;
49330 num37 *= num40;
49331 }
49332 if (velocity.X < num36)
49333 {
49334 velocity.X += num30;
49335 if (num30 > 0.05f && velocity.X < 0f)
49336 {
49337 velocity.X += num30;
49338 }
49339 }
49340 if (velocity.X > num36)
49341 {
49342 velocity.X -= num30;
49343 if (num30 > 0.05f && velocity.X > 0f)
49344 {
49345 velocity.X -= num30;
49346 }
49347 }
49348 if (velocity.Y < num37)
49349 {
49350 velocity.Y += num30;
49351 if (num30 > 0.05f && velocity.Y < 0f)
49352 {
49353 velocity.Y += num30 * 2f;
49354 }
49355 }
49356 if (velocity.Y > num37)
49357 {
49358 velocity.Y -= num30;
49359 if (num30 > 0.05f && velocity.Y > 0f)
49360 {
49361 velocity.Y -= num30 * 2f;
49362 }
49363 }
49364 if ((double)velocity.X > 0.25)
49365 {
49366 direction = -1;
49367 }
49368 else if ((double)velocity.X < -0.25)
49369 {
49370 direction = 1;
49371 }
49373 rotation = velocity.X * 0.05f;
49374 if (flag9)
49375 {
49376 int num43 = 33;
49377 if (type == 198 || type == 886)
49378 {
49379 num43 = 147;
49380 }
49381 if (type == 815)
49382 {
49383 num43 = 31;
49384 }
49385 if (type == 817)
49386 {
49387 num43 = 21;
49388 }
49389 for (int k = 0; k < 12; k++)
49390 {
49391 float speedX3 = 1f - Main.rand.NextFloat() * 2f;
49392 float speedY3 = 1f - Main.rand.NextFloat() * 2f;
49393 int num44 = Dust.NewDust(position, width, height, num43, speedX3, speedY3);
49394 Main.dust[num44].noLightEmittence = true;
49395 Main.dust[num44].noGravity = true;
49396 }
49397 base.Center = Main.player[owner].Center;
49399 if (Main.myPlayer == owner)
49400 {
49401 netUpdate = true;
49402 }
49403 }
49404 bool flag10 = false;
49405 int num45 = 3;
49406 int num46 = 0;
49407 int num47 = 3;
49408 if (type == 380)
49409 {
49410 num45 = 6;
49411 }
49412 if (type == 815)
49413 {
49414 num45 = 5;
49415 num46 = 0;
49416 num47 = 5;
49417 if (num41 > num33)
49418 {
49419 num46 = 6;
49420 num47 = 9;
49421 }
49422 }
49423 if (type == 817)
49424 {
49425 num45 = 5;
49426 num46 = 0;
49427 num47 = 2;
49428 flag10 = true;
49429 }
49430 if (type == 901)
49431 {
49432 num45 = 4;
49433 num46 = 0;
49434 num47 = 5;
49435 if (num41 > num33 / 2f)
49436 {
49437 num45 = 3;
49438 num46 = 6;
49439 num47 = 11;
49440 }
49441 }
49442 if (type == 892)
49443 {
49444 num45 = 6;
49445 num46 = 0;
49446 num47 = Main.projFrames[type] - 1;
49447 }
49448 if (type == 886 || type == 894)
49449 {
49450 num45 = 4;
49451 num46 = 0;
49452 num47 = Main.projFrames[type] - 1;
49453 }
49454 if (type == 774)
49455 {
49456 if (Main.player[owner].velocity.Length() < 2f && vector4.Length() < 10f)
49457 {
49458 direction = -Main.player[owner].direction;
49460 }
49461 num45 = 6;
49462 if (!wet)
49463 {
49464 num46 += 4;
49465 num47 += 4;
49466 }
49467 rotation = velocity.X * 0.05f + Math.Abs(velocity.Y * -0.05f);
49468 }
49469 if (flag10)
49470 {
49471 int num48 = num45 * (num47 - num46) * 2;
49472 frameCounter++;
49473 if (frameCounter >= num48)
49474 {
49475 frameCounter = 0;
49476 }
49478 if (frame > num47)
49479 {
49480 frame = num47 + (num47 - frame);
49481 }
49483 }
49484 else if (++frameCounter >= num45)
49485 {
49486 frameCounter = 0;
49487 frame++;
49489 {
49490 frame = num46;
49491 }
49492 }
49493 return;
49494 }
49495 if (type == 211)
49496 {
49497 float num49 = 0.2f;
49498 float num50 = 5f;
49499 tileCollide = false;
49500 Vector2 vector5 = new Vector2(position.X + (float)width * 0.5f, position.Y + (float)height * 0.5f);
49501 float num51 = Main.player[owner].position.X + (float)(Main.player[owner].width / 2) - vector5.X;
49502 float num52 = Main.player[owner].position.Y + Main.player[owner].gfxOffY + (float)(Main.player[owner].height / 2) - vector5.Y;
49503 if (Main.player[owner].controlLeft)
49504 {
49505 num51 -= 120f;
49506 }
49507 else if (Main.player[owner].controlRight)
49508 {
49509 num51 += 120f;
49510 }
49511 if (Main.player[owner].controlDown)
49512 {
49513 num52 += 120f;
49514 }
49515 else
49516 {
49517 if (Main.player[owner].controlUp)
49518 {
49519 num52 -= 120f;
49520 }
49521 num52 -= 60f;
49522 }
49523 float num53 = (float)Math.Sqrt(num51 * num51 + num52 * num52);
49524 if (num53 > 1000f)
49525 {
49526 position.X += num51;
49527 position.Y += num52;
49528 }
49529 if (localAI[0] == 1f)
49530 {
49531 if (num53 < 10f)
49532 {
49533 Player player2 = Main.player[owner];
49534 if (Math.Abs(player2.velocity.X) + Math.Abs(player2.velocity.Y) < num50 && (player2.velocity.Y == 0f || (player2.mount.Active && player2.mount.CanFly())))
49535 {
49536 localAI[0] = 0f;
49537 }
49538 }
49539 num50 = 12f;
49540 if (num53 < num50)
49541 {
49542 velocity.X = num51;
49543 velocity.Y = num52;
49544 }
49545 else
49546 {
49547 num53 = num50 / num53;
49548 velocity.X = num51 * num53;
49549 velocity.Y = num52 * num53;
49550 }
49551 if ((double)velocity.X > 0.5)
49552 {
49553 direction = -1;
49554 }
49555 else if ((double)velocity.X < -0.5)
49556 {
49557 direction = 1;
49558 }
49560 rotation -= (0.2f + Math.Abs(velocity.X) * 0.025f) * (float)direction;
49561 frameCounter++;
49562 if (frameCounter > 3)
49563 {
49564 frame++;
49565 frameCounter = 0;
49566 }
49567 if (frame < 5)
49568 {
49569 frame = 5;
49570 }
49571 if (frame > 9)
49572 {
49573 frame = 5;
49574 }
49575 for (int l = 0; l < 2; l++)
49576 {
49577 int num54 = Dust.NewDust(new Vector2(position.X + 3f, position.Y + 4f), 14, 14, 156);
49578 Main.dust[num54].velocity *= 0.2f;
49579 Main.dust[num54].noGravity = true;
49580 Main.dust[num54].scale = 1.25f;
49581 Main.dust[num54].shader = GameShaders.Armor.GetSecondaryShader(Main.player[owner].cLight, Main.player[owner]);
49582 }
49583 return;
49584 }
49585 if (num53 > 200f)
49586 {
49587 localAI[0] = 1f;
49588 }
49589 if ((double)velocity.X > 0.5)
49590 {
49591 direction = -1;
49592 }
49593 else if ((double)velocity.X < -0.5)
49594 {
49595 direction = 1;
49596 }
49598 if (num53 < 10f)
49599 {
49600 velocity.X = num51;
49601 velocity.Y = num52;
49602 rotation = velocity.X * 0.05f;
49603 if (num53 < num50)
49604 {
49605 position += velocity;
49606 velocity *= 0f;
49607 num49 = 0f;
49608 }
49609 direction = -Main.player[owner].direction;
49610 }
49611 num53 = num50 / num53;
49612 num51 *= num53;
49613 num52 *= num53;
49614 if (velocity.X < num51)
49615 {
49616 velocity.X += num49;
49617 if (velocity.X < 0f)
49618 {
49619 velocity.X *= 0.99f;
49620 }
49621 }
49622 if (velocity.X > num51)
49623 {
49624 velocity.X -= num49;
49625 if (velocity.X > 0f)
49626 {
49627 velocity.X *= 0.99f;
49628 }
49629 }
49630 if (velocity.Y < num52)
49631 {
49632 velocity.Y += num49;
49633 if (velocity.Y < 0f)
49634 {
49635 velocity.Y *= 0.99f;
49636 }
49637 }
49638 if (velocity.Y > num52)
49639 {
49640 velocity.Y -= num49;
49641 if (velocity.Y > 0f)
49642 {
49643 velocity.Y *= 0.99f;
49644 }
49645 }
49646 if (velocity.X != 0f || velocity.Y != 0f)
49647 {
49648 rotation = velocity.X * 0.05f;
49649 }
49650 frameCounter++;
49651 if (frameCounter > 3)
49652 {
49653 frame++;
49654 frameCounter = 0;
49655 }
49656 if (frame > 4)
49657 {
49658 frame = 0;
49659 }
49660 return;
49661 }
49662 if (type == 199)
49663 {
49664 float num55 = 0.1f;
49665 tileCollide = false;
49666 int num56 = 200;
49667 Vector2 vector6 = new Vector2(position.X + (float)width * 0.5f, position.Y + (float)height * 0.5f);
49668 float num57 = Main.player[owner].position.X + (float)(Main.player[owner].width / 2) - vector6.X;
49669 float num58 = Main.player[owner].position.Y + (float)(Main.player[owner].height / 2) - vector6.Y;
49670 num58 -= 60f;
49671 num57 -= 2f;
49672 if (type == 127)
49673 {
49674 num58 = Main.player[owner].position.Y - vector6.Y;
49675 }
49676 float num59 = (float)Math.Sqrt(num57 * num57 + num58 * num58);
49677 float num60 = 4f;
49678 float num61 = num59;
49679 float num62 = 2000f;
49680 bool num63 = num59 > num62;
49681 if (num59 < (float)num56 && Main.player[owner].velocity.Y == 0f && position.Y + (float)height <= Main.player[owner].position.Y + (float)Main.player[owner].height && !Collision.SolidCollision(position, width, height))
49682 {
49683 ai[0] = 0f;
49684 if (velocity.Y < -6f)
49685 {
49686 velocity.Y = -6f;
49687 }
49688 }
49689 if (num59 < 4f)
49690 {
49691 velocity.X = num57;
49692 velocity.Y = num58;
49693 num55 = 0f;
49694 }
49695 else
49696 {
49697 if (num59 > 350f)
49698 {
49699 num55 = 0.2f;
49700 num60 = 10f;
49701 }
49702 num59 = num60 / num59;
49703 num57 *= num59;
49704 num58 *= num59;
49705 }
49706 if (num63)
49707 {
49708 int num64 = 2;
49709 for (int m = 0; m < 12; m++)
49710 {
49711 float speedX4 = 1f - Main.rand.NextFloat() * 2f;
49712 float speedY4 = 1f - Main.rand.NextFloat() * 2f;
49713 int num65 = Dust.NewDust(position, width, height, num64, speedX4, speedY4);
49714 Main.dust[num65].noLightEmittence = true;
49715 Main.dust[num65].noGravity = true;
49716 }
49717 base.Center = Main.player[owner].Center;
49719 if (Main.myPlayer == owner)
49720 {
49721 netUpdate = true;
49722 }
49723 }
49724 if (velocity.X < num57)
49725 {
49726 velocity.X += num55;
49727 if (velocity.X < 0f)
49728 {
49729 velocity.X += num55;
49730 }
49731 }
49732 if (velocity.X > num57)
49733 {
49734 velocity.X -= num55;
49735 if (velocity.X > 0f)
49736 {
49737 velocity.X -= num55;
49738 }
49739 }
49740 if (velocity.Y < num58)
49741 {
49742 velocity.Y += num55;
49743 if (velocity.Y < 0f)
49744 {
49745 velocity.Y += num55;
49746 }
49747 }
49748 if (velocity.Y > num58)
49749 {
49750 velocity.Y -= num55;
49751 if (velocity.Y > 0f)
49752 {
49753 velocity.Y -= num55;
49754 }
49755 }
49756 direction = -Main.player[owner].direction;
49757 spriteDirection = 1;
49758 rotation = velocity.Y * 0.05f * (float)(-direction);
49759 if (num61 >= 50f)
49760 {
49761 frameCounter++;
49762 if (frameCounter <= 6)
49763 {
49764 return;
49765 }
49766 frameCounter = 0;
49767 if (velocity.X < 0f)
49768 {
49769 if (frame < 2)
49770 {
49771 frame++;
49772 }
49773 if (frame > 2)
49774 {
49775 frame--;
49776 }
49777 }
49778 else
49779 {
49780 if (frame < 6)
49781 {
49782 frame++;
49783 }
49784 if (frame > 6)
49785 {
49786 frame--;
49787 }
49788 }
49789 }
49790 else
49791 {
49792 frameCounter++;
49793 if (frameCounter > 6)
49794 {
49795 frame += direction;
49796 frameCounter = 0;
49797 }
49798 if (frame > 7)
49799 {
49800 frame = 0;
49801 }
49802 if (frame < 0)
49803 {
49804 frame = 7;
49805 }
49806 }
49807 return;
49808 }
49809 if (type == 885 || type == 889)
49810 {
49811 Player player3 = Main.player[owner];
49812 float num66 = 0.15f;
49813 tileCollide = false;
49814 int num67 = 150;
49815 Vector2 center = base.Center;
49816 float num68 = player3.Center.X - center.X;
49817 float num69 = player3.Center.Y - center.Y;
49818 num69 -= 65f;
49819 num68 -= (float)(30 * player3.direction);
49820 float num70 = (float)Math.Sqrt(num68 * num68 + num69 * num69);
49821 float num71 = 8f;
49822 float num72 = num70;
49823 float num73 = 2000f;
49824 bool num74 = num70 > num73;
49825 if (num70 < (float)num67 && player3.velocity.Y == 0f && position.Y + (float)height <= player3.position.Y + (float)player3.height && !Collision.SolidCollision(position, width, height) && velocity.Y < -6f)
49826 {
49827 velocity.Y = -6f;
49828 }
49829 if (num70 < 10f)
49830 {
49831 velocity *= 0.9f;
49832 if (velocity.Length() < 0.5f)
49833 {
49835 }
49836 num66 = 0f;
49837 }
49838 else
49839 {
49840 if (num70 > (float)num67)
49841 {
49842 num66 = 0.2f;
49843 num71 = 12f;
49844 }
49845 num70 = num71 / num70;
49846 num68 *= num70;
49847 num69 *= num70;
49848 }
49849 if (num74)
49850 {
49851 int num75 = 234;
49852 if (type == 889)
49853 {
49854 num75 = 60;
49855 }
49856 for (int n = 0; n < 12; n++)
49857 {
49858 float speedX5 = 1f - Main.rand.NextFloat() * 2f;
49859 float speedY5 = 1f - Main.rand.NextFloat() * 2f;
49860 int num76 = Dust.NewDust(position, width, height, num75, speedX5, speedY5);
49861 Main.dust[num76].noLightEmittence = true;
49862 Main.dust[num76].noGravity = true;
49863 }
49864 base.Center = player3.Center;
49866 if (Main.myPlayer == owner)
49867 {
49868 netUpdate = true;
49869 }
49870 }
49871 if (velocity.X < num68)
49872 {
49873 velocity.X += num66;
49874 if (velocity.X < 0f)
49875 {
49876 velocity.X += num66;
49877 }
49878 }
49879 if (velocity.X > num68)
49880 {
49881 velocity.X -= num66;
49882 if (velocity.X > 0f)
49883 {
49884 velocity.X -= num66;
49885 }
49886 }
49887 if (velocity.Y < num69)
49888 {
49889 velocity.Y += num66;
49890 if (velocity.Y < 0f)
49891 {
49892 velocity.Y += num66;
49893 }
49894 }
49895 if (velocity.Y > num69)
49896 {
49897 velocity.Y -= num66;
49898 if (velocity.Y > 0f)
49899 {
49900 velocity.Y -= num66;
49901 }
49902 }
49903 direction = -player3.direction;
49905 int num77 = 100;
49906 if (num72 >= (float)num67)
49907 {
49908 rotation += 0.5f;
49909 if (rotation > (float)Math.PI * 2f)
49910 {
49911 rotation -= (float)Math.PI * 2f;
49912 }
49913 frame = 6;
49914 frameCounter = 0;
49915 if (type == 885)
49916 {
49917 localAI[0] = 0f;
49918 }
49919 if (type == 889)
49920 {
49921 localAI[0] += 3f;
49922 if (localAI[0] > (float)num77)
49923 {
49924 localAI[0] = num77;
49925 }
49926 }
49927 return;
49928 }
49929 rotation *= 0.95f;
49930 if (rotation < 0.05f)
49931 {
49932 rotation = 0f;
49933 }
49934 frameCounter++;
49935 if (type == 885)
49936 {
49937 switch (frameCounter)
49938 {
49939 case 10:
49940 localAI[0] = 0f;
49941 break;
49942 case 20:
49943 localAI[0] = 1f;
49944 break;
49945 case 30:
49946 localAI[0] = 2f;
49947 break;
49948 case 40:
49949 localAI[0] = 1f;
49950 break;
49951 }
49952 }
49953 if (type == 889)
49954 {
49955 localAI[0] -= 3f;
49956 if (localAI[0] < 0f)
49957 {
49958 localAI[0] = 0f;
49959 }
49960 }
49961 if (frameCounter % 5 == 0)
49962 {
49963 frame++;
49964 if (frame > 5)
49965 {
49966 frame = 0;
49967 }
49968 }
49969 if (frameCounter >= 40)
49970 {
49971 frameCounter = 0;
49972 }
49973 return;
49974 }
49975 bool flag11 = ai[1] == 0f;
49976 if (flag)
49977 {
49978 flag11 = true;
49979 }
49980 if (flag11)
49981 {
49982 int num78 = 500;
49983 if (type == 127)
49984 {
49985 num78 = 200;
49986 }
49987 if (type == 208)
49988 {
49989 num78 = 300;
49990 }
49991 switch (type)
49992 {
49993 case 816:
49994 case 825:
49995 case 854:
49996 case 858:
49997 case 859:
49998 case 860:
49999 case 881:
50000 case 884:
50001 case 890:
50002 case 891:
50003 case 897:
50004 case 900:
50005 case 934:
50006 num78 = 400;
50007 break;
50008 case 821:
50009 case 899:
50010 num78 = 500;
50011 break;
50012 }
50013 if (flag6 || type == 266 || (type >= 390 && type <= 392))
50014 {
50015 num78 += 40 * minionPos;
50016 if (localAI[0] > 0f)
50017 {
50018 num78 += 500;
50019 }
50020 if (type == 266 && localAI[0] > 0f)
50021 {
50022 num78 += 100;
50023 }
50024 if (type >= 390 && type <= 392 && localAI[0] > 0f)
50025 {
50026 num78 += 400;
50027 }
50028 }
50029 if (Main.player[owner].rocketDelay2 > 0)
50030 {
50031 ai[0] = 1f;
50032 }
50033 Vector2 vector7 = new Vector2(position.X + (float)width * 0.5f, position.Y + (float)height * 0.5f);
50034 float num79 = Main.player[owner].position.X + (float)(Main.player[owner].width / 2) - vector7.X;
50035 float num80 = Main.player[owner].position.Y + (float)(Main.player[owner].height / 2) - vector7.Y;
50036 float num81 = (float)Math.Sqrt(num79 * num79 + num80 * num80);
50037 if (!flag7)
50038 {
50039 if (num81 > 2000f)
50040 {
50041 position.X = Main.player[owner].position.X + (float)(Main.player[owner].width / 2) - (float)(width / 2);
50042 position.Y = Main.player[owner].position.Y + (float)(Main.player[owner].height / 2) - (float)(height / 2);
50043 }
50044 else if (num81 > (float)num78 || (Math.Abs(num80) > 300f && ((!flag6 && type != 266 && (type < 390 || type > 392)) || !(localAI[0] > 0f))))
50045 {
50046 if (type != 324)
50047 {
50048 if (num80 > 0f && velocity.Y < 0f)
50049 {
50050 velocity.Y = 0f;
50051 }
50053 {
50054 velocity.Y = 0f;
50055 }
50056 }
50057 ai[0] = 1f;
50058 }
50059 }
50060 }
50061 if ((type == 209 || type == 956) && ai[0] != 0f)
50062 {
50063 if (Main.player[owner].velocity.Y == 0f && alpha >= 100)
50064 {
50065 position.X = Main.player[owner].position.X + (float)(Main.player[owner].width / 2) - (float)(width / 2);
50066 position.Y = Main.player[owner].position.Y + (float)Main.player[owner].height - (float)height;
50067 ai[0] = 0f;
50068 }
50069 else
50070 {
50071 velocity.X = 0f;
50072 velocity.Y = 0f;
50073 if (type == 956 && alpha < 100)
50074 {
50075 int num82 = Dust.NewDust(position, width, height, 6, velocity.X, velocity.Y, 0, default(Color), 1.2f);
50076 Main.dust[num82].velocity.X += Main.rand.NextFloat() - 0.5f;
50077 Main.dust[num82].velocity.Y += (Main.rand.NextFloat() + 0.5f) * -1f;
50078 if (Main.rand.Next(3) != 0)
50079 {
50080 Main.dust[num82].noGravity = true;
50081 }
50082 }
50083 alpha += 5;
50084 if (alpha > 255)
50085 {
50086 alpha = 255;
50087 }
50088 }
50089 }
50090 else if (ai[0] != 0f && !flag7)
50091 {
50092 float num83 = 0.2f;
50093 int num84 = 200;
50094 if (type == 127)
50095 {
50096 num84 = 100;
50097 }
50098 if (flag6 || type == 816 || type == 821 || type == 825 || type == 854 || type == 858 || type == 859 || type == 860)
50099 {
50100 num83 = 0.5f;
50101 num84 = 100;
50102 }
50103 if (type == 875)
50104 {
50105 num83 = 2f;
50106 num84 = 100;
50107 }
50108 tileCollide = false;
50109 Vector2 vector8 = new Vector2(position.X + (float)width * 0.5f, position.Y + (float)height * 0.5f);
50110 float num85 = Main.player[owner].position.X + (float)(Main.player[owner].width / 2) - vector8.X;
50111 if (flag6 || type == 266 || (type >= 390 && type <= 392))
50112 {
50113 num85 -= (float)(40 * Main.player[owner].direction);
50114 float num86 = 700f;
50115 if (flag6)
50116 {
50117 num86 += 100f;
50118 }
50119 bool flag12 = false;
50120 int num87 = -1;
50121 for (int num88 = 0; num88 < 200; num88++)
50122 {
50123 if (!Main.npc[num88].CanBeChasedBy(this))
50124 {
50125 continue;
50126 }
50127 float num89 = Main.npc[num88].position.X + (float)(Main.npc[num88].width / 2);
50128 float num90 = Main.npc[num88].position.Y + (float)(Main.npc[num88].height / 2);
50129 if (Math.Abs(Main.player[owner].position.X + (float)(Main.player[owner].width / 2) - num89) + Math.Abs(Main.player[owner].position.Y + (float)(Main.player[owner].height / 2) - num90) < num86)
50130 {
50131 if (Collision.CanHit(position, width, height, Main.npc[num88].position, Main.npc[num88].width, Main.npc[num88].height))
50132 {
50133 num87 = num88;
50134 }
50135 flag12 = true;
50136 break;
50137 }
50138 }
50139 if (!flag12)
50140 {
50141 num85 -= (float)(40 * minionPos * Main.player[owner].direction);
50142 }
50143 if (flag12 && num87 >= 0)
50144 {
50145 ai[0] = 0f;
50146 }
50147 }
50148 float num91 = Main.player[owner].position.Y + (float)(Main.player[owner].height / 2) - vector8.Y;
50149 if (type == 127)
50150 {
50151 num91 = Main.player[owner].position.Y - vector8.Y;
50152 }
50153 float num92 = (float)Math.Sqrt(num85 * num85 + num91 * num91);
50154 float num93 = num92;
50155 float num94 = 10f;
50156 float num95 = num92;
50157 if (type == 111)
50158 {
50159 num94 = 11f;
50160 }
50161 if (type == 127)
50162 {
50163 num94 = 9f;
50164 }
50165 if (type == 875)
50166 {
50167 num83 = 1.8f;
50168 num94 = 16f;
50169 }
50170 if (type == 324)
50171 {
50172 num94 = 20f;
50173 }
50174 if (flag6 || type == 816 || type == 821 || type == 825 || type == 854 || type == 858 || type == 859 || type == 860 || type == 956 || type == 958 || type == 959 || type == 960 || type == 994 || type == 998 || type == 1003 || type == 1004)
50175 {
50176 num83 = 0.4f;
50177 num94 = 12f;
50178 if (flag6)
50179 {
50180 num83 = 0.8f;
50181 }
50182 if (num94 < Math.Abs(Main.player[owner].velocity.X) + Math.Abs(Main.player[owner].velocity.Y))
50183 {
50184 num94 = Math.Abs(Main.player[owner].velocity.X) + Math.Abs(Main.player[owner].velocity.Y);
50185 }
50186 }
50187 if (type == 208 && Math.Abs(Main.player[owner].velocity.X) + Math.Abs(Main.player[owner].velocity.Y) > 4f)
50188 {
50189 num84 = -1;
50190 }
50191 if (num92 < (float)num84 && Main.player[owner].velocity.Y == 0f && position.Y + (float)height <= Main.player[owner].position.Y + (float)Main.player[owner].height && !Collision.SolidCollision(position, width, height))
50192 {
50193 ai[0] = 0f;
50194 if (velocity.Y < -6f)
50195 {
50196 velocity.Y = -6f;
50197 }
50198 }
50199 if (num92 < 60f)
50200 {
50201 num85 = velocity.X;
50202 num91 = velocity.Y;
50203 }
50204 else
50205 {
50206 num92 = num94 / num92;
50207 num85 *= num92;
50208 num91 *= num92;
50209 }
50210 if (type == 324)
50211 {
50212 if (num95 > 1000f)
50213 {
50214 if ((double)(Math.Abs(velocity.X) + Math.Abs(velocity.Y)) < (double)num94 - 1.25)
50215 {
50216 velocity *= 1.025f;
50217 }
50218 if ((double)(Math.Abs(velocity.X) + Math.Abs(velocity.Y)) > (double)num94 + 1.25)
50219 {
50220 velocity *= 0.975f;
50221 }
50222 }
50223 else if (num95 > 600f)
50224 {
50225 if (Math.Abs(velocity.X) + Math.Abs(velocity.Y) < num94 - 1f)
50226 {
50227 velocity *= 1.05f;
50228 }
50229 if (Math.Abs(velocity.X) + Math.Abs(velocity.Y) > num94 + 1f)
50230 {
50231 velocity *= 0.95f;
50232 }
50233 }
50234 else if (num95 > 400f)
50235 {
50236 if ((double)(Math.Abs(velocity.X) + Math.Abs(velocity.Y)) < (double)num94 - 0.5)
50237 {
50238 velocity *= 1.075f;
50239 }
50240 if ((double)(Math.Abs(velocity.X) + Math.Abs(velocity.Y)) > (double)num94 + 0.5)
50241 {
50242 velocity *= 0.925f;
50243 }
50244 }
50245 else
50246 {
50247 if ((double)(Math.Abs(velocity.X) + Math.Abs(velocity.Y)) < (double)num94 - 0.25)
50248 {
50249 velocity *= 1.1f;
50250 }
50251 if ((double)(Math.Abs(velocity.X) + Math.Abs(velocity.Y)) > (double)num94 + 0.25)
50252 {
50253 velocity *= 0.9f;
50254 }
50255 }
50256 velocity.X = (velocity.X * 34f + num85) / 35f;
50257 velocity.Y = (velocity.Y * 34f + num91) / 35f;
50258 }
50259 else if (type == 875)
50260 {
50261 if (num93 < (float)num84)
50262 {
50263 if (velocity.X < num85)
50264 {
50265 velocity.X += num83;
50266 }
50267 else if (velocity.X > num85)
50268 {
50269 velocity.X -= num83;
50270 }
50271 if (velocity.Y < num91)
50272 {
50273 velocity.Y += num83;
50274 }
50275 else if (velocity.Y > num91)
50276 {
50277 velocity.Y -= num83;
50278 }
50279 }
50280 else
50281 {
50282 velocity = Vector2.Lerp(velocity, new Vector2(num85, num91), 0.75f);
50283 }
50284 }
50285 else
50286 {
50287 if (velocity.X < num85)
50288 {
50289 velocity.X += num83;
50290 if (velocity.X < 0f)
50291 {
50292 velocity.X += num83 * 1.5f;
50293 }
50294 }
50295 if (velocity.X > num85)
50296 {
50297 velocity.X -= num83;
50298 if (velocity.X > 0f)
50299 {
50300 velocity.X -= num83 * 1.5f;
50301 }
50302 }
50303 if (velocity.Y < num91)
50304 {
50305 velocity.Y += num83;
50306 if (velocity.Y < 0f)
50307 {
50308 velocity.Y += num83 * 1.5f;
50309 }
50310 }
50311 if (velocity.Y > num91)
50312 {
50313 velocity.Y -= num83;
50314 if (velocity.Y > 0f)
50315 {
50316 velocity.Y -= num83 * 1.5f;
50317 }
50318 }
50319 }
50320 if (type == 111)
50321 {
50322 frame = 7;
50323 }
50324 if (flag6 && frame < 12)
50325 {
50326 frame = Main.rand.Next(12, 18);
50327 frameCounter = 0;
50328 }
50329 if (type != 313)
50330 {
50331 if ((double)velocity.X > 0.5)
50332 {
50333 spriteDirection = -1;
50334 }
50335 else if ((double)velocity.X < -0.5)
50336 {
50337 spriteDirection = 1;
50338 }
50339 }
50340 if (type == 112)
50341 {
50342 frameCounter++;
50343 if (frame < 3)
50344 {
50345 frame = 3;
50346 frameCounter = 0;
50347 }
50348 if (frameCounter > 3)
50349 {
50350 frameCounter = 0;
50351 frame++;
50352 if (frame >= Main.projFrames[type])
50353 {
50354 frame = 3;
50355 }
50356 }
50357 rotation = velocity.X * 0.125f;
50358 }
50359 else if (type == 900)
50360 {
50361 spriteDirection = -1;
50362 if (velocity.X > 0f)
50363 {
50364 spriteDirection = 1;
50365 }
50366 frameCounter++;
50367 if (frame < 10)
50368 {
50369 frame = 10;
50370 frameCounter = 0;
50371 }
50372 if (frameCounter > 3)
50373 {
50374 frameCounter = 0;
50375 frame++;
50376 if (frame >= Main.projFrames[type])
50377 {
50378 frame = 10;
50379 }
50380 }
50381 rotation = velocity.X * 0.125f;
50382 }
50383 else if (type == 899)
50384 {
50385 spriteDirection = -1;
50386 if (velocity.X > 0f)
50387 {
50388 spriteDirection = 1;
50389 }
50390 frameCounter++;
50391 if (frame < 10)
50392 {
50393 frame = 10;
50394 frameCounter = 0;
50395 }
50396 if (frameCounter > 3)
50397 {
50398 frameCounter = 0;
50399 frame++;
50400 if (frame >= Main.projFrames[type])
50401 {
50402 frame = 10;
50403 }
50404 }
50405 Vector2 v = velocity;
50406 v.Normalize();
50407 rotation = v.ToRotation();
50408 if (velocity.X < 0f)
50409 {
50410 rotation += (float)Math.PI;
50411 }
50412 }
50413 else if (type == 897)
50414 {
50415 spriteDirection = 1;
50416 frameCounter++;
50417 if (frame < 8)
50418 {
50419 frame = 8;
50420 frameCounter = 0;
50421 }
50422 if (frameCounter > 3)
50423 {
50424 frameCounter = 0;
50425 frame++;
50426 if (frame >= Main.projFrames[type])
50427 {
50428 frame = 8;
50429 }
50430 }
50432 v2.Normalize();
50433 rotation = v2.ToRotation() + (float)Math.PI / 2f;
50434 }
50435 else if (type == 891)
50436 {
50437 spriteDirection = 1;
50438 frameCounter++;
50439 if (frame < 9)
50440 {
50441 frame = 9;
50442 frameCounter = 0;
50443 }
50444 if (frameCounter > 3)
50445 {
50446 frameCounter = 0;
50447 frame++;
50448 if (frame >= Main.projFrames[type])
50449 {
50450 frame = 9;
50451 }
50452 }
50454 v3.Normalize();
50455 rotation = v3.ToRotation() + (float)Math.PI / 2f;
50456 }
50457 else if (type == 890)
50458 {
50459 spriteDirection = -1;
50460 if (velocity.X > 0f)
50461 {
50462 spriteDirection = 1;
50463 }
50464 frameCounter++;
50465 if (frame < 9)
50466 {
50467 frame = 9;
50468 frameCounter = 0;
50469 }
50470 if (frameCounter > 3)
50471 {
50472 frameCounter = 0;
50473 frame++;
50474 if (frame >= Main.projFrames[type])
50475 {
50476 frame = 9;
50477 }
50478 }
50479 rotation = velocity.X * 0.025f;
50480 }
50481 else if (type == 884)
50482 {
50483 spriteDirection = -1;
50484 if (velocity.X > 0f)
50485 {
50486 spriteDirection = 1;
50487 }
50488 frameCounter++;
50489 if (frame < 9)
50490 {
50491 frame = 9;
50492 frameCounter = 0;
50493 }
50494 if (frameCounter > 3)
50495 {
50496 frameCounter = 0;
50497 frame++;
50498 if (frame >= Main.projFrames[type])
50499 {
50500 frame = 9;
50501 }
50502 }
50504 v4.Normalize();
50505 rotation = v4.ToRotation() + (float)Math.PI / 2f;
50506 }
50507 else if (type == 881 || type == 934)
50508 {
50509 int num96 = 1226;
50510 if (type == 934)
50511 {
50512 num96 = 1261;
50513 }
50514 if (frame < 6 || frame > 11)
50515 {
50516 Gore.NewGore(new Vector2(base.Center.X, position.Y), velocity * 0.5f, num96);
50517 }
50518 frameCounter++;
50519 if (frameCounter > 4)
50520 {
50521 frame++;
50522 frameCounter = 0;
50523 }
50524 if (frame < 6 || frame > 11)
50525 {
50526 frame = 6;
50527 }
50529 v5.Normalize();
50530 rotation = v5.ToRotation() + (float)Math.PI / 2f;
50531 }
50532 else if (type == 875)
50533 {
50534 if (++frameCounter > 4)
50535 {
50536 frame++;
50537 frameCounter = 0;
50538 }
50539 if (frame < 7 || frame > 10)
50540 {
50541 frame = 7;
50542 }
50544 v6.Normalize();
50545 rotation = v6.ToRotation() + ((spriteDirection == -1) ? 0f : ((float)Math.PI));
50546 }
50547 else if (type == 825)
50548 {
50549 if (++frameCounter > 4)
50550 {
50551 frame++;
50552 frameCounter = 0;
50553 }
50554 if (frame < 21 || frame > 25)
50555 {
50556 frame = 21;
50557 }
50558 rotation = velocity.X * 0.025f;
50559 }
50560 else if (type == 854)
50561 {
50562 if (frame < 13)
50563 {
50564 Gore.NewGore(new Vector2(base.Center.X, position.Y), velocity * 0.5f, 1269);
50565 }
50566 if (++frameCounter > 4)
50567 {
50568 frame++;
50569 frameCounter = 0;
50570 }
50571 if (frame < 13 || frame > 18)
50572 {
50573 frame = 13;
50574 }
50576 v7.Normalize();
50577 rotation = v7.ToRotation() + (float)Math.PI / 2f;
50578 }
50579 else if (type == 858)
50580 {
50581 if (++frameCounter > 4)
50582 {
50583 frame++;
50584 frameCounter = 0;
50585 }
50586 if (frame < 10 || frame > 13)
50587 {
50588 frame = 10;
50589 }
50591 v8.Normalize();
50592 rotation = v8.ToRotation() + ((spriteDirection == -1) ? 0f : ((float)Math.PI));
50593 }
50594 else if (type == 859)
50595 {
50596 if (++frameCounter > 4)
50597 {
50598 frame++;
50599 frameCounter = 0;
50600 }
50601 if (frame < 18 || frame > 23)
50602 {
50603 frame = 18;
50604 }
50605 rotation = velocity.X * 0.025f;
50606 }
50607 else if (type == 860)
50608 {
50609 if (frame < 6)
50610 {
50611 frame = 8;
50612 frameCounter = 0;
50613 }
50614 if (++frameCounter > 4)
50615 {
50616 frame++;
50617 frameCounter = 0;
50618 }
50619 if (frame > 13)
50620 {
50621 frame = 6;
50622 }
50624 v9.Normalize();
50625 rotation = v9.ToRotation() + (float)Math.PI / 2f;
50626 }
50627 else if (type == 816)
50628 {
50629 if (++frameCounter > 4)
50630 {
50631 frame++;
50632 frameCounter = 0;
50633 }
50634 if (frame < 11 || frame > 16)
50635 {
50636 frame = 11;
50637 }
50638 rotation = velocity.X * 0.025f;
50639 }
50640 else if (type == 821)
50641 {
50642 if (++frameCounter > 4)
50643 {
50644 frame++;
50645 frameCounter = 0;
50646 }
50647 if (frame < 19 || frame > 22)
50648 {
50649 frame = 19;
50650 }
50651 rotation = velocity.X * 0.025f;
50652 }
50653 else if (type == 958)
50654 {
50655 spriteDirection = -1;
50656 if (velocity.X > 0f)
50657 {
50658 spriteDirection = 1;
50659 }
50660 if (frame < 13)
50661 {
50662 frame = 13;
50663 frameCounter = 0;
50664 }
50665 if (++frameCounter > 4)
50666 {
50667 frame++;
50668 frameCounter = 0;
50669 }
50670 if (frame > 16)
50671 {
50672 frame = 13;
50673 }
50674 rotation = MathHelper.Clamp(velocity.X * 0.025f, -0.4f, 0.4f);
50675 }
50676 else if (type == 960)
50677 {
50678 spriteDirection = -1;
50679 if (velocity.X > 0f)
50680 {
50681 spriteDirection = 1;
50682 }
50683 frame = 4;
50684 frameCounter = 0;
50686 v10.Normalize();
50687 rotation = v10.ToRotation() + (float)Math.PI / 2f;
50688 }
50689 else if (type == 959)
50690 {
50691 spriteDirection = -1;
50692 if (velocity.X > 0f)
50693 {
50694 spriteDirection = 1;
50695 }
50696 frame = 11;
50697 frameCounter = 0;
50698 rotation = MathHelper.Clamp(velocity.X * 0.025f, -0.4f, 0.4f);
50699 float num97 = Vector2.Dot(velocity.SafeNormalize(Vector2.UnitX), new Vector2(0f, -1f));
50700 if (num97 > 0f && Main.rand.NextFloat() < 0.3f + num97 * 0.3f)
50701 {
50702 Dust dust = Dust.NewDustDirect(position, width, height, 16, velocity.X * 0.7f, velocity.Y * 1.2f, 150, default(Color), 0.6f);
50703 dust.noGravity = true;
50704 dust.fadeIn = 1f;
50705 dust.velocity.X = velocity.X * 0.3f;
50706 dust.position = base.Top + new Vector2(0f, -10f) + new Vector2(Main.rand.NextFloatDirection() * 30f, Main.rand.NextFloatDirection() * 10f);
50707 dust.velocity *= 0.7f;
50708 dust.position += dust.velocity * 2f;
50709 }
50710 }
50711 else if (type == 994)
50712 {
50713 spriteDirection = -1;
50714 if (velocity.X > 0f)
50715 {
50716 spriteDirection = 1;
50717 }
50718 frameCounter++;
50719 if (frameCounter > 5)
50720 {
50721 frame++;
50722 frameCounter = 0;
50723 }
50724 if (frame < 13 || frame > 15)
50725 {
50726 frame = 13;
50727 }
50728 rotation = MathHelper.Clamp(velocity.X * 0.025f, -0.4f, 0.4f);
50729 }
50730 else if (type == 998)
50731 {
50732 spriteDirection = 1;
50733 if (velocity.X > 0f)
50734 {
50735 spriteDirection = -1;
50736 }
50737 frameCounter++;
50738 if (frameCounter > 4)
50739 {
50740 frame++;
50741 frameCounter = 0;
50742 }
50744 {
50745 frame = 6;
50746 }
50747 rotation = MathHelper.Clamp(velocity.X * 0.025f, -0.4f, 0.4f);
50748 }
50749 else if (type == 1003)
50750 {
50751 spriteDirection = 1;
50752 if (velocity.X > 0f)
50753 {
50754 spriteDirection = -1;
50755 }
50756 frameCounter++;
50757 if (frameCounter > 3)
50758 {
50759 frame++;
50760 frameCounter = 0;
50761 }
50762 if (frame < 12 || frame > 15)
50763 {
50764 frame = 12;
50765 }
50766 rotation = MathHelper.Clamp(velocity.X * 0.025f, -0.35f, 0.35f);
50767 }
50768 else if (type == 1004)
50769 {
50770 spriteDirection = 1;
50771 if (velocity.X > 0f)
50772 {
50773 spriteDirection = -1;
50774 }
50775 frameCounter++;
50776 if (frameCounter > 3)
50777 {
50778 frame++;
50779 frameCounter = 0;
50780 }
50781 if (frame < 10 || frame > 14)
50782 {
50783 frame = 10;
50784 }
50785 rotation = MathHelper.Clamp(velocity.X * 0.025f, -0.35f, 0.35f);
50786 }
50787 else if (type == 112)
50788 {
50789 if (spriteDirection == -1)
50790 {
50791 rotation = (float)Math.Atan2(velocity.Y, velocity.X) + 1.57f;
50792 }
50793 else
50794 {
50795 rotation = (float)Math.Atan2(velocity.Y, velocity.X) + 1.57f;
50796 }
50797 }
50798 else if (type >= 390 && type <= 392)
50799 {
50800 int num98 = (int)(base.Center.X / 16f);
50801 int num99 = (int)(base.Center.Y / 16f);
50802 if (Main.tile[num98, num99] != null && Main.tile[num98, num99].wall > 0)
50803 {
50804 rotation = velocity.ToRotation() + (float)Math.PI / 2f;
50806 if (frameCounter > 5)
50807 {
50808 frame++;
50809 frameCounter = 0;
50810 }
50811 if (frame > 7)
50812 {
50813 frame = 4;
50814 }
50815 if (frame < 4)
50816 {
50817 frame = 7;
50818 }
50819 }
50820 else
50821 {
50822 frameCounter++;
50823 if (frameCounter > 2)
50824 {
50825 frame++;
50826 frameCounter = 0;
50827 }
50828 if (frame < 8 || frame > 10)
50829 {
50830 frame = 8;
50831 }
50832 rotation = velocity.X * 0.1f;
50833 }
50834 }
50835 else if (type == 334)
50836 {
50837 frameCounter++;
50838 if (frameCounter > 1)
50839 {
50840 frame++;
50841 frameCounter = 0;
50842 }
50843 if (frame < 7 || frame > 10)
50844 {
50845 frame = 7;
50846 }
50847 rotation = velocity.X * 0.1f;
50848 }
50849 else if (type == 353)
50850 {
50851 frameCounter++;
50852 if (frameCounter > 6)
50853 {
50854 frame++;
50855 frameCounter = 0;
50856 }
50857 if (frame < 10 || frame > 13)
50858 {
50859 frame = 10;
50860 }
50861 rotation = velocity.X * 0.05f;
50862 }
50863 else if (type == 127)
50864 {
50865 frameCounter += 3;
50866 if (frameCounter > 6)
50867 {
50868 frame++;
50869 frameCounter = 0;
50870 }
50871 if (frame <= 5 || frame > 15)
50872 {
50873 frame = 6;
50874 }
50875 rotation = velocity.X * 0.1f;
50876 }
50877 else if (type == 269)
50878 {
50879 if (frame == 6)
50880 {
50881 frameCounter = 0;
50882 }
50883 else if (frame < 4 || frame > 6)
50884 {
50885 frameCounter = 0;
50886 frame = 4;
50887 }
50888 else
50889 {
50890 frameCounter++;
50891 if (frameCounter > 6)
50892 {
50893 frame++;
50894 frameCounter = 0;
50895 }
50896 }
50897 rotation = velocity.X * 0.05f;
50898 }
50899 else if (type == 266)
50900 {
50901 frameCounter++;
50902 if (frameCounter > 6)
50903 {
50904 frame++;
50905 frameCounter = 0;
50906 }
50908 {
50909 frame = 2;
50910 }
50911 rotation = velocity.X * 0.1f;
50912 }
50913 else if (type == 324)
50914 {
50915 frameCounter++;
50916 if (frameCounter > 1)
50917 {
50918 frame++;
50919 frameCounter = 0;
50920 }
50922 {
50923 frame = 6;
50924 }
50925 rotation = (float)Math.Atan2(velocity.Y, velocity.X) + 1.58f;
50926 Lighting.AddLight((int)base.Center.X / 16, (int)base.Center.Y / 16, 0.9f, 0.6f, 0.2f);
50927 for (int num100 = 0; num100 < 2; num100++)
50928 {
50929 int num101 = 4;
50930 int num102 = Dust.NewDust(new Vector2(base.Center.X - (float)num101, base.Center.Y - (float)num101) - velocity * 0f, num101 * 2, num101 * 2, 6, 0f, 0f, 100);
50931 Main.dust[num102].scale *= 1.8f + (float)Main.rand.Next(10) * 0.1f;
50932 Main.dust[num102].velocity *= 0.2f;
50933 if (num100 == 1)
50934 {
50935 Main.dust[num102].position -= velocity * 0.5f;
50936 }
50937 Main.dust[num102].noGravity = true;
50938 num102 = Dust.NewDust(new Vector2(base.Center.X - (float)num101, base.Center.Y - (float)num101) - velocity * 0f, num101 * 2, num101 * 2, 31, 0f, 0f, 100, default(Color), 0.5f);
50939 Main.dust[num102].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f;
50940 Main.dust[num102].velocity *= 0.05f;
50941 if (num100 == 1)
50942 {
50943 Main.dust[num102].position -= velocity * 0.5f;
50944 }
50945 }
50946 }
50947 else if (type == 268)
50948 {
50949 frameCounter++;
50950 if (frameCounter > 4)
50951 {
50952 frame++;
50953 frameCounter = 0;
50954 }
50956 {
50957 frame = 6;
50958 }
50959 rotation = (float)Math.Atan2(velocity.Y, velocity.X) + 1.58f;
50960 }
50961 else if (type == 200)
50962 {
50963 frameCounter += 3;
50964 if (frameCounter > 6)
50965 {
50966 frame++;
50967 frameCounter = 0;
50968 }
50970 {
50971 frame = 6;
50972 }
50973 rotation = velocity.X * 0.1f;
50974 }
50975 else if (type == 208)
50976 {
50977 rotation = velocity.X * 0.075f;
50978 frameCounter++;
50979 if (frameCounter > 6)
50980 {
50981 frame++;
50982 frameCounter = 0;
50983 }
50984 if (frame > 4)
50985 {
50986 frame = 1;
50987 }
50988 if (frame < 1)
50989 {
50990 frame = 1;
50991 }
50992 }
50993 else if (type == 236)
50994 {
50995 rotation = velocity.Y * 0.05f * (float)direction;
50996 if (velocity.Y < 0f)
50997 {
50998 frameCounter += 2;
50999 }
51000 else
51001 {
51002 frameCounter++;
51003 }
51004 if (frameCounter >= 6)
51005 {
51006 frame++;
51007 frameCounter = 0;
51008 }
51009 if (frame > 12)
51010 {
51011 frame = 9;
51012 }
51013 if (frame < 9)
51014 {
51015 frame = 9;
51016 }
51017 }
51018 else if (type == 499)
51019 {
51020 rotation = velocity.Y * 0.05f * (float)direction;
51021 if (velocity.Y < 0f)
51022 {
51023 frameCounter += 2;
51024 }
51025 else
51026 {
51027 frameCounter++;
51028 }
51029 if (frameCounter >= 6)
51030 {
51031 frame++;
51032 frameCounter = 0;
51033 }
51034 if (frame >= 12)
51035 {
51036 frame = 8;
51037 }
51038 if (frame < 8)
51039 {
51040 frame = 8;
51041 }
51042 }
51043 else if (type == 765)
51044 {
51045 rotation = velocity.Y * 0.05f * (float)direction;
51046 frameCounter++;
51047 if (frameCounter >= 8)
51048 {
51049 frame++;
51050 frameCounter = 0;
51051 }
51052 if (frame >= 10)
51053 {
51054 frame = 8;
51055 }
51056 if (frame < 6)
51057 {
51058 frame = 6;
51059 }
51060 }
51061 else if (type == 314)
51062 {
51063 rotation = (float)Math.Atan2(velocity.Y, velocity.X) + 1.58f;
51064 frameCounter++;
51065 if (frameCounter >= 3)
51066 {
51067 frame++;
51068 frameCounter = 0;
51069 }
51070 if (frame > 12)
51071 {
51072 frame = 7;
51073 }
51074 if (frame < 7)
51075 {
51076 frame = 7;
51077 }
51078 }
51079 else if (type == 319)
51080 {
51081 rotation = velocity.X * 0.05f;
51082 frameCounter++;
51083 if (frameCounter >= 6)
51084 {
51085 frame++;
51086 frameCounter = 0;
51087 }
51088 if (frame > 10)
51089 {
51090 frame = 6;
51091 }
51092 if (frame < 6)
51093 {
51094 frame = 6;
51095 }
51096 }
51097 else if (type == 210)
51098 {
51099 rotation = (float)Math.Atan2(velocity.Y, velocity.X) + 1.58f;
51100 frameCounter += 3;
51101 if (frameCounter > 6)
51102 {
51103 frame++;
51104 frameCounter = 0;
51105 }
51106 if (frame > 11)
51107 {
51108 frame = 7;
51109 }
51110 if (frame < 7)
51111 {
51112 frame = 7;
51113 }
51114 }
51115 else if (type == 313)
51116 {
51117 position.Y += height;
51118 height = 54;
51119 position.Y -= height;
51120 position.X += width / 2;
51121 width = 54;
51122 position.X -= width / 2;
51123 rotation += velocity.X * 0.01f;
51124 frameCounter = 0;
51125 frame = 11;
51126 }
51127 else if (type == 398)
51128 {
51129 if ((double)velocity.X > 0.5)
51130 {
51131 spriteDirection = 1;
51132 }
51133 else if ((double)velocity.X < -0.5)
51134 {
51135 spriteDirection = -1;
51136 }
51137 frameCounter++;
51138 if (frameCounter > 1)
51139 {
51140 frame++;
51141 frameCounter = 0;
51142 }
51144 {
51145 frame = 6;
51146 }
51147 rotation = velocity.X * 0.1f;
51148 }
51149 else if (spriteDirection == -1)
51150 {
51151 rotation = (float)Math.Atan2(velocity.Y, velocity.X);
51152 }
51153 else
51154 {
51155 rotation = (float)Math.Atan2(velocity.Y, velocity.X) + 3.14f;
51156 }
51157 if (!flag6 && type != 499 && type != 765 && type != 816 && type != 821 && type != 825 && type != 859 && type != 881 && type != 884 && type != 890 && type != 891 && type != 900 && type != 934 && type != 958 && type != 959 && type != 960 && type != 994 && type != 998 && type != 1003 && type != 1004)
51158 {
51159 if (type == 899)
51160 {
51161 int num103 = 6;
51162 if (Main.rand.Next(4) == 0)
51163 {
51164 num103 = 31;
51165 }
51166 int num104 = Dust.NewDust(base.Center + new Vector2(-8f, 0f) - velocity * 0.25f, 15, 15, num103, (0f - velocity.X) * 0.5f, velocity.Y * 0.5f, 0, default(Color), 1.3f);
51167 Main.dust[num104].velocity.X = Main.dust[num104].velocity.X * 0.2f;
51168 Main.dust[num104].velocity.Y = Main.dust[num104].velocity.Y * 0.2f - 0.2f;
51169 Main.dust[num104].noGravity = true;
51170 }
51171 else if (type == 897)
51172 {
51173 int num105 = 6;
51174 if (Main.rand.Next(4) == 0)
51175 {
51176 num105 = 31;
51177 }
51178 int num106 = Dust.NewDust(base.Center + new Vector2(-8f, -8f) - velocity * 0.25f, 15, 15, num105, (0f - velocity.X) * 0.5f, velocity.Y * 0.5f, 0, default(Color), 1.3f);
51179 Main.dust[num106].velocity.X = Main.dust[num106].velocity.X * 0.2f;
51180 Main.dust[num106].velocity.Y = Main.dust[num106].velocity.Y * 0.2f - 0.2f;
51181 Main.dust[num106].noGravity = true;
51182 }
51183 else if (type == 875)
51184 {
51185 if (Main.rand.Next(3) == 0)
51186 {
51187 Gore.NewGorePerfect(base.Center + new Vector2(-10f + (float)Main.rand.Next(-20, 20) * 0.5f, -10f + (float)Main.rand.Next(-20, 20) * 0.5f), velocity * 0.1f, 1225, 0.5f + Main.rand.NextFloat() * 1f);
51188 Vector2 vector9 = Main.rand.NextVector2CircularEdge(2f, 2f) + velocity * -0.5f;
51189 vector9 *= 0.5f;
51190 int num107 = Dust.NewDust(base.Center - velocity * 1.5f - new Vector2(7f, 7f), 15, 15, 226, vector9.X, vector9.Y, 0, default(Color), 0.65f);
51191 Main.dust[num107].noGravity = true;
51192 }
51193 }
51194 else if (type == 860)
51195 {
51196 int num108 = Dust.NewDust(new Vector2(position.X + (float)(width / 2) - 4f, position.Y + (float)(height / 2) - 4f) + velocity, 8, 8, 27, (0f - velocity.X) * 0.5f, velocity.Y * 0.5f);
51197 Main.dust[num108].velocity.X = Main.dust[num108].velocity.X * 0.2f;
51198 Main.dust[num108].velocity.Y = Main.dust[num108].velocity.Y * 0.2f - 0.2f;
51199 Main.dust[num108].velocity += new Vector2((float)Main.rand.Next(-10, 10) * 0.4f, (float)Main.rand.Next(-10, 10) * 0.4f) * 0.5f;
51200 Main.dust[num108].noGravity = true;
51201 }
51202 else if (type == 858)
51203 {
51204 int num109 = 6;
51205 if (Main.rand.Next(4) == 0)
51206 {
51207 num109 = 31;
51208 }
51209 int num110 = Dust.NewDust(new Vector2(position.X + (float)(width / 2) - 4f, position.Y + (float)(height / 2) - 4f) - velocity, 10, 10, num109, (0f - velocity.X) * 0.5f, velocity.Y * 0.5f, 0, default(Color), 1.3f);
51210 Main.dust[num110].velocity.X = Main.dust[num110].velocity.X * 0.2f;
51211 Main.dust[num110].velocity.Y = Main.dust[num110].velocity.Y * 0.2f - 0.2f;
51212 Main.dust[num110].noGravity = true;
51213 }
51214 else if (type == 112)
51215 {
51216 int num111 = 6;
51217 if (Main.rand.Next(4) == 0)
51218 {
51219 num111 = 31;
51220 }
51221 int num112 = Dust.NewDust(base.Center + new Vector2(12 * spriteDirection, 4f).RotatedBy(rotation) + new Vector2(-5f, -5f), 10, 10, num111, (0f - velocity.X) * 0.5f, velocity.Y * 0.5f, 0, default(Color), 1.3f);
51222 Main.dust[num112].velocity.X = Main.dust[num112].velocity.X * 0.2f;
51223 Main.dust[num112].velocity.Y = Main.dust[num112].velocity.Y * 0.2f - 0.2f;
51224 Main.dust[num112].noGravity = true;
51225 }
51226 else if (type == 854)
51227 {
51228 if (Main.rand.Next(6) == 0)
51229 {
51230 Vector2 vector10 = base.Center / 16f;
51231 int i2 = (int)vector10.X;
51232 int num113 = (int)vector10.Y;
51233 Tile tileSafely = Framing.GetTileSafely(i2, num113 + 1);
51234 if (!WorldGen.SolidTile(tileSafely) && tileSafely.liquid == 0)
51235 {
51236 Gore gore = Gore.NewGorePerfect(base.Center + new Vector2((float)Main.rand.Next(-30, 30) * 0.5f, (float)Main.rand.Next(-30, 30) * 0.5f), velocity * -0.2f, 910);
51237 gore.Frame.CurrentColumn = 0;
51238 gore.timeLeft = 1;
51239 }
51240 }
51241 }
51242 else if (type != 398 && type != 390 && type != 391 && type != 392 && type != 127 && type != 200 && type != 208 && type != 210 && type != 236 && type != 266 && type != 268 && type != 269 && type != 313 && type != 314 && type != 319 && type != 324 && type != 334 && type != 353)
51243 {
51244 int num114 = Dust.NewDust(new Vector2(position.X + (float)(width / 2) - 4f, position.Y + (float)(height / 2) - 4f) - velocity, 8, 8, 16, (0f - velocity.X) * 0.5f, velocity.Y * 0.5f, 50, default(Color), 1.7f);
51245 Main.dust[num114].velocity.X = Main.dust[num114].velocity.X * 0.2f;
51246 Main.dust[num114].velocity.Y = Main.dust[num114].velocity.Y * 0.2f;
51247 Main.dust[num114].noGravity = true;
51248 }
51249 }
51250 }
51251 else
51252 {
51253 if (flag6)
51254 {
51255 float num115 = 40 * minionPos;
51256 int num116 = 30;
51257 int num117 = 60;
51258 localAI[0] -= 1f;
51259 if (localAI[0] < 0f)
51260 {
51261 localAI[0] = 0f;
51262 }
51263 if (ai[1] > 0f)
51264 {
51265 ai[1] -= 1f;
51266 }
51267 else
51268 {
51269 float num118 = position.X;
51270 float num119 = position.Y;
51271 float num120 = 100000f;
51272 float num121 = num120;
51273 int num122 = -1;
51274 float num123 = 20f;
51276 if (ownerMinionAttackTargetNPC != null && ownerMinionAttackTargetNPC.CanBeChasedBy(this))
51277 {
51278 float num124 = ownerMinionAttackTargetNPC.position.X + (float)(ownerMinionAttackTargetNPC.width / 2);
51279 float num125 = ownerMinionAttackTargetNPC.position.Y + (float)(ownerMinionAttackTargetNPC.height / 2);
51280 float num126 = Math.Abs(position.X + (float)(width / 2) - num124) + Math.Abs(position.Y + (float)(height / 2) - num125);
51281 if (num126 < num120)
51282 {
51283 if (num122 == -1 && num126 <= num121)
51284 {
51285 num121 = num126;
51286 num118 = num124;
51287 num119 = num125;
51288 }
51290 {
51291 num120 = num126;
51292 num118 = num124;
51293 num119 = num125;
51295 }
51296 }
51297 }
51298 if (num122 == -1)
51299 {
51300 for (int num127 = 0; num127 < 200; num127++)
51301 {
51302 if (!Main.npc[num127].CanBeChasedBy(this))
51303 {
51304 continue;
51305 }
51306 float num128 = Main.npc[num127].position.X + (float)(Main.npc[num127].width / 2);
51307 float num129 = Main.npc[num127].position.Y + (float)(Main.npc[num127].height / 2);
51308 float num130 = Math.Abs(position.X + (float)(width / 2) - num128) + Math.Abs(position.Y + (float)(height / 2) - num129);
51309 if (num130 < num120)
51310 {
51311 if (num122 == -1 && num130 <= num121)
51312 {
51313 num121 = num130;
51314 num118 = num128 + Main.npc[num127].velocity.X * num123;
51315 num119 = num129 + Main.npc[num127].velocity.Y * num123;
51316 }
51317 if (Collision.CanHit(position, width, height, Main.npc[num127].position, Main.npc[num127].width, Main.npc[num127].height))
51318 {
51319 num120 = num130;
51320 num118 = num128 + Main.npc[num127].velocity.X * num123;
51321 num119 = num129 + Main.npc[num127].velocity.Y * num123;
51322 num122 = num127;
51323 }
51324 }
51325 }
51326 }
51327 if (num122 == -1 && num121 < num120)
51328 {
51329 num120 = num121;
51330 }
51331 float num131 = 400f;
51332 if ((double)position.Y > Main.worldSurface * 16.0)
51333 {
51334 num131 = 200f;
51335 }
51336 if (num120 < num131 + num115 && num122 == -1)
51337 {
51338 float num132 = num118 - (position.X + (float)(width / 2));
51339 if (num132 < -5f)
51340 {
51341 flag2 = true;
51342 flag3 = false;
51343 }
51344 else if (num132 > 5f)
51345 {
51346 flag3 = true;
51347 flag2 = false;
51348 }
51349 }
51350 else if (num122 >= 0 && num120 < 800f + num115)
51351 {
51352 localAI[0] = num117;
51353 float num133 = num118 - (position.X + (float)(width / 2));
51354 if (num133 > 450f || num133 < -450f)
51355 {
51356 if (num133 < -50f)
51357 {
51358 flag2 = true;
51359 flag3 = false;
51360 }
51361 else if (num133 > 50f)
51362 {
51363 flag3 = true;
51364 flag2 = false;
51365 }
51366 }
51367 else if (owner == Main.myPlayer)
51368 {
51369 ai[1] = num116;
51370 Vector2 vector11 = new Vector2(position.X + (float)width * 0.5f, position.Y + (float)(height / 2) - 8f);
51371 float num134 = num118 - vector11.X + (float)Main.rand.Next(-20, 21);
51372 float num135 = Math.Abs(num134) * 0.1f;
51373 num135 = num135 * (float)Main.rand.Next(0, 100) * 0.001f;
51374 float num136 = num119 - vector11.Y + (float)Main.rand.Next(-20, 21) - num135;
51375 float num137 = (float)Math.Sqrt(num134 * num134 + num136 * num136);
51376 num137 = 11f / num137;
51377 num134 *= num137;
51378 num136 *= num137;
51379 int num138 = damage;
51380 int num139 = 195;
51382 Main.projectile[num140].timeLeft = 300;
51383 if (num134 < 0f)
51384 {
51385 direction = -1;
51386 }
51387 if (num134 > 0f)
51388 {
51389 direction = 1;
51390 }
51391 netUpdate = true;
51392 }
51393 }
51394 }
51395 }
51396 bool flag13 = false;
51398 bool flag14 = false;
51399 if (type == 266 || (type >= 390 && type <= 392))
51400 {
51401 float num141 = 40 * minionPos;
51402 int num142 = 60;
51403 localAI[0] -= 1f;
51404 if (localAI[0] < 0f)
51405 {
51406 localAI[0] = 0f;
51407 }
51408 if (ai[1] > 0f)
51409 {
51410 ai[1] -= 1f;
51411 }
51412 else
51413 {
51414 float num143 = position.X;
51415 float num144 = position.Y;
51416 float num145 = 100000f;
51417 float num146 = num145;
51418 int num147 = -1;
51420 if (ownerMinionAttackTargetNPC2 != null && ownerMinionAttackTargetNPC2.CanBeChasedBy(this))
51421 {
51422 float x = ownerMinionAttackTargetNPC2.Center.X;
51423 float y = ownerMinionAttackTargetNPC2.Center.Y;
51424 float num148 = Math.Abs(position.X + (float)(width / 2) - x) + Math.Abs(position.Y + (float)(height / 2) - y);
51425 if (num148 < num145)
51426 {
51427 if (num147 == -1 && num148 <= num146)
51428 {
51429 num146 = num148;
51430 num143 = x;
51431 num144 = y;
51432 }
51434 {
51435 num145 = num148;
51436 num143 = x;
51437 num144 = y;
51439 }
51440 }
51441 }
51442 if (num147 == -1)
51443 {
51444 for (int num149 = 0; num149 < 200; num149++)
51445 {
51446 if (!Main.npc[num149].CanBeChasedBy(this))
51447 {
51448 continue;
51449 }
51450 float num150 = Main.npc[num149].position.X + (float)(Main.npc[num149].width / 2);
51451 float num151 = Main.npc[num149].position.Y + (float)(Main.npc[num149].height / 2);
51452 float num152 = Math.Abs(position.X + (float)(width / 2) - num150) + Math.Abs(position.Y + (float)(height / 2) - num151);
51453 if (num152 < num145)
51454 {
51455 if (num147 == -1 && num152 <= num146)
51456 {
51457 num146 = num152;
51458 num143 = num150;
51459 num144 = num151;
51460 }
51461 if (Collision.CanHit(position, width, height, Main.npc[num149].position, Main.npc[num149].width, Main.npc[num149].height))
51462 {
51463 num145 = num152;
51464 num143 = num150;
51465 num144 = num151;
51466 num147 = num149;
51467 }
51468 }
51469 }
51470 }
51471 if (type >= 390 && type <= 392 && !Collision.SolidCollision(position, width, height))
51472 {
51473 tileCollide = true;
51474 }
51475 if (num147 == -1 && num146 < num145)
51476 {
51477 num145 = num146;
51478 }
51479 else if (num147 >= 0)
51480 {
51481 flag13 = true;
51482 vector12 = new Vector2(num143, num144) - base.Center;
51483 if (type >= 390 && type <= 392)
51484 {
51485 if (Main.npc[num147].position.Y > position.Y + (float)height)
51486 {
51487 int num153 = (int)(base.Center.X / 16f);
51488 int num154 = (int)((position.Y + (float)height + 1f) / 16f);
51489 if (Main.tile[num153, num154] != null && Main.tile[num153, num154].active() && TileID.Sets.Platforms[Main.tile[num153, num154].type])
51490 {
51491 tileCollide = false;
51492 }
51493 }
51495 Rectangle value = new Rectangle((int)Main.npc[num147].position.X, (int)Main.npc[num147].position.Y, Main.npc[num147].width, Main.npc[num147].height);
51496 int num155 = 10;
51497 value.X -= num155;
51498 value.Y -= num155;
51499 value.Width += num155 * 2;
51500 value.Height += num155 * 2;
51501 if (rectangle.Intersects(value))
51502 {
51503 flag14 = true;
51504 Vector2 vector13 = Main.npc[num147].Center - base.Center;
51505 if (velocity.Y > 0f && vector13.Y < 0f)
51506 {
51507 velocity.Y *= 0.5f;
51508 }
51509 if (velocity.Y < 0f && vector13.Y > 0f)
51510 {
51511 velocity.Y *= 0.5f;
51512 }
51513 if (velocity.X > 0f && vector13.X < 0f)
51514 {
51515 velocity.X *= 0.5f;
51516 }
51517 if (velocity.X < 0f && vector13.X > 0f)
51518 {
51519 velocity.X *= 0.5f;
51520 }
51521 if (vector13.Length() > 14f)
51522 {
51523 vector13.Normalize();
51524 vector13 *= 14f;
51525 }
51526 rotation = (rotation * 5f + vector13.ToRotation() + (float)Math.PI / 2f) / 6f;
51527 velocity = (velocity * 9f + vector13) / 10f;
51528 for (int num156 = 0; num156 < 1000; num156++)
51529 {
51530 if (whoAmI != num156 && owner == Main.projectile[num156].owner && Main.projectile[num156].type >= 390 && Main.projectile[num156].type <= 392 && (Main.projectile[num156].Center - base.Center).Length() < 15f)
51531 {
51532 float num157 = 0.5f;
51533 if (base.Center.Y > Main.projectile[num156].Center.Y)
51534 {
51535 Main.projectile[num156].velocity.Y -= num157;
51536 velocity.Y += num157;
51537 }
51538 else
51539 {
51540 Main.projectile[num156].velocity.Y += num157;
51541 velocity.Y -= num157;
51542 }
51543 if (base.Center.X > Main.projectile[num156].Center.X)
51544 {
51545 velocity.X += num157;
51546 Main.projectile[num156].velocity.X -= num157;
51547 }
51548 else
51549 {
51550 velocity.X -= num157;
51551 Main.projectile[num156].velocity.Y += num157;
51552 }
51553 }
51554 }
51555 }
51556 }
51557 }
51558 float num158 = 300f;
51559 if ((double)position.Y > Main.worldSurface * 16.0)
51560 {
51561 num158 = 150f;
51562 }
51563 if (type >= 390 && type <= 392)
51564 {
51565 num158 = 500f;
51566 if ((double)position.Y > Main.worldSurface * 16.0)
51567 {
51568 num158 = 250f;
51569 }
51570 }
51571 if (num145 < num158 + num141 && num147 == -1)
51572 {
51573 float num159 = num143 - (position.X + (float)(width / 2));
51574 if (num159 < -5f)
51575 {
51576 flag2 = true;
51577 flag3 = false;
51578 }
51579 else if (num159 > 5f)
51580 {
51581 flag3 = true;
51582 flag2 = false;
51583 }
51584 }
51585 bool flag15 = false;
51586 if (type >= 390 && type <= 392 && localAI[1] > 0f)
51587 {
51588 flag15 = true;
51589 localAI[1] -= 1f;
51590 }
51591 if (num147 >= 0 && num145 < 800f + num141)
51592 {
51593 friendly = true;
51594 localAI[0] = num142;
51595 float num160 = num143 - (position.X + (float)(width / 2));
51596 if (num160 < -10f)
51597 {
51598 flag2 = true;
51599 flag3 = false;
51600 }
51601 else if (num160 > 10f)
51602 {
51603 flag3 = true;
51604 flag2 = false;
51605 }
51607 {
51608 float num161 = Math.Abs(num144 - base.Center.Y);
51609 if (num161 < 120f)
51610 {
51611 velocity.Y = -10f;
51612 }
51613 else if (num161 < 210f)
51614 {
51615 velocity.Y = -13f;
51616 }
51617 else if (num161 < 270f)
51618 {
51619 velocity.Y = -15f;
51620 }
51621 else if (num161 < 310f)
51622 {
51623 velocity.Y = -17f;
51624 }
51625 else if (num161 < 380f)
51626 {
51627 velocity.Y = -18f;
51628 }
51629 }
51630 if (flag15)
51631 {
51632 friendly = false;
51633 if (velocity.X < 0f)
51634 {
51635 flag2 = true;
51636 }
51637 else if (velocity.X > 0f)
51638 {
51639 flag3 = true;
51640 }
51641 }
51642 }
51643 else
51644 {
51645 friendly = false;
51646 }
51647 }
51648 }
51649 if (ai[1] != 0f)
51650 {
51651 flag2 = false;
51652 flag3 = false;
51653 }
51654 else if (flag6 && localAI[0] == 0f)
51655 {
51656 direction = Main.player[owner].direction;
51657 }
51658 else if (type >= 390 && type <= 392)
51659 {
51660 int num162 = (int)(base.Center.X / 16f);
51661 int num163 = (int)(base.Center.Y / 16f);
51662 if (Main.tile[num162, num163] != null && Main.tile[num162, num163].wall > 0)
51663 {
51664 flag2 = (flag3 = false);
51665 }
51666 }
51667 if (type == 127)
51668 {
51669 if ((double)rotation > -0.1 && (double)rotation < 0.1)
51670 {
51671 rotation = 0f;
51672 }
51673 else if (rotation < 0f)
51674 {
51675 rotation += 0.1f;
51676 }
51677 else
51678 {
51679 rotation -= 0.1f;
51680 }
51681 }
51682 else if (type != 313 && !flag14)
51683 {
51684 rotation = 0f;
51685 }
51686 if (type < 390 || type > 392)
51687 {
51688 tileCollide = true;
51689 }
51690 float num164 = 0.08f;
51691 float num165 = 6.5f;
51692 if (type == 127)
51693 {
51694 num165 = 2f;
51695 num164 = 0.04f;
51696 }
51697 if (type == 112)
51698 {
51699 num165 = 6f;
51700 num164 = 0.06f;
51701 }
51702 if (type == 334)
51703 {
51704 num165 = 8f;
51705 num164 = 0.08f;
51706 }
51707 if (type == 268)
51708 {
51709 num165 = 8f;
51710 num164 = 0.4f;
51711 }
51712 if (type == 324)
51713 {
51714 num164 = 0.1f;
51715 num165 = 3f;
51716 }
51717 if (type == 858)
51718 {
51719 num164 = 0.3f;
51720 num165 = 7f;
51721 }
51722 if (flag6 || type == 266 || (type >= 390 && type <= 392) || type == 816 || type == 821 || type == 825 || type == 859 || type == 860 || type == 881 || type == 884 || type == 890 || type == 891 || type == 897 || type == 899 || type == 900 || type == 934 || type == 956 || type == 958 || type == 959 || type == 960 || type == 994 || type == 998 || type == 1003 || type == 1004)
51723 {
51724 num165 = 6f;
51725 num164 = 0.2f;
51726 if (num165 < Math.Abs(Main.player[owner].velocity.X) + Math.Abs(Main.player[owner].velocity.Y))
51727 {
51728 num165 = Math.Abs(Main.player[owner].velocity.X) + Math.Abs(Main.player[owner].velocity.Y);
51729 num164 = 0.3f;
51730 }
51731 if (flag6)
51732 {
51733 num164 *= 2f;
51734 }
51735 }
51736 if (type == 875)
51737 {
51738 num165 = 7f;
51739 num164 = 0.25f;
51740 if (num165 < Math.Abs(Main.player[owner].velocity.X) + Math.Abs(Main.player[owner].velocity.Y))
51741 {
51742 num165 = Math.Abs(Main.player[owner].velocity.X) + Math.Abs(Main.player[owner].velocity.Y);
51743 num164 = 0.35f;
51744 }
51745 }
51746 if (type >= 390 && type <= 392)
51747 {
51748 num164 *= 2f;
51749 }
51750 if (flag7)
51751 {
51752 num165 = 6f;
51753 }
51754 if (flag2)
51755 {
51756 if ((double)velocity.X > -3.5)
51757 {
51758 velocity.X -= num164;
51759 }
51760 else
51761 {
51762 velocity.X -= num164 * 0.25f;
51763 }
51764 }
51765 else if (flag3)
51766 {
51767 if ((double)velocity.X < 3.5)
51768 {
51769 velocity.X += num164;
51770 }
51771 else
51772 {
51773 velocity.X += num164 * 0.25f;
51774 }
51775 }
51776 else
51777 {
51778 velocity.X *= 0.9f;
51779 if (velocity.X >= 0f - num164 && velocity.X <= num164)
51780 {
51781 velocity.X = 0f;
51782 }
51783 }
51784 if (type == 208)
51785 {
51786 velocity.X *= 0.95f;
51787 if ((double)velocity.X > -0.1 && (double)velocity.X < 0.1)
51788 {
51789 velocity.X = 0f;
51790 }
51791 flag2 = false;
51792 flag3 = false;
51793 }
51794 if (flag2 || flag3)
51795 {
51796 int num166 = (int)(position.X + (float)(width / 2)) / 16;
51797 int j2 = (int)(position.Y + (float)(height / 2)) / 16;
51798 if (type == 236)
51799 {
51800 num166 += direction;
51801 }
51802 if (flag2)
51803 {
51804 num166--;
51805 }
51806 if (flag3)
51807 {
51808 num166++;
51809 }
51810 num166 += (int)velocity.X;
51811 if (WorldGen.SolidTile(num166, j2))
51812 {
51813 flag5 = true;
51814 }
51815 }
51816 if (Main.player[owner].position.Y + (float)Main.player[owner].height - 8f > position.Y + (float)height)
51817 {
51818 flag4 = true;
51819 }
51820 if (type == 268 && frameCounter < 10)
51821 {
51822 flag5 = false;
51823 }
51824 if (type == 860 && velocity.X != 0f)
51825 {
51826 flag5 = true;
51827 }
51828 if ((type == 881 || type == 934) && velocity.X != 0f)
51829 {
51830 flag5 = true;
51831 }
51832 Collision.StepUp(ref position, ref velocity, width, height, ref stepSpeed, ref gfxOffY);
51833 if (velocity.Y == 0f || type == 200)
51834 {
51835 if (!flag4 && (velocity.X < 0f || velocity.X > 0f))
51836 {
51837 int num167 = (int)(position.X + (float)(width / 2)) / 16;
51838 int j3 = (int)(position.Y + (float)(height / 2)) / 16 + 1;
51839 if (flag2)
51840 {
51841 num167--;
51842 }
51843 if (flag3)
51844 {
51845 num167++;
51846 }
51847 WorldGen.SolidTile(num167, j3);
51848 }
51849 if (flag5)
51850 {
51851 int num168 = (int)(position.X + (float)(width / 2)) / 16;
51852 int num169 = (int)(position.Y + (float)height) / 16;
51853 if (WorldGen.SolidTileAllowBottomSlope(num168, num169) || Main.tile[num168, num169].halfBrick() || Main.tile[num168, num169].slope() > 0 || type == 200)
51854 {
51855 if (type == 200)
51856 {
51857 velocity.Y = -3.1f;
51858 }
51859 else
51860 {
51861 try
51862 {
51863 num168 = (int)(position.X + (float)(width / 2)) / 16;
51864 num169 = (int)(position.Y + (float)(height / 2)) / 16;
51865 if (flag2)
51866 {
51867 num168--;
51868 }
51869 if (flag3)
51870 {
51871 num168++;
51872 }
51873 num168 += (int)velocity.X;
51874 if (!WorldGen.SolidTile(num168, num169 - 1) && !WorldGen.SolidTile(num168, num169 - 2))
51875 {
51876 velocity.Y = -5.1f;
51877 }
51878 else if (!WorldGen.SolidTile(num168, num169 - 2))
51879 {
51880 velocity.Y = -7.1f;
51881 }
51882 else if (WorldGen.SolidTile(num168, num169 - 5))
51883 {
51884 velocity.Y = -11.1f;
51885 }
51886 else if (WorldGen.SolidTile(num168, num169 - 4))
51887 {
51888 velocity.Y = -10.1f;
51889 }
51890 else
51891 {
51892 velocity.Y = -9.1f;
51893 }
51894 }
51895 catch
51896 {
51897 velocity.Y = -9.1f;
51898 }
51899 }
51900 if (type == 127)
51901 {
51902 ai[0] = 1f;
51903 }
51904 }
51905 }
51906 else if (type == 266 && (flag2 || flag3))
51907 {
51908 velocity.Y -= 6f;
51909 }
51910 }
51911 if (velocity.X > num165)
51912 {
51913 velocity.X = num165;
51914 }
51915 if (velocity.X < 0f - num165)
51916 {
51917 velocity.X = 0f - num165;
51918 }
51919 if (velocity.X < 0f)
51920 {
51921 direction = -1;
51922 }
51923 if (velocity.X > 0f)
51924 {
51925 direction = 1;
51926 }
51927 if (velocity.X > num164 && flag3)
51928 {
51929 direction = 1;
51930 }
51931 if (velocity.X < 0f - num164 && flag2)
51932 {
51933 direction = -1;
51934 }
51935 if (type != 313)
51936 {
51937 if (direction == -1)
51938 {
51939 spriteDirection = 1;
51940 }
51941 if (direction == 1)
51942 {
51943 spriteDirection = -1;
51944 }
51945 }
51946 if (type == 398 || type == 958 || type == 960 || type == 956 || type == 959 || type == 994)
51947 {
51949 }
51950 bool flag16 = position.X - oldPosition.X == 0f;
51951 if (type == 956)
51952 {
51953 if (alpha > 0)
51954 {
51955 int num170 = Dust.NewDust(position, width, height, 6, velocity.X, velocity.Y, 0, default(Color), 1.2f);
51956 Main.dust[num170].velocity.X += Main.rand.NextFloat() - 0.5f;
51957 Main.dust[num170].velocity.Y += (Main.rand.NextFloat() + 0.5f) * -1f;
51958 if (Main.rand.Next(3) != 0)
51959 {
51960 Main.dust[num170].noGravity = true;
51961 }
51962 alpha -= 5;
51963 if (alpha < 0)
51964 {
51965 alpha = 0;
51966 }
51967 }
51968 if (velocity.Y != 0f)
51969 {
51970 frame = 10;
51971 }
51972 else if (flag16)
51973 {
51974 spriteDirection = 1;
51975 if (Main.player[owner].Center.X < base.Center.X)
51976 {
51977 spriteDirection = -1;
51978 }
51979 frame = 0;
51980 }
51981 else
51982 {
51983 float num171 = velocity.Length();
51984 frameCounter += (int)num171;
51985 if (frameCounter > 7)
51986 {
51987 frame++;
51988 frameCounter = 0;
51989 }
51991 {
51992 frame = 1;
51993 }
51994 }
51995 velocity.Y += 0.4f;
51996 if (velocity.Y > 10f)
51997 {
51998 velocity.Y = 10f;
51999 }
52000 }
52001 else if (type == 958)
52002 {
52003 if (velocity.Y != 0f)
52004 {
52005 localAI[0] = 0f;
52006 frame = 4;
52007 }
52008 else if (flag16)
52009 {
52010 spriteDirection = 1;
52011 if (Main.player[owner].Center.X < base.Center.X)
52012 {
52013 spriteDirection = -1;
52014 }
52015 localAI[0] += 1f;
52016 if (localAI[0] > 200f)
52017 {
52018 frame = 1 + (int)(localAI[0] - 200f) / 6;
52019 if (localAI[0] >= 218f)
52020 {
52021 frame = 0;
52022 localAI[0] = Main.rand.Next(100);
52023 }
52024 }
52025 else
52026 {
52027 frame = 0;
52028 }
52029 }
52030 else
52031 {
52032 localAI[0] = 0f;
52033 float num172 = velocity.Length();
52034 frameCounter += (int)num172;
52035 if (frameCounter > 6)
52036 {
52037 frame++;
52038 frameCounter = 0;
52039 }
52040 if (frame < 5 || frame > 12)
52041 {
52042 frame = 5;
52043 }
52044 }
52045 velocity.Y += 0.4f;
52046 if (velocity.Y > 10f)
52047 {
52048 velocity.Y = 10f;
52049 }
52050 }
52051 else if (type == 959)
52052 {
52053 if (velocity.Y != 0f)
52054 {
52055 frame = ((velocity.Y > 0f) ? 10 : 9);
52056 }
52057 else if (flag16)
52058 {
52059 spriteDirection = 1;
52060 if (Main.player[owner].Center.X < base.Center.X)
52061 {
52062 spriteDirection = -1;
52063 }
52064 frame = 0;
52065 }
52066 else
52067 {
52068 float num173 = velocity.Length();
52069 frameCounter += (int)num173;
52070 if (frameCounter > 6)
52071 {
52072 frame++;
52073 frameCounter = 0;
52074 }
52076 {
52077 frame = 1;
52078 }
52079 }
52080 velocity.Y += 0.4f;
52081 if (velocity.Y > 10f)
52082 {
52083 velocity.Y = 10f;
52084 }
52085 }
52086 else if (type == 998)
52087 {
52088 if (velocity.Y != 0f)
52089 {
52090 frame = 1;
52091 }
52092 else if (flag16)
52093 {
52094 spriteDirection = -1;
52095 if (Main.player[owner].Center.X < base.Center.X)
52096 {
52097 spriteDirection = 1;
52098 }
52099 frame = 0;
52100 }
52101 else
52102 {
52103 float num174 = velocity.Length();
52104 frameCounter += (int)num174;
52105 if (frameCounter > 6)
52106 {
52107 frame++;
52108 frameCounter = 0;
52109 }
52111 {
52112 frame = 0;
52113 }
52114 }
52115 velocity.Y += 0.4f;
52116 if (velocity.Y > 10f)
52117 {
52118 velocity.Y = 10f;
52119 }
52120 }
52121 else if (type == 1003)
52122 {
52123 if (velocity.Y != 0f)
52124 {
52125 frame = 1;
52126 }
52127 else if (flag16)
52128 {
52129 spriteDirection = -1;
52130 if (Main.player[owner].Center.X < base.Center.X)
52131 {
52132 spriteDirection = 1;
52133 }
52134 frame = 0;
52135 }
52136 else
52137 {
52138 float num175 = velocity.Length();
52139 frameCounter += (int)num175;
52140 if (frameCounter > 6)
52141 {
52142 frame++;
52143 frameCounter = 0;
52144 }
52145 if (frame < 2 || frame > 11)
52146 {
52147 frame = 2;
52148 }
52149 }
52150 velocity.Y += 0.4f;
52151 if (velocity.Y > 10f)
52152 {
52153 velocity.Y = 10f;
52154 }
52155 }
52156 else if (type == 1004)
52157 {
52158 if (velocity.Y != 0f)
52159 {
52160 frame = 1;
52161 }
52162 else if (flag16)
52163 {
52164 spriteDirection = -1;
52165 if (Main.player[owner].Center.X < base.Center.X)
52166 {
52167 spriteDirection = 1;
52168 }
52169 frame = 0;
52170 }
52171 else
52172 {
52173 float num176 = velocity.Length();
52174 frameCounter += (int)num176;
52175 if (frameCounter > 6)
52176 {
52177 frame++;
52178 frameCounter = 0;
52179 }
52181 {
52182 frame = 2;
52183 }
52184 }
52185 velocity.Y += 0.4f;
52186 if (velocity.Y > 10f)
52187 {
52188 velocity.Y = 10f;
52189 }
52190 }
52191 else if (type == 994)
52192 {
52193 if (velocity.Y != 0f)
52194 {
52195 frame = 4;
52196 }
52197 else if (flag16)
52198 {
52199 spriteDirection = 1;
52200 if (Main.player[owner].Center.X < base.Center.X)
52201 {
52202 spriteDirection = -1;
52203 }
52204 frameCounter++;
52205 if (frameCounter > 5)
52206 {
52207 frame++;
52208 frameCounter = 0;
52209 }
52210 if (frame > 3)
52211 {
52212 frame = 0;
52213 }
52214 }
52215 else
52216 {
52217 float num177 = velocity.Length();
52218 frameCounter += (int)num177;
52219 if (frameCounter > 6)
52220 {
52221 frame++;
52222 frameCounter = 0;
52223 }
52224 if (frame < 5 || frame > 12)
52225 {
52226 frame = 5;
52227 }
52228 }
52229 velocity.Y += 0.4f;
52230 if (velocity.Y > 10f)
52231 {
52232 velocity.Y = 10f;
52233 }
52234 }
52235 else if (type == 960)
52236 {
52237 _ = Main.player[owner];
52238 if (velocity.Y != 0f)
52239 {
52240 localAI[0] = 0f;
52241 localAI[1] = 0f;
52242 frameCounter = 0;
52243 frame = 4;
52244 }
52245 else if (flag16)
52246 {
52247 if (!flag7)
52248 {
52249 spriteDirection = 1;
52250 if (Main.player[owner].Center.X < base.Center.X)
52251 {
52252 spriteDirection = -1;
52253 }
52254 }
52255 if (frame >= 5 && frame < 12)
52256 {
52257 frameCounter++;
52258 if (frameCounter > 3)
52259 {
52260 frame++;
52261 frameCounter = 0;
52262 }
52263 if (frame >= 12)
52264 {
52265 frame = 0;
52266 }
52267 }
52269 {
52270 if (localAI[0] == 0f)
52271 {
52272 if (localAI[1] == 0f)
52273 {
52274 localAI[1] = 1f;
52275 frameCounter = 0;
52276 }
52277 frame = 13;
52278 frameCounter++;
52279 if (frameCounter > 6)
52280 {
52281 localAI[0] = 1f;
52282 frame = 14;
52283 frameCounter = 0;
52284 }
52285 }
52286 else
52287 {
52288 frameCounter++;
52289 if (frameCounter > 6)
52290 {
52291 frame++;
52292 if (frame > 18)
52293 {
52294 frame = 14;
52295 }
52296 frameCounter = 0;
52297 }
52298 }
52299 }
52300 else
52301 {
52302 localAI[0] = 0f;
52303 if (localAI[1] == 1f)
52304 {
52305 localAI[1] = 0f;
52306 frameCounter = 0;
52307 }
52308 if (frame >= 12 && frame <= 19)
52309 {
52310 frame = 19;
52311 frameCounter++;
52312 if (frameCounter > 6)
52313 {
52314 frame = 0;
52315 frameCounter = 0;
52316 }
52317 }
52318 else
52319 {
52320 frameCounter++;
52321 if (frameCounter >= 24)
52322 {
52323 frameCounter = 0;
52324 }
52325 frame = frameCounter / 6;
52326 }
52327 }
52328 }
52329 else
52330 {
52331 localAI[0] = 0f;
52332 localAI[1] = 0f;
52333 float val = velocity.Length();
52334 frameCounter += (int)Math.Max(2f, val);
52335 if (frameCounter > 6)
52336 {
52337 frame++;
52338 frameCounter = 0;
52339 }
52340 if (frame < 5 || frame > 12)
52341 {
52342 frame = 5;
52343 }
52344 }
52345 velocity.Y += 0.4f;
52346 if (velocity.Y > 10f)
52347 {
52348 velocity.Y = 10f;
52349 }
52350 }
52351 else if (type == 816)
52352 {
52353 if (velocity.Y != 0f)
52354 {
52355 frame = 4;
52356 }
52357 else if (flag16)
52358 {
52359 spriteDirection = -1;
52360 if (Main.player[owner].Center.X < base.Center.X)
52361 {
52362 spriteDirection = 1;
52363 }
52364 if (++frameCounter > 5)
52365 {
52366 frame++;
52367 frameCounter = 0;
52368 }
52370 {
52371 frame = 0;
52372 }
52373 }
52374 else
52375 {
52376 int num178 = 5;
52377 float num179 = velocity.Length();
52378 if (num179 > 4f)
52379 {
52380 num178 = 3;
52381 }
52382 else if (num179 > 2f)
52383 {
52384 num178 = 4;
52385 }
52386 if (++frameCounter > num178)
52387 {
52388 frame++;
52389 frameCounter = 0;
52390 }
52391 if (frame < 4 || frame > 10)
52392 {
52393 frame = 4;
52394 }
52395 }
52396 velocity.Y += 0.4f;
52397 if (velocity.Y > 10f)
52398 {
52399 velocity.Y = 10f;
52400 }
52401 }
52402 if (type == 860)
52403 {
52404 if (velocity.Y != 0f)
52405 {
52406 localAI[0] = 0f;
52407 if (frame >= 5)
52408 {
52409 frame = 5;
52410 frameCounter = 0;
52411 }
52412 else if (++frameCounter > 5)
52413 {
52414 frame++;
52415 frameCounter = 0;
52416 }
52417 }
52418 else if (Math.Abs(velocity.X) < 1f)
52419 {
52420 if (localAI[0] > 800f)
52421 {
52422 frameCounter++;
52423 if (frameCounter > 3)
52424 {
52425 frameCounter = 0;
52426 frame++;
52427 if (frame > 3)
52428 {
52429 frame = 3;
52430 }
52431 }
52432 localAI[0] += 1f;
52433 if (localAI[0] > 850f)
52434 {
52435 localAI[0] = 0f;
52436 }
52437 if (frame == 3 && localAI[0] == 820f)
52438 {
52439 for (int num180 = 0; num180 < 3 + Main.rand.Next(3); num180++)
52440 {
52441 int num181 = Gore.NewGore(new Vector2(position.X, base.Center.Y - 10f), Vector2.Zero, 1218);
52442 Main.gore[num181].velocity = new Vector2((float)Main.rand.Next(1, 10) * 0.3f * (float)(-spriteDirection), 0f - (2f + (float)Main.rand.Next(4) * 0.3f));
52443 }
52444 }
52445 }
52446 else if (frame == 0)
52447 {
52448 localAI[0] += 1f;
52449 frame = 0;
52450 frameCounter = 0;
52451 }
52452 else
52453 {
52454 localAI[0] = 0f;
52455 if (frame > 5)
52456 {
52457 frame = 5;
52458 frameCounter = 0;
52459 }
52460 if (++frameCounter > 4)
52461 {
52462 frame--;
52463 frameCounter = 0;
52464 }
52465 }
52466 }
52467 velocity.Y += 0.4f;
52468 if (velocity.Y > 10f)
52469 {
52470 velocity.Y = 10f;
52471 }
52472 }
52473 if (type == 859)
52474 {
52475 if (velocity.Y != 0f)
52476 {
52477 frame = 4;
52478 }
52479 else if (flag16)
52480 {
52481 spriteDirection = -1;
52482 if (Main.player[owner].Center.X < base.Center.X)
52483 {
52484 spriteDirection = 1;
52485 }
52486 if (frame == 6)
52487 {
52488 if (++frameCounter > 5)
52489 {
52490 frame = 0;
52491 frameCounter = 0;
52492 }
52493 }
52494 else if (frame > 3)
52495 {
52496 frame = 6;
52497 frameCounter = 0;
52498 }
52499 else
52500 {
52501 if (++frameCounter > 5)
52502 {
52503 frame++;
52504 frameCounter = 0;
52505 }
52507 {
52508 frame = 0;
52509 }
52510 }
52511 }
52512 else
52513 {
52514 float num182 = velocity.Length();
52515 int num183 = 8;
52516 if (num182 < 3f)
52517 {
52518 num183 = 4;
52519 }
52520 if (num182 < 1f)
52521 {
52522 num183 = 2;
52523 }
52524 frameCounter += (int)num182;
52525 if (frameCounter > num183)
52526 {
52527 frame++;
52528 frameCounter = 0;
52529 }
52530 if (frame < 5 || frame > 17)
52531 {
52532 frame = 5;
52533 }
52534 }
52535 velocity.Y += 0.4f;
52536 if (velocity.Y > 10f)
52537 {
52538 velocity.Y = 10f;
52539 }
52540 }
52541 else if (type == 858)
52542 {
52543 if (velocity.Y != 0f)
52544 {
52545 frame = 1;
52546 }
52547 else if (flag16)
52548 {
52549 spriteDirection = -1;
52550 if (Main.player[owner].Center.X < base.Center.X)
52551 {
52552 spriteDirection = 1;
52553 }
52554 frame = 0;
52555 }
52556 else
52557 {
52558 float num184 = velocity.Length();
52559 frameCounter += (int)num184;
52560 if (frameCounter > 3)
52561 {
52562 frame++;
52563 frameCounter = 0;
52564 }
52566 {
52567 frame = 2;
52568 }
52569 }
52570 velocity.Y += 0.4f;
52571 if (velocity.Y > 10f)
52572 {
52573 velocity.Y = 10f;
52574 }
52575 }
52576 else if (type == 900)
52577 {
52579 if (velocity.Y != 0f)
52580 {
52581 frame = 1;
52582 frameCounter = 0;
52583 }
52584 else if (flag16)
52585 {
52586 spriteDirection = 1;
52587 if (Main.player[owner].Center.X < base.Center.X)
52588 {
52589 spriteDirection = -1;
52590 }
52591 frame = 0;
52592 frameCounter = 0;
52593 }
52594 else
52595 {
52596 frameCounter += 1 + (int)Math.Abs(velocity.X * 0.3f);
52597 if (frame < 2)
52598 {
52599 frame = 2;
52600 frameCounter = 0;
52601 }
52602 if (frameCounter > 4)
52603 {
52604 frame++;
52605 frameCounter = 0;
52606 }
52607 if (frame > 9)
52608 {
52609 frame = 2;
52610 }
52611 }
52612 velocity.Y += 0.4f;
52613 if (velocity.Y > 10f)
52614 {
52615 velocity.Y = 10f;
52616 }
52617 }
52618 else if (type == 899)
52619 {
52621 if (velocity.Y != 0f)
52622 {
52623 frame = 1;
52624 frameCounter = 0;
52625 }
52626 else if (flag16)
52627 {
52628 spriteDirection = 1;
52629 if (Main.player[owner].Center.X < base.Center.X)
52630 {
52631 spriteDirection = -1;
52632 }
52633 frame = 0;
52634 frameCounter = 0;
52635 }
52636 else
52637 {
52638 frameCounter += 1 + (int)Math.Abs(velocity.X * 0.3f);
52639 if (frame < 2)
52640 {
52641 frame = 2;
52642 frameCounter = 0;
52643 }
52644 if (frameCounter > 4)
52645 {
52646 frame++;
52647 frameCounter = 0;
52648 }
52649 if (frame > 9)
52650 {
52651 frame = 2;
52652 }
52653 }
52654 velocity.Y += 0.4f;
52655 if (velocity.Y > 10f)
52656 {
52657 velocity.Y = 10f;
52658 }
52659 }
52660 else if (type == 897)
52661 {
52663 if (velocity.Y != 0f)
52664 {
52665 frame = 1;
52666 frameCounter = 0;
52667 }
52668 else if (flag16)
52669 {
52670 spriteDirection = 1;
52671 if (Main.player[owner].Center.X < base.Center.X)
52672 {
52673 spriteDirection = -1;
52674 }
52675 frame = 0;
52676 frameCounter = 0;
52677 }
52678 else
52679 {
52680 frameCounter += 1 + (int)Math.Abs(velocity.X * 0.3f);
52681 if (frame < 2)
52682 {
52683 frame = 2;
52684 frameCounter = 0;
52685 }
52686 if (frameCounter > 4)
52687 {
52688 frame++;
52689 frameCounter = 0;
52690 }
52691 if (frame > 7)
52692 {
52693 frame = 2;
52694 }
52695 }
52696 velocity.Y += 0.4f;
52697 if (velocity.Y > 10f)
52698 {
52699 velocity.Y = 10f;
52700 }
52701 }
52702 else if (type == 891)
52703 {
52705 if (velocity.Y != 0f)
52706 {
52707 frame = 1;
52708 frameCounter = 0;
52709 }
52710 else if (flag16)
52711 {
52712 spriteDirection = Main.player[owner].direction;
52713 frame = 0;
52714 frameCounter = 0;
52715 }
52716 else
52717 {
52718 frameCounter += 1 + (int)Math.Abs(velocity.X * 0.3f);
52719 if (frame < 2)
52720 {
52721 frame = 2;
52722 frameCounter = 0;
52723 }
52724 if (frameCounter > 4)
52725 {
52726 frame++;
52727 frameCounter = 0;
52728 }
52729 if (frame > 8)
52730 {
52731 frame = 2;
52732 }
52733 }
52734 velocity.Y += 0.4f;
52735 if (velocity.Y > 10f)
52736 {
52737 velocity.Y = 10f;
52738 }
52739 }
52740 else if (type == 890)
52741 {
52743 if (velocity.Y != 0f)
52744 {
52745 frame = 1;
52746 frameCounter = 0;
52747 }
52748 else if (flag16)
52749 {
52750 spriteDirection = 1;
52751 if (Main.player[owner].Center.X < base.Center.X)
52752 {
52753 spriteDirection = -1;
52754 }
52755 frame = 0;
52756 frameCounter = 0;
52757 }
52758 else
52759 {
52760 frameCounter += 1 + (int)Math.Abs(velocity.X * 0.3f);
52761 if (frame < 2)
52762 {
52763 frame = 2;
52764 frameCounter = 0;
52765 }
52766 if (frameCounter > 4)
52767 {
52768 frame++;
52769 frameCounter = 0;
52770 }
52771 if (frame > 7)
52772 {
52773 frame = 2;
52774 }
52775 }
52776 velocity.Y += 0.4f;
52777 if (velocity.Y > 10f)
52778 {
52779 velocity.Y = 10f;
52780 }
52781 }
52782 else if (type == 884)
52783 {
52785 if (velocity.Y != 0f)
52786 {
52787 if (velocity.Y < 0f)
52788 {
52789 frame = 9;
52790 }
52791 else
52792 {
52793 frame = 1;
52794 }
52795 frameCounter = 0;
52796 }
52797 else if (flag16)
52798 {
52799 spriteDirection = 1;
52800 if (Main.player[owner].Center.X < base.Center.X)
52801 {
52802 spriteDirection = -1;
52803 }
52804 frame = 0;
52805 frameCounter = 0;
52806 }
52807 else
52808 {
52809 frameCounter += 1 + (int)Math.Abs(velocity.X * 0.5f);
52810 if (frameCounter > 6)
52811 {
52812 frame++;
52813 frameCounter = 0;
52814 }
52815 if (frame > 8)
52816 {
52817 frame = 2;
52818 }
52819 }
52820 velocity.Y += 0.4f;
52821 if (velocity.Y > 10f)
52822 {
52823 velocity.Y = 10f;
52824 }
52825 }
52826 else if (type == 881 || type == 934)
52827 {
52828 spriteDirection = 1;
52829 if (Main.player[owner].Center.X < base.Center.X)
52830 {
52831 spriteDirection = -1;
52832 }
52833 if (velocity.Y > 0f)
52834 {
52835 frameCounter++;
52836 if (frameCounter > 2)
52837 {
52838 frame++;
52839 if (frame >= 2)
52840 {
52841 frame = 2;
52842 }
52843 frameCounter = 0;
52844 }
52845 }
52846 else if (velocity.Y < 0f)
52847 {
52848 frameCounter++;
52849 if (frameCounter > 2)
52850 {
52851 frame++;
52852 if (frame >= 5)
52853 {
52854 frame = 0;
52855 }
52856 frameCounter = 0;
52857 }
52858 }
52859 else if (frame == 0)
52860 {
52861 frame = 0;
52862 }
52863 else if (++frameCounter > 3)
52864 {
52865 frame++;
52866 if (frame >= 6)
52867 {
52868 frame = 0;
52869 }
52870 frameCounter = 0;
52871 }
52872 if (wet && Main.player[owner].position.Y + (float)Main.player[owner].height < position.Y + (float)height && localAI[0] == 0f)
52873 {
52874 if (velocity.Y > -4f)
52875 {
52876 velocity.Y -= 0.2f;
52877 }
52878 if (velocity.Y > 0f)
52879 {
52880 velocity.Y *= 0.95f;
52881 }
52882 }
52883 else
52884 {
52885 velocity.Y += 0.4f;
52886 }
52887 if (velocity.Y > 10f)
52888 {
52889 velocity.Y = 10f;
52890 }
52891 }
52892 else if (type == 875)
52893 {
52894 if (velocity.Y != 0f)
52895 {
52896 if (velocity.Y < 0f)
52897 {
52898 frame = 3;
52899 }
52900 else
52901 {
52902 frame = 6;
52903 }
52904 frameCounter = 0;
52905 }
52906 else if (flag16)
52907 {
52908 spriteDirection = -1;
52909 if (Main.player[owner].Center.X < base.Center.X)
52910 {
52911 spriteDirection = 1;
52912 }
52913 frame = 0;
52914 frameCounter = 0;
52915 }
52916 else
52917 {
52918 frameCounter += 1 + (int)Math.Abs(velocity.X * 0.75f);
52919 if (frameCounter > 6)
52920 {
52921 frame++;
52922 frameCounter = 0;
52923 }
52924 if (frame > 6)
52925 {
52926 frame = 0;
52927 }
52928 }
52929 velocity.Y += 0.4f;
52930 if (velocity.Y > 10f)
52931 {
52932 velocity.Y = 10f;
52933 }
52934 }
52935 else if (type == 854)
52936 {
52937 if (velocity.Y != 0f)
52938 {
52939 frame = 7;
52940 }
52941 else if (flag16)
52942 {
52943 spriteDirection = -1;
52944 if (Main.player[owner].Center.X < base.Center.X)
52945 {
52946 spriteDirection = 1;
52947 }
52948 if (++frameCounter > 5)
52949 {
52950 frame++;
52951 frameCounter = 0;
52952 }
52954 {
52955 frame = 0;
52956 }
52957 }
52958 else
52959 {
52960 int num185 = 3;
52961 float num186 = velocity.Length();
52962 if (num186 > 4f)
52963 {
52964 num185 = 1;
52965 }
52966 else if (num186 > 2f)
52967 {
52968 num185 = 2;
52969 }
52970 if (++frameCounter > num185)
52971 {
52972 frame++;
52973 frameCounter = 0;
52974 }
52975 if (frame < 4 || frame > 12)
52976 {
52977 frame = 4;
52978 }
52979 }
52980 velocity.Y += 0.4f;
52981 if (velocity.Y > 10f)
52982 {
52983 velocity.Y = 10f;
52984 }
52985 }
52986 else if (type == 825)
52987 {
52988 if (velocity.Y != 0f)
52989 {
52990 localAI[0] = 0f;
52991 frame = 12;
52992 }
52993 else if (flag16)
52994 {
52995 spriteDirection = -1;
52996 if (Main.player[owner].Center.X < base.Center.X)
52997 {
52998 spriteDirection = 1;
52999 }
53000 if (frame >= 1 && frame <= 2)
53001 {
53002 localAI[0] = 0f;
53003 if (++frameCounter > 5)
53004 {
53005 frame++;
53006 frameCounter = 0;
53007 }
53008 if (frame > 2)
53009 {
53010 frame = 0;
53011 }
53012 }
53013 else if (frame >= 3 && frame <= 11)
53014 {
53015 localAI[0] = 0f;
53016 if (++frameCounter > 5)
53017 {
53018 frame++;
53019 frameCounter = 0;
53020 }
53021 if (frame > 11)
53022 {
53023 frame = 0;
53024 }
53025 }
53026 else
53027 {
53028 if (frame == 13)
53029 {
53030 if (++frameCounter > 8)
53031 {
53032 frame++;
53033 frameCounter = 0;
53034 }
53035 if (frame == 14)
53036 {
53037 frame = 0;
53038 }
53039 }
53040 if (frame != 0)
53041 {
53042 frame = 13;
53043 }
53044 else
53045 {
53046 frame = 0;
53047 }
53048 if (frame == 0)
53049 {
53050 localAI[0] += 1f;
53051 if (localAI[0] > 300f && Main.rand.Next(50) == 0)
53052 {
53053 switch (Main.rand.Next(2))
53054 {
53055 case 0:
53056 frame = 1;
53057 break;
53058 case 1:
53059 frame = 3;
53060 break;
53061 }
53062 }
53063 }
53064 }
53065 }
53066 else
53067 {
53068 localAI[0] = 0f;
53069 int num187 = 3;
53070 float num188 = velocity.Length();
53071 if (num188 > 4f)
53072 {
53073 num187 = 2;
53074 }
53075 else if (num188 > 2f)
53076 {
53077 num187 = 1;
53078 }
53079 if (++frameCounter > num187)
53080 {
53081 frame++;
53082 frameCounter = 0;
53083 }
53084 if (frame < 13)
53085 {
53086 frame = 13;
53087 }
53088 if (frame > 19)
53089 {
53090 frame = 14;
53091 }
53092 }
53093 velocity.Y += 0.4f;
53094 if (velocity.Y > 10f)
53095 {
53096 velocity.Y = 10f;
53097 }
53098 }
53099 else if (type == 821)
53100 {
53101 if (velocity.Y != 0f)
53102 {
53103 localAI[0] = 0f;
53104 frame = 12;
53105 }
53106 else if (flag16)
53107 {
53108 spriteDirection = -1;
53109 if (Main.player[owner].Center.X < base.Center.X)
53110 {
53111 spriteDirection = 1;
53112 }
53113 localAI[0] += 1f;
53114 if (localAI[0] > 400f)
53115 {
53116 int num189 = 7;
53117 if (frame == 9)
53118 {
53119 num189 = 25;
53120 }
53121 if (++frameCounter > num189)
53122 {
53123 frame++;
53124 frameCounter = 0;
53125 }
53126 if (frame < 5)
53127 {
53128 frame = 5;
53129 }
53130 if (frame > 11)
53131 {
53132 localAI[0] = 0f;
53133 frame = 0;
53134 }
53135 }
53136 else
53137 {
53138 if (++frameCounter > 6)
53139 {
53140 frame++;
53141 frameCounter = 0;
53142 }
53144 {
53145 frame = 0;
53146 }
53147 }
53148 }
53149 else
53150 {
53151 localAI[0] = 0f;
53152 int num190 = 4;
53153 float num191 = velocity.Length();
53154 if (num191 > 3f)
53155 {
53156 num190 = 3;
53157 }
53158 if (num191 > 5f)
53159 {
53160 num190 = 2;
53161 }
53162 if (++frameCounter > num190)
53163 {
53164 frame++;
53165 if (num190 == 0)
53166 {
53167 frame++;
53168 }
53169 frameCounter = 0;
53170 }
53171 if (frame < 13 || frame > 18)
53172 {
53173 frame = 13;
53174 }
53175 }
53176 velocity.Y += 0.4f;
53177 if (velocity.Y > 10f)
53178 {
53179 velocity.Y = 10f;
53180 }
53181 }
53182 else if (flag6)
53183 {
53184 if (ai[1] > 0f)
53185 {
53186 if (localAI[1] == 0f)
53187 {
53188 localAI[1] = 1f;
53189 frame = 1;
53190 }
53191 if (frame != 0)
53192 {
53193 frameCounter++;
53194 if (frameCounter > 4)
53195 {
53196 frame++;
53197 frameCounter = 0;
53198 }
53199 if (frame >= 4)
53200 {
53201 frame = 0;
53202 }
53203 }
53204 }
53205 else if (velocity.Y == 0f)
53206 {
53207 localAI[1] = 0f;
53208 if (flag16)
53209 {
53210 frame = 0;
53211 frameCounter = 0;
53212 }
53213 else if ((double)velocity.X < -0.8 || (double)velocity.X > 0.8)
53214 {
53215 frameCounter += (int)Math.Abs(velocity.X);
53216 frameCounter++;
53217 if (frameCounter > 6)
53218 {
53219 frame++;
53220 frameCounter = 0;
53221 }
53222 if (frame < 5)
53223 {
53224 frame = 5;
53225 }
53226 if (frame >= 11)
53227 {
53228 frame = 5;
53229 }
53230 }
53231 else
53232 {
53233 frame = 0;
53234 frameCounter = 0;
53235 }
53236 }
53237 else if (velocity.Y < 0f)
53238 {
53239 frameCounter = 0;
53240 frame = 4;
53241 }
53242 else if (velocity.Y > 0f)
53243 {
53244 frameCounter = 0;
53245 frame = 4;
53246 }
53247 velocity.Y += 0.4f;
53248 if (velocity.Y > 10f)
53249 {
53250 velocity.Y = 10f;
53251 }
53252 _ = velocity;
53253 }
53254 else if (type == 268)
53255 {
53256 if (velocity.Y == 0f)
53257 {
53258 if (frame > 5)
53259 {
53260 frameCounter = 0;
53261 }
53262 if (flag16)
53263 {
53264 int num192 = 3;
53265 frameCounter++;
53266 if (frameCounter < num192)
53267 {
53268 frame = 0;
53269 }
53270 else if (frameCounter < num192 * 2)
53271 {
53272 frame = 1;
53273 }
53274 else if (frameCounter < num192 * 3)
53275 {
53276 frame = 2;
53277 }
53278 else if (frameCounter < num192 * 4)
53279 {
53280 frame = 3;
53281 }
53282 else
53283 {
53284 frameCounter = num192 * 4;
53285 }
53286 }
53287 else
53288 {
53289 velocity.X *= 0.8f;
53290 frameCounter++;
53291 int num193 = 3;
53292 if (frameCounter < num193)
53293 {
53294 frame = 0;
53295 }
53296 else if (frameCounter < num193 * 2)
53297 {
53298 frame = 1;
53299 }
53300 else if (frameCounter < num193 * 3)
53301 {
53302 frame = 2;
53303 }
53304 else if (frameCounter < num193 * 4)
53305 {
53306 frame = 3;
53307 }
53308 else if (flag2 || flag3)
53309 {
53310 velocity.X *= 2f;
53311 frame = 4;
53312 velocity.Y = -6.1f;
53313 frameCounter = 0;
53314 for (int num194 = 0; num194 < 4; num194++)
53315 {
53316 int num195 = Dust.NewDust(new Vector2(position.X, position.Y + (float)height - 2f), width, 4, 5);
53317 Main.dust[num195].velocity += velocity;
53318 Main.dust[num195].velocity *= 0.4f;
53319 }
53320 }
53321 else
53322 {
53323 frameCounter = num193 * 4;
53324 }
53325 }
53326 }
53327 else if (velocity.Y < 0f)
53328 {
53329 frameCounter = 0;
53330 frame = 5;
53331 }
53332 else
53333 {
53334 frame = 4;
53335 frameCounter = 3;
53336 }
53337 velocity.Y += 0.4f;
53338 if (velocity.Y > 10f)
53339 {
53340 velocity.Y = 10f;
53341 }
53342 }
53343 else if (type == 269)
53344 {
53345 if (velocity.Y >= 0f && (double)velocity.Y <= 0.8)
53346 {
53347 if (flag16)
53348 {
53349 frame = 0;
53350 frameCounter = 0;
53351 }
53352 else if ((double)velocity.X < -0.8 || (double)velocity.X > 0.8)
53353 {
53354 int num196 = Dust.NewDust(new Vector2(position.X, position.Y + (float)height - 2f), width, 6, 76);
53355 Main.dust[num196].noGravity = true;
53356 Main.dust[num196].velocity *= 0.3f;
53357 Main.dust[num196].noLight = true;
53358 frameCounter += (int)Math.Abs(velocity.X);
53359 frameCounter++;
53360 if (frameCounter > 6)
53361 {
53362 frame++;
53363 frameCounter = 0;
53364 }
53365 if (frame > 3)
53366 {
53367 frame = 0;
53368 }
53369 }
53370 else
53371 {
53372 frame = 0;
53373 frameCounter = 0;
53374 }
53375 }
53376 else
53377 {
53378 frameCounter = 0;
53379 frame = 2;
53380 }
53381 velocity.Y += 0.4f;
53382 if (velocity.Y > 10f)
53383 {
53384 velocity.Y = 10f;
53385 }
53386 }
53387 else if (type == 313)
53388 {
53389 int i3 = (int)(base.Center.X / 16f);
53390 int num197 = (int)(base.Center.Y / 16f);
53391 int num198 = 0;
53392 Tile tileSafely2 = Framing.GetTileSafely(i3, num197);
53393 Tile tileSafely3 = Framing.GetTileSafely(i3, num197 - 1);
53394 Tile tileSafely4 = Framing.GetTileSafely(i3, num197 + 1);
53395 if (tileSafely2.wall > 0)
53396 {
53397 num198++;
53398 }
53399 if (tileSafely3.wall > 0)
53400 {
53401 num198++;
53402 }
53403 if (tileSafely4.wall > 0)
53404 {
53405 num198++;
53406 }
53407 if (num198 > 1)
53408 {
53409 position.Y += height;
53410 height = 34;
53411 position.Y -= height;
53412 position.X += width / 2;
53413 width = 34;
53414 position.X -= width / 2;
53415 Vector2 vector14 = new Vector2(position.X + (float)width * 0.5f, position.Y + (float)height * 0.5f);
53416 float num199 = Main.player[owner].Center.X - vector14.X;
53417 float num200 = Main.player[owner].Center.Y - vector14.Y;
53418 float num201 = (float)Math.Sqrt(num199 * num199 + num200 * num200);
53419 float num202 = 4f / num201;
53420 num199 *= num202;
53421 num200 *= num202;
53422 if (num201 < 120f)
53423 {
53424 velocity.X *= 0.9f;
53425 velocity.Y *= 0.9f;
53426 if ((double)(Math.Abs(velocity.X) + Math.Abs(velocity.Y)) < 0.1)
53427 {
53428 velocity *= 0f;
53429 }
53430 }
53431 else
53432 {
53433 velocity.X = (velocity.X * 9f + num199) / 10f;
53434 velocity.Y = (velocity.Y * 9f + num200) / 10f;
53435 }
53436 if (num201 >= 120f)
53437 {
53439 rotation = (float)Math.Atan2(velocity.Y * (float)(-direction), velocity.X * (float)(-direction));
53440 }
53442 if (frameCounter > 6)
53443 {
53444 frame++;
53445 frameCounter = 0;
53446 }
53447 if (frame > 10)
53448 {
53449 frame = 5;
53450 }
53451 if (frame < 5)
53452 {
53453 frame = 10;
53454 }
53455 }
53456 else
53457 {
53458 rotation = 0f;
53459 if (direction == -1)
53460 {
53461 spriteDirection = 1;
53462 }
53463 if (direction == 1)
53464 {
53465 spriteDirection = -1;
53466 }
53467 position.Y += height;
53468 height = 30;
53469 position.Y -= height;
53470 position.X += width / 2;
53471 width = 30;
53472 position.X -= width / 2;
53473 if (velocity.Y >= 0f && (double)velocity.Y <= 0.8)
53474 {
53475 if (flag16)
53476 {
53477 frame = 0;
53478 frameCounter = 0;
53479 }
53480 else if ((double)velocity.X < -0.8 || (double)velocity.X > 0.8)
53481 {
53482 frameCounter += (int)Math.Abs(velocity.X);
53483 frameCounter++;
53484 if (frameCounter > 6)
53485 {
53486 frame++;
53487 frameCounter = 0;
53488 }
53489 if (frame > 3)
53490 {
53491 frame = 0;
53492 }
53493 }
53494 else
53495 {
53496 frame = 0;
53497 frameCounter = 0;
53498 }
53499 }
53500 else
53501 {
53502 frameCounter = 0;
53503 frame = 4;
53504 }
53505 velocity.Y += 0.4f;
53506 if (velocity.Y > 10f)
53507 {
53508 velocity.Y = 10f;
53509 }
53510 }
53511 }
53512 else if (type >= 390 && type <= 392)
53513 {
53514 int i4 = (int)(base.Center.X / 16f);
53515 int num203 = (int)(base.Center.Y / 16f);
53516 int num204 = 0;
53517 Tile tileSafely5 = Framing.GetTileSafely(i4, num203);
53518 Tile tileSafely6 = Framing.GetTileSafely(i4, num203 - 1);
53519 Tile tileSafely7 = Framing.GetTileSafely(i4, num203 + 1);
53520 if (tileSafely5.wall > 0)
53521 {
53522 num204++;
53523 }
53524 if (tileSafely6.wall > 0)
53525 {
53526 num204++;
53527 }
53528 if (tileSafely7.wall > 0)
53529 {
53530 num204++;
53531 }
53532 if (num204 > 1)
53533 {
53534 position.Y += height;
53535 height = 34;
53536 position.Y -= height;
53537 position.X += width / 2;
53538 width = 34;
53539 position.X -= width / 2;
53540 float num205 = 9f;
53541 float num206 = 40 * (minionPos + 1);
53542 Vector2 v11 = Main.player[owner].Center - base.Center;
53543 if (flag13)
53544 {
53545 v11 = vector12;
53546 num206 = 10f;
53547 }
53548 else if (!Collision.CanHitLine(base.Center, 1, 1, Main.player[owner].Center, 1, 1))
53549 {
53550 ai[0] = 1f;
53551 }
53552 if (v11.Length() < num206)
53553 {
53554 velocity *= 0.9f;
53555 if ((double)(Math.Abs(velocity.X) + Math.Abs(velocity.Y)) < 0.1)
53556 {
53557 velocity *= 0f;
53558 }
53559 }
53560 else if (v11.Length() < 800f || !flag13)
53561 {
53562 velocity = (velocity * 9f + v11.SafeNormalize(Vector2.Zero) * num205) / 10f;
53563 }
53564 if (v11.Length() >= num206)
53565 {
53567 rotation = velocity.ToRotation() + (float)Math.PI / 2f;
53568 }
53569 else
53570 {
53571 rotation = v11.ToRotation() + (float)Math.PI / 2f;
53572 }
53574 if (frameCounter > 5)
53575 {
53576 frame++;
53577 frameCounter = 0;
53578 }
53579 if (frame > 7)
53580 {
53581 frame = 4;
53582 }
53583 if (frame < 4)
53584 {
53585 frame = 7;
53586 }
53587 }
53588 else
53589 {
53590 if (!flag14)
53591 {
53592 rotation = 0f;
53593 }
53594 if (direction == -1)
53595 {
53596 spriteDirection = 1;
53597 }
53598 if (direction == 1)
53599 {
53600 spriteDirection = -1;
53601 }
53602 position.Y += height;
53603 height = 30;
53604 position.Y -= height;
53605 position.X += width / 2;
53606 width = 30;
53607 position.X -= width / 2;
53608 if (!flag13 && !Collision.CanHitLine(base.Center, 1, 1, Main.player[owner].Center, 1, 1))
53609 {
53610 ai[0] = 1f;
53611 }
53612 if (!flag14 && frame >= 4 && frame <= 7)
53613 {
53614 Vector2 vector15 = Main.player[owner].Center - base.Center;
53615 if (flag13)
53616 {
53618 }
53619 float num207 = 0f - vector15.Y;
53620 if (!(vector15.Y > 0f))
53621 {
53622 if (num207 < 120f)
53623 {
53624 velocity.Y = -10f;
53625 }
53626 else if (num207 < 210f)
53627 {
53628 velocity.Y = -13f;
53629 }
53630 else if (num207 < 270f)
53631 {
53632 velocity.Y = -15f;
53633 }
53634 else if (num207 < 310f)
53635 {
53636 velocity.Y = -17f;
53637 }
53638 else if (num207 < 380f)
53639 {
53640 velocity.Y = -18f;
53641 }
53642 }
53643 }
53644 if (flag14)
53645 {
53646 frameCounter++;
53647 if (frameCounter > 3)
53648 {
53649 frame++;
53650 frameCounter = 0;
53651 }
53652 if (frame >= 8)
53653 {
53654 frame = 4;
53655 }
53656 if (frame <= 3)
53657 {
53658 frame = 7;
53659 }
53660 }
53661 else if (velocity.Y >= 0f && (double)velocity.Y <= 0.8)
53662 {
53663 if (flag16)
53664 {
53665 frame = 0;
53666 frameCounter = 0;
53667 }
53668 else if ((double)velocity.X < -0.8 || (double)velocity.X > 0.8)
53669 {
53670 frameCounter += (int)Math.Abs(velocity.X);
53671 frameCounter++;
53672 if (frameCounter > 5)
53673 {
53674 frame++;
53675 frameCounter = 0;
53676 }
53677 if (frame > 2)
53678 {
53679 frame = 0;
53680 }
53681 }
53682 else
53683 {
53684 frame = 0;
53685 frameCounter = 0;
53686 }
53687 }
53688 else
53689 {
53690 frameCounter = 0;
53691 frame = 3;
53692 }
53693 velocity.Y += 0.4f;
53694 if (velocity.Y > 10f)
53695 {
53696 velocity.Y = 10f;
53697 }
53698 }
53699 }
53700 else if (type == 314)
53701 {
53702 if (velocity.Y >= 0f && (double)velocity.Y <= 0.8)
53703 {
53704 if (flag16)
53705 {
53706 frame = 0;
53707 frameCounter = 0;
53708 }
53709 else if ((double)velocity.X < -0.8 || (double)velocity.X > 0.8)
53710 {
53711 frameCounter += (int)Math.Abs(velocity.X);
53712 frameCounter++;
53713 if (frameCounter > 6)
53714 {
53715 frame++;
53716 frameCounter = 0;
53717 }
53718 if (frame > 6)
53719 {
53720 frame = 1;
53721 }
53722 }
53723 else
53724 {
53725 frame = 0;
53726 frameCounter = 0;
53727 }
53728 }
53729 else
53730 {
53731 frameCounter = 0;
53732 frame = 7;
53733 }
53734 velocity.Y += 0.4f;
53735 if (velocity.Y > 10f)
53736 {
53737 velocity.Y = 10f;
53738 }
53739 }
53740 else if (type == 319)
53741 {
53742 if (velocity.Y >= 0f && (double)velocity.Y <= 0.8)
53743 {
53744 if (flag16)
53745 {
53746 frame = 0;
53747 frameCounter = 0;
53748 }
53749 else if ((double)velocity.X < -0.8 || (double)velocity.X > 0.8)
53750 {
53751 frameCounter += (int)Math.Abs(velocity.X);
53752 frameCounter++;
53753 if (frameCounter > 8)
53754 {
53755 frame++;
53756 frameCounter = 0;
53757 }
53758 if (frame > 5)
53759 {
53760 frame = 2;
53761 }
53762 }
53763 else
53764 {
53765 frame = 0;
53766 frameCounter = 0;
53767 }
53768 }
53769 else
53770 {
53771 frameCounter = 0;
53772 frame = 1;
53773 }
53774 velocity.Y += 0.4f;
53775 if (velocity.Y > 10f)
53776 {
53777 velocity.Y = 10f;
53778 }
53779 }
53780 else if (type == 236)
53781 {
53782 if (velocity.Y >= 0f && (double)velocity.Y <= 0.8)
53783 {
53784 if (flag16)
53785 {
53786 frame = 0;
53787 frameCounter = 0;
53788 }
53789 else if ((double)velocity.X < -0.8 || (double)velocity.X > 0.8)
53790 {
53791 if (frame < 2)
53792 {
53793 frame = 2;
53794 }
53795 frameCounter += (int)Math.Abs(velocity.X);
53796 frameCounter++;
53797 if (frameCounter > 6)
53798 {
53799 frame++;
53800 frameCounter = 0;
53801 }
53802 if (frame > 8)
53803 {
53804 frame = 2;
53805 }
53806 }
53807 else
53808 {
53809 frame = 0;
53810 frameCounter = 0;
53811 }
53812 }
53813 else
53814 {
53815 frameCounter = 0;
53816 frame = 1;
53817 }
53818 velocity.Y += 0.4f;
53819 if (velocity.Y > 10f)
53820 {
53821 velocity.Y = 10f;
53822 }
53823 }
53824 else if (type == 499)
53825 {
53826 if (velocity.Y >= 0f && (double)velocity.Y <= 0.8)
53827 {
53828 if (flag16)
53829 {
53830 frame = 0;
53831 frameCounter = 0;
53832 }
53833 else if ((double)velocity.X < -0.8 || (double)velocity.X > 0.8)
53834 {
53835 if (frame < 2)
53836 {
53837 frame = 2;
53838 }
53839 frameCounter += (int)Math.Abs(velocity.X);
53840 frameCounter++;
53841 if (frameCounter > 6)
53842 {
53843 frame++;
53844 frameCounter = 0;
53845 }
53846 if (frame >= 8)
53847 {
53848 frame = 2;
53849 }
53850 }
53851 else
53852 {
53853 frame = 0;
53854 frameCounter = 0;
53855 }
53856 }
53857 else
53858 {
53859 frameCounter = 0;
53860 frame = 1;
53861 }
53862 velocity.Y += 0.4f;
53863 if (velocity.Y > 10f)
53864 {
53865 velocity.Y = 10f;
53866 }
53867 }
53868 else if (type == 765)
53869 {
53870 if (velocity.Y >= 0f && (double)velocity.Y <= 0.8)
53871 {
53872 if (flag16)
53873 {
53874 frame = 0;
53875 frameCounter = 0;
53876 }
53877 else if ((double)velocity.X < -0.8 || (double)velocity.X > 0.8)
53878 {
53879 if (frame < 1)
53880 {
53881 frame = 1;
53882 }
53883 frameCounter += (int)Math.Abs(velocity.X);
53884 frameCounter++;
53885 if (frameCounter > 6)
53886 {
53887 frame++;
53888 frameCounter = 0;
53889 }
53890 if (frame >= 6)
53891 {
53892 frame = 1;
53893 }
53894 }
53895 else
53896 {
53897 frame = 0;
53898 frameCounter = 0;
53899 }
53900 }
53901 else
53902 {
53903 frame = 0;
53904 frameCounter = 0;
53905 }
53906 velocity.Y += 0.4f;
53907 if (velocity.Y > 10f)
53908 {
53909 velocity.Y = 10f;
53910 }
53911 }
53912 else if (type == 266)
53913 {
53914 if (velocity.Y >= 0f && (double)velocity.Y <= 0.8)
53915 {
53916 if (flag16)
53917 {
53918 frameCounter++;
53919 }
53920 else
53921 {
53922 frameCounter += 3;
53923 }
53924 }
53925 else
53926 {
53927 frameCounter += 5;
53928 }
53929 if (frameCounter >= 20)
53930 {
53931 frameCounter -= 20;
53932 frame++;
53933 }
53934 if (frame > 1)
53935 {
53936 frame = 0;
53937 }
53938 if (wet && Main.player[owner].position.Y + (float)Main.player[owner].height < position.Y + (float)height && localAI[0] == 0f)
53939 {
53940 if (velocity.Y > -4f)
53941 {
53942 velocity.Y -= 0.2f;
53943 }
53944 if (velocity.Y > 0f)
53945 {
53946 velocity.Y *= 0.95f;
53947 }
53948 }
53949 else
53950 {
53951 velocity.Y += 0.4f;
53952 }
53953 if (velocity.Y > 10f)
53954 {
53955 velocity.Y = 10f;
53956 }
53957 }
53958 else if (type == 334)
53959 {
53960 if (velocity.Y == 0f)
53961 {
53962 if (flag16)
53963 {
53964 if (frame > 0)
53965 {
53966 frameCounter += 2;
53967 if (frameCounter > 6)
53968 {
53969 frame++;
53970 frameCounter = 0;
53971 }
53972 if (frame >= 7)
53973 {
53974 frame = 0;
53975 }
53976 }
53977 else
53978 {
53979 frame = 0;
53980 frameCounter = 0;
53981 }
53982 }
53983 else if ((double)velocity.X < -0.8 || (double)velocity.X > 0.8)
53984 {
53985 frameCounter += (int)Math.Abs((double)velocity.X * 0.75);
53986 frameCounter++;
53987 if (frameCounter > 6)
53988 {
53989 frame++;
53990 frameCounter = 0;
53991 }
53992 if (frame >= 7 || frame < 1)
53993 {
53994 frame = 1;
53995 }
53996 }
53997 else if (frame > 0)
53998 {
53999 frameCounter += 2;
54000 if (frameCounter > 6)
54001 {
54002 frame++;
54003 frameCounter = 0;
54004 }
54005 if (frame >= 7)
54006 {
54007 frame = 0;
54008 }
54009 }
54010 else
54011 {
54012 frame = 0;
54013 frameCounter = 0;
54014 }
54015 }
54016 else if (velocity.Y < 0f)
54017 {
54018 frameCounter = 0;
54019 frame = 2;
54020 }
54021 else if (velocity.Y > 0f)
54022 {
54023 frameCounter = 0;
54024 frame = 4;
54025 }
54026 velocity.Y += 0.4f;
54027 if (velocity.Y > 10f)
54028 {
54029 velocity.Y = 10f;
54030 }
54031 }
54032 else if (type == 353)
54033 {
54034 if (velocity.Y == 0f)
54035 {
54036 if (flag16)
54037 {
54038 frame = 0;
54039 frameCounter = 0;
54040 }
54041 else if ((double)velocity.X < -0.8 || (double)velocity.X > 0.8)
54042 {
54043 frameCounter += (int)Math.Abs(velocity.X);
54044 frameCounter++;
54045 if (frameCounter > 6)
54046 {
54047 frame++;
54048 frameCounter = 0;
54049 }
54050 if (frame > 9)
54051 {
54052 frame = 2;
54053 }
54054 }
54055 else
54056 {
54057 frame = 0;
54058 frameCounter = 0;
54059 }
54060 }
54061 else if (velocity.Y < 0f)
54062 {
54063 frameCounter = 0;
54064 frame = 1;
54065 }
54066 else if (velocity.Y > 0f)
54067 {
54068 frameCounter = 0;
54069 frame = 1;
54070 }
54071 velocity.Y += 0.4f;
54072 if (velocity.Y > 10f)
54073 {
54074 velocity.Y = 10f;
54075 }
54076 }
54077 else if (type == 111)
54078 {
54079 if (velocity.Y == 0f)
54080 {
54081 if (flag16)
54082 {
54083 frame = 0;
54084 frameCounter = 0;
54085 }
54086 else if ((double)velocity.X < -0.8 || (double)velocity.X > 0.8)
54087 {
54088 frameCounter += (int)Math.Abs(velocity.X);
54089 frameCounter++;
54090 if (frameCounter > 6)
54091 {
54092 frame++;
54093 frameCounter = 0;
54094 }
54095 if (frame >= 7)
54096 {
54097 frame = 0;
54098 }
54099 }
54100 else
54101 {
54102 frame = 0;
54103 frameCounter = 0;
54104 }
54105 }
54106 else if (velocity.Y < 0f)
54107 {
54108 frameCounter = 0;
54109 frame = 4;
54110 }
54111 else if (velocity.Y > 0f)
54112 {
54113 frameCounter = 0;
54114 frame = 6;
54115 }
54116 velocity.Y += 0.4f;
54117 if (velocity.Y > 10f)
54118 {
54119 velocity.Y = 10f;
54120 }
54121 }
54122 else if (type == 112)
54123 {
54124 if (velocity.Y == 0f)
54125 {
54126 if (flag16)
54127 {
54128 frame = 0;
54129 frameCounter = 0;
54130 }
54131 else if ((double)velocity.X < -0.8 || (double)velocity.X > 0.8)
54132 {
54133 frameCounter += (int)Math.Abs(velocity.X);
54134 frameCounter++;
54135 if (frameCounter > 6)
54136 {
54137 frame++;
54138 frameCounter = 0;
54139 }
54140 if (frame >= 3)
54141 {
54142 frame = 0;
54143 }
54144 }
54145 else
54146 {
54147 frame = 0;
54148 frameCounter = 0;
54149 }
54150 }
54151 else if (velocity.Y != 0f)
54152 {
54153 frameCounter = 0;
54154 frame = 1;
54155 }
54156 velocity.Y += 0.4f;
54157 if (velocity.Y > 10f)
54158 {
54159 velocity.Y = 10f;
54160 }
54161 }
54162 else if (type == 127)
54163 {
54164 if (velocity.Y == 0f)
54165 {
54166 if (flag16)
54167 {
54168 frame = 0;
54169 frameCounter = 0;
54170 }
54171 else if ((double)velocity.X < -0.1 || (double)velocity.X > 0.1)
54172 {
54173 frameCounter += (int)Math.Abs(velocity.X);
54174 frameCounter++;
54175 if (frameCounter > 6)
54176 {
54177 frame++;
54178 frameCounter = 0;
54179 }
54180 if (frame > 5)
54181 {
54182 frame = 0;
54183 }
54184 }
54185 else
54186 {
54187 frame = 0;
54188 frameCounter = 0;
54189 }
54190 }
54191 else
54192 {
54193 frame = 0;
54194 frameCounter = 0;
54195 }
54196 velocity.Y += 0.4f;
54197 if (velocity.Y > 10f)
54198 {
54199 velocity.Y = 10f;
54200 }
54201 }
54202 else if (type == 200)
54203 {
54204 if (velocity.Y == 0f)
54205 {
54206 if (flag16)
54207 {
54208 frame = 0;
54209 frameCounter = 0;
54210 }
54211 else if ((double)velocity.X < -0.1 || (double)velocity.X > 0.1)
54212 {
54213 frameCounter += (int)Math.Abs(velocity.X);
54214 frameCounter++;
54215 if (frameCounter > 6)
54216 {
54217 frame++;
54218 frameCounter = 0;
54219 }
54220 if (frame > 5)
54221 {
54222 frame = 0;
54223 }
54224 }
54225 else
54226 {
54227 frame = 0;
54228 frameCounter = 0;
54229 }
54230 }
54231 else
54232 {
54233 rotation = velocity.X * 0.1f;
54234 frameCounter++;
54235 if (velocity.Y < 0f)
54236 {
54237 frameCounter += 2;
54238 }
54239 if (frameCounter > 6)
54240 {
54241 frame++;
54242 frameCounter = 0;
54243 }
54244 if (frame > 9)
54245 {
54246 frame = 6;
54247 }
54248 if (frame < 6)
54249 {
54250 frame = 6;
54251 }
54252 }
54253 velocity.Y += 0.1f;
54254 if (velocity.Y > 4f)
54255 {
54256 velocity.Y = 4f;
54257 }
54258 }
54259 else if (type == 208)
54260 {
54261 if (velocity.Y == 0f && flag16)
54262 {
54263 if (Main.player[owner].position.X + (float)(Main.player[owner].width / 2) < position.X + (float)(width / 2))
54264 {
54265 direction = -1;
54266 }
54267 else if (Main.player[owner].position.X + (float)(Main.player[owner].width / 2) > position.X + (float)(width / 2))
54268 {
54269 direction = 1;
54270 }
54271 rotation = 0f;
54272 frame = 0;
54273 }
54274 else
54275 {
54276 rotation = velocity.X * 0.075f;
54277 frameCounter++;
54278 if (frameCounter > 6)
54279 {
54280 frame++;
54281 frameCounter = 0;
54282 }
54283 if (frame > 4)
54284 {
54285 frame = 1;
54286 }
54287 if (frame < 1)
54288 {
54289 frame = 1;
54290 }
54291 }
54292 velocity.Y += 0.1f;
54293 if (velocity.Y > 4f)
54294 {
54295 velocity.Y = 4f;
54296 }
54297 }
54298 else if (type == 209)
54299 {
54300 if (alpha > 0)
54301 {
54302 alpha -= 5;
54303 if (alpha < 0)
54304 {
54305 alpha = 0;
54306 }
54307 }
54308 if (velocity.Y == 0f)
54309 {
54310 if (flag16)
54311 {
54312 frame = 0;
54313 frameCounter = 0;
54314 }
54315 else if ((double)velocity.X < -0.1 || (double)velocity.X > 0.1)
54316 {
54317 frameCounter += (int)Math.Abs(velocity.X);
54318 frameCounter++;
54319 if (frameCounter > 6)
54320 {
54321 frame++;
54322 frameCounter = 0;
54323 }
54324 if (frame > 11)
54325 {
54326 frame = 2;
54327 }
54328 if (frame < 2)
54329 {
54330 frame = 2;
54331 }
54332 }
54333 else
54334 {
54335 frame = 0;
54336 frameCounter = 0;
54337 }
54338 }
54339 else
54340 {
54341 frame = 1;
54342 frameCounter = 0;
54343 rotation = 0f;
54344 }
54345 velocity.Y += 0.4f;
54346 if (velocity.Y > 10f)
54347 {
54348 velocity.Y = 10f;
54349 }
54350 }
54351 else if (type == 324)
54352 {
54353 if (velocity.Y == 0f)
54354 {
54355 if ((double)velocity.X < -0.1 || (double)velocity.X > 0.1)
54356 {
54357 frameCounter += (int)Math.Abs(velocity.X);
54358 frameCounter++;
54359 if (frameCounter > 6)
54360 {
54361 frame++;
54362 frameCounter = 0;
54363 }
54364 if (frame > 5)
54365 {
54366 frame = 2;
54367 }
54368 if (frame < 2)
54369 {
54370 frame = 2;
54371 }
54372 }
54373 else
54374 {
54375 frame = 0;
54376 frameCounter = 0;
54377 }
54378 }
54379 else
54380 {
54381 frameCounter = 0;
54382 frame = 1;
54383 }
54384 velocity.Y += 0.4f;
54385 if (velocity.Y > 14f)
54386 {
54387 velocity.Y = 14f;
54388 }
54389 }
54390 else if (type == 210)
54391 {
54392 if (velocity.Y == 0f)
54393 {
54394 if ((double)velocity.X < -0.1 || (double)velocity.X > 0.1)
54395 {
54396 frameCounter += (int)Math.Abs(velocity.X);
54397 frameCounter++;
54398 if (frameCounter > 6)
54399 {
54400 frame++;
54401 frameCounter = 0;
54402 }
54403 if (frame > 6)
54404 {
54405 frame = 0;
54406 }
54407 }
54408 else
54409 {
54410 frame = 0;
54411 frameCounter = 0;
54412 }
54413 }
54414 else
54415 {
54416 rotation = velocity.X * 0.05f;
54417 frameCounter++;
54418 if (frameCounter > 6)
54419 {
54420 frame++;
54421 frameCounter = 0;
54422 }
54423 if (frame > 11)
54424 {
54425 frame = 7;
54426 }
54427 if (frame < 7)
54428 {
54429 frame = 7;
54430 }
54431 }
54432 velocity.Y += 0.4f;
54433 if (velocity.Y > 10f)
54434 {
54435 velocity.Y = 10f;
54436 }
54437 }
54438 else if (type == 398)
54439 {
54440 if (velocity.Y == 0f)
54441 {
54442 if (flag16)
54443 {
54444 frame = 0;
54445 frameCounter = 0;
54446 }
54447 else if ((double)velocity.X < -0.8 || (double)velocity.X > 0.8)
54448 {
54449 frameCounter += (int)Math.Abs(velocity.X);
54450 frameCounter++;
54451 if (frameCounter > 6)
54452 {
54453 frame++;
54454 frameCounter = 0;
54455 }
54456 if (frame >= 5)
54457 {
54458 frame = 0;
54459 }
54460 }
54461 else
54462 {
54463 frame = 0;
54464 frameCounter = 0;
54465 }
54466 }
54467 else if (velocity.Y != 0f)
54468 {
54469 frameCounter = 0;
54470 frame = 5;
54471 }
54472 velocity.Y += 0.4f;
54473 if (velocity.Y > 10f)
54474 {
54475 velocity.Y = 10f;
54476 }
54477 }
54478 }
54479 if (type == 891)
54480 {
54481 _ = Main.player[owner];
54482 DelegateMethods.v3_1 = new Vector3(1f, 0.61f, 0.16f) * 1.5f;
54483 Utils.PlotTileLine(base.Center, base.Center + velocity * 6f, 20f, DelegateMethods.CastLightOpen);
54484 Utils.PlotTileLine(base.Left, base.Right, 20f, DelegateMethods.CastLightOpen);
54485 }
54486 }
static float Clamp(float value, float min, float max)
Definition MathHelper.cs:46
static double Atan2(double y, double x)
static double Sqrt(double d)
static double Abs(double value)
static double Sin(double a)
const double PI
Definition Math.cs:16
static byte Max(byte val1, byte val2)
Definition Math.cs:738
Vector2 velocity
Definition Entity.cs:16
Vector2 position
Definition Entity.cs:14
static ArmorShaderDataSet Armor
Definition GameShaders.cs:7
static bool[] Platforms
Definition TileID.cs:163
IEntitySource GetProjectileSource_FromThis()
bool Chester_IsAnyPlayerTrackingThisProjectile()
static int NewProjectile(IEntitySource spawnSource, Vector2 position, Vector2 velocity, int Type, int Damage, float KnockBack, int Owner=-1, float ai0=0f, float ai1=0f, float ai2=0f)
static float Dot(Vector2 value1, Vector2 value2)
Definition Vector2.cs:121
static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)
Definition Vector2.cs:227

References System.Math.Abs(), Terraria.Lighting.AddLight(), Terraria.Graphics.Shaders.GameShaders.Armor, System.Math.Atan2(), Terraria.Collision.CanHit(), Terraria.Collision.CanHitLine(), Terraria.DelegateMethods.CastLightOpen(), Microsoft.Xna.Framework.MathHelper.Clamp(), Terraria.Entity.direction, Microsoft.Xna.Framework.Vector2.Dot(), Terraria.Main.dust, Terraria.Utils.GetLerpValue(), Terraria.Framing.GetTileSafely(), Terraria.Main.gore, Microsoft.Xna.Framework.Vector2.Length(), Microsoft.Xna.Framework.Vector2.Lerp(), System.Math.Max(), Terraria.Main.myPlayer, Terraria.Dust.NewDust(), Terraria.Dust.NewDustDirect(), Terraria.Gore.NewGore(), Terraria.Gore.NewGorePerfect(), Microsoft.Xna.Framework.Vector2.Normalize(), Terraria.Main.npc, System.Math.PI, Terraria.ID.TileID.Sets.Platforms, Terraria.Main.player, Terraria.Utils.PlotTileLine(), Terraria.Main.projectile, Terraria.Main.projFrames, Terraria.Main.rand, System.Math.Sin(), Terraria.Collision.SolidCollision(), Terraria.WorldGen.SolidTile(), Terraria.WorldGen.SolidTileAllowBottomSlope(), System.Math.Sqrt(), Terraria.Collision.StepUp(), Terraria.Main.tile, System.type, Microsoft.Xna.Framework.Vector2.UnitX, System.value, Terraria.Entity.velocity, Microsoft.Xna.Framework.Vector2.X, Microsoft.Xna.Framework.Vector2.Y, and Microsoft.Xna.Framework.Vector2.Zero.