Exemplo n.º 1
0
        public void AddItem(EquipLocation slot, EquipableItem item)
        {
            //Add the item to a slot
            Debug.Assert(item.GetAllowedEquipLocation() == slot);

            _equippedItems[slot] = item;

            EquipmentUpdated?.Invoke();
        }
Exemplo n.º 2
0
    public void Equip(EquipmentBlueprint Item)
    {
        int SlotIndex = (int)Item.EquipSlot;

        // get equipment currently in use
        EquipmentBlueprint oldEquipment;

        // Swap new equipment with old
        if (equipmentSlot[SlotIndex] != null)
        {
            oldEquipment = equipmentSlot[SlotIndex];
            Inventory.InventoryInstance.AddToInventory(oldEquipment);
        }

        equipmentSlot[SlotIndex] = Item;

        // apply the trait values of the equipment to the player stat
        ApplyTraitsToPlayer(Item);

        if (CallEquipmentUpdated != null)
        {
            CallEquipmentUpdated.Invoke(Item, true);
        }
    }
Exemplo n.º 3
0
 public void WipeEquipment()
 {
     _equippedItems = new Dictionary <EquipLocation, EquipableItem>();
     EquipmentUpdated?.Invoke();
 }
Exemplo n.º 4
0
 public void RemoveItem(EquipLocation slot)
 {
     //Remove the item from this slot
     _equippedItems.Remove(slot);
     EquipmentUpdated?.Invoke();
 }