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

◆ MagicConch()

void Terraria.Player.MagicConch ( )
inline

Definition at line 52512 of file Player.cs.

52513 {
52514 bool flag = position.X / 16f < (float)(Main.maxTilesX / 2);
52515 bool flag2 = false;
52516 int num = 50;
52517 int num2 = 50;
52518 int num3 = WorldGen.beachDistance - num - num2;
52519 if (flag)
52520 {
52521 num3 = Main.maxTilesX - num3 - 1 - num2;
52522 }
52523 else
52524 {
52525 num3 -= num2 / 2;
52526 }
52527 _ = (float)Main.maxTilesY / 1200f;
52528 _ = (float)Main.maxTilesY / 1200f;
52529 new RandomTeleportationAttemptSettings
52530 {
52531 avoidAnyLiquid = true,
52532 avoidHurtTiles = true,
52533 attemptsBeforeGivingUp = 1000,
52534 maximumFallDistanceFromOrignalPoint = 300
52535 };
52537 int num4 = flag.ToDirectionInt();
52538 int startX = (flag ? (Main.maxTilesX - 50) : 50);
52539 flag2 = true;
52541 {
52542 flag2 = false;
52543 startX = ((!flag) ? (Main.maxTilesX - 50) : 50);
52545 {
52546 flag2 = true;
52547 }
52548 }
52549 if (flag2)
52550 {
52551 vector = landingPoint.ToWorldCoordinates(8f, 16f) - new Vector2(width / 2, height);
52552 }
52553 if (flag2)
52554 {
52556 Teleport(newPos, 5);
52558 if (Main.netMode == 2)
52559 {
52560 RemoteClient.CheckSection(whoAmI, position);
52561 NetMessage.SendData(65, -1, -1, null, 0, whoAmI, newPos.X, newPos.Y, 5);
52562 }
52563 }
52564 else
52565 {
52567 Teleport(newPos2, 5);
52569 if (Main.netMode == 2)
52570 {
52571 RemoteClient.CheckSection(whoAmI, position);
52572 NetMessage.SendData(65, -1, -1, null, 0, whoAmI, newPos2.X, newPos2.Y, 5, 1);
52573 }
52574 }
52575 }
Vector2 velocity
Definition Entity.cs:16
Vector2 position
Definition Entity.cs:14
static bool RequestMagicConchTeleportPosition(Player player, int crawlOffsetX, int startX, out Point landingPoint)
void Teleport(Vector2 newPos, int Style=0, int extraInfo=0)
Definition Player.cs:35567

References Terraria.RemoteClient.CheckSection(), Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Main.netMode, Terraria.GameContent.TeleportHelpers.RequestMagicConchTeleportPosition(), Terraria.NetMessage.SendData(), and Microsoft.Xna.Framework.Vector2.Zero.