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

◆ ItemCheck_EmitHeldItemLight()

void Terraria.Player.ItemCheck_EmitHeldItemLight ( Item sItem)
inlineprivate

Definition at line 50437 of file Player.cs.

50438 {
50439 //IL_0738: Unknown result type (might be due to invalid IL or missing references)
50440 //IL_073f: Unknown result type (might be due to invalid IL or missing references)
50441 //IL_066a: Unknown result type (might be due to invalid IL or missing references)
50442 //IL_0680: Unknown result type (might be due to invalid IL or missing references)
50443 //IL_0686: Unknown result type (might be due to invalid IL or missing references)
50444 //IL_060b: Unknown result type (might be due to invalid IL or missing references)
50445 //IL_0612: Unknown result type (might be due to invalid IL or missing references)
50446 //IL_053d: Unknown result type (might be due to invalid IL or missing references)
50447 //IL_0553: Unknown result type (might be due to invalid IL or missing references)
50448 //IL_0559: Unknown result type (might be due to invalid IL or missing references)
50449 //IL_06b8: Unknown result type (might be due to invalid IL or missing references)
50450 //IL_06c2: Unknown result type (might be due to invalid IL or missing references)
50451 //IL_06c7: Unknown result type (might be due to invalid IL or missing references)
50452 //IL_06f8: Unknown result type (might be due to invalid IL or missing references)
50453 //IL_06ff: Unknown result type (might be due to invalid IL or missing references)
50454 //IL_0704: Unknown result type (might be due to invalid IL or missing references)
50455 //IL_058b: Unknown result type (might be due to invalid IL or missing references)
50456 //IL_0595: Unknown result type (might be due to invalid IL or missing references)
50457 //IL_059a: Unknown result type (might be due to invalid IL or missing references)
50458 //IL_05cb: Unknown result type (might be due to invalid IL or missing references)
50459 //IL_05d2: Unknown result type (might be due to invalid IL or missing references)
50460 //IL_05d7: Unknown result type (might be due to invalid IL or missing references)
50461 //IL_0e33: Unknown result type (might be due to invalid IL or missing references)
50462 //IL_0e3a: Unknown result type (might be due to invalid IL or missing references)
50463 //IL_0de2: Unknown result type (might be due to invalid IL or missing references)
50464 //IL_0de9: Unknown result type (might be due to invalid IL or missing references)
50465 //IL_0d78: Unknown result type (might be due to invalid IL or missing references)
50466 //IL_0d7f: Unknown result type (might be due to invalid IL or missing references)
50467 //IL_0d30: Unknown result type (might be due to invalid IL or missing references)
50468 //IL_0d37: Unknown result type (might be due to invalid IL or missing references)
50469 //IL_09dc: Unknown result type (might be due to invalid IL or missing references)
50470 //IL_09e3: Unknown result type (might be due to invalid IL or missing references)
50471 //IL_090a: Unknown result type (might be due to invalid IL or missing references)
50472 //IL_0924: Unknown result type (might be due to invalid IL or missing references)
50473 //IL_092a: Unknown result type (might be due to invalid IL or missing references)
50474 //IL_08ab: Unknown result type (might be due to invalid IL or missing references)
50475 //IL_08b2: Unknown result type (might be due to invalid IL or missing references)
50476 //IL_07d9: Unknown result type (might be due to invalid IL or missing references)
50477 //IL_07f3: Unknown result type (might be due to invalid IL or missing references)
50478 //IL_07f9: Unknown result type (might be due to invalid IL or missing references)
50479 //IL_04a0: Unknown result type (might be due to invalid IL or missing references)
50480 //IL_04a7: Unknown result type (might be due to invalid IL or missing references)
50481 //IL_0390: Unknown result type (might be due to invalid IL or missing references)
50482 //IL_03a7: Unknown result type (might be due to invalid IL or missing references)
50483 //IL_03ad: Unknown result type (might be due to invalid IL or missing references)
50484 //IL_033a: Unknown result type (might be due to invalid IL or missing references)
50485 //IL_0341: Unknown result type (might be due to invalid IL or missing references)
50486 //IL_022a: Unknown result type (might be due to invalid IL or missing references)
50487 //IL_0241: Unknown result type (might be due to invalid IL or missing references)
50488 //IL_0247: Unknown result type (might be due to invalid IL or missing references)
50489 //IL_0f03: Unknown result type (might be due to invalid IL or missing references)
50490 //IL_0f0a: Unknown result type (might be due to invalid IL or missing references)
50491 //IL_0ebb: Unknown result type (might be due to invalid IL or missing references)
50492 //IL_0ec2: Unknown result type (might be due to invalid IL or missing references)
50493 //IL_0c98: Unknown result type (might be due to invalid IL or missing references)
50494 //IL_0c9f: Unknown result type (might be due to invalid IL or missing references)
50495 //IL_0bc6: Unknown result type (might be due to invalid IL or missing references)
50496 //IL_0be0: Unknown result type (might be due to invalid IL or missing references)
50497 //IL_0be6: Unknown result type (might be due to invalid IL or missing references)
50498 //IL_0b67: Unknown result type (might be due to invalid IL or missing references)
50499 //IL_0b6e: Unknown result type (might be due to invalid IL or missing references)
50500 //IL_0a95: Unknown result type (might be due to invalid IL or missing references)
50501 //IL_0aaf: Unknown result type (might be due to invalid IL or missing references)
50502 //IL_0ab5: Unknown result type (might be due to invalid IL or missing references)
50503 //IL_095c: Unknown result type (might be due to invalid IL or missing references)
50504 //IL_0966: Unknown result type (might be due to invalid IL or missing references)
50505 //IL_096b: Unknown result type (might be due to invalid IL or missing references)
50506 //IL_099c: Unknown result type (might be due to invalid IL or missing references)
50507 //IL_09a3: Unknown result type (might be due to invalid IL or missing references)
50508 //IL_09a8: Unknown result type (might be due to invalid IL or missing references)
50509 //IL_082b: Unknown result type (might be due to invalid IL or missing references)
50510 //IL_0835: Unknown result type (might be due to invalid IL or missing references)
50511 //IL_083a: Unknown result type (might be due to invalid IL or missing references)
50512 //IL_086b: Unknown result type (might be due to invalid IL or missing references)
50513 //IL_0872: Unknown result type (might be due to invalid IL or missing references)
50514 //IL_0877: Unknown result type (might be due to invalid IL or missing references)
50515 //IL_03df: Unknown result type (might be due to invalid IL or missing references)
50516 //IL_03e9: Unknown result type (might be due to invalid IL or missing references)
50517 //IL_03ee: Unknown result type (might be due to invalid IL or missing references)
50518 //IL_041f: Unknown result type (might be due to invalid IL or missing references)
50519 //IL_0426: Unknown result type (might be due to invalid IL or missing references)
50520 //IL_042b: Unknown result type (might be due to invalid IL or missing references)
50521 //IL_0279: Unknown result type (might be due to invalid IL or missing references)
50522 //IL_0283: Unknown result type (might be due to invalid IL or missing references)
50523 //IL_0288: Unknown result type (might be due to invalid IL or missing references)
50524 //IL_02b9: Unknown result type (might be due to invalid IL or missing references)
50525 //IL_02c0: Unknown result type (might be due to invalid IL or missing references)
50526 //IL_02c5: Unknown result type (might be due to invalid IL or missing references)
50527 //IL_0ff3: Unknown result type (might be due to invalid IL or missing references)
50528 //IL_0ffa: Unknown result type (might be due to invalid IL or missing references)
50529 //IL_0fa2: Unknown result type (might be due to invalid IL or missing references)
50530 //IL_0fa9: Unknown result type (might be due to invalid IL or missing references)
50531 //IL_0c18: Unknown result type (might be due to invalid IL or missing references)
50532 //IL_0c22: Unknown result type (might be due to invalid IL or missing references)
50533 //IL_0c27: Unknown result type (might be due to invalid IL or missing references)
50534 //IL_0c58: Unknown result type (might be due to invalid IL or missing references)
50535 //IL_0c5f: Unknown result type (might be due to invalid IL or missing references)
50536 //IL_0c64: Unknown result type (might be due to invalid IL or missing references)
50537 //IL_0ae7: Unknown result type (might be due to invalid IL or missing references)
50538 //IL_0af1: Unknown result type (might be due to invalid IL or missing references)
50539 //IL_0af6: Unknown result type (might be due to invalid IL or missing references)
50540 //IL_0b27: Unknown result type (might be due to invalid IL or missing references)
50541 //IL_0b2e: Unknown result type (might be due to invalid IL or missing references)
50542 //IL_0b33: Unknown result type (might be due to invalid IL or missing references)
50543 //IL_044d: Unknown result type (might be due to invalid IL or missing references)
50544 //IL_0452: Unknown result type (might be due to invalid IL or missing references)
50545 //IL_02e7: Unknown result type (might be due to invalid IL or missing references)
50546 //IL_02ec: Unknown result type (might be due to invalid IL or missing references)
50547 //IL_1121: Unknown result type (might be due to invalid IL or missing references)
50548 //IL_1128: Unknown result type (might be due to invalid IL or missing references)
50549 //IL_112d: Unknown result type (might be due to invalid IL or missing references)
50550 //IL_10b7: Unknown result type (might be due to invalid IL or missing references)
50551 //IL_10be: Unknown result type (might be due to invalid IL or missing references)
50552 //IL_1066: Unknown result type (might be due to invalid IL or missing references)
50553 //IL_106d: Unknown result type (might be due to invalid IL or missing references)
50554 //IL_0f45: Unknown result type (might be due to invalid IL or missing references)
50555 //IL_11f7: Unknown result type (might be due to invalid IL or missing references)
50556 //IL_11fd: Unknown result type (might be due to invalid IL or missing references)
50557 //IL_1202: Unknown result type (might be due to invalid IL or missing references)
50558 //IL_1207: Unknown result type (might be due to invalid IL or missing references)
50559 //IL_1184: Unknown result type (might be due to invalid IL or missing references)
50560 //IL_1189: Unknown result type (might be due to invalid IL or missing references)
50561 //IL_118a: Unknown result type (might be due to invalid IL or missing references)
50562 //IL_118f: Unknown result type (might be due to invalid IL or missing references)
50563 //IL_1191: Unknown result type (might be due to invalid IL or missing references)
50564 //IL_1193: Unknown result type (might be due to invalid IL or missing references)
50565 //IL_1198: Unknown result type (might be due to invalid IL or missing references)
50566 //IL_119a: Unknown result type (might be due to invalid IL or missing references)
50567 //IL_119c: Unknown result type (might be due to invalid IL or missing references)
50568 //IL_11a1: Unknown result type (might be due to invalid IL or missing references)
50569 //IL_11b0: Unknown result type (might be due to invalid IL or missing references)
50570 //IL_11b7: Unknown result type (might be due to invalid IL or missing references)
50571 //IL_11d0: Unknown result type (might be due to invalid IL or missing references)
50572 //IL_11d2: Unknown result type (might be due to invalid IL or missing references)
50573 //IL_1167: Unknown result type (might be due to invalid IL or missing references)
50574 //IL_116e: Unknown result type (might be due to invalid IL or missing references)
50575 //IL_1173: Unknown result type (might be due to invalid IL or missing references)
50576 //IL_1326: Unknown result type (might be due to invalid IL or missing references)
50577 //IL_1340: Unknown result type (might be due to invalid IL or missing references)
50578 //IL_1345: Unknown result type (might be due to invalid IL or missing references)
50579 //IL_134a: Unknown result type (might be due to invalid IL or missing references)
50580 //IL_135a: Unknown result type (might be due to invalid IL or missing references)
50581 //IL_1364: Unknown result type (might be due to invalid IL or missing references)
50582 //IL_1369: Unknown result type (might be due to invalid IL or missing references)
50583 //IL_136b: Unknown result type (might be due to invalid IL or missing references)
50584 //IL_136e: Unknown result type (might be due to invalid IL or missing references)
50585 //IL_1373: Unknown result type (might be due to invalid IL or missing references)
50586 //IL_1374: Unknown result type (might be due to invalid IL or missing references)
50587 //IL_1375: Unknown result type (might be due to invalid IL or missing references)
50588 //IL_1217: Unknown result type (might be due to invalid IL or missing references)
50589 //IL_1238: Unknown result type (might be due to invalid IL or missing references)
50590 //IL_123e: Unknown result type (might be due to invalid IL or missing references)
50591 //IL_124f: Unknown result type (might be due to invalid IL or missing references)
50592 //IL_1251: Unknown result type (might be due to invalid IL or missing references)
50593 //IL_1259: Unknown result type (might be due to invalid IL or missing references)
50594 //IL_1263: Unknown result type (might be due to invalid IL or missing references)
50595 //IL_1268: Unknown result type (might be due to invalid IL or missing references)
50596 //IL_1284: Unknown result type (might be due to invalid IL or missing references)
50597 //IL_128a: Unknown result type (might be due to invalid IL or missing references)
50598 //IL_128f: Unknown result type (might be due to invalid IL or missing references)
50599 //IL_1294: Unknown result type (might be due to invalid IL or missing references)
50600 //IL_139b: Unknown result type (might be due to invalid IL or missing references)
50601 //IL_13a0: Unknown result type (might be due to invalid IL or missing references)
50602 //IL_13a2: Unknown result type (might be due to invalid IL or missing references)
50603 //IL_13a3: Unknown result type (might be due to invalid IL or missing references)
50604 //IL_13a5: Unknown result type (might be due to invalid IL or missing references)
50605 //IL_13ac: Unknown result type (might be due to invalid IL or missing references)
50606 //IL_13cb: Unknown result type (might be due to invalid IL or missing references)
50607 //IL_13dc: Unknown result type (might be due to invalid IL or missing references)
50608 //IL_13de: Unknown result type (might be due to invalid IL or missing references)
50609 //IL_12a9: Unknown result type (might be due to invalid IL or missing references)
50610 //IL_12bd: Unknown result type (might be due to invalid IL or missing references)
50611 //IL_12c2: Unknown result type (might be due to invalid IL or missing references)
50612 //IL_12c7: Unknown result type (might be due to invalid IL or missing references)
50613 //IL_13ec: Unknown result type (might be due to invalid IL or missing references)
50614 //IL_13ef: Unknown result type (might be due to invalid IL or missing references)
50615 //IL_13f4: Unknown result type (might be due to invalid IL or missing references)
50616 //IL_13fe: Unknown result type (might be due to invalid IL or missing references)
50617 //IL_1403: Unknown result type (might be due to invalid IL or missing references)
50618 Vector2? handPosition = HandPosition;
50620 {
50621 float R = 1f;
50622 float G = 0.95f;
50623 float B = 0.8f;
50624 int num = 0;
50625 int num4 = BiomeTorchHoldStyle(sItem.type);
50626 if (num4 >= ItemID.Count)
50627 {
50628 ItemLoader.GetItem(num4).HoldItem(this);
50629 }
50630 else
50631 {
50632 if (num4 == 523)
50633 {
50634 num = 8;
50635 }
50636 else if (num4 == 974)
50637 {
50638 num = 9;
50639 }
50640 else if (num4 == 1245)
50641 {
50642 num = 10;
50643 }
50644 else if (num4 == 1333)
50645 {
50646 num = 11;
50647 }
50648 else if (num4 == 2274)
50649 {
50650 num = 12;
50651 }
50652 else if (num4 == 3004)
50653 {
50654 num = 13;
50655 }
50656 else if (num4 == 3045)
50657 {
50658 num = 14;
50659 }
50660 else if (num4 == 3114)
50661 {
50662 num = 15;
50663 }
50664 else if (num4 == 4383)
50665 {
50666 num = 16;
50667 }
50668 else if (num4 == 4384)
50669 {
50670 num = 17;
50671 }
50672 else if (num4 == 4385)
50673 {
50674 num = 18;
50675 }
50676 else if (num4 == 4386)
50677 {
50678 num = 19;
50679 }
50680 else if (num4 == 4387)
50681 {
50682 num = 20;
50683 }
50684 else if (num4 == 4388)
50685 {
50686 num = 21;
50687 }
50688 else if (num4 == 5293)
50689 {
50690 num = 22;
50691 }
50692 else if (num4 == 5353)
50693 {
50694 num = 23;
50695 }
50696 else if (num4 >= 427)
50697 {
50698 num = num4 - 426;
50699 }
50700 num = (int)MathHelper.Clamp((float)num, 0f, (float)(TorchID.Count - 1));
50701 TorchID.TorchColor(num, out R, out G, out B);
50702 int num5 = TorchID.Dust[num];
50703 int maxValue = 30;
50704 if (itemAnimation > 0)
50705 {
50706 maxValue = 7;
50707 }
50708 if (direction == -1)
50709 {
50710 if (Main.rand.Next(maxValue) == 0)
50711 {
50712 int num6 = Dust.NewDust(new Vector2(itemLocation.X - 16f, itemLocation.Y - 14f * gravDir), 4, 4, num5, 0f, 0f, 100);
50713 if (Main.rand.Next(3) != 0)
50714 {
50715 Main.dust[num6].noGravity = true;
50716 }
50717 Dust obj = Main.dust[num6];
50718 obj.velocity *= 0.3f;
50719 Main.dust[num6].velocity.Y -= 1.5f;
50720 Main.dust[num6].position = RotatedRelativePoint(Main.dust[num6].position);
50721 if (num5 == 66)
50722 {
50723 Main.dust[num6].color = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB);
50724 Main.dust[num6].noGravity = true;
50725 }
50726 }
50727 Lighting.AddLight(RotatedRelativePoint(new Vector2(itemLocation.X - 12f + velocity.X, itemLocation.Y - 14f + velocity.Y)), R, G, B);
50728 }
50729 else
50730 {
50731 if (Main.rand.Next(maxValue) == 0)
50732 {
50733 int num7 = Dust.NewDust(new Vector2(itemLocation.X + 6f, itemLocation.Y - 14f * gravDir), 4, 4, num5, 0f, 0f, 100);
50734 if (Main.rand.Next(3) != 0)
50735 {
50736 Main.dust[num7].noGravity = true;
50737 }
50738 Dust obj2 = Main.dust[num7];
50739 obj2.velocity *= 0.3f;
50740 Main.dust[num7].velocity.Y -= 1.5f;
50741 Main.dust[num7].position = RotatedRelativePoint(Main.dust[num7].position);
50742 if (num5 == 66)
50743 {
50744 Main.dust[num7].color = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB);
50745 Main.dust[num7].noGravity = true;
50746 }
50747 }
50748 Lighting.AddLight(RotatedRelativePoint(new Vector2(itemLocation.X + 12f + velocity.X, itemLocation.Y - 14f + velocity.Y)), R, G, B);
50749 }
50750 }
50751 }
50752 if ((sItem.type == 105 || sItem.type == 713) && !wet && !pulley)
50753 {
50754 int maxValue2 = 20;
50755 if (itemAnimation > 0)
50756 {
50757 maxValue2 = 7;
50758 }
50759 if (direction == -1)
50760 {
50761 if (Main.rand.Next(maxValue2) == 0)
50762 {
50763 int num8 = Dust.NewDust(new Vector2(itemLocation.X - 12f, itemLocation.Y - 20f * gravDir), 4, 4, 6, 0f, 0f, 100);
50764 if (Main.rand.Next(3) != 0)
50765 {
50766 Main.dust[num8].noGravity = true;
50767 }
50768 Dust obj3 = Main.dust[num8];
50769 obj3.velocity *= 0.3f;
50770 Main.dust[num8].velocity.Y -= 1.5f;
50771 Main.dust[num8].position = RotatedRelativePoint(Main.dust[num8].position);
50772 }
50773 Lighting.AddLight(RotatedRelativePoint(new Vector2(itemLocation.X - 16f + velocity.X, itemLocation.Y - 14f)), 1f, 0.95f, 0.8f);
50774 }
50775 else
50776 {
50777 if (Main.rand.Next(maxValue2) == 0)
50778 {
50779 int num9 = Dust.NewDust(new Vector2(itemLocation.X + 4f, itemLocation.Y - 20f * gravDir), 4, 4, 6, 0f, 0f, 100);
50780 if (Main.rand.Next(3) != 0)
50781 {
50782 Main.dust[num9].noGravity = true;
50783 }
50784 Dust obj4 = Main.dust[num9];
50785 obj4.velocity *= 0.3f;
50786 Main.dust[num9].velocity.Y -= 1.5f;
50787 Main.dust[num9].position = RotatedRelativePoint(Main.dust[num9].position);
50788 }
50789 Lighting.AddLight(RotatedRelativePoint(new Vector2(itemLocation.X + 6f + velocity.X, itemLocation.Y - 14f)), 1f, 0.95f, 0.8f);
50790 }
50791 }
50792 else if (sItem.type == 148 && !wet && !pulley)
50793 {
50794 int maxValue3 = 10;
50795 if (itemAnimation > 0)
50796 {
50797 maxValue3 = 7;
50798 }
50799 if (direction == -1)
50800 {
50801 if (Main.rand.Next(maxValue3) == 0)
50802 {
50803 int num10 = Dust.NewDust(new Vector2(itemLocation.X - 12f, itemLocation.Y - 20f * gravDir), 4, 4, 172, 0f, 0f, 100);
50804 if (Main.rand.Next(3) != 0)
50805 {
50806 Main.dust[num10].noGravity = true;
50807 }
50808 Dust obj5 = Main.dust[num10];
50809 obj5.velocity *= 0.3f;
50810 Main.dust[num10].velocity.Y -= 1.5f;
50811 Main.dust[num10].position = RotatedRelativePoint(Main.dust[num10].position);
50812 }
50813 Lighting.AddLight(RotatedRelativePoint(new Vector2(itemLocation.X - 16f + velocity.X, itemLocation.Y - 14f)), 0f, 0.5f, 1f);
50814 }
50815 else
50816 {
50817 if (Main.rand.Next(maxValue3) == 0)
50818 {
50819 int num11 = Dust.NewDust(new Vector2(itemLocation.X + 4f, itemLocation.Y - 20f * gravDir), 4, 4, 172, 0f, 0f, 100);
50820 if (Main.rand.Next(3) != 0)
50821 {
50822 Main.dust[num11].noGravity = true;
50823 }
50824 Dust obj6 = Main.dust[num11];
50825 obj6.velocity *= 0.3f;
50826 Main.dust[num11].velocity.Y -= 1.5f;
50827 Main.dust[num11].position = RotatedRelativePoint(Main.dust[num11].position);
50828 }
50829 Lighting.AddLight(RotatedRelativePoint(new Vector2(itemLocation.X + 6f + velocity.X, itemLocation.Y - 14f)), 0f, 0.5f, 1f);
50830 }
50831 }
50832 else if (sItem.type == 3117 && !wet && !pulley)
50833 {
50834 itemLocation.X -= direction * 4;
50835 int maxValue4 = 10;
50836 if (itemAnimation > 0)
50837 {
50838 maxValue4 = 7;
50839 }
50840 if (direction == -1)
50841 {
50842 if (Main.rand.Next(maxValue4) == 0)
50843 {
50844 int num2 = Dust.NewDust(new Vector2(itemLocation.X - 10f, itemLocation.Y - 20f * gravDir), 4, 4, 242, 0f, 0f, 100);
50845 if (Main.rand.Next(3) != 0)
50846 {
50847 Main.dust[num2].noGravity = true;
50848 }
50849 Dust obj7 = Main.dust[num2];
50850 obj7.velocity *= 0.3f;
50851 Main.dust[num2].velocity.Y -= 1.5f;
50852 Main.dust[num2].position = RotatedRelativePoint(Main.dust[num2].position);
50853 }
50854 Lighting.AddLight(RotatedRelativePoint(new Vector2(itemLocation.X - 16f + velocity.X, itemLocation.Y - 14f)), 0.9f, 0.1f, 0.75f);
50855 }
50856 else
50857 {
50858 if (Main.rand.Next(maxValue4) == 0)
50859 {
50860 int num3 = Dust.NewDust(new Vector2(itemLocation.X + 6f, itemLocation.Y - 20f * gravDir), 4, 4, 242, 0f, 0f, 100);
50861 if (Main.rand.Next(3) != 0)
50862 {
50863 Main.dust[num3].noGravity = true;
50864 }
50865 Dust obj8 = Main.dust[num3];
50866 obj8.velocity *= 0.3f;
50867 Main.dust[num3].velocity.Y -= 1.5f;
50868 Main.dust[num3].position = RotatedRelativePoint(Main.dust[num3].position);
50869 }
50870 Lighting.AddLight(RotatedRelativePoint(new Vector2(itemLocation.X + 6f + velocity.X, itemLocation.Y - 14f)), 0.9f, 0.1f, 0.75f);
50871 }
50872 }
50873 else if (sItem.type == 5322 && !wet && !pulley)
50874 {
50875 float r = 0.2f;
50876 float g = 0.3f;
50877 float b = 0.32f;
50878 if (direction == -1)
50879 {
50880 Lighting.AddLight(RotatedRelativePoint(new Vector2(itemLocation.X - 16f + velocity.X, itemLocation.Y - 14f)), r, g, b);
50881 }
50882 else
50883 {
50884 Lighting.AddLight(RotatedRelativePoint(new Vector2(itemLocation.X + 6f + velocity.X, itemLocation.Y - 14f)), r, g, b);
50885 }
50886 }
50887 if (sItem.type == 282 && !pulley)
50888 {
50889 if (direction == -1)
50890 {
50891 Lighting.AddLight(RotatedRelativePoint(new Vector2(itemLocation.X - 16f + velocity.X, itemLocation.Y - 14f)), 0.7f, 1f, 0.8f);
50892 }
50893 else
50894 {
50895 Lighting.AddLight(RotatedRelativePoint(new Vector2(itemLocation.X + 6f + velocity.X, itemLocation.Y - 14f)), 0.7f, 1f, 0.8f);
50896 }
50897 }
50898 if (sItem.type == 3002 && !pulley)
50899 {
50900 float r2 = 1.05f;
50901 float g2 = 0.95f;
50902 float b2 = 0.55f;
50903 if (direction == -1)
50904 {
50905 Lighting.AddLight(RotatedRelativePoint(new Vector2(itemLocation.X - 16f + velocity.X, itemLocation.Y - 14f)), r2, g2, b2);
50906 }
50907 else
50908 {
50909 Lighting.AddLight(RotatedRelativePoint(new Vector2(itemLocation.X + 6f + velocity.X, itemLocation.Y - 14f)), r2, g2, b2);
50910 }
50912 if (spelunkerTimer >= 10)
50913 {
50914 spelunkerTimer = 0;
50915 Main.instance.SpelunkerProjectileHelper.AddSpotToCheck(base.Center);
50916 }
50917 }
50918 if (sItem.type == 286 && !pulley)
50919 {
50920 if (direction == -1)
50921 {
50922 Lighting.AddLight(RotatedRelativePoint(new Vector2(itemLocation.X - 16f + velocity.X, itemLocation.Y - 14f)), 0.7f, 0.8f, 1f);
50923 }
50924 else
50925 {
50926 Lighting.AddLight(RotatedRelativePoint(new Vector2(itemLocation.X + 6f + velocity.X, itemLocation.Y - 14f)), 0.7f, 0.8f, 1f);
50927 }
50928 }
50929 if (sItem.type == 3112 && !pulley)
50930 {
50931 if (direction == -1)
50932 {
50933 Lighting.AddLight(RotatedRelativePoint(new Vector2(itemLocation.X - 16f + velocity.X, itemLocation.Y - 14f)), 1f, 0.6f, 0.85f);
50934 }
50935 else
50936 {
50937 Lighting.AddLight(RotatedRelativePoint(new Vector2(itemLocation.X + 6f + velocity.X, itemLocation.Y - 14f)), 1f, 0.6f, 0.85f);
50938 }
50939 }
50940 if (sItem.type == 4776 && !pulley)
50941 {
50942 Vector2 vec = RotatedRelativePoint(new Vector2(itemLocation.X + 6f + velocity.X, itemLocation.Y - 14f));
50943 if (direction == -1)
50944 {
50945 vec = RotatedRelativePoint(new Vector2(itemLocation.X - 16f + velocity.X, itemLocation.Y - 14f));
50946 }
50947 Vector3 rgb = (DelegateMethods.v3_1 = new Vector3(0.9f, 0.35f, 1f));
50948 Point p = vec.ToTileCoordinates();
50949 DelegateMethods.v2_1 = p.ToVector2();
50950 DelegateMethods.f_1 = 4.5f;
50951 Utils.PlotTileArea(p.X, p.Y, DelegateMethods.SpreadLightOpen_StopForSolids);
50952 Lighting.AddLight(vec, rgb);
50953 }
50954 if (sItem.type == 3542 && handPosition.HasValue)
50955 {
50956 Vector2 vector = handPosition.Value - velocity;
50957 for (int i = 0; i < 4; i++)
50958 {
50959 Dust dust = Main.dust[Dust.NewDust(base.Center, 0, 0, 242, direction * 2, 0f, 150, default(Color), 1.3f)];
50960 dust.position = vector;
50961 dust.velocity *= 0f;
50962 dust.noGravity = true;
50963 dust.fadeIn = 1f;
50964 dust.velocity += velocity;
50965 if (Main.rand.Next(2) == 0)
50966 {
50967 dust.position += Utils.RandomVector2(Main.rand, -4f, 4f);
50968 dust.scale += Main.rand.NextFloat();
50969 if (Main.rand.Next(2) == 0)
50970 {
50971 dust.customData = this;
50972 }
50973 }
50974 }
50975 }
50976 if (sItem.type != 4952 || pulley || isPettingAnimal)
50977 {
50978 return;
50979 }
50980 Vector2 pos = itemLocation + new Vector2((float)(8 * direction), -10f * gravDir);
50981 Vector3 rgb2 = new Vector3(1f, 0.7f, 0.8f) * 1.3f;
50982 Vector2 vector2 = RotatedRelativePoint(pos);
50983 Lighting.AddLight(vector2, rgb2);
50984 if (Main.rand.Next(40) == 0)
50985 {
50986 Vector2 vector3 = Main.rand.NextVector2Circular(4f, 4f);
50987 Dust dust2 = Dust.NewDustPerfect(vector2 + vector3, 43, Vector2.Zero, 254, new Color(255, 255, 0, 255), 0.3f);
50988 if (vector3 != Vector2.Zero)
50989 {
50990 dust2.velocity = vector2.DirectionTo(dust2.position) * 0.2f;
50991 }
50992 dust2.fadeIn = 0.3f;
50993 dust2.noLightEmittence = true;
50994 dust2.customData = this;
50995 }
50996 }
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
static bool[] Torches
If true for a given item type (F:Terraria.Item.type), then that item is a torch. Torches can be aut...
Definition ItemID.cs:1539
static bool[] WaterTorches
If true for a given item type (F:Terraria.Item.type), then that item is a water torch....
Definition ItemID.cs:1546
static readonly short Count
Definition ItemID.cs:12719
static readonly short Count
Definition TorchID.cs:132
static int[] Dust
Definition TorchID.cs:75
static void TorchColor(int torchID, out float R, out float G, out float B)
Definition TorchID.cs:164
static ModItem GetItem(int type)
Gets the ModItem template instance corresponding to the specified type (not the clone/new instance wh...
This serves as the central class from which item-related functions are carried out....
Definition ItemLoader.cs:26
byte spelunkerTimer
Definition Player.cs:1003
bool happyFunTorchTime
Definition Player.cs:3185
bool isPettingAnimal
Definition Player.cs:3005
int BiomeTorchHoldStyle(int style)
Definition Player.cs:39003
Vector2? HandPosition
Definition Player.cs:4474
Vector2 RotatedRelativePoint(Vector2 pos, bool reverseRotation=false, bool addGfxOffY=true)
Takes an input position and returns the position adjusted to the players visual rotation and offset....
Definition Player.cs:4740
Vector2 itemLocation
Definition Player.cs:1670

References Terraria.Lighting.AddLight(), Terraria.Player.BiomeTorchHoldStyle(), Terraria.ID.ItemID.Count, Terraria.ID.TorchID.Count, Terraria.Entity.direction, Terraria.Main.DiscoB, Terraria.Main.DiscoG, Terraria.Main.DiscoR, Terraria.ID.TorchID.Dust, Terraria.Main.dust, Terraria.ModLoader.ItemLoader.GetItem(), Terraria.Player.gravDir, Terraria.Player.HandPosition, Terraria.Player.happyFunTorchTime, Terraria.Main.instance, Terraria.Player.isPettingAnimal, Terraria.Player.itemAnimation, Terraria.Player.itemLocation, Terraria.Dust.NewDust(), Terraria.Dust.NewDustPerfect(), Terraria.Utils.PlotTileArea(), Terraria.Player.pulley, Terraria.Main.rand, Terraria.Utils.RandomVector2(), Terraria.Player.RotatedRelativePoint(), Terraria.Player.spelunkerTimer, Terraria.DelegateMethods.SpreadLightOpen_StopForSolids(), Terraria.ID.TorchID.TorchColor(), Terraria.ID.ItemID.Sets.Torches, Terraria.Entity.velocity, Terraria.ID.ItemID.Sets.WaterTorches, and Terraria.Entity.wet.

Referenced by Terraria.Player.ItemCheck_Inner().

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