|
TModLoader v1.4.4.9
TModLoader source code documentation
|
|
inline |
Gives the player the provided buff. This accounts for if the player is immune to the buff. This also accounts for adjusting the buff time for different game modes. If the player already has the buff, the re-apply logic will happen. Vanilla buff types are found in T:Terraria.ID.BuffID and modded buffs are typically retrieved using M:Terraria.ModLoader.ModContent.BuffType``1. The quiet parameter will determine if the network sync message should happen. This should only be set to false in non-deterministic situations (such as random chance) and code that only runs locally. Other situations run on all clients so the buff should automatically be applied on all clients, keeping the player buff data in sync without burdening the network. When in doubt, consult vanilla source code examples or test your code.
If applying a buff to a player other than the local player in pvp, quiet should be false and the buff must be true in F:Terraria.Main.pvpBuff to properly sync.
| type | The buff type |
| timeToAdd | The desired buff time in ticks. 60 ticks is 1 second |
| quiet | If true, the network sync message is skipped. |
| foodHack | unused |
Definition at line 5700 of file Player.cs.
References Terraria.Player.AddBuff_ActuallyTryToAddTheBuff(), Terraria.Player.AddBuff_DetermineBuffTimeToAdd(), Terraria.Player.AddBuff_RemoveOldMeleeBuffsOfMatchingType(), Terraria.Player.AddBuff_RemoveOldPetBuffsOfMatchingType(), Terraria.Player.AddBuff_TryUpdatingExistingBuffTime(), Terraria.Player.buffImmune, Terraria.Player.buffType, Terraria.Player.DelBuff(), Terraria.ID.BuffID.Sets.IsFedState, Terraria.Player.maxBuffs, Terraria.Main.netMode, Terraria.Main.pvpBuff, Terraria.NetMessage.SendData(), and Terraria.Entity.whoAmI.
Referenced by Terraria.NPC.AI_107_ImprovedWalkers(), Terraria.Projectile.AI_111_DryadsWard(), Terraria.NPC.AI_123_Deerclops(), Terraria.Player.ApplyEquipFunctional(), Terraria.Player.ApplyLifeAndOrMana(), Terraria.Player.ApplyPotionDelay(), Terraria.Player.ApplyTouchDamage(), Terraria.Player.AutoFinchStaff(), Terraria.Player.BrainOfConfusionDodge(), Terraria.NPC.CheckCatchNPC(), Terraria.Player.ConsumeSolarFlare(), Terraria.Player.FloorVisuals(), Terraria.Player.Hurt(), Terraria.Player.ItemCheck_ApplyPetBuffs(), Terraria.Player.ItemCheck_Inner(), Terraria.Player.ItemCheck_UseTeleportRod(), Terraria.Projectile.Kill(), Terraria.Player.NebulaLevelup(), Terraria.Player.OnHit_Inner(), Terraria.Player.OnHurt_Part1(), Terraria.Player.OnHurt_Part2(), Terraria.Player.OnKillNPC(), Terraria.Player.QuickBuff(), Terraria.Player.QuickHeal(), Terraria.Player.StatusFromNPC(), Terraria.Player.TileInteractionsUse(), Terraria.Player.TorchAttack(), Terraria.Player.Update(), Terraria.Player.Update_NPCCollision(), Terraria.Player.UpdateArmorSets(), Terraria.Player.UpdateBuffs(), Terraria.Player.UpdateHungerBuffs(), Terraria.Player.UpdatePet(), Terraria.Player.UpdatePetLight(), Terraria.Player.UpdateStarvingState(), and Terraria.Player.WOFTongue().
Here is the call graph for this function:
Here is the caller graph for this function: