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

◆ SupportedTilesAreFine()

static bool Terraria.GameContent.PortalHelper.SupportedTilesAreFine ( Vector2 portalCenter,
float portalAngle )
inlinestatic

Definition at line 701 of file PortalHelper.cs.

702 {
703 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
704 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
705 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
706 //IL_0152: Unknown result type (might be due to invalid IL or missing references)
707 //IL_0158: Unknown result type (might be due to invalid IL or missing references)
708 //IL_01a6: Unknown result type (might be due to invalid IL or missing references)
709 //IL_01ac: Unknown result type (might be due to invalid IL or missing references)
710 //IL_0165: Unknown result type (might be due to invalid IL or missing references)
711 //IL_016b: Unknown result type (might be due to invalid IL or missing references)
712 //IL_01e3: Unknown result type (might be due to invalid IL or missing references)
713 //IL_01e9: Unknown result type (might be due to invalid IL or missing references)
714 //IL_01b9: Unknown result type (might be due to invalid IL or missing references)
715 //IL_01c1: Unknown result type (might be due to invalid IL or missing references)
716 //IL_017a: Unknown result type (might be due to invalid IL or missing references)
717 //IL_0180: Unknown result type (might be due to invalid IL or missing references)
718 //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
719 //IL_00fd: Unknown result type (might be due to invalid IL or missing references)
720 //IL_01f6: Unknown result type (might be due to invalid IL or missing references)
721 //IL_01fe: Unknown result type (might be due to invalid IL or missing references)
722 //IL_01ce: Unknown result type (might be due to invalid IL or missing references)
723 //IL_01d6: Unknown result type (might be due to invalid IL or missing references)
724 //IL_010c: Unknown result type (might be due to invalid IL or missing references)
725 //IL_0114: Unknown result type (might be due to invalid IL or missing references)
726 //IL_020b: Unknown result type (might be due to invalid IL or missing references)
727 //IL_0213: Unknown result type (might be due to invalid IL or missing references)
728 //IL_0125: Unknown result type (might be due to invalid IL or missing references)
729 //IL_012d: Unknown result type (might be due to invalid IL or missing references)
730 Point point = portalCenter.ToTileCoordinates();
731 int num = (int)Math.Round(MathHelper.WrapAngle(portalAngle) / ((float)Math.PI / 4f));
732 int num7;
733 int num2;
734 int num3;
735 int num6;
736 int num5;
737 switch (num)
738 {
739 case 2:
740 num7 = -1;
741 goto IL_004e;
742 case -2:
743 num7 = 1;
744 goto IL_004e;
745 case 0:
746 case 4:
747 num2 = 0;
748 num3 = ((num == 0) ? 1 : (-1));
749 break;
750 case 3:
751 num6 = -1;
752 goto IL_0068;
753 case -3:
754 num6 = 1;
755 goto IL_0068;
756 case 1:
757 num5 = -1;
758 goto IL_0075;
759 case -1:
760 num5 = 1;
761 goto IL_0075;
762 default:
763 {
764 Main.NewText("Broken portal! (over4s = " + num + " , " + portalAngle + ")");
765 return false;
766 }
767 IL_0075:
768 num2 = num5;
769 num3 = 1;
770 break;
771 IL_0068:
772 num2 = num6;
773 num3 = -1;
774 break;
775 IL_004e:
776 num2 = num7;
777 num3 = 0;
778 break;
779 }
780 if (num2 != 0 && num3 != 0)
781 {
782 int num4 = 3;
783 if (num2 == -1 && num3 == 1)
784 {
785 num4 = 5;
786 }
787 if (num2 == 1 && num3 == -1)
788 {
789 num4 = 2;
790 }
791 if (num2 == 1 && num3 == 1)
792 {
793 num4 = 4;
794 }
795 num4--;
796 if (SupportedSlope(point.X, point.Y, num4) && SupportedSlope(point.X + num2, point.Y - num3, num4))
797 {
798 return SupportedSlope(point.X - num2, point.Y + num3, num4);
799 }
800 return false;
801 }
802 if (num2 != 0)
803 {
804 if (num2 == 1)
805 {
806 point.X--;
807 }
808 if (SupportedNormal(point.X, point.Y) && SupportedNormal(point.X, point.Y - 1))
809 {
810 return SupportedNormal(point.X, point.Y + 1);
811 }
812 return false;
813 }
814 if (num3 != 0)
815 {
816 if (num3 == 1)
817 {
818 point.Y--;
819 }
820 if (!SupportedNormal(point.X, point.Y) || !SupportedNormal(point.X + 1, point.Y) || !SupportedNormal(point.X - 1, point.Y))
821 {
822 if (SupportedHalfbrick(point.X, point.Y) && SupportedHalfbrick(point.X + 1, point.Y))
823 {
824 return SupportedHalfbrick(point.X - 1, point.Y);
825 }
826 return false;
827 }
828 return true;
829 }
830 return true;
831 }
static bool SupportedHalfbrick(int x, int y)
static bool SupportedSlope(int x, int y, int slope)
static bool SupportedNormal(int x, int y)

References Terraria.Main.NewText(), Terraria.GameContent.PortalHelper.SupportedHalfbrick(), Terraria.GameContent.PortalHelper.SupportedNormal(), and Terraria.GameContent.PortalHelper.SupportedSlope().

Referenced by Terraria.GameContent.PortalHelper.AddPortal().

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