Пример #1
0
    public static List <ushort> GetAllFixedAttributrIds(this PItem data)
    {
        List <ushort> l = new List <ushort>();

        if (!data.InvalidGrowAttr() && data.growAttr.equipAttr.fixedAttrs != null)
        {
            foreach (var item in data.growAttr.equipAttr.fixedAttrs)
            {
                l.Add(item.id);
            }
        }
        return(l);
    }
Пример #2
0
    public static double GetFixedAttirbute(this PItem data, int id)
    {
        if (!data.InvalidGrowAttr() && data.growAttr.equipAttr.fixedAttrs != null)
        {
            foreach (var item in data.growAttr.equipAttr.fixedAttrs)
            {
                if (item.id == id)
                {
                    return(item.value);
                }
            }
        }

        return(0);
    }
Пример #3
0
    public override void RefreshPanel(PItem item, PItem cache)
    {
        base.RefreshPanel(item, cache);
        if (item.InvalidGrowAttr())
        {
            canClick = true;
            return;
        }

        EquipType type       = Module_Equip.GetEquipTypeByID(item.itemTypeId);
        int       level      = item.GetIntentyLevel();
        int       limitLevel = moduleEquip.GetLimitIntenLevel(type, level, true);

        m_currentLevel.text   = level.ToString();
        m_nextLimitLevel.text = limitLevel.ToString();
        if (!m_t)
        {
            canClick = true;
        }
    }
Пример #4
0
    private List <PItemAttachAttr> GetAttributePreview(PItem data)
    {
        List <PItemAttachAttr> list = new List <PItemAttachAttr>();

        if (data.GetIntentyLevel() > 0 && !data.InvalidGrowAttr())
        {
            PItemAttachAttr[] attris = data.growAttr.equipAttr.fixedAttrs;
            foreach (var attr in attris)
            {
                list.Add(attr);
            }
        }
        else
        {
            PropItemInfo info = data.GetPropItem();
            if (info && info.attributes != null)
            {
                foreach (var a in info.attributes)
                {
                    PItemAttachAttr attr = PacketObject.Create <PItemAttachAttr>();
                    attr.id    = a.id;
                    attr.value = a.value;
                    list.Add(attr);
                }
            }
        }

        var nowLevel = item.growAttr.equipAttr.level;

        if (nowLevel > 0)
        {
            var             value = moduleForging.Insoul_Info[nowLevel].attribute;
            PItemAttachAttr a     = PacketObject.Create <PItemAttachAttr>();
            a.id    = 18;
            a.value = value;
            list.Add(a);
        }
        return(list);
    }