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

◆ UpdateStarvingState()

void Terraria.Player.UpdateStarvingState ( bool withEmote)
inline

Definition at line 10136 of file Player.cs.

10137 {
10138 if (whoAmI != Main.myPlayer)
10139 {
10140 return;
10141 }
10142 bool flag = false;
10143 for (int i = 0; i < maxBuffs; i++)
10144 {
10145 if (buffTime[i] > 0 && BuffID.Sets.IsFedState[buffType[i]])
10146 {
10147 flag = true;
10148 break;
10149 }
10150 }
10151 if (!flag)
10152 {
10153 if (Main.remixWorld && Main.dontStarveWorld)
10154 {
10155 AddBuff(332, 28800);
10156 }
10157 else
10158 {
10159 AddBuff(332, 18000);
10160 }
10161 if (withEmote)
10162 {
10164 }
10165 }
10166 }
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.
static bool[] IsFedState
If true for a given T:Terraria.ID.BuffID, then that buff is related to player hunger....
Definition BuffID.cs:40
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.ID.BuffID.Sets.IsFedState, Terraria.GameContent.UI.EmoteBubble.MakeLocalPlayerEmote(), Terraria.Player.maxBuffs, Terraria.Main.myPlayer, Terraria.Main.remixWorld, and Terraria.Entity.whoAmI.

Referenced by Terraria.GameContent.DontStarveSeed.Hook_OnEnterWorld(), and Terraria.Player.UpdateBuffs().

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