Esempio n. 1
0
        public bool CombineItems(Item other)
        {
            //if other is a socketable item
            if (other.type == ItemType.Material)
            {
                if (other.onConsume != null)
                {
                    if (Equipped)
                    {
                        OnUnequip();
                    }

                    bool returnval = other.onConsume.Invoke(this);
                    OnEquip();

                    return(returnval);
                }
                else if (this.Stats.Any(x => x.StatID == 3000))
                {
                    if (Equipped)
                    {
                        OnUnequip();
                    }

                    int statindex = Stats.FindIndex(x => x.StatID == 3000);
                    Stats[statindex] = StatActions.GetSocketedStat(other.Rarity, this.type, other.subtype);
                    OnEquip();
                    return(true);
                }
            }
            return(false);
        }