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

◆ AI_067_FreakingPirates()

void Terraria.Projectile.AI_067_FreakingPirates ( )
inlineprivate

Definition at line 52293 of file Projectile.cs.

52294 {
52295 //IL_222d: Unknown result type (might be due to invalid IL or missing references)
52296 //IL_2235: Unknown result type (might be due to invalid IL or missing references)
52297 //IL_224a: Unknown result type (might be due to invalid IL or missing references)
52298 //IL_2252: Unknown result type (might be due to invalid IL or missing references)
52299 //IL_23f8: Unknown result type (might be due to invalid IL or missing references)
52300 //IL_23fe: Unknown result type (might be due to invalid IL or missing references)
52301 //IL_2403: Unknown result type (might be due to invalid IL or missing references)
52302 //IL_241a: Unknown result type (might be due to invalid IL or missing references)
52303 //IL_2420: Unknown result type (might be due to invalid IL or missing references)
52304 //IL_2471: Unknown result type (might be due to invalid IL or missing references)
52305 //IL_247f: Unknown result type (might be due to invalid IL or missing references)
52306 //IL_2484: Unknown result type (might be due to invalid IL or missing references)
52307 //IL_253d: Unknown result type (might be due to invalid IL or missing references)
52308 //IL_2548: Unknown result type (might be due to invalid IL or missing references)
52309 //IL_0157: Unknown result type (might be due to invalid IL or missing references)
52310 //IL_015c: Unknown result type (might be due to invalid IL or missing references)
52311 //IL_043e: Unknown result type (might be due to invalid IL or missing references)
52312 //IL_0443: Unknown result type (might be due to invalid IL or missing references)
52313 //IL_0200: Unknown result type (might be due to invalid IL or missing references)
52314 //IL_0205: Unknown result type (might be due to invalid IL or missing references)
52315 //IL_020f: Unknown result type (might be due to invalid IL or missing references)
52316 //IL_017f: Unknown result type (might be due to invalid IL or missing references)
52317 //IL_01a2: Unknown result type (might be due to invalid IL or missing references)
52318 //IL_01a8: Unknown result type (might be due to invalid IL or missing references)
52319 //IL_01d3: Unknown result type (might be due to invalid IL or missing references)
52320 //IL_01d9: Unknown result type (might be due to invalid IL or missing references)
52321 //IL_01e3: Unknown result type (might be due to invalid IL or missing references)
52322 //IL_01e8: Unknown result type (might be due to invalid IL or missing references)
52323 //IL_01ed: Unknown result type (might be due to invalid IL or missing references)
52324 //IL_03d9: Unknown result type (might be due to invalid IL or missing references)
52325 //IL_03de: Unknown result type (might be due to invalid IL or missing references)
52326 //IL_0227: Unknown result type (might be due to invalid IL or missing references)
52327 //IL_022c: Unknown result type (might be due to invalid IL or missing references)
52328 //IL_0236: Unknown result type (might be due to invalid IL or missing references)
52329 //IL_024e: Unknown result type (might be due to invalid IL or missing references)
52330 //IL_0253: Unknown result type (might be due to invalid IL or missing references)
52331 //IL_0258: Unknown result type (might be due to invalid IL or missing references)
52332 //IL_0262: Unknown result type (might be due to invalid IL or missing references)
52333 //IL_0267: Unknown result type (might be due to invalid IL or missing references)
52334 //IL_026b: Unknown result type (might be due to invalid IL or missing references)
52335 //IL_0275: Unknown result type (might be due to invalid IL or missing references)
52336 //IL_05e1: Unknown result type (might be due to invalid IL or missing references)
52337 //IL_05a0: Unknown result type (might be due to invalid IL or missing references)
52338 //IL_0678: Unknown result type (might be due to invalid IL or missing references)
52339 //IL_067d: Unknown result type (might be due to invalid IL or missing references)
52340 //IL_068b: Unknown result type (might be due to invalid IL or missing references)
52341 //IL_0691: Unknown result type (might be due to invalid IL or missing references)
52342 //IL_0693: Unknown result type (might be due to invalid IL or missing references)
52343 //IL_06a8: Unknown result type (might be due to invalid IL or missing references)
52344 //IL_06ae: Unknown result type (might be due to invalid IL or missing references)
52345 //IL_06b0: Unknown result type (might be due to invalid IL or missing references)
52346 //IL_06b5: Unknown result type (might be due to invalid IL or missing references)
52347 //IL_06b8: Unknown result type (might be due to invalid IL or missing references)
52348 //IL_06bd: Unknown result type (might be due to invalid IL or missing references)
52349 //IL_06c4: Unknown result type (might be due to invalid IL or missing references)
52350 //IL_06c9: Unknown result type (might be due to invalid IL or missing references)
52351 //IL_06d3: Unknown result type (might be due to invalid IL or missing references)
52352 //IL_06d8: Unknown result type (might be due to invalid IL or missing references)
52353 //IL_06e0: Unknown result type (might be due to invalid IL or missing references)
52354 //IL_06e7: Unknown result type (might be due to invalid IL or missing references)
52355 //IL_06ef: Unknown result type (might be due to invalid IL or missing references)
52356 //IL_071a: Unknown result type (might be due to invalid IL or missing references)
52357 //IL_0725: Unknown result type (might be due to invalid IL or missing references)
52358 //IL_072f: Unknown result type (might be due to invalid IL or missing references)
52359 //IL_0734: Unknown result type (might be due to invalid IL or missing references)
52360 //IL_05c1: Unknown result type (might be due to invalid IL or missing references)
52361 //IL_0831: Unknown result type (might be due to invalid IL or missing references)
52362 //IL_2ba7: Unknown result type (might be due to invalid IL or missing references)
52363 //IL_2bac: Unknown result type (might be due to invalid IL or missing references)
52364 //IL_2bb9: Unknown result type (might be due to invalid IL or missing references)
52365 //IL_2bc3: Unknown result type (might be due to invalid IL or missing references)
52366 //IL_2bc8: Unknown result type (might be due to invalid IL or missing references)
52367 //IL_2bcd: Unknown result type (might be due to invalid IL or missing references)
52368 //IL_2bd7: Unknown result type (might be due to invalid IL or missing references)
52369 //IL_2bdc: Unknown result type (might be due to invalid IL or missing references)
52370 //IL_2be1: Unknown result type (might be due to invalid IL or missing references)
52371 //IL_2beb: Unknown result type (might be due to invalid IL or missing references)
52372 //IL_2bf0: Unknown result type (might be due to invalid IL or missing references)
52373 //IL_2c0c: Unknown result type (might be due to invalid IL or missing references)
52374 //IL_2c12: Unknown result type (might be due to invalid IL or missing references)
52375 //IL_2c29: Unknown result type (might be due to invalid IL or missing references)
52376 //IL_2c33: Unknown result type (might be due to invalid IL or missing references)
52377 //IL_2c38: Unknown result type (might be due to invalid IL or missing references)
52378 //IL_2c5e: Unknown result type (might be due to invalid IL or missing references)
52379 //IL_2c63: Unknown result type (might be due to invalid IL or missing references)
52380 //IL_2c70: Unknown result type (might be due to invalid IL or missing references)
52381 //IL_2c7a: Unknown result type (might be due to invalid IL or missing references)
52382 //IL_2c7f: Unknown result type (might be due to invalid IL or missing references)
52383 //IL_2c84: Unknown result type (might be due to invalid IL or missing references)
52384 //IL_2cb2: Unknown result type (might be due to invalid IL or missing references)
52385 //IL_2cbc: Unknown result type (might be due to invalid IL or missing references)
52386 //IL_2cc1: Unknown result type (might be due to invalid IL or missing references)
52387 //IL_0beb: Unknown result type (might be due to invalid IL or missing references)
52388 //IL_0bf0: Unknown result type (might be due to invalid IL or missing references)
52389 //IL_092c: Unknown result type (might be due to invalid IL or missing references)
52390 //IL_093b: Unknown result type (might be due to invalid IL or missing references)
52391 //IL_0949: Unknown result type (might be due to invalid IL or missing references)
52392 //IL_094e: Unknown result type (might be due to invalid IL or missing references)
52393 //IL_0952: Unknown result type (might be due to invalid IL or missing references)
52394 //IL_0957: Unknown result type (might be due to invalid IL or missing references)
52395 //IL_095a: Unknown result type (might be due to invalid IL or missing references)
52396 //IL_0969: Unknown result type (might be due to invalid IL or missing references)
52397 //IL_0977: Unknown result type (might be due to invalid IL or missing references)
52398 //IL_097c: Unknown result type (might be due to invalid IL or missing references)
52399 //IL_0980: Unknown result type (might be due to invalid IL or missing references)
52400 //IL_0985: Unknown result type (might be due to invalid IL or missing references)
52401 //IL_0e56: Unknown result type (might be due to invalid IL or missing references)
52402 //IL_0e5c: Unknown result type (might be due to invalid IL or missing references)
52403 //IL_0e61: Unknown result type (might be due to invalid IL or missing references)
52404 //IL_0e66: Unknown result type (might be due to invalid IL or missing references)
52405 //IL_0c21: Unknown result type (might be due to invalid IL or missing references)
52406 //IL_0c26: Unknown result type (might be due to invalid IL or missing references)
52407 //IL_0c2b: Unknown result type (might be due to invalid IL or missing references)
52408 //IL_0c30: Unknown result type (might be due to invalid IL or missing references)
52409 //IL_08f2: Unknown result type (might be due to invalid IL or missing references)
52410 //IL_0e79: Unknown result type (might be due to invalid IL or missing references)
52411 //IL_0e8c: Unknown result type (might be due to invalid IL or missing references)
52412 //IL_0e96: Unknown result type (might be due to invalid IL or missing references)
52413 //IL_0e9b: Unknown result type (might be due to invalid IL or missing references)
52414 //IL_0ea0: Unknown result type (might be due to invalid IL or missing references)
52415 //IL_0c40: Unknown result type (might be due to invalid IL or missing references)
52416 //IL_14e3: Unknown result type (might be due to invalid IL or missing references)
52417 //IL_14e8: Unknown result type (might be due to invalid IL or missing references)
52418 //IL_14ea: Unknown result type (might be due to invalid IL or missing references)
52419 //IL_14ec: Unknown result type (might be due to invalid IL or missing references)
52420 //IL_0f48: Unknown result type (might be due to invalid IL or missing references)
52421 //IL_0f4c: Unknown result type (might be due to invalid IL or missing references)
52422 //IL_0f51: Unknown result type (might be due to invalid IL or missing references)
52423 //IL_0f5e: Unknown result type (might be due to invalid IL or missing references)
52424 //IL_0c9d: Unknown result type (might be due to invalid IL or missing references)
52425 //IL_0ca2: Unknown result type (might be due to invalid IL or missing references)
52426 //IL_0ca8: Unknown result type (might be due to invalid IL or missing references)
52427 //IL_0a25: Unknown result type (might be due to invalid IL or missing references)
52428 //IL_0a2a: Unknown result type (might be due to invalid IL or missing references)
52429 //IL_1506: Unknown result type (might be due to invalid IL or missing references)
52430 //IL_1511: Unknown result type (might be due to invalid IL or missing references)
52431 //IL_0fac: Unknown result type (might be due to invalid IL or missing references)
52432 //IL_0ee9: Unknown result type (might be due to invalid IL or missing references)
52433 //IL_0d09: Unknown result type (might be due to invalid IL or missing references)
52434 //IL_0d0e: Unknown result type (might be due to invalid IL or missing references)
52435 //IL_18a7: Unknown result type (might be due to invalid IL or missing references)
52436 //IL_17a9: Unknown result type (might be due to invalid IL or missing references)
52437 //IL_17af: Unknown result type (might be due to invalid IL or missing references)
52438 //IL_17b4: Unknown result type (might be due to invalid IL or missing references)
52439 //IL_17b9: Unknown result type (might be due to invalid IL or missing references)
52440 //IL_1737: Unknown result type (might be due to invalid IL or missing references)
52441 //IL_173f: Unknown result type (might be due to invalid IL or missing references)
52442 //IL_155b: Unknown result type (might be due to invalid IL or missing references)
52443 //IL_1563: Unknown result type (might be due to invalid IL or missing references)
52444 //IL_0ffa: Unknown result type (might be due to invalid IL or missing references)
52445 //IL_0d52: Unknown result type (might be due to invalid IL or missing references)
52446 //IL_0d55: Unknown result type (might be due to invalid IL or missing references)
52447 //IL_0d5a: Unknown result type (might be due to invalid IL or missing references)
52448 //IL_0d5f: Unknown result type (might be due to invalid IL or missing references)
52449 //IL_0a72: Unknown result type (might be due to invalid IL or missing references)
52450 //IL_0a4c: Unknown result type (might be due to invalid IL or missing references)
52451 //IL_1905: Unknown result type (might be due to invalid IL or missing references)
52452 //IL_1908: Unknown result type (might be due to invalid IL or missing references)
52453 //IL_190d: Unknown result type (might be due to invalid IL or missing references)
52454 //IL_1912: Unknown result type (might be due to invalid IL or missing references)
52455 //IL_18b9: Unknown result type (might be due to invalid IL or missing references)
52456 //IL_17cb: Unknown result type (might be due to invalid IL or missing references)
52457 //IL_17de: Unknown result type (might be due to invalid IL or missing references)
52458 //IL_17e8: Unknown result type (might be due to invalid IL or missing references)
52459 //IL_17ed: Unknown result type (might be due to invalid IL or missing references)
52460 //IL_17f2: Unknown result type (might be due to invalid IL or missing references)
52461 //IL_157a: Unknown result type (might be due to invalid IL or missing references)
52462 //IL_1582: Unknown result type (might be due to invalid IL or missing references)
52463 //IL_1048: Unknown result type (might be due to invalid IL or missing references)
52464 //IL_0d83: Unknown result type (might be due to invalid IL or missing references)
52465 //IL_0d88: Unknown result type (might be due to invalid IL or missing references)
52466 //IL_0d8c: Unknown result type (might be due to invalid IL or missing references)
52467 //IL_0d91: Unknown result type (might be due to invalid IL or missing references)
52468 //IL_0d6c: Unknown result type (might be due to invalid IL or missing references)
52469 //IL_0d6e: Unknown result type (might be due to invalid IL or missing references)
52470 //IL_0d73: Unknown result type (might be due to invalid IL or missing references)
52471 //IL_0d7a: Unknown result type (might be due to invalid IL or missing references)
52472 //IL_0d7f: Unknown result type (might be due to invalid IL or missing references)
52473 //IL_18c7: Unknown result type (might be due to invalid IL or missing references)
52474 //IL_18cf: Unknown result type (might be due to invalid IL or missing references)
52475 //IL_18e0: Unknown result type (might be due to invalid IL or missing references)
52476 //IL_18eb: Unknown result type (might be due to invalid IL or missing references)
52477 //IL_1807: Unknown result type (might be due to invalid IL or missing references)
52478 //IL_15d7: Unknown result type (might be due to invalid IL or missing references)
52479 //IL_15dc: Unknown result type (might be due to invalid IL or missing references)
52480 //IL_1919: Unknown result type (might be due to invalid IL or missing references)
52481 //IL_191b: Unknown result type (might be due to invalid IL or missing references)
52482 //IL_1920: Unknown result type (might be due to invalid IL or missing references)
52483 //IL_1927: Unknown result type (might be due to invalid IL or missing references)
52484 //IL_195f: Unknown result type (might be due to invalid IL or missing references)
52485 //IL_1965: Unknown result type (might be due to invalid IL or missing references)
52486 //IL_196f: Unknown result type (might be due to invalid IL or missing references)
52487 //IL_1974: Unknown result type (might be due to invalid IL or missing references)
52488 //IL_1979: Unknown result type (might be due to invalid IL or missing references)
52489 //IL_197c: Unknown result type (might be due to invalid IL or missing references)
52490 //IL_1981: Unknown result type (might be due to invalid IL or missing references)
52491 //IL_1995: Unknown result type (might be due to invalid IL or missing references)
52492 //IL_199a: Unknown result type (might be due to invalid IL or missing references)
52493 //IL_199d: Unknown result type (might be due to invalid IL or missing references)
52494 //IL_19a3: Unknown result type (might be due to invalid IL or missing references)
52495 //IL_19ad: Unknown result type (might be due to invalid IL or missing references)
52496 //IL_19b2: Unknown result type (might be due to invalid IL or missing references)
52497 //IL_19b7: Unknown result type (might be due to invalid IL or missing references)
52498 //IL_19b9: Unknown result type (might be due to invalid IL or missing references)
52499 //IL_19be: Unknown result type (might be due to invalid IL or missing references)
52500 //IL_19c1: Unknown result type (might be due to invalid IL or missing references)
52501 //IL_18fe: Unknown result type (might be due to invalid IL or missing references)
52502 //IL_1903: Unknown result type (might be due to invalid IL or missing references)
52503 //IL_183d: Unknown result type (might be due to invalid IL or missing references)
52504 //IL_1666: Unknown result type (might be due to invalid IL or missing references)
52505 //IL_166b: Unknown result type (might be due to invalid IL or missing references)
52506 //IL_1670: Unknown result type (might be due to invalid IL or missing references)
52507 //IL_1675: Unknown result type (might be due to invalid IL or missing references)
52508 //IL_19fc: Unknown result type (might be due to invalid IL or missing references)
52509 //IL_1a01: Unknown result type (might be due to invalid IL or missing references)
52510 //IL_1a03: Unknown result type (might be due to invalid IL or missing references)
52511 //IL_1a08: Unknown result type (might be due to invalid IL or missing references)
52512 //IL_19d0: Unknown result type (might be due to invalid IL or missing references)
52513 //IL_19d5: Unknown result type (might be due to invalid IL or missing references)
52514 //IL_19df: Unknown result type (might be due to invalid IL or missing references)
52515 //IL_19e5: Unknown result type (might be due to invalid IL or missing references)
52516 //IL_186d: Unknown result type (might be due to invalid IL or missing references)
52517 //IL_163b: Unknown result type (might be due to invalid IL or missing references)
52518 //IL_1643: Unknown result type (might be due to invalid IL or missing references)
52519 //IL_15fb: Unknown result type (might be due to invalid IL or missing references)
52520 //IL_1611: Unknown result type (might be due to invalid IL or missing references)
52521 //IL_1616: Unknown result type (might be due to invalid IL or missing references)
52522 //IL_1a29: Unknown result type (might be due to invalid IL or missing references)
52523 //IL_1a2f: Unknown result type (might be due to invalid IL or missing references)
52524 //IL_1a34: Unknown result type (might be due to invalid IL or missing references)
52525 //IL_1a39: Unknown result type (might be due to invalid IL or missing references)
52526 //IL_1a3b: Unknown result type (might be due to invalid IL or missing references)
52527 //IL_1a3e: Unknown result type (might be due to invalid IL or missing references)
52528 //IL_1a43: Unknown result type (might be due to invalid IL or missing references)
52529 //IL_1a48: Unknown result type (might be due to invalid IL or missing references)
52530 //IL_1a4a: Unknown result type (might be due to invalid IL or missing references)
52531 //IL_1a4c: Unknown result type (might be due to invalid IL or missing references)
52532 //IL_1a51: Unknown result type (might be due to invalid IL or missing references)
52533 //IL_1a15: Unknown result type (might be due to invalid IL or missing references)
52534 //IL_19f4: Unknown result type (might be due to invalid IL or missing references)
52535 //IL_19f9: Unknown result type (might be due to invalid IL or missing references)
52536 //IL_1685: Unknown result type (might be due to invalid IL or missing references)
52537 //IL_1240: Unknown result type (might be due to invalid IL or missing references)
52538 //IL_124d: Unknown result type (might be due to invalid IL or missing references)
52539 //IL_1252: Unknown result type (might be due to invalid IL or missing references)
52540 //IL_1273: Unknown result type (might be due to invalid IL or missing references)
52541 //IL_1279: Unknown result type (might be due to invalid IL or missing references)
52542 //IL_1288: Unknown result type (might be due to invalid IL or missing references)
52543 //IL_128d: Unknown result type (might be due to invalid IL or missing references)
52544 //IL_1297: Unknown result type (might be due to invalid IL or missing references)
52545 //IL_129c: Unknown result type (might be due to invalid IL or missing references)
52546 //IL_12a2: Unknown result type (might be due to invalid IL or missing references)
52547 //IL_12b0: Unknown result type (might be due to invalid IL or missing references)
52548 //IL_12b5: Unknown result type (might be due to invalid IL or missing references)
52549 //IL_16e3: Unknown result type (might be due to invalid IL or missing references)
52550 //IL_16e8: Unknown result type (might be due to invalid IL or missing references)
52551 //IL_16ee: Unknown result type (might be due to invalid IL or missing references)
52552 //IL_1c04: Unknown result type (might be due to invalid IL or missing references)
52553 //IL_1c0c: Unknown result type (might be due to invalid IL or missing references)
52554 //IL_1c19: Unknown result type (might be due to invalid IL or missing references)
52555 //IL_1c1c: Unknown result type (might be due to invalid IL or missing references)
52556 //IL_1c21: Unknown result type (might be due to invalid IL or missing references)
52557 //IL_1c26: Unknown result type (might be due to invalid IL or missing references)
52558 //IL_1a5c: Unknown result type (might be due to invalid IL or missing references)
52559 //IL_1a5e: Unknown result type (might be due to invalid IL or missing references)
52560 //IL_1a63: Unknown result type (might be due to invalid IL or missing references)
52561 //IL_1a67: Unknown result type (might be due to invalid IL or missing references)
52562 //IL_1a6c: Unknown result type (might be due to invalid IL or missing references)
52563 //IL_1a71: Unknown result type (might be due to invalid IL or missing references)
52564 //IL_1a73: Unknown result type (might be due to invalid IL or missing references)
52565 //IL_1a75: Unknown result type (might be due to invalid IL or missing references)
52566 //IL_1a7a: Unknown result type (might be due to invalid IL or missing references)
52567 //IL_1a7e: Unknown result type (might be due to invalid IL or missing references)
52568 //IL_1a83: Unknown result type (might be due to invalid IL or missing references)
52569 //IL_1a88: Unknown result type (might be due to invalid IL or missing references)
52570 //IL_1a8f: Unknown result type (might be due to invalid IL or missing references)
52571 //IL_1ab4: Unknown result type (might be due to invalid IL or missing references)
52572 //IL_1ab7: Unknown result type (might be due to invalid IL or missing references)
52573 //IL_1ac1: Unknown result type (might be due to invalid IL or missing references)
52574 //IL_1ac6: Unknown result type (might be due to invalid IL or missing references)
52575 //IL_1acb: Unknown result type (might be due to invalid IL or missing references)
52576 //IL_1a9d: Unknown result type (might be due to invalid IL or missing references)
52577 //IL_1a9f: Unknown result type (might be due to invalid IL or missing references)
52578 //IL_1e6a: Unknown result type (might be due to invalid IL or missing references)
52579 //IL_1e7d: Unknown result type (might be due to invalid IL or missing references)
52580 //IL_1e8b: Unknown result type (might be due to invalid IL or missing references)
52581 //IL_1fca: Unknown result type (might be due to invalid IL or missing references)
52582 //IL_1de9: Unknown result type (might be due to invalid IL or missing references)
52583 //IL_1e0a: Unknown result type (might be due to invalid IL or missing references)
52584 //IL_1e0f: Unknown result type (might be due to invalid IL or missing references)
52585 //IL_1e14: Unknown result type (might be due to invalid IL or missing references)
52586 Player player = Main.player[owner];
52587 if (!player.active)
52588 {
52589 active = false;
52590 return;
52591 }
52592 bool flag = type == 393 || type == 394 || type == 395;
52593 bool flag8 = type == 758;
52594 bool flag9 = type == 833 || type == 834 || type == 835;
52595 bool flag10 = type == 834 || type == 835;
52596 bool flag11 = type == 951;
52597 int num = 450;
52598 float num12 = 500f;
52599 float num21 = 300f;
52600 int num32 = 15;
52601 if (flag11)
52602 {
52603 if (player.dead)
52604 {
52605 player.flinxMinion = false;
52606 }
52607 if (player.flinxMinion)
52608 {
52609 timeLeft = 2;
52610 }
52611 num = 800;
52612 }
52613 if (flag)
52614 {
52615 if (player.dead)
52616 {
52617 player.pirateMinion = false;
52618 }
52619 if (player.pirateMinion)
52620 {
52621 timeLeft = 2;
52622 }
52623 num = 800;
52624 }
52625 Color newColor;
52626 if (flag9)
52627 {
52628 if (player.dead)
52629 {
52630 player.stormTiger = false;
52631 }
52632 if (player.stormTiger)
52633 {
52634 timeLeft = 2;
52635 }
52636 num = 800;
52637 if (ai[0] != 4f)
52638 {
52639 if (velocity != Vector2.Zero && Main.rand.Next(18) == 0)
52640 {
52641 Dust[] dust = Main.dust;
52642 Vector2 val = position;
52643 int num53 = width;
52644 int num54 = height;
52645 newColor = default(Color);
52646 Dust obj = dust[Dust.NewDust(val, num53, num54, 269, 0f, 0f, 0, newColor)];
52647 obj.fadeIn = 0.5f;
52648 obj.scale = 0.3f;
52649 obj.noLight = true;
52650 obj.velocity += velocity * 0.005f;
52651 }
52652 if (type == 833)
52653 {
52654 Lighting.AddLight(base.Center, Vector3.One * 0.5f);
52655 }
52656 if (type == 834)
52657 {
52658 Lighting.AddLight(base.Center, Vector3.One * 0.8f);
52659 }
52660 if (type == 835)
52661 {
52662 Vector2 center2 = base.Center;
52663 newColor = Color.Lerp(Main.OurFavoriteColor, Color.White, 0.8f);
52664 Lighting.AddLight(center2, ((Color)(ref newColor)).ToVector3() * 1f);
52665 }
52666 }
52667 if (owner == Main.myPlayer)
52668 {
52669 if (localAI[0] <= 0f)
52670 {
52671 int num43 = type switch
52672 {
52673 834 => 300,
52674 835 => 240,
52675 _ => 360,
52676 };
52677 if (damage != 0)
52678 {
52680 localAI[0] = (flag12 ? num43 : 10);
52681 }
52682 }
52683 else
52684 {
52685 localAI[0] -= 1f;
52686 }
52687 }
52688 }
52689 if (flag8)
52690 {
52691 if (player.dead)
52692 {
52693 player.vampireFrog = false;
52694 }
52695 if (player.vampireFrog)
52696 {
52697 timeLeft = 2;
52698 }
52699 num = 800;
52700 }
52701 if (type == 500)
52702 {
52703 num12 = 200f;
52704 if (player.dead)
52705 {
52706 player.crimsonHeart = false;
52707 }
52708 if (player.crimsonHeart)
52709 {
52710 timeLeft = 2;
52711 }
52712 }
52713 if (type == 653)
52714 {
52715 num12 = 300f;
52716 if (player.dead)
52717 {
52718 player.companionCube = false;
52719 }
52720 if (player.companionCube)
52721 {
52722 timeLeft = 2;
52723 }
52724 }
52725 if (type == 1018)
52726 {
52727 num12 = 200f;
52728 if (player.dead)
52729 {
52730 player.petFlagDirtiestBlock = false;
52731 }
52732 if (player.petFlagDirtiestBlock)
52733 {
52734 timeLeft = 2;
52735 }
52736 }
52737 if (flag9 && ai[0] == 4f)
52738 {
52739 velocity = Vector2.Zero;
52740 frame = 9;
52741 if (flag10)
52742 {
52743 frame = 11;
52744 }
52745 ai[1] -= 1f;
52746 if (!(ai[1] <= 0f))
52747 {
52748 return;
52749 }
52750 ai[0] = 0f;
52751 ai[1] = 0f;
52752 netUpdate = true;
52753 }
52754 Vector2 vector = player.Center;
52755 if (flag11)
52756 {
52757 vector.X -= (45 + player.width / 2) * player.direction;
52758 vector.X -= minionPos * 30 * player.direction;
52759 }
52760 else if (flag)
52761 {
52762 vector.X -= (15 + player.width / 2) * player.direction;
52763 vector.X -= minionPos * 20 * player.direction;
52764 }
52765 else if (flag9)
52766 {
52767 vector.X -= (15 + player.width / 2) * player.direction;
52768 vector.X -= minionPos * 40 * player.direction;
52769 }
52770 else if (flag8)
52771 {
52772 vector.X -= (35 + player.width / 2) * player.direction;
52773 vector.X -= minionPos * 40 * player.direction;
52774 }
52775 else if (type == 500)
52776 {
52777 vector.X -= (15 + player.width / 2) * player.direction;
52778 vector.X -= 40 * player.direction;
52779 }
52780 else if (type == 1018)
52781 {
52782 vector.X = player.Center.X;
52783 }
52784 else if (type == 653)
52785 {
52786 vector.X = player.Center.X;
52787 }
52788 if (type == 500)
52789 {
52790 Lighting.AddLight(base.Center, 0.9f, 0.1f, 0.3f);
52791 int num49 = 6;
52792 if (frame == 0 || frame == 2)
52793 {
52794 num49 = 12;
52795 }
52796 if (++frameCounter >= num49)
52797 {
52798 frameCounter = 0;
52799 if (++frame >= Main.projFrames[type])
52800 {
52801 frame = 0;
52802 }
52803 }
52804 rotation += velocity.X / 20f;
52805 Vector2 vector6 = (-Vector2.UnitY).RotatedBy(rotation).RotatedBy((float)direction * 0.2f);
52806 int num50 = Dust.NewDust(base.Center + vector6 * 10f - new Vector2(4f), 0, 0, 5, vector6.X, vector6.Y, 0, Color.Transparent);
52807 Main.dust[num50].scale = 1f;
52808 Main.dust[num50].velocity = vector6.RotatedByRandom(0.7853981852531433) * 3.5f;
52809 Main.dust[num50].noGravity = true;
52810 Main.dust[num50].shader = GameShaders.Armor.GetSecondaryShader(Main.player[owner].cLight, Main.player[owner]);
52811 }
52812 if (type == 1018)
52813 {
52814 rotation += velocity.X / 20f;
52815 }
52816 if (type == 653)
52817 {
52818 rotation += velocity.X / 20f;
52819 bool flag13 = owner >= 0 && owner < 255;
52820 if (flag13)
52821 {
52824 {
52826 }
52827 }
52828 Tile tileSafely = Framing.GetTileSafely(base.Center);
52829 if (tileSafely.liquid > 0 && tileSafely.lava())
52830 {
52831 localAI[0] += 1f;
52832 }
52833 else
52834 {
52835 localAI[0] -= 1f;
52836 }
52837 localAI[0] = MathHelper.Clamp(localAI[0], 0f, 20f);
52838 if (localAI[0] >= 20f)
52839 {
52841 {
52843 SoundStyle style = ((Main.rand.Next(10) == 0) ? SoundID.NPCDeath61 : SoundID.NPCDeath59);
52845 }
52846 Kill();
52847 }
52848 if (flag13 && owner == Main.myPlayer && Main.netMode != 2)
52849 {
52850 newColor = Lighting.GetColor((int)base.Center.X / 16, (int)base.Center.Y / 16);
52851 Vector3 vector7 = ((Color)(ref newColor)).ToVector3();
52852 newColor = Lighting.GetColor((int)player.Center.X / 16, (int)player.Center.Y / 16);
52853 Vector3 vector8 = ((Color)(ref newColor)).ToVector3();
52854 if (((Vector3)(ref vector7)).Length() < 0.15f && ((Vector3)(ref vector8)).Length() < 0.15f)
52855 {
52856 localAI[1] += 1f;
52857 }
52858 else if (localAI[1] > 0f)
52859 {
52860 localAI[1] -= 1f;
52861 }
52862 localAI[1] = MathHelper.Clamp(localAI[1], -3600f, 120f);
52863 if (localAI[1] > (float)Main.rand.Next(30, 120) && !player.immune && player.velocity == Vector2.Zero)
52864 {
52865 if (Main.rand.Next(5) == 0)
52866 {
52868 localAI[1] = -600f;
52869 }
52870 else
52871 {
52873 player.Hurt(PlayerDeathReason.ByOther(6), 3, 0);
52874 player.immune = false;
52875 player.immuneTime = 0;
52876 localAI[1] = -300 + Main.rand.Next(30) * -10;
52877 }
52878 }
52879 }
52880 }
52881 bool flag14 = true;
52882 if (type == 500 || type == 653 || type == 1018)
52883 {
52884 flag14 = false;
52885 }
52886 shouldFallThrough = player.position.Y + (float)player.height - 12f > position.Y + (float)height;
52887 friendly = false;
52888 int num51 = 0;
52889 int num52 = 15;
52890 int attackTarget = -1;
52891 bool flag15 = true;
52892 bool flag2 = ai[0] == 5f;
52893 if (flag11)
52894 {
52895 flag15 = false;
52896 friendly = true;
52897 }
52898 if (flag8)
52899 {
52900 friendly = true;
52901 num52 = 20;
52902 num51 = 60;
52903 }
52904 if (flag9)
52905 {
52906 flag15 = false;
52907 friendly = true;
52908 originalDamage = player.highestStormTigerGemOriginalDamage;
52909 }
52910 bool flag3 = ai[0] == 0f;
52911 if (flag9 && flag2)
52912 {
52913 flag3 = true;
52914 }
52915 if (flag3 && flag14)
52916 {
52918 }
52919 float playerDistance;
52920 float myDistance;
52921 bool closerIsMe;
52922 Rectangle hitbox;
52923 if (flag9 && flag2)
52924 {
52925 if (attackTarget >= 0)
52926 {
52927 float maxDistance = num;
52928 NPC nPC = Main.npc[attackTarget];
52929 vector = nPC.Center;
52931 {
52932 ai[0] = 0f;
52933 ai[1] = 0f;
52934 return;
52935 }
52936 Point point = nPC.Top.ToTileCoordinates();
52937 int num2 = 0;
52938 int num3 = point.Y;
52939 while (num2 < num32)
52940 {
52941 Tile tile = Main.tile[point.X, num3];
52942 if (tile == null || tile.active())
52943 {
52944 break;
52945 }
52946 num2++;
52947 num3++;
52948 }
52949 int num4 = num32 / 2;
52950 if (num2 < num4)
52951 {
52952 ai[0] = 0f;
52953 ai[1] = 0f;
52954 return;
52955 }
52956 hitbox = base.Hitbox;
52957 if (((Rectangle)(ref hitbox)).Intersects(nPC.Hitbox) && velocity.Y >= 0f)
52958 {
52959 velocity.Y = -8f;
52960 velocity.X = direction * 10;
52961 }
52962 float num5 = 20f;
52963 float maxAmountAllowedToMove = 4f;
52964 float num6 = 40f;
52965 float num7 = 40f;
52966 Vector2 top = nPC.Top;
52967 float num8 = (float)Math.Cos(Main.timeForVisualEffects / (double)num6 * 6.2831854820251465);
52968 if (num8 > 0f)
52969 {
52970 num8 *= -1f;
52971 }
52972 num8 *= num7;
52973 top.Y += num8;
52974 Vector2 vector9 = top - base.Center;
52975 if (((Vector2)(ref vector9)).Length() > num5)
52976 {
52977 vector9 = vector9.SafeNormalize(Vector2.Zero) * num5;
52978 }
52980 frame = 8;
52981 if (flag10)
52982 {
52983 frame = 10;
52984 }
52985 rotation += 0.6f * (float)spriteDirection;
52986 }
52987 else
52988 {
52989 ai[0] = 0f;
52990 ai[1] = 0f;
52991 }
52992 return;
52993 }
52994 if (ai[0] == 1f)
52995 {
52996 tileCollide = false;
52997 float num9 = 0.2f;
52998 float num10 = 10f;
52999 int num11 = 200;
53000 if (num10 < Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y))
53001 {
53002 num10 = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y);
53003 }
53004 Vector2 vector10 = player.Center - base.Center;
53005 float num55 = ((Vector2)(ref vector10)).Length();
53006 if (num55 > 2000f)
53007 {
53008 position = player.Center - new Vector2((float)width, (float)height) / 2f;
53009 }
53010 if (num55 < (float)num11 && player.velocity.Y == 0f && position.Y + (float)height <= player.position.Y + (float)player.height && !Collision.SolidCollision(position, width, height))
53011 {
53012 ai[0] = 0f;
53013 netUpdate = true;
53014 if (velocity.Y < -6f)
53015 {
53016 velocity.Y = -6f;
53017 }
53018 }
53019 if (!(num55 < 60f))
53020 {
53021 ((Vector2)(ref vector10)).Normalize();
53022 vector10 *= num10;
53023 if (velocity.X < vector10.X)
53024 {
53025 velocity.X += num9;
53026 if (velocity.X < 0f)
53027 {
53028 velocity.X += num9 * 1.5f;
53029 }
53030 }
53031 if (velocity.X > vector10.X)
53032 {
53033 velocity.X -= num9;
53034 if (velocity.X > 0f)
53035 {
53036 velocity.X -= num9 * 1.5f;
53037 }
53038 }
53039 if (velocity.Y < vector10.Y)
53040 {
53041 velocity.Y += num9;
53042 if (velocity.Y < 0f)
53043 {
53044 velocity.Y += num9 * 1.5f;
53045 }
53046 }
53047 if (velocity.Y > vector10.Y)
53048 {
53049 velocity.Y -= num9;
53050 if (velocity.Y > 0f)
53051 {
53052 velocity.Y -= num9 * 1.5f;
53053 }
53054 }
53055 }
53056 if (velocity.X != 0f)
53057 {
53058 spriteDirection = Math.Sign(velocity.X);
53059 }
53060 if (flag11)
53061 {
53062 frameCounter++;
53063 if (frameCounter > 3)
53064 {
53065 frame++;
53066 frameCounter = 0;
53067 }
53068 if (frame < 2 || frame >= Main.projFrames[type])
53069 {
53070 frame = 2;
53071 }
53072 rotation = rotation.AngleTowards(rotation + 0.25f * (float)spriteDirection, 0.25f);
53073 }
53074 if (flag)
53075 {
53076 frameCounter++;
53077 if (frameCounter > 3)
53078 {
53079 frame++;
53080 frameCounter = 0;
53081 }
53082 if ((frame < 10) | (frame > 13))
53083 {
53084 frame = 10;
53085 }
53086 rotation = velocity.X * 0.1f;
53087 }
53088 if (flag8)
53089 {
53090 int num13 = 3;
53091 if (++frameCounter >= num13 * 4)
53092 {
53093 frameCounter = 0;
53094 }
53095 frame = 14 + frameCounter / num13;
53096 rotation = velocity.X * 0.15f;
53097 }
53098 if (flag9)
53099 {
53100 frame = 8;
53101 if (flag10)
53102 {
53103 frame = 10;
53104 }
53105 rotation += 0.6f * (float)spriteDirection;
53106 }
53107 if (type == 1018 && Main.LocalPlayer.miscCounter % 3 == 0)
53108 {
53109 int num14 = 2;
53110 Dust[] dust2 = Main.dust;
53111 Vector2 val2 = position + new Vector2((float)(-num14), (float)(-num14));
53112 int num56 = 16 + num14 * 2;
53113 int num57 = 16 + num14 * 2;
53114 newColor = default(Color);
53115 Dust obj2 = dust2[Dust.NewDust(val2, num56, num57, 0, 0f, 0f, 0, newColor, 0.8f)];
53116 obj2.velocity = -velocity * 0.25f;
53117 obj2.velocity = obj2.velocity.RotatedByRandom(0.2617993950843811);
53118 }
53119 }
53120 if (ai[0] == 2f && ai[1] < 0f)
53121 {
53122 friendly = false;
53123 ai[1] += 1f;
53124 if (num52 >= 0)
53125 {
53126 ai[1] = 0f;
53127 ai[0] = 0f;
53128 netUpdate = true;
53129 return;
53130 }
53131 }
53132 else if (ai[0] == 2f)
53133 {
53135 rotation = 0f;
53136 if (flag)
53137 {
53138 friendly = true;
53139 frame = 4 + (int)((float)num52 - ai[1]) / (num52 / 3);
53140 if (velocity.Y != 0f)
53141 {
53142 frame += 3;
53143 }
53144 }
53145 if (flag8)
53146 {
53147 float num15 = ((float)num52 - ai[1]) / (float)num52;
53148 if ((double)num15 > 0.25 && (double)num15 < 0.75)
53149 {
53150 friendly = true;
53151 }
53152 int num16 = (int)(num15 * 5f);
53153 if (num16 > 2)
53154 {
53155 num16 = 4 - num16;
53156 }
53157 if (velocity.Y != 0f)
53158 {
53159 frame = 21 + num16;
53160 }
53161 else
53162 {
53163 frame = 18 + num16;
53164 }
53165 if (velocity.Y == 0f)
53166 {
53167 velocity.X *= 0.8f;
53168 }
53169 }
53170 velocity.Y += 0.4f;
53171 if (velocity.Y > 10f)
53172 {
53173 velocity.Y = 10f;
53174 }
53175 ai[1] -= 1f;
53176 if (ai[1] <= 0f)
53177 {
53178 if (num51 <= 0)
53179 {
53180 ai[1] = 0f;
53181 ai[0] = 0f;
53182 netUpdate = true;
53183 return;
53184 }
53185 ai[1] = -num51;
53186 }
53187 }
53188 if (attackTarget >= 0)
53189 {
53190 float maxDistance2 = num;
53191 float num17 = 20f;
53192 if (flag8)
53193 {
53194 num17 = 50f;
53195 }
53196 NPC nPC2 = Main.npc[attackTarget];
53197 Vector2 center = nPC2.Center;
53198 vector = center;
53200 {
53201 shouldFallThrough = nPC2.Center.Y > base.Bottom.Y;
53202 bool flag4 = velocity.Y == 0f;
53203 if (wet && velocity.Y > 0f && !shouldFallThrough)
53204 {
53205 flag4 = true;
53206 }
53207 if (center.Y < base.Center.Y - 30f && flag4)
53208 {
53209 float num58 = (center.Y - base.Center.Y) * -1f;
53210 float num18 = 0.4f;
53211 float num19 = (float)Math.Sqrt(num58 * 2f * num18);
53212 if (num19 > 26f)
53213 {
53214 num19 = 26f;
53215 }
53216 velocity.Y = 0f - num19;
53217 }
53218 if (flag15 && Vector2.Distance(base.Center, vector) < num17)
53219 {
53220 if (((Vector2)(ref velocity)).Length() > 10f)
53221 {
53222 velocity /= ((Vector2)(ref velocity)).Length() / 10f;
53223 }
53224 ai[0] = 2f;
53225 ai[1] = num52;
53226 netUpdate = true;
53227 direction = ((center.X - base.Center.X > 0f) ? 1 : (-1));
53228 }
53229 if (flag9)
53230 {
53231 Point point2 = nPC2.Top.ToTileCoordinates();
53232 int num20 = 0;
53233 int num22 = point2.Y;
53234 while (num20 < num32)
53235 {
53236 Tile tile2 = Main.tile[point2.X, num22];
53237 if (tile2 == null || tile2.active())
53238 {
53239 break;
53240 }
53241 num20++;
53242 num22++;
53243 }
53244 if (num20 >= num32)
53245 {
53246 ai[0] = 5f;
53247 ai[1] = 0f;
53248 netUpdate = true;
53249 return;
53250 }
53251 hitbox = base.Hitbox;
53252 if (((Rectangle)(ref hitbox)).Intersects(nPC2.Hitbox) && velocity.Y >= 0f)
53253 {
53254 velocity.Y = -4f;
53255 velocity.X = direction * 10;
53256 }
53257 }
53258 }
53259 if (flag8)
53260 {
53261 int num23 = 1;
53262 if (center.X - base.Center.X < 0f)
53263 {
53264 num23 = -1;
53265 }
53266 vector.X += 20 * -num23;
53267 }
53268 }
53269 if (ai[0] == 0f && attackTarget < 0)
53270 {
53271 if (Main.player[owner].rocketDelay2 > 0)
53272 {
53273 ai[0] = 1f;
53274 netUpdate = true;
53275 }
53276 Vector2 vector11 = player.Center - base.Center;
53277 if (((Vector2)(ref vector11)).Length() > 2000f)
53278 {
53279 position = player.Center - new Vector2((float)width, (float)height) / 2f;
53280 }
53281 else if (((Vector2)(ref vector11)).Length() > num12 || Math.Abs(vector11.Y) > num21)
53282 {
53283 ai[0] = 1f;
53284 netUpdate = true;
53285 if (velocity.Y > 0f && vector11.Y < 0f)
53286 {
53287 velocity.Y = 0f;
53288 }
53289 if (velocity.Y < 0f && vector11.Y > 0f)
53290 {
53291 velocity.Y = 0f;
53292 }
53293 }
53294 }
53295 if (ai[0] == 0f)
53296 {
53297 if (attackTarget < 0)
53298 {
53299 if (Distance(player.Center) > 60f && Distance(vector) > 60f && Math.Sign(vector.X - player.Center.X) != Math.Sign(base.Center.X - player.Center.X))
53300 {
53301 vector = player.Center;
53302 }
53303 Rectangle r = Utils.CenteredRectangle(vector, base.Size);
53304 for (int i = 0; i < 20; i++)
53305 {
53306 if (Collision.SolidCollision(r.TopLeft(), r.Width, r.Height))
53307 {
53308 break;
53309 }
53310 r.Y += 16;
53311 vector.Y += 16f;
53312 }
53313 Vector2 vector12 = Collision.TileCollision(player.Center - base.Size / 2f, vector - player.Center, width, height);
53314 vector = player.Center - base.Size / 2f + vector12;
53315 if (Distance(vector) < 32f)
53316 {
53317 float num24 = player.Center.Distance(vector);
53318 if (player.Center.Distance(base.Center) < num24)
53319 {
53320 vector = base.Center;
53321 }
53322 }
53323 Vector2 vector13 = player.Center - vector;
53324 if (((Vector2)(ref vector13)).Length() > num12 || Math.Abs(vector13.Y) > num21)
53325 {
53326 Rectangle r2 = Utils.CenteredRectangle(player.Center, base.Size);
53327 Vector2 vector2 = vector - player.Center;
53328 Vector2 vector3 = r2.TopLeft();
53329 for (float num25 = 0f; num25 < 1f; num25 += 0.05f)
53330 {
53331 Vector2 vector4 = r2.TopLeft() + vector2 * num25;
53332 if (Collision.SolidCollision(r2.TopLeft() + vector2 * num25, r.Width, r.Height))
53333 {
53334 break;
53335 }
53336 vector3 = vector4;
53337 }
53338 vector = vector3 + base.Size / 2f;
53339 }
53340 }
53341 tileCollide = true;
53342 float num26 = 0.5f;
53343 float num27 = 4f;
53344 float num28 = 4f;
53345 float num29 = 0.1f;
53346 if (flag11 && attackTarget != -1)
53347 {
53348 num26 = 0.65f;
53349 num27 = 5.5f;
53350 num28 = 5.5f;
53351 }
53352 if (flag && attackTarget != -1)
53353 {
53354 num26 = 1f;
53355 num27 = 8f;
53356 num28 = 8f;
53357 }
53358 if (flag8 && attackTarget != -1)
53359 {
53360 num26 = 0.7f;
53361 num27 = 6f;
53362 num28 = 6f;
53363 }
53364 if (flag9 && attackTarget != -1)
53365 {
53366 num26 = 1f;
53367 num27 = 8f;
53368 num28 = 8f;
53369 }
53370 if (num28 < Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y))
53371 {
53372 num28 = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y);
53373 num26 = 0.7f;
53374 }
53375 if (type == 653 || type == 1018)
53376 {
53377 float num30 = ((Vector2)(ref player.velocity)).Length();
53378 if (num30 < 0.1f)
53379 {
53380 num30 = 0f;
53381 }
53382 if (num30 != 0f && num30 < num28)
53383 {
53384 num28 = num30;
53385 }
53386 }
53387 int num31 = 0;
53388 bool flag5 = false;
53389 float num33 = vector.X - base.Center.X;
53390 Vector2 vector5 = vector - base.Center;
53391 if (type == 1018 && Math.Abs(num33) < 50f)
53392 {
53393 rotation = rotation.AngleTowards(0f, 0.2f);
53394 velocity.X *= 0.9f;
53395 if ((double)Math.Abs(velocity.X) < 0.1)
53396 {
53397 velocity.X = 0f;
53398 }
53399 }
53400 else if (type == 653 && Math.Abs(num33) < 150f)
53401 {
53402 rotation = rotation.AngleTowards(0f, 0.2f);
53403 velocity.X *= 0.9f;
53404 if ((double)Math.Abs(velocity.X) < 0.1)
53405 {
53406 velocity.X = 0f;
53407 }
53408 }
53409 else if (Math.Abs(num33) > 5f)
53410 {
53411 if (num33 < 0f)
53412 {
53413 num31 = -1;
53414 if (velocity.X > 0f - num27)
53415 {
53416 velocity.X -= num26;
53417 }
53418 else
53419 {
53420 velocity.X -= num29;
53421 }
53422 }
53423 else
53424 {
53425 num31 = 1;
53426 if (velocity.X < num27)
53427 {
53428 velocity.X += num26;
53429 }
53430 else
53431 {
53432 velocity.X += num29;
53433 }
53434 }
53435 bool flag6 = true;
53436 if (flag)
53437 {
53438 flag6 = false;
53439 }
53440 if (type == 653)
53441 {
53442 flag6 = false;
53443 }
53444 if (type == 1018)
53445 {
53446 flag6 = false;
53447 }
53448 if (flag8 && attackTarget == -1)
53449 {
53450 flag6 = false;
53451 }
53452 if (flag9)
53453 {
53454 flag6 = vector5.Y < -80f;
53455 }
53456 if (flag11)
53457 {
53458 int num59;
53459 if (attackTarget > -1)
53460 {
53461 hitbox = Main.npc[attackTarget].Hitbox;
53462 num59 = (((Rectangle)(ref hitbox)).Intersects(base.Hitbox) ? 1 : 0);
53463 }
53464 else
53465 {
53466 num59 = 0;
53467 }
53468 flag6 = (byte)num59 != 0;
53469 }
53470 if (flag6)
53471 {
53472 flag5 = true;
53473 }
53474 }
53475 else
53476 {
53477 velocity.X *= 0.9f;
53478 if (Math.Abs(velocity.X) < num26 * 2f)
53479 {
53480 velocity.X = 0f;
53481 }
53482 }
53483 bool flag7 = Math.Abs(vector5.X) >= 64f || (vector5.Y <= -48f && Math.Abs(vector5.X) >= 8f);
53484 if (num31 != 0 && flag7)
53485 {
53486 int num34 = (int)(position.X + (float)(width / 2)) / 16;
53487 int num35 = (int)position.Y / 16;
53488 num34 += num31;
53489 num34 += (int)velocity.X;
53490 for (int j = num35; j < num35 + height / 16 + 1; j++)
53491 {
53492 if (WorldGen.SolidTile(num34, j))
53493 {
53494 flag5 = true;
53495 }
53496 }
53497 }
53498 if (type == 500 && velocity.X != 0f)
53499 {
53500 flag5 = true;
53501 }
53502 if (type == 653 && Math.Abs(velocity.X) > 3f)
53503 {
53504 flag5 = true;
53505 }
53506 if (type == 1018 && Math.Abs(velocity.X) > 3f)
53507 {
53508 flag5 = true;
53509 }
53510 Collision.StepUp(ref position, ref velocity, width, height, ref stepSpeed, ref gfxOffY);
53511 float num36 = Utils.GetLerpValue(0f, 100f, vector5.Y, clamped: true) * Utils.GetLerpValue(-2f, -6f, velocity.Y, clamped: true);
53512 if (velocity.Y == 0f)
53513 {
53514 if (flag5)
53515 {
53516 for (int k = 0; k < 3; k++)
53517 {
53518 int num37 = (int)(position.X + (float)(width / 2)) / 16;
53519 if (k == 0)
53520 {
53521 num37 = (int)position.X / 16;
53522 }
53523 if (k == 2)
53524 {
53525 num37 = (int)(position.X + (float)width) / 16;
53526 }
53527 int num38 = (int)(position.Y + (float)height) / 16;
53528 if (!WorldGen.SolidTile(num37, num38) && !Main.tile[num37, num38].halfBrick() && Main.tile[num37, num38].slope() <= 0 && (!TileID.Sets.Platforms[Main.tile[num37, num38].type] || !Main.tile[num37, num38].active() || Main.tile[num37, num38].inActive()))
53529 {
53530 continue;
53531 }
53532 try
53533 {
53534 num37 = (int)(position.X + (float)(width / 2)) / 16;
53535 num38 = (int)(position.Y + (float)(height / 2)) / 16;
53536 num37 += num31;
53537 num37 += (int)velocity.X;
53538 if (!WorldGen.SolidTile(num37, num38 - 1) && !WorldGen.SolidTile(num37, num38 - 2))
53539 {
53540 velocity.Y = -5.1f;
53541 }
53542 else if (!WorldGen.SolidTile(num37, num38 - 2))
53543 {
53544 velocity.Y = -7.1f;
53545 }
53546 else if (WorldGen.SolidTile(num37, num38 - 5))
53547 {
53548 velocity.Y = -11.1f;
53549 }
53550 else if (WorldGen.SolidTile(num37, num38 - 4))
53551 {
53552 velocity.Y = -10.1f;
53553 }
53554 else
53555 {
53556 velocity.Y = -9.1f;
53557 }
53558 }
53559 catch
53560 {
53561 velocity.Y = -9.1f;
53562 }
53563 }
53564 if (vector.Y - base.Center.Y < -48f)
53565 {
53566 float num39 = vector.Y - base.Center.Y;
53567 num39 *= -1f;
53568 if (num39 < 60f)
53569 {
53570 velocity.Y = -6f;
53571 }
53572 else if (num39 < 80f)
53573 {
53574 velocity.Y = -7f;
53575 }
53576 else if (num39 < 100f)
53577 {
53578 velocity.Y = -8f;
53579 }
53580 else if (num39 < 120f)
53581 {
53582 velocity.Y = -9f;
53583 }
53584 else if (num39 < 140f)
53585 {
53586 velocity.Y = -10f;
53587 }
53588 else if (num39 < 160f)
53589 {
53590 velocity.Y = -11f;
53591 }
53592 else if (num39 < 190f)
53593 {
53594 velocity.Y = -12f;
53595 }
53596 else if (num39 < 210f)
53597 {
53598 velocity.Y = -13f;
53599 }
53600 else if (num39 < 270f)
53601 {
53602 velocity.Y = -14f;
53603 }
53604 else if (num39 < 310f)
53605 {
53606 velocity.Y = -15f;
53607 }
53608 else
53609 {
53610 velocity.Y = -16f;
53611 }
53612 }
53613 if (wet && num36 == 0f)
53614 {
53615 velocity.Y *= 2f;
53616 }
53617 }
53618 if (type == 1018 && localAI[2] == 0f)
53619 {
53620 localAI[2] = 1f;
53621 for (int l = 0; l < 6; l++)
53622 {
53623 Dust[] dust3 = Main.dust;
53624 Vector2 val3 = position + velocity;
53625 newColor = default(Color);
53626 Dust obj4 = dust3[Dust.NewDust(val3, 16, 16, 0, 0f, 0f, 0, newColor, 0.8f)];
53627 obj4.velocity.X = velocity.X * 0.25f;
53628 obj4.velocity.Y = -2f + Math.Abs(velocity.Y) * 0.25f;
53629 obj4.velocity = obj4.velocity.RotatedByRandom(0.2617993950843811);
53630 }
53631 }
53632 }
53633 else if (type == 1018)
53634 {
53635 localAI[2] = 0f;
53636 }
53637 if (velocity.X > num28)
53638 {
53639 velocity.X = num28;
53640 }
53641 if (velocity.X < 0f - num28)
53642 {
53643 velocity.X = 0f - num28;
53644 }
53645 if (velocity.X < 0f)
53646 {
53647 direction = -1;
53648 }
53649 if (velocity.X > 0f)
53650 {
53651 direction = 1;
53652 }
53653 if (velocity.X == 0f)
53654 {
53655 direction = ((player.Center.X > base.Center.X) ? 1 : (-1));
53656 }
53657 if (velocity.X > num26 && num31 == 1)
53658 {
53659 direction = 1;
53660 }
53661 if (velocity.X < 0f - num26 && num31 == -1)
53662 {
53663 direction = -1;
53664 }
53666 if (flag11)
53667 {
53668 if (velocity.Y == 0f)
53669 {
53670 rotation = rotation.AngleTowards(0f, 0.3f);
53671 if (velocity.X == 0f)
53672 {
53673 frame = 0;
53674 frameCounter = 0;
53675 }
53676 else if (Math.Abs(velocity.X) >= 0.5f)
53677 {
53678 frameCounter += (int)Math.Abs(velocity.X);
53679 frameCounter++;
53680 if (frameCounter > 10)
53681 {
53682 frame++;
53683 frameCounter = 0;
53684 }
53685 if (frame < 2 || frame >= Main.projFrames[type])
53686 {
53687 frame = 2;
53688 }
53689 }
53690 else
53691 {
53692 frame = 0;
53693 frameCounter = 0;
53694 }
53695 }
53696 else if (velocity.Y != 0f)
53697 {
53698 rotation = Math.Min(4f, velocity.Y) * -0.1f;
53699 if (spriteDirection == -1)
53700 {
53701 rotation -= (float)Math.PI * 2f;
53702 }
53703 frameCounter = 0;
53704 frame = 1;
53705 }
53706 }
53707 if (flag)
53708 {
53709 rotation = 0f;
53710 if (velocity.Y == 0f)
53711 {
53712 if (velocity.X == 0f)
53713 {
53714 frame = 0;
53715 frameCounter = 0;
53716 }
53717 else if (Math.Abs(velocity.X) >= 0.5f)
53718 {
53719 frameCounter += (int)Math.Abs(velocity.X);
53720 frameCounter++;
53721 if (frameCounter > 10)
53722 {
53723 frame++;
53724 frameCounter = 0;
53725 }
53726 if (frame >= 4)
53727 {
53728 frame = 0;
53729 }
53730 }
53731 else
53732 {
53733 frame = 0;
53734 frameCounter = 0;
53735 }
53736 }
53737 else if (velocity.Y != 0f)
53738 {
53739 frameCounter = 0;
53740 frame = 14;
53741 }
53742 }
53743 if (flag8)
53744 {
53745 rotation = 0f;
53746 if (velocity.Y == 0f)
53747 {
53748 if (velocity.X == 0f)
53749 {
53750 int num40 = 4;
53751 if (++frameCounter >= 7 * num40 && Main.rand.Next(50) == 0)
53752 {
53753 frameCounter = 0;
53754 }
53755 int num41 = frameCounter / num40;
53756 if (num41 >= 4)
53757 {
53758 num41 = 6 - num41;
53759 }
53760 if (num41 < 0)
53761 {
53762 num41 = 0;
53763 }
53764 frame = 1 + num41;
53765 }
53766 else if (Math.Abs(velocity.X) >= 0.5f)
53767 {
53768 frameCounter += (int)Math.Abs(velocity.X);
53769 frameCounter++;
53770 int num42 = 15;
53771 int num44 = 8;
53772 if (frameCounter >= num44 * num42)
53773 {
53774 frameCounter = 0;
53775 }
53776 int num45 = frameCounter / num42;
53777 frame = num45 + 5;
53778 }
53779 else
53780 {
53781 frame = 0;
53782 frameCounter = 0;
53783 }
53784 }
53785 else if (velocity.Y != 0f)
53786 {
53787 if (velocity.Y < 0f)
53788 {
53789 if (frame > 9 || frame < 5)
53790 {
53791 frame = 5;
53792 frameCounter = 0;
53793 }
53794 if (++frameCounter >= 1 && frame < 9)
53795 {
53796 frame++;
53797 frameCounter = 0;
53798 }
53799 }
53800 else
53801 {
53802 if (frame > 13 || frame < 9)
53803 {
53804 frame = 9;
53805 frameCounter = 0;
53806 }
53807 if (++frameCounter >= 2 && frame < 11)
53808 {
53809 frame++;
53810 frameCounter = 0;
53811 }
53812 }
53813 }
53814 }
53815 if (flag9)
53816 {
53817 int num46 = 8;
53818 if (flag10)
53819 {
53820 num46 = 10;
53821 }
53822 rotation = 0f;
53823 if (velocity.Y == 0f)
53824 {
53825 if (velocity.X == 0f)
53826 {
53827 frame = 0;
53828 frameCounter = 0;
53829 }
53830 else if (Math.Abs(velocity.X) >= 0.5f)
53831 {
53832 frameCounter += (int)Math.Abs(velocity.X);
53833 frameCounter++;
53834 if (frameCounter > 10)
53835 {
53836 frame++;
53837 frameCounter = 0;
53838 }
53839 if (frame >= num46 || frame < 2)
53840 {
53841 frame = 2;
53842 }
53843 }
53844 else
53845 {
53846 frame = 0;
53847 frameCounter = 0;
53848 }
53849 }
53850 else if (velocity.Y != 0f)
53851 {
53852 frameCounter = 0;
53853 frame = 1;
53854 if (flag10)
53855 {
53856 frame = 9;
53857 }
53858 }
53859 }
53860 velocity.Y += 0.4f + num36 * 1f;
53861 if (velocity.Y > 10f)
53862 {
53863 velocity.Y = 10f;
53864 }
53865 }
53866 if (!flag)
53867 {
53868 return;
53869 }
53870 localAI[0] += 1f;
53871 if (velocity.X == 0f)
53872 {
53873 localAI[0] += 1f;
53874 }
53875 if (localAI[0] >= (float)Main.rand.Next(900, 1200))
53876 {
53877 localAI[0] = 0f;
53878 for (int m = 0; m < 6; m++)
53879 {
53880 Vector2 val4 = base.Center + Vector2.UnitX * (float)(-direction) * 8f - Vector2.One * 5f + Vector2.UnitY * 8f;
53881 float speedX = -direction;
53882 newColor = default(Color);
53883 int num47 = Dust.NewDust(val4, 3, 6, 216, speedX, 1f, 0, newColor);
53884 Dust obj5 = Main.dust[num47];
53885 obj5.velocity /= 2f;
53886 Main.dust[num47].scale = 0.8f;
53887 }
53888 int num48 = Gore.NewGore(base.Center + Vector2.UnitX * (float)(-direction) * 8f, Vector2.Zero, Main.rand.Next(580, 583));
53889 Gore obj6 = Main.gore[num48];
53890 obj6.velocity /= 2f;
53891 Main.gore[num48].velocity.Y = Math.Abs(Main.gore[num48].velocity.Y);
53892 Main.gore[num48].velocity.X = (0f - Math.Abs(Main.gore[num48].velocity.X)) * (float)direction;
53893 }
53894 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
static PlayerDeathReason ByOther(int type, int playerIndex=-1)
bool wet
The Entity is currently in water. Projectile: Affects movement speed and some projectiles die when ...
Definition Entity.cs:57
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
float Distance(Vector2 Other)
Definition Entity.cs:275
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
bool active
If true, the Entity actually exists within the game world. Within the specific entity array,...
Definition Entity.cs:21
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
static ArmorShaderDataSet Armor
Definition GameShaders.cs:7
static readonly SoundStyle Item1
Definition SoundID.cs:679
static readonly SoundStyle NPCDeath61
Definition SoundID.cs:665
static readonly SoundStyle Item16
Definition SoundID.cs:709
static bool[] Platforms
Definition TileID.cs:219
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
int damage
This will always be set in Projectile.NewProjectile based on the weapons damage and player stat modif...
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
bool netUpdate
Set manually to true in M:Terraria.ModLoader.ModProjectile.AI once to make it sync its current F:Terr...
bool IsInRangeOfMeOrMyOwner(Entity entity, float maxDistance, out float myDistance, out float playerDistance, out bool closerIsMe)
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
void Minion_FindTargetInRange(int startAttackRange, ref int attackTarget, bool skipIfCannotHitWithOwnBody, Func< Entity, int, bool > customEliminationCheck=null)
int frame
The frame number in the spritesheet that this projectile will be drawn with. Assign in M:Terraria....
static float[] _CompanionCubeScreamCooldown
bool AI_067_TigerSpecialAttack()
bool friendly
If True, this projectile will hurt enemies (!F:Terraria.NPC.friendly) Defaults to false.
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
bool tileCollide
If true, the projectile will collide with tiles, usually bouncing or killing the tile depending on M:...
int timeLeft
Time in ticks before this projectile will naturally despawn. Each update timeLeft is decreased by 1...
float rotation
Rotation of the projectile. Radians not Degrees. Use T:Microsoft.Xna.Framework.MathHelper if you want...
float stepSpeed
Has nothing to do with the speed that this projectile travels, that is dictated by AI code adjusting ...
bool AI_067_CustomEliminationCheck_Pirates(Entity otherEntity, int currentTarget)
float gfxOffY
An offset from the actual position of the projectile that will be added to the draw position....
int minionPos
A number indicating the order of minions. Minion AI code typically uses this value to determine a sui...
int frameCounter
Used as a timer to decide when to change F:Terraria.Projectile.frame. Defaults to 0.
This data type describes in detail how a sound should be played. Passable to the M:Terraria....
Definition SoundStyle.cs:19

References Terraria.Entity.active, Terraria.Tile.active(), Terraria.Lighting.AddLight(), Terraria.Graphics.Shaders.GameShaders.Armor, Terraria.DataStructures.PlayerDeathReason.ByOther(), Terraria.Entity.Center, Terraria.Utils.CenteredRectangle(), Terraria.Player.companionCube, Terraria.Player.crimsonHeart, Terraria.Player.dead, Terraria.Entity.direction, Terraria.Main.dust, Terraria.Player.flinxMinion, Terraria.Lighting.GetColor(), Terraria.Utils.GetLerpValue(), Terraria.Framing.GetTileSafely(), Terraria.Main.gore, Terraria.Entity.height, Terraria.Player.highestStormTigerGemOriginalDamage, Terraria.Player.Hurt(), Terraria.ID.SoundID.Item1, Terraria.ID.SoundID.Item16, Terraria.Main.LocalPlayer, Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.Dust.NewDust(), Terraria.Gore.NewGore(), Terraria.Main.npc, Terraria.ID.SoundID.NPCDeath59, Terraria.ID.SoundID.NPCDeath61, Terraria.Main.OurFavoriteColor, Terraria.Player.petFlagDirtiestBlock, Terraria.Player.pirateMinion, Terraria.ID.TileID.Sets.Platforms, Terraria.Main.player, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Entity.position, Terraria.Main.projFrames, Terraria.Main.rand, Terraria.Collision.SolidCollision(), Terraria.WorldGen.SolidTile(), Terraria.Collision.StepUp(), Terraria.Player.stormTiger, Terraria.Main.tile, Terraria.Collision.TileCollision(), Terraria.Main.timeForVisualEffects, Terraria.Player.vampireFrog, and Terraria.Entity.velocity.

+ Here is the call graph for this function: