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

◆ FindBuffIndex()

int Terraria.Player.FindBuffIndex ( int type)
inline

Definition at line 5676 of file Player.cs.

5677 {
5678 if (buffImmune[type])
5679 {
5680 return -1;
5681 }
5682 for (int i = 0; i < maxBuffs; i++)
5683 {
5684 if (buffTime[i] >= 1 && buffType[i] == type)
5685 {
5686 return i;
5687 }
5688 }
5689 return -1;
5690 }
bool[] buffImmune
Indexed by T:Terraria.ID.BuffID. If true for a given T:Terraria.ID.BuffID, then this player cannot be...
Definition Player.cs:1699
int[] buffTime
The remaining durations in ticks of all buffs this player has active. A value of 0 means that buff ...
Definition Player.cs:1692
int[] buffType
The T:Terraria.ID.BuffIDs of all buffs this player has active. A value of 0 means that buff slot is...
Definition Player.cs:1684
static int maxBuffs
Definition Player.cs:3380

References Terraria.Player.buffImmune, Terraria.Player.buffTime, Terraria.Player.buffType, and Terraria.Player.maxBuffs.

Referenced by Terraria.Player.AdjustRemainingPotionSickness(), Terraria.Projectile.AI_111_DryadsWard(), Terraria.NPC.AI_123_Deerclops(), Terraria.Player.GetFishingConditions(), Terraria.Player.HasBuff(), Terraria.Player.Hurt(), Terraria.Player.ProcessHitAgainstNPC(), Terraria.Player.TryToPoop(), Terraria.Player.UpdateArmorSets(), Terraria.Player.UpdateBuffs(), Terraria.Player.UpdatePet(), and Terraria.Player.UpdatePetLight().

+ Here is the caller graph for this function: