Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ ApplyLifeAndOrMana()

void Terraria.Player.ApplyLifeAndOrMana ( Item item)
inlineprivate

Definition at line 48647 of file Player.cs.

48648 {
48649 int num = item.healLife;
48650 int healMana = item.healMana;
48651 if (item.type == 3001)
48652 {
48653 int healLife = item.healLife;
48654 int num2 = 120;
48655 num = Main.rand.Next(healLife, num2 + 1);
48656 if (Main.myPlayer == whoAmI)
48657 {
48658 float num3 = Main.rand.NextFloat();
48659 int num4 = 0;
48660 if (num3 <= 0.1f)
48661 {
48662 num4 = 240;
48663 }
48664 else if (num3 <= 0.3f)
48665 {
48666 num4 = 120;
48667 }
48668 else if (num3 <= 0.6f)
48669 {
48670 num4 = 60;
48671 }
48672 if (num4 > 0)
48673 {
48675 }
48676 }
48677 }
48678 statLife += num;
48679 statMana += healMana;
48680 if (statLife > statLifeMax2)
48681 {
48683 }
48684 if (statMana > statManaMax2)
48685 {
48687 }
48688 if (num > 0 && Main.myPlayer == whoAmI)
48689 {
48690 HealEffect(num);
48691 }
48692 if (healMana > 0)
48693 {
48694 AddBuff(94, manaSickTime);
48695 if (Main.myPlayer == whoAmI)
48696 {
48697 ManaEffect(healMana);
48698 }
48699 }
48700 }
static int manaSickTime
Definition Player.cs:749
void ManaEffect(int manaAmount)
Definition Player.cs:3837
void HealEffect(int healAmount, bool broadcast=true)
Definition Player.cs:3828
void SetImmuneTimeForAllTypes(int time)
Definition Player.cs:36009
void AddBuff(int type, int timeToAdd, bool quiet=true, bool foodHack=false)
Definition Player.cs:4441

References System.item, Terraria.Main.myPlayer, and Terraria.Main.rand.

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