Esempio n. 1
0
        public static ProceduralStaff DropStaff(Mod mod, Vector2 position, Staff staffstaff, StaffGem staffgem, StaffOrnament staffornament, float dps, int enemyDef)
        {
            int             id    = Item.NewItem(position, mod.GetItem("ProceduralStaff").item.type);
            ProceduralStaff staff = (ProceduralStaff)Main.item[id].modItem;

            staff.staff    = staffstaff;
            staff.gem      = staffgem;
            staff.ornament = staffornament;
            staff.dps      = dps;
            staff.enemyDef = enemyDef;
            staff.Initialize();
            if (Main.netMode == 2)
            {
                ModPacket packet = mod.GetPacket();
                packet.Write((byte)Message.StaffInit);
                packet.Write(id);
                packet.Write(staffstaff.type);
                packet.Write(staffgem.type);
                packet.Write(staffornament.type);
                packet.Write(dps);
                packet.Write(enemyDef);
                packet.Send();
            }
            return(staff);
        }
Esempio n. 2
0
        public override ModItem Clone(Item item)
        {
            ProceduralStaff copy = (ProceduralStaff)base.Clone(item);

            copy.staff     = staff;
            copy.gem       = gem;
            copy.ornament  = ornament;
            copy.dps       = dps;
            copy.enemyDef  = enemyDef;
            copy.eleDamage = new Dictionary <ELEMENT, float>();
            foreach (ELEMENT element in Enum.GetValues(typeof(ELEMENT)))
            {
                copy.eleDamage[element] = eleDamage[element];
            }
            copy.item.SetNameOverride(item.Name);
            return(copy);
        }