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

◆ ItemCheck_UseTeleportRod()

void Terraria.Player.ItemCheck_UseTeleportRod ( Item sItem)
inlineprivate

Definition at line 45210 of file Player.cs.

45211 {
45212 //IL_0050: Unknown result type (might be due to invalid IL or missing references)
45213 //IL_00d8: Unknown result type (might be due to invalid IL or missing references)
45214 //IL_00e5: Unknown result type (might be due to invalid IL or missing references)
45215 //IL_00f9: Unknown result type (might be due to invalid IL or missing references)
45216 //IL_0106: Unknown result type (might be due to invalid IL or missing references)
45217 //IL_011b: Unknown result type (might be due to invalid IL or missing references)
45218 //IL_0129: Unknown result type (might be due to invalid IL or missing references)
45219 //IL_0168: Unknown result type (might be due to invalid IL or missing references)
45220 //IL_017e: Unknown result type (might be due to invalid IL or missing references)
45221 //IL_0193: Unknown result type (might be due to invalid IL or missing references)
45222 //IL_0199: Unknown result type (might be due to invalid IL or missing references)
45223 if (Main.myPlayer != whoAmI || (sItem.type != 1326 && sItem.type != 5335) || itemAnimation <= 0 || !ItemTimeIsZero)
45224 {
45225 return;
45226 }
45228 Vector2 pointPoisition = default(Vector2);
45229 pointPoisition.X = (float)Main.mouseX + Main.screenPosition.X;
45230 if (gravDir == 1f)
45231 {
45232 pointPoisition.Y = (float)Main.mouseY + Main.screenPosition.Y - (float)height;
45233 }
45234 else
45235 {
45236 pointPoisition.Y = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY;
45237 }
45238 pointPoisition.X -= width / 2;
45240 if (!(pointPoisition.X > 50f) || !(pointPoisition.X < (float)(Main.maxTilesX * 16 - 50)) || !(pointPoisition.Y > 50f) || !(pointPoisition.Y < (float)(Main.maxTilesY * 16 - 50)))
45241 {
45242 return;
45243 }
45244 int num = (int)(pointPoisition.X / 16f);
45245 int num2 = (int)(pointPoisition.Y / 16f);
45246 if ((Main.tile[num, num2].wall == 87 && !NPC.downedPlantBoss && (Main.remixWorld || (double)num2 > Main.worldSurface)) || Collision.SolidCollision(pointPoisition, width, height))
45247 {
45248 return;
45249 }
45251 NetMessage.SendData(65, -1, -1, null, 0, whoAmI, pointPoisition.X, pointPoisition.Y, 1);
45252 if (sItem.type != 1326)
45253 {
45254 return;
45255 }
45256 if (chaosState)
45257 {
45258 statLife -= statLifeMax2 / 7;
45260 if (Main.rand.Next(2) == 0)
45261 {
45263 }
45264 if (statLife <= 0)
45265 {
45266 KillMe(damageSource, 1.0, 0);
45267 }
45268 lifeRegenCount = 0;
45269 lifeRegenTime = 0f;
45270 }
45271 AddBuff(88, 360);
45272 }
static PlayerDeathReason ByOther(int type, int playerIndex=-1)
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
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
int statLifeMax2
The maximum health this player can have, adjusted by buffs and equipment.
Definition Player.cs:2092
float lifeRegenTime
How effective this player's natural life regeneration should be. Resets whenever the player is hurt,...
Definition Player.cs:2146
bool ItemTimeIsZero
Definition Player.cs:4402
int statLife
The current health of this player. Capped at F:Terraria.Player.statLifeMax2. If you increase this v...
Definition Player.cs:2102
void KillMe(PlayerDeathReason damageSource, double dmg, int hitDirection, bool pvp=false)
Definition Player.cs:37626
void Teleport(Vector2 newPos, int Style=0, int extraInfo=0)
Definition Player.cs:36320
void LimitPointToPlayerReachableArea(ref Vector2 pointPoisition)
Definition Player.cs:45170
void ApplyItemTime(Item sItem, float multiplier=1f, bool? callUseItem=null)
Definition Player.cs:4907
int lifeRegenCount
This player's accumulated life regeneration. If this value reaches or exceeds 120,...
Definition Player.cs:2137
void AddBuff(int type, int timeToAdd, bool quiet=true, bool foodHack=false)
Gives the player the provided buff. This accounts for if the player is immune to the buff....
Definition Player.cs:5700

References Terraria.Player.AddBuff(), Terraria.Player.ApplyItemTime(), Terraria.DataStructures.PlayerDeathReason.ByOther(), Terraria.Player.chaosState, Terraria.NPC.downedPlantBoss, Terraria.Player.gravDir, Terraria.Entity.height, Terraria.Player.itemAnimation, Terraria.Player.ItemTimeIsZero, Terraria.Player.KillMe(), Terraria.Player.lifeRegenCount, Terraria.Player.lifeRegenTime, Terraria.Player.LimitPointToPlayerReachableArea(), Terraria.Player.Male, Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Main.mouseX, Terraria.Main.mouseY, Terraria.Main.myPlayer, Terraria.Main.rand, Terraria.Main.remixWorld, Terraria.Main.screenHeight, Terraria.Main.screenPosition, Terraria.NetMessage.SendData(), Terraria.Collision.SolidCollision(), Terraria.Player.statLife, Terraria.Player.statLifeMax2, Terraria.Player.Teleport(), Terraria.Main.tile, Terraria.Entity.whoAmI, Terraria.Entity.width, and Terraria.Main.worldSurface.

Referenced by Terraria.Player.ItemCheck_OwnerOnlyCode().

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