Esempio n. 1
0
    /// <summary>
    /// Try combining an item with an interactive object
    /// </summary>
    /// <param name="item">Item to be combined</param>
    /// <returns>If the combination worked</returns>
    public static bool TryCombination(Item item)
    {
        if (_currentObject == null)
        {
            DialogueManager.PlayDialogue(item.Description);
            return(false);
        }

        Hide();
        // check if object have a condition that requires this item
        var isSatisfied = _currentObject.TrySatisfyCondition(item);

        if (isSatisfied)
        {
            DialogueManager.PlayDialogue(item.IfCombined);
            _currentObject.CheckConditionsSatisfied();
        }
        else
        {
            DialogueManager.PlayDialogue(item.CannotCombine);
        }

        return(isSatisfied);
    }