少年修仙传客户端代码仓库
7187 子 【2.0】【开发】重置灵根点支持限时的物品 / 【2.0】【前端】重置灵根点支持限时的物品
3个文件已修改
71 ■■■■ 已修改文件
Lua/Gen/SnxxzUIReikiRootModelWrap.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Role/ReikiRootModel.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Role/ReikiRootResetWin.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Lua/Gen/SnxxzUIReikiRootModelWrap.cs
@@ -53,7 +53,6 @@
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "cacheFreePoint", _g_get_cacheFreePoint);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "maxQuality", _g_get_maxQuality);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "freeResetLevel", _g_get_freeResetLevel);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "resetCostItemId", _g_get_resetCostItemId);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "reikiRootGetWays", _g_get_reikiRootGetWays);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "isServerPrepare", _g_get_isServerPrepare);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "displayOpenAnimation", _g_get_displayOpenAnimation);
@@ -819,20 +818,6 @@
            
                Snxxz.UI.ReikiRootModel gen_to_be_invoked = (Snxxz.UI.ReikiRootModel)translator.FastGetCSObj(L, 1);
                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.freeResetLevel);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_resetCostItemId(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                Snxxz.UI.ReikiRootModel gen_to_be_invoked = (Snxxz.UI.ReikiRootModel)translator.FastGetCSObj(L, 1);
                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.resetCostItemId);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
System/Role/ReikiRootModel.cs
@@ -58,7 +58,7 @@
        public int freeResetLevel { get; private set; }
        public int resetCostItemId { get; private set; }
        public int[] resetCostItemIds { get; private set; }
        public int[] reikiRootGetWays { get; private set; }
@@ -152,7 +152,7 @@
            }
            freeResetLevel = int.Parse(funcConfig.Numerical4);
            resetCostItemId = int.Parse(funcConfig.Numerical5);
            resetCostItemIds = LitJson.JsonMapper.ToObject<int[]>(funcConfig.Numerical5);
            funcConfig = FuncConfigConfig.Get("LimitAddPoint");
            json = LitJson.JsonMapper.ToObject(funcConfig.Numerical1);
@@ -515,6 +515,20 @@
            return m_ReikiQualityMapColors.ContainsKey(quality) ? m_ReikiQualityMapColors[quality] : 1;
        }
        public int GetUnLimitTimeResetItem()
        {
            var itemId = resetCostItemIds[0];
            for (int i = 0; i < resetCostItemIds.Length; i++)
            {
                var config = ItemConfig.Get(resetCostItemIds[i]);
                if (config.ExpireTime == 0)
                {
                    return resetCostItemIds[i];
                }
            }
            return itemId;
        }
        public bool IsQualityProperty(int id, int property)
        {
            var propertys = GetReikiQualityProperties(id);
System/Role/ReikiRootResetWin.cs
@@ -73,7 +73,24 @@
            if (!freeReset)
            {
                m_Item.SetItem(model.resetCostItemId, 1);
                var count = 0;
                for (int i = 0; i < model.resetCostItemIds.Length; i++)
                {
                    var items = packModel.GetItemsById(PackType.Item, model.resetCostItemIds[i]);
                    if (items != null)
                    {
                        foreach (var item in items)
                        {
                            if (!ItemLogicUtility.Instance.IsOverdue(item.guid))
                            {
                                count++;
                            }
                        }
                    }
                }
                m_Item.SetItem(model.GetUnLimitTimeResetItem(), 1);
                m_Item.count.text = StringUtility.Contact(count >= 1 ? "<color=#35e112>" : "<color=#ff0303>", count,
                        "</color><color=#f7f7f7>/", 1, "</color>");
            }
        }
@@ -101,10 +118,25 @@
            }
            else
            {
                var count = packModel.GetItemCountByID(PackType.Item, model.resetCostItemId);
                var count = 0;
                for (int i = 0; i < model.resetCostItemIds.Length; i++)
                {
                    var items = packModel.GetItemsById(PackType.Item, model.resetCostItemIds[i]);
                    if (items != null)
                    {
                        foreach (var item in items)
                        {
                            if (!ItemLogicUtility.Instance.IsOverdue(item.guid))
                            {
                                count++;
                                break;
                            }
                        }
                    }
                }
                if (count < 1)
                {
                    ItemTipUtility.Show(model.resetCostItemId);
                    ItemTipUtility.Show(model.GetUnLimitTimeResetItem());
                    return;
                }
                SetResetFlag();