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

◆ CheckMana() [1/2]

bool Terraria.Player.CheckMana ( int amount,
bool pay = false,
bool blockQuickMana = false )
inline

Definition at line 57696 of file Player.cs.

57697 {
57698 int num = (int)((float)amount * manaCost);
57699 if (statMana >= num)
57700 {
57701 if (pay)
57702 {
57703 statMana -= num;
57704 }
57705 return true;
57706 }
57707 if (manaFlower && !blockQuickMana)
57708 {
57709 QuickMana();
57710 if (statMana >= num)
57711 {
57712 if (pay)
57713 {
57714 statMana -= num;
57715 }
57716 return true;
57717 }
57718 return false;
57719 }
57720 return false;
57721 }
void QuickMana()
Definition Player.cs:6010
float manaCost
The percent of mana actually used when mana is consumed. Cannot reduce an item's mana cost below 0.
Definition Player.cs:2032
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.manaCost, Terraria.Player.manaFlower, Terraria.Player.QuickMana(), and Terraria.Player.statMana.

Referenced by Terraria.Projectile.AI_075(), Terraria.Projectile.AI_100_Medusa(), Terraria.Projectile.AI_185_LifeDrain(), Terraria.Player.CommandForbiddenStorm(), Terraria.Player.ItemCheck_PayMana(), and Terraria.Player.QuickBuff().

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