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

◆ Teleport()

void Terraria.Player.Teleport ( Vector2 newPos,
int Style = 0,
int extraInfo = 0 )
inline

Definition at line 36320 of file Player.cs.

36321 {
36322 //IL_0094: Unknown result type (might be due to invalid IL or missing references)
36323 //IL_0099: Unknown result type (might be due to invalid IL or missing references)
36324 //IL_009b: Unknown result type (might be due to invalid IL or missing references)
36325 //IL_00a4: Unknown result type (might be due to invalid IL or missing references)
36326 //IL_00ab: Unknown result type (might be due to invalid IL or missing references)
36327 //IL_00b0: Unknown result type (might be due to invalid IL or missing references)
36328 //IL_00be: Unknown result type (might be due to invalid IL or missing references)
36329 //IL_00bf: Unknown result type (might be due to invalid IL or missing references)
36330 //IL_00cd: Unknown result type (might be due to invalid IL or missing references)
36331 //IL_00df: Unknown result type (might be due to invalid IL or missing references)
36332 //IL_0124: Unknown result type (might be due to invalid IL or missing references)
36333 //IL_0129: Unknown result type (might be due to invalid IL or missing references)
36334 //IL_0170: Unknown result type (might be due to invalid IL or missing references)
36335 //IL_0175: Unknown result type (might be due to invalid IL or missing references)
36336 //IL_0248: Unknown result type (might be due to invalid IL or missing references)
36337 //IL_024e: Unknown result type (might be due to invalid IL or missing references)
36338 //IL_0253: Unknown result type (might be due to invalid IL or missing references)
36339 //IL_0258: Unknown result type (might be due to invalid IL or missing references)
36340 //IL_025e: Unknown result type (might be due to invalid IL or missing references)
36341 //IL_0267: Unknown result type (might be due to invalid IL or missing references)
36342 try
36343 {
36346 if (Style != 10)
36347 {
36349 }
36351 if (shimmering || shimmerWet)
36352 {
36353 shimmering = false;
36354 shimmerWet = false;
36355 wet = false;
36356 ClearBuff(353);
36357 }
36358 int extraInfo2 = 0;
36359 if (Style == 4)
36360 {
36362 }
36363 if (Style == 9)
36364 {
36367 }
36368 float num = MathHelper.Clamp(1f - teleportTime * 0.99f, 0.01f, 1f);
36369 Vector2 otherPosition = position;
36370 Main.TeleportEffect(getRect(), Style, extraInfo2, num, TeleportationSide.Entry, newPos);
36371 float num2 = Vector2.Distance(position, newPos);
36373 position = newPos;
36374 if (Style == 8)
36375 {
36378 }
36379 fallStart = (int)(position.Y / 16f);
36380 if (whoAmI == Main.myPlayer)
36381 {
36382 bool flag = false;
36383 Vector2 val = new Vector2((float)Main.screenWidth, (float)Main.screenHeight);
36384 if (num2 < ((Vector2)(ref val)).Length() / 2f + 100f)
36385 {
36386 int time = 0;
36387 if (Style == 1)
36388 {
36389 time = 10;
36390 }
36391 Main.SetCameraLerp(0.1f, time);
36392 flag = true;
36393 }
36394 else
36395 {
36396 NPC.ResetNetOffsets();
36397 Main.BlackFadeIn = 255;
36398 Lighting.Clear();
36399 Main.screenLastPosition = Main.screenPosition;
36400 Main.screenPosition.X = position.X + (float)(width / 2) - (float)(Main.screenWidth / 2);
36401 Main.screenPosition.Y = position.Y + (float)(height / 2) - (float)(Main.screenHeight / 2);
36402 Main.instantBGTransitionCounter = 10;
36404 }
36405 if (num > 0.1f || !flag || Style != 0)
36406 {
36407 if (Main.mapTime < 5)
36408 {
36409 Main.mapTime = 5;
36410 }
36411 Main.maxQ = true;
36412 Main.renderNow = true;
36413 }
36414 }
36415 if (Style == 4)
36416 {
36419 portalPhysicsFlag = true;
36420 gravity = 0f;
36421 }
36424 for (int i = 0; i < 3; i++)
36425 {
36427 }
36429 Main.TeleportEffect(getRect(), Style, extraInfo2, num, TeleportationSide.Exit, otherPosition);
36430 teleportTime = 1f;
36431 teleportStyle = Style;
36432 }
36433 catch
36434 {
36435 }
36436 }
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 ...
bool wet
The Entity is currently in water. Projectile: Affects movement speed and some projectiles die when ...
Definition Entity.cs:57
Vector2 oldPosition
Definition Entity.cs:35
bool shimmerWet
Definition Entity.cs:59
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
static void UpdatePlayerPosition(Player player)
static readonly SoundStyle Item6
Definition SoundID.cs:689
int lastPortalColorIndex
Definition Player.cs:3109
int environmentBuffImmunityTimer
Definition Player.cs:1518
int lastTeleportPylonStyleUsed
Definition Player.cs:3115
int _funkytownAchievementCheckCooldown
Definition Player.cs:3153
void RemoveAllGrapplingHooks()
Definition Player.cs:31755
void ForceUpdateBiomes()
Definition Player.cs:14759
Rectangle getRect()
Definition Player.cs:41240
bool portalPhysicsFlag
Definition Player.cs:3113
void StopVanityActions(bool multiplayerBroadcast=true)
Definition Player.cs:31655
float teleportTime
Definition Player.cs:1189
void UpdateSocialShadow()
Definition Player.cs:14598
Vector2 BlehOldPositionFixer
Definition Player.cs:3586
void ResetAdvancedShadows()
Definition Player.cs:4857
void ClearBuff(int type)
Removes the provided buff type from the player and shuffles the remaining buff indexes down to fill t...
Definition Player.cs:5893

References Terraria.Player._funkytownAchievementCheckCooldown, Terraria.Player.BlehOldPositionFixer, Terraria.Lighting.Clear(), Terraria.Player.ClearBuff(), Terraria.Player.environmentBuffImmunityTimer, Terraria.Player.fallStart, Terraria.Player.ForceUpdateBiomes(), Terraria.Player.getRect(), Terraria.Player.gravity, Terraria.Entity.height, Terraria.ID.SoundID.Item6, Terraria.Player.lastPortalColorIndex, Terraria.Player.lastTeleportPylonStyleUsed, Terraria.Main.mapTime, Terraria.Main.myPlayer, Terraria.Entity.oldPosition, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Player.portalPhysicsFlag, Terraria.Entity.position, Terraria.Player.RemoveAllGrapplingHooks(), Terraria.Player.ResetAdvancedShadows(), Terraria.NPC.ResetNetOffsets(), Terraria.Main.screenHeight, Terraria.Main.screenPosition, Terraria.Main.screenWidth, Terraria.Main.SetCameraLerp(), Terraria.Player.shimmering, Terraria.Entity.shimmerWet, Terraria.Player.StopVanityActions(), Terraria.Main.TeleportEffect(), Terraria.Player.teleportStyle, Terraria.Player.teleportTime, Terraria.GameContent.PressurePlateHelper.UpdatePlayerPosition(), Terraria.Player.UpdateSocialShadow(), Terraria.Entity.wet, Terraria.Entity.whoAmI, and Terraria.Entity.width.

Referenced by Terraria.Player.DemonConch(), Terraria.Player.DoPotionOfReturnReturnToOriginalUsePosition(), Terraria.Player.DoQueenSlimeHookTeleport(), Terraria.GameContent.TeleportPylonsSystem.HandleTeleportRequest(), Terraria.Player.ItemCheck_UseTeleportRod(), Terraria.Player.MagicConch(), Terraria.Player.Shellphone_Spawn(), Terraria.Player.ShimmerUnstuck(), Terraria.Player.TeleportationPotion(), Terraria.GameContent.PortalHelper.TryGoingThroughPortals(), and Terraria.Player.UnityTeleport().

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