少年修仙传客户端代码仓库
hch
2024-12-19 a39a4d876bb4b688b7377a0022a8b38e7f311f4d
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);
            }
        });
    }