Exemplo n.º 1
0
    public ItemSlot TakeItem(CollectibleItem item)
    {
        if (item == null)
        {
            return(null);
        }

        WeaponSlot weapon = WeaponsSlots.Find(lambdaExpression =>
                                              lambdaExpression.BulletType == item.ItemType);

        if (weapon != null)
        {
            AddAmmo(weapon, item.Quantity);
            return(null);
        }

        if (item.ItemType == ItemType.Nothing)
        {
            return(null);
        }

        if (item.ItemInstance == null && !item.Unequipable)
        {
            return(null);
        }

        return(AddItem(item));
    }
Exemplo n.º 2
0
    private void CheckForDifferentEquipedWeapon()
    {
        if (description.WeaponSlot != null)
        {
            var equipedWeapon = WeaponsSlots.Find(lambdaExpression =>
                                                  lambdaExpression.IsEquiped && lambdaExpression != description.WeaponSlot);

            if (equipedWeapon != null)
            {
                equipedWeapon.Equip(new Color(0.2f, 0.2f, 0.2f), false);
            }
        }
    }
Exemplo n.º 3
0
    private void CheckForSelection()
    {
        ItemSlot   itemSelected   = ItensSlots.Find(lambdaExpression => lambdaExpression.Toggle.isOn);
        WeaponSlot weaponSelected = WeaponsSlots.Find(lambdaExpression => lambdaExpression.Toggle.isOn);


        if (itemSelected != null && quickSelectionItens != null)
        {
            description.QuickItemSelectionPopUp.QuickItemSelectionList = quickSelectionItens;
            description.QuickItemSelectionPopUp.UpdateTexts();
        }

        if (itemSelected != null)
        {
            if (description.ItemSlot != null && itemSelected.Type != description.ItemSlot.Type)
            {
                description.RenderDescription();
            }
            else
            {
                description.RenderDescription(itemSelected);
            }
        }
        else if (weaponSelected != null)
        {
            if (description.WeaponSlot != null && weaponSelected.Type != description.WeaponSlot.Type)
            {
                description.RenderDescription();
            }
            else
            {
                description.RenderDescription(weaponSelected);
            }
        }
        else
        {
            description.RenderDescription();
        }
    }
Exemplo n.º 4
0
 public void CheckForCurrentWeapon()
 {
     CurrentWeapon = WeaponsSlots.Find(lambdaExpression =>
                                       lambdaExpression.IsEquiped);
 }