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

◆ TeleportationPotion()

void Terraria.Player.TeleportationPotion ( )
inline

Definition at line 57003 of file Player.cs.

57004 {
57005 //IL_0049: Unknown result type (might be due to invalid IL or missing references)
57006 //IL_004e: Unknown result type (might be due to invalid IL or missing references)
57007 //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
57008 //IL_00b3: Unknown result type (might be due to invalid IL or missing references)
57009 //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
57010 //IL_00c0: Unknown result type (might be due to invalid IL or missing references)
57011 //IL_00c5: Unknown result type (might be due to invalid IL or missing references)
57012 //IL_0053: Unknown result type (might be due to invalid IL or missing references)
57013 //IL_0055: Unknown result type (might be due to invalid IL or missing references)
57014 //IL_0058: Unknown result type (might be due to invalid IL or missing references)
57015 //IL_0062: Unknown result type (might be due to invalid IL or missing references)
57016 //IL_0067: Unknown result type (might be due to invalid IL or missing references)
57017 //IL_00d9: Unknown result type (might be due to invalid IL or missing references)
57018 //IL_00f1: Unknown result type (might be due to invalid IL or missing references)
57019 //IL_00f8: Unknown result type (might be due to invalid IL or missing references)
57020 //IL_007e: Unknown result type (might be due to invalid IL or missing references)
57021 //IL_0096: Unknown result type (might be due to invalid IL or missing references)
57022 //IL_009d: Unknown result type (might be due to invalid IL or missing references)
57023 bool canSpawn = false;
57024 int teleportStartX = 100;
57025 int teleportRangeX = Main.maxTilesX - 200;
57026 int teleportStartY = 100;
57027 int underworldLayer = Main.UnderworldLayer;
57028 Vector2 vector = CheckForGoodTeleportationSpot(ref canSpawn, teleportStartX, teleportRangeX, teleportStartY, underworldLayer, new RandomTeleportationAttemptSettings
57029 {
57030 avoidLava = true,
57031 avoidHurtTiles = true,
57032 maximumFallDistanceFromOrignalPoint = 100,
57033 attemptsBeforeGivingUp = 1000
57034 });
57035 if (canSpawn)
57036 {
57037 Vector2 newPos = vector;
57038 Teleport(newPos, 2);
57039 velocity = Vector2.Zero;
57040 if (Main.netMode == 2)
57041 {
57042 RemoteClient.CheckSection(whoAmI, position);
57043 NetMessage.SendData(65, -1, -1, null, 0, whoAmI, newPos.X, newPos.Y, 2);
57044 }
57045 }
57046 else
57047 {
57048 Vector2 newPos2 = position;
57049 Teleport(newPos2, 2);
57050 velocity = Vector2.Zero;
57051 if (Main.netMode == 2)
57052 {
57053 RemoteClient.CheckSection(whoAmI, position);
57054 NetMessage.SendData(65, -1, -1, null, 0, whoAmI, newPos2.X, newPos2.Y, 2, 1);
57055 }
57056 }
57057 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
void Teleport(Vector2 newPos, int Style=0, int extraInfo=0)
Definition Player.cs:36320
Vector2 CheckForGoodTeleportationSpot(ref bool canSpawn, int teleportStartX, int teleportRangeX, int teleportStartY, int teleportRangeY, RandomTeleportationAttemptSettings settings)
Definition Player.cs:57059

References Terraria.Player.CheckForGoodTeleportationSpot(), Terraria.RemoteClient.CheckSection(), Terraria.Main.netMode, Terraria.Entity.position, Terraria.NetMessage.SendData(), Terraria.Player.Teleport(), Terraria.Main.UnderworldLayer, Terraria.Entity.velocity, and Terraria.Entity.whoAmI.

Referenced by Terraria.Player.ItemCheck_Inner().

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