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

◆ AddBuff_TryUpdatingExistingBuffTime()

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

Definition at line 5812 of file Player.cs.

5813 {
5814 bool result = false;
5815 for (int i = 0; i < maxBuffs; i++)
5816 {
5817 if (buffType[i] != type)
5818 {
5819 continue;
5820 }
5821 if (!BuffLoader.ReApply(type, this, time, i))
5822 {
5823 if (type == 94)
5824 {
5825 buffTime[i] += time;
5826 if (buffTime[i] > manaSickTimeMax)
5827 {
5829 }
5830 }
5831 else if (buffTime[i] < time)
5832 {
5833 buffTime[i] = time;
5834 }
5835 }
5836 result = true;
5837 break;
5838 }
5839 return result;
5840 }
static bool ReApply(int buff, Player player, int time, int buffIndex)
This serves as the central class from which buff-related functions are supported and carried out.
Definition BuffLoader.cs:18
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
static int manaSickTimeMax
Definition Player.cs:1163

References Terraria.Player.buffTime, Terraria.Player.buffType, Terraria.Player.manaSickTimeMax, Terraria.Player.maxBuffs, and Terraria.ModLoader.BuffLoader.ReApply().

Referenced by Terraria.Player.AddBuff().

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