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

◆ TeleportEffect()

static void Terraria.Main.TeleportEffect ( Rectangle effectRect,
int Style,
int extraInfo = 0,
float dustCountMult = 1f,
TeleportationSide side = TeleportationSide::Entry,
Vector2 otherPosition = default(Vector2) )
inlinestatic

Definition at line 12759 of file Main.cs.

12760 {
12761 //IL_0049: Unknown result type (might be due to invalid IL or missing references)
12762 //IL_004f: Unknown result type (might be due to invalid IL or missing references)
12763 //IL_0058: Unknown result type (might be due to invalid IL or missing references)
12764 //IL_005e: Unknown result type (might be due to invalid IL or missing references)
12765 //IL_006d: Unknown result type (might be due to invalid IL or missing references)
12766 //IL_0073: Unknown result type (might be due to invalid IL or missing references)
12767 //IL_013d: Unknown result type (might be due to invalid IL or missing references)
12768 //IL_0143: Unknown result type (might be due to invalid IL or missing references)
12769 //IL_014c: Unknown result type (might be due to invalid IL or missing references)
12770 //IL_0152: Unknown result type (might be due to invalid IL or missing references)
12771 //IL_0161: Unknown result type (might be due to invalid IL or missing references)
12772 //IL_0167: Unknown result type (might be due to invalid IL or missing references)
12773 //IL_02b5: Unknown result type (might be due to invalid IL or missing references)
12774 //IL_02bb: Unknown result type (might be due to invalid IL or missing references)
12775 //IL_02c4: Unknown result type (might be due to invalid IL or missing references)
12776 //IL_02ca: Unknown result type (might be due to invalid IL or missing references)
12777 //IL_0481: Unknown result type (might be due to invalid IL or missing references)
12778 //IL_0487: Unknown result type (might be due to invalid IL or missing references)
12779 //IL_0490: Unknown result type (might be due to invalid IL or missing references)
12780 //IL_0496: Unknown result type (might be due to invalid IL or missing references)
12781 //IL_04a5: Unknown result type (might be due to invalid IL or missing references)
12782 //IL_04ab: Unknown result type (might be due to invalid IL or missing references)
12783 //IL_0550: Unknown result type (might be due to invalid IL or missing references)
12784 //IL_0551: Unknown result type (might be due to invalid IL or missing references)
12785 //IL_0556: Unknown result type (might be due to invalid IL or missing references)
12786 //IL_0625: Unknown result type (might be due to invalid IL or missing references)
12787 //IL_0626: Unknown result type (might be due to invalid IL or missing references)
12788 //IL_062b: Unknown result type (might be due to invalid IL or missing references)
12789 //IL_076b: Unknown result type (might be due to invalid IL or missing references)
12790 //IL_076d: Unknown result type (might be due to invalid IL or missing references)
12791 //IL_076e: Unknown result type (might be due to invalid IL or missing references)
12792 //IL_0773: Unknown result type (might be due to invalid IL or missing references)
12793 //IL_0778: Unknown result type (might be due to invalid IL or missing references)
12794 //IL_0a23: Unknown result type (might be due to invalid IL or missing references)
12795 //IL_0a28: Unknown result type (might be due to invalid IL or missing references)
12796 //IL_008a: Unknown result type (might be due to invalid IL or missing references)
12797 //IL_0091: Unknown result type (might be due to invalid IL or missing references)
12798 //IL_0098: Unknown result type (might be due to invalid IL or missing references)
12799 //IL_009d: Unknown result type (might be due to invalid IL or missing references)
12800 //IL_00a3: Unknown result type (might be due to invalid IL or missing references)
12801 //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
12802 //IL_00c1: Unknown result type (might be due to invalid IL or missing references)
12803 //IL_0182: Unknown result type (might be due to invalid IL or missing references)
12804 //IL_0189: Unknown result type (might be due to invalid IL or missing references)
12805 //IL_0190: Unknown result type (might be due to invalid IL or missing references)
12806 //IL_0195: Unknown result type (might be due to invalid IL or missing references)
12807 //IL_019b: Unknown result type (might be due to invalid IL or missing references)
12808 //IL_01b3: Unknown result type (might be due to invalid IL or missing references)
12809 //IL_01b9: Unknown result type (might be due to invalid IL or missing references)
12810 //IL_0249: Unknown result type (might be due to invalid IL or missing references)
12811 //IL_0250: Unknown result type (might be due to invalid IL or missing references)
12812 //IL_0257: Unknown result type (might be due to invalid IL or missing references)
12813 //IL_025c: Unknown result type (might be due to invalid IL or missing references)
12814 //IL_0262: Unknown result type (might be due to invalid IL or missing references)
12815 //IL_0279: Unknown result type (might be due to invalid IL or missing references)
12816 //IL_028a: Unknown result type (might be due to invalid IL or missing references)
12817 //IL_0294: Unknown result type (might be due to invalid IL or missing references)
12818 //IL_0299: Unknown result type (might be due to invalid IL or missing references)
12819 //IL_02eb: Unknown result type (might be due to invalid IL or missing references)
12820 //IL_02f2: Unknown result type (might be due to invalid IL or missing references)
12821 //IL_02f9: Unknown result type (might be due to invalid IL or missing references)
12822 //IL_02fe: Unknown result type (might be due to invalid IL or missing references)
12823 //IL_0304: Unknown result type (might be due to invalid IL or missing references)
12824 //IL_031c: Unknown result type (might be due to invalid IL or missing references)
12825 //IL_0322: Unknown result type (might be due to invalid IL or missing references)
12826 //IL_04cb: Unknown result type (might be due to invalid IL or missing references)
12827 //IL_04cc: Unknown result type (might be due to invalid IL or missing references)
12828 //IL_04d1: Unknown result type (might be due to invalid IL or missing references)
12829 //IL_04d7: Unknown result type (might be due to invalid IL or missing references)
12830 //IL_04ef: Unknown result type (might be due to invalid IL or missing references)
12831 //IL_04f5: Unknown result type (might be due to invalid IL or missing references)
12832 //IL_0503: Unknown result type (might be due to invalid IL or missing references)
12833 //IL_0508: Unknown result type (might be due to invalid IL or missing references)
12834 //IL_056a: Unknown result type (might be due to invalid IL or missing references)
12835 //IL_056c: Unknown result type (might be due to invalid IL or missing references)
12836 //IL_0572: Unknown result type (might be due to invalid IL or missing references)
12837 //IL_058d: Unknown result type (might be due to invalid IL or missing references)
12838 //IL_0593: Unknown result type (might be due to invalid IL or missing references)
12839 //IL_0614: Unknown result type (might be due to invalid IL or missing references)
12840 //IL_0619: Unknown result type (might be due to invalid IL or missing references)
12841 //IL_063f: Unknown result type (might be due to invalid IL or missing references)
12842 //IL_0641: Unknown result type (might be due to invalid IL or missing references)
12843 //IL_0647: Unknown result type (might be due to invalid IL or missing references)
12844 //IL_065f: Unknown result type (might be due to invalid IL or missing references)
12845 //IL_0665: Unknown result type (might be due to invalid IL or missing references)
12846 //IL_06e9: Unknown result type (might be due to invalid IL or missing references)
12847 //IL_06ee: Unknown result type (might be due to invalid IL or missing references)
12848 //IL_071b: Unknown result type (might be due to invalid IL or missing references)
12849 //IL_0739: Unknown result type (might be due to invalid IL or missing references)
12850 //IL_0745: Unknown result type (might be due to invalid IL or missing references)
12851 //IL_07cb: Unknown result type (might be due to invalid IL or missing references)
12852 //IL_07d0: Unknown result type (might be due to invalid IL or missing references)
12853 //IL_07d2: Unknown result type (might be due to invalid IL or missing references)
12854 //IL_07d3: Unknown result type (might be due to invalid IL or missing references)
12855 //IL_07d8: Unknown result type (might be due to invalid IL or missing references)
12856 //IL_07de: Unknown result type (might be due to invalid IL or missing references)
12857 //IL_07f5: Unknown result type (might be due to invalid IL or missing references)
12858 //IL_091f: Unknown result type (might be due to invalid IL or missing references)
12859 //IL_092b: Unknown result type (might be due to invalid IL or missing references)
12860 //IL_0951: Unknown result type (might be due to invalid IL or missing references)
12861 //IL_0956: Unknown result type (might be due to invalid IL or missing references)
12862 //IL_0a46: Unknown result type (might be due to invalid IL or missing references)
12863 //IL_0a47: Unknown result type (might be due to invalid IL or missing references)
12864 //IL_0a5e: Unknown result type (might be due to invalid IL or missing references)
12865 //IL_0a64: Unknown result type (might be due to invalid IL or missing references)
12866 //IL_0a82: Unknown result type (might be due to invalid IL or missing references)
12867 //IL_0a8c: Unknown result type (might be due to invalid IL or missing references)
12868 //IL_0a91: Unknown result type (might be due to invalid IL or missing references)
12869 //IL_0983: Unknown result type (might be due to invalid IL or missing references)
12870 //IL_0988: Unknown result type (might be due to invalid IL or missing references)
12871 //IL_098c: Unknown result type (might be due to invalid IL or missing references)
12872 //IL_0991: Unknown result type (might be due to invalid IL or missing references)
12873 //IL_0aa5: Unknown result type (might be due to invalid IL or missing references)
12874 //IL_0aaf: Unknown result type (might be due to invalid IL or missing references)
12875 //IL_0ab4: Unknown result type (might be due to invalid IL or missing references)
12876 //IL_0998: Unknown result type (might be due to invalid IL or missing references)
12877 //IL_0999: Unknown result type (might be due to invalid IL or missing references)
12878 //IL_09b0: Unknown result type (might be due to invalid IL or missing references)
12879 //IL_09b6: Unknown result type (might be due to invalid IL or missing references)
12880 //IL_09c9: Unknown result type (might be due to invalid IL or missing references)
12881 //IL_09cb: Unknown result type (might be due to invalid IL or missing references)
12882 //IL_09d2: Unknown result type (might be due to invalid IL or missing references)
12883 //IL_09dc: Unknown result type (might be due to invalid IL or missing references)
12884 //IL_09e1: Unknown result type (might be due to invalid IL or missing references)
12885 //IL_0358: Unknown result type (might be due to invalid IL or missing references)
12886 //IL_0362: Unknown result type (might be due to invalid IL or missing references)
12887 //IL_0367: Unknown result type (might be due to invalid IL or missing references)
12888 //IL_038d: Unknown result type (might be due to invalid IL or missing references)
12889 //IL_0397: Unknown result type (might be due to invalid IL or missing references)
12890 //IL_039c: Unknown result type (might be due to invalid IL or missing references)
12891 //IL_0861: Unknown result type (might be due to invalid IL or missing references)
12892 //IL_0866: Unknown result type (might be due to invalid IL or missing references)
12893 //IL_086d: Unknown result type (might be due to invalid IL or missing references)
12894 //IL_087c: Unknown result type (might be due to invalid IL or missing references)
12895 //IL_0881: Unknown result type (might be due to invalid IL or missing references)
12896 //IL_0886: Unknown result type (might be due to invalid IL or missing references)
12897 //IL_03d0: Unknown result type (might be due to invalid IL or missing references)
12898 //IL_03da: Unknown result type (might be due to invalid IL or missing references)
12899 //IL_03df: Unknown result type (might be due to invalid IL or missing references)
12900 //IL_08fa: Unknown result type (might be due to invalid IL or missing references)
12901 //IL_08ff: Unknown result type (might be due to invalid IL or missing references)
12902 switch (Style)
12903 {
12904 case 0:
12905 {
12907 int num12 = effectRect.Width * effectRect.Height / 5;
12908 num12 = (int)((float)num12 * dustCountMult);
12909 for (int j = 0; j < num12; j++)
12910 {
12911 int num14 = Dust.NewDust(new Vector2((float)effectRect.X, (float)effectRect.Y), effectRect.Width, effectRect.Height, 159);
12912 Main.dust[num14].scale = (float)rand.Next(20, 70) * 0.01f;
12913 if (j < 10)
12914 {
12915 Main.dust[num14].scale += 0.25f;
12916 }
12917 if (j < 5)
12918 {
12919 Main.dust[num14].scale += 0.25f;
12920 }
12921 }
12922 break;
12923 }
12924 case 1:
12925 {
12927 int num2 = effectRect.Width * effectRect.Height / 5;
12928 num2 = (int)((float)num2 * dustCountMult);
12929 for (int num3 = 0; num3 < num2; num3++)
12930 {
12931 int num4 = Dust.NewDust(new Vector2((float)effectRect.X, (float)effectRect.Y), effectRect.Width, effectRect.Height, 164);
12932 Main.dust[num4].scale = (float)rand.Next(20, 70) * 0.01f;
12933 if (num3 < 10)
12934 {
12935 Main.dust[num4].scale += 0.25f;
12936 }
12937 if (num3 < 5)
12938 {
12939 Main.dust[num4].scale += 0.25f;
12940 }
12941 }
12942 break;
12943 }
12944 case 2:
12945 {
12946 int num7 = (int)(50f * dustCountMult);
12947 for (int num8 = 0; num8 < num7; num8++)
12948 {
12949 Dust obj9 = Main.dust[Dust.NewDust(new Vector2((float)effectRect.X, (float)effectRect.Y), effectRect.Width, effectRect.Height, 58, 0f, 0f, 150, Color.GhostWhite, 1.2f)];
12950 obj9.velocity *= 0.5f;
12951 }
12952 break;
12953 }
12954 case 3:
12955 {
12957 int num16 = (int)(50f * dustCountMult);
12958 for (int l = 0; l < num16; l++)
12959 {
12960 int num17 = Dust.NewDust(new Vector2((float)effectRect.X, (float)effectRect.Y), effectRect.Width, effectRect.Height, 180);
12961 Main.dust[num17].noGravity = true;
12962 for (int m = 0; m < 5; m++)
12963 {
12964 if (rand.Next(3) == 0)
12965 {
12966 Dust obj4 = Main.dust[num17];
12967 obj4.velocity *= 0.75f;
12968 }
12969 }
12970 if (rand.Next(3) == 0)
12971 {
12972 Dust obj5 = Main.dust[num17];
12973 obj5.velocity *= 2f;
12974 Main.dust[num17].scale *= 1.2f;
12975 }
12976 if (rand.Next(3) == 0)
12977 {
12978 Dust obj6 = Main.dust[num17];
12979 obj6.velocity *= 2f;
12980 Main.dust[num17].scale *= 1.2f;
12981 }
12982 if (rand.Next(2) == 0)
12983 {
12984 Main.dust[num17].fadeIn = (float)rand.Next(75, 100) * 0.01f;
12985 Main.dust[num17].scale = (float)rand.Next(25, 75) * 0.01f;
12986 }
12987 Main.dust[num17].scale *= 0.8f;
12988 }
12989 break;
12990 }
12991 case 4:
12992 {
12994 int num9 = effectRect.Width * effectRect.Height / 5;
12995 num9 = (int)((float)num9 * dustCountMult);
12996 for (int num10 = 0; num10 < num9; num10++)
12997 {
12998 Dust obj10 = Main.dust[Dust.NewDust(effectRect.TopLeft(), effectRect.Width, effectRect.Height, 263)];
12999 obj10.color = PortalHelper.GetPortalColor(extraInfo);
13000 obj10.noLight = true;
13001 obj10.noGravity = true;
13002 obj10.scale = 1.2f;
13003 obj10.fadeIn = 0.4f;
13004 ((Color)(ref obj10.color)).A = byte.MaxValue;
13005 }
13006 break;
13007 }
13008 case 5:
13009 {
13010 Vector2 position = effectRect.TopLeft();
13011 int num19 = (int)(100f * dustCountMult);
13012 for (int num20 = 0; num20 < num19; num20++)
13013 {
13014 Dust obj8 = Dust.NewDustDirect(position, effectRect.Width, effectRect.Height + 24, Dust.dustWater());
13015 obj8.velocity.Y *= 0f;
13016 obj8.velocity.Y -= 3.5f;
13017 obj8.velocity.X *= 1.5f;
13018 obj8.scale = 0.8f;
13019 obj8.alpha = 130;
13020 obj8.noGravity = true;
13021 obj8.fadeIn = 1.2f;
13022 }
13023 SoundEngine.PlaySound(19, ((Rectangle)(ref effectRect)).Center.ToVector2(), 0);
13024 break;
13025 }
13026 case 7:
13027 {
13028 Vector2 position2 = effectRect.TopLeft();
13029 int num11 = (int)(50f * dustCountMult);
13030 for (int num13 = 0; num13 < num11; num13++)
13031 {
13032 Dust obj11 = Dust.NewDustDirect(position2, effectRect.Width, effectRect.Height + 24, 35);
13033 obj11.velocity.Y *= 0f;
13034 obj11.velocity.Y -= 3.5f;
13035 obj11.velocity.X *= 1.5f;
13036 obj11.scale = 0.8f;
13037 obj11.alpha = 130;
13038 obj11.noGravity = true;
13039 obj11.fadeIn = 1.2f;
13040 }
13041 SoundEngine.PlaySound(in SoundID.Item8, ((Rectangle)(ref effectRect)).Center.ToVector2());
13042 break;
13043 }
13044 case 9:
13045 {
13046 ((Rectangle)(ref effectRect)).Inflate(15, 15);
13047 int num5 = (int)(100f * dustCountMult);
13048 for (int num6 = 0; num6 < num5; num6++)
13049 {
13051 }
13052 SoundEngine.PlaySound(SoundID.Item6, ((Rectangle)(ref effectRect)).Center.X, ((Rectangle)(ref effectRect)).Center.Y);
13053 break;
13054 }
13055 case 10:
13056 {
13057 ((Rectangle)(ref effectRect)).Inflate(15, 15);
13058 int num18 = (int)(60f * dustCountMult);
13059 Vector2 vector = otherPosition - effectRect.TopLeft();
13060 for (int n = 0; n < num18; n++)
13061 {
13062 float fadeIn = 0.4f + rand.NextFloat();
13063 float scale = 0.4f + rand.NextFloat();
13064 Color newColor = hslToRgb(0.66f + rand.NextFloat() * 0.24f, 1f, 0.5f);
13065 Dust dust = Dust.NewDustDirect(effectRect.TopLeft(), effectRect.Width, effectRect.Height, 267, 0f, 0f, 127, newColor);
13066 dust.scale = (float)rand.Next(20, 70) * 0.01f;
13067 if (n < 10)
13068 {
13069 dust.scale += 0.25f;
13070 }
13071 if (n < 5)
13072 {
13073 dust.scale += 0.25f;
13074 }
13075 if ((float)n < (float)num18 * 0.8f)
13076 {
13077 dust.velocity += vector * 0.1f * rand.NextFloat();
13078 }
13079 dust.noGravity = true;
13080 dust.noLight = true;
13081 dust.scale = scale;
13082 dust.fadeIn = fadeIn;
13083 if (dust.dustIndex != 6000)
13084 {
13085 Dust obj7 = Dust.CloneDust(dust);
13086 obj7.scale *= 0.65f;
13087 obj7.fadeIn *= 0.65f;
13088 obj7.color = new Color(255, 255, 255, 255);
13089 }
13090 }
13091 SoundEngine.PlaySound(SoundID.Item8, ((Rectangle)(ref effectRect)).Center.X, ((Rectangle)(ref effectRect)).Center.Y);
13092 break;
13093 }
13094 case 11:
13095 {
13096 for (int k = 0; k < 50; k++)
13097 {
13098 int num15 = rand.Next(4);
13099 Color color = Color.Green;
13100 switch (num15)
13101 {
13102 case 0:
13103 case 1:
13104 ((Color)(ref color))._002Ector(100, 255, 100);
13105 break;
13106 case 2:
13107 color = Color.Yellow;
13108 break;
13109 case 3:
13110 color = Color.White;
13111 break;
13112 }
13113 Dust obj3 = Dust.NewDustPerfect(rand.NextVector2FromRectangle(effectRect), 267);
13114 obj3.noGravity = true;
13115 obj3.color = color;
13116 obj3.velocity *= 2f;
13117 obj3.scale = 0.8f + rand.NextFloat() * 0.6f;
13118 obj3.fadeIn = 0.5f;
13119 }
13120 break;
13121 }
13122 case 13:
13123 {
13124 SoundEngine.PlaySound(in SoundID.Item8, ((Rectangle)(ref effectRect)).Center.ToVector2());
13125 for (int i = 0; i < 21; i++)
13126 {
13127 int num = Dust.NewDust(rand.NextVector2FromRectangle(effectRect), 2, 2, 27, 0f, 0f, 100, default(Color), rand.Next(1, 3));
13128 Dust obj = Main.dust[num];
13129 obj.velocity *= 1.75f;
13130 if (i % 3 == 0)
13131 {
13132 Dust obj2 = Main.dust[num];
13133 obj2.velocity *= 1.5f;
13134 }
13135 Main.dust[num].noLightEmittence = true;
13136 Main.dust[num].noGravity = true;
13137 }
13138 break;
13139 }
13140 case 6:
13141 case 8:
13142 case 12:
13143 break;
13144 }
13145 }
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 Color GetPortalColor(int colorIndex)
static void SpawnInWorldDust(int tileStyle, Rectangle dustBox)
static readonly SoundStyle Item6
Definition SoundID.cs:689
static readonly SoundStyle Item8
Definition SoundID.cs:693
static Color hslToRgb(Vector3 hslVector)
Definition Main.cs:61847
static UnifiedRandom rand
Definition Main.cs:2758
static Dust[] dust
Definition Main.cs:1822

References Terraria.Dust.CloneDust(), Terraria.Graphics.Light.Color, Terraria.Main.dust, Terraria.Dust.dustWater(), Terraria.GameContent.PortalHelper.GetPortalColor(), Terraria.Main.hslToRgb(), Terraria.ID.SoundID.Item6, Terraria.ID.SoundID.Item8, Terraria.Dust.NewDust(), Terraria.Dust.NewDustDirect(), Terraria.Dust.NewDustPerfect(), Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.rand, and Terraria.GameContent.TeleportPylonsSystem.SpawnInWorldDust().

Referenced by Terraria.NPC.Teleport(), and Terraria.Player.Teleport().

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