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

◆ UpdateNPC_TeleportVisuals()

void Terraria.NPC.UpdateNPC_TeleportVisuals ( )
inlineprivate

Definition at line 88895 of file NPC.cs.

88896 {
88897 if (!(teleportTime > 0f))
88898 {
88899 return;
88900 }
88901 if (teleportStyle == 0)
88902 {
88903 if ((float)Main.rand.Next(100) <= 100f * teleportTime * 2f)
88904 {
88905 int num = Dust.NewDust(new Vector2(getRect().X, getRect().Y), getRect().Width, getRect().Height, 159);
88906 Main.dust[num].scale = teleportTime * 1.5f;
88907 Main.dust[num].noGravity = true;
88908 Main.dust[num].velocity *= 1.1f;
88909 }
88910 }
88911 else if (teleportStyle == 4)
88912 {
88913 teleportTime -= 0.02f;
88914 if ((float)Main.rand.Next(100) <= 100f * teleportTime)
88915 {
88916 Dust obj = Main.dust[Dust.NewDust(position, width, height, 263)];
88918 obj.noLight = true;
88919 obj.noGravity = true;
88920 obj.scale = 1.2f;
88921 obj.fadeIn = 0.4f;
88922 }
88923 }
88924 else if (teleportStyle == 12)
88925 {
88926 teleportTime -= 0.02f;
88927 if ((float)Main.rand.Next(100) <= 100f * teleportTime)
88928 {
88929 Dust obj2 = Main.dust[Dust.NewDust(position, width, height, 263)];
88930 obj2.color = Main.hslToRgb((float)(Main.timeForVisualEffects / 60.0) % 1f, 1f, 0.75f, 0);
88931 obj2.noLight = true;
88932 obj2.noGravity = true;
88933 obj2.scale = 1.2f;
88934 obj2.fadeIn = 0.4f;
88935 }
88936 }
88937 else if (teleportStyle == 13)
88938 {
88939 teleportTime = 0f;
88940 }
88941 teleportTime = Math.Max(0f, teleportTime - 0.005f);
88942 }
static byte Max(byte val1, byte val2)
Definition Math.cs:738
Vector2 position
Definition Entity.cs:14
static Color GetPortalColor(int colorIndex)
Rectangle getRect()
Definition NPC.cs:86847
int lastPortalColorIndex
Definition NPC.cs:573
int teleportStyle
Definition NPC.cs:59
float teleportTime
Definition NPC.cs:61

References Terraria.Main.dust, Terraria.GameContent.PortalHelper.GetPortalColor(), Terraria.Main.hslToRgb(), System.Math.Max(), Terraria.Dust.NewDust(), System.obj, Terraria.Main.rand, Terraria.Main.timeForVisualEffects, Microsoft.Xna.Framework.Graphics.Vector2, System.X, and System.Y.