Esempio n. 1
0
 public void RemoveEquipment(Equipment.Equipment equipment)
 {
     switch (equipment.EquipmentType)
     {
         case EquipmentType.Weapon:
             weapon = null;
             break;
         case EquipmentType.Armor:
             var armorType = (equipment as Armor).ArmorType;
             switch (armorType)
             {
                 case ArmorType.Body:
                     body = null;
                     pDef -= body.PhysicalDef;
                     mDef -= body.MagicalDef;
                     break;
                 case ArmorType.Boots:
                     boots = null;
                     pDef -= boots.PhysicalDef;
                     mDef -= boots.MagicalDef;
                     break;
                 case ArmorType.Gloves:
                     gloves = null;
                     pDef -= gloves.PhysicalDef;
                     mDef -= gloves.MagicalDef;
                     break;
                 case ArmorType.Helmet:
                     helmet = null;
                     pDef -= helmet.PhysicalDef;
                     mDef -= helmet.MagicalDef;
                     break;
                 case ArmorType.None:
                     break;
                 default:
                     break;
             }
             break;
         case EquipmentType.None:
             break;
         default:
             break;
     }
 }
Esempio n. 2
0
 public void Equip(ITGame.CLI.Models.Equipment.Equipment equipment)
 {
     switch (equipment.EquipmentType)
     {
         case EquipmentType.Weapon:
             weapon = equipment as Weapon;
             break;
         case EquipmentType.Armor:
             var armor = equipment as Armor;
             switch (armor.ArmorType)
             {
                 case ArmorType.Body:
                     body = armor;
                     pDef += body.PhysicalDef;
                     mDef += body.MagicalDef;
                     break;
                 case ArmorType.Boots:
                     boots = armor;
                     pDef += boots.PhysicalDef;
                     mDef += boots.MagicalDef;
                     break;
                 case ArmorType.Gloves:
                     gloves = armor;
                     pDef += gloves.PhysicalDef;
                     mDef += gloves.MagicalDef;
                     break;
                 case ArmorType.Helmet:
                     helmet = armor;
                     pDef += helmet.PhysicalDef;
                     mDef += helmet.MagicalDef;
                     break;
                 case ArmorType.None:
                     break;
                 default:
                     break;
             }
             break;
         case EquipmentType.None:
             break;
         default:
             break;
     }
 }