Exemple #1
0
    public bool EquipItems(GameObject ItemToSwap, GameObject EquipmentSlot_)
    {
        if (ItemToSwap.GetComponent <ItemPress>().currentItem.type == EquipmentSlot_.GetComponent <ItemPress>().currentItem.type)
        {// Same type
            ItemSelectionHandler.Weapons temp = EquipmentSlot_.GetComponent <ItemPress>().currentItem;
            EquipmentSlot_.GetComponent <ItemPress>().currentItem = ItemToSwap.GetComponent <ItemPress>().currentItem;
            ItemToSwap.GetComponent <ItemPress>().currentItem     = temp;
            string type = "";
            switch (ItemToSwap.GetComponent <ItemPress>().currentItem.type)
            {
            case ItemSelectionHandler.ItemType.Head:
            {
                type = "Head";
            }
            break;

            case ItemSelectionHandler.ItemType.Chest:
            {
                type = "Chest";
            }
            break;

            case ItemSelectionHandler.ItemType.Weapons:
            {
                type = "Weapons";
            }
            break;

            case ItemSelectionHandler.ItemType.Leggings:
            {
                type = "Leggings";
            }
            break;

            case ItemSelectionHandler.ItemType.Boots:
            {
                type = "Boots";
            }
            break;
            }

            string ItemDescription = "Weapon Stats \n" +
                                     "Attack Power (+" + ItemToSwap.GetComponent <ItemPress>().currentItem.AttPower + ")\n" +
                                     "Critical Power (+" + ItemToSwap.GetComponent <ItemPress>().currentItem.CritPower + ")\n\n" +
                                     type;
            ItemToSwap.GetComponentInChildren <TextMeshProUGUI>().text = ItemDescription;


            Equipped = true;
            return(true);
        }
        return(false);
    }
Exemple #2
0
        public Character()
        {
            for (int i = 0; i < Slots.Length; ++i)
            {
                Slots[i] = new ItemSelectionHandler.Weapons(i + 1);
            }

            //Head = new ItemSelectionHandler.Weapons((int)ItemSelectionHandler.ItemType.Head);
            //Chest = new ItemSelectionHandler.Weapons((int)ItemSelectionHandler.ItemType.Chest);
            //Weapon = new ItemSelectionHandler.Weapons((int)ItemSelectionHandler.ItemType.Weapons);
            //Leggings = new ItemSelectionHandler.Weapons((int)ItemSelectionHandler.ItemType.Leggings);
            //Boots = new ItemSelectionHandler.Weapons((int)ItemSelectionHandler.ItemType.Boots);
        }