| | |
| | |
|
| | | 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)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | 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
|
| | | {
|