Terraria.Player.ManaEffect C# (CSharp) Method

ManaEffect() public method

public ManaEffect ( int manaAmount ) : void
manaAmount int
return void
        public void ManaEffect(int manaAmount)
        {
            CombatText.NewText(new Microsoft.Xna.Framework.Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height), CombatText.HealMana, string.Concat((object)manaAmount), false, false);
            if (Main.netMode != 1 || this.whoAmI != Main.myPlayer)
                return;
            NetMessage.SendData(43, -1, -1, "", this.whoAmI, (float)manaAmount, 0.0f, 0.0f, 0, 0, 0);
        }

Usage Example

 /// <summary>
 /// Activates the tome skill.
 /// </summary>
 /// <param name="p">The <see cref="Player" /> that activated the skill.</param>
 /// <remarks>No NetMessages have to be sent, this method is called on all clients and the server.</remarks>
 public override void Activate(Player p)
 {
     if (p.direction == 1)
     {
         if (p.statMana > 20)
         {
             p.statLife += 20;
             p.statMana -= 20;
             p.HealEffect(20);
         }
     }
     else if (p.statLife > 20)
     {
         p.statMana += 20;
         p.statLife -= 5 ;
         p.ManaEffect(20);
     }
 }
All Usage Examples Of Terraria.Player::ManaEffect
Player