Exemple #1
0
 public void AddInventoryItem(Item item)
 {
     if (_inventoryController.AddInventoryItem(item)) //próba dodania do inventory
     {
         _questLogController.CheckGoal(item.name);
         _lootModel.RemoveWaitingItem(item); //usuwanie z okna lootu
     }
     else if (_notification.IsFree())
     {
         _notification.ActiveOk("There is no space in your inventory.");
     }
 }
Exemple #2
0
    public void CheckGoal(string goal)
    {
        List <Quest> completedQuests = _questLogModel.AddProgressGoal(goal);// zwraca questy, które się zakończyły z tym progresem

        _questLogView.SetCompletedIcon(completedQuests);
        foreach (Quest q in completedQuests)
        {
            _playerController.AddExp(q.expReward);
            _inventoryController.AddInventoryItem(q.itemReward);
            CheckGoal(q.itemReward.name);
        }
        if (_questLogView.quest != null && _questLogView.quest.goalName == goal)
        {
            _questLogView.UpdateProgress();
        }
    }
Exemple #3
0
    public void UseItem(EquipmentSlot equipmentSlot)
    {
        Item item = equipmentSlot.GetItem();

        if (item != null)
        {
            if (_inventoryController.GetItemsCount() != _inventoryController.GetInventorySize())
            {
                item.UnEquip();
                _equipmentModel.RemoveItem(item);
                _inventoryController.AddInventoryItem(item);
            }
            else if (_notification.IsFree())
            {
                _notification.ActiveOk("There is no space in your inventory.");
            }
        }
    }