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

◆ UpdateTeleportVisuals()

void Terraria.Player.UpdateTeleportVisuals ( )
inline

Definition at line 15939 of file Player.cs.

15940 {
15941 if (!(teleportTime > 0f))
15942 {
15943 return;
15944 }
15945 if (teleportStyle == 0)
15946 {
15947 if ((float)Main.rand.Next(100) <= 100f * teleportTime * 2f)
15948 {
15949 int num = Dust.NewDust(new Vector2(getRect().X, getRect().Y), getRect().Width, getRect().Height, 159);
15950 Main.dust[num].scale = teleportTime * 1.5f;
15951 Main.dust[num].noGravity = true;
15952 Main.dust[num].velocity *= 1.1f;
15953 }
15954 }
15955 else if (teleportStyle == 1)
15956 {
15957 if ((float)Main.rand.Next(100) <= 100f * teleportTime)
15958 {
15959 int num2 = Dust.NewDust(new Vector2(getRect().X, getRect().Y), getRect().Width, getRect().Height, 164);
15960 Main.dust[num2].scale = teleportTime * 1.5f;
15961 Main.dust[num2].noGravity = true;
15962 Main.dust[num2].velocity *= 1.1f;
15963 }
15964 }
15965 else if (teleportStyle == 2)
15966 {
15967 teleportTime = 0.005f;
15968 }
15969 else if (teleportStyle == 3)
15970 {
15971 teleportTime = 0.005f;
15972 }
15973 else if (teleportStyle == 4)
15974 {
15975 teleportTime -= 0.02f;
15976 if ((float)Main.rand.Next(100) <= 100f * teleportTime)
15977 {
15978 Dust obj = Main.dust[Dust.NewDust(position, width, height, 263)];
15980 obj.noLight = true;
15981 obj.noGravity = true;
15982 obj.scale = 1.2f;
15983 obj.fadeIn = 0.4f;
15984 }
15985 }
15986 else if (teleportStyle == 9)
15987 {
15988 Rectangle hitbox = base.Hitbox;
15989 hitbox.Inflate(5, 5);
15990 if ((float)Main.rand.Next(100) <= 100f * teleportTime)
15991 {
15993 }
15994 }
15995 teleportTime -= 0.005f;
15996 }
Vector2 position
Definition Entity.cs:14
static Color GetPortalColor(int colorIndex)
static void SpawnInWorldDust(int tileStyle, Rectangle dustBox)
int lastPortalColorIndex
Definition Player.cs:2549
int teleportStyle
Definition Player.cs:779
int lastTeleportPylonStyleUsed
Definition Player.cs:2555
Rectangle getRect()
Definition Player.cs:40162
float teleportTime
Definition Player.cs:777

References Terraria.Main.dust, Terraria.GameContent.PortalHelper.GetPortalColor(), Terraria.Dust.NewDust(), System.obj, Terraria.Main.rand, Terraria.GameContent.TeleportPylonsSystem.SpawnInWorldDust(), System.X, and System.Y.