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

◆ UpdateManaRegen()

void Terraria.Player.UpdateManaRegen ( )
inline

Definition at line 17767 of file Player.cs.

17768 {
17769 //IL_0256: Unknown result type (might be due to invalid IL or missing references)
17770 //IL_027a: Unknown result type (might be due to invalid IL or missing references)
17771 //IL_0280: Unknown result type (might be due to invalid IL or missing references)
17772 //IL_02c3: Unknown result type (might be due to invalid IL or missing references)
17773 //IL_02cd: Unknown result type (might be due to invalid IL or missing references)
17774 //IL_02d2: Unknown result type (might be due to invalid IL or missing references)
17775 if (nebulaLevelMana > 0)
17776 {
17777 int num = 6;
17779 if (nebulaManaCounter >= num)
17780 {
17782 statMana++;
17783 if (statMana >= statManaMax2)
17784 {
17786 }
17787 }
17788 }
17789 else
17790 {
17792 }
17793 if (manaRegenDelay > 0f)
17794 {
17795 manaRegenDelay -= 1f;
17798 {
17799 manaRegenDelay -= 1f;
17800 }
17802 {
17803 manaRegenDelay -= 0.05f;
17804 }
17805 }
17806 if (manaRegenBuff && manaRegenDelay > 20f)
17807 {
17808 manaRegenDelay = 20f;
17809 }
17810 if (manaRegenDelay <= 0f)
17811 {
17812 manaRegenDelay = 0f;
17815 {
17816 manaRegen += statManaMax2 / 3;
17817 }
17819 {
17820 manaRegen += statManaMax2 / 50;
17821 }
17822 float num2 = (float)statMana / (float)statManaMax2 * 0.8f + 0.2f;
17823 if (manaRegenBuff)
17824 {
17825 num2 = 1f;
17826 }
17827 manaRegen = (int)((double)((float)manaRegen * num2) * 1.15);
17828 }
17829 else
17830 {
17831 manaRegen = 0;
17832 }
17834 while (manaRegenCount >= 120)
17835 {
17836 bool flag = false;
17837 manaRegenCount -= 120;
17838 if (statMana < statManaMax2)
17839 {
17840 statMana++;
17841 flag = true;
17842 }
17843 if (statMana < statManaMax2)
17844 {
17845 continue;
17846 }
17847 if (whoAmI == Main.myPlayer && flag)
17848 {
17850 for (int i = 0; i < 5; i++)
17851 {
17852 int num3 = Dust.NewDust(position, width, height, 45, 0f, 0f, 255, default(Color), (float)Main.rand.Next(20, 26) * 0.1f);
17853 Main.dust[num3].noLight = true;
17854 Main.dust[num3].noGravity = true;
17855 Dust obj = Main.dust[num3];
17856 obj.velocity *= 0.5f;
17857 }
17858 }
17860 }
17861 }
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 ...
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
bool IsStandingStillForSpecialEffects
Definition Player.cs:3677
int statManaMax2
The maximum mana this player can have, adjusted by buffs and equipment.
Definition Player.cs:2122
int nebulaManaCounter
Definition Player.cs:1119
bool usedArcaneCrystal
Definition Player.cs:1061
int nebulaLevelMana
Definition Player.cs:1117
float manaRegenDelay
Definition Player.cs:2152
int[] grappling
Definition Player.cs:2840
float manaRegenDelayBonus
Definition Player.cs:1217
bool manaRegenBuff
Definition Player.cs:2154
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.Main.dust, Terraria.Player.grappling, Terraria.Entity.height, Terraria.Player.IsStandingStillForSpecialEffects, Terraria.Player.manaRegen, Terraria.Player.manaRegenBonus, Terraria.Player.manaRegenBuff, Terraria.Player.manaRegenCount, Terraria.Player.manaRegenDelay, Terraria.Player.manaRegenDelayBonus, Terraria.Main.myPlayer, Terraria.Player.nebulaLevelMana, Terraria.Player.nebulaManaCounter, Terraria.Dust.NewDust(), Terraria.Audio.SoundEngine.PlaySound(), Terraria.Entity.position, Terraria.Main.rand, Terraria.Player.statMana, Terraria.Player.statManaMax2, Terraria.Player.usedArcaneCrystal, Terraria.Entity.whoAmI, and Terraria.Entity.width.

Referenced by Terraria.Player.Update().

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