Пример #1
0
        public SysRefineVo GetRefineVo(uint uid)
        {
            PGoods      currentGoods = GetPGoodsById(uid);
            SysRefineVo sv           = BaseDataMgr.instance.GetDataById <SysRefineVo>((currentGoods.equip[0].refine));

            return(sv);
        }
Пример #2
0
        //装备等级 x  品质 y 强化等级 m 精炼等级 n 鉴定费用钻石 z = 2*x*y
        //分解数量 f = int(x/50+(y/3)^4 + m/5 + (n/2)^2.3) 继承费用 j = x ^ 2 /2 + (y+4)^4
        /// <summary>
        /// 是否可精炼
        /// </summary>
        /// <param name="uid"></param>
        /// <returns> 0 可继承 1 金币不足 2 精炼石不够</returns>
        public int IsRefine(uint uid)
        {
            SysRefineVo sv = GetRefineVo(uid);

            if (MeVo.instance.diam < sv.money)
            {
                return(1);
            }
            else if (GetRefineGoodsCount() < int.Parse(sv.goods))
            {
                return(2);
            }
            return(0);
        }
Пример #3
0
 public static float GetRefineRate(this SysRefineVo vo)
 {
     return(vo.value / 10000f);
 }
Пример #4
0
        public void LeftViewClick(uint uid)
        {
            this.uid   = uid;
            this.repos = Singleton <EquipLeftView> .Instance.Repos;
            PGoods currentGoods = Singleton <GoodsMode> .Instance.GetPGoodsById(uid);

            SysRefineVo sv = BaseDataMgr.instance.GetDataById <SysRefineVo>((uint)(currentGoods.equip[0].refine));

            if (sv != null)
            {
                costValue.text = string.Empty + sv.money;
                refineCost     = int.Parse(sv.goods);
                //refineStone.text = sv.goods;//精炼石数量
            }
            UpdateRefineCost();

            ItemManager.Instance.InitItem(equipIcon, currentGoods.goodsId, 0);
            int stren = 0;

            //if(currentGoods.equip.Count != 0)
            stren = currentGoods.equip[0].stren;
            int refine = currentGoods.equip[0].refine;

            refineLvl.text = refine + "/15";
            //equipStren.text = "+" + stren ;
            //item2.FindInChild<UILabel>("label").text = "+" + (stren + 1);
            SysEquipVo vo = BaseDataMgr.instance.GetDataById <SysEquipVo>(currentGoods.goodsId);  //先枚举强化属性显示

            equipName.text = vo.name + "  " + string.Format(ColorConst.YELLOW_FORMAT, "+" + stren);
            string[]      strenType = StringUtils.SplitVoString(vo.stren_type);
            List <string> strs      = new List <string>();

            foreach (string s in strenType)
            {
                strs.AddRange(StringUtils.GetValueListFromString(vo.GetEquipStrenType(int.Parse(s))));
            }
            //Log.info(this, Singleton<EquipMode>.Instance.GetEquipStrenType(vo, vo.stren_type) + "  " + vo.stren_type);

            for (int i = 0; i < 3; i++)
            {
                if (i < strenType.Length)
                {
                    int addValue   = int.Parse(strs[i * 2 + 1]);
                    int strenValue = int.Parse(strs[i * 2]) + addValue * stren;
                    if (sv.value == 0)
                    {
                        attrList[i].text = VoUtils.RoleAttrFormat1(int.Parse(strenType[i]), string.Empty + strenValue);
                    }
                    else
                    {
                        attrList[i].text = VoUtils.RoleAttrFormat1(int.Parse(strenType[i]), strenValue +
                                                                   string.Format(ColorConst.GREEN_FORMAT, "  +" + Mathf.RoundToInt(strenValue * sv.GetRefineRate()) + "( " + string.Format("{0:0%}", sv.GetRefineRate()) + " )"));
                    }
                }
                else
                {
                    attrList[i].text = string.Empty;
                }
            }

            for (int i = 0; i < 15; i++)
            {
                if (refine > i)
                {
                    refineStar[i].spriteName = "xingxing1";
                }
                else
                {
                    refineStar[i].spriteName = "kongxing";
                }
            }
        }