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

◆ AddBuff_ActuallyTryToAddTheBuff()

bool Terraria.Player.AddBuff_ActuallyTryToAddTheBuff ( int type,
int time )
inlineprivate

Definition at line 5735 of file Player.cs.

5736 {
5737 int num = -1;
5738 while (num == -1)
5739 {
5740 int num2 = -1;
5741 for (int i = 0; i < maxBuffs; i++)
5742 {
5743 if (!Main.debuff[buffType[i]])
5744 {
5745 num2 = i;
5746 break;
5747 }
5748 }
5749 if (num2 == -1)
5750 {
5751 return false;
5752 }
5753 for (int j = num2; j < maxBuffs; j++)
5754 {
5755 if (buffType[j] == 0)
5756 {
5757 num = j;
5758 break;
5759 }
5760 }
5761 if (num == -1)
5762 {
5763 DelBuff(num2);
5764 }
5765 }
5766 buffType[num] = type;
5767 buffTime[num] = time;
5768 return true;
5769 }
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
void DelBuff(int b)
Removes the buff at the provided index in F:Terraria.Player.buffType and F:Terraria....
Definition Player.cs:5868

References Terraria.Player.buffTime, Terraria.Player.buffType, Terraria.Main.debuff, Terraria.Player.DelBuff(), and Terraria.Player.maxBuffs.

Referenced by Terraria.Player.AddBuff().

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