Beispiel #1
0
    public void ConfirmOperation()
    {
        if (selling)
        {
            _o.InventoryRemove(operationItem);
            RefreshLayout(sellingLayout, _o.inventorySlots, true, _o.inventory.ToArray());
        }
        else
        {
            _o.InventoryAdd(operationItem);
            for (int i = 0; i < _o.currentEvent.rewards.Length; i++)
            {
                if (_o.currentEvent.rewards[i] != operationItem)
                {
                    continue;
                }
                _o.currentEvent.rewards[i] = null;
                break;
            }
            RefreshInventory();
        }

        if (confirmationPanel != null)
        {
            confirmationPanel.SetActive(false);
        }
    }
Beispiel #2
0
    public void GetReward()
    {
        _o = Overlord._instance;

        if (_o.currentEvent == null)
        {
            _o.currentEvent = _o.GetRandomEvent(Overlord.EventTypes.TREASURE);
        }

        animate     = true;
        shake_timer = _SHAKE_TIME_;
        GetComponent <Button>().interactable = false;

        Item i = _o.currentEvent.rewards[Random.Range(0, _o.currentEvent.rewards.Length)];

        Debug.Log(i.name);

        item.GetComponent <Image>().sprite = i.artwork;
        Text t = item.transform.Find("Text").GetComponent <Text>();

        t.text = string.Format(_TREASURE_TEXT_, i.name, i.description);
        if (_o.inventorySlots <= _o.inventory.Count)
        {
            t.text += "\nYou can't carry more objects. Leaving this treasure behind drives you more insane.";
        }

        _o.InventoryAdd(i);
    }
Beispiel #3
0
    public void SelectItem(int index)
    {
        _o.InventoryAdd(items[index]);
        Manager m = FindObjectOfType <Manager>();

        if (m != null)
        {
            m.DisplayInventory();
        }

        UnityEngine.SceneManagement.SceneManager.LoadScene("Map");
    }