void Heal(Item item, Player player)
 {
     if (AffixItemItem.IsAccessoryEquipped(item, player))
     {
         int amount = (int)MathHelper.Clamp(player.statLifeMax2 * Type1.GetValue(), 1, 9999999);
         if (amount > 0)
         {
             player.statLife += amount;
             PoMEffectHelper.Heal(player, amount);
         }
     }
 }
Esempio n. 2
0
        void HealPlayer(Player player)
        {
            int amount = (int)MathHelper.Clamp(player.statLifeMax2 * Type1.GetValue(), 1, 9999999);

            player.statLife += amount;
            PoMEffectHelper.Heal(player, amount);
            if (Main.netMode == NetmodeID.MultiplayerClient)
            {
                EffectPacketHandler.CSyncHeal(player.whoAmI, amount);
            }
            lastProcTime = Main.GameUpdateCount;
        }
Esempio n. 3
0
        void ReceiveSyncHeal(BinaryReader reader, int fromWho)
        {
            int playerID = reader.ReadByte();
            int amount   = reader.ReadInt32();

            if (Main.netMode == NetmodeID.Server)
            {
                ModPacket packet = GetPacket((byte)PacketType.SyncHeal);
                packet.Write((byte)playerID);
                packet.Write(amount);
                packet.Send(-1, fromWho);
            }
            else
            {
                Player player = Main.player[playerID];
                PoMEffectHelper.Heal(player, amount);
            }
        }
 void Heal(Item item, Player player)
 {
     if (AffixItemItem.IsAccessoryEquipped(item, player) && (Main.GameUpdateCount - lastProcTime) >= (int)Math.Round(Type2.GetValue() * 60))
     {
         lastProcTime = Main.GameUpdateCount;
         int amount = Type1.GetValue();
         if (amount > 0)
         {
             player.statLife += amount;
             PoMEffectHelper.Heal(player, amount);
         }
         else
         {
             player.immune = false;
             player.Hurt(PlayerDeathReason.ByPlayer(player.whoAmI), -amount, 0, false);
         }
     }
 }