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

◆ QuickMana()

void Terraria.Player.QuickMana ( )
inline

Definition at line 6010 of file Player.cs.

6011 {
6012 //IL_0041: Unknown result type (might be due to invalid IL or missing references)
6013 if (cursed || CCed || dead || statMana == statManaMax2)
6014 {
6015 return;
6016 }
6017 Item item = QuickMana_GetItemToUse();
6018 if (item != null && ItemCheck_CheckCanUse(item))
6019 {
6020 SoundEngine.PlaySound(item.UseSound, position);
6021 if (item.potion)
6022 {
6023 ApplyPotionDelay(item);
6024 }
6025 ApplyLifeAndOrMana(item);
6026 if (item.consumable && ItemLoader.ConsumeItem(item, this))
6027 {
6028 item.stack--;
6029 }
6030 if (item.stack <= 0)
6031 {
6032 item.TurnToAir();
6033 }
6034 Recipe.FindRecipes();
6035 }
6036 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
static bool ConsumeItem(Item item, Player player)
If ModItem.ConsumeItem or any of the GlobalItem.ConsumeItem hooks returns false, sets consume to fals...
This serves as the central class from which item-related functions are carried out....
Definition ItemLoader.cs:26
int statManaMax2
The maximum mana this player can have, adjusted by buffs and equipment.
Definition Player.cs:2122
void ApplyPotionDelay(Item sItem)
Definition Player.cs:52671
Item QuickMana_GetItemToUse()
Definition Player.cs:6038
void ApplyLifeAndOrMana(Item item)
Definition Player.cs:52702
bool ItemCheck_CheckCanUse(Item sItem)
Definition Player.cs:52757
int statMana
The current mana of this player. Capped at F:Terraria.Player.statManaMax2. If you increase this val...
Definition Player.cs:2111
bool CCed
Checks if the player is currently "crowd controlled", meaning the player is F:Terraria....
Definition Player.cs:3716

References Terraria.Player.ApplyLifeAndOrMana(), Terraria.Player.ApplyPotionDelay(), Terraria.Player.CCed, Terraria.Item.consumable, Terraria.ModLoader.ItemLoader.ConsumeItem(), Terraria.Player.cursed, Terraria.Player.dead, Terraria.Recipe.FindRecipes(), Terraria.Player.ItemCheck_CheckCanUse(), Terraria.Audio.SoundEngine.PlaySound(), Terraria.Entity.position, Terraria.Item.potion, Terraria.Player.QuickMana_GetItemToUse(), Terraria.Item.stack, Terraria.Player.statMana, Terraria.Player.statManaMax2, Terraria.Item.TurnToAir(), and Terraria.Item.UseSound.

Referenced by Terraria.Player.CheckMana(), Terraria.Player.CheckMana(), and Terraria.Player.Update().

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