少年修仙传客户端代码仓库
hch
2024-12-19 a39a4d876bb4b688b7377a0022a8b38e7f311f4d
10340 【越南】【英文】【BT】【砍树】寻宝多抽优化
7个文件已修改
317 ■■■■■ 已修改文件
LogicProject/System/TreasurePavilion/TreasureLuckyDrawBehavior.cs 107 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LogicProject/System/TreasurePavilion/TreasurePavilionModel.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/GatheringSoul/GatherSoulXBWin.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HappyXB/HappyXBGetItemWin.cs 92 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HappyXB/HappyXBModel.cs 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Store/StoreModel.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Utility/EnumHelper.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LogicProject/System/TreasurePavilion/TreasureLuckyDrawBehavior.cs
@@ -29,6 +29,7 @@
    HappyXBModel XBModel { get { return ModelCenter.Instance.GetModel<HappyXBModel>(); } }
    RoleParticularModel model { get { return ModelCenter.Instance.GetModelEx<RoleParticularModel>(); } }
    PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
    StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
    public void Display(int type)
    {
        this.type = type;
@@ -179,49 +180,17 @@
                    int costToolCount = funcSet.costToolNums[0];
                    int xbOneMoney = TreasureSetConfig.Get(type).CostMoneyList[0];
                    if (TreasurePavilionModel.Instance.isSkipOneTip)
                    if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbOneMoney)
                    {
                        if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbOneMoney)
                        storeModel.UseMoneyCheck(xbOneMoney, () =>
                        {
                            TreasurePavilionModel.Instance.isEffectPlaying = true;
                            XBModel.SendXBQuest(type, 0, 0);
                        }
                        else
                        {
                            SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
                        }
                        }, 4, fullTip: Language.Get("TreasurePavilion08", xbOneMoney, moneyType, funcSet.costToolIds[0], costToolCount));
                    }
                    else
                    {
                        ConfirmCancel.MoneyIconToggleConfirm(
               Language.Get("L1003"),
               Language.Get("TreasurePavilion08", xbOneMoney, moneyType, funcSet.costToolIds[0], costToolCount),
               Language.Get("DefaultDialogueBoxWin_TextEnter"),
               moneyType,
               xbOneMoney,
              UIHelper.GetMoneyCnt(moneyType),
               (bool isOk, bool isToggle) =>
               {
                   TreasurePavilionModel.Instance.isSkipOneTip = isToggle;
                   if (isOk)
                   {
                       if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbOneMoney)
                       {
                           TreasurePavilionModel.Instance.isEffectPlaying = true;
                           XBModel.SendXBQuest(type, 0, 0);
                       }
                       else
                       {
                           SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
                       }
                   }
               },
                    true,
                    Language.Get("FlyShoseConfirmwin_Text2"));
                        SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
                    }
                }
            }
@@ -235,65 +204,33 @@
            var funcSet = XBModel.GetXBFuncSet(type);
            int toolCnt = 0;
            int needToolCnt = 0;
            if (XBModel.IsHaveManyXBTool(type, out toolCnt, out needToolCnt))
            int needMoney = 0;
            if (XBModel.IsHaveManyXBToolEx(type, out toolCnt, out needToolCnt, out needMoney))
            {
                if (toolCnt >= needToolCnt)
                {
                    XBModel.CheckXBManyLimit(0, type, 2);
                    return;
                }
                else
                {
                    XBModel.CheckXBManyLimit(funcSet.xbPrices[1], type, 0);
                }
            }
            TreasurePavilionModel.Instance.isEffectPlaying = false;
            int moneyType = XBModel.XBCostTypeDict[type];
            int xbManyMoney = needMoney == 0 ? funcSet.xbPrices[1] : needMoney;
            if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbManyMoney)
            {
                storeModel.UseMoneyCheck(xbManyMoney, () =>
                {
                    TreasurePavilionModel.Instance.isEffectPlaying = true;
                    XBModel.SendXBQuest(type, 1, toolCnt > 0 ? 2 : 0);
                }, 4, fullTip: Language.Get("TreasurePavilion08", xbManyMoney, moneyType, funcSet.costToolIds[1], needToolCnt - toolCnt));
            }
            else
            {
                TreasurePavilionModel.Instance.isEffectPlaying = false;
                int moneyType = XBModel.XBCostTypeDict[type];
                int costToolCount = funcSet.costToolNums[1];
                int xbManyMoney = TreasureSetConfig.Get(type).CostMoneyList[1];
                if (TreasurePavilionModel.Instance.isSkipManyTip)
                {
                    if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbManyMoney)
                    {
                        TreasurePavilionModel.Instance.isEffectPlaying = true;
                        XBModel.SendXBQuest(type, 1, 0);
                    }
                    else
                    {
                        SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
                    }
                }
                else
                {
                    ConfirmCancel.MoneyIconToggleConfirm(
       Language.Get("L1003"),
       Language.Get("TreasurePavilion08", xbManyMoney, moneyType, funcSet.costToolIds[1], costToolCount),
       Language.Get("DefaultDialogueBoxWin_TextEnter"),
       moneyType,
       xbManyMoney,
      UIHelper.GetMoneyCnt(moneyType),
       (bool isOk, bool isToggle) =>
       {
           TreasurePavilionModel.Instance.isSkipManyTip = isToggle;
           if (isOk)
           {
               if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbManyMoney)
               {
                   TreasurePavilionModel.Instance.isEffectPlaying = true;
                   XBModel.SendXBQuest(type, 1, 0);
               }
               else
               {
                   SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
               }
           }
       },
                    true,
                    Language.Get("FlyShoseConfirmwin_Text2"));
                }
                SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
            }
        });
    }
LogicProject/System/TreasurePavilion/TreasurePavilionModel.cs
@@ -27,8 +27,6 @@
    public Dictionary<int, int> gubaoItemCountDict = new Dictionary<int, int>();    //古宝碎片背包物品改为数值记录
    public event Action UpdateGubaoItemCountEvent;
    public bool isSkipOneTip = false;                                       //本次登录是否跳过一次购买二次确认窗口
    public bool isSkipManyTip = false;                                       //本次登录是否跳过多次购买二次确认窗口
    public bool isWinOpen = false;
    int getA3CBCount;          //古宝收到了几次包
    int m_SelectIndex;  //古宝总类型
System/GatheringSoul/GatherSoulXBWin.cs
@@ -180,7 +180,8 @@
            
            int toolCnt = 0;
            int needToolCnt = 0;
            if (XBModel.IsHaveManyXBTool(type, out toolCnt, out needToolCnt))
            int needMoney = 0;
            if (XBModel.IsHaveManyXBToolEx(type, out toolCnt, out needToolCnt, out needMoney))
            {
                if (toolCnt >= needToolCnt)
                {
@@ -192,15 +193,16 @@
            }
            int moneyType = XBModel.XBCostTypeDict[type];
            int xbManyMoney = TreasureSetConfig.Get(type).CostMoneyList[1];
            XBFuncSet funcSet = XBModel.GetXBFuncSet(type);
            int xbManyMoney = needMoney == 0 ? funcSet.xbPrices[1] : needMoney;
            if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbManyMoney)
            {
                storeModel.UseMoneyCheck(xbManyMoney, () =>
                {
                    TreasurePavilionModel.Instance.isEffectPlaying = true;
                    XBModel.SendXBQuest(type, 1, 0);
                }, 3);
                    XBModel.SendXBQuest(type, 1, toolCnt > 0 ? 2 : 0);
                }, 3, fullTip: Language.Get("TreasurePavilion08", xbManyMoney, moneyType, funcSet.costToolIds[1], needToolCnt - toolCnt));
            }
            else
            {
System/HappyXB/HappyXBGetItemWin.cs
@@ -350,56 +350,56 @@
        public void SendXBQuest(int xbNum)
        {
            if (!XBModel.CheckIsEmptyGrid(PackType.Treasure)) return;
            //if (!XBModel.CheckIsEmptyGrid(PackType.Treasure)) return;
            int moneyType = XBModel.XBCostTypeDict[(int)XBModel.title];
            int costType = GetCostType(xbNum);
            bool isMoneyEnough = true;
            if (xbNum == 0)
            {
                isMoneyEnough = UIHelper.GetMoneyCnt(moneyType) >= (ulong)oneMoney;
            }
            else
            {
                isMoneyEnough = UIHelper.GetMoneyCnt(moneyType) >= (ulong)manyMoney;
            }
            //int moneyType = XBModel.XBCostTypeDict[(int)XBModel.title];
            //int costType = GetCostType(xbNum);
            //bool isMoneyEnough = true;
            //if (xbNum == 0)
            //{
            //    isMoneyEnough = UIHelper.GetMoneyCnt(moneyType) >= (ulong)oneMoney;
            //}
            //else
            //{
            //    isMoneyEnough = UIHelper.GetMoneyCnt(moneyType) >= (ulong)manyMoney;
            //}
            switch(costType)
            {
                case 0:
                    if (!isMoneyEnough)
                    {
                        //WindowCenter.Instance.Open<RechargeTipWin>();
                        SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
                        return;
                    }
                    break;
                case 1:
                case 2:
            //switch(costType)
            //{
            //    case 0:
            //        if (!isMoneyEnough)
            //        {
            //            //WindowCenter.Instance.Open<RechargeTipWin>();
            //            SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
            //            return;
            //        }
            //        break;
            //    case 1:
            //    case 2:
                    break;
            }
            //        break;
            //}
            switch (XBModel.title)
            {
                case HappXBTitle.Best:
                    XBModel.SendXBQuest(1, xbNum, costType);
                    break;
                case HappXBTitle.Rune:
                    XBModel.SendXBQuest(2, xbNum, costType);
                    break;
                case HappXBTitle.Gubao1:
                case HappXBTitle.Gubao2:
                case HappXBTitle.Gubao3:
                case HappXBTitle.Gubao4:
                    int treasureID = TreasurePavilionModel.Instance.xbIDArr[TreasurePavilionModel.Instance.xbIndex];
                    int treasureType = XBGetItemConfig.Get(treasureID).TreasureType;
                    XBModel.SendXBQuest(treasureType, xbNum, costType);
                    break;
                case HappXBTitle.GatherSoul:
                    XBModel.SendXBQuest(GatheringSoulModel.xbType, xbNum, costType);
                    break;
            }
            //switch (XBModel.title)
            //{
            //    case HappXBTitle.Best:
            //        XBModel.SendXBQuest(1, xbNum, costType);
            //        break;
            //    case HappXBTitle.Rune:
            //        XBModel.SendXBQuest(2, xbNum, costType);
            //        break;
            //    case HappXBTitle.Gubao1:
            //    case HappXBTitle.Gubao2:
            //    case HappXBTitle.Gubao3:
            //    case HappXBTitle.Gubao4:
            //        int treasureID = TreasurePavilionModel.Instance.xbIDArr[TreasurePavilionModel.Instance.xbIndex];
            //        int treasureType = XBGetItemConfig.Get(treasureID).TreasureType;
            //        XBModel.SendXBQuest(treasureType, xbNum, costType);
            //        break;
            //    case HappXBTitle.GatherSoul:
            //        XBModel.SendXBQuest(GatheringSoulModel.xbType, xbNum, costType);
            //        break;
            //}
        }
        private void OnStartXB(int oneOrMany)
System/HappyXB/HappyXBModel.cs
@@ -616,25 +616,30 @@
                if (IsHaveOneXBTool(xbType))
                {
                    SendXBQuest(xbType, 0, 2);
                    return;
                }
                int moneyType = XBCostTypeDict[xbType];
                int xbOneMoney = funcSet.xbPrices[0];
                if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbOneMoney)
                {
                    m_storeModel.UseMoneyCheck(xbOneMoney, () =>
                    {
                        SendXBQuest(xbType, 0, 0);
                    }, xbType == 1 ? 5 : 6, fullTip: Language.Get("TreasurePavilion08", xbOneMoney, moneyType, funcSet.costToolIds[0], 1));
                }
                else
                {
                    int xbOneMoney = funcSet.xbPrices[0];
                    int moneyType = XBCostTypeDict[xbType];
                    if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbOneMoney)
                    {
                        SendXBQuest(xbType, 0, 0);
                    }
                    else
                    {
                        //WindowCenter.Instance.Open<RechargeTipWin>();
                        SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
                    SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
                    }
                }
            }
        }
        public void SendXBManyQuest(PackType type, int xbType)
        {
            var funcSet = GetXBFuncSet(xbType);
@@ -642,39 +647,32 @@
            {
                int toolCnt = 0;
                int needToolCnt = 0;
                if (IsHaveManyXBTool(xbType, out toolCnt, out needToolCnt))
                int needMoney = 0;
                if (IsHaveManyXBToolEx(xbType, out toolCnt, out needToolCnt,  out needMoney))
                {
                    if (toolCnt >= needToolCnt)
                    {
                        CheckXBManyLimit(0, xbType, 2);
                    }
                    else
                    {
                        CheckXBManyLimit(funcSet.xbPrices[1], xbType, 0);
                    }
                    //needToolCnt = needToolCnt - toolCnt;
                    //int needMoney = needToolCnt * funcSet.xbPrices[0];
                    //if (needMoney > 0)
                    //{
                    //    ItemConfig itemConfig = ItemConfig.Get(funcSet.costToolIds[1]);
                    //    ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("HappyXBCostTools", funcSet.costToolNums[1], itemConfig.ItemName, needMoney, needToolCnt), (bool isOk) =>
                    //    {
                    //        if (isOk)
                    //        {
                    //            CheckXBManyLimit(needMoney, xbType,0);
                    //        }
                    //        return;
                    //    });
                    //}
                    //else
                    //{
                    //    CheckXBManyLimit(0, xbType,2);
                    //}
                        return;
                    }
                }
                int moneyType = XBCostTypeDict[xbType];
                int xbManyMoney = needMoney == 0 ? funcSet.xbPrices[1] : needMoney;
                if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbManyMoney)
                {
                    m_storeModel.UseMoneyCheck(xbManyMoney, () =>
                    {
                        SendXBQuest(xbType, 1, toolCnt > 0 ? 2 : 0);
                    }, xbType == 1 ? 5:6, fullTip: Language.Get("TreasurePavilion08", xbManyMoney, moneyType, funcSet.costToolIds[1], needToolCnt - toolCnt));
                }
                else
                {
                    CheckXBManyLimit(funcSet.xbPrices[1], xbType, 0);
                    SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
                }
            }
@@ -740,6 +738,7 @@
            return false;
        }
        //needToolCnt 为配表中需要的道具数量
        public bool IsHaveManyXBTool(int type, out int toolCnt, out int needToolCnt)
        {
            toolCnt = 0;
@@ -756,6 +755,30 @@
            return false;
        }
        //needToolCnt 为配表中需要的道具数量
        // 可获得真正需要补足购买道具的金额
        public bool IsHaveManyXBToolEx(int type, out int toolCnt, out int needToolCnt, out int needMoney)
        {
            toolCnt = 0;
            needToolCnt = 0;    //配置中需要的道具数量
            needMoney = 0;  //真正需要补足购买道具的金额
            XBFuncSet funcSet = GetXBFuncSet(type);
            if (funcSet == null) return false;
            toolCnt = playerPack.GetItemCountByID(PackType.Item, funcSet.costToolIds[1]);
            needToolCnt = funcSet.costToolNums[1];
            if (toolCnt > 0)
            {
                if (toolCnt < needToolCnt)
                {
                    needMoney = funcSet.xbPrices[1] / needToolCnt * (needToolCnt - toolCnt);
                }
                return true;
            }
            return false;
        }
System/Store/StoreModel.cs
@@ -1240,7 +1240,7 @@
    //花仙玉购买的二次确认框(本次登录) 默认提示 MysticalQG104    是否花费<color=#109d06>{0}</color>仙玉进行购买?
    //type 对应枚举 BuyStoreItemCheckType 方便记忆
    public void UseMoneyCheck(int money, Action func, int type = 0, string tip = "MysticalQG104")
    public void UseMoneyCheck(int money, Action func, int type = 0, string tip = "MysticalQG104", string fullTip = "")
    {
        if (money == 0)
        {
@@ -1255,8 +1255,8 @@
            return;
        }
        ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), Language.Get(tip, money),
            Language.Get("ConfirmCancel102"), (Action<bool, bool>)((bool isOk, bool isToggle) =>
        ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), fullTip == "" ? Language.Get(tip, money) : fullTip,
            Language.Get("ConfirmCancel102"), (bool isOk, bool isToggle) =>
            {
                if (isOk)
                {
@@ -1264,7 +1264,7 @@
                    buyItemCheckDict[type] = isToggle;
                }
            }));
            });
    }
Utility/EnumHelper.cs
@@ -1895,6 +1895,9 @@
    ActGift = 1, //活动礼包
    MJXB = 2,   //秘境寻宝
    GatherSoulXB = 3,   //聚魂寻宝
    TreasurePavilion = 4,   //古宝寻宝
    BestXB = 5,   //极品寻宝
    RuneXB = 6,   //符文寻宝
}
//查询其他玩家数据 用途类型