少年修仙传客户端代码仓库
9938 子 【BT0.1】【主干】装备升星修改 / 【BT0.1】【主干】装备升星修改 - 分解预览
1个文件已修改
43 ■■■■■ 已修改文件
System/KnapSack/Logic/EquipDevourWin.cs 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/EquipDevourWin.cs
@@ -35,6 +35,7 @@
        [SerializeField] Image getMatIcon;
        [SerializeField] Text getMatProgressText;
        [SerializeField] ButtonEx gotoShenfj;
        [SerializeField] ItemCell devItemCell;
        [SerializeField] int singleLineNum = 5;
        [SerializeField] int sumGridNum = 100;
@@ -44,6 +45,9 @@
        List<ItemModel> devourModellist;
        bool isOpen = true;
        int getMatCycle = 0;
        int devItemID;//分解装备获得的材料ID
        string devourFormula;   //分解公式
        int preViewDevItemCnt; //分解获得的材料数量
        protected override void BindController()
        {
            colorlistObj.SetActive(true);
@@ -63,7 +67,13 @@
        protected override void OnPreOpen()
        {
            getMatCycle = int.Parse(FuncConfigConfig.Get("EquipDecomposeAward").Numerical1);
            if (getMatCycle == 0)
            {
                var config = FuncConfigConfig.Get("EquipDecomposeAward");
                getMatCycle = int.Parse(config.Numerical1);
                devItemID = int.Parse(config.Numerical4);
                devourFormula = config.Numerical5;
            }
            isOpen = true;
            playerPack.selectDevourlist.Clear();
            devourModellist = playerPack.GetDevourModellist();
@@ -182,6 +192,9 @@
            devourModellist = playerPack.GetDevourModellist();
            playerPack.GetSelectDevourList();
            gridCtrl.m_Scorller.RefreshActiveCellViews();
            RefreshDecomposeAttr();
            RefreshDecomPreviewAttr();
            RefreshGeMatProgress();
        }
        private void OnRefreshColor(PackModel.EquipColorType type)
@@ -200,6 +213,9 @@
                colorlistObj.SetActive(false);
                playerPack.GetSelectDevourList();
                gridCtrl.m_Scorller.RefreshActiveCellViews();
                RefreshDecomposeAttr();
                RefreshDecomPreviewAttr();
                RefreshGeMatProgress();
            }
        }
@@ -323,6 +339,7 @@
        {
            equipAddExpPreview = 0;
            EquipDeComposeConfig deComposeConfig = EquipDeComposeConfig.Get(playerPack.decomposeLv);
            devItemCell.SetActive(false);
            if (playerPack.selectDevourlist.Count > 0)
            {
                equipAddExpPreview = GetPreviewExpByDevour();
@@ -348,6 +365,14 @@
                }
                string previewExp = StringUtility.Contact(playerPack.decomposeExp, "+", equipAddExpPreview);
                expNumText.text = StringUtility.Contact(UIHelper.AppendColor(TextColType.Green, previewExp, true), "/" + deComposeConfig.UpNeedExp);
                if (preViewDevItemCnt != 0)
                {
                    devItemCell.SetActive(true);
                    devItemCell.Init(new ItemCellModel(devItemID, false, (ulong)preViewDevItemCnt));
                    devItemCell.button.AddListener(() => {
                        ItemTipUtility.Show(devItemID);
                    });
                }
            }
            else
            {
@@ -433,9 +458,11 @@
            return count;
        }
        int GetPreviewExpByDevour()
        {
            int sumExp = 0;
            preViewDevItemCnt = 0;
            for (int i = 0; i < playerPack.selectDevourlist.Count; i++)
            {
                int curExp = 0;
@@ -451,6 +478,7 @@
                    {
                        curExp = tagPet.Exp;
                    }
                    preViewDevItemCnt += GetDogzScoreById(itemModel);
                }
                sumExp += curExp;
            }
@@ -465,5 +493,18 @@
            return sumExp;
        }
        public int GetDogzScoreById(ItemModel itemModel)
        {
            if (itemModel == null)
                return 0;
            if (itemModel.config.ItemColor < 4)
                return 0;
            Equation.Instance.Clear();
            Equation.Instance.AddKeyValue("itemColor", itemModel.config.ItemColor);
            Equation.Instance.AddKeyValue("isSuite", itemModel.config.SuiteiD == 0 ? 0 : 1);
            Equation.Instance.AddKeyValue("itemClass", itemModel.config.LV);
            return Equation.Instance.Eval<int>(devourFormula);
        }
    }
}