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

◆ ItemCheck_PayMana()

bool Terraria.Player.ItemCheck_PayMana ( Item sItem,
bool canUse )
inlineprivate

Definition at line 53261 of file Player.cs.

53262 {
53263 bool flag = altFunctionUse == 2;
53264 bool flag2 = false;
53265 int num = (int)((float)sItem.mana * manaCost);
53266 if (sItem.type == 2795)
53267 {
53268 flag2 = true;
53269 }
53270 if (sItem.type == 3852 && flag)
53271 {
53272 num = (int)((float)(sItem.mana * 2) * manaCost);
53273 }
53274 if (sItem.shoot > 0 && ProjectileID.Sets.TurretFeature[sItem.shoot] && flag)
53275 {
53276 flag2 = true;
53277 }
53278 if (sItem.shoot > 0 && ProjectileID.Sets.MinionTargettingFeature[sItem.shoot] && flag)
53279 {
53280 flag2 = true;
53281 }
53282 if (sItem.type == 3006)
53283 {
53284 flag2 = true;
53285 }
53286 if (sItem.type != 3269 && !CheckMana(sItem, -1, !flag2))
53287 {
53288 canUse = false;
53289 }
53290 return canUse;
53291 }
static bool[] MinionTargettingFeature
If true for a given projectile type (F:Terraria.Projectile.type), then any item that shoots that proj...
static bool[] TurretFeature
If true for a given projectile type (F:Terraria.Projectile.type), then any item that shoots that proj...
bool CheckMana(int amount, bool pay=false, bool blockQuickMana=false)
Definition Player.cs:57696
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

References Terraria.Player.altFunctionUse, Terraria.Player.CheckMana(), Terraria.Player.manaCost, Terraria.ID.ProjectileID.Sets.MinionTargettingFeature, and Terraria.ID.ProjectileID.Sets.TurretFeature.

Referenced by Terraria.Player.ItemCheck_CheckCanUse().

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