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

◆ ApplyLifeAndOrMana()

void Terraria.Player.ApplyLifeAndOrMana ( Item item)
inlineprivate

Definition at line 52702 of file Player.cs.

52703 {
52704 int num = GetHealLife(item, quickHeal: true);
52705 int healMana = GetHealMana(item, quickHeal: true);
52706 if (item.type == 3001)
52707 {
52708 int healLife = item.healLife;
52709 int num2 = 120;
52710 num = Main.rand.Next(healLife, num2 + 1);
52711 if (Main.myPlayer == whoAmI)
52712 {
52713 float num3 = Main.rand.NextFloat();
52714 int num4 = 0;
52715 if (num3 <= 0.1f)
52716 {
52717 num4 = 240;
52718 }
52719 else if (num3 <= 0.3f)
52720 {
52721 num4 = 120;
52722 }
52723 else if (num3 <= 0.6f)
52724 {
52725 num4 = 60;
52726 }
52727 if (num4 > 0)
52728 {
52730 }
52731 }
52732 }
52733 statLife += num;
52734 statMana += healMana;
52735 if (statLife > statLifeMax2)
52736 {
52738 }
52739 if (statMana > statManaMax2)
52740 {
52742 }
52743 if (num > 0 && Main.myPlayer == whoAmI)
52744 {
52745 HealEffect(num);
52746 }
52747 if (healMana > 0)
52748 {
52749 AddBuff(94, manaSickTime);
52750 if (Main.myPlayer == whoAmI)
52751 {
52752 ManaEffect(healMana);
52753 }
52754 }
52755 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
int statLifeMax2
The maximum health this player can have, adjusted by buffs and equipment.
Definition Player.cs:2092
static int manaSickTime
Definition Player.cs:1161
int statManaMax2
The maximum mana this player can have, adjusted by buffs and equipment.
Definition Player.cs:2122
void ManaEffect(int manaAmount)
Definition Player.cs:4991
int statLife
The current health of this player. Capped at F:Terraria.Player.statLifeMax2. If you increase this v...
Definition Player.cs:2102
void HealEffect(int healAmount, bool broadcast=true)
Spawns a T:Terraria.CombatText indicating the player healed healAmount life and syncs it if broadcas...
Definition Player.cs:4980
int GetHealMana(Item item, bool quickHeal=false)
Definition Player.cs:58599
void SetImmuneTimeForAllTypes(int time)
Definition Player.cs:36818
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
int GetHealLife(Item item, bool quickHeal=false)
Definition Player.cs:58587
int statMana
The current mana of this player. Capped at F:Terraria.Player.statManaMax2. If you increase this val...
Definition Player.cs:2111

References Terraria.Player.AddBuff(), Terraria.Player.GetHealLife(), Terraria.Player.GetHealMana(), Terraria.Player.HealEffect(), Terraria.Item.healLife, Terraria.Player.ManaEffect(), Terraria.Player.manaSickTime, Terraria.Main.myPlayer, Terraria.Main.rand, Terraria.Player.SetImmuneTimeForAllTypes(), Terraria.Player.statLife, Terraria.Player.statLifeMax2, Terraria.Player.statMana, Terraria.Player.statManaMax2, Terraria.Item.type, and Terraria.Entity.whoAmI.

Referenced by Terraria.Player.ItemCheck_Inner(), Terraria.Player.QuickHeal(), and Terraria.Player.QuickMana().

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