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

◆ ApplyTouchDamage()

void Terraria.Player.ApplyTouchDamage ( int tileId,
int x,
int y )
inlineprivate

Definition at line 26834 of file Player.cs.

26835 {
26837 {
26838 AddBuff(67, 20);
26839 }
26841 {
26842 if (suffocateDelay < 5)
26843 {
26845 }
26846 else
26847 {
26848 AddBuff(68, 1);
26849 }
26850 }
26851 else
26852 {
26853 suffocateDelay = 0;
26854 }
26856 {
26857 AddBuff(30, Main.rand.Next(240, 600));
26858 }
26860 if (num > 0)
26861 {
26862 num = Main.DamageVar(num, 0f - luck);
26863 Hurt(PlayerDeathReason.ByOther(3), num, 0, pvp: false, quiet: false, Crit: false, 0);
26864 }
26866 {
26867 WorldGen.KillTile(x, y);
26868 if (Main.netMode == 1 && !Main.tile[x, y].active())
26869 {
26870 NetMessage.SendData(17, -1, -1, null, 4, x, y);
26871 }
26872 }
26873 }
static PlayerDeathReason ByOther(int type, int playerIndex=-1)
static bool[] TouchDamageDestroyTile
Definition TileID.cs:346
static bool[] TouchDamageBleeding
Applies the F:Terraria.ID.BuffID.Bleeding buff to any player touching the tile. The duration is rando...
Definition TileID.cs:361
static bool[] TouchDamageHot
Applies the F:Terraria.ID.BuffID.Burning buff to any player touching the tile without F:Terraria....
Definition TileID.cs:356
static int[] TouchDamageImmediate
Deals the provided amount of damage to any player in contact with the tile. Used by cactus,...
Definition TileID.cs:366
static bool[] Suffocate
If true, the tile will apply the F:Terraria.ID.BuffID.Suffocation buff if the player is overlapping t...
Definition TileID.cs:351
double Hurt(PlayerDeathReason damageSource, int Damage, int hitDirection, bool pvp, bool quiet, bool Crit, int cooldownCounter, bool dodgeable=true, float armorPenetration=0f)
Definition Player.cs:36998
byte suffocateDelay
Definition Player.cs:2499
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.DataStructures.PlayerDeathReason.ByOther(), Terraria.Main.DamageVar(), Terraria.Player.Hurt(), Terraria.WorldGen.KillTile(), Terraria.Player.luck, Terraria.Main.netMode, Terraria.Main.rand, Terraria.NetMessage.SendData(), Terraria.ID.TileID.Sets.Suffocate, Terraria.Player.suffocateDelay, Terraria.Main.tile, Terraria.ID.TileID.Sets.TouchDamageBleeding, Terraria.ID.TileID.Sets.TouchDamageDestroyTile, Terraria.ID.TileID.Sets.TouchDamageHot, and Terraria.ID.TileID.Sets.TouchDamageImmediate.

Referenced by Terraria.Player.Update().

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