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

◆ UpdateHungerBuffs()

void Terraria.Player.UpdateHungerBuffs ( )
inline

Definition at line 10083 of file Player.cs.

10084 {
10085 for (int i = 0; i < maxBuffs; i++)
10086 {
10087 if (buffType[i] <= 0 || buffTime[i] <= 0)
10088 {
10089 continue;
10090 }
10091 if (buffType[i] == 332)
10092 {
10093 if (buffTime[i] <= 2 && whoAmI == Main.myPlayer)
10094 {
10095 if (Main.remixWorld && Main.dontStarveWorld)
10096 {
10097 AddBuff(333, 28800);
10098 }
10099 else
10100 {
10101 AddBuff(333, 18000);
10102 }
10104 }
10105 if (!Main.dontStarveWorld)
10106 {
10107 buffTime[i] = 0;
10108 }
10109 }
10110 else if (buffType[i] == 333)
10111 {
10112 if (buffTime[i] <= 2 && whoAmI == Main.myPlayer)
10113 {
10114 if (Main.remixWorld && Main.dontStarveWorld)
10115 {
10116 AddBuff(334, 5);
10117 }
10118 else
10119 {
10120 AddBuff(334, 5);
10121 }
10123 }
10124 if (!Main.dontStarveWorld)
10125 {
10126 buffTime[i] = 0;
10127 }
10128 }
10129 else if (buffType[i] == 334 && !Main.dontStarveWorld)
10130 {
10131 buffTime[i] = 0;
10132 }
10133 }
10134 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
static void MakeLocalPlayerEmote(int emoteId)
Send a emote from P:Terraria.Main.LocalPlayer. Should never be called on server.
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
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
static int maxBuffs
Definition Player.cs:3380

References Terraria.Player.AddBuff(), Terraria.Player.buffTime, Terraria.Player.buffType, Terraria.Main.dontStarveWorld, Terraria.GameContent.UI.EmoteBubble.MakeLocalPlayerEmote(), Terraria.Player.maxBuffs, Terraria.Main.myPlayer, Terraria.Main.remixWorld, and Terraria.Entity.whoAmI.

Referenced by Terraria.Player.TryToResetHungerToNeutral(), and Terraria.Player.UpdateBuffs().

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