private void EquipItem(EquipableItem item)
 {
     LoadEquipmentOnSlot(item, item.slotType);
     item.equipped = true;
     modHandler.ApplyEquipmentModifiers(item);
     characterStats.SetMaxAPFromStamina();
     characterStats.SetMaxHealthFromVitality();
 }
Example #2
0
        public void Use(EquipableItem item)
        {
            if (currentInventoryObject.tag == "EquipmentSlot")
            {
                equipmentSlotManager.UnloadEquipmentOnSlot(item, item.slotType);
                equipmentSlotManager.UnloadEquipementOnEquipMenu(item, item.slotType);
                item.equipped = false;
                modHandler.RemoveAllModifiers(item);
                inventoryHandler.AddItem(item);
                characterStats.SetMaxAPFromStamina();
                characterStats.SetMaxHealthFromVitality();
            }

            else
            {
                equipmentSlotManager.LoadEquipmentOnSlot(item, item.slotType);
                equipmentSlotManager.LoadEquipementOnEquipMenu(item, item.slotType);
                item.equipped = true;
                modHandler.ApplyEquipmentModifiers(item);
                characterStats.SetMaxAPFromStamina();
                characterStats.SetMaxHealthFromVitality();
            }
            statpreview.updateStatTexts();
        }