示例#1
0
        void Bleed(NPC target, int hitDamage)
        {
            int     damage   = (int)MathHelper.Clamp(hitDamage * Type2.GetValue(), 1, int.MaxValue);
            int     duration = (int)MathHelper.Clamp(Type3.GetValue() * 60, 1, int.MaxValue);
            BuffNPC pomNPC   = target.GetGlobalNPC <BuffNPC>();

            pomNPC.AddPoisonBuff(target, damage, duration);
        }
示例#2
0
        void ReceiveAddPoisonBuffNPC(BinaryReader reader, int fromWho)
        {
            byte npcID        = reader.ReadByte();
            int  damage       = reader.ReadInt32();
            int  dutaionTicks = reader.ReadInt32();

            NPC     npc    = Main.npc[npcID];
            BuffNPC pomNPC = npc.GetGlobalNPC <BuffNPC>();

            pomNPC.AddPoisonBuff(npc, damage, dutaionTicks, false);

            if (Main.netMode == NetmodeID.Server)
            {
                ModPacket packet = GetPacket((byte)PacketType.AddPoisonBuffNPC);
                packet.Write(npcID);
                packet.Write(damage);
                packet.Write(dutaionTicks);
                packet.Send(-1, fromWho);
            }
        }