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

◆ TeleportationPotion()

void Terraria.Player.TeleportationPotion ( )
inline

Definition at line 52647 of file Player.cs.

52648 {
52649 bool canSpawn = false;
52650 int teleportStartX = 100;
52651 int teleportRangeX = Main.maxTilesX - 200;
52652 int teleportStartY = 100;
52653 int underworldLayer = Main.UnderworldLayer;
52654 Vector2 vector = CheckForGoodTeleportationSpot(ref canSpawn, teleportStartX, teleportRangeX, teleportStartY, underworldLayer, new RandomTeleportationAttemptSettings
52655 {
52656 avoidLava = true,
52657 avoidHurtTiles = true,
52658 maximumFallDistanceFromOrignalPoint = 100,
52659 attemptsBeforeGivingUp = 1000
52660 });
52661 if (canSpawn)
52662 {
52664 Teleport(newPos, 2);
52666 if (Main.netMode == 2)
52667 {
52668 RemoteClient.CheckSection(whoAmI, position);
52669 NetMessage.SendData(65, -1, -1, null, 0, whoAmI, newPos.X, newPos.Y, 2);
52670 }
52671 }
52672 else
52673 {
52675 Teleport(newPos2, 2);
52677 if (Main.netMode == 2)
52678 {
52679 RemoteClient.CheckSection(whoAmI, position);
52680 NetMessage.SendData(65, -1, -1, null, 0, whoAmI, newPos2.X, newPos2.Y, 2, 1);
52681 }
52682 }
52683 }
Vector2 velocity
Definition Entity.cs:16
Vector2 position
Definition Entity.cs:14
void Teleport(Vector2 newPos, int Style=0, int extraInfo=0)
Definition Player.cs:35567
Vector2 CheckForGoodTeleportationSpot(ref bool canSpawn, int teleportStartX, int teleportRangeX, int teleportStartY, int teleportRangeY, RandomTeleportationAttemptSettings settings)
Definition Player.cs:52685

References Terraria.RemoteClient.CheckSection(), Terraria.Main.netMode, Terraria.NetMessage.SendData(), Terraria.Main.UnderworldLayer, and Microsoft.Xna.Framework.Vector2.Zero.