Exemple #1
0
    override public bool BuildProperty(PropertyOperation operation)
    {
        PromoteTableItem item = GetPromoteRes();

        if (null != item)
        {
            operation.AddPro((int)PropertyTypeEnum.PropertyTypeDamage, item.value);
        }
        return(true);
    }
Exemple #2
0
    public uint GetFightValue()
    {
        uint             max_value = 0;
        PromoteTableItem item      = DataManager.PromoteTable[mPromoteLv] as PromoteTableItem;

        if (null != item)
        {
            max_value += item.score;
        }

        return(max_value + (uint)GetWeaponRes().grade);
    }
Exemple #3
0
    private void InitWeaponItemInfo()
    {
        PlayerDataModule module = ModuleManager.Instance.FindModule <PlayerDataModule>();

        if (null == module)
        {
            return;
        }
        WeaponObj mData = module.GetItemByID(uiparam.itemid, PackageType.Pack_Weapon) as WeaponObj;

        if (null == mData)
        {
            return;
        }
        WeaponTableItem item = DataManager.WeaponTable[uiparam.itemid] as WeaponTableItem;

        if (null == item)
        {
            return;
        }
        ConfigTableItem configitem = DataManager.ConfigTable[item.quality] as ConfigTableItem;

        if (null == configitem)
        {
            return;
        }
        PromoteTableItem pres = DataManager.PromoteTable[mData.GetPromoteLv() + item.upgrade] as PromoteTableItem;

        if (pres == null)
        {
            GameDebug.LogError("进阶promote.txt表格无此ID=" + mData.GetPromoteLv());
            return;
        }
        StrenTableItem stritem = DataManager.StrenTable[module.GetStrenLv()] as StrenTableItem;

        if (null == stritem)
        {
            return;
        }

        uint lv     = module.GetStrenLv();
        int  starlv = (int)(lv / STREN_STEP);

        if (starlv > 0 && (lv % STREN_STEP) == 0)
        {
            starlv -= 1;
        }
        uint showlv = lv == 0 ? 0 : (lv % STREN_STEP == 0 ? 10 : lv % STREN_STEP);

        for (uint i = 0; i < showlv; ++i)
        {
            SetIcon(mWeaponStrList[(int)i], "common:strenth (" + (starlv + 7) + ")");
        }

        for (uint i = showlv; i < STREN_STEP; ++i)
        {
            SetIcon(mWeaponStrList[(int)i], "common:starslvback");
        }

        mWeaponName.text       = "[" + configitem.value + "]" + item.name;
        mWeaponUseLv.text      = mData.GetPromoteLv() + "阶";
        mWeaponStrLv.text      = module.GetStrenLv() + "级";
        mWeaponBaseDamage.text = pres.value.ToString();
        mWeaponStrDamage.text  = stritem.value.ToString();
        mWeaponDesc.text       = item.desc;
        mWeaponAbtain.text     = item.desc0;
        mNumLb.text            = mData.GetPromoteLv().ToString();

        //SetIcon(mWeaponPic, item.picname);
    }
Exemple #4
0
    public void SetPromote(int resId)
    {
        PlayerDataModule module = ModuleManager.Instance.FindModule <PlayerDataModule>();

        if (module == null)
        {
            return;
        }

        WeaponObj wobj = module.GetItemByID(resId, PackageType.Pack_Weapon) as WeaponObj;

        if (wobj == null)
        {
            return;
        }

        int plv = (int)wobj.GetPromoteLv();
        PromoteTableItem curpres = wobj.GetPromoteRes();

        if (curpres == null)
        {
            GameDebug.LogError("资源ID为" + plv + "不存在表格promote.txt中 ");
            return;
        }

        int toLv = wobj.getProtemResId() + 1;

        PromoteTableItem nexpres = DataManager.PromoteTable[toLv] as PromoteTableItem;

        if (nexpres == null)
        {
            PopTipManager.Instance.AddNewTip(StringHelper.GetString("weapon_promote_max"));
            return;
        }

        uint   count      = module.GetItemNumByID(curpres.item0);
        string item_name  = "";
        bool   isShortage = false;

        if (count < curpres.num0)
        {
            string ons = ItemManager.Instance.getItemName(curpres.item0);
            item_name += ons;
            isShortage = true;
        }
        count = module.GetItemNumByID(curpres.item1);
        if (count < curpres.num1)
        {
            string tns = ItemManager.Instance.getItemName(curpres.item1);
            if (!"".Equals(item_name))
            {
                item_name += "、";
            }
            item_name += tns;
            isShortage = true;
        }

        if (isShortage)
        {
            PopTipManager.Instance.AddNewTip(StringHelper.GetString("item_need").Replace("?", item_name));
            return;
        }

        PackageManager pack = module.GetPackManager();

        int packpos = 0;

        foreach (KeyValuePair <int, ItemObj> value in pack.getPackDic(PackageType.Pack_Weapon))
        {
            if (null != value.Value && value.Value.GetResId() == resId)
            {
                packpos = value.Value.PackPos;
                break;
            }
        }
        SetPromoteActionParam param = new SetPromoteActionParam();

        param.WeaponResId = resId;
        param.WeaponPos   = packpos;

        Net.Instance.DoAction((int)Message.MESSAGE_ID.ID_MSG_WD_SET_PROMOTE, param);
    }