Example #1
0
    //==============
    //EQUIPPED ITEMS
    //==============

    public void EquipWeaponToMainHand(BaseWeapon weaponToEquip)
    {
        if (inventory.CheckForItem(weaponToEquip))
        {
            inventory.RemoveItem(weaponToEquip);
        }

        SetWeaponRange(weaponToEquip.GetWeaponRange());

        equippedWeapon = weaponToEquip;

        if (equippedWeapon.IsTwoHanded())
        {
            offHandEnabled = false;
        }
    }
Example #2
0
        private void GeHarvest(HolderObject itemHolder)
        {
            _currentState = GardenBedState.Available;
            var gardenResult = _currentItem.Item.GardenResult;

            if (_currentItem.CurrentDurability <= 1)
            {
                gardenResult = _currentItem.Item.GardenWitheredResult;
            }

            var result = new HolderObject(gardenResult.Key.GetType(), gardenResult.Value * _maxSeeds);

            if (!_gameManager.PlayerModel.Inventory.AddItem(result))
            {
                GameManager.PlacementItemsController.DropItemToGround(GameManager, result);
            }

            _inventory.RemoveItem(_currentItem);
            _currentItem = null;
            RemoveItemPrefabs();
            _itemsInitialized = false;
            _currentStage     = 0;
        }