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

◆ WingFrame()

void Terraria.Player.WingFrame ( bool wingFlap,
bool isCustomWings = false )
inline

Definition at line 27316 of file Player.cs.

27317 {
27318 //IL_004a: Unknown result type (might be due to invalid IL or missing references)
27319 //IL_02e2: Unknown result type (might be due to invalid IL or missing references)
27320 //IL_0b67: Unknown result type (might be due to invalid IL or missing references)
27321 //IL_0166: Unknown result type (might be due to invalid IL or missing references)
27322 //IL_017d: Unknown result type (might be due to invalid IL or missing references)
27323 //IL_0183: Unknown result type (might be due to invalid IL or missing references)
27324 //IL_07c4: Unknown result type (might be due to invalid IL or missing references)
27325 //IL_07d9: Unknown result type (might be due to invalid IL or missing references)
27326 //IL_07de: Unknown result type (might be due to invalid IL or missing references)
27327 //IL_07e3: Unknown result type (might be due to invalid IL or missing references)
27328 //IL_07eb: Unknown result type (might be due to invalid IL or missing references)
27329 //IL_0803: Unknown result type (might be due to invalid IL or missing references)
27330 //IL_0828: Unknown result type (might be due to invalid IL or missing references)
27331 //IL_082d: Unknown result type (might be due to invalid IL or missing references)
27332 //IL_082f: Unknown result type (might be due to invalid IL or missing references)
27333 //IL_0834: Unknown result type (might be due to invalid IL or missing references)
27334 //IL_083e: Unknown result type (might be due to invalid IL or missing references)
27335 //IL_0843: Unknown result type (might be due to invalid IL or missing references)
27336 //IL_084d: Unknown result type (might be due to invalid IL or missing references)
27337 //IL_0852: Unknown result type (might be due to invalid IL or missing references)
27338 //IL_1003: Unknown result type (might be due to invalid IL or missing references)
27339 //IL_1008: Unknown result type (might be due to invalid IL or missing references)
27340 //IL_1021: Unknown result type (might be due to invalid IL or missing references)
27341 //IL_1026: Unknown result type (might be due to invalid IL or missing references)
27342 //IL_0c01: Unknown result type (might be due to invalid IL or missing references)
27343 //IL_0c06: Unknown result type (might be due to invalid IL or missing references)
27344 //IL_0c0b: Unknown result type (might be due to invalid IL or missing references)
27345 //IL_0c15: Unknown result type (might be due to invalid IL or missing references)
27346 //IL_0c1a: Unknown result type (might be due to invalid IL or missing references)
27347 //IL_0c1f: Unknown result type (might be due to invalid IL or missing references)
27348 //IL_0c2e: Unknown result type (might be due to invalid IL or missing references)
27349 //IL_0c33: Unknown result type (might be due to invalid IL or missing references)
27350 //IL_0c38: Unknown result type (might be due to invalid IL or missing references)
27351 //IL_0c3a: Unknown result type (might be due to invalid IL or missing references)
27352 //IL_0c3c: Unknown result type (might be due to invalid IL or missing references)
27353 //IL_0c41: Unknown result type (might be due to invalid IL or missing references)
27354 //IL_0c48: Unknown result type (might be due to invalid IL or missing references)
27355 //IL_0c5c: Unknown result type (might be due to invalid IL or missing references)
27356 //IL_0c66: Unknown result type (might be due to invalid IL or missing references)
27357 //IL_0c82: Unknown result type (might be due to invalid IL or missing references)
27358 //IL_0c88: Unknown result type (might be due to invalid IL or missing references)
27359 //IL_0c8d: Unknown result type (might be due to invalid IL or missing references)
27360 //IL_0c92: Unknown result type (might be due to invalid IL or missing references)
27361 //IL_0c99: Unknown result type (might be due to invalid IL or missing references)
27362 //IL_0ca3: Unknown result type (might be due to invalid IL or missing references)
27363 //IL_0ca8: Unknown result type (might be due to invalid IL or missing references)
27364 //IL_08d2: Unknown result type (might be due to invalid IL or missing references)
27365 //IL_08e6: Unknown result type (might be due to invalid IL or missing references)
27366 //IL_08eb: Unknown result type (might be due to invalid IL or missing references)
27367 //IL_0903: Unknown result type (might be due to invalid IL or missing references)
27368 //IL_0908: Unknown result type (might be due to invalid IL or missing references)
27369 //IL_090d: Unknown result type (might be due to invalid IL or missing references)
27370 //IL_0915: Unknown result type (might be due to invalid IL or missing references)
27371 //IL_092d: Unknown result type (might be due to invalid IL or missing references)
27372 //IL_0952: Unknown result type (might be due to invalid IL or missing references)
27373 //IL_0957: Unknown result type (might be due to invalid IL or missing references)
27374 //IL_0959: Unknown result type (might be due to invalid IL or missing references)
27375 //IL_095e: Unknown result type (might be due to invalid IL or missing references)
27376 //IL_0967: Unknown result type (might be due to invalid IL or missing references)
27377 //IL_096d: Unknown result type (might be due to invalid IL or missing references)
27378 //IL_0972: Unknown result type (might be due to invalid IL or missing references)
27379 //IL_098a: Unknown result type (might be due to invalid IL or missing references)
27380 //IL_098f: Unknown result type (might be due to invalid IL or missing references)
27381 //IL_0994: Unknown result type (might be due to invalid IL or missing references)
27382 //IL_099e: Unknown result type (might be due to invalid IL or missing references)
27383 //IL_09a3: Unknown result type (might be due to invalid IL or missing references)
27384 //IL_09ab: Unknown result type (might be due to invalid IL or missing references)
27385 //IL_09b2: Unknown result type (might be due to invalid IL or missing references)
27386 //IL_09bc: Unknown result type (might be due to invalid IL or missing references)
27387 //IL_09c1: Unknown result type (might be due to invalid IL or missing references)
27388 //IL_09c6: Unknown result type (might be due to invalid IL or missing references)
27389 //IL_13b1: Unknown result type (might be due to invalid IL or missing references)
27390 //IL_13bb: Unknown result type (might be due to invalid IL or missing references)
27391 //IL_13c0: Unknown result type (might be due to invalid IL or missing references)
27392 //IL_0ef5: Unknown result type (might be due to invalid IL or missing references)
27393 //IL_0f04: Unknown result type (might be due to invalid IL or missing references)
27394 //IL_0f09: Unknown result type (might be due to invalid IL or missing references)
27395 //IL_0ed9: Unknown result type (might be due to invalid IL or missing references)
27396 //IL_0ee8: Unknown result type (might be due to invalid IL or missing references)
27397 //IL_0eed: Unknown result type (might be due to invalid IL or missing references)
27398 //IL_0f18: Unknown result type (might be due to invalid IL or missing references)
27399 //IL_0f1d: Unknown result type (might be due to invalid IL or missing references)
27400 //IL_0f22: Unknown result type (might be due to invalid IL or missing references)
27401 //IL_13e0: Unknown result type (might be due to invalid IL or missing references)
27402 //IL_13e5: Unknown result type (might be due to invalid IL or missing references)
27403 //IL_13f4: Unknown result type (might be due to invalid IL or missing references)
27404 //IL_13fe: Unknown result type (might be due to invalid IL or missing references)
27405 //IL_1403: Unknown result type (might be due to invalid IL or missing references)
27406 //IL_105e: Unknown result type (might be due to invalid IL or missing references)
27407 //IL_108c: Unknown result type (might be due to invalid IL or missing references)
27408 //IL_0f2c: Unknown result type (might be due to invalid IL or missing references)
27409 //IL_0f2e: Unknown result type (might be due to invalid IL or missing references)
27410 //IL_0f33: Unknown result type (might be due to invalid IL or missing references)
27411 //IL_0f3a: Unknown result type (might be due to invalid IL or missing references)
27412 //IL_0f4e: Unknown result type (might be due to invalid IL or missing references)
27413 //IL_0f6a: Unknown result type (might be due to invalid IL or missing references)
27414 //IL_0f74: Unknown result type (might be due to invalid IL or missing references)
27415 //IL_0f79: Unknown result type (might be due to invalid IL or missing references)
27416 //IL_1423: Unknown result type (might be due to invalid IL or missing references)
27417 //IL_1428: Unknown result type (might be due to invalid IL or missing references)
27418 //IL_142a: Unknown result type (might be due to invalid IL or missing references)
27419 //IL_1439: Unknown result type (might be due to invalid IL or missing references)
27420 //IL_1450: Unknown result type (might be due to invalid IL or missing references)
27421 //IL_1456: Unknown result type (might be due to invalid IL or missing references)
27422 //IL_1458: Unknown result type (might be due to invalid IL or missing references)
27423 //IL_145d: Unknown result type (might be due to invalid IL or missing references)
27424 //IL_1462: Unknown result type (might be due to invalid IL or missing references)
27425 //IL_1465: Unknown result type (might be due to invalid IL or missing references)
27426 //IL_146a: Unknown result type (might be due to invalid IL or missing references)
27427 //IL_146c: Unknown result type (might be due to invalid IL or missing references)
27428 //IL_1471: Unknown result type (might be due to invalid IL or missing references)
27429 //IL_1473: Unknown result type (might be due to invalid IL or missing references)
27430 //IL_147a: Unknown result type (might be due to invalid IL or missing references)
27431 //IL_1483: Unknown result type (might be due to invalid IL or missing references)
27432 //IL_14d2: Unknown result type (might be due to invalid IL or missing references)
27433 //IL_14d7: Unknown result type (might be due to invalid IL or missing references)
27434 //IL_14d9: Unknown result type (might be due to invalid IL or missing references)
27435 //IL_14e8: Unknown result type (might be due to invalid IL or missing references)
27436 //IL_14ff: Unknown result type (might be due to invalid IL or missing references)
27437 //IL_1505: Unknown result type (might be due to invalid IL or missing references)
27438 //IL_1507: Unknown result type (might be due to invalid IL or missing references)
27439 //IL_150c: Unknown result type (might be due to invalid IL or missing references)
27440 //IL_1511: Unknown result type (might be due to invalid IL or missing references)
27441 //IL_1514: Unknown result type (might be due to invalid IL or missing references)
27442 //IL_1519: Unknown result type (might be due to invalid IL or missing references)
27443 //IL_151b: Unknown result type (might be due to invalid IL or missing references)
27444 //IL_1520: Unknown result type (might be due to invalid IL or missing references)
27445 //IL_1522: Unknown result type (might be due to invalid IL or missing references)
27446 //IL_1529: Unknown result type (might be due to invalid IL or missing references)
27447 //IL_1532: Unknown result type (might be due to invalid IL or missing references)
27448 //IL_1581: Unknown result type (might be due to invalid IL or missing references)
27449 //IL_1586: Unknown result type (might be due to invalid IL or missing references)
27450 //IL_1588: Unknown result type (might be due to invalid IL or missing references)
27451 //IL_1597: Unknown result type (might be due to invalid IL or missing references)
27452 //IL_15ae: Unknown result type (might be due to invalid IL or missing references)
27453 //IL_15b4: Unknown result type (might be due to invalid IL or missing references)
27454 //IL_15b6: Unknown result type (might be due to invalid IL or missing references)
27455 //IL_15bb: Unknown result type (might be due to invalid IL or missing references)
27456 //IL_15c0: Unknown result type (might be due to invalid IL or missing references)
27457 //IL_15c3: Unknown result type (might be due to invalid IL or missing references)
27458 //IL_15c8: Unknown result type (might be due to invalid IL or missing references)
27459 //IL_15ca: Unknown result type (might be due to invalid IL or missing references)
27460 //IL_15cf: Unknown result type (might be due to invalid IL or missing references)
27461 //IL_15d1: Unknown result type (might be due to invalid IL or missing references)
27462 //IL_15d8: Unknown result type (might be due to invalid IL or missing references)
27463 //IL_15e1: Unknown result type (might be due to invalid IL or missing references)
27464 //IL_1408: Unknown result type (might be due to invalid IL or missing references)
27465 //IL_1412: Unknown result type (might be due to invalid IL or missing references)
27466 //IL_1417: Unknown result type (might be due to invalid IL or missing references)
27467 //IL_1114: Unknown result type (might be due to invalid IL or missing references)
27468 //IL_1119: Unknown result type (might be due to invalid IL or missing references)
27469 //IL_11be: Unknown result type (might be due to invalid IL or missing references)
27470 //IL_11c3: Unknown result type (might be due to invalid IL or missing references)
27471 //IL_1760: Unknown result type (might be due to invalid IL or missing references)
27472 //IL_1778: Unknown result type (might be due to invalid IL or missing references)
27473 //IL_177e: Unknown result type (might be due to invalid IL or missing references)
27474 //IL_17b1: Unknown result type (might be due to invalid IL or missing references)
27475 //IL_17bb: Unknown result type (might be due to invalid IL or missing references)
27476 //IL_17c0: Unknown result type (might be due to invalid IL or missing references)
27477 //IL_1288: Unknown result type (might be due to invalid IL or missing references)
27478 //IL_128d: Unknown result type (might be due to invalid IL or missing references)
27479 bool flag = wingsLogic != wings;
27480 if (wings == 4)
27481 {
27482 if (wingFlap || jump > 0)
27483 {
27484 rocketDelay2--;
27485 if (rocketDelay2 <= 0)
27486 {
27488 rocketDelay2 = 60;
27489 }
27490 int num = 2;
27491 if (TryingToHoverUp)
27492 {
27493 num = 4;
27494 }
27495 for (int i = 0; i < num; i++)
27496 {
27497 int type = 6;
27498 if (head == 41)
27499 {
27500 _ = body;
27501 }
27502 float scale = 1.75f;
27503 int alpha = 100;
27504 float x = position.X + (float)(width / 2) + 16f;
27505 if (direction > 0)
27506 {
27507 x = position.X + (float)(width / 2) - 26f;
27508 }
27509 float num12 = position.Y + (float)height - 18f;
27510 if (i == 1 || i == 3)
27511 {
27512 x = position.X + (float)(width / 2) + 8f;
27513 if (direction > 0)
27514 {
27515 x = position.X + (float)(width / 2) - 20f;
27516 }
27517 num12 += 6f;
27518 }
27519 if (i > 1)
27520 {
27521 num12 += velocity.Y;
27522 }
27523 int num23 = Dust.NewDust(new Vector2(x, num12), 8, 8, type, 0f, 0f, alpha, default(Color), scale);
27524 Main.dust[num23].velocity.X *= 0.1f;
27525 Main.dust[num23].velocity.Y = Main.dust[num23].velocity.Y * 1f + 2f * gravDir - velocity.Y * 0.3f;
27526 Main.dust[num23].noGravity = true;
27527 Main.dust[num23].noLightEmittence = flag;
27528 Main.dust[num23].shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
27529 if (num == 4)
27530 {
27531 Main.dust[num23].velocity.Y += 6f;
27532 }
27533 }
27535 if (wingFrameCounter > 4)
27536 {
27537 wingFrame++;
27538 wingFrameCounter = 0;
27539 if (wingFrame >= 3)
27540 {
27541 wingFrame = 0;
27542 }
27543 }
27544 }
27545 else if (!controlJump || velocity.Y == 0f)
27546 {
27547 wingFrame = 3;
27548 }
27549 return;
27550 }
27552 {
27553 if (!flag && velocity.Y != 0f)
27554 {
27555 Lighting.AddLight(base.Bottom, 0.3f, 0.1f, 0.4f);
27556 }
27557 return;
27558 }
27559 if (wings == 22)
27560 {
27561 if (!controlJump)
27562 {
27563 wingFrame = 0;
27564 wingFrameCounter = 0;
27565 }
27566 else if (wingTime > 0f)
27567 {
27569 {
27570 if (velocity.X != 0f)
27571 {
27573 int num26 = 2;
27574 if (wingFrameCounter < num26)
27575 {
27576 wingFrame = 1;
27577 return;
27578 }
27579 if (wingFrameCounter < num26 * 2)
27580 {
27581 wingFrame = 2;
27582 return;
27583 }
27584 if (wingFrameCounter < num26 * 3)
27585 {
27586 wingFrame = 3;
27587 return;
27588 }
27589 if (wingFrameCounter < num26 * 4 - 1)
27590 {
27591 wingFrame = 2;
27592 return;
27593 }
27594 wingFrame = 2;
27595 wingFrameCounter = 0;
27596 }
27597 else
27598 {
27600 int num27 = 6;
27601 if (wingFrameCounter < num27)
27602 {
27603 wingFrame = 4;
27604 return;
27605 }
27606 if (wingFrameCounter < num27 * 2)
27607 {
27608 wingFrame = 5;
27609 return;
27610 }
27611 if (wingFrameCounter < num27 * 3 - 1)
27612 {
27613 wingFrame = 4;
27614 return;
27615 }
27616 wingFrame = 4;
27617 wingFrameCounter = 0;
27618 }
27619 }
27620 else
27621 {
27623 int num28 = 2;
27624 if (wingFrameCounter < num28)
27625 {
27626 wingFrame = 4;
27627 return;
27628 }
27629 if (wingFrameCounter < num28 * 2)
27630 {
27631 wingFrame = 5;
27632 return;
27633 }
27634 if (wingFrameCounter < num28 * 3)
27635 {
27636 wingFrame = 6;
27637 return;
27638 }
27639 if (wingFrameCounter < num28 * 4 - 1)
27640 {
27641 wingFrame = 5;
27642 return;
27643 }
27644 wingFrame = 5;
27645 wingFrameCounter = 0;
27646 }
27647 }
27648 else
27649 {
27651 int num29 = 6;
27652 if (wingFrameCounter < num29)
27653 {
27654 wingFrame = 4;
27655 return;
27656 }
27657 if (wingFrameCounter < num29 * 2)
27658 {
27659 wingFrame = 5;
27660 return;
27661 }
27662 if (wingFrameCounter < num29 * 3 - 1)
27663 {
27664 wingFrame = 4;
27665 return;
27666 }
27667 wingFrame = 4;
27668 wingFrameCounter = 0;
27669 }
27670 return;
27671 }
27672 if (wings == 12)
27673 {
27674 if (wingFlap || jump > 0)
27675 {
27677 int num30 = 5;
27678 if (wingFrameCounter < num30)
27679 {
27680 wingFrame = 1;
27681 return;
27682 }
27683 if (wingFrameCounter < num30 * 2)
27684 {
27685 wingFrame = 2;
27686 return;
27687 }
27688 if (wingFrameCounter < num30 * 3)
27689 {
27690 wingFrame = 3;
27691 return;
27692 }
27693 if (wingFrameCounter < num30 * 4 - 1)
27694 {
27695 wingFrame = 2;
27696 return;
27697 }
27698 wingFrame = 2;
27699 wingFrameCounter = 0;
27700 }
27701 else if (velocity.Y != 0f)
27702 {
27703 wingFrame = 2;
27704 }
27705 else
27706 {
27707 wingFrame = 0;
27708 }
27709 return;
27710 }
27711 if (wings == 24)
27712 {
27713 if (wingFlap || jump > 0)
27714 {
27716 int num31 = 1;
27717 if (wingFrameCounter < num31)
27718 {
27719 wingFrame = 1;
27720 return;
27721 }
27722 if (wingFrameCounter < num31 * 2)
27723 {
27724 wingFrame = 2;
27725 return;
27726 }
27727 if (wingFrameCounter < num31 * 3)
27728 {
27729 wingFrame = 3;
27730 return;
27731 }
27732 wingFrame = 2;
27733 if (wingFrameCounter >= num31 * 4 - 1)
27734 {
27735 wingFrameCounter = 0;
27736 }
27737 }
27738 else if (velocity.Y != 0f)
27739 {
27740 if (controlJump)
27741 {
27743 int num2 = 3;
27744 if (wingFrameCounter < num2)
27745 {
27746 wingFrame = 1;
27747 return;
27748 }
27749 if (wingFrameCounter < num2 * 2)
27750 {
27751 wingFrame = 2;
27752 return;
27753 }
27754 if (wingFrameCounter < num2 * 3)
27755 {
27756 wingFrame = 3;
27757 return;
27758 }
27759 wingFrame = 2;
27760 if (wingFrameCounter >= num2 * 4 - 1)
27761 {
27762 wingFrameCounter = 0;
27763 }
27764 }
27765 else if (wingTime == 0f)
27766 {
27767 wingFrame = 0;
27768 }
27769 else
27770 {
27771 wingFrame = 1;
27772 }
27773 }
27774 else
27775 {
27776 wingFrame = 0;
27777 }
27778 return;
27779 }
27780 if (wings == 30)
27781 {
27782 bool flag2 = false;
27783 if (wingFlap || jump > 0)
27784 {
27786 int num3 = 2;
27787 if (wingFrameCounter >= num3 * 3)
27788 {
27789 wingFrameCounter = 0;
27790 }
27792 flag2 = true;
27793 }
27794 else if (velocity.Y != 0f)
27795 {
27796 if (controlJump)
27797 {
27799 int num4 = 2;
27800 if (wingFrameCounter >= num4 * 3)
27801 {
27802 wingFrameCounter = 0;
27803 }
27805 flag2 = true;
27806 }
27807 else if (wingTime == 0f)
27808 {
27809 wingFrame = 0;
27810 }
27811 else
27812 {
27813 wingFrame = 0;
27814 }
27815 }
27816 else
27817 {
27818 wingFrame = 0;
27819 }
27820 if (!flag2)
27821 {
27822 return;
27823 }
27824 for (int j = 0; j < 4; j++)
27825 {
27826 if (Main.rand.Next(4) == 0)
27827 {
27828 Vector2 vector = (-0.74539816f + (float)Math.PI / 8f * (float)j + 0.03f * (float)j).ToRotationVector2() * new Vector2((float)(-direction * 20), 20f);
27829 Dust dust = Main.dust[Dust.NewDust(base.Center, 0, 0, 229, 0f, 0f, 100, Color.White, 0.8f)];
27830 dust.noGravity = true;
27831 dust.noLightEmittence = flag;
27832 dust.position = base.Center + vector;
27833 dust.velocity = DirectionTo(dust.position) * 2f;
27834 if (Main.rand.Next(10) != 0)
27835 {
27836 dust.customData = this;
27837 }
27838 else
27839 {
27840 dust.fadeIn = 0.5f;
27841 }
27842 dust.shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
27843 }
27844 }
27845 for (int k = 0; k < 4; k++)
27846 {
27847 if (Main.rand.Next(8) == 0)
27848 {
27849 Vector2 vector2 = (-0.7053982f + (float)Math.PI / 8f * (float)k + 0.03f * (float)k).ToRotationVector2() * new Vector2((float)(direction * 20), 24f) + new Vector2((float)(-direction) * 16f, 0f);
27850 Dust dust2 = Main.dust[Dust.NewDust(base.Center, 0, 0, 229, 0f, 0f, 100, Color.White, 0.5f)];
27851 dust2.noGravity = true;
27852 dust2.noLightEmittence = flag;
27853 dust2.position = base.Center + vector2;
27854 dust2.velocity = Vector2.Normalize(dust2.position - base.Center - new Vector2((float)(-direction) * 16f, 0f)) * 2f;
27855 dust2.position += dust2.velocity * 5f;
27856 if (Main.rand.Next(10) != 0)
27857 {
27858 dust2.customData = this;
27859 }
27860 else
27861 {
27862 dust2.fadeIn = 0.5f;
27863 }
27864 dust2.shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
27865 }
27866 }
27867 return;
27868 }
27870 {
27871 if (wingFlap || jump > 0)
27872 {
27874 int num5 = 4;
27875 if (wingFrameCounter >= num5 * 6)
27876 {
27877 wingFrameCounter = 0;
27878 }
27880 }
27881 else if (velocity.Y != 0f)
27882 {
27883 if (controlJump)
27884 {
27886 int num6 = 9;
27887 if (wingFrameCounter >= num6 * 6)
27888 {
27889 wingFrameCounter = 0;
27890 }
27892 }
27893 else
27894 {
27896 int num7 = 6;
27897 if (wingFrameCounter >= num7 * 6)
27898 {
27899 wingFrameCounter = 0;
27900 }
27902 }
27903 }
27904 else
27905 {
27907 int num8 = 4;
27908 if (wingFrameCounter >= num8 * 6)
27909 {
27910 wingFrameCounter = 0;
27911 }
27913 }
27914 return;
27915 }
27917 {
27918 if (wingTime > 0f)
27919 {
27920 rocketDelay2--;
27921 if (rocketDelay2 <= 0)
27922 {
27924 rocketDelay2 = 30;
27925 }
27926 }
27927 if (velocity.Y == 0f)
27928 {
27929 wingFrameCounter = 0;
27930 wingFrame = 0;
27931 }
27932 else
27933 {
27935 int num9 = 3;
27936 if (wingTime == 0f)
27937 {
27938 num9 = 5;
27939 }
27940 if (wingFrameCounter >= num9 * 6)
27941 {
27942 wingFrameCounter = 0;
27943 }
27945 }
27946 if (Main.netMode != 2 && Main.rand.Next(8) == 0)
27947 {
27948 Rectangle r = Utils.CenteredRectangle(Main.ReverseGravitySupport(base.Bottom - Main.screenPosition) + Main.screenPosition, new Vector2(40f, 24f));
27949 Dust dust4 = Dust.NewDustDirect(r.TopLeft(), r.Width, r.Height, 43, 0f, 0f, 0, Color.White * 0.5f, 0.2f);
27950 dust4.fadeIn = 0.4f;
27951 dust4.velocity += velocity;
27952 dust4.velocity *= 0.35f;
27953 dust4.shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
27954 }
27955 return;
27956 }
27958 {
27959 int num10 = 5;
27960 if (wingFlap || jump > 0)
27961 {
27963 if (wingFrameCounter >= num10 * 6)
27964 {
27965 wingFrameCounter = 0;
27966 }
27968 }
27969 else if (velocity.Y != 0f)
27970 {
27971 if (controlJump)
27972 {
27973 wingFrame = 2;
27974 }
27975 else if (ShouldFloatInWater && wet)
27976 {
27977 wingFrame = 0;
27978 }
27979 else
27980 {
27981 wingFrame = 3;
27982 }
27983 }
27984 else
27985 {
27987 if (wingFrameCounter >= num10 * 6)
27988 {
27989 wingFrameCounter = 0;
27990 }
27992 }
27993 return;
27994 }
27996 {
27997 if (wingFlap || jump > 0)
27998 {
28000 int num11 = 4;
28001 if (wingFrameCounter >= num11 * 6)
28002 {
28003 wingFrameCounter = 0;
28004 }
28006 }
28007 else if (velocity.Y != 0f)
28008 {
28009 if (controlJump)
28010 {
28012 int num13 = 9;
28013 if (wingFrameCounter >= num13 * 6)
28014 {
28015 wingFrameCounter = 0;
28016 }
28018 }
28019 else
28020 {
28022 int num14 = 6;
28023 if (wingFrameCounter >= num14 * 6)
28024 {
28025 wingFrameCounter = 0;
28026 }
28028 }
28029 }
28030 else
28031 {
28033 int num15 = 4;
28034 if (wingFrameCounter >= num15 * 6)
28035 {
28036 wingFrameCounter = 0;
28037 }
28039 }
28040 int num16 = 1;
28041 if (wingFrame == 3)
28042 {
28043 num16 = 5;
28044 }
28045 if (velocity.Y == 0f)
28046 {
28047 num16 = 0;
28048 }
28049 Rectangle r2 = Utils.CenteredRectangle((gravDir == 1f) ? (base.Bottom + new Vector2(0f, -10f)) : (base.Top + new Vector2(0f, 10f)), new Vector2(50f, 20f));
28050 for (int l = 0; l < num16; l++)
28051 {
28052 Dust dust5 = Dust.NewDustDirect(r2.TopLeft(), r2.Width, r2.Height, 31, 0f, 0f, 0, Color.Black);
28053 dust5.scale = 0.7f;
28054 dust5.velocity *= 0.4f;
28055 dust5.velocity.Y += gravDir * 0.5f;
28056 dust5.shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
28057 }
28058 return;
28059 }
28060 if (wings == 33)
28061 {
28062 bool flag3 = false;
28063 if (wingFlap || jump > 0)
28064 {
28065 flag3 = true;
28066 }
28067 else if (velocity.Y != 0f && controlJump)
28068 {
28069 flag3 = true;
28070 }
28071 if (!flag3)
28072 {
28073 return;
28074 }
28075 Color newColor = Main.hslToRgb(Main.rgbToHsl(eyeColor).X, 1f, 0.5f);
28076 int num17 = ((direction != 1) ? (-4) : 0);
28077 int num18 = ((gravDir == 1f) ? height : 0);
28078 for (int m = 0; m < 2; m++)
28079 {
28080 Dust dust3 = Main.dust[Dust.NewDust(position, width, height, 182, velocity.X, velocity.Y, 127, newColor)];
28081 dust3.noGravity = true;
28082 dust3.fadeIn = 1f;
28083 dust3.scale = 1f;
28084 dust3.noLight = true;
28085 dust3.noLightEmittence = flag;
28086 dust3.shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
28087 switch (m)
28088 {
28089 case 0:
28090 dust3.position = new Vector2(position.X + (float)num17, position.Y + (float)num18);
28091 dust3.velocity.X = dust3.velocity.X * 1f - 2f - velocity.X * 0.3f;
28092 dust3.velocity.Y = dust3.velocity.Y * 1f + 2f * gravDir - velocity.Y * 0.3f;
28093 break;
28094 case 1:
28095 dust3.position = new Vector2(position.X + (float)width + (float)num17, position.Y + (float)num18);
28096 dust3.velocity.X = dust3.velocity.X * 1f + 2f - velocity.X * 0.3f;
28097 dust3.velocity.Y = dust3.velocity.Y * 1f + 2f * gravDir - velocity.Y * 0.3f;
28098 break;
28099 }
28100 if (dust3.dustIndex != 6000)
28101 {
28102 Dust dust6 = Dust.CloneDust(dust3);
28103 dust6.scale *= 0.65f;
28104 dust6.fadeIn *= 0.65f;
28105 dust6.color = new Color(255, 255, 255, 255);
28106 dust3.noLight = true;
28107 dust3.noLightEmittence = flag;
28108 dust3.shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
28109 }
28110 }
28111 return;
28112 }
28113 if (wings == 38)
28114 {
28115 bool flag4 = false;
28116 if (wingFlap || jump > 0)
28117 {
28119 if (wingFrameCounter >= 32)
28120 {
28121 wingFrameCounter = 0;
28122 }
28123 wingFrame = 1 + wingFrameCounter / 8;
28124 if (wingFrame == 4)
28125 {
28126 wingFrame = 2;
28127 }
28128 flag4 = true;
28129 }
28130 else if (velocity.Y != 0f)
28131 {
28132 if (controlJump)
28133 {
28135 if (wingFrameCounter >= 32)
28136 {
28137 wingFrameCounter = 0;
28138 }
28139 wingFrame = 1 + wingFrameCounter / 8;
28140 if (wingFrame == 4)
28141 {
28142 wingFrame = 2;
28143 }
28144 flag4 = true;
28145 }
28146 else
28147 {
28148 wingFrame = 0;
28149 }
28150 }
28151 else
28152 {
28153 wingFrame = 0;
28154 }
28155 if (!flag4)
28156 {
28157 return;
28158 }
28159 Vector2 vector3 = default(Vector2);
28160 ((Vector2)(ref vector3))._002Ector((float)direction, gravDir);
28161 Vector2 value = velocity * 0.5f;
28162 int type2 = 267;
28163 int num19 = miscCounter * direction;
28164 for (int n = 0; n < 3; n++)
28165 {
28166 Vector2 vector4 = Vector2.Zero;
28167 switch (n)
28168 {
28169 case 1:
28170 vector4 = velocity * -0.33f;
28171 break;
28172 case 2:
28173 vector4 = velocity * -0.66f;
28174 break;
28175 }
28176 Vector2 vector5 = new Vector2(-39f, 6f) * vector3 + Utils.RotatedBy(new Vector2(2f, 0f), (float)num19 / -15f * ((float)Math.PI * 2f));
28177 Dust dust7 = Dust.NewDustPerfect(base.Center + vector5 + vector4, type2, value, 0, underShirtColor);
28178 dust7.noGravity = true;
28179 dust7.noLight = true;
28180 dust7.noLightEmittence = flag;
28181 dust7.scale = 0.47f;
28182 dust7.shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
28183 vector5 = new Vector2(-23f, 2f) * vector3 + Utils.RotatedBy(new Vector2(2f, 0f), (float)num19 / -15f * ((float)Math.PI * 2f));
28184 Dust dust8 = Dust.NewDustPerfect(base.Center + vector5 + vector4, type2, value, 0, underShirtColor);
28185 dust8.noGravity = true;
28186 dust8.noLight = true;
28187 dust8.noLightEmittence = flag;
28188 dust8.scale = 0.35f;
28189 dust8.shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
28190 vector5 = new Vector2(-31f, -6f) * vector3 + Utils.RotatedBy(new Vector2(2f, 0f), (float)num19 / -20f * ((float)Math.PI * 2f));
28191 Dust dust9 = Dust.NewDustPerfect(base.Center + vector5 + vector4, type2, value, 0, underShirtColor);
28192 dust9.noGravity = true;
28193 dust9.noLight = true;
28194 dust9.noLightEmittence = flag;
28195 dust9.scale = 0.49f;
28196 dust9.shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
28197 }
28198 return;
28199 }
28200 int num20 = 4;
28201 int num21 = 4;
28202 int num22 = 0;
28203 if (wings == 43)
28204 {
28205 num21 = 7;
28206 num22 = 1;
28207 num20 = 3;
28208 }
28209 if (isCustomWings)
28210 {
28211 return;
28212 }
28213 if (wings == 32)
28214 {
28215 num20 = 3;
28216 }
28217 if (wingFlap || jump > 0)
28218 {
28220 if (wingFrameCounter > num20)
28221 {
28222 wingFrame++;
28223 wingFrameCounter = 0;
28224 if (wingFrame >= num21)
28225 {
28226 wingFrame = num22;
28227 }
28228 }
28229 }
28230 else if (velocity.Y != 0f)
28231 {
28232 wingFrame = 1;
28233 if (wings == 32)
28234 {
28235 wingFrame = 3;
28236 }
28237 if (wings == 43)
28238 {
28239 wingFrame = 2;
28240 if (ShouldFloatInWater && wet)
28241 {
28242 wingFrame = 0;
28243 }
28244 }
28245 if (wings == 29 && Main.rand.Next(5) == 0)
28246 {
28247 int num24 = 4;
28248 if (direction == 1)
28249 {
28250 num24 = -40;
28251 }
28252 int num25 = Dust.NewDust(new Vector2(position.X + (float)(width / 2) + (float)num24, position.Y + (float)(height / 2) - 15f), 30, 30, 6, 0f, 0f, 100, default(Color), 2.4f);
28253 Main.dust[num25].noGravity = true;
28254 Main.dust[num25].noLightEmittence = flag;
28255 Dust obj = Main.dust[num25];
28256 obj.velocity *= 0.3f;
28257 if (Main.rand.Next(10) == 0)
28258 {
28259 Main.dust[num25].fadeIn = 2f;
28260 }
28261 Main.dust[num25].shader = GameShaders.Armor.GetSecondaryShader(cWings, this);
28262 }
28263 }
28264 else
28265 {
28266 wingFrame = 0;
28267 }
28268 }
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 ...
bool wet
The Entity is currently in water. Projectile: Affects movement speed and some projectiles die when ...
Definition Entity.cs:57
Vector2 Top
Definition Entity.cs:121
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
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
Vector2 DirectionTo(Vector2 Destination)
Definition Entity.cs:289
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 Item24
Definition SoundID.cs:725
static readonly SoundStyle Item13
Definition SoundID.cs:703
Color underShirtColor
Definition Player.cs:2723
bool TryingToHoverDown
Definition Player.cs:4275
int wingFrameCounter
Definition Player.cs:1506
bool ShouldFloatInWater
Definition Player.cs:4211
bool ShouldDrawWingsThatAreAlwaysAnimated()
Definition Player.cs:28270
bool TryingToHoverUp
Definition Player.cs:4263

References Terraria.Lighting.AddLight(), Terraria.Graphics.Shaders.GameShaders.Armor, Terraria.Player.body, Terraria.Utils.CenteredRectangle(), Terraria.Dust.CloneDust(), Terraria.Player.controlJump, Terraria.Player.cWings, Terraria.Entity.direction, Terraria.Entity.DirectionTo(), Terraria.Main.dust, Terraria.Player.eyeColor, Terraria.Player.gravDir, Terraria.Player.head, Terraria.Entity.height, Terraria.Main.hslToRgb(), Terraria.ID.SoundID.Item13, Terraria.ID.SoundID.Item24, Terraria.Player.jump, Terraria.Player.miscCounter, Terraria.Main.netMode, Terraria.Dust.NewDust(), Terraria.Dust.NewDustDirect(), Terraria.Dust.NewDustPerfect(), Terraria.Audio.SoundEngine.PlaySound(), Terraria.Dust.position, Terraria.Entity.position, Terraria.Main.rand, Terraria.Main.ReverseGravitySupport(), Terraria.Main.rgbToHsl(), Terraria.Player.rocketDelay2, Terraria.Utils.RotatedBy(), Terraria.Main.screenPosition, Terraria.Player.ShouldDrawWingsThatAreAlwaysAnimated(), Terraria.Player.ShouldFloatInWater, Terraria.Player.TryingToHoverDown, Terraria.Player.TryingToHoverUp, Terraria.Player.underShirtColor, Terraria.Entity.velocity, Terraria.Entity.wet, Terraria.Entity.width, Terraria.Player.wingFrame, Terraria.Player.wingFrameCounter, Terraria.Player.wings, Terraria.Player.wingsLogic, and Terraria.Player.wingTime.

Referenced by Terraria.Player.Update(), and Terraria.GameContent.UI.Elements.UICharacter.UpdateAnim().

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