Ejemplo n.º 1
0
    public void UpdateItemDisplay()
    {
        item         = reader.GetItemData(type);
        image.sprite = item.sprite;
        text.text    = "" + num;
        switch (item.itemPrimaryType)
        {
        case ItemPrimaryType.SoulType:
            bg.color = Item.SoulColor;
            break;

        case ItemPrimaryType.Farm:
            bg.color = Item.FarmColor;
            break;

        case ItemPrimaryType.Mine:
            bg.color = Item.MineColor;
            break;

        case ItemPrimaryType.Buff:
            bg.color = Item.BuffColor;
            break;

        default:
            return;
        }
    }
Ejemplo n.º 2
0
    public void UpdateItemDisplay()
    {
        item = itemReader.GetItemData(type);
        if (item.sprite != null)
        {
            image.sprite = item.sprite;
        }

        switch (item.itemPrimaryType)
        {
        case ItemPrimaryType.SoulType:
            bg.color = Item.SoulColor;
            break;

        case ItemPrimaryType.Farm:
            bg.color = Item.FarmColor;
            break;

        case ItemPrimaryType.Mine:
            bg.color = Item.MineColor;
            break;

        case ItemPrimaryType.Buff:
            bg.color = Item.BuffColor;
            break;

        default:
            break;
        }
    }
Ejemplo n.º 3
0
        public ItemInfo(ItemReader itemReader, D2Unit item)
        {
            ItemName   = itemReader.GetFullItemName(item);
            Properties = itemReader.GetMagicalStrings(item);
            Location   = itemReader.GetItemData(item)?.BodyLoc ?? BodyLocation.None;

            // backwards compatibility with D2ID
            BaseItem = itemReader.GetGrammaticalName(itemReader.GetItemName(item), out string grammerCase);
            Quality  = QualityColor(itemReader.GetItemQuality(item));
        }
    public void UpdateItem()
    {
        name.text = itemType.ToString();

        reader = new ItemReader();
        reader.ReadFile();
        item = reader.GetItemData(itemType);

        image.sprite = item.sprite;
        type.text    = item.itemPrimaryType.ToString();
        intro.text   = item.Intro.Trim() + "\n";
        use.text     = item.Use.Trim() + "\n" + item.Access.Trim() + "\n";
    }
Ejemplo n.º 5
0
    public void UpdateItemDisplay()
    {
        if (itemReader == null)
        {
            itemReader = FindObjectOfType <GameManager>().itemReader;
        }
        item = itemReader.GetItemData(type);
        if (item.sprite != null)
        {
            image.sprite = item.sprite;
        }
        if (num < numneed)
        {
            text.text = "<color=red>" + num + "</color>/" + numneed;
        }
        else
        {
            text.text = num + "/" + numneed;
        }
        switch (item.itemPrimaryType)
        {
        case ItemPrimaryType.SoulType:
            bg.color = Item.SoulColor;
            break;

        case ItemPrimaryType.Farm:
            bg.color = Item.FarmColor;
            break;

        case ItemPrimaryType.Mine:
            bg.color = Item.MineColor;
            break;

        case ItemPrimaryType.Buff:
            bg.color = Item.BuffColor;
            break;

        default:
            return;
        }
    }
    public void OnUseBtn()
    {
        Item      useditem    = itemReader.GetItemData(currentType);
        BuffEntry currentBuff = useditem.buff;
        Monster   monster     = gameManager.gameInteraction.menu.currentMonster;

        if (currentBuff == null)
        {
            return;
        }
        if (currentBuff.counter >= 0)
        {
            monster.addBuff(currentBuff.attributeType, currentBuff.value, currentBuff.counter);
        }
        else
        {
            monster.modifyAttribute(currentBuff.attributeType, currentBuff.value);
        }
        monster.UpdateCurrentValue();
        inventory.itemManager.ConsumeItem(currentType, 1);
        UpdateInventory();
    }
Ejemplo n.º 7
0
    public void UpdateItem()
    {
        Vector2 v = new Vector2(0, size * index);

        //this.GetComponent<RectTransform>().anchoredPosition =new Vector2( v.x*UnityEngine.Screen.width,v.y*UnityEngine.Screen.height);
        this.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, v.y * UnityEngine.Screen.height);
        this.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, width * UnityEngine.Screen.height);
        this.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height * UnityEngine.Screen.height);

        item = itemReader.GetItemData(type);
        if (item.sprite != null)
        {
            image.sprite = item.sprite;
        }
        textnum.text      = (num > 0?"+":"") + num;
        textremained.text = "" + gameManager.itemManager.GetItemNum(type);

        switch (item.itemPrimaryType)
        {
        case ItemPrimaryType.SoulType:
            bg.color = Item.SoulColor;
            break;

        case ItemPrimaryType.Farm:
            bg.color = Item.FarmColor;
            break;

        case ItemPrimaryType.Mine:
            bg.color = Item.MineColor;
            break;

        case ItemPrimaryType.Buff:
            bg.color = Item.BuffColor;
            break;

        default:
            break;
        }
    }
Ejemplo n.º 8
0
 public ItemInfo(ItemReader itemReader, D2Unit item)
 {
     ItemName   = itemReader.GetFullItemName(item);
     Properties = itemReader.GetMagicalStrings(item);
     Location   = itemReader.GetItemData(item)?.BodyLoc ?? BodyLocation.None;
 }