void Heal(Item item, Player player)
 {
     if (AffixItemItem.IsAccessoryEquipped(item, player))
     {
         int amount = (int)MathHelper.Clamp(player.statManaMax2 * Type1.GetValue(), 1, 9999999);
         if (amount > 0)
         {
             player.statMana += amount;
             PoMEffectHelper.HealMana(player, amount);
         }
     }
 }
Esempio n. 2
0
        public override bool PreHurt(Item item, Player player, bool pvp, bool quiet, ref float damageMultiplier, ref int hitDirection, ref bool crit, ref bool customDamage, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource)
        {
            if (AffixItemItem.IsAccessoryEquipped(item, player))
            {
                int manaAmount = (int)Math.Round(player.statManaMax2 * Type1.GetValue());
                player.statMana += manaAmount;
                PoMEffectHelper.HealMana(player, manaAmount);
                damageMultiplier += Type2.GetValue();
            }

            return(true);
        }
Esempio n. 3
0
        void ReceiveSyncHealMana(BinaryReader reader, int fromWho)
        {
            int playerID = reader.ReadByte();
            int amount   = reader.ReadInt32();

            if (Main.netMode == NetmodeID.Server)
            {
                ModPacket packet = GetPacket((byte)PacketType.SyncHealMana);
                packet.Write((byte)playerID);
                packet.Write(amount);
                packet.Send(-1, fromWho);
            }
            else
            {
                Player player = Main.player[playerID];
                PoMEffectHelper.HealMana(player, amount);
            }
        }